@cdx-ui/components 0.0.1-beta.5 → 0.0.1-beta.50
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 +28 -18
- package/lib/commonjs/components/AlertDialog/index.js +1 -1
- 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 +12 -1
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +26 -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 +39 -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/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/styles.js +9 -9
- 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/Avatar.figma.js +54 -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/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/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 +29 -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/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/styles/primitives.js +43 -6
- package/lib/commonjs/styles/primitives.js.map +1 -1
- package/lib/module/components/AlertDialog/index.js +1 -1
- 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 +13 -2
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +26 -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 +40 -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/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/styles.js +10 -10
- 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/Avatar.figma.js +48 -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/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/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 +23 -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/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/styles/primitives.js +43 -6
- package/lib/module/styles/primitives.js.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 +3 -3
- 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/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/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/Avatar.figma.d.ts +8 -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/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/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 +8 -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/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/styles/primitives.d.ts +38 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/AlertDialog/index.tsx +1 -1
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Avatar/styles.ts +49 -34
- package/src/components/Button/index.tsx +37 -3
- package/src/components/Button/styles.ts +27 -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 +82 -86
- package/src/components/Chip/index.tsx +104 -27
- package/src/components/Chip/styles.ts +232 -18
- 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/styles.ts +12 -19
- 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/metro/withCdxMetroConfig.ts +4 -29
- package/src/metro/withForgeMetroConfig.ts +29 -0
- package/src/styles/primitives.ts +43 -6
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Pressable, Text, View } from 'react-native';
|
|
5
|
+
import { createRadio, dataAttributes } from '@cdx-ui/primitives';
|
|
6
|
+
import { cn } from '@cdx-ui/utils';
|
|
7
|
+
import { radioGroupVariants, radioIndicatorVariants, radioInnerDotVariants, radioLabelVariants, radioRootVariants } from './styles';
|
|
8
|
+
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// STYLED INDICATOR BASE
|
|
11
|
+
// =============================================================================
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const RadioIndicatorBase = /*#__PURE__*/forwardRef(({
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
style,
|
|
17
|
+
...props
|
|
18
|
+
}, ref) => {
|
|
19
|
+
// On web, data attributes arrive as `dataSet: { checked: true }`.
|
|
20
|
+
// On native, they arrive as individual `data-checked: "true"` props.
|
|
21
|
+
const ds = props.dataSet;
|
|
22
|
+
const isChecked = ds ? ds.checked === true : props['data-checked'] === 'true';
|
|
23
|
+
const isInvalid = ds ? ds.invalid === true : props['data-invalid'] === 'true';
|
|
24
|
+
const isHovered = ds ? ds.hover === true : props['data-hover'] === 'true';
|
|
25
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
className: cn(radioIndicatorVariants(), className),
|
|
28
|
+
style: style,
|
|
29
|
+
...props,
|
|
30
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
31
|
+
className: cn(radioInnerDotVariants()),
|
|
32
|
+
...dataAttributes({
|
|
33
|
+
checked: isChecked,
|
|
34
|
+
invalid: isInvalid,
|
|
35
|
+
hover: isHovered
|
|
36
|
+
})
|
|
37
|
+
}), children]
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
RadioIndicatorBase.displayName = 'Radio.IndicatorBase';
|
|
41
|
+
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// PRIMITIVE ASSEMBLY
|
|
44
|
+
// =============================================================================
|
|
45
|
+
|
|
46
|
+
const RadioPrimitive = createRadio({
|
|
47
|
+
Root: Pressable,
|
|
48
|
+
Indicator: RadioIndicatorBase,
|
|
49
|
+
Label: Text,
|
|
50
|
+
Group: View
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// =============================================================================
|
|
54
|
+
// RADIO ROOT
|
|
55
|
+
// =============================================================================
|
|
56
|
+
|
|
57
|
+
const RadioRoot = /*#__PURE__*/forwardRef(({
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
style,
|
|
61
|
+
...props
|
|
62
|
+
}, ref) => {
|
|
63
|
+
const computedClassName = cn(radioRootVariants(), className);
|
|
64
|
+
return /*#__PURE__*/_jsx(RadioPrimitive, {
|
|
65
|
+
ref: ref,
|
|
66
|
+
className: computedClassName,
|
|
67
|
+
style: style,
|
|
68
|
+
...props,
|
|
69
|
+
children: children
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
RadioRoot.displayName = 'Radio';
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// RADIO INDICATOR
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
const RadioIndicator = /*#__PURE__*/forwardRef(({
|
|
79
|
+
className,
|
|
80
|
+
children,
|
|
81
|
+
style,
|
|
82
|
+
...props
|
|
83
|
+
}, ref) => {
|
|
84
|
+
return /*#__PURE__*/_jsx(RadioPrimitive.Indicator, {
|
|
85
|
+
ref: ref,
|
|
86
|
+
className: className,
|
|
87
|
+
style: style,
|
|
88
|
+
...props,
|
|
89
|
+
children: children
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
RadioIndicator.displayName = 'Radio.Indicator';
|
|
93
|
+
|
|
94
|
+
// =============================================================================
|
|
95
|
+
// RADIO LABEL
|
|
96
|
+
// =============================================================================
|
|
97
|
+
|
|
98
|
+
const RadioLabel = /*#__PURE__*/forwardRef(({
|
|
99
|
+
className,
|
|
100
|
+
children,
|
|
101
|
+
style,
|
|
102
|
+
...props
|
|
103
|
+
}, ref) => {
|
|
104
|
+
const computedClassName = cn(radioLabelVariants(), className);
|
|
105
|
+
return /*#__PURE__*/_jsx(RadioPrimitive.Label, {
|
|
106
|
+
ref: ref,
|
|
107
|
+
className: computedClassName,
|
|
108
|
+
style: style,
|
|
109
|
+
...props,
|
|
110
|
+
children: children
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
RadioLabel.displayName = 'Radio.Label';
|
|
114
|
+
|
|
115
|
+
// =============================================================================
|
|
116
|
+
// RADIO GROUP
|
|
117
|
+
// =============================================================================
|
|
118
|
+
|
|
119
|
+
const RadioGroup = /*#__PURE__*/forwardRef(({
|
|
120
|
+
className,
|
|
121
|
+
children,
|
|
122
|
+
style,
|
|
123
|
+
direction = 'column',
|
|
124
|
+
value,
|
|
125
|
+
defaultValue,
|
|
126
|
+
onChange,
|
|
127
|
+
isDisabled,
|
|
128
|
+
isInvalid,
|
|
129
|
+
isRequired,
|
|
130
|
+
isReadOnly,
|
|
131
|
+
name,
|
|
132
|
+
...viewProps
|
|
133
|
+
}, ref) => {
|
|
134
|
+
const computedClassName = cn(radioGroupVariants({
|
|
135
|
+
direction
|
|
136
|
+
}), className);
|
|
137
|
+
return /*#__PURE__*/_jsx(RadioPrimitive.Group, {
|
|
138
|
+
ref: ref,
|
|
139
|
+
className: computedClassName,
|
|
140
|
+
style: style,
|
|
141
|
+
value: value,
|
|
142
|
+
defaultValue: defaultValue,
|
|
143
|
+
onChange: onChange,
|
|
144
|
+
isDisabled: isDisabled,
|
|
145
|
+
isInvalid: isInvalid,
|
|
146
|
+
isRequired: isRequired,
|
|
147
|
+
isReadOnly: isReadOnly,
|
|
148
|
+
name: name,
|
|
149
|
+
...viewProps,
|
|
150
|
+
children: children
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
RadioGroup.displayName = 'Radio.Group';
|
|
154
|
+
|
|
155
|
+
// =============================================================================
|
|
156
|
+
// COMPOUND COMPONENT
|
|
157
|
+
// =============================================================================
|
|
158
|
+
|
|
159
|
+
export const Radio = Object.assign(RadioRoot, {
|
|
160
|
+
Indicator: RadioIndicator,
|
|
161
|
+
Label: RadioLabel,
|
|
162
|
+
Group: RadioGroup
|
|
163
|
+
});
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","Text","View","createRadio","dataAttributes","cn","radioGroupVariants","radioIndicatorVariants","radioInnerDotVariants","radioLabelVariants","radioRootVariants","jsx","_jsx","jsxs","_jsxs","RadioIndicatorBase","className","children","style","props","ref","ds","dataSet","isChecked","checked","isInvalid","invalid","isHovered","hover","displayName","RadioPrimitive","Root","Indicator","Label","Group","RadioRoot","computedClassName","RadioIndicator","RadioLabel","RadioGroup","direction","value","defaultValue","onChange","isDisabled","isRequired","isReadOnly","name","viewProps","Radio","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Radio/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,SAAS,EAAEC,IAAI,EAAkBC,IAAI,QAAwB,cAAc;AACpF,SAASC,WAAW,EAAEC,cAAc,QAA0B,oBAAoB;AAClF,SAASC,EAAE,QAAQ,eAAe;AAClC,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,qBAAqB,EACrBC,kBAAkB,EAClBC,iBAAiB,QACZ,UAAU;;AAEjB;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEA,MAAMC,kBAAkB,gBAAGhB,UAAU,CACnC,CAAC;EAAEiB,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACjD;EACA;EACA,MAAMC,EAAE,GAAIF,KAAK,CAASG,OAAO;EACjC,MAAMC,SAAS,GAAGF,EAAE,GAAGA,EAAE,CAACG,OAAO,KAAK,IAAI,GAAIL,KAAK,CAAS,cAAc,CAAC,KAAK,MAAM;EACtF,MAAMM,SAAS,GAAGJ,EAAE,GAAGA,EAAE,CAACK,OAAO,KAAK,IAAI,GAAIP,KAAK,CAAS,cAAc,CAAC,KAAK,MAAM;EACtF,MAAMQ,SAAS,GAAGN,EAAE,GAAGA,EAAE,CAACO,KAAK,KAAK,IAAI,GAAIT,KAAK,CAAS,YAAY,CAAC,KAAK,MAAM;EAElF,oBACEL,KAAA,CAACZ,IAAI;IAACkB,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEX,EAAE,CAACE,sBAAsB,CAAC,CAAC,EAAES,SAAS,CAAE;IAACE,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,gBACzFL,IAAA,CAACV,IAAI;MACHc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UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBC,IAAI,EAAEA,IAAK;IAAA,GACPC,SAAS;IAAA/B,QAAA,EAEZA;EAAQ,CACW,CAAC;AAE3B,CACF,CAAC;AAEDsB,UAAU,CAACV,WAAW,GAAG,aAAa;;AAEtC;AACA;AACA;;AAQA,OAAO,MAAMoB,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAChB,SAAS,EAAE;EAC5CH,SAAS,EAAEK,cAAc;EACzBJ,KAAK,EAAEK,UAAU;EACjBJ,KAAK,EAAEK;AACT,CAAC,CAA2B","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
|
+
export const radioRootVariants = cva(['flex-row items-center gap-2', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', DISABLED_CURSOR]);
|
|
7
|
+
export const radioIndicatorVariants = cva(['items-center justify-center', 'rounded-[var(--border-radius-round)]', 'border-2', 'h-5 w-5', 'bg-surface-primary', 'data-[checked=false]:border-content-secondary', 'data-[checked=true]:border-stroke-action', 'data-[invalid=true]:border-stroke-danger', 'data-[checked=true]:data-[invalid=true]:border-stroke-danger', Platform.select({
|
|
8
|
+
web: [TRANSITION_COLORS, 'data-[hover=true]:data-[checked=true]:border-surface-action-strong-hover', 'data-[hover=true]:data-[invalid=true]:border-surface-danger-strong-hover', 'web:data-[focus-visible=true]:outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-[var(--color-stroke-ring)] web:data-[focus-visible=true]:ring-offset-2'].join(' '),
|
|
9
|
+
default: ''
|
|
10
|
+
})]);
|
|
11
|
+
export const radioInnerDotVariants = cva(['rounded-[var(--border-radius-round)]', 'h-2.5 w-2.5', 'scale-0', 'data-[checked=true]:scale-100', 'bg-surface-action-strong', 'data-[invalid=true]:bg-surface-danger-strong', Platform.select({
|
|
12
|
+
web: ['data-[hover=true]:bg-surface-action-strong-hover', 'data-[hover=true]:data-[invalid=true]:bg-surface-danger-strong-hover'].join(' '),
|
|
13
|
+
default: ''
|
|
14
|
+
})]);
|
|
15
|
+
export const radioLabelVariants = cva(['body-md', 'text-content-primary']);
|
|
16
|
+
export const radioGroupVariants = cva([], {
|
|
17
|
+
variants: {
|
|
18
|
+
direction: {
|
|
19
|
+
column: 'gap-2',
|
|
20
|
+
row: 'flex-row gap-4'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
direction: 'column'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","cva","DISABLED_CURSOR","TRANSITION_COLORS","radioRootVariants","radioIndicatorVariants","select","web","join","default","radioInnerDotVariants","radioLabelVariants","radioGroupVariants","variants","direction","column","row","defaultVariants"],"sourceRoot":"../../../../src","sources":["components/Radio/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,yBAAyB;AAE5E,OAAO,MAAMC,iBAAiB,GAAGH,GAAG,CAAC,CACnC,6BAA6B,EAC7B,wDAAwD,EACxDC,eAAe,CAChB,CAAC;AAEF,OAAO,MAAMG,sBAAsB,GAAGJ,GAAG,CAAC,CACxC,6BAA6B,EAC7B,sCAAsC,EACtC,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,+CAA+C,EAC/C,0CAA0C,EAC1C,0CAA0C,EAC1C,8DAA8D,EAC9DD,QAAQ,CAACM,MAAM,CAAC;EACdC,GAAG,EAAE,CACHJ,iBAAiB,EACjB,0EAA0E,EAC1E,0EAA0E,EAC1E,4CAA4C,EAC5C,gJAAgJ,CACjJ,CAACK,IAAI,CAAC,GAAG,CAAC;EACXC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,CAAC;AAEF,OAAO,MAAMC,qBAAqB,GAAGT,GAAG,CAAC,CACvC,sCAAsC,EACtC,aAAa,EACb,SAAS,EACT,+BAA+B,EAC/B,0BAA0B,EAC1B,8CAA8C,EAC9CD,QAAQ,CAACM,MAAM,CAAC;EACdC,GAAG,EAAE,CACH,kDAAkD,EAClD,sEAAsE,CACvE,CAACC,IAAI,CAAC,GAAG,CAAC;EACXC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,CAAC;AAEF,OAAO,MAAME,kBAAkB,GAAGV,GAAG,CAAC,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAE1E,OAAO,MAAMW,kBAAkB,GAAGX,GAAG,CAAC,EAAE,EAAE;EACxCY,QAAQ,EAAE;IACRC,SAAS,EAAE;MACTC,MAAM,EAAE,OAAO;MACfC,GAAG,EAAE;IACP;EACF,CAAC;EACDC,eAAe,EAAE;IAAEH,SAAS,EAAE;EAAS;AACzC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { ScopedTheme as UniwindScopedTheme } from 'uniwind';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
/**
|
|
6
|
+
* Forces a specific theme on a component subtree, regardless of the application's
|
|
7
|
+
* global theme. Useful for marketing heroes, embedded widgets, or preview surfaces
|
|
8
|
+
* that must render in a fixed mode.
|
|
9
|
+
*
|
|
10
|
+
* Wraps Uniwind's `ScopedTheme` to keep `uniwind` an internal implementation detail.
|
|
11
|
+
*
|
|
12
|
+
* Web requires `@custom-variant dark (&:where(.dark, .dark *));` in the consuming
|
|
13
|
+
* app's `global.css`. See the Storybook story (`Theming/ScopedTheme`) for the full
|
|
14
|
+
* mechanism, light-vs-dark asymmetry, and dynamic-switch caveat.
|
|
15
|
+
*/
|
|
16
|
+
export const ScopedTheme = props => /*#__PURE__*/_jsx(UniwindScopedTheme, {
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScopedTheme","UniwindScopedTheme","jsx","_jsx","props"],"sourceRoot":"../../../../src","sources":["components/ScopedTheme/index.tsx"],"mappings":";;AACA,SAASA,WAAW,IAAIC,kBAAkB,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMH,WAAW,GAAII,KAAuB,iBAAKD,IAAA,CAACF,kBAAkB;EAAA,GAAKG;AAAK,CAAG,CAAC","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
4
|
import { StyleSheet } from 'react-native';
|
|
5
|
+
import { domDataAttributes } from '@cdx-ui/primitives';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
/** Props that must not be forwarded to a DOM `<button>`. */
|
|
7
8
|
const OMIT = new Set(['hitSlop', 'pressRetentionOffset', 'android_ripple', 'android_disableSound', 'unstable_pressDelay', 'onLongPress', 'delayLongPress', 'onPress', 'onPressIn', 'onPressOut', 'onHoverIn', 'onHoverOut', 'disabled', 'style', 'className', 'testID', 'children', 'accessible', 'accessibilityActions', 'accessibilityElementsHidden', 'accessibilityHint', 'accessibilityIgnoresInvertColors', 'accessibilityLabel', 'accessibilityLabelledBy', 'accessibilityLiveRegion', 'accessibilityRole', 'accessibilityState', 'accessibilityValue', 'accessibilityViewIsModal', 'importantForAccessibility', 'needsOffscreenAlphaCompositing', 'collapsable', 'shouldRasterizeIOS', 'removeClippedSubviews', 'onAccessibilityAction', 'onAccessibilityEscape', 'onAccessibilityTap']);
|
|
@@ -51,13 +52,16 @@ export const SelectTriggerHost = /*#__PURE__*/forwardRef(function SelectTriggerH
|
|
|
51
52
|
style,
|
|
52
53
|
className,
|
|
53
54
|
testID,
|
|
55
|
+
dataSet,
|
|
54
56
|
...rest
|
|
55
57
|
} = props;
|
|
56
58
|
const domProps = filterDomProps(rest);
|
|
59
|
+
const dataAttrs = domDataAttributes(dataSet ?? {});
|
|
57
60
|
const flattened = StyleSheet.flatten(style);
|
|
58
61
|
return /*#__PURE__*/_jsx("button", {
|
|
59
62
|
ref: ref,
|
|
60
63
|
...domProps,
|
|
64
|
+
...dataAttrs,
|
|
61
65
|
type: "button",
|
|
62
66
|
disabled: !!disabled,
|
|
63
67
|
className: typeof className === 'string' ? className : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","StyleSheet","jsx","_jsx","OMIT","Set","resolveChildren","children","pressed","filterDomProps","rest","entries","Object","filter","key","has","fromEntries","webButtonLayoutStyle","display","flexDirection","alignItems","justifyContent","width","minWidth","textAlign","boxSizing","margin","font","lineHeight","WebkitAppearance","appearance","SelectTriggerHost","props","ref","onPress","onPressIn","onPressOut","onHoverIn","onHoverOut","disabled","style","className","testID","domProps","flattened","flatten","type","undefined","onClick","e","onPointerDown","onPointerUp","onPointerCancel","onMouseEnter","onMouseLeave","displayName"],"sourceRoot":"../../../../src","sources":["components/Select/SelectTriggerHost.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","forwardRef","StyleSheet","domDataAttributes","jsx","_jsx","OMIT","Set","resolveChildren","children","pressed","filterDomProps","rest","entries","Object","filter","key","has","fromEntries","webButtonLayoutStyle","display","flexDirection","alignItems","justifyContent","width","minWidth","textAlign","boxSizing","margin","font","lineHeight","WebkitAppearance","appearance","SelectTriggerHost","props","ref","onPress","onPressIn","onPressOut","onHoverIn","onHoverOut","disabled","style","className","testID","dataSet","domProps","dataAttrs","flattened","flatten","type","undefined","onClick","e","onPointerDown","onPointerUp","onPointerCancel","onMouseEnter","onMouseLeave","displayName"],"sourceRoot":"../../../../src","sources":["components/Select/SelectTriggerHost.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,iBAAiB,QAAoC,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOnF;AACA,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAC3B,SAAS,EACT,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,EACnB,kCAAkC,EAClC,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,gCAAgC,EAChC,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,CACrB,CAAC;AAEF,SAASC,eAAeA,CAACC,QAAoC,EAAmB;EAC9E,IAAI,OAAOA,QAAQ,KAAK,UAAU,EAAE;IAClC,OAAOA,QAAQ,CAAC;MAAEC,OAAO,EAAE;IAAM,CAAC,CAAC;EACrC;EACA,OAAOD,QAAQ;AACjB;AAEA,SAASE,cAAcA,CAACC,IAAY,EAAiD;EACnF,MAAMC,OAAO,GAAGC,MAAM,CAACD,OAAO,CAACD,IAAI,CAAC,CAACG,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,KAAK,CAACV,IAAI,CAACW,GAAG,CAACD,GAAG,CA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;IAAE,CAAE;IACzD,eAAaJ,MAAO;IACpBQ,OAAO,EAAGC,CAAC,IAAK;MACd,IAAI,CAACZ,QAAQ,EAAE;QACbL,OAAO,GAAGiB,CAAqE,CAAC;MAClF;IACF,CAAE;IACFC,aAAa,EAAGD,CAAC,IAAK;MACpBhB,SAAS,GAAGgB,CAAuE,CAAC;IACtF,CAAE;IACFE,WAAW,EAAGF,CAAC,IAAK;MAClBf,UAAU,GAAGe,CAAwE,CAAC;IACxF,CAAE;IACFG,eAAe,EAAGH,CAAC,IAAK;MACtBf,UAAU,GAAGe,CAAwE,CAAC;IACxF,CAAE;IACFI,YAAY,EAAGJ,CAAC,IAAK;MACnBd,SAAS,GAAGc,CAAuE,CAAC;IACtF,CAAE;IACFK,YAAY,EAAGL,CAAC,IAAK;MACnBb,UAAU,GAAGa,CAAwE,CAAC;IACxF,CAAE;IAAA5C,QAAA,EAEDD,eAAe,CAACC,QAAQ;EAAC,CACpB,CAAC;AAEb,CACF,CAAC;AAEDwB,iBAAiB,CAAC0B,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { Pressable, Text, View } from 'react-native';
|
|
5
|
-
import {
|
|
5
|
+
import { KeyboardArrowDown } from '@cdx-ui/icons';
|
|
6
6
|
import { createSelect } from '@cdx-ui/primitives';
|
|
7
7
|
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
8
8
|
import { Icon } from '../Icon';
|
|
@@ -72,7 +72,7 @@ const SelectTrigger = /*#__PURE__*/forwardRef(({
|
|
|
72
72
|
style: style,
|
|
73
73
|
...props,
|
|
74
74
|
children: [children, /*#__PURE__*/_jsx(SelectIcon, {
|
|
75
|
-
as:
|
|
75
|
+
as: KeyboardArrowDown
|
|
76
76
|
})]
|
|
77
77
|
});
|
|
78
78
|
});
|
|
@@ -109,6 +109,7 @@ SelectValue.displayName = 'Select.Value';
|
|
|
109
109
|
const SelectIcon = ({
|
|
110
110
|
className,
|
|
111
111
|
style,
|
|
112
|
+
as: IconComponent,
|
|
112
113
|
...props
|
|
113
114
|
}) => {
|
|
114
115
|
const {
|
|
@@ -117,10 +118,15 @@ const SelectIcon = ({
|
|
|
117
118
|
const computedClassName = cn(selectIconVariants({
|
|
118
119
|
size
|
|
119
120
|
}), className);
|
|
120
|
-
|
|
121
|
+
const iconSizeClass = size === 'small' ? 'size-4' : 'size-5';
|
|
122
|
+
return /*#__PURE__*/_jsx(SelectPrimitive.Icon, {
|
|
121
123
|
className: computedClassName,
|
|
122
124
|
style: style,
|
|
123
|
-
|
|
125
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
126
|
+
as: IconComponent,
|
|
127
|
+
className: iconSizeClass,
|
|
128
|
+
...props
|
|
129
|
+
})
|
|
124
130
|
});
|
|
125
131
|
};
|
|
126
132
|
SelectIcon.displayName = 'Select.Icon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","Pressable","Text","View","
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","Text","View","KeyboardArrowDown","createSelect","cn","useStyleContext","withStyleContext","Icon","SelectTriggerHost","selectContentVariants","selectIconVariants","selectItemLabelVariants","selectItemVariants","selectTriggerVariants","selectValueVariants","jsx","_jsx","jsxs","_jsxs","SCOPE","Root","useSelectStyleContext","SelectPrimitive","Trigger","Value","Content","Item","ItemLabel","SelectRoot","variant","size","className","children","style","props","ref","context","displayName","SelectTrigger","computedClassName","SelectIcon","as","SelectValue","IconComponent","iconSizeClass","SelectContent","SelectItem","SelectItemLabel","Select","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Select/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,SAAS,EAAEC,IAAI,EAAkBC,IAAI,QAAwB,cAAc;AACpF,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SACEC,YAAY,QAOP,oBAAoB;AAC3B,SA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kBAAkB,CAAC;IAAEkB;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAErE,oBACEf,IAAA,CAACM,eAAe,CAACI,IAAI;IAACS,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEQ,iBAAkB;IAACN,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,EAClFA;EAAQ,CACW,CAAC;AAE3B,CACF,CAAC;AAEDc,UAAU,CAACT,WAAW,GAAG,aAAa;;AAEtC;AACA;AACA;;AAMA,MAAMU,eAAe,gBAAGjD,UAAU,CAChC,CAAC;EAAEiC,SAAS;EAAEE,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACvC,MAAM;IAAEL;EAAK,CAAC,GAAGT,qBAAqB,CAAC,CAAC;EAExC,MAAMkB,iBAAiB,GAAGnC,EAAE,CAACO,uBAAuB,CAAC;IAAEmB;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAE1E,oBACEf,IAAA,CAACM,eAAe,CAACK,SAAS;IAACQ,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEQ,iBAAkB;IAACN,KAAK,EAAEA,KAAM;IAAA,GAAKC;EAAK,CAAG,CAAC;AAElG,CACF,CAAC;AAEDa,eAAe,CAACV,WAAW,GAAG,kBAAkB;;AAEhD;AACA;AACA;;AAWA,OAAO,MAAMW,MAAM,GAAGC,MAAM,CAACC,MAAM,CAACtB,UAAU,EAAE;EAC9CL,OAAO,EAAEe,aAAa;EACtBd,KAAK,EAAEkB,WAAW;EAClBnC,IAAI,EAAEiC,UAAU;EAChBf,OAAO,EAAEoB,aAAa;EACtBnB,IAAI,EAAEoB,UAAU;EAChBnB,SAAS,EAAEoB;AACb,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -2,21 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
-
import {
|
|
5
|
+
import { DISABLED_CURSOR, TRANSITION_COLORS } from '../../styles/primitives';
|
|
6
6
|
|
|
7
7
|
// ── Trigger ─────────────────────────────────────────────────
|
|
8
8
|
|
|
9
|
-
export const selectTriggerVariants = cva(['flex w-full min-w-0 flex-row items-center justify-between text-start',
|
|
10
|
-
default: 'data-[active=true]:border-slate-300',
|
|
11
|
-
web: ['data-[hover=true]:border-slate-300 data-[active=true]:data-[hover=true]:border-slate-400', 'data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-slate-400/50 data-[focus-visible=true]:ring-offset-2', 'data-[state=open]:ring-2 data-[state=open]:ring-slate-400/50'].join(' ')
|
|
12
|
-
})], {
|
|
9
|
+
export const selectTriggerVariants = cva(['flex w-full min-w-0 flex-row items-center justify-between text-start', 'bg-surface-primary', 'border border-stroke-primary', 'rounded-[var(--border-radius-default)]', TRANSITION_COLORS, 'data-[disabled=true]:bg-surface-secondary', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', DISABLED_CURSOR, 'data-[readonly=true]:cursor-default', 'data-[readonly=true]:bg-surface-secondary', 'web:data-[hover=true]:data-[focus=false]:data-[invalid=false]:border-stroke-hover', 'data-[focus=true]:border-[length:var(--border-width-focused)]', 'data-[focus=true]:data-[invalid=false]:border-stroke-action', 'data-[focus=true]:data-[invalid=true]:border-stroke-danger', 'data-[state=open]:border-[length:var(--border-width-focused)]', 'data-[state=open]:data-[invalid=false]:border-stroke-action', 'data-[state=open]:data-[invalid=true]:border-stroke-danger', 'data-[invalid=true]:border-stroke-danger'], {
|
|
13
10
|
variants: {
|
|
14
11
|
variant: {
|
|
15
12
|
outline: []
|
|
16
13
|
},
|
|
17
14
|
size: {
|
|
18
|
-
default:
|
|
19
|
-
small:
|
|
15
|
+
default: ['h-11 min-h-11 px-4 py-3 gap-4', 'data-[focus=true]:px-[calc(var(--spacing-4)-var(--spacing-px))]', 'data-[focus=true]:py-[calc(var(--spacing-3)-var(--spacing-px))]', 'data-[state=open]:px-[calc(var(--spacing-4)-var(--spacing-px))]', 'data-[state=open]:py-[calc(var(--spacing-3)-var(--spacing-px))]'],
|
|
16
|
+
small: ['h-8 min-h-8 px-3 py-2 gap-1.5', 'data-[focus=true]:px-[calc(var(--spacing-3)-var(--spacing-px))]', 'data-[focus=true]:py-[calc(var(--spacing-2)-var(--spacing-px))]', 'data-[state=open]:px-[calc(var(--spacing-3)-var(--spacing-px))]', 'data-[state=open]:py-[calc(var(--spacing-2)-var(--spacing-px))]']
|
|
20
17
|
}
|
|
21
18
|
},
|
|
22
19
|
defaultVariants: {
|
|
@@ -27,11 +24,11 @@ export const selectTriggerVariants = cva(['flex w-full min-w-0 flex-row items-ce
|
|
|
27
24
|
|
|
28
25
|
// ── Value ───────────────────────────────────────────────────
|
|
29
26
|
|
|
30
|
-
export const selectValueVariants = cva(['min-w-0 flex-1 text-start', 'data-[placeholder=true]:text-
|
|
27
|
+
export const selectValueVariants = cva(['min-w-0 flex-1 text-start', 'text-content-primary', 'data-[placeholder=true]:text-content-tertiary', 'data-[invalid=true]:text-content-danger'], {
|
|
31
28
|
variants: {
|
|
32
29
|
size: {
|
|
33
|
-
default:
|
|
34
|
-
small:
|
|
30
|
+
default: 'text-[0.875rem]',
|
|
31
|
+
small: 'text-[0.75rem]'
|
|
35
32
|
}
|
|
36
33
|
},
|
|
37
34
|
defaultVariants: {
|
|
@@ -41,11 +38,11 @@ export const selectValueVariants = cva(['min-w-0 flex-1 text-start', 'data-[plac
|
|
|
41
38
|
|
|
42
39
|
// ── Icon ────────────────────────────────────────────────────
|
|
43
40
|
|
|
44
|
-
export const selectIconVariants = cva(['shrink-0 items-center justify-center self-center',
|
|
41
|
+
export const selectIconVariants = cva(['shrink-0 items-center justify-center self-center', 'text-content-tertiary', 'data-[invalid=true]:text-content-danger', 'data-[state=open]:rotate-180'], {
|
|
45
42
|
variants: {
|
|
46
43
|
size: {
|
|
47
|
-
default: '
|
|
48
|
-
small: '
|
|
44
|
+
default: 'size-5',
|
|
45
|
+
small: 'size-4'
|
|
49
46
|
}
|
|
50
47
|
},
|
|
51
48
|
defaultVariants: {
|
|
@@ -55,16 +52,16 @@ export const selectIconVariants = cva(['shrink-0 items-center justify-center sel
|
|
|
55
52
|
|
|
56
53
|
// ── Content ─────────────────────────────────────────────────
|
|
57
54
|
|
|
58
|
-
export const selectContentVariants = cva([
|
|
59
|
-
web:
|
|
55
|
+
export const selectContentVariants = cva(['bg-surface-primary', 'border border-stroke-secondary', 'overflow-hidden', 'rounded-xl', Platform.select({
|
|
56
|
+
web: 'shadow-sm',
|
|
60
57
|
default: ''
|
|
61
58
|
}), 'max-h-60', 'py-1']);
|
|
62
59
|
|
|
63
60
|
// ── Item ────────────────────────────────────────────────────
|
|
64
61
|
|
|
65
|
-
export const selectItemVariants = cva(['flex-row items-center', 'transition-colors duration-100', 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none', 'data-[state=checked]:bg-
|
|
66
|
-
default: 'data-[active=true]:bg-
|
|
67
|
-
web: 'data-[hover=true]:bg-
|
|
62
|
+
export const selectItemVariants = cva(['flex-row items-center', 'transition-colors duration-100', 'data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none', 'data-[state=checked]:bg-surface-action-tint data-[state=checked]:font-medium', Platform.select({
|
|
63
|
+
default: 'data-[active=true]:bg-surface-action-tint-active',
|
|
64
|
+
web: 'data-[hover=true]:bg-surface-action-tint-hover data-[active=true]:data-[hover=true]:bg-surface-action-tint-active data-[highlighted=true]:bg-surface-action-tint-hover'
|
|
68
65
|
})], {
|
|
69
66
|
variants: {
|
|
70
67
|
size: {
|
|
@@ -79,11 +76,11 @@ export const selectItemVariants = cva(['flex-row items-center', 'transition-colo
|
|
|
79
76
|
|
|
80
77
|
// ── ItemLabel ───────────────────────────────────────────────
|
|
81
78
|
|
|
82
|
-
export const selectItemLabelVariants = cva([
|
|
79
|
+
export const selectItemLabelVariants = cva(['text-content-primary', 'data-[state=checked]:font-medium'], {
|
|
83
80
|
variants: {
|
|
84
81
|
size: {
|
|
85
|
-
default:
|
|
86
|
-
small:
|
|
82
|
+
default: 'text-[0.875rem]',
|
|
83
|
+
small: 'text-[0.75rem]'
|
|
87
84
|
}
|
|
88
85
|
},
|
|
89
86
|
defaultVariants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","
|
|
1
|
+
{"version":3,"names":["Platform","cva","DISABLED_CURSOR","TRANSITION_COLORS","selectTriggerVariants","variants","variant","outline","size","default","small","defaultVariants","selectValueVariants","selectIconVariants","selectContentVariants","select","web","selectItemVariants","selectItemLabelVariants"],"sourceRoot":"../../../../src","sources":["components/Select/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AACjE,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,yBAAyB;;AAE5E;;AAEA,OAAO,MAAMC,qBAAqB,GAAGH,GAAG,CACtC,CACE,sEAAsE,EACtE,oBAAoB,EACpB,8BAA8B,EAC9B,wCAAwC,EACxCE,iBAAiB,EACjB,2CAA2C,EAC3C,wDAAwD,EACxDD,eAAe,EACf,qCAAqC,EACrC,2CAA2C,EAC3C,mFAAmF,EACnF,+DAA+D,EAC/D,6DAA6D,EAC7D,4DAA4D,EAC5D,+DAA+D,EAC/D,6DAA6D,EAC7D,4DAA4D,EAC5D,0CAA0C,CAC3C,EACD;EACEG,QAAQ,EAAE;IACRC,OAAO,EAAE;MACPC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE;MACJC,OAAO,EAAE,CACP,+BAA+B,EAC/B,iEAAiE,EACjE,iEAAiE,EACjE,iEAAiE,EACjE,iEAAiE,CAClE;MACDC,KAAK,EAAE,CACL,+BAA+B,EAC/B,iEAAiE,EACjE,iEAAiE,EACjE,iEAAiE,EACjE,iEAAiE;IAErE;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,OAAO,EAAE,SAAS;IAClBE,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,M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CAAC,EAC5D;EACEI,QAAQ,EAAE;IACRG,IAAI,EAAE;MACJC,OAAO,EAAE,iBAAiB;MAC1BC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
-
export const textStyle = cva([
|
|
6
|
-
web: 'font-
|
|
5
|
+
export const textStyle = cva(['text-content-primary', Platform.select({
|
|
6
|
+
web: 'font-body my-0 bg-transparent no-underline',
|
|
7
7
|
default: ''
|
|
8
8
|
})], {
|
|
9
9
|
variants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","textStyle","select","web","default","variants","size","xl","lg","md","sm","xs"],"sourceRoot":"../../../../src","sources":["components/Text/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AAEjE,OAAO,MAAMC,SAAS,GAAGD,GAAG,CAC1B,CACE,
|
|
1
|
+
{"version":3,"names":["Platform","cva","textStyle","select","web","default","variants","size","xl","lg","md","sm","xs"],"sourceRoot":"../../../../src","sources":["components/Text/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,0BAA0B;AAEjE,OAAO,MAAMC,SAAS,GAAGD,GAAG,CAC1B,CACE,sBAAsB,EACtBD,QAAQ,CAACG,MAAM,CAAC;EACdC,GAAG,EAAE,4CAA4C;EACjDC,OAAO,EAAE;AACX,CAAC,CAAC,CACH,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE;IACN;EACF;AACF,CACF,CAAC","ignoreList":[]}
|