diff --git a/.changeset/flat-vans-stare.md b/.changeset/flat-vans-stare.md new file mode 100644 index 00000000..71e7cb2f --- /dev/null +++ b/.changeset/flat-vans-stare.md @@ -0,0 +1,10 @@ +--- +"crossed-docs": minor +"@crossed/webpack": minor +"@crossed/loader": minor +"@crossed/styled": minor +"@crossed/theme": minor +"@crossed/ui": minor +--- + +update for build time web diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index d1bed2cf..9d259777 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -1,7 +1,7 @@ on: push: tags: - - 'crossed-docs@[0-9]+.[0-9]+.[0-9]**' + - 'crossed-docs@**' permissions: contents: read diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createBadge/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createBadge/page.tsx deleted file mode 100644 index e5bcfca0..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createBadge/page.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; - -import { useTranslation } from 'react-i18next'; -import { TemplatePrimitive } from '../templatePrimitive'; - -export default function CreateBadge() { - const { t } = useTranslation(); - return ( - ReactNode', - }, - { - name: 'Text', - description: 'Text to show', - type: '(p: any) => ReactNode', - }, - ]} - return={[ - { name: 'Badge', description: 'Container of Badge component' }, - { name: 'Badge.Text', description: 'Text to show' }, - ]} - types={[]} - anatomy={` -import { createBadge } from "@crossed/primitive"; - -const Badge = createBadge({ Root, Text }) - - - - -`} - example={` -import { createBadge } from "@crossed/primitive"; - -const Badge = createBadge({ Root, Text })`} - /> - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createButton/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createButton/page.tsx deleted file mode 100644 index 1ea39bfa..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createButton/page.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; - -import { useTranslation } from 'react-i18next'; -import { TemplatePrimitive } from '../templatePrimitive'; - -export default function CreateButton() { - const { t } = useTranslation(); - return ( - - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createDropdown/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createDropdown/page.tsx deleted file mode 100644 index c7871996..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createDropdown/page.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { TemplatePrimitive } from '../templatePrimitive'; -import { useTranslation } from 'react-i18next'; - -export default function CreateDropdown() { - const { t } = useTranslation(); - return ( - - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createInput/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createInput/page.tsx deleted file mode 100644 index ece790cb..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createInput/page.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { useTranslation } from 'react-i18next'; -import { TemplatePrimitive } from '../templatePrimitive'; - -export default function CreateInput() { - const { t } = useTranslation(); - return ( - - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createLabel/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createLabel/page.tsx deleted file mode 100644 index 95b949e5..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createLabel/page.tsx +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { useTranslation } from 'react-i18next'; -import { TemplatePrimitive } from '../templatePrimitive'; - -export default function CreateLabel() { - const { t } = useTranslation(); - return ( - - - -`} - example={` -import { createLabel } from "@crossed/primitive"; - -const Input = createLabel({ - Root, - Text, -}); - -`} - /> - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createList/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createList/page.tsx deleted file mode 100644 index e621c6ee..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createList/page.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { useTranslation } from 'react-i18next'; -import { TemplatePrimitive } from '../templatePrimitive'; - -export default function CreateList() { - const { t } = useTranslation(); - return ( - - - - - - - -`} - example={` -import { createList } from "@crossed/primitive"; - -const List = createList({ - Root, - Item, - Title, - SubTitle, - Label, - Divider, -}); - -`} - /> - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createModal/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createModal/page.tsx deleted file mode 100644 index f1f7068e..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createModal/page.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { TemplatePrimitive } from '../templatePrimitive'; -import { useTranslation } from 'react-i18next'; - -export default function CreateModal() { - const { t } = useTranslation(); - return ( - - - - - - - - - - -`} - example={` -import { createModal } from "@crossed/primitive"; - -const Modal = createModal({ - Root, - Trigger, - Content, - Portal, - Overlay, - Title, - Description, -}); -`} - /> - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createSelect/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createSelect/page.tsx deleted file mode 100644 index 8e566d33..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createSelect/page.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { useTranslation } from 'react-i18next'; -import { TemplatePrimitive } from '../templatePrimitive'; - -export default function CreateSelect() { - const { t } = useTranslation(); - return ( - - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/createSheet/page.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/createSheet/page.tsx deleted file mode 100644 index 19f742ac..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/createSheet/page.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { useTranslation } from 'react-i18next'; -import { TemplatePrimitive } from '../templatePrimitive'; - -export default function CreateSheet() { - const { t } = useTranslation(); - return ( - - ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/layout.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/layout.tsx deleted file mode 100644 index 2ffb9828..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/layout.tsx +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; - -import { TOCLayout } from '@/components/TOCLayout'; -import { withDefaultProps } from '@crossed/core'; - -export default withDefaultProps(TOCLayout, { - links: [ - { title: 'Example', href: '#example' }, - { title: 'Anatomy', href: '#anatomy' }, - { title: 'Params', href: '#params' }, - { title: 'Return', href: '#return' }, - { title: 'Types', href: '#types' }, - ], -}); diff --git a/apps/documentation/src/app/(doc)/primitive/(components)/templatePrimitive.tsx b/apps/documentation/src/app/(doc)/primitive/(components)/templatePrimitive.tsx deleted file mode 100644 index ded3578c..00000000 --- a/apps/documentation/src/app/(doc)/primitive/(components)/templatePrimitive.tsx +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; - -import { CodeBlock } from '@/components/CodeBlock'; -import { - H1, - H2, - I, - P, - TBody, - THead, - Table, - Td, - Text, - Th, - Tr, - YBox, -} from '@crossed/ui'; -import { useTranslation } from 'react-i18next'; -import { ReactNode } from 'react'; -import { withDefaultProps } from '@crossed/core'; -import { TOCLayout } from '@/components/TOCLayout'; - -type TableRow = { name: string; description: string; type?: string }; - -type TemplatePrimitiveProps = { - title: ReactNode; - description?: ReactNode; - anatomy: string; - params: TableRow[]; - return: TableRow[]; - types: TableRow[]; - example: string; -}; - -export const TemplatePrimitive = ({ - title, - description, - anatomy, - params, - return: returnProps, - example, - types, -}: TemplatePrimitiveProps) => { - const { t } = useTranslation(); - return ( - -

{title}

- {description &&

{description}

} - {example && ( - <> -

{t('Example')}

- {example} - - )} - {anatomy && ( - <> -

{t('Anatomy')}

- {anatomy} - - )} -

Params

- - - - - - - - - - {params.map(({ name, description, type }, i) => { - return ( - - - - - - ); - })} - -
- {t('Name')} - - {t('Type')} - - {t('Description')} -
- {name} - - {type || '-'} - - {description} -
-

Return

- - - - - - - - - - {returnProps.map(({ name, description, type }, i) => { - return ( - - - - - - ); - })} - -
- {t('Name')} - - {t('Type')} - - {t('Description')} -
- {name} - - {type || '-'} - - {description} -
-

Types

- - - - - - - - - - {types.map(({ name, description, type }, i) => { - return ( - - - - - - ); - })} - -
- {t('Name')} - - {t('Type')} - - {t('Description')} -
- {name} - - {type || '-'} - - {description} -
-
- ); -}; - -export const Menu = withDefaultProps(TOCLayout, { - links: [ - { title: 'Anatomy', href: '#anatomy' }, - { title: 'Params', href: '#params' }, - { title: 'Return', href: '#return' }, - { title: 'Example', href: '#example' }, - ], -}); diff --git a/apps/documentation/src/app/(doc)/primitive/introduction/layout.tsx b/apps/documentation/src/app/(doc)/primitive/introduction/layout.tsx deleted file mode 100644 index 8b233ece..00000000 --- a/apps/documentation/src/app/(doc)/primitive/introduction/layout.tsx +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; - -import { TOCLayout } from '@/components/TOCLayout'; -import { withDefaultProps } from '@crossed/core'; - -export default withDefaultProps(TOCLayout, { - links: [ - { title: 'Introduction', href: '#introduction' }, - { title: 'Key Features', href: '#features' }, - { title: 'Dependencies used', href: '#dependencies' }, - ], -}); diff --git a/apps/documentation/src/app/(doc)/primitive/introduction/page.tsx b/apps/documentation/src/app/(doc)/primitive/introduction/page.tsx deleted file mode 100644 index 8f7c7229..00000000 --- a/apps/documentation/src/app/(doc)/primitive/introduction/page.tsx +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import '@/style.config'; -import { H1, P, YBox, Kbd } from '@crossed/ui'; - -export default function Home() { - return ( - -

Introduction

-

- @crossed/style permet de créer des primitives -

-
- ); -} diff --git a/apps/documentation/src/app/(doc)/primitive/layout.tsx b/apps/documentation/src/app/(doc)/primitive/layout.tsx deleted file mode 100644 index 01e8f2f7..00000000 --- a/apps/documentation/src/app/(doc)/primitive/layout.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { SideBarLayout } from '@/components/SideBarLayout'; -import { withDefaultProps } from '@crossed/core'; - -export default withDefaultProps(SideBarLayout, { - menus: [ - { href: '/primitive/introduction', title: 'Introduction' }, - { href: '/primitive/setup', title: 'Setup' }, - { title: 'Components' }, - { href: '/primitive/createBadge', title: 'createBadge' }, - { href: '/primitive/createButton', title: 'createButton' }, - { href: '/primitive/createDropdown', title: 'createDropdown' }, - { href: '/primitive/createInput', title: 'createInput' }, - { href: '/primitive/createLabel', title: 'createLabel' }, - { href: '/primitive/createList', title: 'createList' }, - { href: '/primitive/createModal', title: 'createModal' }, - { href: '/primitive/createSelect', title: 'createSelect' }, - { href: '/primitive/createSheet', title: 'createSheet' }, - ], -}); diff --git a/apps/documentation/src/app/(doc)/primitive/setup/layout.tsx b/apps/documentation/src/app/(doc)/primitive/setup/layout.tsx deleted file mode 100644 index 8b233ece..00000000 --- a/apps/documentation/src/app/(doc)/primitive/setup/layout.tsx +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; - -import { TOCLayout } from '@/components/TOCLayout'; -import { withDefaultProps } from '@crossed/core'; - -export default withDefaultProps(TOCLayout, { - links: [ - { title: 'Introduction', href: '#introduction' }, - { title: 'Key Features', href: '#features' }, - { title: 'Dependencies used', href: '#dependencies' }, - ], -}); diff --git a/apps/documentation/src/app/(doc)/primitive/setup/page.tsx b/apps/documentation/src/app/(doc)/primitive/setup/page.tsx deleted file mode 100644 index bc755208..00000000 --- a/apps/documentation/src/app/(doc)/primitive/setup/page.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; -import { CodeBlock } from '@/components/CodeBlock'; -import { H1, H2, YBox, Tabs } from '@crossed/ui'; -import { useTranslation } from 'react-i18next'; - -export default function Home() { - const { t } = useTranslation(); - return ( - -

Setup

- -

{t('Install dependencies')}

- - - - pnpm - - - npm - - - yarn - - - - - pnpm i @crossed/primitive - - - npm i @crossed/primitive - - - yarn add @crossed/primitive - - - -
-
- ); -} diff --git a/apps/documentation/src/app/(doc)/styled/plugins/page.tsx b/apps/documentation/src/app/(doc)/styled/plugins/page.tsx index 34b5a54c..d8ddb2bb 100644 --- a/apps/documentation/src/app/(doc)/styled/plugins/page.tsx +++ b/apps/documentation/src/app/(doc)/styled/plugins/page.tsx @@ -23,6 +23,7 @@ import { Td, Th, Card, + fontColorStyles, } from '@crossed/ui'; import { useTranslation } from 'react-i18next'; @@ -99,10 +100,10 @@ apply(params: { - -
+ {t('Name')} + {t('Type')} @@ -116,7 +117,7 @@ apply(params: { key - string + string Key detected @@ -127,7 +128,7 @@ apply(params: { styles - any + any style correspond of test key @@ -138,7 +139,7 @@ apply(params: { isWeb - boolean + boolean isWeb is true when plugin loaded by @crossed/loader @@ -149,7 +150,7 @@ apply(params: { props - any | undefined + any | undefined props of component, undefined at buildtime if pass @@ -160,7 +161,7 @@ apply(params: { addClassname - Function + Function @@ -183,10 +184,10 @@ addClassname(params: { - -
+ {t('Name')} + {t('Required')} diff --git a/apps/documentation/src/app/(doc)/styled/plugins/web/page.tsx b/apps/documentation/src/app/(doc)/styled/plugins/web/page.tsx index d0f28497..64a2d1da 100644 --- a/apps/documentation/src/app/(doc)/styled/plugins/web/page.tsx +++ b/apps/documentation/src/app/(doc)/styled/plugins/web/page.tsx @@ -7,13 +7,13 @@ 'use client'; import '@/style.config'; -import { H1, YBox, Text } from '@crossed/ui'; +import { H1, YBox, Text, fontColorStyles } from '@crossed/ui'; export default function PluginsPage() { return (

Web

- {'// comming soon'} + {'// comming soon'}
); } diff --git a/apps/documentation/src/app/(doc)/styled/reference/createStyles/page.tsx b/apps/documentation/src/app/(doc)/styled/reference/createStyles/page.tsx index 6f7490d6..06a74ef3 100644 --- a/apps/documentation/src/app/(doc)/styled/reference/createStyles/page.tsx +++ b/apps/documentation/src/app/(doc)/styled/reference/createStyles/page.tsx @@ -21,6 +21,7 @@ import { Th, Tr, YBox, + fontColorStyles, } from '@crossed/ui'; import Link from 'next/link'; import { useTranslation } from 'react-i18next'; @@ -82,7 +83,7 @@ export type StylesParams = ExtractForProps; styles
- + {`(theme: Themes[keyof Themes]) => Record`} @@ -131,7 +132,7 @@ text.className() style - + {`(e: Params) => { style: | CSSProperties @@ -150,7 +151,7 @@ text.className() rnw - + {`(e: Params) => { style: | ViewStyle @@ -173,7 +174,9 @@ text.className() className - {'(e: Params) => { className: string }'} + + {'(e: Params) => { className: string }'} + get className for web diff --git a/apps/documentation/src/app/(doc)/styled/setup/page.tsx b/apps/documentation/src/app/(doc)/styled/setup/page.tsx index c5916bc3..86425811 100644 --- a/apps/documentation/src/app/(doc)/styled/setup/page.tsx +++ b/apps/documentation/src/app/(doc)/styled/setup/page.tsx @@ -13,7 +13,7 @@ import { CodeBlock } from '@/components/CodeBlock'; import { H2, P, createTabs, YBox } from '@crossed/ui'; import { useTranslation } from 'react-i18next'; import { useState } from 'react'; -import { createStyles } from '@crossed/styled'; +import { composeStyles, createStyles, isWeb } from '@crossed/styled'; const Description = withDefaultProps(Text, { size: 'md', @@ -25,7 +25,7 @@ const BuilderTabs = createTabs(); const styles = createStyles(() => ({ selectTrigger: { - web: { base: { maxWidth: '150px', justifyContent: 'space-between' } }, + base: { maxWidth: '150px', justifyContent: 'space-between' }, }, })); @@ -48,7 +48,9 @@ export default function Home() { - {type || '-'} + {type || '-'} {description} @@ -157,7 +158,7 @@ export const TemplatePrimitive = ({ {name} - {type || '-'} + {type || '-'} {description} @@ -194,7 +195,7 @@ export const TemplatePrimitive = ({ {name} - {type || '-'} + {type || '-'} {description} diff --git a/apps/documentation/src/app/appshel.tsx b/apps/documentation/src/app/appshel.tsx deleted file mode 100644 index af5762e2..00000000 --- a/apps/documentation/src/app/appshel.tsx +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) Paymium. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root of this projects source tree. - */ - -'use client'; - -import { Footer } from '@/components/Footer'; -import { NavBar } from '@/components/NavBar'; -import { createStyles } from '@crossed/styled'; -import { FlatList } from 'react-native'; - -const styleSheet = createStyles(() => ({ - root: { base: { minHeight: '100%' } }, - container: { - base: { - // backgroundColor: t.colors.neutral['100'], - minHeight: '100%', - // display: 'flex', - }, - }, -})); - -export const AppShell = ({ children }) => ( - } - ListFooterComponent={