@neko-os/ui 0.2.2 → 0.3.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/README.md +0 -76
- package/dist/DynamicStyleTag.js +18 -2
- package/dist/DynamicStyleTag.native.js +3 -1
- package/dist/NekoUI.js +39 -1
- package/dist/abstractions/ActivityIndicator.js +19 -1
- package/dist/abstractions/ActivityIndicator.native.js +43 -1
- package/dist/abstractions/ActivityIndicator.web.js +43 -1
- package/dist/abstractions/AnimatedView.js +3 -1
- package/dist/abstractions/AnimatedView.native.js +5 -1
- package/dist/abstractions/AnimatedView.web.js +3 -1
- package/dist/abstractions/BlurView.js +43 -1
- package/dist/abstractions/BlurView.native.js +39 -1
- package/dist/abstractions/BlurView.web.js +39 -1
- package/dist/abstractions/DraggableSlideView.js +3 -1
- package/dist/abstractions/DraggableSlideView.native.js +62 -1
- package/dist/abstractions/FlatList.js +3 -1
- package/dist/abstractions/FlatList.native.js +37 -1
- package/dist/abstractions/FlatList.web.js +3 -1
- package/dist/abstractions/GradientView.js +5 -1
- package/dist/abstractions/GradientView.native.js +32 -1
- package/dist/abstractions/HiddenInput.js +3 -1
- package/dist/abstractions/HiddenInput.native.js +3 -1
- package/dist/abstractions/Icon.js +10 -1
- package/dist/abstractions/Icon.native.js +13 -1
- package/dist/abstractions/Icon.web.js +11 -1
- package/dist/abstractions/Image.js +12 -1
- package/dist/abstractions/Image.native.js +7 -1
- package/dist/abstractions/Image.web.js +7 -1
- package/dist/abstractions/ImageBackground.js +17 -1
- package/dist/abstractions/ImageBackground.native.js +27 -1
- package/dist/abstractions/ImageBackground.web.js +7 -1
- package/dist/abstractions/KeyboardAvoidingView.js +3 -1
- package/dist/abstractions/KeyboardAvoidingView.native.js +3 -1
- package/dist/abstractions/Platform.js +1 -1
- package/dist/abstractions/Platform.native.js +3 -1
- package/dist/abstractions/Platform.web.js +3 -1
- package/dist/abstractions/Pressable.js +4 -1
- package/dist/abstractions/Pressable.native.js +3 -1
- package/dist/abstractions/Pressable.web.js +3 -1
- package/dist/abstractions/SafeAreaView.js +3 -1
- package/dist/abstractions/SafeAreaView.native.js +3 -1
- package/dist/abstractions/ScrollView.js +3 -1
- package/dist/abstractions/ScrollView.native.js +5 -1
- package/dist/abstractions/ScrollView.web.js +3 -1
- package/dist/abstractions/StaticList.js +51 -1
- package/dist/abstractions/Switch.js +97 -1
- package/dist/abstractions/Switch.native.js +12 -1
- package/dist/abstractions/Table.js +29 -1
- package/dist/abstractions/Table.native.js +19 -1
- package/dist/abstractions/Text.js +14 -1
- package/dist/abstractions/Text.native.js +3 -1
- package/dist/abstractions/Text.web.js +18 -1
- package/dist/abstractions/TextInput.js +12 -1
- package/dist/abstractions/TextInput.native.js +5 -1
- package/dist/abstractions/TextInput.web.js +5 -1
- package/dist/abstractions/TouchableOpacity.js +4 -1
- package/dist/abstractions/TouchableOpacity.native.js +3 -1
- package/dist/abstractions/View.js +3 -1
- package/dist/abstractions/View.native.js +3 -1
- package/dist/abstractions/View.web.js +3 -1
- package/dist/abstractions/helpers/componentSize.js +13 -1
- package/dist/abstractions/helpers/componentSize.native.js +12 -1
- package/dist/abstractions/helpers/storage.js +32 -1
- package/dist/abstractions/helpers/storage.native.js +34 -1
- package/dist/abstractions/helpers/transformStyle.js +8 -1
- package/dist/abstractions/helpers/transformStyle.native.js +3 -1
- package/dist/abstractions/helpers/useSafeAreaInsets.js +3 -1
- package/dist/abstractions/helpers/useSafeAreaInsets.native.js +3 -1
- package/dist/abstractions/helpers/windowWidth.js +13 -1
- package/dist/abstractions/helpers/windowWidth.native.js +6 -1
- package/dist/abstractions/helpers/windowWidth.web.js +6 -1
- package/dist/components/actions/ActionsDrawer.js +81 -1
- package/dist/components/actions/Breadcrumb.js +47 -1
- package/dist/components/actions/Button.js +82 -1
- package/dist/components/actions/Dropdown.js +91 -1
- package/dist/components/actions/FloatingButton.js +87 -1
- package/dist/components/actions/FloatingMenu.js +39 -1
- package/dist/components/actions/Link.js +66 -1
- package/dist/components/actions/Pressable.js +38 -1
- package/dist/components/actions/index.js +9 -1
- package/dist/components/actions/menu/HorizontalMenu.js +98 -1
- package/dist/components/actions/menu/Menu.js +7 -1
- package/dist/components/actions/menu/SubmenuWrapper.js +16 -1
- package/dist/components/actions/menu/VerticalMenu.js +133 -1
- package/dist/components/animations/AnimatedTopBar.js +10 -1
- package/dist/components/animations/AnimatedTopBar.native.js +34 -1
- package/dist/components/animations/AnimatedTopBar.web.js +1 -1
- package/dist/components/animations/AnimatedView.js +45 -1
- package/dist/components/animations/DraggableSlideView.js +42 -1
- package/dist/components/animations/ParallaxHeader.js +9 -1
- package/dist/components/animations/ParallaxHeader.native.js +32 -1
- package/dist/components/animations/ParallaxHeader.web.js +32 -1
- package/dist/components/animations/ReanimatedScrollHandler.js +8 -1
- package/dist/components/animations/ReanimatedScrollHandler.native.js +24 -1
- package/dist/components/animations/ReanimatedScrollHandler.web.js +1 -1
- package/dist/components/animations/ReanimatedView.js +40 -1
- package/dist/components/animations/index.js +5 -1
- package/dist/components/calendar/CalendarNav.js +67 -1
- package/dist/components/calendar/WeekDaysBar.js +18 -1
- package/dist/components/calendar/_helpers/calendarDays.js +16 -1
- package/dist/components/calendar/_helpers/dateDisabled.js +24 -1
- package/dist/components/feedback/alerter.js +31 -1
- package/dist/components/feedback/confirmer.js +70 -1
- package/dist/components/feedback/index.js +3 -1
- package/dist/components/feedback/notifications/Notification.js +37 -1
- package/dist/components/feedback/notifications/NotificationsHandler.js +65 -1
- package/dist/components/filter/DateFilter.js +72 -0
- package/dist/components/filter/FilterGroup.js +17 -0
- package/dist/components/filter/FilterHandler.js +54 -0
- package/dist/components/filter/FilterItem.js +30 -0
- package/dist/components/filter/PopoverFilterItem.js +84 -0
- package/dist/components/filter/SearchInput.js +49 -0
- package/dist/components/filter/index.js +6 -0
- package/dist/components/form/Form.js +31 -1
- package/dist/components/form/FormGroup.js +21 -1
- package/dist/components/form/FormItem.js +118 -1
- package/dist/components/form/FormList.js +143 -1
- package/dist/components/form/FormWrapperComponent.js +52 -1
- package/dist/components/form/FormWrapperComponent.native.js +5 -1
- package/dist/components/form/SubmitButton.js +22 -1
- package/dist/components/form/index.js +9 -1
- package/dist/components/form/useNewForm.js +211 -1
- package/dist/components/form/useWatch.js +70 -1
- package/dist/components/form/validation/defaultMessages.js +20 -1
- package/dist/components/form/validation/index.js +5 -1
- package/dist/components/form/validation/normalizeRules.js +22 -1
- package/dist/components/form/validation/shouldValidateOn.js +21 -1
- package/dist/components/form/validation/validateRules.js +83 -1
- package/dist/components/form/validation/validators.js +82 -1
- package/dist/components/helpers/ConditionalLazyRender.js +6 -1
- package/dist/components/helpers/LazyAction.js +22 -1
- package/dist/components/helpers/LazyRender.js +55 -1
- package/dist/components/helpers/LazyRender.native.js +58 -1
- package/dist/components/helpers/Portal.js +21 -1
- package/dist/components/helpers/PortalHandler.js +32 -1
- package/dist/components/helpers/Responsive.js +18 -1
- package/dist/components/helpers/Separator.js +49 -1
- package/dist/components/helpers/VerticalView.js +34 -1
- package/dist/components/helpers/index.js +8 -1
- package/dist/components/index.js +20 -1
- package/dist/components/inputs/BooleanSelect.js +14 -0
- package/dist/components/inputs/Checkbox.js +56 -1
- package/dist/components/inputs/DateInput.js +123 -1
- package/dist/components/inputs/DateRangeInput.js +41 -0
- package/dist/components/inputs/Editable.js +129 -0
- package/dist/components/inputs/EnabledSelect.js +14 -0
- package/dist/components/inputs/InputWrapper.js +93 -1
- package/dist/components/inputs/LinkInput.js +17 -1
- package/dist/components/inputs/MaskInput.js +67 -1
- package/dist/components/inputs/NumberInput.js +111 -1
- package/dist/components/inputs/NumberRangeInput.js +41 -0
- package/dist/components/inputs/PasswordInput.js +24 -0
- package/dist/components/inputs/Picker.js +169 -1
- package/dist/components/inputs/Radio.js +55 -1
- package/dist/components/inputs/RateInput.js +62 -1
- package/dist/components/inputs/SegmentedPicker.js +62 -1
- package/dist/components/inputs/Select.js +219 -1
- package/dist/components/inputs/Switch.js +60 -1
- package/dist/components/inputs/TextArea.js +5 -0
- package/dist/components/inputs/TextInput.js +32 -1
- package/dist/components/inputs/UploadInput.js +140 -0
- package/dist/components/inputs/_DateInput.native.js +89 -1
- package/dist/components/inputs/datePicker/DatePicker.js +24 -1
- package/dist/components/inputs/datePicker/DayPicker.js +64 -1
- package/dist/components/inputs/datePicker/MonthPicker.js +62 -1
- package/dist/components/inputs/datePicker/QuarterPicker.js +65 -1
- package/dist/components/inputs/datePicker/WeekPicker.js +74 -1
- package/dist/components/inputs/datePicker/YearPicker.js +70 -1
- package/dist/components/inputs/index.js +23 -1
- package/dist/components/inputs/upload/Upload.js +99 -0
- package/dist/components/inputs/upload/Upload.native.js +154 -0
- package/dist/components/inputs/upload/useUploadState.js +143 -0
- package/dist/components/layout/Layout.js +40 -1
- package/dist/components/layout/LayoutContent.js +42 -1
- package/dist/components/layout/LayoutHeader.js +70 -1
- package/dist/components/layout/LayoutSider.js +64 -1
- package/dist/components/layout/index.js +4 -1
- package/dist/components/list/FlatList.js +91 -1
- package/dist/components/list/ScrollView.js +58 -1
- package/dist/components/list/index.js +2 -1
- package/dist/components/modals/bottomDrawer/index.js +3 -1
- package/dist/components/modals/bottomDrawer/index.native.js +5 -1
- package/dist/components/modals/bottomDrawer/index.web.js +5 -1
- package/dist/components/modals/bottomDrawer/native/BottomDrawer.js +239 -1
- package/dist/components/modals/bottomDrawer/native/DrawerContext.js +17 -1
- package/dist/components/modals/bottomDrawer/native/DrawerHandle.js +12 -1
- package/dist/components/modals/bottomDrawer/native/DrawerScrollView.js +5 -1
- package/dist/components/modals/bottomDrawer/native/createDrawerScrollComponent.js +139 -1
- package/dist/components/modals/bottomDrawer/native/utils.js +65 -1
- package/dist/components/modals/bottomDrawer/web/BottomDrawer.js +5 -1
- package/dist/components/modals/drawer/Drawer.js +5 -1
- package/dist/components/modals/drawer/Drawer.native.js +3 -1
- package/dist/components/modals/drawer/Drawer.web.js +3 -1
- package/dist/components/modals/drawer/index.js +1 -1
- package/dist/components/modals/index.js +4 -1
- package/dist/components/modals/modal/Modal.js +84 -1
- package/dist/components/modals/modal/Modal.native.js +83 -1
- package/dist/components/modals/modal/ModalBackdrop.js +58 -1
- package/dist/components/modals/modal/ModalContent.js +28 -1
- package/dist/components/modals/modal/ModalFooter.js +31 -1
- package/dist/components/modals/modal/ModalHeader.js +50 -1
- package/dist/components/modals/modal/handler/ModalsHandler.js +61 -1
- package/dist/components/modals/modal/index.js +6 -1
- package/dist/components/modals/router/ModalRoute.js +15 -1
- package/dist/components/modals/router/ModalsRouter.js +120 -1
- package/dist/components/modals/router/ModalsRouterContext.js +16 -1
- package/dist/components/modals/router/index.js +6 -1
- package/dist/components/modals/router/useAllModalsParams.js +6 -1
- package/dist/components/modals/router/useModalParams.js +6 -1
- package/dist/components/modals/router/useModalsNavigation.js +6 -1
- package/dist/components/modals/router/useUpdateModalContainer.js +6 -1
- package/dist/components/presentation/Avatar.js +79 -1
- package/dist/components/presentation/AvatarLabel.js +60 -1
- package/dist/components/presentation/AvatarsGroup.js +30 -0
- package/dist/components/presentation/Badge.js +91 -1
- package/dist/components/presentation/ContentLabel.js +43 -1
- package/dist/components/presentation/Icon.js +20 -1
- package/dist/components/presentation/IconLabel.js +40 -1
- package/dist/components/presentation/Image.js +33 -1
- package/dist/components/presentation/ImageBackground.js +38 -1
- package/dist/components/presentation/LabelValue.js +51 -1
- package/dist/components/presentation/Progress.js +20 -0
- package/dist/components/presentation/Rate.js +58 -1
- package/dist/components/presentation/RateTag.js +35 -1
- package/dist/components/presentation/Result.js +60 -1
- package/dist/components/presentation/ResultBar.js +56 -1
- package/dist/components/presentation/Tag.js +69 -1
- package/dist/components/presentation/Tooltip.js +44 -1
- package/dist/components/presentation/index.js +16 -1
- package/dist/components/sections/Section.js +50 -1
- package/dist/components/sections/SectionItem.js +24 -1
- package/dist/components/sections/SectionItemDropdown.js +68 -1
- package/dist/components/sections/SectionItemLink.js +35 -1
- package/dist/components/sections/index.js +4 -1
- package/dist/components/state/Loading.js +20 -1
- package/dist/components/state/LoadingView.js +37 -1
- package/dist/components/state/StatePresenter.js +41 -1
- package/dist/components/state/index.js +3 -1
- package/dist/components/steps/ActiveStepContent.js +16 -0
- package/dist/components/steps/StepsHandler.js +53 -0
- package/dist/components/steps/StepsMenu.js +14 -0
- package/dist/components/steps/StepsNavigation.js +37 -0
- package/dist/components/steps/index.js +4 -0
- package/dist/components/structure/Accordion.js +69 -1
- package/dist/components/structure/AccordionGroup.js +35 -1
- package/dist/components/structure/Affix.js +34 -0
- package/dist/components/structure/Affix.native.js +3 -0
- package/dist/components/structure/BlurView.js +59 -1
- package/dist/components/structure/Card.js +46 -1
- package/dist/components/structure/Col.js +22 -1
- package/dist/components/structure/GradientView.js +42 -1
- package/dist/components/structure/KeyboardAvoidingView.js +52 -1
- package/dist/components/structure/Row.js +50 -1
- package/dist/components/structure/SafeAreaView.js +42 -1
- package/dist/components/structure/Segment.js +51 -1
- package/dist/components/structure/TopBar.js +57 -1
- package/dist/components/structure/View.js +44 -1
- package/dist/components/structure/index.js +14 -1
- package/dist/components/structure/overlay/OverlayHandler.js +83 -1
- package/dist/components/structure/overlay/OverlayHandler.native.js +6 -1
- package/dist/components/structure/overlay/OverlayWrapper.js +52 -1
- package/dist/components/structure/overlay/calculatePosition.js +29 -1
- package/dist/components/structure/overlay/smartPlacement.js +32 -1
- package/dist/components/structure/popover/Popover.js +135 -1
- package/dist/components/structure/popover/Popover.native.js +105 -1
- package/dist/components/structure/popover/PopoverContent.js +18 -1
- package/dist/components/structure/popover/Popover_BU.js +157 -1
- package/dist/components/table/DataTable.js +62 -1
- package/dist/components/table/Pagination.js +128 -1
- package/dist/components/table/Table.js +66 -1
- package/dist/components/table/TableCol.js +67 -1
- package/dist/components/table/TableHeader.js +69 -1
- package/dist/components/table/TableHeaderRow.js +31 -1
- package/dist/components/table/TableRow.js +30 -1
- package/dist/components/table/index.js +7 -1
- package/dist/components/tabs/ActiveTabContent.js +38 -1
- package/dist/components/tabs/TabsHandler.js +16 -1
- package/dist/components/tabs/TabsMenu.js +15 -1
- package/dist/components/tabs/index.js +3 -1
- package/dist/components/text/DateText.js +24 -1
- package/dist/components/text/Text.js +32 -1
- package/dist/components/text/VerticalText.js +29 -1
- package/dist/components/text/index.js +3 -1
- package/dist/components/theme/ThemePicker.js +48 -1
- package/dist/components/theme/ThemePickerDrawer.js +12 -1
- package/dist/components/theme/ThemeStatusBar.js +3 -1
- package/dist/components/theme/ThemeStatusBar.native.js +9 -1
- package/dist/components/theme/ThemeThumb.js +98 -1
- package/dist/components/theme/index.js +3 -1
- package/dist/helpers/debounce.js +9 -1
- package/dist/helpers/index.js +5 -1
- package/dist/helpers/options.js +65 -1
- package/dist/helpers/random.js +5 -1
- package/dist/helpers/storage.js +76 -1
- package/dist/helpers/string.js +74 -1
- package/dist/i18n/I18n.js +96 -1
- package/dist/i18n/I18nProvider.js +40 -1
- package/dist/i18n/index.js +2 -1
- package/dist/index.js +8 -1
- package/dist/modifiers/_helpers.js +6 -1
- package/dist/modifiers/alignConverter.js +11 -1
- package/dist/modifiers/animation.js +18 -1
- package/dist/modifiers/animations/animatedEffects.js +64 -1
- package/dist/modifiers/animations/animatedEffects.native.js +55 -1
- package/dist/modifiers/animations/animatedEffects.web.js +55 -1
- package/dist/modifiers/animations/fadeEffect.js +46 -1
- package/dist/modifiers/animations/fadeEffect.native.js +33 -1
- package/dist/modifiers/animations/fadeEffect.web.js +3 -1
- package/dist/modifiers/animations/scaleEffect.js +46 -1
- package/dist/modifiers/animations/scaleEffect.native.js +33 -1
- package/dist/modifiers/animations/scrollEffect.web.js +3 -1
- package/dist/modifiers/animations/slideEffect.js +64 -1
- package/dist/modifiers/animations/slideEffect.native.js +53 -1
- package/dist/modifiers/animations/slideEffect.web.js +3 -1
- package/dist/modifiers/applyStyles.js +7 -1
- package/dist/modifiers/background.js +34 -1
- package/dist/modifiers/border.js +86 -1
- package/dist/modifiers/colorConverter.js +13 -1
- package/dist/modifiers/cursor.js +21 -1
- package/dist/modifiers/default.js +9 -1
- package/dist/modifiers/display.js +22 -1
- package/dist/modifiers/flex.js +20 -1
- package/dist/modifiers/flexWrapper.js +87 -1
- package/dist/modifiers/fullColor.js +32 -1
- package/dist/modifiers/grid.js +27 -1
- package/dist/modifiers/hover.js +28 -1
- package/dist/modifiers/logger.js +6 -1
- package/dist/modifiers/margin.js +25 -1
- package/dist/modifiers/overflow.js +28 -1
- package/dist/modifiers/padding.js +25 -1
- package/dist/modifiers/position.js +57 -1
- package/dist/modifiers/responsiveConverter.js +19 -1
- package/dist/modifiers/shadow.js +35 -1
- package/dist/modifiers/size.js +59 -1
- package/dist/modifiers/sizeConverter.js +12 -1
- package/dist/modifiers/state.js +33 -1
- package/dist/modifiers/text.js +62 -1
- package/dist/modifiers/textConverter.js +12 -1
- package/dist/modifiers/themeComponent.js +11 -1
- package/dist/responsive/ResponsiveHandler.js +28 -1
- package/dist/responsive/index.js +2 -1
- package/dist/responsive/responsiveHooks.js +67 -1
- package/dist/theme/ThemeHandler.js +81 -1
- package/dist/theme/default/base.js +95 -1
- package/dist/theme/default/blackTheme.js +47 -1
- package/dist/theme/default/cyberpunkTheme.js +36 -1
- package/dist/theme/default/darkTheme.js +35 -1
- package/dist/theme/default/hackerTheme.js +55 -1
- package/dist/theme/default/lightTheme.js +35 -1
- package/dist/theme/default/paperTheme.js +36 -1
- package/dist/theme/default/themes.js +15 -1
- package/dist/theme/format/colorsVariations.js +31 -1
- package/dist/theme/format/formatTheme.js +28 -1
- package/dist/theme/helpers/colorScale.js +12 -1
- package/dist/theme/helpers/contrastColor.js +18 -1
- package/dist/theme/helpers/dynamicColor.js +32 -1
- package/dist/theme/helpers/mergePreset.js +7 -1
- package/dist/theme/helpers/relatedScales.js +34 -1
- package/dist/theme/helpers/sizeScale.js +20 -1
- package/dist/theme/helpers/textScale.js +15 -1
- package/dist/theme/index.js +2 -1
- package/package.json +1 -3
- package/src/abstractions/Icon.js +1 -1
- package/src/abstractions/TextInput.js +10 -1
- package/src/components/actions/ActionsDrawer.js +17 -4
- package/src/components/actions/Button.js +5 -1
- package/src/components/actions/FloatingMenu.js +1 -1
- package/src/components/actions/menu/HorizontalMenu.js +2 -1
- package/src/components/actions/menu/VerticalMenu.js +2 -1
- package/src/components/filter/DateFilter.js +72 -0
- package/src/components/filter/FilterGroup.js +17 -0
- package/src/components/filter/FilterHandler.js +54 -0
- package/src/components/filter/FilterItem.js +30 -0
- package/src/components/filter/PopoverFilterItem.js +84 -0
- package/src/components/filter/SearchInput.js +49 -0
- package/src/components/filter/index.js +6 -0
- package/src/components/form/Form.js +9 -3
- package/src/components/form/FormItem.js +26 -1
- package/src/components/form/FormWrapperComponent.js +12 -3
- package/src/components/form/useNewForm.js +55 -4
- package/src/components/helpers/Separator.js +15 -11
- package/src/components/helpers/index.js +1 -0
- package/src/components/index.js +2 -0
- package/src/components/inputs/BooleanSelect.js +14 -0
- package/src/components/inputs/DateInput.js +3 -1
- package/src/components/inputs/DateRangeInput.js +41 -0
- package/src/components/inputs/Editable.js +129 -0
- package/src/components/inputs/EnabledSelect.js +14 -0
- package/src/components/inputs/InputWrapper.js +7 -4
- package/src/components/inputs/NumberInput.js +10 -5
- package/src/components/inputs/NumberRangeInput.js +41 -0
- package/src/components/inputs/PasswordInput.js +24 -0
- package/src/components/inputs/Picker.js +2 -2
- package/src/components/inputs/Select.js +61 -47
- package/src/components/inputs/TextArea.js +5 -0
- package/src/components/inputs/TextInput.js +14 -4
- package/src/components/inputs/UploadInput.js +140 -0
- package/src/components/inputs/index.js +9 -0
- package/src/components/inputs/upload/Upload.js +99 -0
- package/src/components/inputs/upload/Upload.native.js +154 -0
- package/src/components/inputs/upload/useUploadState.js +143 -0
- package/src/components/layout/LayoutHeader.js +1 -0
- package/src/components/presentation/AvatarLabel.js +1 -1
- package/src/components/presentation/AvatarsGroup.js +30 -0
- package/src/components/presentation/Badge.js +3 -2
- package/src/components/presentation/ContentLabel.js +1 -1
- package/src/components/presentation/IconLabel.js +1 -0
- package/src/components/presentation/Progress.js +20 -0
- package/src/components/presentation/index.js +2 -0
- package/src/components/sections/Section.js +1 -1
- package/src/components/sections/SectionItemLink.js +4 -2
- package/src/components/steps/ActiveStepContent.js +16 -0
- package/src/components/steps/StepsHandler.js +53 -0
- package/src/components/steps/StepsMenu.js +14 -0
- package/src/components/steps/StepsNavigation.js +37 -0
- package/src/components/steps/index.js +4 -0
- package/src/components/structure/Affix.js +34 -0
- package/src/components/structure/Affix.native.js +3 -0
- package/src/components/structure/Card.js +1 -0
- package/src/components/structure/TopBar.js +14 -2
- package/src/components/structure/index.js +1 -0
- package/src/components/structure/overlay/OverlayHandler.js +9 -1
- package/src/components/structure/popover/Popover.js +22 -5
- package/src/components/table/DataTable.js +7 -2
- package/src/components/table/Table.js +2 -1
- package/src/components/tabs/ActiveTabContent.js +4 -1
- package/src/components/text/DateText.js +15 -2
- package/src/modifiers/border.js +15 -9
- package/src/modifiers/fullColor.js +2 -2
- package/src/modifiers/size.js +8 -5
- package/src/theme/default/base.js +2 -0
- package/src/theme/default/hackerTheme.js +1 -10
- package/src/theme/default/paperTheme.js +1 -14
- package/src/theme/format/colorsVariations.js +1 -1
- package/src/theme/helpers/colorScale.js +2 -1
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { mergeDeepRight } from 'ramda';
|
|
2
|
+
import { BASE_THEME } from "./base";
|
|
3
|
+
|
|
4
|
+
export var DEFAULT_LIGHT_THEME = mergeDeepRight(BASE_THEME, {
|
|
5
|
+
label: 'Light',
|
|
6
|
+
|
|
7
|
+
colors: {
|
|
8
|
+
primary: '#818DF9',
|
|
9
|
+
text: '#272D34',
|
|
10
|
+
text2: '#4A5159',
|
|
11
|
+
text3: '#6E7680',
|
|
12
|
+
text4: '#9AA1AC',
|
|
13
|
+
|
|
14
|
+
mainBG: '#F4F5FE',
|
|
15
|
+
overlayBG: '#FFFFFF',
|
|
16
|
+
backdrop: '#383E44',
|
|
17
|
+
shadow: 'rgba(39, 45, 52, 0.15)',
|
|
18
|
+
transparent: 'rgba(255, 255, 255, 0)',
|
|
19
|
+
divider: '#e0e0e0',
|
|
20
|
+
|
|
21
|
+
blue: '#4DA3FF',
|
|
22
|
+
yellow: '#FFD93B',
|
|
23
|
+
green: '#4CAF50',
|
|
24
|
+
purple: '#9B59B6',
|
|
25
|
+
orange: '#FF7F50',
|
|
26
|
+
cyan: '#00BCD4',
|
|
27
|
+
red: '#E74C3C',
|
|
28
|
+
navy: '#34495E',
|
|
29
|
+
indigo: '#5C6BC0',
|
|
30
|
+
gray: '#B0BEC5',
|
|
31
|
+
brown: '#8D6E63',
|
|
32
|
+
lylac: '#B39DDB',
|
|
33
|
+
pink: '#F48FB1'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -1 +1,36 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { mergeDeepRight } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { BASE_THEME } from "./base";
|
|
4
|
+
|
|
5
|
+
export var DEFAULT_PAPER_THEME = mergeDeepRight(BASE_THEME, {
|
|
6
|
+
label: 'Paper',
|
|
7
|
+
useOverlayDivider: true,
|
|
8
|
+
|
|
9
|
+
colors: {
|
|
10
|
+
primary: '#5A5A5A',
|
|
11
|
+
text: '#000000',
|
|
12
|
+
text2: '#333333',
|
|
13
|
+
text3: '#555555',
|
|
14
|
+
text4: '#777777',
|
|
15
|
+
|
|
16
|
+
mainBG: '#F8F1E3',
|
|
17
|
+
overlayBG: '#F8F1E3',
|
|
18
|
+
backdrop: '#383E44',
|
|
19
|
+
shadow: 'rgba(0, 0, 0, 0.04)',
|
|
20
|
+
divider: '#E3D9C9',
|
|
21
|
+
|
|
22
|
+
blue: '#6B8EAE',
|
|
23
|
+
yellow: '#EADCA6',
|
|
24
|
+
green: '#88A288',
|
|
25
|
+
purple: '#A391B8',
|
|
26
|
+
orange: '#D9A066',
|
|
27
|
+
cyan: '#9CC9C2',
|
|
28
|
+
red: '#B85C5C',
|
|
29
|
+
navy: '#4A4A4A',
|
|
30
|
+
indigo: '#70788C',
|
|
31
|
+
gray: '#B8B8B8',
|
|
32
|
+
brown: '#8B7355',
|
|
33
|
+
lylac: '#C7B7D4',
|
|
34
|
+
pink: '#E4A1B2'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import{CYBERPUNK_DARK_THEME}from"./cyberpunkTheme";
|
|
1
|
+
import { CYBERPUNK_DARK_THEME } from "./cyberpunkTheme";
|
|
2
|
+
import { DEFAULT_BLACK_THEME } from "./blackTheme";
|
|
3
|
+
import { DEFAULT_DARK_THEME } from "./darkTheme";
|
|
4
|
+
import { DEFAULT_LIGHT_THEME } from "./lightTheme";
|
|
5
|
+
import { DEFAULT_MATRIX_THEME } from "./hackerTheme";
|
|
6
|
+
import { DEFAULT_PAPER_THEME } from "./paperTheme";
|
|
7
|
+
|
|
8
|
+
export var DEFAULT_THEMES = {
|
|
9
|
+
light: DEFAULT_LIGHT_THEME,
|
|
10
|
+
dark: DEFAULT_DARK_THEME,
|
|
11
|
+
paper: DEFAULT_PAPER_THEME,
|
|
12
|
+
black: DEFAULT_BLACK_THEME,
|
|
13
|
+
cyberpunk: CYBERPUNK_DARK_THEME,
|
|
14
|
+
hacker: DEFAULT_MATRIX_THEME
|
|
15
|
+
};
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(r, e) {return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}function _iterableToArrayLimit(r, l) {var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];if (null != t) {var e,n,i,u,a = [],f = !0,o = !1;try {if (i = (t = t.call(r)).next, 0 === l) {if (Object(t) !== t) return;f = !1;} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);} catch (r) {o = !0, n = r;} finally {try {if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;} finally {if (o) throw n;}}return a;}}function _arrayWithHoles(r) {if (Array.isArray(r)) return r;}import tinycolor from 'tinycolor2';
|
|
2
|
+
|
|
3
|
+
var variations = [10, 20, 30, 40, 50, 60, 70, 80, 90];
|
|
4
|
+
|
|
5
|
+
export function generateColorVariants(colors) {
|
|
6
|
+
var isDark = tinycolor((colors == null ? void 0 : colors.overlayBG) || (colors == null ? void 0 : colors.bg)).isDark();
|
|
7
|
+
var result = {};
|
|
8
|
+
|
|
9
|
+
Object.entries(colors).forEach(function (_ref) {var _ref2 = _slicedToArray(_ref, 2),key = _ref2[0],value = _ref2[1];
|
|
10
|
+
result[key] = value;
|
|
11
|
+
|
|
12
|
+
variations.forEach(function (amount) {
|
|
13
|
+
if (amount <= 40) {
|
|
14
|
+
var lightenSignal = !isDark ? '-' : '+';
|
|
15
|
+
var darkenSignal = isDark ? '-' : '+';
|
|
16
|
+
result[`${key}${lightenSignal}${amount}`] = tinycolor(value).lighten(amount).toString();
|
|
17
|
+
result[`${key}${darkenSignal}${amount}`] = tinycolor(value).darken(amount).toString();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
result[`${key}_op${amount}`] = tinycolor(value).
|
|
21
|
+
setAlpha(amount / 100).
|
|
22
|
+
toString();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function applyColorVariantsOnTheme(theme) {
|
|
30
|
+
return Object.assign({}, theme, { colors: generateColorVariants(theme.colors) });
|
|
31
|
+
}
|
|
@@ -1 +1,28 @@
|
|
|
1
|
-
import{mergeDeepRight,mergeDeepLeft,pipe}
|
|
1
|
+
import { mergeDeepRight, mergeDeepLeft, pipe } from 'ramda';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import tinycolor from 'tinycolor2';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_LIGHT_THEME } from "../default/lightTheme";
|
|
6
|
+
import { DEFAULT_THEMES } from "../default/themes";
|
|
7
|
+
import { applyColorVariantsOnTheme } from "./colorsVariations";
|
|
8
|
+
|
|
9
|
+
export function useFormattedTheme(themes, key) {
|
|
10
|
+
themes = themes || DEFAULT_THEMES;
|
|
11
|
+
return React.useMemo(function () {return formatTheme(themes, key);}, [key]);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function formatTheme(themes, key) {var _formattedTheme$color, _formattedTheme$color2;
|
|
15
|
+
themes = themes || DEFAULT_THEMES;
|
|
16
|
+
var theme = themes[key] || DEFAULT_THEMES[key] || DEFAULT_LIGHT_THEME;
|
|
17
|
+
var baseDefaultTheme = DEFAULT_THEMES[theme.base] || DEFAULT_THEMES[key] || DEFAULT_LIGHT_THEME;
|
|
18
|
+
|
|
19
|
+
var formattedTheme = pipe(
|
|
20
|
+
mergeDeepRight(baseDefaultTheme),
|
|
21
|
+
applyColorVariantsOnTheme,
|
|
22
|
+
mergeDeepLeft(themes._all || {})
|
|
23
|
+
)(Object.assign({}, theme));
|
|
24
|
+
|
|
25
|
+
var isDark = tinycolor((formattedTheme == null ? void 0 : (_formattedTheme$color = formattedTheme.colors) == null ? void 0 : _formattedTheme$color.overlayBG) || (formattedTheme == null ? void 0 : (_formattedTheme$color2 = formattedTheme.colors) == null ? void 0 : _formattedTheme$color2.bg)).isDark();
|
|
26
|
+
|
|
27
|
+
return Object.assign({}, formattedTheme, { isDark: isDark, isLight: !isDark });
|
|
28
|
+
}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["color"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { omit, keys } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_DARK_THEME } from "../default/darkTheme";
|
|
4
|
+
|
|
5
|
+
var EXCLUDED_KEYS = ['shadow', 'transparent'];
|
|
6
|
+
var SCALE = keys(DEFAULT_DARK_THEME.colors).filter(function (k) {return !EXCLUDED_KEYS.includes(k);});
|
|
7
|
+
|
|
8
|
+
export function getColorFromProps(_ref, defaultValue) {var color = _ref.color,props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
if (!!color) return [color, props];
|
|
10
|
+
color = SCALE.find(function (key) {return !!props[key];}) || defaultValue;
|
|
11
|
+
return [color, omit(SCALE, props)];
|
|
12
|
+
}
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import tinycolor from'tinycolor2';
|
|
1
|
+
import tinycolor from 'tinycolor2';
|
|
2
|
+
|
|
3
|
+
export function getContrastColor(bg) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['#FFFFFF', '#666666'];var tolerance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2.5;
|
|
4
|
+
if (!options.length) return '#666666';
|
|
5
|
+
|
|
6
|
+
var contrasts = options.map(function (color) {return {
|
|
7
|
+
color: color,
|
|
8
|
+
contrast: tinycolor.readability(bg, color)
|
|
9
|
+
};});
|
|
10
|
+
|
|
11
|
+
contrasts.sort(function (a, b) {return b.contrast - a.contrast;});
|
|
12
|
+
|
|
13
|
+
if (contrasts.length > 1 && Math.abs(contrasts[0].contrast - contrasts[1].contrast) < tolerance) {
|
|
14
|
+
return options[0];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return contrasts[0].color;
|
|
18
|
+
}
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
function _toConsumableArray(r) {return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r, a) {if (r) {if ("string" == typeof r) return _arrayLikeToArray(r, a);var t = {}.toString.call(r).slice(8, -1);return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;}}function _iterableToArray(r) {if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);}function _arrayWithoutHoles(r) {if (Array.isArray(r)) return _arrayLikeToArray(r);}function _arrayLikeToArray(r, a) {(null == a || a > r.length) && (a = r.length);for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];return n;}var BASE_COLORS = [
|
|
2
|
+
'text3',
|
|
3
|
+
'blue',
|
|
4
|
+
'yellow',
|
|
5
|
+
'green',
|
|
6
|
+
'purple',
|
|
7
|
+
'orange',
|
|
8
|
+
'cyan',
|
|
9
|
+
'red',
|
|
10
|
+
'navy',
|
|
11
|
+
'indigo',
|
|
12
|
+
'gray',
|
|
13
|
+
'brown',
|
|
14
|
+
'lylac',
|
|
15
|
+
'pink'];
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var COLORS = [].concat(BASE_COLORS, _toConsumableArray(BASE_COLORS.map(function (c) {return `${c}+10`;})), _toConsumableArray(BASE_COLORS.map(function (c) {return `${c}-10`;})));
|
|
19
|
+
|
|
20
|
+
export function getDynamicColor(id) {
|
|
21
|
+
var num;
|
|
22
|
+
if (typeof id === 'number') {
|
|
23
|
+
num = id;
|
|
24
|
+
} else {
|
|
25
|
+
num = String(id).
|
|
26
|
+
split('').
|
|
27
|
+
reduce(function (acc, char) {return acc + char.charCodeAt(0);}, 0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var index = num % COLORS.length;
|
|
31
|
+
return COLORS[index];
|
|
32
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{getThemeValue}from"./relatedScales";
|
|
1
|
+
import { getThemeValue } from "./relatedScales";
|
|
2
|
+
|
|
3
|
+
export function mergePreset(presets, key, props, defaultKey) {
|
|
4
|
+
if (!key) return props;
|
|
5
|
+
var preset = getThemeValue(presets, key, false) || getThemeValue(presets, defaultKey, {});
|
|
6
|
+
return Object.assign({}, props, preset);
|
|
7
|
+
}
|
|
@@ -1 +1,34 @@
|
|
|
1
|
-
import{is}from'ramda';
|
|
1
|
+
import { is } from 'ramda';
|
|
2
|
+
|
|
3
|
+
var SCALES = [
|
|
4
|
+
['xxxs'],
|
|
5
|
+
['xxs'],
|
|
6
|
+
['xs'],
|
|
7
|
+
['sm', 'small'],
|
|
8
|
+
['md', 'p'],
|
|
9
|
+
['lg', 'h6'],
|
|
10
|
+
['xl', 'h5'],
|
|
11
|
+
['xxl', 'h4'],
|
|
12
|
+
['xxxl', 'h3']];
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export function getScaleSynonyms(key) {
|
|
16
|
+
return SCALES.find(function (list) {return list.includes(key);}) || [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getThemeValue(group, key, defaultValue) {
|
|
20
|
+
defaultValue = defaultValue === undefined ? key : defaultValue;
|
|
21
|
+
if (!key) return defaultValue;
|
|
22
|
+
var value = group[key];
|
|
23
|
+
if (!!value || !is(String, key)) return value || defaultValue;
|
|
24
|
+
|
|
25
|
+
var synonyms = getScaleSynonyms(key);
|
|
26
|
+
for (var synonym of synonyms) {
|
|
27
|
+
if (group != null && group[synonym]) {
|
|
28
|
+
value = group[synonym];
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return value || defaultValue;
|
|
34
|
+
}
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["size"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { omit } from 'ramda';
|
|
2
|
+
|
|
3
|
+
var SCALE = ['xxxs', 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl'];
|
|
4
|
+
|
|
5
|
+
export function moveScale(value) {var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
6
|
+
var index = SCALE.indexOf(value);
|
|
7
|
+
if (!index) return value;
|
|
8
|
+
var movedIndex = index + unit;
|
|
9
|
+
var movedValue = SCALE[index + unit];
|
|
10
|
+
if (!movedValue) {
|
|
11
|
+
movedValue = unit > 0 ? 'xxxl' : 'xxxs';
|
|
12
|
+
}
|
|
13
|
+
return movedValue;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getSizeFromProps(_ref, defaultValue) {var size = _ref.size,props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
if (!!size) return [size, props];
|
|
18
|
+
size = SCALE.find(function (key) {return !!props[key];}) || defaultValue;
|
|
19
|
+
return [size, omit(SCALE, props)];
|
|
20
|
+
}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["size"];function _objectWithoutProperties(e, t) {if (null == e) return {};var o,r,i = _objectWithoutPropertiesLoose(e, t);if (Object.getOwnPropertySymbols) {var n = Object.getOwnPropertySymbols(e);for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);}return i;}function _objectWithoutPropertiesLoose(r, e) {if (null == r) return {};var t = {};for (var n in r) if ({}.hasOwnProperty.call(r, n)) {if (-1 !== e.indexOf(n)) continue;t[n] = r[n];}return t;}import { omit } from 'ramda';
|
|
2
|
+
|
|
3
|
+
var SCALE = ['xxxs', 'xxs', 'xs', 'sm', 'p', 'h6', 'h5', 'h4', 'h3', 'h2', 'h1'];
|
|
4
|
+
|
|
5
|
+
export function moveTextScale(value) {var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
6
|
+
var index = SCALE.indexOf(value);
|
|
7
|
+
if (!index) return value;
|
|
8
|
+
return SCALE[index + unit] || value;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getTextFromProps(_ref, defaultValue) {var size = _ref.size,props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
if (!!size) return [size, props];
|
|
13
|
+
size = SCALE.find(function (key) {return !!props[key];}) || defaultValue;
|
|
14
|
+
return [size, omit(SCALE, props)];
|
|
15
|
+
}
|
package/dist/theme/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export*from"./ThemeHandler";
|
|
1
|
+
export * from "./ThemeHandler";
|
|
2
|
+
export * from "./default/themes";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neko-os/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": "Christian Storch <ccstorch@gmail.com>",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -39,9 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"dayjs": "1.11.18",
|
|
43
42
|
"prop-types": "^15.8.1",
|
|
44
|
-
"react-native-web": "^0.21.0",
|
|
45
43
|
"tinycolor2": "^1.6.0"
|
|
46
44
|
},
|
|
47
45
|
"devDependencies": {
|
package/src/abstractions/Icon.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as Icons from '@remixicon/react'
|
|
|
3
3
|
import { capitalizeFirstLetter, toCamelCase } from '../helpers/string'
|
|
4
4
|
|
|
5
5
|
export function AbsIcon({ name, ...props }) {
|
|
6
|
-
if (!!name && !name.startsWith('Ri')) name = 'Ri' + capitalizeFirstLetter(toCamelCase(name))
|
|
6
|
+
if (!!name && !name.startsWith?.('Ri')) name = 'Ri' + capitalizeFirstLetter(toCamelCase(name))
|
|
7
7
|
const IconComponent = Icons[name] || Icons['RiCircleFill']
|
|
8
8
|
|
|
9
9
|
return <IconComponent {...props} />
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
export function AbsTextInput({ onChange, ...props }) {
|
|
1
|
+
export function AbsTextInput({ onChange, multiline, rows, ...props }) {
|
|
2
|
+
if (multiline) {
|
|
3
|
+
return (
|
|
4
|
+
<textarea
|
|
5
|
+
rows={rows}
|
|
6
|
+
onChange={(e) => onChange?.(e?.target?.value, e)}
|
|
7
|
+
{...props}
|
|
8
|
+
/>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
2
11
|
return <input type="text" onChange={(e) => onChange?.(e?.target?.value, e)} {...props} />
|
|
3
12
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { pipe } from 'ramda'
|
|
2
|
+
import React from 'react'
|
|
2
3
|
|
|
3
|
-
import { TopBar, View } from '../structure'
|
|
4
4
|
import { BottomDrawer, DrawerScrollView } from '../modals/bottomDrawer'
|
|
5
5
|
import { Menu } from './menu/Menu'
|
|
6
6
|
import { Section } from '../sections'
|
|
7
|
+
import { TopBar, View } from '../structure'
|
|
7
8
|
import { useDefaultModifier } from '../../modifiers/default'
|
|
9
|
+
import { useTheme } from '../../theme'
|
|
8
10
|
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
9
11
|
|
|
10
12
|
const DEFAULT_PROPS = {
|
|
@@ -34,7 +36,7 @@ function Content({ items, title, subtitle, onClose, onChange, topBarProps, menuP
|
|
|
34
36
|
<View flex>
|
|
35
37
|
<DrawerScrollView>
|
|
36
38
|
{!title && <View paddingT="md" />}
|
|
37
|
-
<Section>
|
|
39
|
+
<Section marginH="md">
|
|
38
40
|
<Menu items={items} onChange={handleChange} {...menuProps} />
|
|
39
41
|
</Section>
|
|
40
42
|
<View height={100} />
|
|
@@ -44,7 +46,8 @@ function Content({ items, title, subtitle, onClose, onChange, topBarProps, menuP
|
|
|
44
46
|
)
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
export function ActionsDrawer({ items, onChange, title, subtitle, onClose, ...rootProps }) {
|
|
49
|
+
export function ActionsDrawer({ items, onChange, title, subtitle, onClose, snapPoints, ...rootProps }) {
|
|
50
|
+
const { elementHeights, spaces } = useTheme()
|
|
48
51
|
const [{}, formattedProps] = pipe(
|
|
49
52
|
useThemeComponentModifier('ActionsDrawer'), //
|
|
50
53
|
useDefaultModifier(DEFAULT_PROPS)
|
|
@@ -52,8 +55,18 @@ export function ActionsDrawer({ items, onChange, title, subtitle, onClose, ...ro
|
|
|
52
55
|
|
|
53
56
|
const { topBarProps, menuProps, ...props } = formattedProps
|
|
54
57
|
|
|
58
|
+
// Auto height
|
|
59
|
+
snapPoints = React.useMemo(() => {
|
|
60
|
+
if (!!snapPoints?.length) return snapPoints
|
|
61
|
+
// Title bar + padding + safe footer space
|
|
62
|
+
const safeSpace = (!!title ? elementHeights.xxl : spaces.sm) + spaces.md + spaces.sm
|
|
63
|
+
const itemHeight = elementHeights[menuProps?.linkMinHeight]
|
|
64
|
+
const itemsLength = Math.min(8, items.length)
|
|
65
|
+
return [itemsLength * itemHeight + safeSpace]
|
|
66
|
+
}, [snapPoints, title, items])
|
|
67
|
+
|
|
55
68
|
return (
|
|
56
|
-
<BottomDrawer onClose={onClose} {...props}>
|
|
69
|
+
<BottomDrawer onClose={onClose} snapPoints={snapPoints} {...props}>
|
|
57
70
|
<Content
|
|
58
71
|
onClose={onClose}
|
|
59
72
|
topBarProps={topBarProps}
|
|
@@ -15,6 +15,7 @@ import { useHoverConverter } from '../../modifiers/hover'
|
|
|
15
15
|
import { useMarginModifier } from '../../modifiers/margin'
|
|
16
16
|
import { usePaddingModifier } from '../../modifiers/padding'
|
|
17
17
|
import { usePositionModifier } from '../../modifiers/position'
|
|
18
|
+
import { useShadowModifier } from '../../modifiers/shadow'
|
|
18
19
|
import { useSizeConverter } from '../../modifiers/sizeConverter'
|
|
19
20
|
import { useSizeModifier } from '../../modifiers/size'
|
|
20
21
|
import { useStateModifier } from '../../modifiers/state'
|
|
@@ -33,12 +34,15 @@ const DEFAULT_PROPS = ([{ sizeCode }]) => ({
|
|
|
33
34
|
},
|
|
34
35
|
})
|
|
35
36
|
|
|
36
|
-
export function Button({ children, ...rootProps }) {
|
|
37
|
+
export function Button({ children, dashed, ...rootProps }) {
|
|
38
|
+
if (dashed) rootProps = { outline: true, ...rootProps, borderStyle: 'dashed' }
|
|
39
|
+
|
|
37
40
|
const [{ loading, fontColor, sizeCode }, formattedProps] = pipe(
|
|
38
41
|
useColorConverter('primary'),
|
|
39
42
|
useSizeConverter('elementHeights', 'md'),
|
|
40
43
|
useThemeComponentModifier('Button'),
|
|
41
44
|
useDefaultModifier(DEFAULT_PROPS),
|
|
45
|
+
useShadowModifier,
|
|
42
46
|
useHoverConverter,
|
|
43
47
|
useCursorModifier,
|
|
44
48
|
useFullColorModifier,
|
|
@@ -13,7 +13,7 @@ export function FloatingMenu({ fixed, onChange, items, activeIndex, size = 'md',
|
|
|
13
13
|
WrapperView = WrapperView || View
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<View absolute={!fixed} fixed={fixed} left="md" right="md" centerH bottom={Math.max(insets.bottom, 16)}>
|
|
16
|
+
<View absolute={!fixed} fixed={fixed} left="md" right="md" centerH bottom={Math.max(insets.bottom / 2, 16)}>
|
|
17
17
|
<WrapperView height={height} shadow round row paddingH="sm" bg={bg} {...props}>
|
|
18
18
|
{items.map((item, index) => {
|
|
19
19
|
const isActive = index === activeIndex
|
|
@@ -23,7 +23,7 @@ function Item({
|
|
|
23
23
|
...props
|
|
24
24
|
}) {
|
|
25
25
|
activeColor = activeColor || 'primary'
|
|
26
|
-
let { active, key, ...childProps } = omit(['onClick', 'onPress'], item)
|
|
26
|
+
let { active, key, disabled, ...childProps } = omit(['onClick', 'onPress'], item)
|
|
27
27
|
if (!active && activeIndex >= 0) active = activeIndex === index
|
|
28
28
|
if (!active && activeKey !== undefined) active = activeKey === item.key
|
|
29
29
|
|
|
@@ -41,6 +41,7 @@ function Item({
|
|
|
41
41
|
fullH
|
|
42
42
|
center
|
|
43
43
|
paddingH={linkPaddingH}
|
|
44
|
+
disabled={disabled}
|
|
44
45
|
{...linkProps}
|
|
45
46
|
onPress={() => handlePress(item, index)}
|
|
46
47
|
>
|
|
@@ -30,7 +30,7 @@ function LinkItem({
|
|
|
30
30
|
...props
|
|
31
31
|
}) {
|
|
32
32
|
activeColor = activeColor || 'primary'
|
|
33
|
-
let { active, key, ...childProps } = omit(['onClick', 'onPress'], item)
|
|
33
|
+
let { active, key, disabled, ...childProps } = omit(['onClick', 'onPress'], item)
|
|
34
34
|
if (!active && activeIndex >= 0) active = activeIndex === index
|
|
35
35
|
if (!active && activeKey !== undefined) active = activeKey === item.key
|
|
36
36
|
const bg = active && tinycolor(color).setAlpha(0.03).toString()
|
|
@@ -49,6 +49,7 @@ function LinkItem({
|
|
|
49
49
|
bg={bg}
|
|
50
50
|
transition="border-color 0.5s ease, background 0.3s ease"
|
|
51
51
|
hover={{ br: 0 }}
|
|
52
|
+
disabled={disabled}
|
|
52
53
|
{...linkProps}
|
|
53
54
|
onPress={() => handlePress(item, index)}
|
|
54
55
|
>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import dayjs from 'dayjs'
|
|
3
|
+
import { is } from 'ramda'
|
|
4
|
+
|
|
5
|
+
import { DateInput } from '../inputs'
|
|
6
|
+
import { FilterItem } from './FilterItem'
|
|
7
|
+
import { useFilter } from './FilterHandler'
|
|
8
|
+
|
|
9
|
+
function getFormat(type) {
|
|
10
|
+
switch (type) {
|
|
11
|
+
case 'year':
|
|
12
|
+
return 'YYYY'
|
|
13
|
+
case 'quarter':
|
|
14
|
+
return 'YYYY [Q]Q'
|
|
15
|
+
case 'month':
|
|
16
|
+
return 'YYYY MMM'
|
|
17
|
+
case 'week':
|
|
18
|
+
return 'YYYY wo'
|
|
19
|
+
default:
|
|
20
|
+
return 'YYYY-MM-DD'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function formatValue(value, type) {
|
|
25
|
+
if (!value) return null
|
|
26
|
+
const date = dayjs(value)
|
|
27
|
+
|
|
28
|
+
switch (type) {
|
|
29
|
+
case 'year':
|
|
30
|
+
return [date.startOf('year'), date.endOf('year')]
|
|
31
|
+
case 'quarter':
|
|
32
|
+
return [date.startOf('quarter'), date.endOf('quarter')]
|
|
33
|
+
case 'month':
|
|
34
|
+
return [date.startOf('month'), date.endOf('month')]
|
|
35
|
+
case 'week':
|
|
36
|
+
return [date.startOf('isoWeek'), date.endOf('isoWeek')]
|
|
37
|
+
default:
|
|
38
|
+
return [date.startOf('day'), date.endOf('day')]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function DateFilter({ name, label, type, format, useMapValue, ...rest }) {
|
|
43
|
+
const { filters, onChangeFilter } = useFilter()
|
|
44
|
+
let value = filters?.[name]
|
|
45
|
+
format = format || getFormat(type)
|
|
46
|
+
|
|
47
|
+
if (!!value?.init && !!value.end) {
|
|
48
|
+
value = value.init
|
|
49
|
+
}
|
|
50
|
+
if (is(Array, value) && value?.length === 2) {
|
|
51
|
+
value = value[0]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!!value && !!value.format) {
|
|
55
|
+
label = value.format(format)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const handleChange = (val) => {
|
|
59
|
+
let result = formatValue(val, type)
|
|
60
|
+
if (!!result?.length && !!useMapValue) {
|
|
61
|
+
const [init, end] = result
|
|
62
|
+
result = { init, end }
|
|
63
|
+
}
|
|
64
|
+
onChangeFilter(name, result)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<FilterItem name={name}>
|
|
69
|
+
{({ value: _v }) => <DateInput value={value} onChange={handleChange} type={type} {...rest} />}
|
|
70
|
+
</FilterItem>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const FilterGroupContext = React.createContext(null)
|
|
4
|
+
const useGroupPath = () => React.useContext(FilterGroupContext)?.path || []
|
|
5
|
+
|
|
6
|
+
export function useFilterPath(name) {
|
|
7
|
+
const listPath = !!name ? (Array.isArray(name) ? name : [name]) : []
|
|
8
|
+
const parentPath = useGroupPath()
|
|
9
|
+
return [...parentPath, ...listPath]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function FilterGroup({ name, children }) {
|
|
13
|
+
const path = useFilterPath(name)
|
|
14
|
+
const value = { path }
|
|
15
|
+
|
|
16
|
+
return <FilterGroupContext.Provider value={value}>{children}</FilterGroupContext.Provider>
|
|
17
|
+
}
|