@cdx-ui/components 0.0.1-alpha.9 → 0.0.1-beta.2
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 +53 -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/index.js +20 -9
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +182 -163
- 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 +18 -11
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +17 -16
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- 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 +52 -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/Field/FieldLabel.js +33 -0
- package/lib/commonjs/components/Field/FieldLabel.js.map +1 -0
- package/lib/commonjs/components/Field/FieldLabel.web.js +22 -0
- package/lib/commonjs/components/Field/FieldLabel.web.js.map +1 -0
- package/lib/commonjs/components/Field/index.js +158 -0
- package/lib/commonjs/components/Field/index.js.map +1 -0
- package/lib/commonjs/components/Field/styles.js +16 -0
- package/lib/commonjs/components/Field/styles.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 +48 -0
- package/lib/commonjs/components/Form/index.js.map +1 -0
- package/lib/commonjs/components/Form/styles.js +9 -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 +23 -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 +75 -0
- package/lib/commonjs/components/IconButton/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/styles.js +44 -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 +17 -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 +14 -0
- package/lib/commonjs/components/Link/styles.js.map +1 -0
- package/lib/commonjs/components/OtpInput/index.js +83 -0
- package/lib/commonjs/components/OtpInput/index.js.map +1 -0
- package/lib/commonjs/components/OtpInput/styles.js +48 -0
- package/lib/commonjs/components/OtpInput/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/index.js +45 -0
- package/lib/commonjs/components/ProgressBar/index.js.map +1 -0
- package/lib/commonjs/components/ProgressBar/styles.js +10 -0
- package/lib/commonjs/components/ProgressBar/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 +44 -0
- package/lib/commonjs/components/Stack/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 +23 -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 +204 -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/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/index.js +21 -10
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Button/styles.js +181 -162
- 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 +19 -12
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +17 -16
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- 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 +48 -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/Field/FieldLabel.js +29 -0
- package/lib/module/components/Field/FieldLabel.js.map +1 -0
- package/lib/module/components/Field/FieldLabel.web.js +17 -0
- package/lib/module/components/Field/FieldLabel.web.js.map +1 -0
- package/lib/module/components/Field/index.js +155 -0
- package/lib/module/components/Field/index.js.map +1 -0
- package/lib/module/components/Field/styles.js +12 -0
- package/lib/module/components/Field/styles.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 +44 -0
- package/lib/module/components/Form/index.js.map +1 -0
- package/lib/module/components/Form/styles.js +5 -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 +19 -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 +71 -0
- package/lib/module/components/IconButton/index.js.map +1 -0
- package/lib/module/components/IconButton/styles.js +40 -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 +17 -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 +11 -0
- package/lib/module/components/Link/styles.js.map +1 -0
- package/lib/module/components/OtpInput/index.js +79 -0
- package/lib/module/components/OtpInput/index.js.map +1 -0
- package/lib/module/components/OtpInput/styles.js +44 -0
- package/lib/module/components/OtpInput/styles.js.map +1 -0
- package/lib/module/components/ProgressBar/index.js +41 -0
- package/lib/module/components/ProgressBar/index.js.map +1 -0
- package/lib/module/components/ProgressBar/styles.js +6 -0
- package/lib/module/components/ProgressBar/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 +40 -0
- package/lib/module/components/Stack/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 +19 -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 +17 -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/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/index.d.ts +6 -3
- package/lib/typescript/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/components/Button/styles.d.ts +11 -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 +7 -5
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -4
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
- 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/Field/FieldLabel.d.ts +18 -0
- package/lib/typescript/components/Field/FieldLabel.d.ts.map +1 -0
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +16 -0
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -0
- package/lib/typescript/components/Field/index.d.ts +26 -0
- package/lib/typescript/components/Field/index.d.ts.map +1 -0
- package/lib/typescript/components/Field/styles.d.ts +16 -0
- package/lib/typescript/components/Field/styles.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormRoot.d.ts +14 -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 +7 -0
- package/lib/typescript/components/Form/index.d.ts.map +1 -0
- package/lib/typescript/components/Form/styles.d.ts +2 -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 +11 -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 +6 -0
- package/lib/typescript/components/Link/styles.d.ts.map +1 -0
- package/lib/typescript/components/OtpInput/index.d.ts +11 -0
- package/lib/typescript/components/OtpInput/index.d.ts.map +1 -0
- package/lib/typescript/components/OtpInput/styles.d.ts +14 -0
- package/lib/typescript/components/OtpInput/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressBar/index.d.ts +17 -0
- package/lib/typescript/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/components/ProgressBar/styles.d.ts +5 -0
- package/lib/typescript/components/ProgressBar/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 +23 -0
- package/lib/typescript/components/Stack/styles.d.ts.map +1 -0
- package/lib/typescript/components/Switch/index.d.ts +0 -1
- package/lib/typescript/components/Switch/index.d.ts.map +1 -1
- 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 +17 -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/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 +15 -6
- 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/index.tsx +14 -9
- package/src/components/Button/styles.ts +159 -209
- package/src/components/Card/index.tsx +115 -0
- package/src/components/Card/styles.ts +41 -0
- package/src/components/Checkbox/index.tsx +15 -23
- package/src/components/Checkbox/styles.ts +33 -24
- package/src/components/Chip/index.tsx +91 -0
- package/src/components/Chip/styles.ts +52 -0
- package/src/components/Dialog/index.tsx +304 -0
- package/src/components/Dialog/styles.ts +88 -0
- package/src/components/Field/FieldLabel.tsx +33 -0
- package/src/components/Field/FieldLabel.web.tsx +25 -0
- package/src/components/Field/index.tsx +171 -0
- package/src/components/Field/styles.ts +32 -0
- package/src/components/Form/FormRoot.tsx +20 -0
- package/src/components/Form/FormRoot.web.tsx +12 -0
- package/src/components/Form/index.tsx +38 -0
- package/src/components/Form/styles.ts +3 -0
- package/src/components/Heading/index.tsx +36 -0
- package/src/components/Heading/styles.tsx +25 -0
- package/src/components/Icon/index.tsx +54 -0
- package/src/components/IconButton/index.tsx +92 -0
- package/src/components/IconButton/styles.ts +59 -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 +36 -40
- package/src/components/Link/index.tsx +83 -0
- package/src/components/Link/styles.ts +21 -0
- package/src/components/OtpInput/index.tsx +79 -0
- package/src/components/OtpInput/styles.ts +45 -0
- package/src/components/ProgressBar/index.tsx +53 -0
- package/src/components/ProgressBar/styles.ts +9 -0
- package/src/components/ProgressSegmented/index.tsx +81 -0
- package/src/components/ProgressSegmented/styles.ts +20 -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 +42 -0
- package/src/components/Switch/index.tsx +0 -2
- package/src/components/Text/index.tsx +16 -0
- package/src/components/Text/styles.tsx +25 -0
- package/src/components/VirtualizedList/index.tsx +19 -0
- package/src/components/index.ts +17 -0
- package/src/index.ts +3 -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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import {
|
|
3
|
+
COLOR_BG_PRIMARY,
|
|
4
|
+
COLOR_BORDER_DEFAULT,
|
|
5
|
+
COLOR_TEXT_PRIMARY,
|
|
6
|
+
RADIUS_SM,
|
|
7
|
+
SHADOW_SM,
|
|
8
|
+
} from '../../styles/primitives';
|
|
9
|
+
|
|
10
|
+
// ── Root ────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
export const cardRootVariants = cva([
|
|
13
|
+
COLOR_BG_PRIMARY,
|
|
14
|
+
`border ${COLOR_BORDER_DEFAULT}`,
|
|
15
|
+
RADIUS_SM,
|
|
16
|
+
SHADOW_SM,
|
|
17
|
+
'overflow-hidden',
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
// ── Header ──────────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
export const cardHeaderVariants = cva([
|
|
23
|
+
'flex-row items-center justify-between p-4 border-b border-t-8',
|
|
24
|
+
COLOR_BORDER_DEFAULT,
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
// ── Title ───────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
export const cardTitleVariants = cva(['flex-1']);
|
|
30
|
+
|
|
31
|
+
// ── Content ─────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
export const cardContentVariants = cva([COLOR_TEXT_PRIMARY, 'p-4']);
|
|
34
|
+
|
|
35
|
+
// ── Footer ──────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
export const cardFooterVariants = cva([
|
|
38
|
+
'p-4 border-t',
|
|
39
|
+
COLOR_BORDER_DEFAULT,
|
|
40
|
+
'flex-row items-center gap-2',
|
|
41
|
+
]);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { forwardRef, type ReactNode } from 'react';
|
|
2
2
|
import { Pressable, Text, type TextProps, View, type ViewProps } from 'react-native';
|
|
3
|
+
import { Check, CheckIndeterminateSmall } from '@cdx-ui/icons';
|
|
3
4
|
import { createCheckbox, type ICheckboxProps } from '@cdx-ui/primitives';
|
|
4
5
|
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
6
|
+
import { Icon, IconProps } from '../Icon';
|
|
5
7
|
import {
|
|
6
8
|
type CheckboxVariantProps,
|
|
7
9
|
checkboxGroupVariants,
|
|
@@ -35,17 +37,23 @@ export interface CheckboxProps extends ICheckboxProps, CheckboxVariantProps {
|
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
const CheckboxRoot = forwardRef<View, CheckboxProps>(
|
|
38
|
-
({ size = '
|
|
40
|
+
({ size = 'default', className, isIndeterminate, children, style, ...props }, ref) => {
|
|
39
41
|
const computedClassName = cn(checkboxRootVariants({ size }), className);
|
|
40
42
|
|
|
41
43
|
return (
|
|
42
44
|
<CheckboxPrimitive
|
|
43
45
|
ref={ref as any}
|
|
44
46
|
className={computedClassName}
|
|
47
|
+
isIndeterminate={isIndeterminate}
|
|
45
48
|
style={style}
|
|
46
49
|
context={{ size }}
|
|
47
50
|
{...props}
|
|
48
51
|
>
|
|
52
|
+
<CheckboxIndicator>
|
|
53
|
+
<CheckboxPrimitive.Icon>
|
|
54
|
+
<CheckboxIcon as={isIndeterminate ? CheckIndeterminateSmall : Check} />
|
|
55
|
+
</CheckboxPrimitive.Icon>
|
|
56
|
+
</CheckboxIndicator>
|
|
49
57
|
{children}
|
|
50
58
|
</CheckboxPrimitive>
|
|
51
59
|
);
|
|
@@ -87,28 +95,14 @@ CheckboxIndicator.displayName = 'Checkbox.Indicator';
|
|
|
87
95
|
// CHECKBOX ICON
|
|
88
96
|
// =============================================================================
|
|
89
97
|
|
|
90
|
-
export interface CheckboxIconProps extends
|
|
91
|
-
className?: string;
|
|
92
|
-
children?: ReactNode;
|
|
93
|
-
}
|
|
98
|
+
export interface CheckboxIconProps extends Omit<IconProps, 'children'> {}
|
|
94
99
|
|
|
95
|
-
const CheckboxIcon =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const computedClassName = cn(checkboxIconVariants({ size }), className);
|
|
100
|
+
const CheckboxIcon = ({ className, style, ...props }: CheckboxIconProps) => {
|
|
101
|
+
const { size } = useCheckboxStyleContext();
|
|
102
|
+
const computedClassName = cn(checkboxIconVariants({ size }), className);
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
ref={ref as any}
|
|
103
|
-
className={computedClassName}
|
|
104
|
-
style={style}
|
|
105
|
-
{...props}
|
|
106
|
-
>
|
|
107
|
-
{children}
|
|
108
|
-
</CheckboxPrimitive.Icon>
|
|
109
|
-
);
|
|
110
|
-
},
|
|
111
|
-
);
|
|
104
|
+
return <Icon className={computedClassName} style={style} {...props} />;
|
|
105
|
+
};
|
|
112
106
|
|
|
113
107
|
CheckboxIcon.displayName = 'Checkbox.Icon';
|
|
114
108
|
|
|
@@ -211,5 +205,3 @@ export const Checkbox = Object.assign(CheckboxRoot, {
|
|
|
211
205
|
Label: CheckboxLabel,
|
|
212
206
|
Group: CheckboxGroup,
|
|
213
207
|
}) as CheckboxCompoundComponent;
|
|
214
|
-
|
|
215
|
-
export type { CheckboxVariantProps };
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import {
|
|
4
|
+
COLOR_BG_PRIMARY,
|
|
5
|
+
COLOR_BORDER_STRONG,
|
|
6
|
+
COLOR_TEXT_PRIMARY,
|
|
7
|
+
DISABLED_CURSOR,
|
|
8
|
+
DISABLED_OPACITY,
|
|
9
|
+
TRANSITION_COLORS,
|
|
10
|
+
} from '../../styles/primitives';
|
|
3
11
|
|
|
4
12
|
export const checkboxRootVariants = cva(
|
|
5
|
-
[
|
|
6
|
-
'flex-row items-center',
|
|
7
|
-
'data-[disabled=true]:opacity-60 data-[disabled=true]:cursor-not-allowed',
|
|
8
|
-
],
|
|
13
|
+
['flex-row items-center', DISABLED_OPACITY, DISABLED_CURSOR],
|
|
9
14
|
{
|
|
10
15
|
variants: {
|
|
11
16
|
size: {
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
small: 'gap-2',
|
|
18
|
+
default: 'gap-2.5',
|
|
14
19
|
},
|
|
15
20
|
},
|
|
16
21
|
defaultVariants: {
|
|
17
|
-
size: '
|
|
22
|
+
size: 'default',
|
|
18
23
|
},
|
|
19
24
|
},
|
|
20
25
|
);
|
|
@@ -23,18 +28,22 @@ export const checkboxIndicatorVariants = cva(
|
|
|
23
28
|
[
|
|
24
29
|
'items-center justify-center',
|
|
25
30
|
'rounded',
|
|
26
|
-
'border-2
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
'border-2',
|
|
32
|
+
COLOR_BORDER_STRONG,
|
|
33
|
+
COLOR_BG_PRIMARY,
|
|
34
|
+
'data-[checked=true]:bg-slate-900 data-[checked=true]:border-slate-900',
|
|
35
|
+
'data-[indeterminate=true]:bg-slate-900 data-[indeterminate=true]:border-slate-900',
|
|
36
|
+
'data-[disabled=true]:opacity-50',
|
|
29
37
|
'data-[invalid=true]:border-red-500',
|
|
30
38
|
'data-[checked=true]:data-[invalid=true]:bg-red-500 data-[checked=true]:data-[invalid=true]:border-red-500',
|
|
39
|
+
'data-[indeterminate=true]:data-[invalid=true]:bg-red-500 data-[indeterminate=true]:data-[invalid=true]:border-red-500',
|
|
31
40
|
Platform.select({
|
|
32
41
|
web: [
|
|
33
|
-
|
|
34
|
-
'data-[hover=true]:border-
|
|
35
|
-
'data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-
|
|
42
|
+
TRANSITION_COLORS,
|
|
43
|
+
'data-[hover=true]:data-[checked=false]:data-[indeterminate=false]:border-slate-400 data-[hover=true]:data-[checked=false]:data-[indeterminate=false]:bg-slate-50',
|
|
44
|
+
'data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-slate-400/50 data-[focus-visible=true]:ring-offset-2',
|
|
36
45
|
'data-[invalid=true]:data-[hover=true]:border-red-400',
|
|
37
|
-
'data-[invalid=true]:data-[focus-visible=true]:ring-red-
|
|
46
|
+
'data-[invalid=true]:data-[focus-visible=true]:ring-red-400/50',
|
|
38
47
|
].join(' '),
|
|
39
48
|
default: '',
|
|
40
49
|
}),
|
|
@@ -42,12 +51,12 @@ export const checkboxIndicatorVariants = cva(
|
|
|
42
51
|
{
|
|
43
52
|
variants: {
|
|
44
53
|
size: {
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
small: 'h-4 w-4',
|
|
55
|
+
default: 'h-5 w-5',
|
|
47
56
|
},
|
|
48
57
|
},
|
|
49
58
|
defaultVariants: {
|
|
50
|
-
size: '
|
|
59
|
+
size: 'default',
|
|
51
60
|
},
|
|
52
61
|
},
|
|
53
62
|
);
|
|
@@ -55,26 +64,26 @@ export const checkboxIndicatorVariants = cva(
|
|
|
55
64
|
export const checkboxIconVariants = cva(['text-white'], {
|
|
56
65
|
variants: {
|
|
57
66
|
size: {
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
small: 'h-3 w-3',
|
|
68
|
+
default: 'h-3.5 w-3.5',
|
|
60
69
|
},
|
|
61
70
|
},
|
|
62
71
|
defaultVariants: {
|
|
63
|
-
size: '
|
|
72
|
+
size: 'default',
|
|
64
73
|
},
|
|
65
74
|
});
|
|
66
75
|
|
|
67
76
|
export const checkboxLabelVariants = cva(
|
|
68
|
-
[
|
|
77
|
+
[COLOR_TEXT_PRIMARY, 'data-[disabled=true]:text-slate-400'],
|
|
69
78
|
{
|
|
70
79
|
variants: {
|
|
71
80
|
size: {
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
small: 'text-sm',
|
|
82
|
+
default: 'text-base',
|
|
74
83
|
},
|
|
75
84
|
},
|
|
76
85
|
defaultVariants: {
|
|
77
|
-
size: '
|
|
86
|
+
size: 'default',
|
|
78
87
|
},
|
|
79
88
|
},
|
|
80
89
|
);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
+
import { View, Text as RNText, type ViewProps, type TextProps } from 'react-native';
|
|
3
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
4
|
+
import { Icon, type IconProps } from '../Icon';
|
|
5
|
+
import { chipRootVariants, chipLabelVariants, chipIconVariants, ChipVariants } from './styles';
|
|
6
|
+
|
|
7
|
+
const SCOPE = 'CHIP';
|
|
8
|
+
|
|
9
|
+
const Root = withStyleContext(View, SCOPE);
|
|
10
|
+
|
|
11
|
+
const useChipStyleContext = () => useStyleContext(SCOPE) as ChipVariants;
|
|
12
|
+
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// STYLED ROOT COMPONENT
|
|
15
|
+
// =============================================================================
|
|
16
|
+
|
|
17
|
+
export interface ChipProps extends ViewProps, ChipVariants {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ChipRoot = forwardRef<View, ChipProps>(
|
|
23
|
+
({ children, color = 'default', className, style, ...props }, ref) => {
|
|
24
|
+
const computedClassName = cn(chipRootVariants({ color }), className);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Root ref={ref} className={computedClassName} style={style} context={{ color }} {...props}>
|
|
28
|
+
{children}
|
|
29
|
+
</Root>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
ChipRoot.displayName = 'Chip';
|
|
35
|
+
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// STYLED LABEL COMPONENT
|
|
38
|
+
// =============================================================================
|
|
39
|
+
|
|
40
|
+
export interface ChipLabelProps extends TextProps {
|
|
41
|
+
className?: string;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const ChipLabel = forwardRef<RNText, ChipLabelProps>(
|
|
46
|
+
({ className, children, style, ...props }, ref) => {
|
|
47
|
+
const { color } = useChipStyleContext();
|
|
48
|
+
|
|
49
|
+
const computedClassName = cn(chipLabelVariants({ color }), className);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<RNText ref={ref} className={computedClassName} style={style} {...props}>
|
|
53
|
+
{children}
|
|
54
|
+
</RNText>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
ChipLabel.displayName = 'Chip.Label';
|
|
60
|
+
|
|
61
|
+
// =============================================================================
|
|
62
|
+
// STYLED ICON COMPONENT
|
|
63
|
+
// =============================================================================
|
|
64
|
+
|
|
65
|
+
export interface ChipIconProps extends Omit<IconProps, 'children'> {}
|
|
66
|
+
|
|
67
|
+
const ChipIcon = ({ className, style, as, ...props }: ChipIconProps) => {
|
|
68
|
+
const { color } = useChipStyleContext();
|
|
69
|
+
|
|
70
|
+
const computedClassName = cn(chipIconVariants({ color }), className);
|
|
71
|
+
|
|
72
|
+
return <Icon as={as} className={computedClassName} style={style} {...props} />;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
ChipIcon.displayName = 'Chip.Icon';
|
|
76
|
+
|
|
77
|
+
// =============================================================================
|
|
78
|
+
// COMPOUND COMPONENT EXPORT
|
|
79
|
+
// =============================================================================
|
|
80
|
+
|
|
81
|
+
type ChipCompoundComponent = typeof ChipRoot & {
|
|
82
|
+
Label: typeof ChipLabel;
|
|
83
|
+
Icon: typeof ChipIcon;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const Chip = Object.assign(ChipRoot, {
|
|
87
|
+
Label: ChipLabel,
|
|
88
|
+
Icon: ChipIcon,
|
|
89
|
+
}) as ChipCompoundComponent;
|
|
90
|
+
|
|
91
|
+
export { type ChipVariants } from './styles';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
export const chipRootVariants = cva(
|
|
4
|
+
['flex-row items-center justify-center rounded-full px-2 py-1 gap-1.5 self-start'],
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
color: {
|
|
8
|
+
default: 'bg-surface-neutral-tint',
|
|
9
|
+
error: 'bg-surface-danger-tint',
|
|
10
|
+
info: 'bg-surface-info-tint',
|
|
11
|
+
success: 'bg-surface-success-tint',
|
|
12
|
+
warning: 'bg-surface-warning-tint',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
color: 'default',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// TODO: letter-spacing values (tracking-wider) are not working on web, but the font-mono-medium is.
|
|
22
|
+
export const chipLabelVariants = cva(['label-sm font-mono-medium'], {
|
|
23
|
+
variants: {
|
|
24
|
+
color: {
|
|
25
|
+
default: 'text-content-primary',
|
|
26
|
+
error: 'text-content-primary',
|
|
27
|
+
info: 'text-content-primary',
|
|
28
|
+
success: 'text-content-primary',
|
|
29
|
+
warning: 'text-content-primary',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
color: 'default',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const chipIconVariants = cva(['size-4'], {
|
|
38
|
+
variants: {
|
|
39
|
+
color: {
|
|
40
|
+
default: 'text-content-primary',
|
|
41
|
+
error: 'text-content-danger',
|
|
42
|
+
info: 'text-content-info',
|
|
43
|
+
success: 'text-content-success',
|
|
44
|
+
warning: 'text-content-warning',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
color: 'default',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export type ChipVariants = VariantProps<typeof chipRootVariants>;
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { forwardRef, type ReactNode } from 'react';
|
|
2
|
+
import { Pressable, Text, View, type PressableProps, type ViewProps } from 'react-native';
|
|
3
|
+
import { Close as CloseIcon } from '@cdx-ui/icons';
|
|
4
|
+
import {
|
|
5
|
+
createDialog,
|
|
6
|
+
type IDialogBodyProps,
|
|
7
|
+
type IDialogCloseProps,
|
|
8
|
+
type IDialogContentProps,
|
|
9
|
+
type IDialogDescriptionProps,
|
|
10
|
+
type IDialogFooterProps,
|
|
11
|
+
type IDialogHeaderProps,
|
|
12
|
+
type IDialogRootProps,
|
|
13
|
+
type IDialogTitleProps,
|
|
14
|
+
type IDialogTriggerProps,
|
|
15
|
+
} from '@cdx-ui/primitives';
|
|
16
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
17
|
+
import { Icon } from '../Icon';
|
|
18
|
+
import {
|
|
19
|
+
type DialogVariantProps,
|
|
20
|
+
dialogBodyVariants,
|
|
21
|
+
dialogCloseIconVariants,
|
|
22
|
+
dialogCloseVariants,
|
|
23
|
+
dialogContentVariants,
|
|
24
|
+
dialogDescriptionVariants,
|
|
25
|
+
dialogFooterVariants,
|
|
26
|
+
dialogHeaderVariants,
|
|
27
|
+
dialogOverlayVariants,
|
|
28
|
+
dialogTitleVariants,
|
|
29
|
+
} from './styles';
|
|
30
|
+
|
|
31
|
+
export { useDialog } from '@cdx-ui/primitives';
|
|
32
|
+
|
|
33
|
+
// =============================================================================
|
|
34
|
+
// STYLE CONTEXT
|
|
35
|
+
// =============================================================================
|
|
36
|
+
|
|
37
|
+
const SCOPE = 'DIALOG';
|
|
38
|
+
|
|
39
|
+
const Root = withStyleContext(View, SCOPE);
|
|
40
|
+
|
|
41
|
+
const useDialogStyleContext = () => useStyleContext(SCOPE) as DialogVariantProps;
|
|
42
|
+
|
|
43
|
+
// =============================================================================
|
|
44
|
+
// STYLED OVERLAY (internal — not consumer-facing)
|
|
45
|
+
// =============================================================================
|
|
46
|
+
|
|
47
|
+
const StyledOverlay = forwardRef<View, PressableProps & { className?: string }>(
|
|
48
|
+
({ className, ...props }, ref) => (
|
|
49
|
+
<Pressable ref={ref} className={cn(dialogOverlayVariants(), className)} {...props} />
|
|
50
|
+
),
|
|
51
|
+
);
|
|
52
|
+
StyledOverlay.displayName = 'Dialog.Overlay';
|
|
53
|
+
|
|
54
|
+
// =============================================================================
|
|
55
|
+
// CREATE DIALOG PRIMITIVE
|
|
56
|
+
// =============================================================================
|
|
57
|
+
|
|
58
|
+
const DialogPrimitive = createDialog({
|
|
59
|
+
Root,
|
|
60
|
+
Trigger: Pressable,
|
|
61
|
+
Overlay: StyledOverlay,
|
|
62
|
+
Content: View,
|
|
63
|
+
Header: View,
|
|
64
|
+
Title: Text,
|
|
65
|
+
Description: Text,
|
|
66
|
+
Body: View,
|
|
67
|
+
Footer: View,
|
|
68
|
+
Close: Pressable,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// =============================================================================
|
|
72
|
+
// STYLED ROOT
|
|
73
|
+
// =============================================================================
|
|
74
|
+
|
|
75
|
+
export interface DialogRootProps
|
|
76
|
+
extends Omit<ViewProps, 'children' | 'role'>, IDialogRootProps, DialogVariantProps {
|
|
77
|
+
className?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const DialogRoot = forwardRef<View, DialogRootProps>(
|
|
81
|
+
({ size = 'md', className, children, style, ...props }, ref) => (
|
|
82
|
+
<DialogPrimitive ref={ref} className={className} style={style} context={{ size }} {...props}>
|
|
83
|
+
{children}
|
|
84
|
+
</DialogPrimitive>
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
DialogRoot.displayName = 'Dialog';
|
|
89
|
+
|
|
90
|
+
// =============================================================================
|
|
91
|
+
// STYLED TRIGGER
|
|
92
|
+
// =============================================================================
|
|
93
|
+
|
|
94
|
+
export interface DialogTriggerProps extends IDialogTriggerProps {
|
|
95
|
+
className?: string;
|
|
96
|
+
children?: ReactNode;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const DialogTrigger = forwardRef<View, DialogTriggerProps>(
|
|
100
|
+
({ className, children, style, ...props }, ref) => (
|
|
101
|
+
<DialogPrimitive.Trigger ref={ref} className={className} style={style} {...props}>
|
|
102
|
+
{children}
|
|
103
|
+
</DialogPrimitive.Trigger>
|
|
104
|
+
),
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
DialogTrigger.displayName = 'Dialog.Trigger';
|
|
108
|
+
|
|
109
|
+
// =============================================================================
|
|
110
|
+
// STYLED CONTENT
|
|
111
|
+
// =============================================================================
|
|
112
|
+
|
|
113
|
+
export interface DialogContentProps extends IDialogContentProps, DialogVariantProps {
|
|
114
|
+
className?: string;
|
|
115
|
+
children?: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const DialogContent = forwardRef<View, DialogContentProps>(
|
|
119
|
+
({ size: sizeProp, className, children, style, ...props }, ref) => {
|
|
120
|
+
const { size: contextSize } = useDialogStyleContext();
|
|
121
|
+
const size = sizeProp ?? contextSize;
|
|
122
|
+
const computedClassName = cn(dialogContentVariants({ size }), className);
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<DialogPrimitive.Content ref={ref} className={computedClassName} style={style} {...props}>
|
|
126
|
+
{children}
|
|
127
|
+
</DialogPrimitive.Content>
|
|
128
|
+
);
|
|
129
|
+
},
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
DialogContent.displayName = 'Dialog.Content';
|
|
133
|
+
|
|
134
|
+
// =============================================================================
|
|
135
|
+
// STYLED HEADER
|
|
136
|
+
// =============================================================================
|
|
137
|
+
|
|
138
|
+
export interface DialogHeaderProps extends IDialogHeaderProps {
|
|
139
|
+
className?: string;
|
|
140
|
+
children?: ReactNode;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const DialogHeader = forwardRef<View, DialogHeaderProps>(
|
|
144
|
+
({ className, children, style, ...props }, ref) => {
|
|
145
|
+
const computedClassName = cn(dialogHeaderVariants(), className);
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<DialogPrimitive.Header ref={ref} className={computedClassName} style={style} {...props}>
|
|
149
|
+
{children}
|
|
150
|
+
</DialogPrimitive.Header>
|
|
151
|
+
);
|
|
152
|
+
},
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
DialogHeader.displayName = 'Dialog.Header';
|
|
156
|
+
|
|
157
|
+
// =============================================================================
|
|
158
|
+
// STYLED TITLE
|
|
159
|
+
// =============================================================================
|
|
160
|
+
|
|
161
|
+
export interface DialogTitleProps extends IDialogTitleProps {
|
|
162
|
+
className?: string;
|
|
163
|
+
children?: ReactNode;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const DialogTitle = forwardRef<Text, DialogTitleProps>(
|
|
167
|
+
({ className, children, style, ...props }, ref) => {
|
|
168
|
+
const computedClassName = cn(dialogTitleVariants(), className);
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<DialogPrimitive.Title ref={ref} className={computedClassName} style={style} {...props}>
|
|
172
|
+
{children}
|
|
173
|
+
</DialogPrimitive.Title>
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
DialogTitle.displayName = 'Dialog.Title';
|
|
179
|
+
|
|
180
|
+
// =============================================================================
|
|
181
|
+
// STYLED DESCRIPTION
|
|
182
|
+
// =============================================================================
|
|
183
|
+
|
|
184
|
+
export interface DialogDescriptionProps extends IDialogDescriptionProps {
|
|
185
|
+
className?: string;
|
|
186
|
+
children?: ReactNode;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const DialogDescription = forwardRef<Text, DialogDescriptionProps>(
|
|
190
|
+
({ className, children, style, ...props }, ref) => {
|
|
191
|
+
const computedClassName = cn(dialogDescriptionVariants(), className);
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<DialogPrimitive.Description ref={ref} className={computedClassName} style={style} {...props}>
|
|
195
|
+
{children}
|
|
196
|
+
</DialogPrimitive.Description>
|
|
197
|
+
);
|
|
198
|
+
},
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
DialogDescription.displayName = 'Dialog.Description';
|
|
202
|
+
|
|
203
|
+
// =============================================================================
|
|
204
|
+
// STYLED BODY
|
|
205
|
+
// =============================================================================
|
|
206
|
+
|
|
207
|
+
export interface DialogBodyProps extends IDialogBodyProps {
|
|
208
|
+
className?: string;
|
|
209
|
+
children?: ReactNode;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const DialogBody = forwardRef<View, DialogBodyProps>(
|
|
213
|
+
({ className, children, style, ...props }, ref) => {
|
|
214
|
+
const computedClassName = cn(dialogBodyVariants(), className);
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<DialogPrimitive.Body ref={ref} className={computedClassName} style={style} {...props}>
|
|
218
|
+
{children}
|
|
219
|
+
</DialogPrimitive.Body>
|
|
220
|
+
);
|
|
221
|
+
},
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
DialogBody.displayName = 'Dialog.Body';
|
|
225
|
+
|
|
226
|
+
// =============================================================================
|
|
227
|
+
// STYLED FOOTER
|
|
228
|
+
// =============================================================================
|
|
229
|
+
|
|
230
|
+
export interface DialogFooterProps extends IDialogFooterProps {
|
|
231
|
+
className?: string;
|
|
232
|
+
children?: ReactNode;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const DialogFooter = forwardRef<View, DialogFooterProps>(
|
|
236
|
+
({ className, children, style, ...props }, ref) => {
|
|
237
|
+
const computedClassName = cn(dialogFooterVariants(), className);
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<DialogPrimitive.Footer ref={ref} className={computedClassName} style={style} {...props}>
|
|
241
|
+
{children}
|
|
242
|
+
</DialogPrimitive.Footer>
|
|
243
|
+
);
|
|
244
|
+
},
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
DialogFooter.displayName = 'Dialog.Footer';
|
|
248
|
+
|
|
249
|
+
// =============================================================================
|
|
250
|
+
// STYLED CLOSE
|
|
251
|
+
// =============================================================================
|
|
252
|
+
|
|
253
|
+
export interface DialogCloseProps extends IDialogCloseProps {
|
|
254
|
+
className?: string;
|
|
255
|
+
children?: ReactNode;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const DialogClose = forwardRef<View, DialogCloseProps>(
|
|
259
|
+
({ className, accessibilityLabel = 'Close', children, style, ...props }, ref) => {
|
|
260
|
+
const computedClassName = cn(dialogCloseVariants(), className);
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<DialogPrimitive.Close
|
|
264
|
+
ref={ref}
|
|
265
|
+
className={computedClassName}
|
|
266
|
+
style={style}
|
|
267
|
+
hitSlop={12}
|
|
268
|
+
accessibilityRole="button"
|
|
269
|
+
accessibilityLabel={accessibilityLabel}
|
|
270
|
+
{...props}
|
|
271
|
+
>
|
|
272
|
+
{children ?? <Icon as={CloseIcon} className={dialogCloseIconVariants()} />}
|
|
273
|
+
</DialogPrimitive.Close>
|
|
274
|
+
);
|
|
275
|
+
},
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
DialogClose.displayName = 'Dialog.Close';
|
|
279
|
+
|
|
280
|
+
// =============================================================================
|
|
281
|
+
// COMPOUND COMPONENT
|
|
282
|
+
// =============================================================================
|
|
283
|
+
|
|
284
|
+
type DialogCompoundComponent = typeof DialogRoot & {
|
|
285
|
+
Trigger: typeof DialogTrigger;
|
|
286
|
+
Content: typeof DialogContent;
|
|
287
|
+
Header: typeof DialogHeader;
|
|
288
|
+
Title: typeof DialogTitle;
|
|
289
|
+
Description: typeof DialogDescription;
|
|
290
|
+
Body: typeof DialogBody;
|
|
291
|
+
Footer: typeof DialogFooter;
|
|
292
|
+
Close: typeof DialogClose;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export const Dialog = Object.assign(DialogRoot, {
|
|
296
|
+
Trigger: DialogTrigger,
|
|
297
|
+
Content: DialogContent,
|
|
298
|
+
Header: DialogHeader,
|
|
299
|
+
Title: DialogTitle,
|
|
300
|
+
Description: DialogDescription,
|
|
301
|
+
Body: DialogBody,
|
|
302
|
+
Footer: DialogFooter,
|
|
303
|
+
Close: DialogClose,
|
|
304
|
+
}) as DialogCompoundComponent;
|