@cdx-ui/components 0.0.1-alpha.3 → 0.0.1-alpha.30
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 +20 -2
- package/lib/commonjs/components/AlertDialog/index.js +117 -0
- package/lib/commonjs/components/AlertDialog/index.js.map +1 -0
- package/lib/commonjs/components/Avatar/index.js +156 -0
- package/lib/commonjs/components/Avatar/index.js.map +1 -0
- package/lib/commonjs/components/Avatar/styles.js +80 -0
- package/lib/commonjs/components/Avatar/styles.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/index.js +248 -0
- package/lib/commonjs/components/BottomSheet/index.js.map +1 -0
- package/lib/commonjs/components/BottomSheet/styles.js +61 -0
- package/lib/commonjs/components/BottomSheet/styles.js.map +1 -0
- package/lib/commonjs/components/Box/Box.js +1 -0
- package/lib/commonjs/components/Box/Box.js.map +1 -1
- package/lib/commonjs/components/Button/buttonSharedVariants.js +200 -0
- package/lib/commonjs/components/Button/buttonSharedVariants.js.map +1 -0
- package/lib/commonjs/components/Button/index.js +31 -13
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +170 -187
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Card/index.js +104 -0
- package/lib/commonjs/components/Card/index.js.map +1 -0
- package/lib/commonjs/components/Card/styles.js +28 -0
- package/lib/commonjs/components/Card/styles.js.map +1 -0
- package/lib/commonjs/components/Checkbox/index.js +180 -0
- package/lib/commonjs/components/Checkbox/index.js.map +1 -0
- package/lib/commonjs/components/Checkbox/styles.js +68 -0
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -0
- package/lib/commonjs/components/Chip/index.js +103 -0
- package/lib/commonjs/components/Chip/index.js.map +1 -0
- package/lib/commonjs/components/Chip/styles.js +50 -0
- package/lib/commonjs/components/Chip/styles.js.map +1 -0
- package/lib/commonjs/components/Dialog/index.js +275 -0
- package/lib/commonjs/components/Dialog/index.js.map +1 -0
- package/lib/commonjs/components/Dialog/styles.js +63 -0
- package/lib/commonjs/components/Dialog/styles.js.map +1 -0
- package/lib/commonjs/components/Form/FormLabelRoot.js +33 -0
- package/lib/commonjs/components/Form/FormLabelRoot.js.map +1 -0
- package/lib/commonjs/components/Form/FormLabelRoot.web.js +18 -0
- package/lib/commonjs/components/Form/FormLabelRoot.web.js.map +1 -0
- package/lib/commonjs/components/Form/FormRoot.js +25 -0
- package/lib/commonjs/components/Form/FormRoot.js.map +1 -0
- package/lib/commonjs/components/Form/FormRoot.web.js +17 -0
- package/lib/commonjs/components/Form/FormRoot.web.js.map +1 -0
- package/lib/commonjs/components/Form/index.js +255 -0
- package/lib/commonjs/components/Form/index.js.map +1 -0
- package/lib/commonjs/components/Form/styles.js +57 -0
- package/lib/commonjs/components/Form/styles.js.map +1 -0
- package/lib/commonjs/components/Heading/index.js +35 -0
- package/lib/commonjs/components/Heading/index.js.map +1 -0
- package/lib/commonjs/components/Heading/styles.js +24 -0
- package/lib/commonjs/components/Heading/styles.js.map +1 -0
- package/lib/commonjs/components/Icon/index.js +61 -0
- package/lib/commonjs/components/Icon/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/index.js +80 -0
- package/lib/commonjs/components/IconButton/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/styles.js +91 -0
- package/lib/commonjs/components/IconButton/styles.js.map +1 -0
- package/lib/commonjs/components/Image/Image.js +69 -0
- package/lib/commonjs/components/Image/Image.js.map +1 -0
- package/lib/commonjs/components/Image/index.js +13 -0
- package/lib/commonjs/components/Image/index.js.map +1 -0
- package/lib/commonjs/components/Input/BaseInput.android.js +20 -0
- package/lib/commonjs/components/Input/BaseInput.android.js.map +1 -0
- package/lib/commonjs/components/Input/index.js +10 -16
- package/lib/commonjs/components/Input/index.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +16 -30
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +94 -0
- package/lib/commonjs/components/Link/index.js.map +1 -0
- package/lib/commonjs/components/Link/styles.js +16 -0
- package/lib/commonjs/components/Link/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/index.js +62 -0
- package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/styles.js +21 -0
- package/lib/commonjs/components/ProgressSegmented/styles.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.js +10 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.js.map +1 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js +98 -0
- package/lib/commonjs/components/Select/SelectTriggerHost.web.js.map +1 -0
- package/lib/commonjs/components/Select/index.js +13 -13
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Select/styles.js +29 -53
- package/lib/commonjs/components/Select/styles.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +8 -21
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +8 -21
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/components/Stack/styles.js +39 -0
- package/lib/commonjs/components/Stack/styles.js.map +1 -0
- package/lib/commonjs/components/Switch/BaseSwitch.js +46 -0
- package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -0
- package/lib/commonjs/components/Switch/BaseSwitch.web.js +56 -0
- package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -0
- package/lib/commonjs/components/Switch/index.js +13 -0
- package/lib/commonjs/components/Switch/index.js.map +1 -0
- package/lib/commonjs/components/Switch/styles.js +128 -0
- package/lib/commonjs/components/Switch/styles.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +18 -9
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Text/styles.js +24 -0
- package/lib/commonjs/components/Text/styles.js.map +1 -0
- package/lib/commonjs/components/VirtualizedList/index.js +19 -0
- package/lib/commonjs/components/VirtualizedList/index.js.map +1 -0
- package/lib/commonjs/components/index.js +192 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +40 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/metro/withCdxMetroConfig.js +24 -0
- package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/commonjs/styles/index.js +17 -0
- package/lib/commonjs/styles/index.js.map +1 -0
- package/lib/commonjs/styles/primitives.js +123 -0
- package/lib/commonjs/styles/primitives.js.map +1 -0
- package/lib/module/components/AlertDialog/index.js +112 -0
- package/lib/module/components/AlertDialog/index.js.map +1 -0
- package/lib/module/components/Avatar/index.js +152 -0
- package/lib/module/components/Avatar/index.js.map +1 -0
- package/lib/module/components/Avatar/styles.js +77 -0
- package/lib/module/components/Avatar/styles.js.map +1 -0
- package/lib/module/components/BottomSheet/index.js +242 -0
- package/lib/module/components/BottomSheet/index.js.map +1 -0
- package/lib/module/components/BottomSheet/styles.js +58 -0
- package/lib/module/components/BottomSheet/styles.js.map +1 -0
- package/lib/module/components/Box/Box.js +1 -0
- package/lib/module/components/Box/Box.js.map +1 -1
- package/lib/module/components/Button/buttonSharedVariants.js +195 -0
- package/lib/module/components/Button/buttonSharedVariants.js.map +1 -0
- package/lib/module/components/Button/index.js +32 -14
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +168 -186
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Card/index.js +100 -0
- package/lib/module/components/Card/index.js.map +1 -0
- package/lib/module/components/Card/styles.js +25 -0
- package/lib/module/components/Card/styles.js.map +1 -0
- package/lib/module/components/Checkbox/index.js +176 -0
- package/lib/module/components/Checkbox/index.js.map +1 -0
- package/lib/module/components/Checkbox/styles.js +64 -0
- package/lib/module/components/Checkbox/styles.js.map +1 -0
- package/lib/module/components/Chip/index.js +99 -0
- package/lib/module/components/Chip/index.js.map +1 -0
- package/lib/module/components/Chip/styles.js +46 -0
- package/lib/module/components/Chip/styles.js.map +1 -0
- package/lib/module/components/Dialog/index.js +267 -0
- package/lib/module/components/Dialog/index.js.map +1 -0
- package/lib/module/components/Dialog/styles.js +60 -0
- package/lib/module/components/Dialog/styles.js.map +1 -0
- package/lib/module/components/Form/FormLabelRoot.js +29 -0
- package/lib/module/components/Form/FormLabelRoot.js.map +1 -0
- package/lib/module/components/Form/FormLabelRoot.web.js +13 -0
- package/lib/module/components/Form/FormLabelRoot.web.js.map +1 -0
- package/lib/module/components/Form/FormRoot.js +21 -0
- package/lib/module/components/Form/FormRoot.js.map +1 -0
- package/lib/module/components/Form/FormRoot.web.js +12 -0
- package/lib/module/components/Form/FormRoot.web.js.map +1 -0
- package/lib/module/components/Form/index.js +252 -0
- package/lib/module/components/Form/index.js.map +1 -0
- package/lib/module/components/Form/styles.js +53 -0
- package/lib/module/components/Form/styles.js.map +1 -0
- package/lib/module/components/Heading/index.js +31 -0
- package/lib/module/components/Heading/index.js.map +1 -0
- package/lib/module/components/Heading/styles.js +20 -0
- package/lib/module/components/Heading/styles.js.map +1 -0
- package/lib/module/components/Icon/index.js +57 -0
- package/lib/module/components/Icon/index.js.map +1 -0
- package/lib/module/components/IconButton/index.js +76 -0
- package/lib/module/components/IconButton/index.js.map +1 -0
- package/lib/module/components/IconButton/styles.js +87 -0
- package/lib/module/components/IconButton/styles.js.map +1 -0
- package/lib/module/components/Image/Image.js +67 -0
- package/lib/module/components/Image/Image.js.map +1 -0
- package/lib/module/components/Image/index.js +4 -0
- package/lib/module/components/Image/index.js.map +1 -0
- package/lib/module/components/Input/BaseInput.android.js +16 -0
- package/lib/module/components/Input/BaseInput.android.js.map +1 -0
- package/lib/module/components/Input/index.js +10 -16
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/components/Input/styles.js +16 -30
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/Link/index.js +85 -0
- package/lib/module/components/Link/index.js.map +1 -0
- package/lib/module/components/Link/styles.js +12 -0
- package/lib/module/components/Link/styles.js.map +1 -0
- package/lib/module/components/ProgressSegmented/index.js +58 -0
- package/lib/module/components/ProgressSegmented/index.js.map +1 -0
- package/lib/module/components/ProgressSegmented/styles.js +17 -0
- package/lib/module/components/ProgressSegmented/styles.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.js +7 -0
- package/lib/module/components/Select/SelectTriggerHost.js.map +1 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js +93 -0
- package/lib/module/components/Select/SelectTriggerHost.web.js.map +1 -0
- package/lib/module/components/Select/index.js +14 -14
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Select/styles.js +29 -53
- package/lib/module/components/Select/styles.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +8 -21
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +8 -21
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/components/Stack/styles.js +35 -0
- package/lib/module/components/Stack/styles.js.map +1 -0
- package/lib/module/components/Switch/BaseSwitch.js +42 -0
- package/lib/module/components/Switch/BaseSwitch.js.map +1 -0
- package/lib/module/components/Switch/BaseSwitch.web.js +52 -0
- package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -0
- package/lib/module/components/Switch/index.js +9 -0
- package/lib/module/components/Switch/index.js.map +1 -0
- package/lib/module/components/Switch/styles.js +125 -0
- package/lib/module/components/Switch/styles.js.map +1 -0
- package/lib/module/components/Text/index.js +19 -1
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/Text/styles.js +20 -0
- package/lib/module/components/Text/styles.js.map +1 -0
- package/lib/module/components/VirtualizedList/index.js +15 -0
- package/lib/module/components/VirtualizedList/index.js.map +1 -0
- package/lib/module/components/index.js +16 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/metro/withCdxMetroConfig.js +20 -0
- package/lib/module/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/module/styles/index.js +4 -0
- package/lib/module/styles/index.js.map +1 -0
- package/lib/module/styles/primitives.js +119 -0
- package/lib/module/styles/primitives.js.map +1 -0
- package/lib/typescript/components/AlertDialog/index.d.ts +30 -0
- package/lib/typescript/components/AlertDialog/index.d.ts.map +1 -0
- package/lib/typescript/components/Avatar/index.d.ts +40 -0
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/components/Avatar/styles.d.ts +16 -0
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/index.d.ts +61 -0
- package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts +16 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -0
- package/lib/typescript/components/Box/Box.d.ts +1 -0
- package/lib/typescript/components/Box/Box.d.ts.map +1 -1
- package/lib/typescript/components/Button/buttonSharedVariants.d.ts +29 -0
- package/lib/typescript/components/Button/buttonSharedVariants.d.ts.map +1 -0
- package/lib/typescript/components/Button/index.d.ts +6 -3
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +14 -8
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Card/index.d.ts +30 -0
- package/lib/typescript/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/components/Card/styles.d.ts +6 -0
- package/lib/typescript/components/Card/styles.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/index.d.ts +46 -0
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/styles.d.ts +18 -0
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -0
- package/lib/typescript/components/Chip/index.d.ts +27 -0
- package/lib/typescript/components/Chip/index.d.ts.map +1 -0
- package/lib/typescript/components/Chip/styles.d.ts +12 -0
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/index.d.ts +61 -0
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/styles.d.ts +14 -0
- package/lib/typescript/components/Dialog/styles.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormLabelRoot.d.ts +18 -0
- package/lib/typescript/components/Form/FormLabelRoot.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormLabelRoot.web.d.ts +20 -0
- package/lib/typescript/components/Form/FormLabelRoot.web.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.d.ts +12 -0
- package/lib/typescript/components/Form/FormRoot.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.web.d.ts +10 -0
- package/lib/typescript/components/Form/FormRoot.web.d.ts.map +1 -0
- package/lib/typescript/components/Form/index.d.ts +64 -0
- package/lib/typescript/components/Form/index.d.ts.map +1 -0
- package/lib/typescript/components/Form/styles.d.ts +22 -0
- package/lib/typescript/components/Form/styles.d.ts.map +1 -0
- package/lib/typescript/components/Heading/index.d.ts +10 -0
- package/lib/typescript/components/Heading/index.d.ts.map +1 -0
- package/lib/typescript/components/Heading/styles.d.ts +6 -0
- package/lib/typescript/components/Heading/styles.d.ts.map +1 -0
- package/lib/typescript/components/Icon/index.d.ts +27 -0
- package/lib/typescript/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/components/IconButton/index.d.ts +15 -0
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -0
- package/lib/typescript/components/IconButton/styles.d.ts +16 -0
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -0
- package/lib/typescript/components/Image/Image.d.ts +47 -0
- package/lib/typescript/components/Image/Image.d.ts.map +1 -0
- package/lib/typescript/components/Image/index.d.ts +2 -0
- package/lib/typescript/components/Image/index.d.ts.map +1 -0
- package/lib/typescript/components/Input/BaseInput.android.d.ts +3 -0
- package/lib/typescript/components/Input/BaseInput.android.d.ts.map +1 -0
- package/lib/typescript/components/Input/index.d.ts +7 -5
- package/lib/typescript/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts +5 -7
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +26 -0
- package/lib/typescript/components/Link/index.d.ts.map +1 -0
- package/lib/typescript/components/Link/styles.d.ts +4 -0
- package/lib/typescript/components/Link/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/index.d.ts +15 -0
- package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/styles.d.ts +8 -0
- package/lib/typescript/components/ProgressSegmented/styles.d.ts.map +1 -0
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts +3 -0
- package/lib/typescript/components/Select/SelectTriggerHost.d.ts.map +1 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts +13 -0
- package/lib/typescript/components/Select/SelectTriggerHost.web.d.ts.map +1 -0
- package/lib/typescript/components/Select/index.d.ts +7 -4
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Select/styles.d.ts +6 -8
- package/lib/typescript/components/Select/styles.d.ts.map +1 -1
- package/lib/typescript/components/Stack/HStack.d.ts +1 -12
- package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/VStack.d.ts +1 -12
- package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/styles.d.ts +10 -0
- package/lib/typescript/components/Stack/styles.d.ts.map +1 -0
- package/lib/typescript/components/Switch/BaseSwitch.d.ts +9 -0
- package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -0
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +15 -0
- package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -0
- package/lib/typescript/components/Switch/index.d.ts +7 -0
- package/lib/typescript/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/components/Switch/styles.d.ts +26 -0
- package/lib/typescript/components/Switch/styles.d.ts.map +1 -0
- package/lib/typescript/components/Text/index.d.ts +9 -1
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/styles.d.ts +6 -0
- package/lib/typescript/components/Text/styles.d.ts.map +1 -0
- package/lib/typescript/components/VirtualizedList/index.d.ts +8 -0
- package/lib/typescript/components/VirtualizedList/index.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +16 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/metro/withCdxMetroConfig.d.ts +19 -0
- package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -0
- package/lib/typescript/styles/index.d.ts +2 -0
- package/lib/typescript/styles/index.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +85 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -0
- package/package.json +23 -16
- package/src/components/AlertDialog/index.tsx +124 -0
- package/src/components/Avatar/index.tsx +172 -0
- package/src/components/Avatar/styles.ts +83 -0
- package/src/components/BottomSheet/index.tsx +316 -0
- package/src/components/BottomSheet/styles.ts +79 -0
- package/src/components/Box/Box.tsx +1 -0
- package/src/components/Button/buttonSharedVariants.ts +281 -0
- package/src/components/Button/index.tsx +24 -15
- package/src/components/Button/styles.ts +195 -229
- package/src/components/Card/index.tsx +115 -0
- package/src/components/Card/styles.ts +41 -0
- package/src/components/Checkbox/index.tsx +207 -0
- package/src/components/Checkbox/styles.ts +103 -0
- package/src/components/Chip/index.tsx +91 -0
- package/src/components/Chip/styles.ts +51 -0
- package/src/components/Dialog/index.tsx +304 -0
- package/src/components/Dialog/styles.ts +88 -0
- package/src/components/Form/FormLabelRoot.tsx +33 -0
- package/src/components/Form/FormLabelRoot.web.tsx +18 -0
- package/src/components/Form/FormRoot.tsx +19 -0
- package/src/components/Form/FormRoot.web.tsx +12 -0
- package/src/components/Form/index.tsx +272 -0
- package/src/components/Form/styles.ts +75 -0
- package/src/components/Heading/index.tsx +36 -0
- package/src/components/Heading/styles.tsx +26 -0
- package/src/components/Icon/index.tsx +54 -0
- package/src/components/IconButton/index.tsx +93 -0
- package/src/components/IconButton/styles.ts +131 -0
- package/src/components/Image/Image.tsx +77 -0
- package/src/components/Image/index.ts +1 -0
- package/src/components/Input/BaseInput.android.tsx +13 -0
- package/src/components/Input/index.tsx +9 -22
- package/src/components/Input/styles.ts +42 -37
- package/src/components/Link/index.tsx +83 -0
- package/src/components/Link/styles.ts +20 -0
- package/src/components/ProgressSegmented/index.tsx +81 -0
- package/src/components/ProgressSegmented/styles.ts +19 -0
- package/src/components/Select/SelectTriggerHost.tsx +4 -0
- package/src/components/Select/SelectTriggerHost.web.tsx +136 -0
- package/src/components/Select/index.tsx +14 -14
- package/src/components/Select/styles.ts +68 -75
- package/src/components/Stack/HStack.tsx +8 -19
- package/src/components/Stack/VStack.tsx +8 -23
- package/src/components/Stack/styles.ts +37 -0
- package/src/components/Switch/BaseSwitch.tsx +38 -0
- package/src/components/Switch/BaseSwitch.web.tsx +69 -0
- package/src/components/Switch/index.tsx +11 -0
- package/src/components/Switch/styles.ts +120 -0
- package/src/components/Text/index.tsx +16 -0
- package/src/components/Text/styles.tsx +26 -0
- package/src/components/VirtualizedList/index.tsx +19 -0
- package/src/components/index.ts +16 -0
- package/src/index.ts +3 -0
- package/src/metro/withCdxMetroConfig.ts +29 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/primitives.ts +107 -0
- package/lib/commonjs/components/Text/Text.js +0 -30
- package/lib/commonjs/components/Text/Text.js.map +0 -1
- package/lib/module/components/Text/Text.js +0 -26
- package/lib/module/components/Text/Text.js.map +0 -1
- package/lib/typescript/components/Text/Text.d.ts +0 -11
- package/lib/typescript/components/Text/Text.d.ts.map +0 -1
- package/src/components/Text/Text.tsx +0 -58
- package/src/components/Text/index.ts +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Styled, theme-aware UI components for the Candescent Design System.
|
|
4
4
|
|
|
5
|
-
Built on top of [`@cdx-ui/primitives`](../primitives/) and [`@cdx-ui/
|
|
5
|
+
Built on top of [`@cdx-ui/primitives`](../primitives/) and [`@cdx-ui/styles`](../styles/), styled via [Uniwind](https://uniwind.dev) + [CVA](https://cva.style).
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ import { Button } from '@cdx-ui/components';
|
|
|
24
24
|
|
|
25
25
|
export function Example() {
|
|
26
26
|
return (
|
|
27
|
-
<Button variant="
|
|
27
|
+
<Button variant="strong" color="action" size="default" onPress={() => console.log('pressed')}>
|
|
28
28
|
<Button.Label>Get Started</Button.Label>
|
|
29
29
|
</Button>
|
|
30
30
|
);
|
|
@@ -32,3 +32,21 @@ export function Example() {
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Component stories live in [`apps/storybook`](../../apps/storybook/).
|
|
35
|
+
|
|
36
|
+
## Testing
|
|
37
|
+
|
|
38
|
+
Tests live in [`__tests__/`](./__tests__/). **Jest** uses the repo-root **`jest.config.js`** with **two projects**: **`rntl`** (jest-expo native + **`@testing-library/react-native`**) for `*.test.tsx`, and **`axe`** (jest-expo web + jsdom + **`@testing-library/react`** + **`jest-axe`**) for `*.axe.test.tsx`.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# From monorepo root
|
|
42
|
+
pnpm nx run @cdx-ui/components:test
|
|
43
|
+
# or
|
|
44
|
+
pnpm test:all
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Production types use `tsconfig.json`; tests use `tsconfig.test.json`.
|
|
48
|
+
|
|
49
|
+
**Authoring:** See **[docs/testing.md](../../docs/testing.md)** and **[docs/internal/testing.md](../../docs/internal/testing.md)** (RNTL vs DOM, `fireEvent.press` vs `fireEvent.click`, file naming).
|
|
50
|
+
|
|
51
|
+
**A11y-only ad-hoc** (from `packages/components`):
|
|
52
|
+
`pnpm exec jest --config ../../jest.config.js --testNamePattern="a11y"`
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AlertDialog = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
|
+
var _utils = require("@cdx-ui/utils");
|
|
10
|
+
var _Button = require("../Button");
|
|
11
|
+
var _Dialog = require("../Dialog");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// ALERT DIALOG ROOT (Dialog with non-dismissible defaults + alertdialog role)
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
const AlertDialogRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
19
|
+
closeOnBackdropPress = false,
|
|
20
|
+
closeOnEscKey = false,
|
|
21
|
+
role = 'alertdialog',
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.Dialog, {
|
|
25
|
+
ref: ref,
|
|
26
|
+
closeOnBackdropPress: closeOnBackdropPress,
|
|
27
|
+
closeOnEscKey: closeOnEscKey,
|
|
28
|
+
role: role,
|
|
29
|
+
...props,
|
|
30
|
+
children: children
|
|
31
|
+
}));
|
|
32
|
+
AlertDialogRoot.displayName = 'AlertDialog';
|
|
33
|
+
|
|
34
|
+
// =============================================================================
|
|
35
|
+
// ALERT DIALOG ACTION
|
|
36
|
+
// =============================================================================
|
|
37
|
+
|
|
38
|
+
const AlertDialogAction = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
39
|
+
asChild = false,
|
|
40
|
+
children,
|
|
41
|
+
color = 'action',
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}, ref) => {
|
|
45
|
+
if (asChild && /*#__PURE__*/_react.default.isValidElement(children)) {
|
|
46
|
+
return /*#__PURE__*/_react.default.cloneElement(children, {
|
|
47
|
+
ref,
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
53
|
+
ref: ref,
|
|
54
|
+
variant: "strong",
|
|
55
|
+
color: color,
|
|
56
|
+
className: className,
|
|
57
|
+
...props,
|
|
58
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button.Label, {
|
|
59
|
+
children: children
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
AlertDialogAction.displayName = 'AlertDialog.Action';
|
|
64
|
+
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// ALERT DIALOG CANCEL
|
|
67
|
+
// =============================================================================
|
|
68
|
+
|
|
69
|
+
const AlertDialogCancel = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
70
|
+
asChild = false,
|
|
71
|
+
children,
|
|
72
|
+
onPress,
|
|
73
|
+
className,
|
|
74
|
+
...props
|
|
75
|
+
}, ref) => {
|
|
76
|
+
const {
|
|
77
|
+
onOpenChange
|
|
78
|
+
} = (0, _primitives.useDialog)();
|
|
79
|
+
const handlePress = (0, _utils.composeEventHandlers)(onPress, () => onOpenChange(false));
|
|
80
|
+
if (asChild && /*#__PURE__*/_react.default.isValidElement(children)) {
|
|
81
|
+
return /*#__PURE__*/_react.default.cloneElement(children, {
|
|
82
|
+
ref,
|
|
83
|
+
onPress: handlePress,
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
89
|
+
ref: ref,
|
|
90
|
+
variant: "outline",
|
|
91
|
+
onPress: handlePress,
|
|
92
|
+
className: className,
|
|
93
|
+
...props,
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button.Label, {
|
|
95
|
+
children: children
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
AlertDialogCancel.displayName = 'AlertDialog.Cancel';
|
|
100
|
+
|
|
101
|
+
// =============================================================================
|
|
102
|
+
// COMPOUND EXPORT
|
|
103
|
+
// =============================================================================
|
|
104
|
+
|
|
105
|
+
const AlertDialog = exports.AlertDialog = Object.assign(AlertDialogRoot, {
|
|
106
|
+
Trigger: _Dialog.Dialog.Trigger,
|
|
107
|
+
Content: _Dialog.Dialog.Content,
|
|
108
|
+
Header: _Dialog.Dialog.Header,
|
|
109
|
+
Title: _Dialog.Dialog.Title,
|
|
110
|
+
Description: _Dialog.Dialog.Description,
|
|
111
|
+
Body: _Dialog.Dialog.Body,
|
|
112
|
+
Footer: _Dialog.Dialog.Footer,
|
|
113
|
+
Close: _Dialog.Dialog.Close,
|
|
114
|
+
Action: AlertDialogAction,
|
|
115
|
+
Cancel: AlertDialogCancel
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_primitives","_utils","_Button","_Dialog","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AlertDialogRoot","forwardRef","closeOnBackdropPress","closeOnEscKey","role","children","props","ref","jsx","Dialog","displayName","AlertDialogAction","asChild","color","className","React","isValidElement","cloneElement","Button","variant","Label","AlertDialogCancel","onPress","onOpenChange","useDialog","handlePress","composeEventHandlers","AlertDialog","exports","assign","Trigger","Content","Header","Title","Description","Body","Footer","Close","Action","Cancel"],"sourceRoot":"../../../../src","sources":["components/AlertDialog/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAyD,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,wBAAAO,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAT,uBAAA,YAAAA,CAAAO,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,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EAAErB,cAAM,CAACqB,OAAO;EACvBC,OAAO,EAAEtB,cAAM,CAACsB,OAAO;EACvBC,MAAM,EAAEvB,cAAM,CAACuB,MAAM;EACrBC,KAAK,EAAExB,cAAM,CAACwB,KAAK;EACnBC,WAAW,EAAEzB,cAAM,CAACyB,WAAW;EAC/BC,IAAI,EAAE1B,cAAM,CAAC0B,IAAI;EACjBC,MAAM,EAAE3B,cAAM,CAAC2B,MAAM;EACrBC,KAAK,EAAE5B,cAAM,CAAC4B,KAAK;EACnBC,MAAM,EAAE3B,iBAAiB;EACzB4B,MAAM,EAAElB;AACV,CAAC,CAAiC","ignoreList":[]}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Avatar = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
10
|
+
var _utils = require("@cdx-ui/utils");
|
|
11
|
+
var _Icon = require("../Icon");
|
|
12
|
+
var _styles = require("./styles");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const SCOPE = 'AVATAR';
|
|
15
|
+
const Root = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
16
|
+
const useAvatarStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
17
|
+
const AvatarPrimitive = (0, _primitives.createAvatar)({
|
|
18
|
+
Root,
|
|
19
|
+
Image: _reactNative.Image,
|
|
20
|
+
Text: _reactNative.Text,
|
|
21
|
+
Icon: _Icon.Icon,
|
|
22
|
+
Badge: _reactNative.View
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// AVATAR ROOT
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
const AvatarRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
30
|
+
size = 'lg',
|
|
31
|
+
className,
|
|
32
|
+
children,
|
|
33
|
+
style,
|
|
34
|
+
...props
|
|
35
|
+
}, ref) => {
|
|
36
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarRootVariants)({
|
|
37
|
+
size
|
|
38
|
+
}), className);
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive, {
|
|
40
|
+
ref: ref,
|
|
41
|
+
className: computedClassName,
|
|
42
|
+
style: style,
|
|
43
|
+
context: {
|
|
44
|
+
size
|
|
45
|
+
},
|
|
46
|
+
...props,
|
|
47
|
+
children: children
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
AvatarRoot.displayName = 'Avatar';
|
|
51
|
+
|
|
52
|
+
// =============================================================================
|
|
53
|
+
// AVATAR IMAGE
|
|
54
|
+
// =============================================================================
|
|
55
|
+
|
|
56
|
+
const AvatarImage = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
57
|
+
className,
|
|
58
|
+
style,
|
|
59
|
+
...props
|
|
60
|
+
}, ref) => {
|
|
61
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarImageVariants)(), className);
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Image, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
className: computedClassName,
|
|
65
|
+
style: style,
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
AvatarImage.displayName = 'Avatar.Image';
|
|
70
|
+
|
|
71
|
+
// =============================================================================
|
|
72
|
+
// AVATAR TEXT
|
|
73
|
+
// =============================================================================
|
|
74
|
+
|
|
75
|
+
const AvatarText = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
76
|
+
className,
|
|
77
|
+
children,
|
|
78
|
+
style,
|
|
79
|
+
...props
|
|
80
|
+
}, ref) => {
|
|
81
|
+
const {
|
|
82
|
+
size
|
|
83
|
+
} = useAvatarStyleContext();
|
|
84
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarTextVariants)({
|
|
85
|
+
size
|
|
86
|
+
}), className);
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Text, {
|
|
88
|
+
ref: ref,
|
|
89
|
+
className: computedClassName,
|
|
90
|
+
style: style,
|
|
91
|
+
...props,
|
|
92
|
+
children: children
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
AvatarText.displayName = 'Avatar.Text';
|
|
96
|
+
|
|
97
|
+
// =============================================================================
|
|
98
|
+
// AVATAR ICON
|
|
99
|
+
// =============================================================================
|
|
100
|
+
|
|
101
|
+
const AvatarIcon = ({
|
|
102
|
+
className,
|
|
103
|
+
style,
|
|
104
|
+
...props
|
|
105
|
+
}) => {
|
|
106
|
+
const {
|
|
107
|
+
size
|
|
108
|
+
} = useAvatarStyleContext();
|
|
109
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarIconVariants)({
|
|
110
|
+
size
|
|
111
|
+
}), className);
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Icon, {
|
|
113
|
+
className: computedClassName,
|
|
114
|
+
style: style,
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
AvatarIcon.displayName = 'Avatar.Icon';
|
|
119
|
+
|
|
120
|
+
// =============================================================================
|
|
121
|
+
// AVATAR BADGE
|
|
122
|
+
// =============================================================================
|
|
123
|
+
|
|
124
|
+
const AvatarBadge = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
125
|
+
className,
|
|
126
|
+
children,
|
|
127
|
+
style,
|
|
128
|
+
...props
|
|
129
|
+
}, ref) => {
|
|
130
|
+
const {
|
|
131
|
+
size
|
|
132
|
+
} = useAvatarStyleContext();
|
|
133
|
+
const computedClassName = (0, _utils.cn)((0, _styles.avatarBadgeVariants)({
|
|
134
|
+
size
|
|
135
|
+
}), className);
|
|
136
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarPrimitive.Badge, {
|
|
137
|
+
ref: ref,
|
|
138
|
+
className: computedClassName,
|
|
139
|
+
style: style,
|
|
140
|
+
...props,
|
|
141
|
+
children: children
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
AvatarBadge.displayName = 'Avatar.Badge';
|
|
145
|
+
|
|
146
|
+
// =============================================================================
|
|
147
|
+
// COMPOUND COMPONENT
|
|
148
|
+
// =============================================================================
|
|
149
|
+
|
|
150
|
+
const Avatar = exports.Avatar = Object.assign(AvatarRoot, {
|
|
151
|
+
Image: AvatarImage,
|
|
152
|
+
Text: AvatarText,
|
|
153
|
+
Icon: AvatarIcon,
|
|
154
|
+
Badge: AvatarBadge
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_Icon","_styles","_jsxRuntime","SCOPE","Root","withStyleContext","View","useAvatarStyleContext","useStyleContext","AvatarPrimitive","createAvatar","Image","Text","Icon","IconComponent","Badge","AvatarRoot","forwardRef","size","className","children","style","props","ref","computedClassName","cn","avatarRootVariants","jsx","context","displayName","AvatarImage","avatarImageVariants","AvatarText","avatarTextVariants","AvatarIcon","avatarIconVariants","AvatarBadge","avatarBadgeVariants","Avatar","exports","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Avatar/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAOkB,IAAAM,WAAA,GAAAN,OAAA;AAElB,MAAMO,KAAK,GAAG,QAAQ;AAEtB,MAAMC,IAAI,GAAG,IAAAC,uBAAgB,EAACC,iBAAI,EAAEH,KAAK,CAAC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C;EAAEE,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACjD,MAAM;IAAEL;EAAK,CAAC,GAAGX,qBAAqB,CAAC,CAAC;EACxC,MAAMiB,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAY,2BAAmB,EAAC;IAAEnB;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAEtE,oBACE,IAAAjB,WAAA,CAAAyB,GAAA,EAAClB,eAAe,CAACM,KAAK;IACpBQ,GAAG,EAAEA,GAAa;IAClBJ,SAAS,EAAEK,iBAAkB;IAC7BH,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAAF,QAAA,EAERA;EAAQ,CACY,CAAC;AAE5B,CACF,CAAC;AAEDgB,WAAW,CAACP,WAAW,GAAG,cAAc;;AAExC;AACA;AACA;;AASO,MAAMS,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAACzB,UAAU,EAAE;EAC9CL,KAAK,EAAEmB,WAAW;EAClBlB,IAAI,EAAEoB,UAAU;EAChBnB,IAAI,EAAEqB,UAAU;EAChBnB,KAAK,EAAEqB;AACT,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.avatarTextVariants = exports.avatarRootVariants = exports.avatarImageVariants = exports.avatarIconVariants = exports.avatarBadgeVariants = void 0;
|
|
7
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
+
var _primitives = require("../../styles/primitives");
|
|
9
|
+
// ── Root ─────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
const avatarRootVariants = exports.avatarRootVariants = (0, _classVarianceAuthority.cva)([_primitives.RADIUS_FULL, 'relative items-center justify-center', _primitives.COLOR_BG_MUTED], {
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
sm: 'w-8 h-8',
|
|
15
|
+
md: 'w-10 h-10',
|
|
16
|
+
lg: 'w-12 h-12',
|
|
17
|
+
xl: 'w-16 h-16',
|
|
18
|
+
'2xl': 'w-20 h-20'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: 'lg'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// ── Image ────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
const avatarImageVariants = exports.avatarImageVariants = (0, _classVarianceAuthority.cva)(['absolute top-0 left-0 w-full h-full', _primitives.RADIUS_FULL, 'overflow-hidden']);
|
|
29
|
+
|
|
30
|
+
// ── Text ─────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
const avatarTextVariants = exports.avatarTextVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_SECONDARY, 'font-semibold'], {
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
sm: 'text-xs',
|
|
36
|
+
md: 'text-sm',
|
|
37
|
+
lg: 'text-base',
|
|
38
|
+
xl: 'text-xl',
|
|
39
|
+
'2xl': 'text-2xl'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
size: 'lg'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// ── Icon ─────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
const avatarIconVariants = exports.avatarIconVariants = (0, _classVarianceAuthority.cva)([_primitives.COLOR_TEXT_SECONDARY], {
|
|
50
|
+
variants: {
|
|
51
|
+
size: {
|
|
52
|
+
sm: 'size-4',
|
|
53
|
+
md: 'size-5',
|
|
54
|
+
lg: 'size-6',
|
|
55
|
+
xl: 'size-8',
|
|
56
|
+
'2xl': 'size-10'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
size: 'lg'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ── Badge ────────────────────────────────────────────────
|
|
65
|
+
|
|
66
|
+
const avatarBadgeVariants = exports.avatarBadgeVariants = (0, _classVarianceAuthority.cva)(['absolute border-2 border-white', _primitives.RADIUS_FULL], {
|
|
67
|
+
variants: {
|
|
68
|
+
size: {
|
|
69
|
+
sm: 'w-2.5 h-2.5 bottom-0 right-0',
|
|
70
|
+
md: 'w-3 h-3 bottom-0 right-0',
|
|
71
|
+
lg: 'w-3.5 h-3.5 bottom-0 right-0',
|
|
72
|
+
xl: 'w-4 h-4 bottom-0.5 right-0.5',
|
|
73
|
+
'2xl': 'w-5 h-5 bottom-0.5 right-0.5'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
size: 'lg'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","_primitives","avatarRootVariants","exports","cva","RADIUS_FULL","COLOR_BG_MUTED","variants","size","sm","md","lg","xl","defaultVariants","avatarImageVariants","avatarTextVariants","COLOR_TEXT_SECONDARY","avatarIconVariants","avatarBadgeVariants"],"sourceRoot":"../../../../src","sources":["components/Avatar/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA;;AAEO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,2BAAG,EACnC,CAACC,uBAAW,EAAE,sCAAsC,EAAEC,0BAAc,CAAC,EACrE;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,WAAW;MACf,KAAK,EAAE;IACT;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AI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BottomSheet = void 0;
|
|
7
|
+
exports.useBottomSheet = useBottomSheet;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
11
|
+
var _bottomSheet = require("@gorhom/bottom-sheet");
|
|
12
|
+
var _utils = require("@cdx-ui/utils");
|
|
13
|
+
var _icons = require("@cdx-ui/icons");
|
|
14
|
+
var _Heading = require("../Heading");
|
|
15
|
+
var _Icon = require("../Icon");
|
|
16
|
+
var _Text = require("../Text");
|
|
17
|
+
var _styles = require("./styles");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
/** Ref type for BottomSheet; forwards the @gorhom modal ref (present, dismiss, snapToIndex, minimize, restore, etc.). */
|
|
21
|
+
|
|
22
|
+
function BottomSheetHeaderComponent({
|
|
23
|
+
title,
|
|
24
|
+
subtitle,
|
|
25
|
+
children,
|
|
26
|
+
className,
|
|
27
|
+
onClose,
|
|
28
|
+
closeAccessibilityLabel,
|
|
29
|
+
onBack,
|
|
30
|
+
backAccessibilityLabel = 'Go back'
|
|
31
|
+
}, ref) {
|
|
32
|
+
const hasTitle = title !== undefined && title !== '';
|
|
33
|
+
const hasContent = hasTitle || !!children || !!onBack;
|
|
34
|
+
const computedClassName = (0, _utils.cn)((0, _styles.bottomSheetHeaderVariants)({
|
|
35
|
+
hasTitle: hasContent
|
|
36
|
+
}), className);
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
38
|
+
ref: ref,
|
|
39
|
+
className: computedClassName,
|
|
40
|
+
children: [onBack && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
41
|
+
onPress: onBack,
|
|
42
|
+
hitSlop: 12,
|
|
43
|
+
accessibilityRole: "button",
|
|
44
|
+
accessibilityLabel: backAccessibilityLabel,
|
|
45
|
+
className: (0, _utils.cn)((0, _styles.bottomSheetBackButtonVariants)()),
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
47
|
+
as: _icons.ArrowBackIosNew,
|
|
48
|
+
className: (0, _styles.bottomSheetBackIconVariants)()
|
|
49
|
+
})
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
51
|
+
className: "flex-1",
|
|
52
|
+
children: children ?? (hasTitle ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
53
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading.Heading, {
|
|
54
|
+
size: "xs",
|
|
55
|
+
className: "text-lg",
|
|
56
|
+
children: title
|
|
57
|
+
}), subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Text, {
|
|
58
|
+
className: (0, _styles.bottomSheetSubtitleVariants)(),
|
|
59
|
+
children: subtitle
|
|
60
|
+
}) : null]
|
|
61
|
+
}) : null)
|
|
62
|
+
}), onClose && /*#__PURE__*/(0, _jsxRuntime.jsx)(BottomSheetCloseButton, {
|
|
63
|
+
onPress: onClose,
|
|
64
|
+
...(closeAccessibilityLabel !== undefined && {
|
|
65
|
+
accessibilityLabel: closeAccessibilityLabel
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
BottomSheetHeaderComponent.displayName = 'BottomSheet.Header';
|
|
71
|
+
const BottomSheetHeader = /*#__PURE__*/(0, _react.forwardRef)(BottomSheetHeaderComponent);
|
|
72
|
+
BottomSheetHeader.displayName = 'BottomSheet.Header';
|
|
73
|
+
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// CLOSEBUTTON
|
|
76
|
+
// =============================================================================
|
|
77
|
+
|
|
78
|
+
function BottomSheetCloseButton({
|
|
79
|
+
onPress,
|
|
80
|
+
className,
|
|
81
|
+
accessibilityLabel = 'Close'
|
|
82
|
+
}) {
|
|
83
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
84
|
+
onPress: onPress,
|
|
85
|
+
hitSlop: 12,
|
|
86
|
+
accessibilityRole: "button",
|
|
87
|
+
accessibilityLabel: accessibilityLabel,
|
|
88
|
+
className: (0, _utils.cn)((0, _styles.bottomSheetCloseButtonVariants)(), className),
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
90
|
+
as: _icons.Close,
|
|
91
|
+
className: (0, _styles.bottomSheetCloseIconVariants)()
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
BottomSheetCloseButton.displayName = 'BottomSheet.CloseButton';
|
|
96
|
+
|
|
97
|
+
// =============================================================================
|
|
98
|
+
// CONTENT
|
|
99
|
+
// =============================================================================
|
|
100
|
+
|
|
101
|
+
const BottomSheetContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
102
|
+
children,
|
|
103
|
+
className,
|
|
104
|
+
hasSafeAreaInset,
|
|
105
|
+
style
|
|
106
|
+
}, ref) => {
|
|
107
|
+
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
108
|
+
const computedClassName = (0, _utils.cn)((0, _styles.bottomSheetContentVariants)(), className);
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
110
|
+
ref: ref,
|
|
111
|
+
className: computedClassName,
|
|
112
|
+
style: hasSafeAreaInset ? {
|
|
113
|
+
paddingBottom: insets.bottom,
|
|
114
|
+
...style
|
|
115
|
+
} : style,
|
|
116
|
+
pointerEvents: "box-none",
|
|
117
|
+
children: children
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
BottomSheetContent.displayName = 'BottomSheet.Content';
|
|
121
|
+
|
|
122
|
+
// =============================================================================
|
|
123
|
+
// FOOTER
|
|
124
|
+
// =============================================================================
|
|
125
|
+
|
|
126
|
+
const BottomSheetFooter = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
127
|
+
children,
|
|
128
|
+
className,
|
|
129
|
+
style
|
|
130
|
+
}, ref) => {
|
|
131
|
+
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
132
|
+
const computedClassName = (0, _utils.cn)((0, _styles.bottomSheetFooterVariants)(), className);
|
|
133
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
134
|
+
ref: ref,
|
|
135
|
+
className: computedClassName,
|
|
136
|
+
style: {
|
|
137
|
+
paddingBottom: Math.max(insets.bottom, 24),
|
|
138
|
+
...style
|
|
139
|
+
},
|
|
140
|
+
pointerEvents: "box-none",
|
|
141
|
+
children: children
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
BottomSheetFooter.displayName = 'BottomSheet.Footer';
|
|
145
|
+
|
|
146
|
+
// =============================================================================
|
|
147
|
+
// MODAL WRAPPER (WITH STYLES)
|
|
148
|
+
// =============================================================================
|
|
149
|
+
|
|
150
|
+
const MAX_DYNAMIC_CONTENT_SIZE = _reactNative.Dimensions.get('window').height * 0.9;
|
|
151
|
+
const CustomBackdrop = props => {
|
|
152
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetBackdrop, {
|
|
153
|
+
...props,
|
|
154
|
+
disappearsOnIndex: -1,
|
|
155
|
+
appearsOnIndex: 0,
|
|
156
|
+
opacity: 0.5,
|
|
157
|
+
pressBehavior: "close"
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
const BottomSheetModalStyled = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
161
|
+
handleVisible = true,
|
|
162
|
+
footer,
|
|
163
|
+
...rest
|
|
164
|
+
}, ref) => {
|
|
165
|
+
const renderFooter = (0, _react.useCallback)(props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetFooter, {
|
|
166
|
+
...props,
|
|
167
|
+
children: footer
|
|
168
|
+
}), [footer]);
|
|
169
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetModal, {
|
|
170
|
+
ref: ref,
|
|
171
|
+
enableDynamicSizing: true,
|
|
172
|
+
maxDynamicContentSize: MAX_DYNAMIC_CONTENT_SIZE,
|
|
173
|
+
handleComponent: handleVisible ? undefined : null,
|
|
174
|
+
handleIndicatorStyle: handleVisible ? _styles.handleIndicatorStyle : undefined,
|
|
175
|
+
backdropComponent: CustomBackdrop,
|
|
176
|
+
backgroundComponent: backgroundProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
177
|
+
...backgroundProps,
|
|
178
|
+
className: (0, _utils.cn)((0, _styles.bottomSheetContainerVariants)())
|
|
179
|
+
}),
|
|
180
|
+
...rest,
|
|
181
|
+
...(footer != null && {
|
|
182
|
+
footerComponent: renderFooter
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
BottomSheetModalStyled.displayName = 'BottomSheet.Modal';
|
|
187
|
+
|
|
188
|
+
// =============================================================================
|
|
189
|
+
// SCROLLVIEW WRAPPER (with footer margin adjustment enabled by default)
|
|
190
|
+
// =============================================================================
|
|
191
|
+
|
|
192
|
+
function BottomSheetScrollViewStyled({
|
|
193
|
+
enableFooterMarginAdjustment = true,
|
|
194
|
+
children,
|
|
195
|
+
...rest
|
|
196
|
+
}) {
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetScrollView, {
|
|
198
|
+
enableFooterMarginAdjustment: enableFooterMarginAdjustment,
|
|
199
|
+
...rest,
|
|
200
|
+
children: children
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
BottomSheetScrollViewStyled.displayName = 'BottomSheet.ScrollView';
|
|
204
|
+
|
|
205
|
+
// =============================================================================
|
|
206
|
+
// VIEW WRAPPER (with footer margin adjustment enabled by default)
|
|
207
|
+
// =============================================================================
|
|
208
|
+
|
|
209
|
+
function BottomSheetViewStyled({
|
|
210
|
+
enableFooterMarginAdjustment = true,
|
|
211
|
+
children,
|
|
212
|
+
...rest
|
|
213
|
+
}) {
|
|
214
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomSheet.BottomSheetView, {
|
|
215
|
+
enableFooterMarginAdjustment: enableFooterMarginAdjustment,
|
|
216
|
+
...rest,
|
|
217
|
+
children: children
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
BottomSheetViewStyled.displayName = 'BottomSheet.View';
|
|
221
|
+
|
|
222
|
+
// Display names for gorhom components exposed as BottomSheet.*
|
|
223
|
+
|
|
224
|
+
_bottomSheet.BottomSheetModalProvider.displayName = 'BottomSheet.Provider';
|
|
225
|
+
|
|
226
|
+
// ── Public exports ────────────────────────────────────────
|
|
227
|
+
|
|
228
|
+
const BottomSheet = exports.BottomSheet = {
|
|
229
|
+
Modal: BottomSheetModalStyled,
|
|
230
|
+
Header: BottomSheetHeader,
|
|
231
|
+
Content: BottomSheetContent,
|
|
232
|
+
Footer: BottomSheetFooter,
|
|
233
|
+
Provider: _bottomSheet.BottomSheetModalProvider,
|
|
234
|
+
ScrollView: BottomSheetScrollViewStyled,
|
|
235
|
+
View: BottomSheetViewStyled
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// ── Hooks ────────────────────────────────────────────────
|
|
239
|
+
|
|
240
|
+
function useBottomSheet() {
|
|
241
|
+
const ref = (0, _react.useRef)(null);
|
|
242
|
+
return {
|
|
243
|
+
ref,
|
|
244
|
+
present: () => ref.current?.present(),
|
|
245
|
+
dismiss: () => ref.current?.dismiss()
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=index.js.map
|