@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,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Image, Text, View } from 'react-native';
|
|
5
|
+
import { createAvatar } from '@cdx-ui/primitives';
|
|
6
|
+
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
7
|
+
import { Icon as IconComponent } from '../Icon';
|
|
8
|
+
import { avatarBadgeVariants, avatarIconVariants, avatarTextVariants, avatarImageVariants, avatarRootVariants } from './styles';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
const SCOPE = 'AVATAR';
|
|
11
|
+
const Root = withStyleContext(View, SCOPE);
|
|
12
|
+
const useAvatarStyleContext = () => useStyleContext(SCOPE);
|
|
13
|
+
const AvatarPrimitive = createAvatar({
|
|
14
|
+
Root,
|
|
15
|
+
Image,
|
|
16
|
+
Text,
|
|
17
|
+
Icon: IconComponent,
|
|
18
|
+
Badge: View
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// AVATAR ROOT
|
|
23
|
+
// =============================================================================
|
|
24
|
+
|
|
25
|
+
const AvatarRoot = /*#__PURE__*/forwardRef(({
|
|
26
|
+
size = 'lg',
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
style,
|
|
30
|
+
...props
|
|
31
|
+
}, ref) => {
|
|
32
|
+
const computedClassName = cn(avatarRootVariants({
|
|
33
|
+
size
|
|
34
|
+
}), className);
|
|
35
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive, {
|
|
36
|
+
ref: ref,
|
|
37
|
+
className: computedClassName,
|
|
38
|
+
style: style,
|
|
39
|
+
context: {
|
|
40
|
+
size
|
|
41
|
+
},
|
|
42
|
+
...props,
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
AvatarRoot.displayName = 'Avatar';
|
|
47
|
+
|
|
48
|
+
// =============================================================================
|
|
49
|
+
// AVATAR IMAGE
|
|
50
|
+
// =============================================================================
|
|
51
|
+
|
|
52
|
+
const AvatarImage = /*#__PURE__*/forwardRef(({
|
|
53
|
+
className,
|
|
54
|
+
style,
|
|
55
|
+
...props
|
|
56
|
+
}, ref) => {
|
|
57
|
+
const computedClassName = cn(avatarImageVariants(), className);
|
|
58
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Image, {
|
|
59
|
+
ref: ref,
|
|
60
|
+
className: computedClassName,
|
|
61
|
+
style: style,
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
AvatarImage.displayName = 'Avatar.Image';
|
|
66
|
+
|
|
67
|
+
// =============================================================================
|
|
68
|
+
// AVATAR TEXT
|
|
69
|
+
// =============================================================================
|
|
70
|
+
|
|
71
|
+
const AvatarText = /*#__PURE__*/forwardRef(({
|
|
72
|
+
className,
|
|
73
|
+
children,
|
|
74
|
+
style,
|
|
75
|
+
...props
|
|
76
|
+
}, ref) => {
|
|
77
|
+
const {
|
|
78
|
+
size
|
|
79
|
+
} = useAvatarStyleContext();
|
|
80
|
+
const computedClassName = cn(avatarTextVariants({
|
|
81
|
+
size
|
|
82
|
+
}), className);
|
|
83
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Text, {
|
|
84
|
+
ref: ref,
|
|
85
|
+
className: computedClassName,
|
|
86
|
+
style: style,
|
|
87
|
+
...props,
|
|
88
|
+
children: children
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
AvatarText.displayName = 'Avatar.Text';
|
|
92
|
+
|
|
93
|
+
// =============================================================================
|
|
94
|
+
// AVATAR ICON
|
|
95
|
+
// =============================================================================
|
|
96
|
+
|
|
97
|
+
const AvatarIcon = ({
|
|
98
|
+
className,
|
|
99
|
+
style,
|
|
100
|
+
...props
|
|
101
|
+
}) => {
|
|
102
|
+
const {
|
|
103
|
+
size
|
|
104
|
+
} = useAvatarStyleContext();
|
|
105
|
+
const computedClassName = cn(avatarIconVariants({
|
|
106
|
+
size
|
|
107
|
+
}), className);
|
|
108
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Icon, {
|
|
109
|
+
className: computedClassName,
|
|
110
|
+
style: style,
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
AvatarIcon.displayName = 'Avatar.Icon';
|
|
115
|
+
|
|
116
|
+
// =============================================================================
|
|
117
|
+
// AVATAR BADGE
|
|
118
|
+
// =============================================================================
|
|
119
|
+
|
|
120
|
+
const AvatarBadge = /*#__PURE__*/forwardRef(({
|
|
121
|
+
className,
|
|
122
|
+
children,
|
|
123
|
+
style,
|
|
124
|
+
...props
|
|
125
|
+
}, ref) => {
|
|
126
|
+
const {
|
|
127
|
+
size
|
|
128
|
+
} = useAvatarStyleContext();
|
|
129
|
+
const computedClassName = cn(avatarBadgeVariants({
|
|
130
|
+
size
|
|
131
|
+
}), className);
|
|
132
|
+
return /*#__PURE__*/_jsx(AvatarPrimitive.Badge, {
|
|
133
|
+
ref: ref,
|
|
134
|
+
className: computedClassName,
|
|
135
|
+
style: style,
|
|
136
|
+
...props,
|
|
137
|
+
children: children
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
AvatarBadge.displayName = 'Avatar.Badge';
|
|
141
|
+
|
|
142
|
+
// =============================================================================
|
|
143
|
+
// COMPOUND COMPONENT
|
|
144
|
+
// =============================================================================
|
|
145
|
+
|
|
146
|
+
export const Avatar = Object.assign(AvatarRoot, {
|
|
147
|
+
Image: AvatarImage,
|
|
148
|
+
Text: AvatarText,
|
|
149
|
+
Icon: AvatarIcon,
|
|
150
|
+
Badge: AvatarBadge
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Image","Text","View","createAvatar","cn","useStyleContext","withStyleContext","Icon","IconComponent","avatarBadgeVariants","avatarIconVariants","avatarTextVariants","avatarImageVariants","avatarRootVariants","jsx","_jsx","SCOPE","Root","useAvatarStyleContext","AvatarPrimitive","Badge","AvatarRoot","size","className","children","style","props","ref","computedClassName","context","displayName","AvatarImage","AvatarText","AvatarIcon","AvatarBadge","Avatar","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Avatar/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,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,IAAA,CAACI,eAAe,CAACZ,IAAI;IAACgB,SAAS,EAAEK,iBAAkB;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC;EAAK,CAAG,CAAC;AACxF,CAAC;AAEDO,UAAU,CAACH,WAAW,GAAG,aAAa;;AAEtC;AACA;AACA;;AAOA,MAAMI,WAAW,gBAAGnC,UAAU,CAC5B,CAAC;EAAEwB,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACjD,MAAM;IAAEL;EAAK,CAAC,GAAGJ,qBAAqB,CAAC,CAAC;EACxC,MAAMU,iBAAiB,GAAGxB,EAAE,CAACK,mBAAmB,CAAC;IAAEa;EAAK,CAAC,CAAC,EAAEC,SAAS,CAAC;EAEtE,oBACER,IAAA,CAACI,eAAe,CAACC,KAAK;IACpBO,GAAG,EAAEA,GAAa;IAClBJ,SAAS,EAAEK,iBAAkB;IAC7BH,KAAK,EAAEA,KAAM;IAAA,GACTC,KAAK;IAAAF,QAAA,EAERA;EAAQ,CACY,CAAC;AAE5B,CACF,CAAC;AAEDU,WAAW,CAACJ,WAAW,GAAG,cAAc;;AAExC;AACA;AACA;;AASA,OAAO,MAAMK,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAChB,UAAU,EAAE;EAC9CrB,KAAK,EAAE+B,WAAW;EAClB9B,IAAI,EAAE+B,UAAU;EAChBzB,IAAI,EAAE0B,UAAU;EAChBb,KAAK,EAAEc;AACT,CAAC,CAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { COLOR_BG_MUTED, COLOR_TEXT_SECONDARY, RADIUS_FULL } from '../../styles/primitives';
|
|
5
|
+
|
|
6
|
+
// ── Root ─────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
export const avatarRootVariants = cva([RADIUS_FULL, 'relative items-center justify-center', COLOR_BG_MUTED], {
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
sm: 'w-8 h-8',
|
|
12
|
+
md: 'w-10 h-10',
|
|
13
|
+
lg: 'w-12 h-12',
|
|
14
|
+
xl: 'w-16 h-16',
|
|
15
|
+
'2xl': 'w-20 h-20'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: 'lg'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// ── Image ────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
export const avatarImageVariants = cva(['absolute top-0 left-0 w-full h-full', RADIUS_FULL, 'overflow-hidden']);
|
|
26
|
+
|
|
27
|
+
// ── Text ─────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
export const avatarTextVariants = cva([COLOR_TEXT_SECONDARY, 'font-semibold'], {
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: 'text-xs',
|
|
33
|
+
md: 'text-sm',
|
|
34
|
+
lg: 'text-base',
|
|
35
|
+
xl: 'text-xl',
|
|
36
|
+
'2xl': 'text-2xl'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
size: 'lg'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// ── Icon ─────────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
export const avatarIconVariants = cva([COLOR_TEXT_SECONDARY], {
|
|
47
|
+
variants: {
|
|
48
|
+
size: {
|
|
49
|
+
sm: 'size-4',
|
|
50
|
+
md: 'size-5',
|
|
51
|
+
lg: 'size-6',
|
|
52
|
+
xl: 'size-8',
|
|
53
|
+
'2xl': 'size-10'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
size: 'lg'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ── Badge ────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
export const avatarBadgeVariants = cva(['absolute border-2 border-white', RADIUS_FULL], {
|
|
64
|
+
variants: {
|
|
65
|
+
size: {
|
|
66
|
+
sm: 'w-2.5 h-2.5 bottom-0 right-0',
|
|
67
|
+
md: 'w-3 h-3 bottom-0 right-0',
|
|
68
|
+
lg: 'w-3.5 h-3.5 bottom-0 right-0',
|
|
69
|
+
xl: 'w-4 h-4 bottom-0.5 right-0.5',
|
|
70
|
+
'2xl': 'w-5 h-5 bottom-0.5 right-0.5'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
size: 'lg'
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cva","COLOR_BG_MUTED","COLOR_TEXT_SECONDARY","RADIUS_FULL","avatarRootVariants","variants","size","sm","md","lg","xl","defaultVariants","avatarImageVariants","avatarTextVariants","avatarIconVariants","avatarBadgeVariants"],"sourceRoot":"../../../../src","sources":["components/Avatar/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAA2B,0BAA0B;AACjE,SAASC,cAAc,EAAEC,oBAAoB,EAAEC,WAAW,QAAQ,yBAAyB;;AAE3F;;AAEA,OAAO,MAAMC,kBAAkB,GAAGJ,GAAG,CACnC,CAACG,WAAW,EAAE,sCAAsC,EAAEF,cAAc,CAAC,EACrE;EACEI,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;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,MAAMM,mBAAmB,GAAGZ,GAAG,CAAC,CACrC,qCAAqC,EACrCG,WAAW,EACX,iBAAiB,CAClB,CAAC;;AAEF;;AAEA,OAAO,MAAMU,kBAAkB,GAAGb,GAAG,CAAC,CAACE,oBAAoB,EAAE,eAAe,CAAC,EAAE;EAC7EG,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,SAAS;MACbC,EAAE,EAAE,WAAW;MACfC,EAAE,EAAE,SAAS;MACb,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAEF;;AAEA,OAAO,MAAMQ,kBAAkB,GAAGd,GAAG,CAAC,CAACE,oBAAoB,CAAC,EAAE;EAC5DG,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZC,EAAE,EAAE,QAAQ;MACZ,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC;;AAEF;;AAEA,OAAO,MAAMS,mBAAmB,GAAGf,GAAG,CAAC,CAAC,gCAAgC,EAAEG,WAAW,CAAC,EAAE;EACtFE,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,EAAE,EAAE,8BAA8B;MAClCC,EAAE,EAAE,0BAA0B;MAC9BC,EAAE,EAAE,8BAA8B;MAClCC,EAAE,EAAE,8BAA8B;MAClC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useCallback, useRef } from 'react';
|
|
4
|
+
import { Dimensions, Pressable, View } from 'react-native';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { BottomSheetModal, BottomSheetModalProvider, BottomSheetScrollView, BottomSheetView, BottomSheetBackdrop, BottomSheetFooter as GorhomBottomSheetFooter } from '@gorhom/bottom-sheet';
|
|
7
|
+
import { cn } from '@cdx-ui/utils';
|
|
8
|
+
import { ArrowBackIosNew, Close } from '@cdx-ui/icons';
|
|
9
|
+
import { Heading } from '../Heading';
|
|
10
|
+
import { Icon } from '../Icon';
|
|
11
|
+
import { Text } from '../Text';
|
|
12
|
+
import { bottomSheetBackButtonVariants, bottomSheetBackIconVariants, bottomSheetCloseButtonVariants, bottomSheetCloseIconVariants, bottomSheetContainerVariants, bottomSheetContentVariants, bottomSheetFooterVariants, bottomSheetHeaderVariants, bottomSheetSubtitleVariants, handleIndicatorStyle } from './styles';
|
|
13
|
+
|
|
14
|
+
/** Ref type for BottomSheet; forwards the @gorhom modal ref (present, dismiss, snapToIndex, minimize, restore, etc.). */
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
function BottomSheetHeaderComponent({
|
|
17
|
+
title,
|
|
18
|
+
subtitle,
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
onClose,
|
|
22
|
+
closeAccessibilityLabel,
|
|
23
|
+
onBack,
|
|
24
|
+
backAccessibilityLabel = 'Go back'
|
|
25
|
+
}, ref) {
|
|
26
|
+
const hasTitle = title !== undefined && title !== '';
|
|
27
|
+
const hasContent = hasTitle || !!children || !!onBack;
|
|
28
|
+
const computedClassName = cn(bottomSheetHeaderVariants({
|
|
29
|
+
hasTitle: hasContent
|
|
30
|
+
}), className);
|
|
31
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
32
|
+
ref: ref,
|
|
33
|
+
className: computedClassName,
|
|
34
|
+
children: [onBack && /*#__PURE__*/_jsx(Pressable, {
|
|
35
|
+
onPress: onBack,
|
|
36
|
+
hitSlop: 12,
|
|
37
|
+
accessibilityRole: "button",
|
|
38
|
+
accessibilityLabel: backAccessibilityLabel,
|
|
39
|
+
className: cn(bottomSheetBackButtonVariants()),
|
|
40
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
41
|
+
as: ArrowBackIosNew,
|
|
42
|
+
className: bottomSheetBackIconVariants()
|
|
43
|
+
})
|
|
44
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
45
|
+
className: "flex-1",
|
|
46
|
+
children: children ?? (hasTitle ? /*#__PURE__*/_jsxs(View, {
|
|
47
|
+
children: [/*#__PURE__*/_jsx(Heading, {
|
|
48
|
+
size: "xs",
|
|
49
|
+
className: "text-lg",
|
|
50
|
+
children: title
|
|
51
|
+
}), subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
52
|
+
className: bottomSheetSubtitleVariants(),
|
|
53
|
+
children: subtitle
|
|
54
|
+
}) : null]
|
|
55
|
+
}) : null)
|
|
56
|
+
}), onClose && /*#__PURE__*/_jsx(BottomSheetCloseButton, {
|
|
57
|
+
onPress: onClose,
|
|
58
|
+
...(closeAccessibilityLabel !== undefined && {
|
|
59
|
+
accessibilityLabel: closeAccessibilityLabel
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
BottomSheetHeaderComponent.displayName = 'BottomSheet.Header';
|
|
65
|
+
const BottomSheetHeader = /*#__PURE__*/forwardRef(BottomSheetHeaderComponent);
|
|
66
|
+
BottomSheetHeader.displayName = 'BottomSheet.Header';
|
|
67
|
+
|
|
68
|
+
// =============================================================================
|
|
69
|
+
// CLOSEBUTTON
|
|
70
|
+
// =============================================================================
|
|
71
|
+
|
|
72
|
+
function BottomSheetCloseButton({
|
|
73
|
+
onPress,
|
|
74
|
+
className,
|
|
75
|
+
accessibilityLabel = 'Close'
|
|
76
|
+
}) {
|
|
77
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
78
|
+
onPress: onPress,
|
|
79
|
+
hitSlop: 12,
|
|
80
|
+
accessibilityRole: "button",
|
|
81
|
+
accessibilityLabel: accessibilityLabel,
|
|
82
|
+
className: cn(bottomSheetCloseButtonVariants(), className),
|
|
83
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
84
|
+
as: Close,
|
|
85
|
+
className: bottomSheetCloseIconVariants()
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
BottomSheetCloseButton.displayName = 'BottomSheet.CloseButton';
|
|
90
|
+
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// CONTENT
|
|
93
|
+
// =============================================================================
|
|
94
|
+
|
|
95
|
+
const BottomSheetContent = /*#__PURE__*/forwardRef(({
|
|
96
|
+
children,
|
|
97
|
+
className,
|
|
98
|
+
hasSafeAreaInset,
|
|
99
|
+
style
|
|
100
|
+
}, ref) => {
|
|
101
|
+
const insets = useSafeAreaInsets();
|
|
102
|
+
const computedClassName = cn(bottomSheetContentVariants(), className);
|
|
103
|
+
return /*#__PURE__*/_jsx(View, {
|
|
104
|
+
ref: ref,
|
|
105
|
+
className: computedClassName,
|
|
106
|
+
style: hasSafeAreaInset ? {
|
|
107
|
+
paddingBottom: insets.bottom,
|
|
108
|
+
...style
|
|
109
|
+
} : style,
|
|
110
|
+
pointerEvents: "box-none",
|
|
111
|
+
children: children
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
BottomSheetContent.displayName = 'BottomSheet.Content';
|
|
115
|
+
|
|
116
|
+
// =============================================================================
|
|
117
|
+
// FOOTER
|
|
118
|
+
// =============================================================================
|
|
119
|
+
|
|
120
|
+
const BottomSheetFooter = /*#__PURE__*/forwardRef(({
|
|
121
|
+
children,
|
|
122
|
+
className,
|
|
123
|
+
style
|
|
124
|
+
}, ref) => {
|
|
125
|
+
const insets = useSafeAreaInsets();
|
|
126
|
+
const computedClassName = cn(bottomSheetFooterVariants(), className);
|
|
127
|
+
return /*#__PURE__*/_jsx(View, {
|
|
128
|
+
ref: ref,
|
|
129
|
+
className: computedClassName,
|
|
130
|
+
style: {
|
|
131
|
+
paddingBottom: Math.max(insets.bottom, 24),
|
|
132
|
+
...style
|
|
133
|
+
},
|
|
134
|
+
pointerEvents: "box-none",
|
|
135
|
+
children: children
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
BottomSheetFooter.displayName = 'BottomSheet.Footer';
|
|
139
|
+
|
|
140
|
+
// =============================================================================
|
|
141
|
+
// MODAL WRAPPER (WITH STYLES)
|
|
142
|
+
// =============================================================================
|
|
143
|
+
|
|
144
|
+
const MAX_DYNAMIC_CONTENT_SIZE = Dimensions.get('window').height * 0.9;
|
|
145
|
+
const CustomBackdrop = props => {
|
|
146
|
+
return /*#__PURE__*/_jsx(BottomSheetBackdrop, {
|
|
147
|
+
...props,
|
|
148
|
+
disappearsOnIndex: -1,
|
|
149
|
+
appearsOnIndex: 0,
|
|
150
|
+
opacity: 0.5,
|
|
151
|
+
pressBehavior: "close"
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
const BottomSheetModalStyled = /*#__PURE__*/forwardRef(({
|
|
155
|
+
handleVisible = true,
|
|
156
|
+
footer,
|
|
157
|
+
...rest
|
|
158
|
+
}, ref) => {
|
|
159
|
+
const renderFooter = useCallback(props => /*#__PURE__*/_jsx(GorhomBottomSheetFooter, {
|
|
160
|
+
...props,
|
|
161
|
+
children: footer
|
|
162
|
+
}), [footer]);
|
|
163
|
+
return /*#__PURE__*/_jsx(BottomSheetModal, {
|
|
164
|
+
ref: ref,
|
|
165
|
+
enableDynamicSizing: true,
|
|
166
|
+
maxDynamicContentSize: MAX_DYNAMIC_CONTENT_SIZE,
|
|
167
|
+
handleComponent: handleVisible ? undefined : null,
|
|
168
|
+
handleIndicatorStyle: handleVisible ? handleIndicatorStyle : undefined,
|
|
169
|
+
backdropComponent: CustomBackdrop,
|
|
170
|
+
backgroundComponent: backgroundProps => /*#__PURE__*/_jsx(View, {
|
|
171
|
+
...backgroundProps,
|
|
172
|
+
className: cn(bottomSheetContainerVariants())
|
|
173
|
+
}),
|
|
174
|
+
...rest,
|
|
175
|
+
...(footer != null && {
|
|
176
|
+
footerComponent: renderFooter
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
BottomSheetModalStyled.displayName = 'BottomSheet.Modal';
|
|
181
|
+
|
|
182
|
+
// =============================================================================
|
|
183
|
+
// SCROLLVIEW WRAPPER (with footer margin adjustment enabled by default)
|
|
184
|
+
// =============================================================================
|
|
185
|
+
|
|
186
|
+
function BottomSheetScrollViewStyled({
|
|
187
|
+
enableFooterMarginAdjustment = true,
|
|
188
|
+
children,
|
|
189
|
+
...rest
|
|
190
|
+
}) {
|
|
191
|
+
return /*#__PURE__*/_jsx(BottomSheetScrollView, {
|
|
192
|
+
enableFooterMarginAdjustment: enableFooterMarginAdjustment,
|
|
193
|
+
...rest,
|
|
194
|
+
children: children
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
BottomSheetScrollViewStyled.displayName = 'BottomSheet.ScrollView';
|
|
198
|
+
|
|
199
|
+
// =============================================================================
|
|
200
|
+
// VIEW WRAPPER (with footer margin adjustment enabled by default)
|
|
201
|
+
// =============================================================================
|
|
202
|
+
|
|
203
|
+
function BottomSheetViewStyled({
|
|
204
|
+
enableFooterMarginAdjustment = true,
|
|
205
|
+
children,
|
|
206
|
+
...rest
|
|
207
|
+
}) {
|
|
208
|
+
return /*#__PURE__*/_jsx(BottomSheetView, {
|
|
209
|
+
enableFooterMarginAdjustment: enableFooterMarginAdjustment,
|
|
210
|
+
...rest,
|
|
211
|
+
children: children
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
BottomSheetViewStyled.displayName = 'BottomSheet.View';
|
|
215
|
+
|
|
216
|
+
// Display names for gorhom components exposed as BottomSheet.*
|
|
217
|
+
|
|
218
|
+
BottomSheetModalProvider.displayName = 'BottomSheet.Provider';
|
|
219
|
+
|
|
220
|
+
// ── Public exports ────────────────────────────────────────
|
|
221
|
+
|
|
222
|
+
export const BottomSheet = {
|
|
223
|
+
Modal: BottomSheetModalStyled,
|
|
224
|
+
Header: BottomSheetHeader,
|
|
225
|
+
Content: BottomSheetContent,
|
|
226
|
+
Footer: BottomSheetFooter,
|
|
227
|
+
Provider: BottomSheetModalProvider,
|
|
228
|
+
ScrollView: BottomSheetScrollViewStyled,
|
|
229
|
+
View: BottomSheetViewStyled
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// ── Hooks ────────────────────────────────────────────────
|
|
233
|
+
|
|
234
|
+
export function useBottomSheet() {
|
|
235
|
+
const ref = useRef(null);
|
|
236
|
+
return {
|
|
237
|
+
ref,
|
|
238
|
+
present: () => ref.current?.present(),
|
|
239
|
+
dismiss: () => ref.current?.dismiss()
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useCallback","useRef","Dimensions","Pressable","View","useSafeAreaInsets","BottomSheetModal","BottomSheetModalProvider","BottomSheetScrollView","BottomSheetView","BottomSheetBackdrop","BottomSheetFooter","GorhomBottomSheetFooter","cn","ArrowBackIosNew","Close","Heading","Icon","Text","bottomSheetBackButtonVariants","bottomSheetBackIconVariants","bottomSheetCloseButtonVariants","bottomSheetCloseIconVariants","bottomSheetContainerVariants","bottomSheetContentVariants","bottomSheetFooterVariants","bottomSheetHeaderVariants","bottomSheetSubtitleVariants","handleIndicatorStyle","jsx","_jsx","jsxs","_jsxs","BottomSheetHeaderComponent","title","subtitle","children","className","onClose","closeAccessibilityLabel","onBack","backAccessibilityLabel","ref","hasTitle","undefined","hasContent","computedClassName","onPress","hitSlop","accessibilityRole","accessibilityLabel","as","size","BottomSheetCloseButton","displayName","BottomSheetHeader","BottomSheetContent","hasSafeAreaInset","style","insets","paddingBottom","bottom","pointerEvents","Math","max","MAX_DYNAMIC_CONTENT_SIZE","get","height","CustomBackdrop","props","disappearsOnIndex","appearsOnIndex","opacity","pressBehavior","BottomSheetModalStyled","handleVisible","footer","rest","renderFooter","enableDynamicSizing","maxDynamicContentSize","handleComponent","backdropComponent","backgroundComponent","backgroundProps","footerComponent","BottomSheetScrollViewStyled","enableFooterMarginAdjustment","BottomSheetViewStyled","BottomSheet","Modal","Header","Content","Footer","Provider","ScrollView","useBottomSheet","present","current","dismiss"],"sourceRoot":"../../../../src","sources":["components/BottomSheet/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,MAAM,QAAwB,OAAO;AAC9E,SAASC,UAAU,EAAEC,SAAS,EAAEC,IAAI,QAAmB,cAAc;AACrE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SACEC,gBAAgB,EAChBC,wBAAwB,EACxBC,qBAAqB,EACrBC,eAAe,EACfC,mBAAmB,EACnBC,iBAAiB,IAAIC,uBAAuB,QAGvC,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,eAAe,EAAEC,KAAK,QAAQ,eAAe;AACtD,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,IAAI,QAAQ,SAAS;AAC9B,SAASC,IAAI,QAAQ,SAAS;AAC9B,SACEC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,yBAAyB,EACzBC,yBAAyB,EACzBC,2BAA2B,EAC3BC,oBAAoB,QACf,UAAU;;AAEjB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAcA,SAASC,0BAA0BA,CACjC;EACEC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,SAAS;EACTC,OAAO;EACPC,uBAAuB;EACvBC,MAAM;EACNC,sBAAsB,GAAG;AACH,CAAC,EACzBC,GAAoB,EACpB;EACA,MAAMC,QAAQ,GAAGT,KAAK,KAAKU,SAAS,IAAIV,KAAK,KAAK,EAAE;EACpD,MAAMW,UAAU,GAAGF,QAAQ,IAAI,CAAC,CAACP,QAAQ,IAAI,CAAC,CAACI,MAAM;EACrD,MAAMM,iBAAiB,GAAGjC,EAAE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AAO,MAAMmC,WAAW,GAAG;EACzBC,KAAK,EAAEhB,sBAAsB;EAC7BiB,MAAM,EAAEpC,iBAAiB;EACzBqC,OAAO,EAAEpC,kBAAkB;EAC3BqC,MAAM,EAAElF,iBAAiB;EACzBmF,QAAQ,EAAEvF,wBAAwB;EAClCwF,UAAU,EAAET,2BAA2B;EACvClF,IAAI,EAAEoF;AACR,CAAwB;;AAExB;;AAEA,OAAO,SAASQ,cAAcA,CAAA,EAAG;EAC/B,MAAMtD,GAAG,GAAGzC,MAAM,CAAsB,IAAI,CAAC;EAC7C,OAAO;IAAEyC,GAAG;IAAEuD,OAAO,EAAEA,CAAA,KAAMvD,GAAG,CAACwD,OAAO,EAAED,OAAO,CAAC,CAAC;IAAEE,OAAO,EAAEA,CAAA,KAAMzD,GAAG,CAACwD,OAAO,EAAEC,OAAO,CAAC;EAAE,CAAC;AAC9F","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { COLOR_BG_PRIMARY, COLOR_BORDER_DEFAULT, COLOR_TEXT_PRIMARY, COLOR_TEXT_SECONDARY } from '../../styles/primitives';
|
|
5
|
+
|
|
6
|
+
// ── Container ──────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
export const bottomSheetContainerVariants = cva(['rounded-t-3xl border-t border-x overflow-hidden', COLOR_BG_PRIMARY, COLOR_BORDER_DEFAULT]);
|
|
9
|
+
|
|
10
|
+
// ── Header ─────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
export const bottomSheetHeaderVariants = cva(['flex-row items-center justify-between min-h-12 px-4 pt-3 pb-2', COLOR_BG_PRIMARY, COLOR_TEXT_PRIMARY], {
|
|
13
|
+
variants: {
|
|
14
|
+
hasTitle: {
|
|
15
|
+
true: '',
|
|
16
|
+
false: 'justify-end'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
hasTitle: true
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// ── Content ────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
export const bottomSheetContentVariants = cva([COLOR_BG_PRIMARY, 'px-4 pb-6']);
|
|
27
|
+
|
|
28
|
+
// ── Footer ─────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
export const bottomSheetFooterVariants = cva(['px-4 pt-3 pb-4 border-t', COLOR_BG_PRIMARY, COLOR_BORDER_DEFAULT]);
|
|
31
|
+
|
|
32
|
+
// ── Subtitle ────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
export const bottomSheetSubtitleVariants = cva(['text-sm', COLOR_TEXT_SECONDARY]);
|
|
35
|
+
|
|
36
|
+
// ── Back Button ─────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
export const bottomSheetBackButtonVariants = cva(['p-1 -m-1 mr-2 rounded-full active:opacity-70']);
|
|
39
|
+
export const bottomSheetBackIconVariants = cva(['size-5 text-slate-500']);
|
|
40
|
+
|
|
41
|
+
// ── Close Button ───────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
export const bottomSheetCloseButtonVariants = cva(['p-1 -m-1 rounded-full active:opacity-70']);
|
|
44
|
+
|
|
45
|
+
// ── Close Icon ─────────────────────────────────────────────
|
|
46
|
+
|
|
47
|
+
export const bottomSheetCloseIconVariants = cva(['size-5 text-slate-500']);
|
|
48
|
+
|
|
49
|
+
// ── Handle indicator ────────────────────────────────────────
|
|
50
|
+
// Plain ViewStyle — gorhom's handleIndicatorStyle doesn't accept classNames.
|
|
51
|
+
// slate-300 (#cbd5e1) maps to COLOR_BORDER_STRONG; update when raw token palette is available (TODO).
|
|
52
|
+
export const handleIndicatorStyle = {
|
|
53
|
+
backgroundColor: '#cbd5e1',
|
|
54
|
+
width: 36,
|
|
55
|
+
height: 4,
|
|
56
|
+
borderRadius: 2
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cva","COLOR_BG_PRIMARY","COLOR_BORDER_DEFAULT","COLOR_TEXT_PRIMARY","COLOR_TEXT_SECONDARY","bottomSheetContainerVariants","bottomSheetHeaderVariants","variants","hasTitle","true","false","defaultVariants","bottomSheetContentVariants","bottomSheetFooterVariants","bottomSheetSubtitleVariants","bottomSheetBackButtonVariants","bottomSheetBackIconVariants","bottomSheetCloseButtonVariants","bottomSheetCloseIconVariants","handleIndicatorStyle","backgroundColor","width","height","borderRadius"],"sourceRoot":"../../../../src","sources":["components/BottomSheet/styles.ts"],"mappings":";;AACA,SAASA,GAAG,QAA2B,0BAA0B;AACjE,SACEC,gBAAgB,EAChBC,oBAAoB,EACpBC,kBAAkB,EAClBC,oBAAoB,QACf,yBAAyB;;AAEhC;;AAEA,OAAO,MAAMC,4BAA4B,GAAGL,GAAG,CAAC,CAC9C,iDAAiD,EACjDC,gBAAgB,EAChBC,oBAAoB,CACrB,CAAC;;AAEF;;AAEA,OAAO,MAAMI,yBAAyB,GAAGN,GAAG,CAC1C,CACE,+DAA+D,EAC/DC,gBAAgB,EAChBE,kBAAkB,CACnB,EACD;EACEI,QAAQ,EAAE;IACRC,QAAQ,EAAE;MACRC,IAAI,EAAE,EAAE;MACRC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,QAAQ,EAAE;EACZ;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,MAAMI,0BAA0B,GAAGZ,GAAG,CAAC,CAACC,gBAAgB,EAAE,WAAW,CAAC,CAAC;;AAE9E;;AAEA,OAAO,MAAMY,yBAAyB,GAAGb,GAAG,CAAC,CAC3C,yBAAyB,EACzBC,gBAAgB,EAChBC,oBAAoB,CACrB,CAAC;;AAEF;;AAEA,OAAO,MAAMY,2BAA2B,GAAGd,GAAG,CAAC,CAAC,SAAS,EAAEI,oBAAoB,CAAC,CAAC;;AAEjF;;AAEA,OAAO,MAAMW,6BAA6B,GAAGf,GAAG,CAAC,CAAC,8CAA8C,CAAC,CAAC;AAElG,OAAO,MAAMgB,2BAA2B,GAAGhB,GAAG,CAAC,CAAC,uBAAuB,CAAC,CAAC;;AAEzE;;AAEA,OAAO,MAAMiB,8BAA8B,GAAGjB,GAAG,CAAC,CAAC,yCAAyC,CAAC,CAAC;;AAE9F;;AAEA,OAAO,MAAMkB,4BAA4B,GAAGlB,GAAG,CAAC,CAAC,uBAAuB,CAAC,CAAC;;AAE1E;AACA;AACA;AACA,OAAO,MAAMmB,oBAA+B,GAAG;EAC7CC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,CAAC;EACTC,YAAY,EAAE;AAChB,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { WrapStringChild } from '../../utils/WrapStringChild';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/** @deprecated Use View instead */
|
|
7
8
|
export const Box = /*#__PURE__*/forwardRef(({
|
|
8
9
|
style,
|
|
9
10
|
className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","View","WrapStringChild","jsx","_jsx","Box","style","className","children","textProps","restProps","ref","displayName"],"sourceRoot":"../../../../src","sources":["components/Box/Box.tsx"],"mappings":";;AAAA,SAA4BA,UAAU,QAAQ,OAAO;AACrD,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,eAAe,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ9D,OAAO,MAAMC,GAAG,gBAAGL,UAAU,CAC3B,CAAC;EAAEM,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,SAAS;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAuB,KAAK;EACpF,oBACEP,IAAA,CAACH,IAAI;IAACU,GAAG,EAAEA,GAAI;IAACL,KAAK,EAAEA,KAAM;IAACC,SAAS,EAAEA,SAAU;IAAA,GAAKG,SAAS;IAAAF,QAAA,eAC/DJ,IAAA,CAACF,eAAe;MAACO,SAAS,EAAEA,SAAU;MAAAD,QAAA,EAAEA;IAAQ,CAAkB;EAAC,CAC/D,CAAC;AAEX,CACF,CAAC;AAEDH,GAAG,CAACO,WAAW,GAAG,KAAK","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["forwardRef","View","WrapStringChild","jsx","_jsx","Box","style","className","children","textProps","restProps","ref","displayName"],"sourceRoot":"../../../../src","sources":["components/Box/Box.tsx"],"mappings":";;AAAA,SAA4BA,UAAU,QAAQ,OAAO;AACrD,SAASC,IAAI,QAAwB,cAAc;AACnD,SAASC,eAAe,QAAQ,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ9D;AACA,OAAO,MAAMC,GAAG,gBAAGL,UAAU,CAC3B,CAAC;EAAEM,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,SAAS;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAuB,KAAK;EACpF,oBACEP,IAAA,CAACH,IAAI;IAACU,GAAG,EAAEA,GAAI;IAACL,KAAK,EAAEA,KAAM;IAACC,SAAS,EAAEA,SAAU;IAAA,GAAKG,SAAS;IAAAF,QAAA,eAC/DJ,IAAA,CAACF,eAAe;MAACO,SAAS,EAAEA,SAAU;MAAAD,QAAA,EAAEA;IAAQ,CAAkB;EAAC,CAC/D,CAAC;AAEX,CACF,CAAC;AAEDH,GAAG,CAACO,WAAW,GAAG,KAAK","ignoreList":[]}
|
|
@@ -4,7 +4,8 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import { ActivityIndicator, Pressable, Text, View } from 'react-native';
|
|
5
5
|
import { createButton } from '@cdx-ui/primitives';
|
|
6
6
|
import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { Icon } from '../Icon';
|
|
8
|
+
import { buttonGroupVariants, buttonIconVariants, buttonRootVariants, buttonSpinnerVariants, buttonTextVariants } from './styles';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
const SCOPE = 'BUTTON';
|
|
10
11
|
const Root = withStyleContext(Pressable, SCOPE);
|
|
@@ -22,9 +23,9 @@ const ButtonPrimitive = createButton({
|
|
|
22
23
|
// =============================================================================
|
|
23
24
|
|
|
24
25
|
const ButtonRoot = /*#__PURE__*/forwardRef(({
|
|
25
|
-
variant = '
|
|
26
|
-
color = '
|
|
27
|
-
size = '
|
|
26
|
+
variant = 'strong',
|
|
27
|
+
color = 'action',
|
|
28
|
+
size = 'default',
|
|
28
29
|
fullWidth = false,
|
|
29
30
|
className,
|
|
30
31
|
children,
|
|
@@ -82,6 +83,9 @@ const ButtonLabel = /*#__PURE__*/forwardRef(({
|
|
|
82
83
|
});
|
|
83
84
|
});
|
|
84
85
|
ButtonLabel.displayName = 'Button.Label';
|
|
86
|
+
|
|
87
|
+
// TODO: Use ButtonGroupVariantProps
|
|
88
|
+
|
|
85
89
|
const ButtonGroup = /*#__PURE__*/forwardRef(({
|
|
86
90
|
className,
|
|
87
91
|
children,
|
|
@@ -106,18 +110,25 @@ const ButtonGroup = /*#__PURE__*/forwardRef(({
|
|
|
106
110
|
});
|
|
107
111
|
});
|
|
108
112
|
ButtonGroup.displayName = 'Button.Group';
|
|
109
|
-
const ButtonIcon =
|
|
113
|
+
const ButtonIcon = ({
|
|
110
114
|
className,
|
|
111
115
|
style,
|
|
116
|
+
as,
|
|
112
117
|
...props
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
118
|
+
}) => {
|
|
119
|
+
const {
|
|
120
|
+
size
|
|
121
|
+
} = useButtonStyleContext();
|
|
122
|
+
const computedClassName = cn(buttonIconVariants({
|
|
123
|
+
size
|
|
124
|
+
}), className);
|
|
125
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
126
|
+
as: as,
|
|
127
|
+
className: computedClassName,
|
|
117
128
|
style: style,
|
|
118
129
|
...props
|
|
119
130
|
});
|
|
120
|
-
}
|
|
131
|
+
};
|
|
121
132
|
ButtonIcon.displayName = 'Button.Icon';
|
|
122
133
|
const ButtonSpinner = /*#__PURE__*/forwardRef(({
|
|
123
134
|
className,
|