@cdx-ui/components 0.0.1-beta.6 → 0.0.1-beta.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -18
- package/lib/commonjs/components/AlertDialog/index.js +5 -4
- package/lib/commonjs/components/AlertDialog/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/index.js +1 -1
- package/lib/commonjs/components/Avatar/styles.js +36 -29
- package/lib/commonjs/components/Avatar/styles.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +16 -1
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +85 -26
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/CLAUDE.md +90 -0
- package/lib/commonjs/components/Card/index.js +22 -4
- package/lib/commonjs/components/Card/index.js.map +1 -1
- package/lib/commonjs/components/Card/styles.js +27 -4
- package/lib/commonjs/components/Card/styles.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js +5 -29
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +41 -47
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +78 -9
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/Chip/styles.js +207 -21
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/components/Dialog/index.js +71 -16
- package/lib/commonjs/components/Dialog/index.js.map +1 -1
- package/lib/commonjs/components/Dialog/styles.js +60 -14
- package/lib/commonjs/components/Dialog/styles.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +8 -2
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Field/styles.js +4 -4
- package/lib/commonjs/components/Field/styles.js.map +1 -1
- package/lib/commonjs/components/Heading/styles.js +1 -1
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +3 -4
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +6 -1
- package/lib/commonjs/components/IconButton/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/styles.js +135 -10
- package/lib/commonjs/components/IconButton/styles.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +7 -6
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +22 -3
- package/lib/commonjs/components/Link/index.js.map +1 -1
- package/lib/commonjs/components/Link/styles.js +56 -6
- package/lib/commonjs/components/Link/styles.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js +3 -25
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +29 -57
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/components/ProgressSegmented/index.js +24 -10
- package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js +167 -0
- package/lib/commonjs/components/Radio/index.js.map +1 -0
- package/lib/commonjs/components/Radio/styles.js +31 -0
- package/lib/commonjs/components/Radio/styles.js.map +1 -0
- package/lib/commonjs/components/ScopedTheme/index.js +24 -0
- package/lib/commonjs/components/ScopedTheme/index.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +4 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +9 -3
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +17 -20
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +2 -2
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/components/Tile/index.js +251 -0
- package/lib/commonjs/components/Tile/index.js.map +1 -0
- package/lib/commonjs/components/Tile/styles.js +52 -0
- package/lib/commonjs/components/Tile/styles.js.map +1 -0
- package/lib/commonjs/components/index.js +36 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/AlertDialog.Description.figma.js +20 -0
- package/lib/commonjs/figma/AlertDialog.Description.figma.js.map +1 -0
- package/lib/commonjs/figma/AlertDialog.Footer.figma.js +41 -0
- package/lib/commonjs/figma/AlertDialog.Footer.figma.js.map +1 -0
- package/lib/commonjs/figma/AlertDialog.Header.figma.js +28 -0
- package/lib/commonjs/figma/AlertDialog.Header.figma.js.map +1 -0
- package/lib/commonjs/figma/AlertDialog.Text.figma.js +20 -0
- package/lib/commonjs/figma/AlertDialog.Text.figma.js.map +1 -0
- package/lib/commonjs/figma/AlertDialog.Title.figma.js +27 -0
- package/lib/commonjs/figma/AlertDialog.Title.figma.js.map +1 -0
- package/lib/commonjs/figma/AlertDialog.figma.js +43 -0
- package/lib/commonjs/figma/AlertDialog.figma.js.map +1 -0
- package/lib/commonjs/figma/Avatar.figma.js +57 -0
- package/lib/commonjs/figma/Avatar.figma.js.map +1 -0
- package/lib/commonjs/figma/Button.figma.js +28 -15
- package/lib/commonjs/figma/Button.figma.js.map +1 -1
- package/lib/commonjs/figma/CLAUDE.md +30 -0
- package/lib/commonjs/figma/Card.Header.figma.js +28 -0
- package/lib/commonjs/figma/Card.Header.figma.js.map +1 -0
- package/lib/commonjs/figma/Card.figma.js +42 -0
- package/lib/commonjs/figma/Card.figma.js.map +1 -0
- package/lib/commonjs/figma/Checkbox.figma.js +55 -0
- package/lib/commonjs/figma/Checkbox.figma.js.map +1 -0
- package/lib/commonjs/figma/Chip.figma.js +68 -0
- package/lib/commonjs/figma/Chip.figma.js.map +1 -0
- package/lib/commonjs/figma/Dialog.Description.figma.js +20 -0
- package/lib/commonjs/figma/Dialog.Description.figma.js.map +1 -0
- package/lib/commonjs/figma/Dialog.Footer.figma.js +30 -0
- package/lib/commonjs/figma/Dialog.Footer.figma.js.map +1 -0
- package/lib/commonjs/figma/Dialog.Header.figma.js +29 -0
- package/lib/commonjs/figma/Dialog.Header.figma.js.map +1 -0
- package/lib/commonjs/figma/Dialog.Text.figma.js +20 -0
- package/lib/commonjs/figma/Dialog.Text.figma.js.map +1 -0
- package/lib/commonjs/figma/Dialog.Title.figma.js +27 -0
- package/lib/commonjs/figma/Dialog.Title.figma.js.map +1 -0
- package/lib/commonjs/figma/Dialog.figma.js +51 -0
- package/lib/commonjs/figma/Dialog.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Input.figma.js +57 -0
- package/lib/commonjs/figma/Field.Input.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Select.figma.js +57 -0
- package/lib/commonjs/figma/Field.Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Heading.figma.js +30 -0
- package/lib/commonjs/figma/Heading.figma.js.map +1 -0
- package/lib/commonjs/figma/Icon.figma.js +20 -0
- package/lib/commonjs/figma/Icon.figma.js.map +1 -0
- package/lib/commonjs/figma/IconButton.figma.js +47 -0
- package/lib/commonjs/figma/IconButton.figma.js.map +1 -0
- package/lib/commonjs/figma/Input.figma.js +52 -0
- package/lib/commonjs/figma/Input.figma.js.map +1 -0
- package/lib/commonjs/figma/Link.figma.js +30 -0
- package/lib/commonjs/figma/Link.figma.js.map +1 -0
- package/lib/commonjs/figma/ListItem.Description.figma.js +23 -0
- package/lib/commonjs/figma/ListItem.Description.figma.js.map +1 -0
- package/lib/commonjs/figma/ListItem.LeadingSlot.figma.js +24 -0
- package/lib/commonjs/figma/ListItem.LeadingSlot.figma.js.map +1 -0
- package/lib/commonjs/figma/ListItem.Meta.figma.js +23 -0
- package/lib/commonjs/figma/ListItem.Meta.figma.js.map +1 -0
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js +24 -0
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js.map +1 -0
- package/lib/commonjs/figma/ListItem.Title.figma.js +23 -0
- package/lib/commonjs/figma/ListItem.Title.figma.js.map +1 -0
- package/lib/commonjs/figma/ListItem.TrailingSlot.figma.js +24 -0
- package/lib/commonjs/figma/ListItem.TrailingSlot.figma.js.map +1 -0
- package/lib/commonjs/figma/ListItem.figma.js +50 -0
- package/lib/commonjs/figma/ListItem.figma.js.map +1 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js +39 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/commonjs/figma/Radio.figma.js +40 -0
- package/lib/commonjs/figma/Radio.figma.js.map +1 -0
- package/lib/commonjs/figma/Select.figma.js +53 -0
- package/lib/commonjs/figma/Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Text.figma.js +32 -0
- package/lib/commonjs/figma/Text.figma.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.js +27 -0
- package/lib/commonjs/figma/icons.figma.batch.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.json +17705 -0
- package/lib/commonjs/hooks/index.js +19 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useForgeBottomTabScreenOptions.js +246 -0
- package/lib/commonjs/hooks/useForgeBottomTabScreenOptions.js.map +1 -0
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/metro/withCdxMetroConfig.js +7 -18
- package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -1
- package/lib/commonjs/metro/withForgeMetroConfig.js +24 -0
- package/lib/commonjs/metro/withForgeMetroConfig.js.map +1 -0
- package/lib/commonjs/navigation/forgeTabIcon.js +43 -0
- package/lib/commonjs/navigation/forgeTabIcon.js.map +1 -0
- package/lib/commonjs/navigation/forgeTabIcon.native.js +35 -0
- package/lib/commonjs/navigation/forgeTabIcon.native.js.map +1 -0
- package/lib/commonjs/navigation/index.js +13 -0
- package/lib/commonjs/navigation/index.js.map +1 -0
- package/lib/commonjs/navigation/types.js +38 -0
- package/lib/commonjs/navigation/types.js.map +1 -0
- package/lib/commonjs/styles/primitives.js +43 -6
- package/lib/commonjs/styles/primitives.js.map +1 -1
- package/lib/module/components/AlertDialog/index.js +5 -4
- package/lib/module/components/AlertDialog/index.js.map +1 -1
- package/lib/module/components/Avatar/index.js +1 -1
- package/lib/module/components/Avatar/styles.js +36 -29
- package/lib/module/components/Avatar/styles.js.map +1 -1
- package/lib/module/components/Button/index.js +17 -2
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +85 -26
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/CLAUDE.md +90 -0
- package/lib/module/components/Card/index.js +23 -4
- package/lib/module/components/Card/index.js.map +1 -1
- package/lib/module/components/Card/styles.js +27 -4
- package/lib/module/components/Card/styles.js.map +1 -1
- package/lib/module/components/Checkbox/index.js +6 -30
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +43 -48
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Chip/index.js +82 -13
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/Chip/styles.js +206 -20
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/components/Dialog/index.js +74 -19
- package/lib/module/components/Dialog/index.js.map +1 -1
- package/lib/module/components/Dialog/styles.js +60 -14
- package/lib/module/components/Dialog/styles.js.map +1 -1
- package/lib/module/components/Field/index.js +9 -3
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Field/styles.js +4 -4
- package/lib/module/components/Field/styles.js.map +1 -1
- package/lib/module/components/Heading/styles.js +1 -1
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/Icon/index.js +3 -4
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/IconButton/index.js +6 -1
- package/lib/module/components/IconButton/index.js.map +1 -1
- package/lib/module/components/IconButton/styles.js +135 -10
- package/lib/module/components/IconButton/styles.js.map +1 -1
- package/lib/module/components/Input/styles.js +7 -6
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/index.js +25 -6
- package/lib/module/components/Link/index.js.map +1 -1
- package/lib/module/components/Link/styles.js +55 -6
- package/lib/module/components/Link/styles.js.map +1 -1
- package/lib/module/components/ListItem/index.js +3 -25
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +30 -58
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/components/ProgressSegmented/index.js +25 -11
- package/lib/module/components/ProgressSegmented/index.js.map +1 -1
- package/lib/module/components/Radio/index.js +164 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Radio/styles.js +27 -0
- package/lib/module/components/Radio/styles.js.map +1 -0
- package/lib/module/components/ScopedTheme/index.js +19 -0
- package/lib/module/components/ScopedTheme/index.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js +4 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -1
- package/lib/module/components/Select/index.js +10 -4
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +18 -21
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Text/styles.js +2 -2
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/components/Tile/index.js +243 -0
- package/lib/module/components/Tile/index.js.map +1 -0
- package/lib/module/components/Tile/styles.js +48 -0
- package/lib/module/components/Tile/styles.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/AlertDialog.Description.figma.js +14 -0
- package/lib/module/figma/AlertDialog.Description.figma.js.map +1 -0
- package/lib/module/figma/AlertDialog.Footer.figma.js +35 -0
- package/lib/module/figma/AlertDialog.Footer.figma.js.map +1 -0
- package/lib/module/figma/AlertDialog.Header.figma.js +22 -0
- package/lib/module/figma/AlertDialog.Header.figma.js.map +1 -0
- package/lib/module/figma/AlertDialog.Text.figma.js +14 -0
- package/lib/module/figma/AlertDialog.Text.figma.js.map +1 -0
- package/lib/module/figma/AlertDialog.Title.figma.js +21 -0
- package/lib/module/figma/AlertDialog.Title.figma.js.map +1 -0
- package/lib/module/figma/AlertDialog.figma.js +37 -0
- package/lib/module/figma/AlertDialog.figma.js.map +1 -0
- package/lib/module/figma/Avatar.figma.js +51 -0
- package/lib/module/figma/Avatar.figma.js.map +1 -0
- package/lib/module/figma/Button.figma.js +28 -15
- package/lib/module/figma/Button.figma.js.map +1 -1
- package/lib/module/figma/CLAUDE.md +30 -0
- package/lib/module/figma/Card.Header.figma.js +22 -0
- package/lib/module/figma/Card.Header.figma.js.map +1 -0
- package/lib/module/figma/Card.figma.js +36 -0
- package/lib/module/figma/Card.figma.js.map +1 -0
- package/lib/module/figma/Checkbox.figma.js +49 -0
- package/lib/module/figma/Checkbox.figma.js.map +1 -0
- package/lib/module/figma/Chip.figma.js +62 -0
- package/lib/module/figma/Chip.figma.js.map +1 -0
- package/lib/module/figma/Dialog.Description.figma.js +14 -0
- package/lib/module/figma/Dialog.Description.figma.js.map +1 -0
- package/lib/module/figma/Dialog.Footer.figma.js +24 -0
- package/lib/module/figma/Dialog.Footer.figma.js.map +1 -0
- package/lib/module/figma/Dialog.Header.figma.js +23 -0
- package/lib/module/figma/Dialog.Header.figma.js.map +1 -0
- package/lib/module/figma/Dialog.Text.figma.js +14 -0
- package/lib/module/figma/Dialog.Text.figma.js.map +1 -0
- package/lib/module/figma/Dialog.Title.figma.js +21 -0
- package/lib/module/figma/Dialog.Title.figma.js.map +1 -0
- package/lib/module/figma/Dialog.figma.js +45 -0
- package/lib/module/figma/Dialog.figma.js.map +1 -0
- package/lib/module/figma/Field.Input.figma.js +51 -0
- package/lib/module/figma/Field.Input.figma.js.map +1 -0
- package/lib/module/figma/Field.Select.figma.js +51 -0
- package/lib/module/figma/Field.Select.figma.js.map +1 -0
- package/lib/module/figma/Heading.figma.js +24 -0
- package/lib/module/figma/Heading.figma.js.map +1 -0
- package/lib/module/figma/Icon.figma.js +14 -0
- package/lib/module/figma/Icon.figma.js.map +1 -0
- package/lib/module/figma/IconButton.figma.js +41 -0
- package/lib/module/figma/IconButton.figma.js.map +1 -0
- package/lib/module/figma/Input.figma.js +46 -0
- package/lib/module/figma/Input.figma.js.map +1 -0
- package/lib/module/figma/Link.figma.js +24 -0
- package/lib/module/figma/Link.figma.js.map +1 -0
- package/lib/module/figma/ListItem.Description.figma.js +17 -0
- package/lib/module/figma/ListItem.Description.figma.js.map +1 -0
- package/lib/module/figma/ListItem.LeadingSlot.figma.js +18 -0
- package/lib/module/figma/ListItem.LeadingSlot.figma.js.map +1 -0
- package/lib/module/figma/ListItem.Meta.figma.js +17 -0
- package/lib/module/figma/ListItem.Meta.figma.js.map +1 -0
- package/lib/module/figma/ListItem.SectionHeader.figma.js +18 -0
- package/lib/module/figma/ListItem.SectionHeader.figma.js.map +1 -0
- package/lib/module/figma/ListItem.Title.figma.js +17 -0
- package/lib/module/figma/ListItem.Title.figma.js.map +1 -0
- package/lib/module/figma/ListItem.TrailingSlot.figma.js +18 -0
- package/lib/module/figma/ListItem.TrailingSlot.figma.js.map +1 -0
- package/lib/module/figma/ListItem.figma.js +44 -0
- package/lib/module/figma/ListItem.figma.js.map +1 -0
- package/lib/module/figma/ProgressSegmented.figma.js +33 -0
- package/lib/module/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/module/figma/Radio.figma.js +34 -0
- package/lib/module/figma/Radio.figma.js.map +1 -0
- package/lib/module/figma/Select.figma.js +47 -0
- package/lib/module/figma/Select.figma.js.map +1 -0
- package/lib/module/figma/Text.figma.js +26 -0
- package/lib/module/figma/Text.figma.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.js +22 -0
- package/lib/module/figma/icons.figma.batch.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.json +17705 -0
- package/lib/module/hooks/index.js +4 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useForgeBottomTabScreenOptions.js +242 -0
- package/lib/module/hooks/useForgeBottomTabScreenOptions.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/metro/withCdxMetroConfig.js +3 -17
- package/lib/module/metro/withCdxMetroConfig.js.map +1 -1
- package/lib/module/metro/withForgeMetroConfig.js +20 -0
- package/lib/module/metro/withForgeMetroConfig.js.map +1 -0
- package/lib/module/navigation/forgeTabIcon.js +39 -0
- package/lib/module/navigation/forgeTabIcon.js.map +1 -0
- package/lib/module/navigation/forgeTabIcon.native.js +31 -0
- package/lib/module/navigation/forgeTabIcon.native.js.map +1 -0
- package/lib/module/navigation/index.js +4 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/types.js +36 -0
- package/lib/module/navigation/types.js.map +1 -0
- package/lib/module/styles/primitives.js +43 -6
- package/lib/module/styles/primitives.js.map +1 -1
- package/lib/typescript/components/AlertDialog/index.d.ts +3 -2
- package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -1
- package/lib/typescript/components/Avatar/styles.d.ts +4 -4
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -1
- package/lib/typescript/components/Button/index.d.ts +13 -1
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +5 -3
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Card/index.d.ts +4 -3
- package/lib/typescript/components/Card/index.d.ts.map +1 -1
- package/lib/typescript/components/Card/styles.d.ts +13 -3
- package/lib/typescript/components/Card/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +1 -2
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -14
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +19 -6
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +13 -4
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
- package/lib/typescript/components/Dialog/index.d.ts +16 -10
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/components/Dialog/styles.d.ts +16 -5
- package/lib/typescript/components/Dialog/styles.d.ts.map +1 -1
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +2 -2
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -1
- package/lib/typescript/components/Field/index.d.ts.map +1 -1
- package/lib/typescript/components/Field/styles.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts +1 -1
- package/lib/typescript/components/Icon/index.d.ts +5 -5
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts +3 -3
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/styles.d.ts +6 -2
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +2 -2
- package/lib/typescript/components/Link/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/styles.d.ts +9 -2
- package/lib/typescript/components/Link/styles.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts +3 -10
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
- package/lib/typescript/components/ProgressSegmented/index.d.ts +14 -3
- package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -1
- package/lib/typescript/components/Radio/index.d.ts +40 -0
- package/lib/typescript/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/components/Radio/styles.d.ts +8 -0
- package/lib/typescript/components/Radio/styles.d.ts.map +1 -0
- package/lib/typescript/components/ScopedTheme/index.d.ts +16 -0
- package/lib/typescript/components/ScopedTheme/index.d.ts.map +1 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +3 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts +1 -1
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Stack/styles.d.ts +2 -2
- package/lib/typescript/components/Text/styles.d.ts +1 -1
- package/lib/typescript/components/Tile/index.d.ts +70 -0
- package/lib/typescript/components/Tile/index.d.ts.map +1 -0
- package/lib/typescript/components/Tile/styles.d.ts +18 -0
- package/lib/typescript/components/Tile/styles.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/AlertDialog.Description.figma.d.ts +8 -0
- package/lib/typescript/figma/AlertDialog.Description.figma.d.ts.map +1 -0
- package/lib/typescript/figma/AlertDialog.Footer.figma.d.ts +8 -0
- package/lib/typescript/figma/AlertDialog.Footer.figma.d.ts.map +1 -0
- package/lib/typescript/figma/AlertDialog.Header.figma.d.ts +8 -0
- package/lib/typescript/figma/AlertDialog.Header.figma.d.ts.map +1 -0
- package/lib/typescript/figma/AlertDialog.Text.figma.d.ts +8 -0
- package/lib/typescript/figma/AlertDialog.Text.figma.d.ts.map +1 -0
- package/lib/typescript/figma/AlertDialog.Title.figma.d.ts +8 -0
- package/lib/typescript/figma/AlertDialog.Title.figma.d.ts.map +1 -0
- package/lib/typescript/figma/AlertDialog.figma.d.ts +8 -0
- package/lib/typescript/figma/AlertDialog.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Avatar.figma.d.ts +11 -0
- package/lib/typescript/figma/Avatar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Button.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Card.Header.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Card.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts +8 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Chip.figma.d.ts +8 -0
- package/lib/typescript/figma/Chip.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Dialog.Description.figma.d.ts +8 -0
- package/lib/typescript/figma/Dialog.Description.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Dialog.Footer.figma.d.ts +8 -0
- package/lib/typescript/figma/Dialog.Footer.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Dialog.Header.figma.d.ts +8 -0
- package/lib/typescript/figma/Dialog.Header.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Dialog.Text.figma.d.ts +8 -0
- package/lib/typescript/figma/Dialog.Text.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Dialog.Title.figma.d.ts +8 -0
- package/lib/typescript/figma/Dialog.Title.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Dialog.figma.d.ts +8 -0
- package/lib/typescript/figma/Dialog.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Heading.figma.d.ts +8 -0
- package/lib/typescript/figma/Heading.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Icon.figma.d.ts +8 -0
- package/lib/typescript/figma/Icon.figma.d.ts.map +1 -0
- package/lib/typescript/figma/IconButton.figma.d.ts +8 -0
- package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Link.figma.d.ts +8 -0
- package/lib/typescript/figma/Link.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ListItem.Description.figma.d.ts +11 -0
- package/lib/typescript/figma/ListItem.Description.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ListItem.LeadingSlot.figma.d.ts +8 -0
- package/lib/typescript/figma/ListItem.LeadingSlot.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ListItem.Meta.figma.d.ts +11 -0
- package/lib/typescript/figma/ListItem.Meta.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ListItem.SectionHeader.figma.d.ts +8 -0
- package/lib/typescript/figma/ListItem.SectionHeader.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ListItem.Title.figma.d.ts +11 -0
- package/lib/typescript/figma/ListItem.Title.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ListItem.TrailingSlot.figma.d.ts +8 -0
- package/lib/typescript/figma/ListItem.TrailingSlot.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ListItem.figma.d.ts +8 -0
- package/lib/typescript/figma/ListItem.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts +8 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Radio.figma.d.ts +8 -0
- package/lib/typescript/figma/Radio.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Text.figma.d.ts +11 -0
- package/lib/typescript/figma/Text.figma.d.ts.map +1 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts +14 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts.map +1 -0
- package/lib/typescript/hooks/index.d.ts +2 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useForgeBottomTabScreenOptions.d.ts +137 -0
- package/lib/typescript/hooks/useForgeBottomTabScreenOptions.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/metro/withCdxMetroConfig.d.ts +4 -18
- package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -1
- package/lib/typescript/metro/withForgeMetroConfig.d.ts +19 -0
- package/lib/typescript/metro/withForgeMetroConfig.d.ts.map +1 -0
- package/lib/typescript/navigation/forgeTabIcon.d.ts +27 -0
- package/lib/typescript/navigation/forgeTabIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/forgeTabIcon.native.d.ts +15 -0
- package/lib/typescript/navigation/forgeTabIcon.native.d.ts.map +1 -0
- package/lib/typescript/navigation/index.d.ts +4 -0
- package/lib/typescript/navigation/index.d.ts.map +1 -0
- package/lib/typescript/navigation/types.d.ts +37 -0
- package/lib/typescript/navigation/types.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +38 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -1
- package/package.json +10 -8
- package/src/components/AlertDialog/index.tsx +8 -6
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Avatar/styles.ts +49 -34
- package/src/components/Button/index.tsx +39 -5
- package/src/components/Button/styles.ts +56 -27
- package/src/components/CLAUDE.md +90 -0
- package/src/components/Card/index.tsx +41 -16
- package/src/components/Card/styles.ts +42 -15
- package/src/components/Checkbox/index.tsx +8 -19
- package/src/components/Checkbox/styles.ts +84 -86
- package/src/components/Chip/index.tsx +104 -27
- package/src/components/Chip/styles.ts +232 -18
- package/src/components/Dialog/index.tsx +95 -29
- package/src/components/Dialog/styles.ts +72 -30
- package/src/components/Field/FieldLabel.web.tsx +1 -1
- package/src/components/Field/index.tsx +10 -3
- package/src/components/Field/styles.ts +5 -4
- package/src/components/Heading/styles.ts +1 -1
- package/src/components/Icon/index.tsx +6 -7
- package/src/components/IconButton/index.tsx +7 -6
- package/src/components/IconButton/styles.ts +136 -10
- package/src/components/Input/styles.ts +15 -9
- package/src/components/Link/index.tsx +22 -9
- package/src/components/Link/styles.ts +49 -9
- package/src/components/ListItem/index.tsx +8 -23
- package/src/components/ListItem/styles.ts +50 -81
- package/src/components/ProgressSegmented/index.tsx +50 -14
- package/src/components/Radio/index.tsx +192 -0
- package/src/components/Radio/styles.ts +59 -0
- package/src/components/ScopedTheme/index.tsx +17 -0
- package/src/components/Select/SelectTriggerHost.web.tsx +8 -1
- package/src/components/Select/index.tsx +9 -4
- package/src/components/Select/styles.ts +49 -51
- package/src/components/Text/styles.ts +2 -2
- package/src/components/Tile/index.tsx +296 -0
- package/src/components/Tile/styles.ts +82 -0
- package/src/components/index.ts +3 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useForgeBottomTabScreenOptions.ts +245 -0
- package/src/index.ts +2 -0
- package/src/metro/withCdxMetroConfig.ts +4 -29
- package/src/metro/withForgeMetroConfig.ts +29 -0
- package/src/navigation/forgeTabIcon.native.ts +36 -0
- package/src/navigation/forgeTabIcon.ts +33 -0
- package/src/navigation/index.ts +3 -0
- package/src/navigation/types.ts +54 -0
- package/src/styles/primitives.ts +43 -6
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Components — authoring & styling conventions
|
|
2
|
+
|
|
3
|
+
Auto-loaded when working in `packages/components/src/components/**`. Covers both the
|
|
4
|
+
styled component files (`index.tsx`) and their co-located CVA variant files (`styles.ts`).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Component Authoring (`index.tsx`)
|
|
9
|
+
|
|
10
|
+
Styled components in `@cdx-ui/components` follow a consistent pattern. Read the full guides before making changes:
|
|
11
|
+
|
|
12
|
+
- `docs/internal/practices/composition.md` — compound component pattern, naming conventions
|
|
13
|
+
- `docs/internal/practices/types.md` — prop types, `I*Props` vs `*Props`, exporting
|
|
14
|
+
- `docs/internal/practices/styling.md` — `cn()`, CVA, token classes, `Platform.select()`
|
|
15
|
+
- `docs/internal/practices/state.md` — `useControllableState`, `composeEventHandlers`
|
|
16
|
+
- `docs/internal/practices/data-attributes.md` — `data-[state]` and `data-slot`
|
|
17
|
+
|
|
18
|
+
### Pattern summary
|
|
19
|
+
|
|
20
|
+
Each component follows this structure (see `Button/index.tsx` as the canonical example):
|
|
21
|
+
|
|
22
|
+
1. **Imports** — RN base components, primitive from `@cdx-ui/primitives`, `cn` + style context from `@cdx-ui/utils`, variant functions from `./styles`
|
|
23
|
+
2. **Scope constant** — `const SCOPE = 'COMPONENT_NAME'` for `withStyleContext` / `useStyleContext`
|
|
24
|
+
3. **Root wrapping** — `const Root = withStyleContext(BaseRNComponent, SCOPE)`
|
|
25
|
+
4. **Primitive instantiation** — `const Primitive = createComponent({ Root, Text, ... })` using the primitive factory
|
|
26
|
+
5. **Styled sub-components** — each wraps a single element, uses `forwardRef`, destructures variant props with defaults, computes `cn(variantFn({ ...variants }), className)`, passes `context` to the primitive root
|
|
27
|
+
6. **Compound export** — `Object.assign(RootComponent, { Sub1, Sub2 }) as CompoundType`
|
|
28
|
+
|
|
29
|
+
### Key rules
|
|
30
|
+
|
|
31
|
+
- Props interface extends RN base props + primitive `I*Props` + CVA `VariantProps` + `{ className?: string }`
|
|
32
|
+
- Always accept and spread `style` alongside `className`
|
|
33
|
+
- Variant defaults in destructuring must match CVA `defaultVariants`
|
|
34
|
+
- `displayName` set on every exported sub-component
|
|
35
|
+
- `className` is merged last via `cn()` so consumer overrides always win
|
|
36
|
+
- Never hardcode colors — use semantic token classes (`bg-surface-*`, `text-content-*`, `border-stroke-*`)
|
|
37
|
+
- Event handlers composed via `composeEventHandlers` from `@cdx-ui/utils`
|
|
38
|
+
- Third-party libraries fully abstracted — no adopted library types leak to consumers
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Styling Conventions (`styles.ts`)
|
|
43
|
+
|
|
44
|
+
Variant definitions live in co-located `styles.ts` files using CVA. Read the full guides before making changes:
|
|
45
|
+
|
|
46
|
+
- `docs/internal/practices/styling.md` — `cn()`, CVA, token architecture, dark mode, `Platform.select()`
|
|
47
|
+
- `docs/internal/practices/data-attributes.md` — `data-[state]` selectors for interaction states
|
|
48
|
+
|
|
49
|
+
### Pattern summary
|
|
50
|
+
|
|
51
|
+
Each `styles.ts` exports CVA variant functions and their derived `VariantProps` types (see `Button/styles.ts` as the canonical example):
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { Platform } from 'react-native';
|
|
55
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
56
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
57
|
+
|
|
58
|
+
export const componentRootVariants = cva(
|
|
59
|
+
[
|
|
60
|
+
/* base classes */
|
|
61
|
+
],
|
|
62
|
+
{
|
|
63
|
+
variants: {
|
|
64
|
+
/* variant axes */
|
|
65
|
+
},
|
|
66
|
+
compoundVariants: [
|
|
67
|
+
/* variant × variant combinations */
|
|
68
|
+
],
|
|
69
|
+
defaultVariants: {
|
|
70
|
+
/* defaults matching the component's destructured defaults */
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
export type ComponentVariantProps = VariantProps<typeof componentRootVariants>;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Key rules
|
|
79
|
+
|
|
80
|
+
- **Semantic token classes only** — use `bg-surface-action-strong`, `text-content-primary`, `border-stroke-primary`, etc. Never hardcode hex colors, `bg-white`, `text-black`, or raw Tailwind color scales for themed values.
|
|
81
|
+
- **`data-[state]` selectors** — use `data-[disabled=true]:`, `data-[hover=true]:`, `data-[active=true]:`, `data-[focus-visible=true]:` for interaction states. Primitives emit these data attributes.
|
|
82
|
+
- **`Platform.select()`** for platform-specific classes — web gets `data-[hover=true]` styles (hover exists on web); native responds only to `data-[active=true]` (press). Always set `default` (native) and `web` keys.
|
|
83
|
+
- **Shared style primitives** — import `DISABLED_CURSOR`, `TRANSITION_COLORS`, etc. from `../../styles/primitives` for cross-component consistency.
|
|
84
|
+
- **`web:` prefix** for web-only utilities — e.g., `web:outline-none`, `web:focus-visible:ring-2`.
|
|
85
|
+
- **`compoundVariants`** for variant × variant combinations where simple variant merging is insufficient.
|
|
86
|
+
- **`defaultVariants`** must match the destructured defaults in the component's `index.tsx`.
|
|
87
|
+
- **One `cva()` per sub-component** — root, text, icon, spinner, etc. each get their own variant function.
|
|
88
|
+
- **Export `VariantProps` types** — derived via `VariantProps<typeof variantFn>` for the component layer to consume.
|
|
89
|
+
- **No dynamic string construction** — all Tailwind class names must be statically detectable by the Tailwind scanner.
|
|
90
|
+
- **CSS variables for token values** — use `rounded-[var(--border-radius-button)]` syntax when referencing design tokens not mapped to Tailwind utilities.
|
|
@@ -2,24 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
-
import { cn } from '@cdx-ui/utils';
|
|
5
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
6
6
|
import { cardContentVariants, cardFooterVariants, cardHeaderVariants, cardRootVariants } from './styles';
|
|
7
7
|
|
|
8
8
|
// =============================================================================
|
|
9
9
|
// STYLED ROOT COMPONENT
|
|
10
10
|
// =============================================================================
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const SCOPE = 'CARD';
|
|
13
|
+
const Root = withStyleContext(View, SCOPE);
|
|
14
|
+
const useCardStyleContext = () => useStyleContext(SCOPE);
|
|
12
15
|
const CardRoot = /*#__PURE__*/forwardRef(({
|
|
13
16
|
className,
|
|
14
17
|
children,
|
|
15
18
|
style,
|
|
19
|
+
fullBleed,
|
|
16
20
|
...props
|
|
17
21
|
}, ref) => {
|
|
18
22
|
const computedClassName = cn(cardRootVariants(), className);
|
|
19
|
-
return /*#__PURE__*/_jsx(
|
|
23
|
+
return /*#__PURE__*/_jsx(Root, {
|
|
20
24
|
ref: ref,
|
|
21
25
|
className: computedClassName,
|
|
22
26
|
style: style,
|
|
27
|
+
context: {
|
|
28
|
+
fullBleed
|
|
29
|
+
},
|
|
23
30
|
...props,
|
|
24
31
|
children: children
|
|
25
32
|
});
|
|
@@ -55,9 +62,15 @@ const CardContent = /*#__PURE__*/forwardRef(({
|
|
|
55
62
|
className,
|
|
56
63
|
children,
|
|
57
64
|
style,
|
|
65
|
+
fullBleed,
|
|
58
66
|
...props
|
|
59
67
|
}, ref) => {
|
|
60
|
-
const
|
|
68
|
+
const {
|
|
69
|
+
fullBleed: fullBleedFromContext
|
|
70
|
+
} = useCardStyleContext();
|
|
71
|
+
const computedClassName = cn(cardContentVariants({
|
|
72
|
+
fullBleed: fullBleed ?? fullBleedFromContext
|
|
73
|
+
}), className);
|
|
61
74
|
return /*#__PURE__*/_jsx(View, {
|
|
62
75
|
ref: ref,
|
|
63
76
|
className: computedClassName,
|
|
@@ -76,9 +89,15 @@ const CardFooter = /*#__PURE__*/forwardRef(({
|
|
|
76
89
|
className,
|
|
77
90
|
children,
|
|
78
91
|
style,
|
|
92
|
+
fullBleed,
|
|
79
93
|
...props
|
|
80
94
|
}, ref) => {
|
|
81
|
-
const
|
|
95
|
+
const {
|
|
96
|
+
fullBleed: fullBleedFromContext
|
|
97
|
+
} = useCardStyleContext();
|
|
98
|
+
const computedClassName = cn(cardFooterVariants({
|
|
99
|
+
fullBleed: fullBleed ?? fullBleedFromContext
|
|
100
|
+
}), className);
|
|
82
101
|
return /*#__PURE__*/_jsx(View, {
|
|
83
102
|
ref: ref,
|
|
84
103
|
className: computedClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","View","cn","cardContentVariants","cardFooterVariants","cardHeaderVariants","cardRootVariants","jsx","_jsx","CardRoot","className","children","style","props","ref","computedClassName","displayName","CardHeader","CardContent","CardFooter","Card","Header","Content","Footer"],"sourceRoot":"../../../../src","sources":["components/Card/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,EAAE,QAAQ,eAAe;
|
|
1
|
+
{"version":3,"names":["forwardRef","View","cn","useStyleContext","withStyleContext","cardContentVariants","cardFooterVariants","cardHeaderVariants","cardRootVariants","jsx","_jsx","SCOPE","Root","useCardStyleContext","CardRoot","className","children","style","fullBleed","props","ref","computedClassName","context","displayName","CardHeader","CardContent","fullBleedFromContext","CardFooter","Card","Header","Content","Footer"],"sourceRoot":"../../../../src","sources":["components/Card/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,IAAI,QAAwB,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CACF,CAAC;AAEDW,UAAU,CAACJ,WAAW,GAAG,aAAa;;AAEtC;AACA;AACA;;AAQA,OAAO,MAAMK,IAAI,GAAGd,QAAiC;AAErDc,IAAI,CAACC,MAAM,GAAGL,UAAU;AACxBI,IAAI,CAACE,OAAO,GAAGL,WAAW;AAC1BG,IAAI,CAACG,MAAM,GAAGJ,UAAU","ignoreList":[]}
|
|
@@ -4,11 +4,18 @@ import { cva } from 'class-variance-authority';
|
|
|
4
4
|
|
|
5
5
|
// ── Root ────────────────────────────────────────────────────
|
|
6
6
|
|
|
7
|
-
export const cardRootVariants = cva(['bg-surface-primary', 'border border-stroke-secondary', 'rounded-[var(--border-radius-default)]', 'overflow-hidden']
|
|
7
|
+
export const cardRootVariants = cva(['bg-surface-primary', 'border border-stroke-secondary', 'rounded-[var(--border-radius-default)]', 'overflow-hidden'], {
|
|
8
|
+
variants: {
|
|
9
|
+
fullBleed: {
|
|
10
|
+
true: '',
|
|
11
|
+
false: ''
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
8
15
|
|
|
9
16
|
// ── Header ──────────────────────────────────────────────────
|
|
10
17
|
|
|
11
|
-
export const cardHeaderVariants = cva(['
|
|
18
|
+
export const cardHeaderVariants = cva(['border-t-8 border-t-surface-brand-strong', 'border-b border-solid border-b-stroke-secondary', 'flex-row items-center justify-between gap-0.5', 'px-5 py-3']);
|
|
12
19
|
|
|
13
20
|
// ── Title ───────────────────────────────────────────────────
|
|
14
21
|
|
|
@@ -16,9 +23,25 @@ export const cardTitleVariants = cva(['flex-1']);
|
|
|
16
23
|
|
|
17
24
|
// ── Content ─────────────────────────────────────────────────
|
|
18
25
|
|
|
19
|
-
export const cardContentVariants = cva(['text-content-primary', 'p-
|
|
26
|
+
export const cardContentVariants = cva(['text-content-primary', 'p-5'], {
|
|
27
|
+
variants: {
|
|
28
|
+
fullBleed: {
|
|
29
|
+
true: 'p-0'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
20
33
|
|
|
21
34
|
// ── Footer ──────────────────────────────────────────────────
|
|
22
35
|
|
|
23
|
-
export const cardFooterVariants = cva(['
|
|
36
|
+
export const cardFooterVariants = cva(['flex-col items-stretch gap-2'], {
|
|
37
|
+
variants: {
|
|
38
|
+
fullBleed: {
|
|
39
|
+
true: 'p-5',
|
|
40
|
+
false: 'px-5 pb-5 pt-0'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
fullBleed: false
|
|
45
|
+
}
|
|
46
|
+
});
|
|
24
47
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cva","cardRootVariants","cardHeaderVariants","cardTitleVariants","cardContentVariants","cardFooterVariants"],"sourceRoot":"../../../../src","sources":["components/Card/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,
|
|
1
|
+
{"version":3,"names":["cva","cardRootVariants","variants","fullBleed","true","false","cardHeaderVariants","cardTitleVariants","cardContentVariants","cardFooterVariants","defaultVariants"],"sourceRoot":"../../../../src","sources":["components/Card/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAAsB,0BAA0B;;AAE5D;;AAEA,OAAO,MAAMC,gBAAgB,GAAGD,GAAG,CACjC,CACE,oBAAoB,EACpB,gCAAgC,EAChC,wCAAwC,EACxC,iBAAiB,CAClB,EACD;EACEE,QAAQ,EAAE;IACRC,SAAS,EAAE;MACTC,IAAI,EAAE,EAAE;MACRC,KAAK,EAAE;IACT;EACF;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,MAAMC,kBAAkB,GAAGN,GAAG,CAAC,CACpC,0CAA0C,EAC1C,iDAAiD,EACjD,+CAA+C,EAC/C,WAAW,CACZ,CAAC;;AAEF;;AAEA,OAAO,MAAMO,iBAAiB,GAAGP,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;;AAEhD;;AAEA,OAAO,MAAMQ,mBAAmB,GAAGR,GAAG,CAAC,CAAC,sBAAsB,EAAE,KAAK,CAAC,EAAE;EACtEE,QAAQ,EAAE;IACRC,SAAS,EAAE;MACTC,IAAI,EAAE;IACR;EACF;AACF,CAAC,CAAC;;AAEF;;AAEA,OAAO,MAAMK,kBAAkB,GAAGT,GAAG,CAAC,CAAC,8BAA8B,CAAC,EAAE;EACtEE,QAAQ,EAAE;IACRC,SAAS,EAAE;MACTC,IAAI,EAAE,KAAK;MACXC,KAAK,EAAE;IACT;EACF,CAAC;EACDK,eAAe,EAAE;IACfP,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,15 +4,12 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import { Pressable, Text, View } from 'react-native';
|
|
5
5
|
import { Check, CheckIndeterminateSmall } from '@cdx-ui/icons';
|
|
6
6
|
import { createCheckbox } from '@cdx-ui/primitives';
|
|
7
|
-
import { cn
|
|
7
|
+
import { cn } from '@cdx-ui/utils';
|
|
8
8
|
import { Icon } from '../Icon';
|
|
9
9
|
import { checkboxGroupVariants, checkboxIconVariants, checkboxIndicatorVariants, checkboxLabelVariants, checkboxRootVariants } from './styles';
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
const SCOPE = 'CHECKBOX';
|
|
12
|
-
const Root = withStyleContext(Pressable, SCOPE);
|
|
13
|
-
const useCheckboxStyleContext = () => useStyleContext(SCOPE);
|
|
14
11
|
const CheckboxPrimitive = createCheckbox({
|
|
15
|
-
Root,
|
|
12
|
+
Root: Pressable,
|
|
16
13
|
Indicator: View,
|
|
17
14
|
Icon: View,
|
|
18
15
|
Label: Text,
|
|
@@ -24,24 +21,18 @@ const CheckboxPrimitive = createCheckbox({
|
|
|
24
21
|
// =============================================================================
|
|
25
22
|
|
|
26
23
|
const CheckboxRoot = /*#__PURE__*/forwardRef(({
|
|
27
|
-
size = 'default',
|
|
28
24
|
className,
|
|
29
25
|
isIndeterminate,
|
|
30
26
|
children,
|
|
31
27
|
style,
|
|
32
28
|
...props
|
|
33
29
|
}, ref) => {
|
|
34
|
-
const computedClassName = cn(checkboxRootVariants(
|
|
35
|
-
size
|
|
36
|
-
}), className);
|
|
30
|
+
const computedClassName = cn(checkboxRootVariants(), className);
|
|
37
31
|
return /*#__PURE__*/_jsxs(CheckboxPrimitive, {
|
|
38
32
|
ref: ref,
|
|
39
33
|
className: computedClassName,
|
|
40
34
|
isIndeterminate: isIndeterminate,
|
|
41
35
|
style: style,
|
|
42
|
-
context: {
|
|
43
|
-
size
|
|
44
|
-
},
|
|
45
36
|
...props,
|
|
46
37
|
children: [/*#__PURE__*/_jsx(CheckboxIndicator, {
|
|
47
38
|
children: /*#__PURE__*/_jsx(CheckboxPrimitive.Icon, {
|
|
@@ -64,12 +55,7 @@ const CheckboxIndicator = /*#__PURE__*/forwardRef(({
|
|
|
64
55
|
style,
|
|
65
56
|
...props
|
|
66
57
|
}, ref) => {
|
|
67
|
-
const
|
|
68
|
-
size
|
|
69
|
-
} = useCheckboxStyleContext();
|
|
70
|
-
const computedClassName = cn(checkboxIndicatorVariants({
|
|
71
|
-
size
|
|
72
|
-
}), className);
|
|
58
|
+
const computedClassName = cn(checkboxIndicatorVariants(), className);
|
|
73
59
|
return /*#__PURE__*/_jsx(CheckboxPrimitive.Indicator, {
|
|
74
60
|
ref: ref,
|
|
75
61
|
className: computedClassName,
|
|
@@ -89,12 +75,7 @@ const CheckboxIcon = ({
|
|
|
89
75
|
style,
|
|
90
76
|
...props
|
|
91
77
|
}) => {
|
|
92
|
-
const
|
|
93
|
-
size
|
|
94
|
-
} = useCheckboxStyleContext();
|
|
95
|
-
const computedClassName = cn(checkboxIconVariants({
|
|
96
|
-
size
|
|
97
|
-
}), className);
|
|
78
|
+
const computedClassName = cn(checkboxIconVariants(), className);
|
|
98
79
|
return /*#__PURE__*/_jsx(Icon, {
|
|
99
80
|
className: computedClassName,
|
|
100
81
|
style: style,
|
|
@@ -113,12 +94,7 @@ const CheckboxLabel = /*#__PURE__*/forwardRef(({
|
|
|
113
94
|
style,
|
|
114
95
|
...props
|
|
115
96
|
}, ref) => {
|
|
116
|
-
const
|
|
117
|
-
size
|
|
118
|
-
} = useCheckboxStyleContext();
|
|
119
|
-
const computedClassName = cn(checkboxLabelVariants({
|
|
120
|
-
size
|
|
121
|
-
}), className);
|
|
97
|
+
const computedClassName = cn(checkboxLabelVariants(), className);
|
|
122
98
|
return /*#__PURE__*/_jsx(CheckboxPrimitive.Label, {
|
|
123
99
|
ref: ref,
|
|
124
100
|
className: computedClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","Pressable","Text","View","Check","CheckIndeterminateSmall","createCheckbox","cn","
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","Text","View","Check","CheckIndeterminateSmall","createCheckbox","cn","Icon","checkboxGroupVariants","checkboxIconVariants","checkboxIndicatorVariants","checkboxLabelVariants","checkboxRootVariants","jsx","_jsx","jsxs","_jsxs","CheckboxPrimitive","Root","Indicator","Label","Group","CheckboxRoot","className","isIndeterminate","children","style","props","ref","computedClassName","CheckboxIndicator","CheckboxIcon","as","displayName","CheckboxLabel","CheckboxGroup","direction","value","onChange","isDisabled","isInvalid","isReadOnly","viewProps","Checkbox","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Checkbox/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,SAAS,EAAEC,IAAI,EAAkBC,IAAI,QAAwB,cAAc;AACpF,SAASC,KAAK,EAAEC,uBAAuB,QAAQ,eAAe;AAC9D,SAASC,cAAc,QAA6B,oBAAoB;AACxE,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,IAAI,QAAmB,SAAS;AACzC,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,yBAAyB,EACzBC,qBAAqB,EACrBC,oBAAoB,QACf,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElB,MAAMC,iBAAiB,G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AGvB,EAAE,CAACE,qBAAqB,CAAC;IAAE4B;EAAU,CAAC,CAAC,EAAEb,SAAS,CAAC;EAE7E,oBACET,IAAA,CAACG,iBAAiB,CAACI,KAAK;IACtBO,GAAG,EAAEA,GAAW;IAChBL,SAAS,EAAEM,iBAAkB;IAC7BH,KAAK,EAAEA,KAAM;IACbW,KAAK,EAAEA,KAAK,IAAI,EAAG;IACnBC,QAAQ,EAAEA,QAAS;IACnBC,UAAU,EAAEA,UAAW;IACvBC,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IAAA,GACnBC,SAAS;IAAAjB,QAAA,EAEZA;EAAQ,CACc,CAAC;AAE9B,CACF,CAAC;AAEDU,aAAa,CAACF,WAAW,GAAG,gBAAgB;;AAE5C;AACA;AACA;;AASA,OAAO,MAAMU,QAAQ,GAAGC,MAAM,CAACC,MAAM,CAACvB,YAAY,EAAE;EAClDH,SAAS,EAAEW,iBAAiB;EAC5BvB,IAAI,EAAEwB,YAAY;EAClBX,KAAK,EAAEc,aAAa;EACpBb,KAAK,EAAEc;AACT,CAAC,CAA8B","ignoreList":[]}
|
|
@@ -2,54 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
defaultVariants: {
|
|
50
|
-
size: 'default'
|
|
51
|
-
}
|
|
52
|
-
});
|
|
5
|
+
import { DISABLED_CURSOR, DISABLED_OPACITY, TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
|
+
|
|
7
|
+
// TODO: Handle text wrapping in the label
|
|
8
|
+
|
|
9
|
+
export const checkboxRootVariants = cva(['flex-row items-center gap-2.5', DISABLED_OPACITY, DISABLED_CURSOR,
|
|
10
|
+
// Suppress stray outline on the Pressable/label wrapper; focus ring is drawn on Checkbox.Indicator (Radio pattern).
|
|
11
|
+
'web:outline-none web:focus:outline-none web:focus-visible:outline-none']);
|
|
12
|
+
export const checkboxIndicatorVariants = cva(['items-center justify-center', 'h-5 w-5', 'rounded', 'border-2 border-solid', 'data-[disabled=true]:opacity-50',
|
|
13
|
+
// Background — layered by specificity. checked=false acts as an explicit reset so the base bg
|
|
14
|
+
// reasserts when transitioning from checked/indeterminate on native (where absent attributes
|
|
15
|
+
// break data-[attr=false] selectors).
|
|
16
|
+
// IMPORTANT: On native (Uniwind), only the LAST data-[] condition in a compound chain is
|
|
17
|
+
// effectively evaluated. Place the most discriminating condition last to avoid false matches.
|
|
18
|
+
'data-[checked=false]:bg-surface-primary', 'data-[checked=true]:bg-surface-action-strong', 'data-[indeterminate=true]:bg-surface-action-strong',
|
|
19
|
+
// Border — invalid (later) beats checked/indeterminate.
|
|
20
|
+
'data-[checked=false]:border-content-secondary', 'data-[checked=true]:border-stroke-action', 'data-[indeterminate=true]:border-stroke-action', 'data-[invalid=true]:border-stroke-danger', Platform.select({
|
|
21
|
+
web: [
|
|
22
|
+
// Invalid bg — compound selectors evaluate correctly on web.
|
|
23
|
+
'data-[invalid=true]:data-[checked=true]:bg-surface-danger-strong', 'data-[invalid=true]:data-[indeterminate=true]:bg-surface-danger-strong', TRANSITION_COLORS,
|
|
24
|
+
// Hover — unchecked (Figma: border unchanged, bg overlay at opacity/hover)
|
|
25
|
+
'data-[hover=true]:data-[checked=false]:data-[indeterminate=false]:bg-content-secondary/[0.08]',
|
|
26
|
+
// Hover — unchecked + invalid (overlay uses danger token)
|
|
27
|
+
'data-[hover=true]:data-[invalid=true]:data-[checked=false]:data-[indeterminate=false]:bg-surface-danger-strong/[0.08]',
|
|
28
|
+
// Hover — checked / indeterminate (bg + border darken together)
|
|
29
|
+
'data-[hover=true]:data-[checked=true]:bg-surface-action-strong-hover', 'data-[hover=true]:data-[checked=true]:border-[--color-surface-action-strong-hover]', 'data-[hover=true]:data-[indeterminate=true]:bg-surface-action-strong-hover', 'data-[hover=true]:data-[indeterminate=true]:border-[--color-surface-action-strong-hover]', 'data-[hover=true]:data-[checked=true]:data-[invalid=true]:bg-surface-danger-strong-hover', 'data-[hover=true]:data-[checked=true]:data-[invalid=true]:border-[--color-surface-danger-strong-hover]', 'data-[hover=true]:data-[indeterminate=true]:data-[invalid=true]:bg-surface-danger-strong-hover', 'data-[hover=true]:data-[indeterminate=true]:data-[invalid=true]:border-[--color-surface-danger-strong-hover]',
|
|
30
|
+
// Active — CSS :active pseudo-class (web root does not track press via data-active).
|
|
31
|
+
// data-[hover=true] guard ensures active beats hover by specificity (0,3,0 > 0,2,0).
|
|
32
|
+
'web:active:data-[hover=true]:data-[checked=true]:bg-surface-action-strong-active', 'web:active:data-[hover=true]:data-[checked=true]:border-[--color-surface-action-strong-active]', 'web:active:data-[hover=true]:data-[indeterminate=true]:bg-surface-action-strong-active', 'web:active:data-[hover=true]:data-[indeterminate=true]:border-[--color-surface-action-strong-active]', 'web:active:data-[hover=true]:data-[checked=true]:data-[invalid=true]:bg-surface-danger-strong-active', 'web:active:data-[hover=true]:data-[checked=true]:data-[invalid=true]:border-[--color-surface-danger-strong-active]', 'web:active:data-[hover=true]:data-[indeterminate=true]:data-[invalid=true]:bg-surface-danger-strong-active', 'web:active:data-[hover=true]:data-[indeterminate=true]:data-[invalid=true]:border-[--color-surface-danger-strong-active]',
|
|
33
|
+
// Focus ring
|
|
34
|
+
'web:data-[focus-visible=true]:outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[--color-stroke-ring] web:data-[focus-visible=true]:ring-offset-2'].join(' '),
|
|
35
|
+
default: [
|
|
36
|
+
// Invalid bg is NOT styled on native. Compound data-[] selectors cannot express
|
|
37
|
+
// "invalid AND checked" without false-matching other states (Uniwind only evaluates
|
|
38
|
+
// the last condition). Invalid state is communicated via border-stroke-danger (single
|
|
39
|
+
// condition, always correct). The fill stays action-strong for checked/indeterminate.
|
|
40
|
+
//
|
|
41
|
+
// Active — native tracks press via data-[active] from usePress.
|
|
42
|
+
// Place data-[active=true] last so the rule only fires during press.
|
|
43
|
+
// 'data-[checked=false]:data-[invalid=true]:bg-transparent',
|
|
44
|
+
'data-[checked=true]:data-[invalid=true]:bg-surface-danger-strong', 'data-[checked=true]:data-[active=true]:bg-surface-action-strong-active', 'data-[checked=true]:data-[active=true]:data-[invalid=true]:bg-surface-danger-strong-active', 'data-[indeterminate=true]:data-[active=true]:bg-surface-action-strong-active'].join(' ')
|
|
45
|
+
})]);
|
|
46
|
+
export const checkboxIconVariants = cva(['text-white', 'h-5 w-5']);
|
|
47
|
+
export const checkboxLabelVariants = cva(['text-content-primary text-base', 'data-[disabled=true]:text-content-tertiary']);
|
|
53
48
|
export const checkboxGroupVariants = cva([], {
|
|
54
49
|
variants: {
|
|
55
50
|
direction: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","
|
|
1
|
+
{"version":3,"names":["Platform","cva","DISABLED_CURSOR","DISABLED_OPACITY","TRANSITION_COLORS","checkboxRootVariants","checkboxIndicatorVariants","select","web","join","default","checkboxIconVariants","checkboxLabelVariants","checkboxGroupVariants","variants","direction","column","row","defaultVariants"],"sourceRoot":"../../../../src","sources":["components/Checkbox/styles.ts"],"mappings":";;AAAA,SAASA,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O,MAAMW,qBAAqB,GAAGX,GAAG,CAAC,CACvC,gCAAgC,EAChC,4CAA4C,CAC7C,CAAC;AAEF,OAAO,MAAMY,qBAAqB,GAAGZ,GAAG,CAAC,EAAE,EAAE;EAC3Ca,QAAQ,EAAE;IACRC,SAAS,EAAE;MACTC,MAAM,EAAE,OAAO;MACfC,GAAG,EAAE;IACP;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,44 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { forwardRef, useMemo } from 'react';
|
|
4
|
+
import { Pressable, Text as RNText, View } from 'react-native';
|
|
5
|
+
import { createChip } from '@cdx-ui/primitives';
|
|
6
|
+
import { cn, ParentContext, useParentContext, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
7
|
+
import { Avatar } from '../Avatar';
|
|
6
8
|
import { Icon } from '../Icon';
|
|
7
|
-
import {
|
|
9
|
+
import { chipAvatarVariants, chipIconVariants, chipLabelVariants, chipRootVariants } from './styles';
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
11
|
const SCOPE = 'CHIP';
|
|
10
|
-
const
|
|
12
|
+
const RootView = withStyleContext(View, SCOPE);
|
|
13
|
+
const RootPressable = withStyleContext(Pressable, SCOPE);
|
|
14
|
+
const ChipPrimitive = createChip({
|
|
15
|
+
View: RootView,
|
|
16
|
+
Pressable: RootPressable
|
|
17
|
+
});
|
|
11
18
|
const useChipStyleContext = () => useStyleContext(SCOPE);
|
|
12
19
|
|
|
13
20
|
// =============================================================================
|
|
14
|
-
//
|
|
21
|
+
// ROOT
|
|
15
22
|
// =============================================================================
|
|
16
23
|
|
|
17
24
|
const ChipRoot = /*#__PURE__*/forwardRef(({
|
|
18
25
|
children,
|
|
26
|
+
variant = 'tint',
|
|
27
|
+
size = 'default',
|
|
19
28
|
color = 'default',
|
|
20
29
|
className,
|
|
21
30
|
style,
|
|
31
|
+
asChild,
|
|
22
32
|
...props
|
|
23
33
|
}, ref) => {
|
|
34
|
+
const parentContextValues = useParentContext();
|
|
35
|
+
const styleContextValues = useMemo(() => ({
|
|
36
|
+
...parentContextValues,
|
|
37
|
+
[SCOPE]: {
|
|
38
|
+
variant,
|
|
39
|
+
size,
|
|
40
|
+
color
|
|
41
|
+
}
|
|
42
|
+
}), [parentContextValues, variant, size, color]);
|
|
24
43
|
const computedClassName = cn(chipRootVariants({
|
|
44
|
+
variant,
|
|
45
|
+
size,
|
|
25
46
|
color
|
|
26
47
|
}), className);
|
|
27
|
-
|
|
48
|
+
const root = /*#__PURE__*/_jsx(ChipPrimitive, {
|
|
28
49
|
ref: ref,
|
|
50
|
+
asChild: asChild,
|
|
29
51
|
className: computedClassName,
|
|
30
|
-
style: style,
|
|
31
52
|
context: {
|
|
53
|
+
variant,
|
|
54
|
+
size,
|
|
32
55
|
color
|
|
33
56
|
},
|
|
57
|
+
style: style,
|
|
34
58
|
...props,
|
|
35
59
|
children: children
|
|
36
60
|
});
|
|
61
|
+
if (asChild) {
|
|
62
|
+
return /*#__PURE__*/_jsx(ParentContext.Provider, {
|
|
63
|
+
value: styleContextValues,
|
|
64
|
+
children: root
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return root;
|
|
37
68
|
});
|
|
38
69
|
ChipRoot.displayName = 'Chip';
|
|
39
70
|
|
|
40
71
|
// =============================================================================
|
|
41
|
-
//
|
|
72
|
+
// LABEL
|
|
42
73
|
// =============================================================================
|
|
43
74
|
|
|
44
75
|
const ChipLabel = /*#__PURE__*/forwardRef(({
|
|
@@ -48,9 +79,13 @@ const ChipLabel = /*#__PURE__*/forwardRef(({
|
|
|
48
79
|
...props
|
|
49
80
|
}, ref) => {
|
|
50
81
|
const {
|
|
82
|
+
size,
|
|
83
|
+
variant,
|
|
51
84
|
color
|
|
52
85
|
} = useChipStyleContext();
|
|
53
86
|
const computedClassName = cn(chipLabelVariants({
|
|
87
|
+
size,
|
|
88
|
+
variant,
|
|
54
89
|
color
|
|
55
90
|
}), className);
|
|
56
91
|
return /*#__PURE__*/_jsx(RNText, {
|
|
@@ -64,20 +99,24 @@ const ChipLabel = /*#__PURE__*/forwardRef(({
|
|
|
64
99
|
ChipLabel.displayName = 'Chip.Label';
|
|
65
100
|
|
|
66
101
|
// =============================================================================
|
|
67
|
-
//
|
|
102
|
+
// ICON
|
|
68
103
|
// =============================================================================
|
|
69
104
|
|
|
70
105
|
const ChipIcon = ({
|
|
71
106
|
className,
|
|
72
107
|
style,
|
|
73
108
|
as,
|
|
109
|
+
slot,
|
|
74
110
|
...props
|
|
75
111
|
}) => {
|
|
76
112
|
const {
|
|
113
|
+
size,
|
|
77
114
|
color
|
|
78
115
|
} = useChipStyleContext();
|
|
79
116
|
const computedClassName = cn(chipIconVariants({
|
|
80
|
-
|
|
117
|
+
size,
|
|
118
|
+
color,
|
|
119
|
+
slot
|
|
81
120
|
}), className);
|
|
82
121
|
return /*#__PURE__*/_jsx(Icon, {
|
|
83
122
|
as: as,
|
|
@@ -89,11 +128,41 @@ const ChipIcon = ({
|
|
|
89
128
|
ChipIcon.displayName = 'Chip.Icon';
|
|
90
129
|
|
|
91
130
|
// =============================================================================
|
|
92
|
-
//
|
|
131
|
+
// AVATAR
|
|
132
|
+
// =============================================================================
|
|
133
|
+
|
|
134
|
+
const ChipAvatar = ({
|
|
135
|
+
className,
|
|
136
|
+
style,
|
|
137
|
+
children,
|
|
138
|
+
...props
|
|
139
|
+
}) => {
|
|
140
|
+
const {
|
|
141
|
+
size
|
|
142
|
+
} = useChipStyleContext();
|
|
143
|
+
// chipAvatarVariants sets w/h and the leading slot negative margin.
|
|
144
|
+
// Avatar renders with size="sm" (its smallest named size) but chipAvatarVariants
|
|
145
|
+
// overrides the w/h via tailwind-merge so the chip size wins.
|
|
146
|
+
const computedClassName = cn(chipAvatarVariants({
|
|
147
|
+
size
|
|
148
|
+
}), className);
|
|
149
|
+
return /*#__PURE__*/_jsx(Avatar, {
|
|
150
|
+
size: "sm",
|
|
151
|
+
className: computedClassName,
|
|
152
|
+
style: style,
|
|
153
|
+
...props,
|
|
154
|
+
children: children
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
ChipAvatar.displayName = 'Chip.Avatar';
|
|
158
|
+
|
|
159
|
+
// =============================================================================
|
|
160
|
+
// COMPOUND EXPORT
|
|
93
161
|
// =============================================================================
|
|
94
162
|
|
|
95
163
|
export const Chip = Object.assign(ChipRoot, {
|
|
96
164
|
Label: ChipLabel,
|
|
97
|
-
Icon: ChipIcon
|
|
165
|
+
Icon: ChipIcon,
|
|
166
|
+
Avatar: ChipAvatar
|
|
98
167
|
});
|
|
99
168
|
//# sourceMappingURL=index.js.map
|