wn-native-ui 0.0.0-stage → 0.1.0
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +128 -3
- package/lib/module/components/Avatar/Avatar.js +131 -0
- package/lib/module/components/Avatar/index.js +3 -0
- package/lib/module/components/Avatar/styles.js +49 -0
- package/lib/module/components/BottomActionBar/BottomActionBar.js +43 -0
- package/lib/module/components/BottomActionBar/index.js +3 -0
- package/lib/module/components/BottomActionBar/styles.js +22 -0
- package/lib/module/components/BottomSheet/BottomSheet.js +103 -0
- package/lib/module/components/BottomSheet/index.js +3 -0
- package/lib/module/components/BottomSheet/styles.js +84 -0
- package/lib/module/components/Button/Button.js +38 -0
- package/lib/module/components/Button/index.js +3 -0
- package/lib/module/components/Button/styles.js +50 -0
- package/lib/module/components/Checkbox/Checkbox.js +131 -0
- package/lib/module/components/Checkbox/index.js +3 -0
- package/lib/module/components/Checkbox/styles.js +64 -0
- package/lib/module/components/DatePicker/DatePicker.js +521 -0
- package/lib/module/components/DatePicker/index.js +3 -0
- package/lib/module/components/DatePicker/model.js +255 -0
- package/lib/module/components/DatePicker/styles.js +273 -0
- package/lib/module/components/Dialog/Dialog.js +146 -0
- package/lib/module/components/Dialog/index.js +3 -0
- package/lib/module/components/Dialog/styles.js +112 -0
- package/lib/module/components/EmptyState/EmptyState.js +56 -0
- package/lib/module/components/EmptyState/index.js +3 -0
- package/lib/module/components/EmptyState/styles.js +84 -0
- package/lib/module/components/Field/Field.js +54 -0
- package/lib/module/components/Field/FieldContext.js +7 -0
- package/lib/module/components/Field/index.js +3 -0
- package/lib/module/components/Field/styles.js +56 -0
- package/lib/module/components/FilterChips/FilterChips.js +74 -0
- package/lib/module/components/FilterChips/index.js +3 -0
- package/lib/module/components/FilterChips/styles.js +72 -0
- package/lib/module/components/Form/Form.js +53 -0
- package/lib/module/components/Form/FormItem.js +128 -0
- package/lib/module/components/Form/context.js +4 -0
- package/lib/module/components/Form/index.js +10 -0
- package/lib/module/components/Form/model.js +327 -0
- package/lib/module/components/Form/styles.js +10 -0
- package/lib/module/components/ImagePreview/ImagePreview.js +189 -0
- package/lib/module/components/ImagePreview/index.js +3 -0
- package/lib/module/components/ImagePreview/styles.js +87 -0
- package/lib/module/components/InlineFeedback/InlineFeedback.js +78 -0
- package/lib/module/components/InlineFeedback/index.js +3 -0
- package/lib/module/components/InlineFeedback/styles.js +148 -0
- package/lib/module/components/Input/Input.js +50 -0
- package/lib/module/components/Input/index.js +3 -0
- package/lib/module/components/Input/styles.js +41 -0
- package/lib/module/components/ListSkeleton/ListSkeleton.js +50 -0
- package/lib/module/components/ListSkeleton/index.js +3 -0
- package/lib/module/components/ListSkeleton/styles.js +30 -0
- package/lib/module/components/NavigationBar/NavigationBar.js +170 -0
- package/lib/module/components/NavigationBar/index.js +3 -0
- package/lib/module/components/NavigationBar/styles.js +98 -0
- package/lib/module/components/Picker/Picker.js +156 -0
- package/lib/module/components/Picker/index.js +3 -0
- package/lib/module/components/Picker/styles.js +96 -0
- package/lib/module/components/Radio/Radio.js +114 -0
- package/lib/module/components/Radio/index.js +3 -0
- package/lib/module/components/Radio/styles.js +70 -0
- package/lib/module/components/SearchInput/SearchInput.js +102 -0
- package/lib/module/components/SearchInput/index.js +3 -0
- package/lib/module/components/SearchInput/styles.js +106 -0
- package/lib/module/components/SideDrawer/SideDrawer.js +161 -0
- package/lib/module/components/SideDrawer/index.js +3 -0
- package/lib/module/components/SideDrawer/styles.js +89 -0
- package/lib/module/components/Skeleton/Skeleton.js +66 -0
- package/lib/module/components/Skeleton/index.js +3 -0
- package/lib/module/components/Skeleton/styles.js +18 -0
- package/lib/module/components/Switch/Switch.js +61 -0
- package/lib/module/components/Switch/index.js +3 -0
- package/lib/module/components/Switch/styles.js +33 -0
- package/lib/module/components/TabBar/TabBar.js +68 -0
- package/lib/module/components/TabBar/index.js +3 -0
- package/lib/module/components/TabBar/styles.js +84 -0
- package/lib/module/components/Tabs/Tabs.js +65 -0
- package/lib/module/components/Tabs/index.js +3 -0
- package/lib/module/components/Tabs/styles.js +99 -0
- package/lib/module/components/Tag/Tag.js +171 -0
- package/lib/module/components/Tag/index.js +3 -0
- package/lib/module/components/Tag/styles.js +163 -0
- package/lib/module/components/TextArea/TextArea.js +74 -0
- package/lib/module/components/TextArea/index.js +3 -0
- package/lib/module/components/TextArea/styles.js +45 -0
- package/lib/module/components/TimePicker/TimePicker.js +262 -0
- package/lib/module/components/TimePicker/index.js +3 -0
- package/lib/module/components/TimePicker/model.js +63 -0
- package/lib/module/components/TimePicker/styles.js +143 -0
- package/lib/module/components/Timeline/Timeline.js +154 -0
- package/lib/module/components/Timeline/index.js +3 -0
- package/lib/module/components/Timeline/model.js +36 -0
- package/lib/module/components/Timeline/styles.js +115 -0
- package/lib/module/components/Toast/Toast.js +249 -0
- package/lib/module/components/Toast/index.js +3 -0
- package/lib/module/components/Toast/styles.js +61 -0
- package/lib/module/components/Upload/Upload.js +762 -0
- package/lib/module/components/Upload/index.js +3 -0
- package/lib/module/components/Upload/model.js +3 -0
- package/lib/module/components/Upload/picker.js +97 -0
- package/lib/module/components/Upload/styles.js +358 -0
- package/lib/module/components/index.js +32 -0
- package/lib/module/index.js +4 -0
- package/lib/module/package.json +1 -0
- package/lib/module/ui/tokens.js +174 -0
- package/lib/typescript/components/Avatar/Avatar.d.ts +20 -0
- package/lib/typescript/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/components/Avatar/index.d.ts +3 -0
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/components/Avatar/styles.d.ts +46 -0
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -0
- package/lib/typescript/components/BottomActionBar/BottomActionBar.d.ts +17 -0
- package/lib/typescript/components/BottomActionBar/BottomActionBar.d.ts.map +1 -0
- package/lib/typescript/components/BottomActionBar/index.d.ts +3 -0
- package/lib/typescript/components/BottomActionBar/index.d.ts.map +1 -0
- package/lib/typescript/components/BottomActionBar/styles.d.ts +19 -0
- package/lib/typescript/components/BottomActionBar/styles.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/BottomSheet.d.ts +19 -0
- package/lib/typescript/components/BottomSheet/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/index.d.ts +3 -0
- package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts +86 -0
- package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -0
- package/lib/typescript/components/Button/Button.d.ts +12 -0
- package/lib/typescript/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/components/Button/index.d.ts +3 -0
- package/lib/typescript/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/components/Button/styles.d.ts +48 -0
- package/lib/typescript/components/Button/styles.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/Checkbox.d.ts +39 -0
- package/lib/typescript/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/index.d.ts +3 -0
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/components/Checkbox/styles.d.ts +65 -0
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -0
- package/lib/typescript/components/DatePicker/DatePicker.d.ts +40 -0
- package/lib/typescript/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/lib/typescript/components/DatePicker/index.d.ts +4 -0
- package/lib/typescript/components/DatePicker/index.d.ts.map +1 -0
- package/lib/typescript/components/DatePicker/model.d.ts +49 -0
- package/lib/typescript/components/DatePicker/model.d.ts.map +1 -0
- package/lib/typescript/components/DatePicker/styles.d.ts +287 -0
- package/lib/typescript/components/DatePicker/styles.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/Dialog.d.ts +35 -0
- package/lib/typescript/components/Dialog/Dialog.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/index.d.ts +3 -0
- package/lib/typescript/components/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/components/Dialog/styles.d.ts +114 -0
- package/lib/typescript/components/Dialog/styles.d.ts.map +1 -0
- package/lib/typescript/components/EmptyState/EmptyState.d.ts +13 -0
- package/lib/typescript/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/typescript/components/EmptyState/index.d.ts +3 -0
- package/lib/typescript/components/EmptyState/index.d.ts.map +1 -0
- package/lib/typescript/components/EmptyState/styles.d.ts +86 -0
- package/lib/typescript/components/EmptyState/styles.d.ts.map +1 -0
- package/lib/typescript/components/Field/Field.d.ts +14 -0
- package/lib/typescript/components/Field/Field.d.ts.map +1 -0
- package/lib/typescript/components/Field/FieldContext.d.ts +8 -0
- package/lib/typescript/components/Field/FieldContext.d.ts.map +1 -0
- package/lib/typescript/components/Field/index.d.ts +3 -0
- package/lib/typescript/components/Field/index.d.ts.map +1 -0
- package/lib/typescript/components/Field/styles.d.ts +58 -0
- package/lib/typescript/components/Field/styles.d.ts.map +1 -0
- package/lib/typescript/components/FilterChips/FilterChips.d.ts +23 -0
- package/lib/typescript/components/FilterChips/FilterChips.d.ts.map +1 -0
- package/lib/typescript/components/FilterChips/index.d.ts +3 -0
- package/lib/typescript/components/FilterChips/index.d.ts.map +1 -0
- package/lib/typescript/components/FilterChips/styles.d.ts +75 -0
- package/lib/typescript/components/FilterChips/styles.d.ts.map +1 -0
- package/lib/typescript/components/Form/Form.d.ts +17 -0
- package/lib/typescript/components/Form/Form.d.ts.map +1 -0
- package/lib/typescript/components/Form/FormItem.d.ts +29 -0
- package/lib/typescript/components/Form/FormItem.d.ts.map +1 -0
- package/lib/typescript/components/Form/context.d.ts +8 -0
- package/lib/typescript/components/Form/context.d.ts.map +1 -0
- package/lib/typescript/components/Form/index.d.ts +12 -0
- package/lib/typescript/components/Form/index.d.ts.map +1 -0
- package/lib/typescript/components/Form/model.d.ts +82 -0
- package/lib/typescript/components/Form/model.d.ts.map +1 -0
- package/lib/typescript/components/Form/styles.d.ts +7 -0
- package/lib/typescript/components/Form/styles.d.ts.map +1 -0
- package/lib/typescript/components/ImagePreview/ImagePreview.d.ts +17 -0
- package/lib/typescript/components/ImagePreview/ImagePreview.d.ts.map +1 -0
- package/lib/typescript/components/ImagePreview/index.d.ts +3 -0
- package/lib/typescript/components/ImagePreview/index.d.ts.map +1 -0
- package/lib/typescript/components/ImagePreview/styles.d.ts +87 -0
- package/lib/typescript/components/ImagePreview/styles.d.ts.map +1 -0
- package/lib/typescript/components/InlineFeedback/InlineFeedback.d.ts +13 -0
- package/lib/typescript/components/InlineFeedback/InlineFeedback.d.ts.map +1 -0
- package/lib/typescript/components/InlineFeedback/index.d.ts +3 -0
- package/lib/typescript/components/InlineFeedback/index.d.ts.map +1 -0
- package/lib/typescript/components/InlineFeedback/styles.d.ts +151 -0
- package/lib/typescript/components/InlineFeedback/styles.d.ts.map +1 -0
- package/lib/typescript/components/Input/Input.d.ts +14 -0
- package/lib/typescript/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/components/Input/index.d.ts +3 -0
- package/lib/typescript/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/components/Input/styles.d.ts +40 -0
- package/lib/typescript/components/Input/styles.d.ts.map +1 -0
- package/lib/typescript/components/ListSkeleton/ListSkeleton.d.ts +10 -0
- package/lib/typescript/components/ListSkeleton/ListSkeleton.d.ts.map +1 -0
- package/lib/typescript/components/ListSkeleton/index.d.ts +3 -0
- package/lib/typescript/components/ListSkeleton/index.d.ts.map +1 -0
- package/lib/typescript/components/ListSkeleton/styles.d.ts +27 -0
- package/lib/typescript/components/ListSkeleton/styles.d.ts.map +1 -0
- package/lib/typescript/components/NavigationBar/NavigationBar.d.ts +34 -0
- package/lib/typescript/components/NavigationBar/NavigationBar.d.ts.map +1 -0
- package/lib/typescript/components/NavigationBar/index.d.ts +3 -0
- package/lib/typescript/components/NavigationBar/index.d.ts.map +1 -0
- package/lib/typescript/components/NavigationBar/styles.d.ts +97 -0
- package/lib/typescript/components/NavigationBar/styles.d.ts.map +1 -0
- package/lib/typescript/components/Picker/Picker.d.ts +32 -0
- package/lib/typescript/components/Picker/Picker.d.ts.map +1 -0
- package/lib/typescript/components/Picker/index.d.ts +3 -0
- package/lib/typescript/components/Picker/index.d.ts.map +1 -0
- package/lib/typescript/components/Picker/styles.d.ts +99 -0
- package/lib/typescript/components/Picker/styles.d.ts.map +1 -0
- package/lib/typescript/components/Radio/Radio.d.ts +38 -0
- package/lib/typescript/components/Radio/Radio.d.ts.map +1 -0
- package/lib/typescript/components/Radio/index.d.ts +3 -0
- package/lib/typescript/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/components/Radio/styles.d.ts +71 -0
- package/lib/typescript/components/Radio/styles.d.ts.map +1 -0
- package/lib/typescript/components/SearchInput/SearchInput.d.ts +20 -0
- package/lib/typescript/components/SearchInput/SearchInput.d.ts.map +1 -0
- package/lib/typescript/components/SearchInput/index.d.ts +3 -0
- package/lib/typescript/components/SearchInput/index.d.ts.map +1 -0
- package/lib/typescript/components/SearchInput/styles.d.ts +105 -0
- package/lib/typescript/components/SearchInput/styles.d.ts.map +1 -0
- package/lib/typescript/components/SideDrawer/SideDrawer.d.ts +19 -0
- package/lib/typescript/components/SideDrawer/SideDrawer.d.ts.map +1 -0
- package/lib/typescript/components/SideDrawer/index.d.ts +3 -0
- package/lib/typescript/components/SideDrawer/index.d.ts.map +1 -0
- package/lib/typescript/components/SideDrawer/styles.d.ts +88 -0
- package/lib/typescript/components/SideDrawer/styles.d.ts.map +1 -0
- package/lib/typescript/components/Skeleton/Skeleton.d.ts +11 -0
- package/lib/typescript/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/typescript/components/Skeleton/index.d.ts +3 -0
- package/lib/typescript/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/components/Skeleton/styles.d.ts +15 -0
- package/lib/typescript/components/Skeleton/styles.d.ts.map +1 -0
- package/lib/typescript/components/Switch/Switch.d.ts +9 -0
- package/lib/typescript/components/Switch/Switch.d.ts.map +1 -0
- package/lib/typescript/components/Switch/index.d.ts +3 -0
- package/lib/typescript/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/components/Switch/styles.d.ts +30 -0
- package/lib/typescript/components/Switch/styles.d.ts.map +1 -0
- package/lib/typescript/components/TabBar/TabBar.d.ts +26 -0
- package/lib/typescript/components/TabBar/TabBar.d.ts.map +1 -0
- package/lib/typescript/components/TabBar/index.d.ts +3 -0
- package/lib/typescript/components/TabBar/index.d.ts.map +1 -0
- package/lib/typescript/components/TabBar/styles.d.ts +82 -0
- package/lib/typescript/components/TabBar/styles.d.ts.map +1 -0
- package/lib/typescript/components/Tabs/Tabs.d.ts +21 -0
- package/lib/typescript/components/Tabs/Tabs.d.ts.map +1 -0
- package/lib/typescript/components/Tabs/index.d.ts +3 -0
- package/lib/typescript/components/Tabs/index.d.ts.map +1 -0
- package/lib/typescript/components/Tabs/styles.d.ts +100 -0
- package/lib/typescript/components/Tabs/styles.d.ts.map +1 -0
- package/lib/typescript/components/Tag/Tag.d.ts +22 -0
- package/lib/typescript/components/Tag/Tag.d.ts.map +1 -0
- package/lib/typescript/components/Tag/index.d.ts +3 -0
- package/lib/typescript/components/Tag/index.d.ts.map +1 -0
- package/lib/typescript/components/Tag/styles.d.ts +164 -0
- package/lib/typescript/components/Tag/styles.d.ts.map +1 -0
- package/lib/typescript/components/TextArea/TextArea.d.ts +16 -0
- package/lib/typescript/components/TextArea/TextArea.d.ts.map +1 -0
- package/lib/typescript/components/TextArea/index.d.ts +3 -0
- package/lib/typescript/components/TextArea/index.d.ts.map +1 -0
- package/lib/typescript/components/TextArea/styles.d.ts +46 -0
- package/lib/typescript/components/TextArea/styles.d.ts.map +1 -0
- package/lib/typescript/components/TimePicker/TimePicker.d.ts +17 -0
- package/lib/typescript/components/TimePicker/TimePicker.d.ts.map +1 -0
- package/lib/typescript/components/TimePicker/index.d.ts +4 -0
- package/lib/typescript/components/TimePicker/index.d.ts.map +1 -0
- package/lib/typescript/components/TimePicker/model.d.ts +16 -0
- package/lib/typescript/components/TimePicker/model.d.ts.map +1 -0
- package/lib/typescript/components/TimePicker/styles.d.ts +150 -0
- package/lib/typescript/components/TimePicker/styles.d.ts.map +1 -0
- package/lib/typescript/components/Timeline/Timeline.d.ts +12 -0
- package/lib/typescript/components/Timeline/Timeline.d.ts.map +1 -0
- package/lib/typescript/components/Timeline/index.d.ts +4 -0
- package/lib/typescript/components/Timeline/index.d.ts.map +1 -0
- package/lib/typescript/components/Timeline/model.d.ts +45 -0
- package/lib/typescript/components/Timeline/model.d.ts.map +1 -0
- package/lib/typescript/components/Timeline/styles.d.ts +120 -0
- package/lib/typescript/components/Timeline/styles.d.ts.map +1 -0
- package/lib/typescript/components/Toast/Toast.d.ts +30 -0
- package/lib/typescript/components/Toast/Toast.d.ts.map +1 -0
- package/lib/typescript/components/Toast/index.d.ts +3 -0
- package/lib/typescript/components/Toast/index.d.ts.map +1 -0
- package/lib/typescript/components/Toast/styles.d.ts +59 -0
- package/lib/typescript/components/Toast/styles.d.ts.map +1 -0
- package/lib/typescript/components/Upload/Upload.d.ts +31 -0
- package/lib/typescript/components/Upload/Upload.d.ts.map +1 -0
- package/lib/typescript/components/Upload/index.d.ts +4 -0
- package/lib/typescript/components/Upload/index.d.ts.map +1 -0
- package/lib/typescript/components/Upload/model.d.ts +50 -0
- package/lib/typescript/components/Upload/model.d.ts.map +1 -0
- package/lib/typescript/components/Upload/picker.d.ts +13 -0
- package/lib/typescript/components/Upload/picker.d.ts.map +1 -0
- package/lib/typescript/components/Upload/styles.d.ts +376 -0
- package/lib/typescript/components/Upload/styles.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +61 -0
- package/lib/typescript/components/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/ui/tokens.d.ts +167 -0
- package/lib/typescript/ui/tokens.d.ts.map +1 -0
- package/package.json +216 -6
- package/src/components/Avatar/Avatar.tsx +192 -0
- package/src/components/Avatar/README.md +32 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Avatar/styles.ts +49 -0
- package/src/components/BottomActionBar/BottomActionBar.tsx +53 -0
- package/src/components/BottomActionBar/README.md +50 -0
- package/src/components/BottomActionBar/index.ts +2 -0
- package/src/components/BottomActionBar/styles.ts +22 -0
- package/src/components/BottomSheet/BottomSheet.tsx +136 -0
- package/src/components/BottomSheet/README.md +51 -0
- package/src/components/BottomSheet/index.ts +2 -0
- package/src/components/BottomSheet/styles.ts +84 -0
- package/src/components/Button/Button.tsx +65 -0
- package/src/components/Button/README.md +59 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Button/styles.ts +50 -0
- package/src/components/Checkbox/Checkbox.tsx +220 -0
- package/src/components/Checkbox/README.md +60 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/Checkbox/styles.ts +64 -0
- package/src/components/DatePicker/DatePicker.tsx +728 -0
- package/src/components/DatePicker/README.md +88 -0
- package/src/components/DatePicker/index.ts +9 -0
- package/src/components/DatePicker/model.ts +316 -0
- package/src/components/DatePicker/styles.ts +267 -0
- package/src/components/Dialog/Dialog.tsx +254 -0
- package/src/components/Dialog/README.md +98 -0
- package/src/components/Dialog/index.ts +2 -0
- package/src/components/Dialog/styles.ts +109 -0
- package/src/components/EmptyState/EmptyState.tsx +58 -0
- package/src/components/EmptyState/README.md +44 -0
- package/src/components/EmptyState/index.ts +2 -0
- package/src/components/EmptyState/styles.ts +82 -0
- package/src/components/Field/Field.tsx +59 -0
- package/src/components/Field/FieldContext.ts +13 -0
- package/src/components/Field/README.md +68 -0
- package/src/components/Field/index.ts +2 -0
- package/src/components/Field/styles.ts +56 -0
- package/src/components/FilterChips/FilterChips.tsx +110 -0
- package/src/components/FilterChips/README.md +69 -0
- package/src/components/FilterChips/index.ts +2 -0
- package/src/components/FilterChips/styles.ts +72 -0
- package/src/components/Form/Form.tsx +77 -0
- package/src/components/Form/FormItem.tsx +204 -0
- package/src/components/Form/README.md +101 -0
- package/src/components/Form/context.ts +11 -0
- package/src/components/Form/index.ts +25 -0
- package/src/components/Form/model.ts +427 -0
- package/src/components/Form/styles.ts +10 -0
- package/src/components/ImagePreview/ImagePreview.tsx +207 -0
- package/src/components/ImagePreview/README.md +51 -0
- package/src/components/ImagePreview/index.ts +2 -0
- package/src/components/ImagePreview/styles.ts +87 -0
- package/src/components/InlineFeedback/InlineFeedback.tsx +88 -0
- package/src/components/InlineFeedback/README.md +47 -0
- package/src/components/InlineFeedback/index.ts +2 -0
- package/src/components/InlineFeedback/styles.ts +140 -0
- package/src/components/Input/Input.tsx +79 -0
- package/src/components/Input/README.md +62 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/Input/styles.ts +41 -0
- package/src/components/ListSkeleton/ListSkeleton.tsx +48 -0
- package/src/components/ListSkeleton/README.md +37 -0
- package/src/components/ListSkeleton/index.ts +2 -0
- package/src/components/ListSkeleton/styles.ts +30 -0
- package/src/components/NavigationBar/NavigationBar.tsx +218 -0
- package/src/components/NavigationBar/README.md +72 -0
- package/src/components/NavigationBar/index.ts +7 -0
- package/src/components/NavigationBar/styles.ts +98 -0
- package/src/components/Picker/Picker.tsx +238 -0
- package/src/components/Picker/README.md +76 -0
- package/src/components/Picker/index.ts +8 -0
- package/src/components/Picker/styles.ts +94 -0
- package/src/components/README.md +44 -0
- package/src/components/Radio/README.md +52 -0
- package/src/components/Radio/Radio.tsx +195 -0
- package/src/components/Radio/index.ts +2 -0
- package/src/components/Radio/styles.ts +70 -0
- package/src/components/SearchInput/README.md +48 -0
- package/src/components/SearchInput/SearchInput.tsx +131 -0
- package/src/components/SearchInput/index.ts +2 -0
- package/src/components/SearchInput/styles.ts +100 -0
- package/src/components/SideDrawer/README.md +48 -0
- package/src/components/SideDrawer/SideDrawer.tsx +198 -0
- package/src/components/SideDrawer/index.ts +2 -0
- package/src/components/SideDrawer/styles.ts +86 -0
- package/src/components/Skeleton/README.md +38 -0
- package/src/components/Skeleton/Skeleton.tsx +108 -0
- package/src/components/Skeleton/index.ts +2 -0
- package/src/components/Skeleton/styles.ts +18 -0
- package/src/components/Switch/README.md +27 -0
- package/src/components/Switch/Switch.tsx +77 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Switch/styles.ts +33 -0
- package/src/components/TabBar/README.md +66 -0
- package/src/components/TabBar/TabBar.tsx +93 -0
- package/src/components/TabBar/index.ts +2 -0
- package/src/components/TabBar/styles.ts +81 -0
- package/src/components/Tabs/README.md +64 -0
- package/src/components/Tabs/Tabs.tsx +114 -0
- package/src/components/Tabs/index.ts +2 -0
- package/src/components/Tabs/styles.ts +99 -0
- package/src/components/Tag/README.md +60 -0
- package/src/components/Tag/Tag.tsx +166 -0
- package/src/components/Tag/index.ts +2 -0
- package/src/components/Tag/styles.ts +159 -0
- package/src/components/TextArea/README.md +61 -0
- package/src/components/TextArea/TextArea.tsx +114 -0
- package/src/components/TextArea/index.ts +2 -0
- package/src/components/TextArea/styles.ts +45 -0
- package/src/components/TimePicker/README.md +62 -0
- package/src/components/TimePicker/TimePicker.tsx +343 -0
- package/src/components/TimePicker/index.ts +3 -0
- package/src/components/TimePicker/model.ts +88 -0
- package/src/components/TimePicker/styles.ts +141 -0
- package/src/components/Timeline/README.md +81 -0
- package/src/components/Timeline/Timeline.tsx +197 -0
- package/src/components/Timeline/index.ts +12 -0
- package/src/components/Timeline/model.ts +87 -0
- package/src/components/Timeline/styles.ts +115 -0
- package/src/components/Toast/README.md +68 -0
- package/src/components/Toast/Toast.tsx +310 -0
- package/src/components/Toast/index.ts +8 -0
- package/src/components/Toast/styles.ts +58 -0
- package/src/components/Upload/README.md +93 -0
- package/src/components/Upload/Upload.tsx +839 -0
- package/src/components/Upload/index.ts +14 -0
- package/src/components/Upload/model.ts +61 -0
- package/src/components/Upload/picker.ts +125 -0
- package/src/components/Upload/styles.ts +358 -0
- package/src/components/index.ts +119 -0
- package/src/index.ts +2 -0
- package/src/ui/tokens.ts +144 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
import { uiTokens as token } from "../../ui/tokens.js";
|
|
5
|
+
export const styles = StyleSheet.create({
|
|
6
|
+
button: {
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
alignSelf: 'stretch',
|
|
9
|
+
borderRadius: token.radius.medium,
|
|
10
|
+
borderWidth: 1,
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
gap: token.space.s8,
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
minHeight: token.size.inputMinHeight,
|
|
15
|
+
paddingHorizontal: token.space.s20,
|
|
16
|
+
paddingVertical: token.space.s12
|
|
17
|
+
},
|
|
18
|
+
destructive: {
|
|
19
|
+
backgroundColor: token.color.destructive,
|
|
20
|
+
borderColor: token.color.destructive
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
backgroundColor: token.color.bgDisabled,
|
|
24
|
+
borderColor: token.color.separator,
|
|
25
|
+
opacity: token.opacity.disabled
|
|
26
|
+
},
|
|
27
|
+
disabledLabel: {
|
|
28
|
+
color: token.color.labelDisabled
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
color: token.color.onTint,
|
|
32
|
+
...token.type.subheadline,
|
|
33
|
+
fontWeight: '600',
|
|
34
|
+
textAlign: 'center'
|
|
35
|
+
},
|
|
36
|
+
pressed: {
|
|
37
|
+
opacity: token.opacity.pressed
|
|
38
|
+
},
|
|
39
|
+
primary: {
|
|
40
|
+
backgroundColor: token.color.tintDefault,
|
|
41
|
+
borderColor: token.color.tintDefault
|
|
42
|
+
},
|
|
43
|
+
secondary: {
|
|
44
|
+
backgroundColor: token.color.bgSecondary,
|
|
45
|
+
borderColor: token.color.separator
|
|
46
|
+
},
|
|
47
|
+
secondaryLabel: {
|
|
48
|
+
color: token.color.tintPressed
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useMemo, useState } from 'react';
|
|
4
|
+
import { Pressable, Text, View } from 'react-native';
|
|
5
|
+
import Svg, { Path } from 'react-native-svg';
|
|
6
|
+
import { useFieldContext } from "../Field/FieldContext.js";
|
|
7
|
+
import { uiTokens as token } from "../../ui/tokens.js";
|
|
8
|
+
import { styles } from "./styles.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const CheckboxGroupContext = /*#__PURE__*/createContext(null);
|
|
11
|
+
function containsValue(values, value) {
|
|
12
|
+
return values.some(item => Object.is(item, value));
|
|
13
|
+
}
|
|
14
|
+
function CheckboxControl({
|
|
15
|
+
accessible = true,
|
|
16
|
+
accessibilityLabel,
|
|
17
|
+
checked,
|
|
18
|
+
defaultChecked = false,
|
|
19
|
+
description,
|
|
20
|
+
disabled = false,
|
|
21
|
+
indeterminate = false,
|
|
22
|
+
importantForAccessibility,
|
|
23
|
+
label,
|
|
24
|
+
onChange,
|
|
25
|
+
style,
|
|
26
|
+
value,
|
|
27
|
+
...pressableProps
|
|
28
|
+
}) {
|
|
29
|
+
const field = useFieldContext();
|
|
30
|
+
const group = useContext(CheckboxGroupContext);
|
|
31
|
+
const [internalChecked, setInternalChecked] = useState(defaultChecked);
|
|
32
|
+
const grouped = group !== null && value !== undefined;
|
|
33
|
+
const resolvedChecked = grouped ? containsValue(group.selected, value) : checked ?? internalChecked;
|
|
34
|
+
const isDisabled = disabled || Boolean(field?.disabled) || Boolean(group?.disabled);
|
|
35
|
+
const isInvalid = Boolean(field?.invalid);
|
|
36
|
+
const hasCopy = Boolean(label || description);
|
|
37
|
+
const defaultAccessibilityLabel = [label ?? field?.label, description].filter(Boolean).join(',') || undefined;
|
|
38
|
+
const update = () => {
|
|
39
|
+
const nextChecked = indeterminate ? true : !resolvedChecked;
|
|
40
|
+
if (grouped) {
|
|
41
|
+
group.update(value, nextChecked);
|
|
42
|
+
onChange?.(nextChecked);
|
|
43
|
+
} else {
|
|
44
|
+
if (checked === undefined) setInternalChecked(nextChecked);
|
|
45
|
+
onChange?.(nextChecked);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
49
|
+
...pressableProps,
|
|
50
|
+
accessible: accessible,
|
|
51
|
+
accessibilityLabel: accessible ? accessibilityLabel ?? defaultAccessibilityLabel : undefined,
|
|
52
|
+
accessibilityRole: accessible ? 'checkbox' : undefined,
|
|
53
|
+
accessibilityState: accessible ? {
|
|
54
|
+
checked: indeterminate ? 'mixed' : resolvedChecked,
|
|
55
|
+
disabled: isDisabled
|
|
56
|
+
} : undefined,
|
|
57
|
+
disabled: isDisabled,
|
|
58
|
+
importantForAccessibility: accessible ? importantForAccessibility : 'no-hide-descendants',
|
|
59
|
+
onPress: update,
|
|
60
|
+
style: ({
|
|
61
|
+
pressed
|
|
62
|
+
}) => [styles.item, !hasCopy && styles.controlOnly, isDisabled && styles.disabled, pressed && !isDisabled && styles.pressed, style],
|
|
63
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
64
|
+
style: [styles.control, (resolvedChecked || indeterminate) && styles.controlChecked, isInvalid && styles.controlInvalid],
|
|
65
|
+
children: resolvedChecked || indeterminate ? /*#__PURE__*/_jsx(Svg, {
|
|
66
|
+
fill: "none",
|
|
67
|
+
height: 12,
|
|
68
|
+
viewBox: "0 0 12 12",
|
|
69
|
+
width: 12,
|
|
70
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
71
|
+
d: indeterminate ? 'M2.5 6h7' : 'm2 6 2.35 2.35L10 3.5',
|
|
72
|
+
stroke: token.color.onTint,
|
|
73
|
+
strokeLinecap: "round",
|
|
74
|
+
strokeLinejoin: "round",
|
|
75
|
+
strokeWidth: 1.8
|
|
76
|
+
})
|
|
77
|
+
}) : null
|
|
78
|
+
}), hasCopy ? /*#__PURE__*/_jsxs(View, {
|
|
79
|
+
style: styles.copy,
|
|
80
|
+
children: [label ? /*#__PURE__*/_jsx(Text, {
|
|
81
|
+
style: styles.label,
|
|
82
|
+
children: label
|
|
83
|
+
}) : null, description ? /*#__PURE__*/_jsx(Text, {
|
|
84
|
+
style: styles.description,
|
|
85
|
+
children: description
|
|
86
|
+
}) : null]
|
|
87
|
+
}) : null]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function CheckboxGroup({
|
|
91
|
+
accessibilityLabel = '复选项',
|
|
92
|
+
children,
|
|
93
|
+
defaultValue = [],
|
|
94
|
+
direction = 'vertical',
|
|
95
|
+
disabled = false,
|
|
96
|
+
onChange,
|
|
97
|
+
options = [],
|
|
98
|
+
style,
|
|
99
|
+
value
|
|
100
|
+
}) {
|
|
101
|
+
const controlled = value !== undefined;
|
|
102
|
+
const [internalValue, setInternalValue] = useState(() => [...defaultValue]);
|
|
103
|
+
const selected = controlled ? value : internalValue;
|
|
104
|
+
const context = useMemo(() => ({
|
|
105
|
+
disabled,
|
|
106
|
+
selected,
|
|
107
|
+
update: (itemValue, itemChecked) => {
|
|
108
|
+
const nextValue = itemChecked ? containsValue(selected, itemValue) ? [...selected] : [...selected, itemValue] : selected.filter(item => !Object.is(item, itemValue));
|
|
109
|
+
if (!controlled) setInternalValue(nextValue);
|
|
110
|
+
onChange?.(nextValue);
|
|
111
|
+
}
|
|
112
|
+
}), [controlled, disabled, onChange, selected]);
|
|
113
|
+
return /*#__PURE__*/_jsx(CheckboxGroupContext.Provider, {
|
|
114
|
+
value: context,
|
|
115
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
116
|
+
accessibilityLabel: accessibilityLabel,
|
|
117
|
+
accessibilityRole: "list",
|
|
118
|
+
style: [styles.group, direction === 'horizontal' && styles.groupHorizontal, style],
|
|
119
|
+
children: [options.map(option => /*#__PURE__*/_jsx(CheckboxControl, {
|
|
120
|
+
accessibilityLabel: option.accessibilityLabel,
|
|
121
|
+
description: option.description,
|
|
122
|
+
disabled: option.disabled,
|
|
123
|
+
label: option.label,
|
|
124
|
+
value: option.value
|
|
125
|
+
}, `${typeof option.value}:${String(option.value)}`)), children]
|
|
126
|
+
})
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
export const Checkbox = Object.assign(CheckboxControl, {
|
|
130
|
+
Group: CheckboxGroup
|
|
131
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
import { uiTokens as token } from "../../ui/tokens.js";
|
|
5
|
+
export const styles = StyleSheet.create({
|
|
6
|
+
control: {
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
backgroundColor: token.color.bgSecondary,
|
|
9
|
+
borderColor: token.color.controlBorder,
|
|
10
|
+
borderRadius: 6,
|
|
11
|
+
borderWidth: 1,
|
|
12
|
+
height: 20,
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
width: 20
|
|
15
|
+
},
|
|
16
|
+
controlChecked: {
|
|
17
|
+
backgroundColor: token.color.tintDefault,
|
|
18
|
+
borderColor: token.color.tintDefault
|
|
19
|
+
},
|
|
20
|
+
controlInvalid: {
|
|
21
|
+
borderColor: token.color.destructive
|
|
22
|
+
},
|
|
23
|
+
controlOnly: {
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
width: token.size.minTouch
|
|
26
|
+
},
|
|
27
|
+
copy: {
|
|
28
|
+
flex: 1,
|
|
29
|
+
gap: token.space.s4,
|
|
30
|
+
minWidth: 0
|
|
31
|
+
},
|
|
32
|
+
description: {
|
|
33
|
+
color: token.color.labelSecondary,
|
|
34
|
+
...token.type.footnote
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
opacity: token.opacity.disabled
|
|
38
|
+
},
|
|
39
|
+
group: {
|
|
40
|
+
alignItems: 'stretch',
|
|
41
|
+
gap: token.space.s4
|
|
42
|
+
},
|
|
43
|
+
groupHorizontal: {
|
|
44
|
+
alignItems: 'flex-start',
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
flexWrap: 'wrap',
|
|
47
|
+
gap: token.space.s12
|
|
48
|
+
},
|
|
49
|
+
item: {
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
borderRadius: token.radius.small,
|
|
52
|
+
flexDirection: 'row',
|
|
53
|
+
gap: token.space.s12,
|
|
54
|
+
minHeight: token.size.minTouch
|
|
55
|
+
},
|
|
56
|
+
label: {
|
|
57
|
+
color: token.color.labelPrimary,
|
|
58
|
+
...token.type.subheadline
|
|
59
|
+
},
|
|
60
|
+
pressed: {
|
|
61
|
+
backgroundColor: token.color.bgTertiary,
|
|
62
|
+
opacity: token.opacity.pressed
|
|
63
|
+
}
|
|
64
|
+
});
|