From d4b160156199bf7a059500c5a06a8dd517986e3e Mon Sep 17 00:00:00 2001 From: Lionel Bertrand Date: Fri, 30 Aug 2024 12:46:27 +0200 Subject: [PATCH 1/8] add build time --- .../(components)/createBadge/page.tsx | 51 --- .../(components)/createButton/page.tsx | 42 --- .../(components)/createDropdown/page.tsx | 47 --- .../(components)/createInput/page.tsx | 41 -- .../(components)/createLabel/page.tsx | 44 --- .../(components)/createList/page.tsx | 56 --- .../(components)/createModal/page.tsx | 60 --- .../(components)/createSelect/page.tsx | 28 -- .../(components)/createSheet/page.tsx | 28 -- .../(doc)/primitive/(components)/layout.tsx | 21 -- .../(components)/templatePrimitive.tsx | 178 --------- .../(doc)/primitive/introduction/layout.tsx | 19 - .../app/(doc)/primitive/introduction/page.tsx | 21 -- .../src/app/(doc)/primitive/layout.tsx | 27 -- .../src/app/(doc)/primitive/setup/layout.tsx | 19 - .../src/app/(doc)/primitive/setup/page.tsx | 47 --- .../src/app/(doc)/styled/plugins/page.tsx | 19 +- .../src/app/(doc)/styled/plugins/web/page.tsx | 4 +- .../styled/reference/createStyles/page.tsx | 11 +- .../src/app/(doc)/styled/setup/page.tsx | 8 +- .../ui/(components)/(input)/Radio/page.tsx | 5 +- .../ui/(components)/templatePrimitive.tsx | 7 +- apps/documentation/src/app/appshel.tsx | 36 -- apps/documentation/src/app/layout.tsx | 9 +- apps/documentation/src/app/page.tsx | 30 +- .../src/components/ChangeTheme.tsx | 2 +- .../src/components/CodeBlock.tsx | 12 +- apps/documentation/src/components/NavBar.tsx | 12 +- .../src/components/SideBarLayout.tsx | 47 +-- .../src/components/TOCLayout.tsx | 43 +-- apps/documentation/src/locales/en/common.json | 2 +- apps/documentation/src/locales/fr/common.json | 2 +- apps/expo/app.json | 3 +- apps/expo/app/(app)/_layout.tsx | 11 +- apps/expo/app/(app)/accordion.tsx | 103 ++--- apps/expo/app/(app)/button.tsx | 52 +-- apps/expo/app/(app)/checkbox.tsx | 61 +-- apps/expo/app/(app)/index.tsx | 47 ++- apps/expo/app/(app)/input.tsx | 93 ++--- apps/expo/app/(app)/radio.tsx | 61 +-- apps/expo/app/(app)/select.tsx | 89 ++--- apps/expo/app/_layout.tsx | 16 +- apps/expo/package.json | 1 + apps/expo/style.config.ts | 7 +- apps/expo/tsconfig.json | 2 +- packages/loader/src/__tests__/getAst.ts | 19 - packages/loader/src/__tests__/index.spec.ts | 97 ++--- .../loader/src/__tests__/media-query.spec.ts | 35 +- .../loader/src/__tests__/pseudoClass.spec.ts | 42 ++- .../loader/src/__tests__/variants.spec.ts | 54 --- packages/loader/src/index.ts | 215 +++++++---- packages/styled/__tests__/Registry.spec.ts | 4 +- packages/styled/__tests__/classNames.spec.ts | 57 +++ .../styled/__tests__/composeStyles.spec.ts | 29 ++ .../styled/__tests__/createStyles.spec.ts | 108 +----- .../styled/__tests__/extendsStyles.spec.ts | 140 ------- .../__tests__/plugins/pseudoClass.spec.ts | 190 +++++----- .../styled/__tests__/plugins/variants.spec.ts | 113 ------ packages/styled/__tests__/plugins/web.spec.ts | 52 --- packages/styled/__tests__/pressable.spec.ts | 31 ++ packages/styled/__tests__/rnw.spec.ts | 44 +++ packages/styled/__tests__/setTheme.spec.ts | 2 +- .../styled/src/Registry/RegistryBridge.ts | 4 +- packages/styled/src/Registry/index.ts | 15 +- packages/styled/src/classNames.ts | 37 ++ packages/styled/src/composeStyles.ts | 29 +- packages/styled/src/createMethods.ts | 168 --------- packages/styled/src/createStyles.ts | 53 ++- packages/styled/src/index.ts | 3 + .../src/plugins/PseudoClass/PseudoClass.ts | 32 +- packages/styled/src/plugins/Variants.ts | 69 ---- packages/styled/src/plugins/Web.ts | 33 -- packages/styled/src/plugins/index.ts | 6 - packages/styled/src/pressable.ts | 56 +++ packages/styled/src/rnw.ts | 34 ++ .../styled/src/setTheme/setTheme.native.ts | 13 + packages/styled/src/setTheme/setTheme.ts | 9 +- packages/styled/src/setTheme/setTheme.web.ts | 17 - packages/styled/src/types.ts | 88 ++--- packages/theme/src/dark/theme.ts | 4 +- packages/theme/src/light/theme.ts | 12 +- packages/ui/src/disclosure/Accordion.tsx | 65 ++-- packages/ui/src/disclosure/Tabs.tsx | 62 ++- packages/ui/src/display/Card.tsx | 47 +-- packages/ui/src/display/MenuList.tsx | 32 +- packages/ui/src/display/Table.tsx | 58 ++- packages/ui/src/feedback/Alert.tsx | 72 ++-- packages/ui/src/feedback/Banner.tsx | 11 +- packages/ui/src/feedback/Toast.tsx | 15 +- packages/ui/src/forms/Button.tsx | 354 ------------------ packages/ui/src/forms/Button/Button.tsx | 253 +++++++++++++ packages/ui/src/forms/Button/index.ts | 8 + packages/ui/src/forms/Button/styles.ts | 148 ++++++++ packages/ui/src/forms/Checkbox/index.tsx | 43 +-- packages/ui/src/forms/Input.tsx | 60 +-- packages/ui/src/forms/Label/Label.tsx | 27 +- packages/ui/src/forms/Label/Label.web.tsx | 23 +- packages/ui/src/forms/Label/styles.ts | 13 - packages/ui/src/forms/Label/types.ts | 17 +- packages/ui/src/forms/Radio/Radio.tsx | 98 ++--- packages/ui/src/forms/Select/ContentWeb.tsx | 21 +- packages/ui/src/forms/Select/context.ts | 4 +- packages/ui/src/forms/Select/index.tsx | 59 ++- packages/ui/src/forms/Textarea.tsx | 67 ++-- packages/ui/src/layout/Box.tsx | 27 +- packages/ui/src/layout/Divider.tsx | 41 +- packages/ui/src/other/CloseButton.tsx | 25 +- packages/ui/src/overlay/Modal/index.tsx | 55 ++- packages/ui/src/styles/form.ts | 30 +- packages/ui/src/styles/textAlign.ts | 17 + packages/ui/src/styles/typography.ts | 99 ++--- packages/ui/src/typography/Anchor.tsx | 4 +- packages/ui/src/typography/P.tsx | 12 +- packages/ui/src/typography/Text.tsx | 78 +--- packages/webpack/src/index.ts | 149 +++++--- packages/webpack/src/loader.ts | 69 ++++ pnpm-lock.yaml | 3 + 117 files changed, 2184 insertions(+), 3420 deletions(-) delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createBadge/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createButton/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createDropdown/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createInput/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createLabel/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createList/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createModal/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createSelect/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/createSheet/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/layout.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/(components)/templatePrimitive.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/introduction/layout.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/introduction/page.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/layout.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/setup/layout.tsx delete mode 100644 apps/documentation/src/app/(doc)/primitive/setup/page.tsx delete mode 100644 apps/documentation/src/app/appshel.tsx delete mode 100644 packages/loader/src/__tests__/getAst.ts delete mode 100644 packages/loader/src/__tests__/variants.spec.ts create mode 100644 packages/styled/__tests__/classNames.spec.ts create mode 100644 packages/styled/__tests__/composeStyles.spec.ts delete mode 100644 packages/styled/__tests__/extendsStyles.spec.ts delete mode 100644 packages/styled/__tests__/plugins/variants.spec.ts delete mode 100644 packages/styled/__tests__/plugins/web.spec.ts create mode 100644 packages/styled/__tests__/pressable.spec.ts create mode 100644 packages/styled/__tests__/rnw.spec.ts create mode 100644 packages/styled/src/classNames.ts delete mode 100644 packages/styled/src/createMethods.ts delete mode 100644 packages/styled/src/plugins/Variants.ts delete mode 100644 packages/styled/src/plugins/Web.ts create mode 100644 packages/styled/src/pressable.ts create mode 100644 packages/styled/src/rnw.ts create mode 100644 packages/styled/src/setTheme/setTheme.native.ts delete mode 100644 packages/styled/src/setTheme/setTheme.web.ts delete mode 100644 packages/ui/src/forms/Button.tsx create mode 100644 packages/ui/src/forms/Button/Button.tsx create mode 100644 packages/ui/src/forms/Button/index.ts create mode 100644 packages/ui/src/forms/Button/styles.ts delete mode 100644 packages/ui/src/forms/Label/styles.ts create mode 100644 packages/ui/src/styles/textAlign.ts create mode 100644 packages/webpack/src/loader.ts 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={