@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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from './View'
|
|
3
|
+
|
|
4
|
+
export function Affix({ children, shadow, offsetTop, offsetBottom, ...props }) {
|
|
5
|
+
const [isFloating, setIsFloating] = React.useState(false)
|
|
6
|
+
const sentinelRef = React.useRef()
|
|
7
|
+
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const sentinel = sentinelRef.current
|
|
10
|
+
if (!sentinel) return
|
|
11
|
+
|
|
12
|
+
const observer = new IntersectionObserver(
|
|
13
|
+
([entry]) => setIsFloating(!entry.isIntersecting),
|
|
14
|
+
{ threshold: [1] }
|
|
15
|
+
)
|
|
16
|
+
observer.observe(sentinel)
|
|
17
|
+
return () => observer.disconnect()
|
|
18
|
+
}, [])
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<div ref={sentinelRef} style={{ height: 0 }} />
|
|
23
|
+
<View
|
|
24
|
+
sticky
|
|
25
|
+
top={offsetBottom === undefined ? (offsetTop || 0) : undefined}
|
|
26
|
+
bottom={offsetBottom}
|
|
27
|
+
shadow={shadow && isFloating}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</View>
|
|
32
|
+
</>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
+
import { pipe } from 'ramda'
|
|
2
|
+
|
|
1
3
|
import { Text } from '../text'
|
|
2
4
|
import { View } from './View'
|
|
5
|
+
import { useDefaultModifier } from '../../modifiers/default'
|
|
3
6
|
import { useResponsiveConverter } from '../../modifiers/responsiveConverter'
|
|
7
|
+
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
4
8
|
import { useSafeAreaInsets } from '../../abstractions/helpers/useSafeAreaInsets'
|
|
5
9
|
|
|
10
|
+
const DEFAULT_PROPS = {
|
|
11
|
+
borderB: 'overlayDivider',
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
export function TopBar({ right, left, WrapperView, children, ...rootProps }) {
|
|
7
15
|
const { top: safeTop } = useSafeAreaInsets()
|
|
8
16
|
|
|
9
|
-
const [_, props] =
|
|
17
|
+
const [_, props] = pipe(
|
|
18
|
+
useThemeComponentModifier('TopBar'),
|
|
19
|
+
useDefaultModifier(DEFAULT_PROPS),
|
|
20
|
+
useResponsiveConverter([])
|
|
21
|
+
)([{}, rootProps])
|
|
10
22
|
let { useSafeArea = true, title, subtitle } = props
|
|
11
23
|
|
|
12
24
|
const hasContent = !!title || !!subtitle || !!children || !!right || !!left
|
|
@@ -16,7 +28,7 @@ export function TopBar({ right, left, WrapperView, children, ...rootProps }) {
|
|
|
16
28
|
return (
|
|
17
29
|
<WrapperView paddingT={useSafeArea && safeTop} {...props}>
|
|
18
30
|
{!!hasContent && (
|
|
19
|
-
<View minH="
|
|
31
|
+
<View minH="xxl" centerV row paddingH="md" paddingV="sm" gap="sm" fullW>
|
|
20
32
|
<View flex={1} toLeft>
|
|
21
33
|
{left}
|
|
22
34
|
</View>
|
|
@@ -10,8 +10,9 @@ const OverlayContext = React.createContext(null)
|
|
|
10
10
|
export const useOverlay = () => React.useContext(OverlayContext)
|
|
11
11
|
|
|
12
12
|
export const useRegisterOverlay = (opts = {}) => {
|
|
13
|
-
const { unmountOnClose } = opts
|
|
13
|
+
const { unmountOnClose, onOpenChange } = opts
|
|
14
14
|
const timeout = React.useRef(null)
|
|
15
|
+
const wasOpen = React.useRef(false)
|
|
15
16
|
const { overlays, setOverlays } = useOverlay()
|
|
16
17
|
const randomId = React.useMemo(() => genRandonId(), [])
|
|
17
18
|
const overlay = overlays[randomId] || {}
|
|
@@ -20,12 +21,19 @@ export const useRegisterOverlay = (opts = {}) => {
|
|
|
20
21
|
const removeOverlay = () => setOverlays((data) => dissoc(randomId, data))
|
|
21
22
|
const stopDelayedClosing = () => !!timeout?.current && clearTimeout(timeout.current)
|
|
22
23
|
|
|
24
|
+
const isOpen = !!overlay.open
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (wasOpen.current && !isOpen) onOpenChange?.(false)
|
|
27
|
+
wasOpen.current = isOpen
|
|
28
|
+
}, [isOpen])
|
|
29
|
+
|
|
23
30
|
React.useEffect(() => {
|
|
24
31
|
return () => removeOverlay()
|
|
25
32
|
}, [])
|
|
26
33
|
|
|
27
34
|
const onOpen = ({ content, triggerRect, placement, options = {} }) => {
|
|
28
35
|
stopDelayedClosing()
|
|
36
|
+
onOpenChange?.(true)
|
|
29
37
|
mergeOverlay({ open: true, content, triggerRect, placement, ...options })
|
|
30
38
|
}
|
|
31
39
|
|
|
@@ -18,11 +18,16 @@ export function Popover({
|
|
|
18
18
|
bottomDrawerProps = {},
|
|
19
19
|
watch,
|
|
20
20
|
disabled,
|
|
21
|
+
startsOpen,
|
|
22
|
+
onOpenChange,
|
|
21
23
|
...props
|
|
22
24
|
}) {
|
|
23
25
|
const shouldUseDrawer = useResponsiveValue(useBottomDrawer)
|
|
24
26
|
const ref = React.useRef(null)
|
|
25
|
-
const { onOpen, onUpdate, onClose, onFastClose, stopDelayedClosing } = useRegisterOverlay({
|
|
27
|
+
const { onOpen, onUpdate, onClose, onFastClose, stopDelayedClosing } = useRegisterOverlay({
|
|
28
|
+
unmountOnClose,
|
|
29
|
+
onOpenChange,
|
|
30
|
+
})
|
|
26
31
|
|
|
27
32
|
const click = trigger === 'click'
|
|
28
33
|
const hover = trigger === 'hover'
|
|
@@ -68,7 +73,10 @@ export function Popover({
|
|
|
68
73
|
})
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
React.useEffect(() =>
|
|
76
|
+
React.useEffect(() => {
|
|
77
|
+
if (startsOpen && ref.current) show()
|
|
78
|
+
return () => onClose()
|
|
79
|
+
}, [])
|
|
72
80
|
|
|
73
81
|
React.useEffect(() => {
|
|
74
82
|
if (!ref.current || !watch) return
|
|
@@ -84,6 +92,7 @@ export function Popover({
|
|
|
84
92
|
content={content}
|
|
85
93
|
renderContent={renderContent}
|
|
86
94
|
children={children}
|
|
95
|
+
onOpenChange={onOpenChange}
|
|
87
96
|
{...props}
|
|
88
97
|
{...bottomDrawerProps}
|
|
89
98
|
/>
|
|
@@ -99,12 +108,20 @@ export function Popover({
|
|
|
99
108
|
return React.cloneElement(child, childProps)
|
|
100
109
|
}
|
|
101
110
|
|
|
102
|
-
function DrawerPopover({ children, content, renderContent, snapPoints, ...props }) {
|
|
111
|
+
function DrawerPopover({ children, content, renderContent, snapPoints, onOpenChange, ...props }) {
|
|
103
112
|
const [open, setOpen] = React.useState(false)
|
|
104
|
-
const onClose = () =>
|
|
113
|
+
const onClose = () => {
|
|
114
|
+
setOpen(false)
|
|
115
|
+
onOpenChange?.(false)
|
|
116
|
+
}
|
|
105
117
|
|
|
106
118
|
const child = React.Children.only(children)
|
|
107
|
-
let childProps = {
|
|
119
|
+
let childProps = {
|
|
120
|
+
onClick: () => {
|
|
121
|
+
setOpen(true)
|
|
122
|
+
onOpenChange?.(true)
|
|
123
|
+
},
|
|
124
|
+
}
|
|
108
125
|
|
|
109
126
|
return (
|
|
110
127
|
<>
|
|
@@ -35,11 +35,16 @@ export function DataTable({ data, columns, rowKey = 'key', stickyHeader, grid, .
|
|
|
35
35
|
return (
|
|
36
36
|
<Table {...props}>
|
|
37
37
|
<TableHeaderRow sticky={stickyHeader}>
|
|
38
|
-
{columns.map((
|
|
38
|
+
{columns.map((rawColumn, index) => {
|
|
39
|
+
const { key, render, renderHeader, field, label, ...column } = rawColumn
|
|
39
40
|
const headerProps = { ...column, size: sizeCode }
|
|
40
41
|
if (!column.borderR && columns.length - 1 > index && grid) headerProps.borderR = true
|
|
41
42
|
|
|
42
|
-
return
|
|
43
|
+
return (
|
|
44
|
+
<TableHeader key={key} {...headerProps}>
|
|
45
|
+
{renderHeader ? renderHeader(rawColumn) : label}
|
|
46
|
+
</TableHeader>
|
|
47
|
+
)
|
|
43
48
|
})}
|
|
44
49
|
</TableHeaderRow>
|
|
45
50
|
|
|
@@ -18,10 +18,11 @@ const TableContext = React.createContext(null)
|
|
|
18
18
|
export const useTable = () => React.useContext(TableContext) || {}
|
|
19
19
|
|
|
20
20
|
const DEFAULT_PROPS = {
|
|
21
|
-
br: '
|
|
21
|
+
br: 'xxl', //
|
|
22
22
|
overflow: 'scroll',
|
|
23
23
|
width: '100%',
|
|
24
24
|
relative: true,
|
|
25
|
+
border: 'overlayDivider',
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export function Table({ children, ...rootProps }) {
|
|
@@ -7,7 +7,10 @@ import { useTabs } from './TabsHandler'
|
|
|
7
7
|
const duration = 100
|
|
8
8
|
|
|
9
9
|
function Item({ item, active, ...props }) {
|
|
10
|
-
const Content = React.useMemo(
|
|
10
|
+
const Content = React.useMemo(
|
|
11
|
+
() => item.render || item.renderContent || item.Content,
|
|
12
|
+
[item.renderContent, item.Content]
|
|
13
|
+
)
|
|
11
14
|
const [open, setOpen] = React.useState(active)
|
|
12
15
|
|
|
13
16
|
React.useEffect(() => {
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { is } from 'ramda'
|
|
2
2
|
import dayjs from 'dayjs'
|
|
3
|
+
import relativeTime from 'dayjs/esm/plugin/relativeTime'
|
|
3
4
|
|
|
4
5
|
import { Text } from '../text'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
dayjs.extend(relativeTime)
|
|
8
|
+
|
|
9
|
+
export function DateText({ format = 'DD MMM YYYY', fromNow, withFromNow, value, children, ...props }) {
|
|
7
10
|
value = is(String, children) ? children : value
|
|
11
|
+
if (!value) return false
|
|
8
12
|
// TODO: Get format from i18n
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
const date = dayjs(value)
|
|
15
|
+
const formattedValue = fromNow ? date.fromNow() : date.format(format)
|
|
16
|
+
const suffix = withFromNow ? ` (${date.fromNow()})` : ''
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Text {...props}>
|
|
20
|
+
{formattedValue}
|
|
21
|
+
{suffix}
|
|
22
|
+
</Text>
|
|
23
|
+
)
|
|
11
24
|
}
|
package/src/modifiers/border.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { clearProps, flattenStyle } from './_helpers'
|
|
2
|
-
import { useGetColor, useGetRadius } from '../theme/ThemeHandler'
|
|
2
|
+
import { useGetColor, useGetRadius, useTheme } from '../theme/ThemeHandler'
|
|
3
|
+
|
|
4
|
+
function resolveBorderWidth(value, theme) {
|
|
5
|
+
const base = theme.baseBorderWidth ?? 1
|
|
6
|
+
if (value === 'overlayDivider') return theme.useOverlayDivider ? base : 0
|
|
7
|
+
if (value === true) return base
|
|
8
|
+
return value
|
|
9
|
+
}
|
|
3
10
|
|
|
4
11
|
export function useBorderModifier([values, props]) {
|
|
5
12
|
const getRadius = useGetRadius()
|
|
6
13
|
const getColor = useGetColor()
|
|
14
|
+
const theme = useTheme()
|
|
7
15
|
let {
|
|
8
16
|
br,
|
|
9
17
|
brT,
|
|
@@ -34,13 +42,11 @@ export function useBorderModifier([values, props]) {
|
|
|
34
42
|
const borderBottomRightRadius = getRadius(brB ?? borderRadiusB ?? brR ?? borderRadiusR ?? borderRadius ?? br)
|
|
35
43
|
const borderBottomLeftRadius = getRadius(brB ?? borderRadiusB ?? brL ?? borderRadiusL ?? borderRadius ?? br)
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (borderB === true) borderB = 1
|
|
43
|
-
if (borderL === true) borderL = 1
|
|
45
|
+
border = resolveBorderWidth(border, theme)
|
|
46
|
+
borderT = resolveBorderWidth(borderT, theme)
|
|
47
|
+
borderR = resolveBorderWidth(borderR, theme)
|
|
48
|
+
borderB = resolveBorderWidth(borderB, theme)
|
|
49
|
+
borderL = resolveBorderWidth(borderL, theme)
|
|
44
50
|
const borderTopWidth = borderT || border || 0
|
|
45
51
|
const borderBottomWidth = borderB || border || 0
|
|
46
52
|
const borderLeftWidth = borderL || border || 0
|
|
@@ -48,7 +54,7 @@ export function useBorderModifier([values, props]) {
|
|
|
48
54
|
const hasBorder = borderTopWidth || borderBottomWidth || borderLeftWidth || borderRightWidth
|
|
49
55
|
|
|
50
56
|
if (!!hasBorder) {
|
|
51
|
-
borderStyle = 'solid'
|
|
57
|
+
if (!borderStyle) borderStyle = 'solid'
|
|
52
58
|
if (!borderColor && !brColor) brColor = 'divider'
|
|
53
59
|
}
|
|
54
60
|
|
|
@@ -5,13 +5,13 @@ import { useGetColor } from '../theme/ThemeHandler'
|
|
|
5
5
|
|
|
6
6
|
export function useFullColorModifier([
|
|
7
7
|
{ color, ...values },
|
|
8
|
-
{ outline, contrastTolerance, fill, bg: forcedBG, ...props },
|
|
8
|
+
{ outline, contrastTolerance, fill, bg: forcedBG, borderColor: explicitBorderColor, ...props },
|
|
9
9
|
]) {
|
|
10
10
|
const getColor = useGetColor()
|
|
11
11
|
|
|
12
12
|
let bg = color
|
|
13
13
|
const bgObj = tinycolor(getColor(bg))
|
|
14
|
-
let borderColor = color
|
|
14
|
+
let borderColor = explicitBorderColor ?? color
|
|
15
15
|
let fontColor = 'text'
|
|
16
16
|
|
|
17
17
|
if (!!outline && fill !== true) {
|
package/src/modifiers/size.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Platform } from '../abstractions/Platform'
|
|
2
2
|
import { clearProps, flattenStyle } from './_helpers'
|
|
3
|
-
import { useGetElementHeight } from '../theme/ThemeHandler'
|
|
3
|
+
import { useGetElementHeight, useTheme } from '../theme/ThemeHandler'
|
|
4
4
|
|
|
5
5
|
export function useSizeModifier([values, props]) {
|
|
6
|
+
const theme = useTheme()
|
|
6
7
|
const getHeight = useGetElementHeight()
|
|
7
8
|
let {
|
|
8
9
|
width,
|
|
@@ -26,11 +27,13 @@ export function useSizeModifier([values, props]) {
|
|
|
26
27
|
...restProps
|
|
27
28
|
} = props || {}
|
|
28
29
|
|
|
29
|
-
minHeight = getHeight(minHeight
|
|
30
|
-
minWidth = getHeight(minWidth
|
|
30
|
+
minHeight = getHeight(minHeight ?? minH)
|
|
31
|
+
minWidth = getHeight(minWidth ?? minW)
|
|
31
32
|
|
|
32
|
-
maxHeight = getHeight(maxHeight
|
|
33
|
-
|
|
33
|
+
maxHeight = getHeight(maxHeight ?? maxH)
|
|
34
|
+
|
|
35
|
+
maxWidth = maxWidth ?? maxW
|
|
36
|
+
maxWidth = maxWidth === 'base' ? theme.baseMaxWidth : getHeight(maxWidth || maxW)
|
|
34
37
|
|
|
35
38
|
height = getHeight(height)
|
|
36
39
|
width = getHeight(width)
|
|
@@ -4,6 +4,7 @@ import { BASE_THEME } from './base'
|
|
|
4
4
|
|
|
5
5
|
export const DEFAULT_MATRIX_THEME = mergeDeepRight(BASE_THEME, {
|
|
6
6
|
label: 'Hacker',
|
|
7
|
+
useOverlayDivider: true,
|
|
7
8
|
|
|
8
9
|
colors: {
|
|
9
10
|
primary: '#00FF41',
|
|
@@ -51,14 +52,4 @@ export const DEFAULT_MATRIX_THEME = mergeDeepRight(BASE_THEME, {
|
|
|
51
52
|
xxl: 7,
|
|
52
53
|
xxxl: 8,
|
|
53
54
|
},
|
|
54
|
-
|
|
55
|
-
components: {
|
|
56
|
-
Card: {
|
|
57
|
-
border: true,
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
Section: {
|
|
61
|
-
border: true,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
55
|
})
|
|
@@ -4,6 +4,7 @@ import { BASE_THEME } from './base'
|
|
|
4
4
|
|
|
5
5
|
export const DEFAULT_PAPER_THEME = mergeDeepRight(BASE_THEME, {
|
|
6
6
|
label: 'Paper',
|
|
7
|
+
useOverlayDivider: true,
|
|
7
8
|
|
|
8
9
|
colors: {
|
|
9
10
|
primary: '#5A5A5A',
|
|
@@ -32,18 +33,4 @@ export const DEFAULT_PAPER_THEME = mergeDeepRight(BASE_THEME, {
|
|
|
32
33
|
lylac: '#C7B7D4',
|
|
33
34
|
pink: '#E4A1B2',
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
-
components: {
|
|
37
|
-
Card: {
|
|
38
|
-
border: true,
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
Section: {
|
|
42
|
-
border: true,
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
TopBar: {
|
|
46
|
-
borderB: true,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
36
|
})
|
|
@@ -10,7 +10,7 @@ export function generateColorVariants(colors) {
|
|
|
10
10
|
result[key] = value
|
|
11
11
|
|
|
12
12
|
variations.forEach((amount) => {
|
|
13
|
-
if (amount <=
|
|
13
|
+
if (amount <= 40) {
|
|
14
14
|
const lightenSignal = !isDark ? '-' : '+'
|
|
15
15
|
const darkenSignal = isDark ? '-' : '+'
|
|
16
16
|
result[`${key}${lightenSignal}${amount}`] = tinycolor(value).lighten(amount).toString()
|
|
@@ -2,7 +2,8 @@ import { omit, keys } from 'ramda'
|
|
|
2
2
|
|
|
3
3
|
import { DEFAULT_DARK_THEME } from '../default/darkTheme'
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const EXCLUDED_KEYS = ['shadow', 'transparent']
|
|
6
|
+
const SCALE = keys(DEFAULT_DARK_THEME.colors).filter((k) => !EXCLUDED_KEYS.includes(k))
|
|
6
7
|
|
|
7
8
|
export function getColorFromProps({ color, ...props }, defaultValue) {
|
|
8
9
|
if (!!color) return [color, props]
|