@neko-os/ui 0.0.4 → 0.0.6
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/dist/NekoUI.js +1 -1
- package/dist/abstractions/ActivityIndicator.js +1 -0
- package/dist/abstractions/ActivityIndicator.native.js +1 -0
- package/dist/abstractions/AnimatedView.js +1 -0
- package/dist/abstractions/AnimatedView.native.js +1 -0
- package/dist/abstractions/BKTouchableOpacity.js +0 -0
- package/dist/abstractions/DraggableSlideView.js +1 -0
- package/dist/abstractions/DraggableSlideView.native.js +1 -0
- package/dist/abstractions/HiddenInput.js +1 -0
- package/dist/abstractions/HiddenInput.native.js +1 -0
- package/dist/abstractions/Icon.js +1 -1
- package/dist/abstractions/Icon.native.js +1 -1
- package/dist/abstractions/Icon.web.js +1 -1
- package/dist/abstractions/Image.js +1 -0
- package/dist/abstractions/Image.native.js +1 -0
- package/dist/abstractions/Image.web.js +1 -0
- package/dist/abstractions/Platform.js +1 -0
- package/dist/abstractions/Platform.native.js +1 -0
- package/dist/abstractions/Platform.web.js +1 -0
- package/dist/abstractions/SafeAreaView.js +1 -0
- package/dist/abstractions/SafeAreaView.native.js +1 -0
- package/dist/abstractions/Switch.js +1 -0
- package/dist/abstractions/Switch.native.js +1 -0
- package/dist/abstractions/Table.js +1 -0
- package/dist/abstractions/Table.native.js +1 -0
- package/dist/abstractions/Text.js +1 -1
- package/dist/abstractions/TextInput.js +1 -0
- package/dist/abstractions/TextInput.native.js +1 -0
- package/dist/abstractions/TextInput.web.js +1 -0
- package/dist/abstractions/TouchableOpacity.js +1 -1
- package/dist/abstractions/TouchableOpacity.native.js +1 -0
- package/dist/abstractions/TouchableOpacity.web.js +1 -0
- package/dist/abstractions/View.js +1 -1
- package/dist/abstractions/helpers/componentSize.js +1 -0
- package/dist/abstractions/helpers/componentSize.native.js +1 -0
- package/dist/abstractions/helpers/transformStyle.js +1 -0
- package/dist/abstractions/helpers/transformStyle.native.js +1 -0
- package/dist/abstractions/helpers/windowWidth.js +1 -0
- package/dist/abstractions/helpers/windowWidth.native.js +1 -0
- package/dist/abstractions/helpers/windowWidth.web.js +1 -0
- package/dist/components/actions/Breadcrumb.js +1 -0
- package/dist/components/actions/Button.js +1 -0
- package/dist/components/actions/Dropdown.js +1 -0
- package/dist/components/actions/Link.js +1 -0
- package/dist/components/actions/index.js +1 -0
- package/dist/components/actions/menu/HorizontalMenu.js +1 -0
- package/dist/components/actions/menu/Menu.js +1 -0
- package/dist/components/actions/menu/SubmenuWrapper.js +1 -0
- package/dist/components/actions/menu/VerticalMenu.js +1 -0
- package/dist/components/animations/AnimatedView.js +1 -0
- package/dist/components/animations/DraggableSlideView.js +1 -0
- package/dist/components/animations/index.js +1 -0
- package/dist/components/calendar/DayPicker.js +1 -0
- package/dist/components/calendar/_helpers/calendarDays.js +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/feedback/index.js +1 -0
- package/dist/components/feedback/notifications/Notification.js +1 -0
- package/dist/components/feedback/notifications/NotificationsHandler.js +1 -0
- package/dist/components/form/Form.js +1 -0
- package/dist/components/form/FormGroup.js +1 -0
- package/dist/components/form/FormItem.js +1 -0
- package/dist/components/form/FormList.js +1 -0
- package/dist/components/form/FormWrapperComponent.js +1 -0
- package/dist/components/form/FormWrapperComponent.native.js +1 -0
- package/dist/components/form/SubmitButton.js +1 -0
- package/dist/{form → components/form}/index.js +1 -1
- package/dist/components/form/useNewForm.js +1 -0
- package/dist/components/form/useWatch.js +1 -0
- package/dist/components/helpers/LazyRender.js +1 -0
- package/dist/components/helpers/LazyRender.native.js +1 -0
- package/dist/components/helpers/Portal.js +1 -0
- package/dist/components/helpers/PortalHandler.js +1 -0
- package/dist/components/helpers/Responsive.js +1 -0
- package/dist/components/helpers/Separator.js +1 -0
- package/dist/components/helpers/VerticalView.js +1 -0
- package/dist/components/helpers/index.js +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/inputs/Checkbox.js +1 -0
- package/dist/components/inputs/InputWrapper.js +1 -0
- package/dist/components/inputs/Picker.js +1 -0
- package/dist/components/inputs/Radio.js +1 -0
- package/dist/components/inputs/Switch.js +1 -0
- package/dist/components/inputs/TextInput.js +1 -0
- package/dist/components/inputs/index.js +1 -0
- package/dist/components/layout/Layout.js +1 -0
- package/dist/components/layout/LayoutContent.js +1 -0
- package/dist/components/layout/LayoutHeader.js +1 -0
- package/dist/components/layout/LayoutSider.js +1 -0
- package/dist/components/layout/index.js +1 -0
- package/dist/components/presentation/Avatar.js +1 -0
- package/dist/components/presentation/AvatarLabel.js +1 -0
- package/dist/components/presentation/Badge.js +1 -0
- package/dist/components/presentation/ContentLabel.js +1 -0
- package/dist/components/presentation/Icon.js +1 -0
- package/dist/components/presentation/IconLabel.js +1 -0
- package/dist/components/presentation/Image.js +1 -0
- package/dist/components/presentation/LabelValue.js +1 -0
- package/dist/components/presentation/Result.js +1 -0
- package/dist/components/presentation/ResultBar.js +1 -0
- package/dist/components/presentation/Tag.js +1 -0
- package/dist/components/presentation/Tooltip.js +1 -0
- package/dist/components/presentation/index.js +1 -0
- package/dist/components/state/Loading.js +1 -0
- package/dist/components/state/LoadingView.js +1 -0
- package/dist/components/state/index.js +1 -0
- package/dist/components/structure/Accordion.js +1 -0
- package/dist/components/structure/AccordionGroup.js +1 -0
- package/dist/components/structure/Card.js +1 -0
- package/dist/components/structure/Col.js +1 -0
- package/dist/components/structure/Row.js +1 -0
- package/dist/components/structure/SafeAreaView.js +1 -0
- package/dist/components/structure/View.js +1 -0
- package/dist/components/structure/index.js +1 -0
- package/dist/components/structure/overlay/OverlayHandler.js +1 -0
- package/dist/components/structure/overlay/OverlayHandler.native.js +1 -0
- package/dist/components/structure/overlay/OverlayWrapper.js +1 -0
- package/dist/components/structure/overlay/calculatePosition.js +1 -0
- package/dist/components/structure/overlay/smartPlacement.js +1 -0
- package/dist/components/structure/popover/Popover.js +1 -0
- package/dist/components/structure/popover/Popover.native.js +1 -0
- package/dist/components/structure/popover/PopoverContent.js +1 -0
- package/dist/components/table/DataTable.js +1 -0
- package/dist/components/table/Pagination.js +1 -0
- package/dist/components/table/Table.js +1 -0
- package/dist/components/table/TableCol.js +1 -0
- package/dist/components/table/TableHeader.js +1 -0
- package/dist/components/table/TableHeaderRow.js +1 -0
- package/dist/components/table/TableRow.js +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/text/Text.js +1 -0
- package/dist/components/text/VerticalText.js +1 -0
- package/dist/components/text/index.js +1 -0
- package/dist/helpers/debounce.js +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/options.js +1 -0
- package/dist/helpers/random.js +1 -0
- package/dist/index.css +15 -0
- package/dist/index.js +1 -1
- package/dist/modifiers/alignConverter.js +1 -0
- package/dist/modifiers/animation.js +1 -0
- package/dist/modifiers/animations/animatedEffects.js +1 -0
- package/dist/modifiers/animations/animatedEffects.native.js +1 -0
- package/dist/modifiers/animations/animatedEffects.web.js +1 -0
- package/dist/modifiers/animations/fadeEffect.js +1 -0
- package/dist/modifiers/animations/fadeEffect.native.js +1 -0
- package/dist/modifiers/animations/slideEffect.js +1 -0
- package/dist/modifiers/animations/slideEffect.native.js +1 -0
- package/dist/modifiers/applyStyles.js +1 -0
- package/dist/modifiers/background.js +1 -1
- package/dist/modifiers/border.js +1 -1
- package/dist/modifiers/colorConverter.js +1 -0
- package/dist/modifiers/default.js +1 -0
- package/dist/modifiers/display.js +1 -0
- package/dist/modifiers/flex.js +1 -1
- package/dist/modifiers/flexWrapper.js +1 -1
- package/dist/modifiers/fullColor.js +1 -0
- package/dist/modifiers/grid.js +1 -0
- package/dist/modifiers/logger.js +1 -0
- package/dist/modifiers/margin.js +1 -1
- package/dist/modifiers/overflow.js +1 -0
- package/dist/modifiers/padding.js +1 -1
- package/dist/modifiers/position.js +1 -1
- package/dist/modifiers/responsiveConverter.js +1 -0
- package/dist/modifiers/shadow.js +1 -1
- package/dist/modifiers/size.js +1 -1
- package/dist/modifiers/sizeConverter.js +1 -0
- package/dist/modifiers/state.js +1 -0
- package/dist/modifiers/text.js +1 -1
- package/dist/modifiers/textConverter.js +1 -0
- package/dist/modifiers/themeComponent.js +1 -0
- package/dist/responsive/ResponsiveHandler.js +1 -0
- package/dist/responsive/index.js +1 -0
- package/dist/responsive/responsiveHooks.js +1 -0
- package/dist/theme/ThemeHandler.js +1 -1
- package/dist/theme/default/base.js +1 -1
- package/dist/theme/default/cyberpunkTheme.js +1 -1
- package/dist/theme/default/darkTheme.js +1 -1
- package/dist/theme/default/deepWoodsTheme.js +1 -1
- package/dist/theme/default/forestTheme.js +1 -1
- package/dist/theme/default/hackerTheme.js +1 -0
- package/dist/theme/default/lightTheme.js +1 -1
- package/dist/theme/default/midnightTheme.js +1 -1
- package/dist/theme/default/msdosTheme.js +1 -0
- package/dist/theme/default/oceanTheme.js +1 -1
- package/dist/theme/default/pastelTheme.js +1 -1
- package/dist/theme/default/sunsetTheme.js +1 -1
- package/dist/theme/default/themes.js +1 -1
- package/dist/theme/helpers/colorScale.js +1 -0
- package/dist/theme/helpers/contrastColor.js +1 -0
- package/dist/theme/helpers/dynamicColor.js +1 -0
- package/dist/theme/helpers/mergePreset.js +1 -0
- package/dist/theme/helpers/relatedScales.js +1 -0
- package/dist/theme/helpers/sizeScale.js +1 -1
- package/dist/theme/helpers/textScale.js +1 -0
- package/package.json +8 -4
- package/src/NekoUI.js +15 -1
- package/src/abstractions/ActivityIndicator.js +31 -0
- package/src/abstractions/ActivityIndicator.native.js +44 -0
- package/src/abstractions/AnimatedView.js +3 -0
- package/src/abstractions/AnimatedView.native.js +6 -0
- package/src/abstractions/BKTouchableOpacity.js +12 -0
- package/src/abstractions/DraggableSlideView.js +85 -0
- package/src/abstractions/DraggableSlideView.native.js +62 -0
- package/src/abstractions/HiddenInput.js +3 -0
- package/src/abstractions/HiddenInput.native.js +3 -0
- package/src/abstractions/Icon.js +4 -20
- package/src/abstractions/Icon.native.js +11 -2
- package/src/abstractions/Icon.web.js +11 -2
- package/src/abstractions/Image.js +12 -0
- package/src/abstractions/Image.native.js +7 -0
- package/src/abstractions/Image.web.js +7 -0
- package/src/abstractions/Platform.js +1 -0
- package/src/abstractions/Platform.native.js +3 -0
- package/src/abstractions/Platform.web.js +3 -0
- package/src/abstractions/SafeAreaView.js +3 -0
- package/src/abstractions/SafeAreaView.native.js +3 -0
- package/src/abstractions/Switch.js +97 -0
- package/src/abstractions/Switch.native.js +12 -0
- package/src/abstractions/Table.js +29 -0
- package/src/abstractions/Table.native.js +19 -0
- package/src/abstractions/Text.js +13 -2
- package/src/abstractions/TextInput.js +3 -0
- package/src/abstractions/TextInput.native.js +5 -0
- package/src/abstractions/TextInput.web.js +5 -0
- package/src/abstractions/TouchableOpacity.js +3 -11
- package/src/abstractions/TouchableOpacity.native.js +3 -0
- package/src/abstractions/TouchableOpacity.web.js +3 -0
- package/src/abstractions/View.js +2 -2
- package/src/abstractions/helpers/componentSize.js +13 -0
- package/src/abstractions/helpers/componentSize.native.js +12 -0
- package/src/abstractions/helpers/transformStyle.js +8 -0
- package/src/abstractions/helpers/transformStyle.native.js +3 -0
- package/src/abstractions/helpers/windowWidth.js +13 -0
- package/src/abstractions/helpers/windowWidth.native.js +6 -0
- package/src/abstractions/helpers/windowWidth.web.js +6 -0
- package/src/components/actions/Breadcrumb.js +47 -0
- package/src/components/actions/Button.js +67 -0
- package/src/components/actions/Dropdown.js +68 -0
- package/src/components/actions/Link.js +52 -0
- package/src/components/actions/index.js +5 -0
- package/src/components/actions/menu/HorizontalMenu.js +96 -0
- package/src/components/actions/menu/Menu.js +7 -0
- package/src/components/actions/menu/SubmenuWrapper.js +16 -0
- package/src/components/actions/menu/VerticalMenu.js +107 -0
- package/src/components/animations/AnimatedView.js +45 -0
- package/src/components/animations/DraggableSlideView.js +42 -0
- package/src/components/animations/index.js +2 -0
- package/src/components/calendar/DayPicker.js +91 -0
- package/src/components/calendar/_helpers/calendarDays.js +16 -0
- package/src/components/calendar/index.js +1 -0
- package/src/components/feedback/index.js +1 -0
- package/src/components/feedback/notifications/Notification.js +37 -0
- package/src/components/feedback/notifications/NotificationsHandler.js +65 -0
- package/src/components/form/Form.js +25 -0
- package/src/{form → components/form}/FormGroup.js +4 -4
- package/src/components/form/FormItem.js +56 -0
- package/src/{form → components/form}/FormList.js +47 -11
- package/src/components/form/FormWrapperComponent.js +43 -0
- package/src/components/form/FormWrapperComponent.native.js +5 -0
- package/src/components/form/SubmitButton.js +20 -0
- package/src/{form → components/form}/index.js +3 -1
- package/src/components/form/useNewForm.js +67 -0
- package/src/components/form/useWatch.js +70 -0
- package/src/components/helpers/LazyRender.js +55 -0
- package/src/components/helpers/LazyRender.native.js +58 -0
- package/src/components/helpers/Portal.js +21 -0
- package/src/components/helpers/PortalHandler.js +32 -0
- package/src/components/helpers/Responsive.js +18 -0
- package/src/components/helpers/Separator.js +45 -0
- package/src/components/helpers/VerticalView.js +34 -0
- package/src/components/helpers/index.js +6 -0
- package/src/components/index.js +13 -0
- package/src/components/inputs/Checkbox.js +56 -0
- package/src/components/inputs/InputWrapper.js +79 -0
- package/src/components/inputs/Picker.js +116 -0
- package/src/components/inputs/Radio.js +55 -0
- package/src/components/inputs/Switch.js +60 -0
- package/src/components/inputs/TextInput.js +22 -0
- package/src/components/inputs/index.js +6 -0
- package/src/components/layout/Layout.js +40 -0
- package/src/components/layout/LayoutContent.js +42 -0
- package/src/components/layout/LayoutHeader.js +69 -0
- package/src/components/layout/LayoutSider.js +64 -0
- package/src/components/layout/index.js +4 -0
- package/src/components/presentation/Avatar.js +79 -0
- package/src/components/presentation/AvatarLabel.js +58 -0
- package/src/components/presentation/Badge.js +90 -0
- package/src/components/presentation/ContentLabel.js +43 -0
- package/src/components/presentation/Icon.js +20 -0
- package/src/components/presentation/IconLabel.js +39 -0
- package/src/components/presentation/Image.js +33 -0
- package/src/components/presentation/LabelValue.js +49 -0
- package/src/components/presentation/Result.js +60 -0
- package/src/components/presentation/ResultBar.js +56 -0
- package/src/components/presentation/Tag.js +69 -0
- package/src/components/presentation/Tooltip.js +43 -0
- package/src/components/presentation/index.js +11 -0
- package/src/components/state/Loading.js +20 -0
- package/src/components/state/LoadingView.js +28 -0
- package/src/components/state/index.js +2 -0
- package/src/components/structure/Accordion.js +69 -0
- package/src/components/structure/AccordionGroup.js +35 -0
- package/src/components/structure/Card.js +45 -0
- package/src/components/structure/Col.js +22 -0
- package/src/components/structure/Row.js +42 -0
- package/src/components/structure/SafeAreaView.js +42 -0
- package/src/components/structure/View.js +42 -0
- package/src/components/structure/index.js +8 -0
- package/src/components/structure/overlay/OverlayHandler.js +70 -0
- package/src/components/structure/overlay/OverlayHandler.native.js +6 -0
- package/src/components/structure/overlay/OverlayWrapper.js +52 -0
- package/src/components/structure/overlay/calculatePosition.js +29 -0
- package/src/components/structure/overlay/smartPlacement.js +32 -0
- package/src/components/structure/popover/Popover.js +69 -0
- package/src/components/structure/popover/Popover.native.js +75 -0
- package/src/components/structure/popover/PopoverContent.js +18 -0
- package/src/components/table/DataTable.js +57 -0
- package/src/components/table/Pagination.js +128 -0
- package/src/components/table/Table.js +65 -0
- package/src/components/table/TableCol.js +67 -0
- package/src/components/table/TableHeader.js +69 -0
- package/src/components/table/TableHeaderRow.js +31 -0
- package/src/components/table/TableRow.js +30 -0
- package/src/components/table/index.js +7 -0
- package/src/components/text/Text.js +32 -0
- package/src/components/text/VerticalText.js +29 -0
- package/src/components/text/index.js +2 -0
- package/src/helpers/debounce.js +9 -0
- package/src/helpers/index.js +3 -0
- package/src/helpers/options.js +65 -0
- package/src/helpers/random.js +5 -0
- package/src/index.css +15 -0
- package/src/index.js +3 -5
- package/src/modifiers/alignConverter.js +11 -0
- package/src/modifiers/animation.js +18 -0
- package/src/modifiers/animations/animatedEffects.js +63 -0
- package/src/modifiers/animations/animatedEffects.native.js +53 -0
- package/src/modifiers/animations/animatedEffects.web.js +3 -0
- package/src/modifiers/animations/fadeEffect.js +43 -0
- package/src/modifiers/animations/fadeEffect.native.js +33 -0
- package/src/modifiers/animations/slideEffect.js +61 -0
- package/src/modifiers/animations/slideEffect.native.js +53 -0
- package/src/modifiers/applyStyles.js +7 -0
- package/src/modifiers/background.js +10 -7
- package/src/modifiers/border.js +40 -13
- package/src/modifiers/colorConverter.js +13 -0
- package/src/modifiers/default.js +9 -0
- package/src/modifiers/display.js +22 -0
- package/src/modifiers/flex.js +11 -8
- package/src/modifiers/flexWrapper.js +58 -14
- package/src/modifiers/fullColor.js +29 -0
- package/src/modifiers/grid.js +27 -0
- package/src/modifiers/logger.js +6 -0
- package/src/modifiers/margin.js +10 -7
- package/src/modifiers/overflow.js +23 -0
- package/src/modifiers/padding.js +10 -7
- package/src/modifiers/position.js +20 -9
- package/src/modifiers/responsiveConverter.js +19 -0
- package/src/modifiers/shadow.js +10 -7
- package/src/modifiers/size.js +18 -9
- package/src/modifiers/sizeConverter.js +12 -0
- package/src/modifiers/state.js +33 -0
- package/src/modifiers/text.js +14 -13
- package/src/modifiers/textConverter.js +12 -0
- package/src/modifiers/themeComponent.js +11 -0
- package/src/responsive/ResponsiveHandler.js +28 -0
- package/src/responsive/index.js +2 -0
- package/src/responsive/responsiveHooks.js +54 -0
- package/src/theme/ThemeHandler.js +31 -33
- package/src/theme/default/base.js +29 -17
- package/src/theme/default/cyberpunkTheme.js +1 -0
- package/src/theme/default/darkTheme.js +2 -1
- package/src/theme/default/deepWoodsTheme.js +1 -0
- package/src/theme/default/forestTheme.js +1 -0
- package/src/theme/default/hackerTheme.js +40 -0
- package/src/theme/default/lightTheme.js +1 -0
- package/src/theme/default/midnightTheme.js +1 -0
- package/src/theme/default/msdosTheme.js +40 -0
- package/src/theme/default/oceanTheme.js +1 -0
- package/src/theme/default/pastelTheme.js +1 -0
- package/src/theme/default/sunsetTheme.js +1 -0
- package/src/theme/default/themes.js +4 -0
- package/src/theme/helpers/colorScale.js +11 -0
- package/src/theme/helpers/contrastColor.js +20 -0
- package/src/theme/helpers/dynamicColor.js +32 -0
- package/src/theme/helpers/mergePreset.js +7 -0
- package/src/theme/helpers/relatedScales.js +34 -0
- package/src/theme/helpers/sizeScale.js +17 -4
- package/src/theme/helpers/textScale.js +15 -0
- package/dist/actions/Button.js +0 -1
- package/dist/actions/index.js +0 -1
- package/dist/form/Form.js +0 -1
- package/dist/form/FormGroup.js +0 -1
- package/dist/form/FormItem.js +0 -1
- package/dist/form/FormList.js +0 -1
- package/dist/form/FormWrapperComponent.js +0 -1
- package/dist/form/FormWrapperComponent.native.js +0 -1
- package/dist/form/useForm.js +0 -1
- package/dist/modifiers/fullColor.js.js +0 -1
- package/dist/presentation/Icon.js +0 -1
- package/dist/presentation/Tag.js +0 -1
- package/dist/presentation/index.js +0 -1
- package/dist/structure/Card.js +0 -1
- package/dist/structure/View.js +0 -1
- package/dist/structure/index.js +0 -1
- package/dist/text/Text.js +0 -1
- package/dist/text/index.js +0 -1
- package/dist/theme/default/base.native.js +0 -1
- package/dist/theme/default/base.web.js +0 -1
- package/src/actions/Button.js +0 -48
- package/src/actions/index.js +0 -1
- package/src/form/Form.js +0 -14
- package/src/form/FormItem.js +0 -34
- package/src/form/FormWrapperComponent.js +0 -8
- package/src/form/FormWrapperComponent.native.js +0 -5
- package/src/form/useForm.js +0 -65
- package/src/modifiers/fullColor.js.js +0 -30
- package/src/presentation/Icon.js +0 -14
- package/src/presentation/Tag.js +0 -32
- package/src/presentation/index.js +0 -2
- package/src/structure/Card.js +0 -36
- package/src/structure/View.js +0 -34
- package/src/structure/index.js +0 -2
- package/src/text/Text.js +0 -20
- package/src/text/index.js +0 -1
- package/src/theme/default/base.native.js +0 -58
- package/src/theme/default/base.web.js +0 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { mergeDeepRight } from 'ramda'
|
|
2
|
+
|
|
3
|
+
import { BASE_THEME } from './base'
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_MATRIX_THEME = mergeDeepRight(BASE_THEME, {
|
|
6
|
+
colors: {
|
|
7
|
+
primary: '#00FF41',
|
|
8
|
+
text: '#00FF41',
|
|
9
|
+
text2: '#00CC33',
|
|
10
|
+
text3: '#009926',
|
|
11
|
+
text4: '#00661A',
|
|
12
|
+
|
|
13
|
+
bg: '#000000',
|
|
14
|
+
overlayBG: '#0A0A0A',
|
|
15
|
+
shadow: 'rgba(0, 255, 65, 0.2)',
|
|
16
|
+
divider: 'rgba(0,255,65, 0.3)',
|
|
17
|
+
|
|
18
|
+
blue: '#0087BD',
|
|
19
|
+
yellow: '#AEBF00',
|
|
20
|
+
green: '#00FF41',
|
|
21
|
+
purple: '#7A1FA2',
|
|
22
|
+
orange: '#FF6D00',
|
|
23
|
+
cyan: '#00BFA5',
|
|
24
|
+
red: '#D50000',
|
|
25
|
+
navy: '#003366',
|
|
26
|
+
indigo: '#303F9F',
|
|
27
|
+
gray: '#4A4A4A',
|
|
28
|
+
brown: '#5D4037',
|
|
29
|
+
lylac: '#8E24AA',
|
|
30
|
+
pink: '#C51162',
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
components: {
|
|
34
|
+
Card: {
|
|
35
|
+
border: 1,
|
|
36
|
+
br: 5,
|
|
37
|
+
borderColor: 'divider',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { mergeDeepRight } from 'ramda'
|
|
2
|
+
|
|
3
|
+
import { BASE_THEME } from './base'
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_MSDOS_THEME = mergeDeepRight(BASE_THEME, {
|
|
6
|
+
colors: {
|
|
7
|
+
primary: '#FFFF00',
|
|
8
|
+
text: '#FFFFFF',
|
|
9
|
+
text2: '#FFD700',
|
|
10
|
+
text3: '#CCCCCC',
|
|
11
|
+
text4: '#999999',
|
|
12
|
+
|
|
13
|
+
bg: '#0000AA',
|
|
14
|
+
overlayBG: '#000088',
|
|
15
|
+
shadow: 'rgba(0, 0, 0, 0.6)',
|
|
16
|
+
divider: 'rgba(255,255,255,0.3)',
|
|
17
|
+
|
|
18
|
+
blue: '#0000FF',
|
|
19
|
+
yellow: '#FFFF00',
|
|
20
|
+
green: '#00FF00',
|
|
21
|
+
purple: '#AA00FF',
|
|
22
|
+
orange: '#FF7700',
|
|
23
|
+
cyan: '#00FFFF',
|
|
24
|
+
red: '#FF0000',
|
|
25
|
+
navy: '#000080',
|
|
26
|
+
indigo: '#4B0082',
|
|
27
|
+
gray: '#B0B0B0',
|
|
28
|
+
brown: '#8B4513',
|
|
29
|
+
lylac: '#9370DB',
|
|
30
|
+
pink: '#FF69B4',
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
components: {
|
|
34
|
+
Card: {
|
|
35
|
+
border: 1,
|
|
36
|
+
br: 5,
|
|
37
|
+
borderColor: 'divider',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
})
|
|
@@ -2,6 +2,8 @@ import { CYBERPUNK_DARK_THEME } from './cyberpunkTheme'
|
|
|
2
2
|
import { DEEP_WOODS_DARK_THEME } from './deepWoodsTheme'
|
|
3
3
|
import { DEFAULT_DARK_THEME } from './darkTheme'
|
|
4
4
|
import { DEFAULT_LIGHT_THEME } from './lightTheme'
|
|
5
|
+
import { DEFAULT_MATRIX_THEME } from './hackerTheme'
|
|
6
|
+
import { DEFAULT_MSDOS_THEME } from './msdosTheme'
|
|
5
7
|
import { FOREST_MIST_THEME } from './forestTheme'
|
|
6
8
|
import { MIDNIGHT_NEON_THEME } from './midnightTheme'
|
|
7
9
|
import { OCEAN_BREEZE_THEME } from './oceanTheme'
|
|
@@ -18,4 +20,6 @@ export const DEFAULT_THEMES = {
|
|
|
18
20
|
forest: FOREST_MIST_THEME,
|
|
19
21
|
cyberpunk: CYBERPUNK_DARK_THEME,
|
|
20
22
|
deepWoods: DEEP_WOODS_DARK_THEME,
|
|
23
|
+
hacker: DEFAULT_MATRIX_THEME,
|
|
24
|
+
msdos: DEFAULT_MSDOS_THEME,
|
|
21
25
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { omit, keys } from 'ramda'
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_DARK_THEME } from '../default/darkTheme'
|
|
4
|
+
|
|
5
|
+
const SCALE = keys(DEFAULT_DARK_THEME.colors)
|
|
6
|
+
|
|
7
|
+
export function getColorFromProps({ color, ...props }, defaultValue) {
|
|
8
|
+
if (!!color) return [color, props]
|
|
9
|
+
color = SCALE.find((key) => !!props[key]) || defaultValue
|
|
10
|
+
return [color, omit(SCALE, props)]
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import tinycolor from 'tinycolor2'
|
|
2
|
+
|
|
3
|
+
export function getContrastColor(bg, options = ['#FFFFFF', '#666666'], tolerance = 2.5) {
|
|
4
|
+
if (!options.length) return '#666666'
|
|
5
|
+
|
|
6
|
+
return tinycolor.mostReadable(bg, options).toHexString()
|
|
7
|
+
|
|
8
|
+
// const contrasts = options.map((color) => ({
|
|
9
|
+
// color,
|
|
10
|
+
// contrast: tinycolor.readability(bg, color),
|
|
11
|
+
// }))
|
|
12
|
+
|
|
13
|
+
// contrasts.sort((a, b) => b.contrast - a.contrast)
|
|
14
|
+
|
|
15
|
+
// if (contrasts.length > 1 && Math.abs(contrasts[0].contrast - contrasts[1].contrast) < tolerance) {
|
|
16
|
+
// return options[0]
|
|
17
|
+
// }
|
|
18
|
+
|
|
19
|
+
// return contrasts[0].color
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const 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
|
+
const COLORS = [...BASE_COLORS, ...BASE_COLORS.map((c) => `${c}+10`), ...BASE_COLORS.map((c) => `${c}-10`)]
|
|
19
|
+
|
|
20
|
+
export function getDynamicColor(id) {
|
|
21
|
+
let num
|
|
22
|
+
if (typeof id === 'number') {
|
|
23
|
+
num = id
|
|
24
|
+
} else {
|
|
25
|
+
num = String(id)
|
|
26
|
+
.split('')
|
|
27
|
+
.reduce((acc, char) => acc + char.charCodeAt(0), 0)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const index = num % COLORS.length
|
|
31
|
+
return COLORS[index]
|
|
32
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getThemeValue } from './relatedScales'
|
|
2
|
+
|
|
3
|
+
export function mergePreset(presets, key, props, defaultKey) {
|
|
4
|
+
if (!key) return props
|
|
5
|
+
const preset = getThemeValue(presets, key, false) || getThemeValue(presets, defaultKey, {})
|
|
6
|
+
return { ...props, ...preset }
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { is } from 'ramda'
|
|
2
|
+
|
|
3
|
+
const 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((list) => list.includes(key)) || []
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getThemeValue(group, key, defaultValue) {
|
|
20
|
+
defaultValue = defaultValue === undefined ? key : defaultValue
|
|
21
|
+
if (!key) return defaultValue
|
|
22
|
+
let value = group[key]
|
|
23
|
+
if (!!value || !is(String, key)) return value || defaultValue
|
|
24
|
+
|
|
25
|
+
const synonyms = getScaleSynonyms(key)
|
|
26
|
+
for (const synonym of synonyms) {
|
|
27
|
+
if (group?.[synonym]) {
|
|
28
|
+
value = group[synonym]
|
|
29
|
+
break
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return value || defaultValue
|
|
34
|
+
}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { omit } from 'ramda'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const SCALE = ['xxxs', 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl']
|
|
4
|
+
|
|
5
|
+
export function moveScale(value, unit = 1) {
|
|
6
|
+
const index = SCALE.indexOf(value)
|
|
5
7
|
if (!index) return value
|
|
6
|
-
|
|
8
|
+
const movedIndex = index + unit
|
|
9
|
+
let movedValue = SCALE[index + unit]
|
|
10
|
+
if (!movedValue) {
|
|
11
|
+
movedValue = unit > 0 ? 'xxxl' : 'xxxs'
|
|
12
|
+
}
|
|
13
|
+
return movedValue
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function getSizeFromProps({ size, ...props }, defaultValue) {
|
|
17
|
+
if (!!size) return [size, props]
|
|
18
|
+
size = SCALE.find((key) => !!props[key]) || defaultValue
|
|
19
|
+
return [size, omit(SCALE, props)]
|
|
7
20
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { omit } from 'ramda'
|
|
2
|
+
|
|
3
|
+
const SCALE = ['xxxs', 'xxs', 'xs', 'sm', 'p', 'h6', 'h5', 'h4', 'h3', 'h2', 'h1']
|
|
4
|
+
|
|
5
|
+
export function moveTextScale(value, unit = 1) {
|
|
6
|
+
const index = SCALE.indexOf(value)
|
|
7
|
+
if (!index) return value
|
|
8
|
+
return SCALE[index + unit] || value
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getTextFromProps({ size, ...props }, defaultValue) {
|
|
12
|
+
if (!!size) return [size, props]
|
|
13
|
+
size = SCALE.find((key) => !!props[key]) || defaultValue
|
|
14
|
+
return [size, omit(SCALE, props)]
|
|
15
|
+
}
|
package/dist/actions/Button.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/actions/Button.js";var _excluded=["label","style","textProps","size"];import{pipe}from'ramda';import{AbsTouchableOpacity}from"../abstractions/TouchableOpacity";import{Text}from"../text/Text";import{useBackgroundModifier}from"../modifiers/background";import{useBorderModifier}from"../modifiers/border";import{useFlexModifier}from"../modifiers/flex";import{useFlexWrapperModifier}from"../modifiers/flexWrapper";import{useFullColorModifier}from"../modifiers/fullColor.js";import{useMarginModifier}from"../modifiers/margin";import{useMergeThemeComponent}from"../theme/ThemeHandler";import{usePaddingModifier}from"../modifiers/padding";import{usePositionModifier}from"../modifiers/position";import{useSizeModifier}from"../modifiers/size";import{jsx as _jsx}from"react/jsx-runtime";export function Button(rootProps){var _useMergeThemeCompone=useMergeThemeComponent('Button',rootProps),label=_useMergeThemeCompone.label,style=_useMergeThemeCompone.style,textProps=_useMergeThemeCompone.textProps,_useMergeThemeCompone2=_useMergeThemeCompone.size,size=_useMergeThemeCompone2===void 0?'md':_useMergeThemeCompone2,props=_objectWithoutProperties(_useMergeThemeCompone,_excluded);var defaultProps={paddingH:size,paddingV:2,height:size,br:size,borderWidth:1,color:'primary',center:true,row:true};var _useFullColorModifier=useFullColorModifier(Object.assign({},defaultProps,props,{style:style})),_useFullColorModifier2=_slicedToArray(_useFullColorModifier,2),fontColor=_useFullColorModifier2[0],formattedProps=_useFullColorModifier2[1];props=pipe(useSizeModifier,usePositionModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useFlexWrapperModifier,useBackgroundModifier,useBorderModifier)(formattedProps);return _jsx(AbsTouchableOpacity,Object.assign({className:"neko-button neko-wave-click-effect"},props,{children:_jsx(Text,Object.assign({center:true,color:fontColor,strong:true,size:size},textProps,{children:label}))}));}
|
package/dist/actions/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./Button";
|
package/dist/form/Form.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/form/Form.js";import React from'react';import{FormWrapperComponent}from"./FormWrapperComponent";import{jsx as _jsx}from"react/jsx-runtime";var FormContext=React.createContext(null);export var useFormInstance=function useFormInstance(){return React.useContext(FormContext);};export function Form(_ref){var form=_ref.form,children=_ref.children;return _jsx(FormContext.Provider,{value:form,children:_jsx(FormWrapperComponent,{form:form,children:children})});}
|
package/dist/form/FormGroup.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/form/FormGroup.js";import React from'react';import{jsx as _jsx}from"react/jsx-runtime";var FormGroupContext=React.createContext(null);var useGroupPath=function useGroupPath(){var _React$useContext;return((_React$useContext=React.useContext(FormGroupContext))==null?void 0:_React$useContext.path)||[];};export function useRelativePath(name,opts){var relative=opts.relative;var listPath=!!name?Array.isArray(name)?name:[name]:[];var parentPath=useGroupPath();if(!relative)return listPath;return[].concat(_toConsumableArray(parentPath),_toConsumableArray(listPath));}export function FormGroup(_ref){var name=_ref.name;var path=useRelativePath(name,{relative:true});var value={path:path};return _jsx(FormGroupContext.Provider,{value:value,children:children});}
|
package/dist/form/FormItem.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/form/FormItem.js";import{Text}from"react-native-web";import React from'react';import{FormGroup,useRelativePath}from"./FormGroup";import{useFormInstance}from"./Form";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function FormItem(_ref){var name=_ref.name,relative=_ref.relative,children=_ref.children;var form=useFormInstance();var listPath=useRelativePath(name,{relative:relative});var _React$useState=React.useState(form.getFieldValue(listPath)),_React$useState2=_slicedToArray(_React$useState,2),value=_React$useState2[0],setValue=_React$useState2[1];var error=form.getError(listPath);React.useEffect(function(){return form.registerListener(listPath,function(val){return setValue(val);});},[listPath.join('$NEKOJOIN$')]);var handleChange=function handleChange(e){var _e$target$value,_e$target;var val=(_e$target$value=e==null?void 0:(_e$target=e.target)==null?void 0:_e$target.value)!=null?_e$target$value:e;form.setFieldValue(listPath,val);};var child=React.Children.only(children);var childWithProps=React.cloneElement(child,{value:value,onChange:handleChange});return _jsxs(FormGroup,{name:listPath,children:[childWithProps,error&&_jsx(Text,{style:{color:'red'},children:error})]});}
|
package/dist/form/FormList.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/form/FormList.js";import{Text}from"react-native-web";import React from'react';import{FormGroup,useRelativePath}from"./FormGroup";import{useFormInstance}from"./Form";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var FormListContext=React.createContext(null);var useFormList=function useFormList(){return React.useContext(FormListContext);};export function FormList(_ref){var name=_ref.name,relative=_ref.relative,children=_ref.children;var form=useFormInstance();var listPath=useRelativePath(name,{relative:relative});var listPathStr=listPath.join('$NEKOJOIN$');var error=form.getError(listPath);var _React$useState=React.useState(function(){var initial=form.getFieldValue(listPath)||[];return initial.map(function(_,index){return{key:index,name:index};});}),_React$useState2=_slicedToArray(_React$useState,2),fields=_React$useState2[0],setFields=_React$useState2[1];React.useEffect(function(){return form.registerListener(listPath,function(val){if(Array.isArray(val)){setFields(val.map(function(_,index){return{key:index,name:index};}));}});},[listPathStr]);var add=function add(){var defaultValue=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var current=form.getFieldValue(listPath)||[];form.setFieldValue(listPath,[].concat(_toConsumableArray(current),[defaultValue]));};var addOn=function addOn(index){var defaultValue=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var current=form.getFieldValue(listPath)||[];form.setFieldValue(listPath,[].concat(_toConsumableArray(current.slice(0,index)),[defaultValue],_toConsumableArray(current.slice(index))));};var replace=function replace(index,value){var current=form.getFieldValue(listPath)||[];form.setFieldValue(listPath,current.map(function(item,i){return i===index?value:item;}));};var move=function move(fromIndex,toIndex){var current=form.getFieldValue(listPath)||[];if(fromIndex<0||fromIndex>=current.length)return;if(toIndex<0||toIndex>=current.length)return;var item=current[fromIndex];var updated=_toConsumableArray(current);updated.splice(fromIndex,1);updated.splice(toIndex,0,item);form.setFieldValue(listPath,updated);};var remove=function remove(index){var current=form.getFieldValue(listPath)||[];form.setFieldValue(listPath,current.filter(function(_,i){return i!==index;}));};var actions=React.useMemo(function(){return{add:add,addOn:addOn,replace:replace,remove:remove,move:move};},[listPathStr]);return _jsx(FormGroup,{name:listPath,children:_jsxs(FormListContext.Provider,{value:actions,children:[typeof children==='function'?children(fields,actions):React.cloneElement(React.Children.only(children),Object.assign({fields:fields},actions)),error&&_jsx(Text,{style:{color:'red'},children:error})]})});}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/form/FormWrapperComponent.js";var _excluded=["children","form"];import{jsx as _jsx}from"react/jsx-runtime";export function FormWrapperComponent(_ref){var children=_ref.children,form=_ref.form,props=_objectWithoutProperties(_ref,_excluded);var handleSubmit=function handleSubmit(e){e.preventDefault();form.handleSubmit();};return _jsx("form",{onSubmit:handleSubmit,children:children});}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["children"];import React from'react';export function FormWrapperComponent(_ref){var children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);return children;}
|
package/dist/form/useForm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{assocPath,path}from'ramda';import React from'react';export function useForm(){var _ref=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref$initialValues=_ref.initialValues,initialValues=_ref$initialValues===void 0?{}:_ref$initialValues,validate=_ref.validate;var valuesRef=React.useRef(Object.assign({},initialValues));var errorsRef=React.useRef({});var listenersRef=React.useRef({});var notify=function notify(name){var key=Array.isArray(name)?name.join('.'):name;if(listenersRef.current[key]){listenersRef.current[key].forEach(function(cb){return cb(path(name,valuesRef.current));});}};var setFieldValue=function setFieldValue(name,value){valuesRef.current=assocPath(name,value,valuesRef.current);notify(name);};var getFieldValue=function getFieldValue(name){return path(name,valuesRef.current);};var getError=function getError(name){return path(name,errorsRef.current);};var setError=function setError(name,error){errorsRef.current=assocPath(name,error,errorsRef.current);};var registerListener=function registerListener(name,cb){var key=Array.isArray(name)?name.join('.'):name;if(!listenersRef.current[key]){listenersRef.current[key]=[];}listenersRef.current[key].push(cb);return function(){listenersRef.current[key]=listenersRef.current[key].filter(function(fn){return fn!==cb;});};};var validateForm=function validateForm(){if(!validate)return true;var newErrors=validate(valuesRef.current)||{};errorsRef.current=newErrors;return Object.keys(newErrors).length===0;};var handleSubmit=function handleSubmit(onValid){return function(){var isValid=validateForm();if(isValid){onValid(valuesRef.current);}};};return{setFieldValue:setFieldValue,getFieldValue:getFieldValue,getError:getError,setError:setError,registerListener:registerListener,handleSubmit:handleSubmit,valuesRef:valuesRef};}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["color","outline"];import tinycolor from'tinycolor2';import{useGetColor}from"../theme/ThemeHandler";export function useFullColorModifier(props){var getColor=useGetColor();var color=props.color,outline=props.outline,restProps=_objectWithoutProperties(props,_excluded);var bg=color;var bgObj=tinycolor(getColor(bg));var borderColor=color;var textColor='text';var textColorObj=tinycolor(getColor('text'));if(!!outline){bg='transparent';textColor=color;}else if(bgObj.isDark()===textColorObj.isDark()){textColor='overlayBG';}return[textColor,Object.assign({},restProps,{bg:bg,borderColor:borderColor})];}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/presentation/Icon.js";var _excluded=["name","color"];import{AbsIcon}from"../abstractions/Icon";import{useGetColor,useMergeThemeComponent}from"../theme/ThemeHandler";import{jsx as _jsx}from"react/jsx-runtime";export function Icon(_ref){var name=_ref.name,color=_ref.color,rootProps=_objectWithoutProperties(_ref,_excluded);var getColor=useGetColor();var props=useMergeThemeComponent('Icon',rootProps);return _jsx(AbsIcon,Object.assign({className:"neko-icon",name:name,color:getColor(color||'text')},props));}
|
package/dist/presentation/Tag.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/presentation/Tag.js";var _excluded=["label","style","textProps","size"];import{Text}from"../text/Text";import{View}from"../structure/View";import{moveScaleDown}from"../theme/helpers/sizeScale";import{useFullColorModifier}from"../modifiers/fullColor.js";import{useMergeThemeComponent}from"../theme/ThemeHandler";import{jsx as _jsx}from"react/jsx-runtime";export function Tag(rootProps){var _useMergeThemeCompone=useMergeThemeComponent('Button',rootProps),label=_useMergeThemeCompone.label,style=_useMergeThemeCompone.style,textProps=_useMergeThemeCompone.textProps,_useMergeThemeCompone2=_useMergeThemeCompone.size,size=_useMergeThemeCompone2===void 0?'md':_useMergeThemeCompone2,props=_objectWithoutProperties(_useMergeThemeCompone,_excluded);var oneSizeDown=moveScaleDown(size,1);var twoSizeDown=moveScaleDown(size,2);var threeSizeDown=moveScaleDown(size,3);var defaultProps={paddingH:twoSizeDown,padding:threeSizeDown,outline:true,br:threeSizeDown,borderWidth:1,color:'primary',center:true};var _useFullColorModifier=useFullColorModifier(Object.assign({},defaultProps,props,{style:style})),_useFullColorModifier2=_slicedToArray(_useFullColorModifier,2),fontColor=_useFullColorModifier2[0],formattedProps=_useFullColorModifier2[1];return _jsx(View,{className:"neko-tag",row:true,children:_jsx(View,Object.assign({className:"neko-tag-inner"},formattedProps,{children:_jsx(Text,Object.assign({strong:true,center:true,color:fontColor,size:oneSizeDown},textProps,{children:label}))}))});}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./Tag";export*from"./Icon";
|
package/dist/structure/Card.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/structure/Card.js";var _excluded=["children"];import{pipe}from'ramda';import{AbsView}from"../abstractions/View";import{useBackgroundModifier}from"../modifiers/background";import{useBorderModifier}from"../modifiers/border";import{useFlexModifier}from"../modifiers/flex";import{useFlexWrapperModifier}from"../modifiers/flexWrapper";import{useMarginModifier}from"../modifiers/margin";import{useMergeThemeComponent}from"../theme/ThemeHandler";import{usePaddingModifier}from"../modifiers/padding";import{usePositionModifier}from"../modifiers/position";import{useShadowModifier}from"../modifiers/shadow";import{useSizeModifier}from"../modifiers/size";import{jsx as _jsx}from"react/jsx-runtime";export function Card(_ref){var children=_ref.children,rootProps=_objectWithoutProperties(_ref,_excluded);var props=useMergeThemeComponent('Card',rootProps);var defaultProps={padding:'md',br:'xlg',bg:'overlayBG'};props=pipe(useSizeModifier,usePositionModifier,usePaddingModifier,useMarginModifier,useFlexWrapperModifier,useFlexModifier,useBackgroundModifier,useBorderModifier,useShadowModifier)(Object.assign({},defaultProps,props));return _jsx(AbsView,Object.assign({className:"neko-card"},props,{children:children}));}
|
package/dist/structure/View.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/structure/View.js";var _excluded=["children"];import{pipe}from'ramda';import{AbsView}from"../abstractions/View";import{useBackgroundModifier}from"../modifiers/background";import{useBorderModifier}from"../modifiers/border";import{useFlexModifier}from"../modifiers/flex";import{useFlexWrapperModifier}from"../modifiers/flexWrapper";import{useMarginModifier}from"../modifiers/margin";import{useMergeThemeComponent}from"../theme/ThemeHandler";import{usePaddingModifier}from"../modifiers/padding";import{usePositionModifier}from"../modifiers/position";import{useShadowModifier}from"../modifiers/shadow";import{useSizeModifier}from"../modifiers/size";import{jsx as _jsx}from"react/jsx-runtime";export function View(_ref){var children=_ref.children,rootProps=_objectWithoutProperties(_ref,_excluded);var props=useMergeThemeComponent('View',rootProps);props=pipe(useSizeModifier,usePositionModifier,usePaddingModifier,useMarginModifier,useFlexWrapperModifier,useFlexModifier,useBackgroundModifier,useBorderModifier,useShadowModifier)(props);return _jsx(AbsView,Object.assign({className:"neko-view"},props,{children:children}));}
|
package/dist/structure/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./View";export*from"./Card";
|
package/dist/text/Text.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/Users/christianstorch/Apps/nekoapps/libs/neko-ui/src/text/Text.js";var _excluded=["children"];import{pipe}from'ramda';import{AbsText}from"../abstractions/Text";import{useFlexModifier}from"../modifiers/flex";import{useMarginModifier}from"../modifiers/margin";import{usePaddingModifier}from"../modifiers/padding";import{useSizeModifier}from"../modifiers/size";import{useTextModifier}from"../modifiers/text";import{jsx as _jsx}from"react/jsx-runtime";export function Text(_ref){var children=_ref.children,props=_objectWithoutProperties(_ref,_excluded);props=pipe(useSizeModifier,usePaddingModifier,useMarginModifier,useFlexModifier,useTextModifier)(props);return _jsx(AbsText,Object.assign({},props,{children:children}));}
|
package/dist/text/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./Text";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var BASE_THEME={spaces:{xxsm:3,xsm:5,sm:10,md:15,lg:20,xlg:30},radius:{xsm:5,sm:7,md:8,lg:10,xlg:12},elementHeights:{xsm:20,sm:30,md:35,lg:50,xlg:60},texts:{h1:{fontSize:32,strong:true},h2:{fontSize:26,strong:true},h3:{fontSize:22,strong:true},h4:{fontSize:18,strong:true},h5:{fontSize:16,strong:true},h6:{fontSize:14,strong:true},p:{fontSize:14},sm:{fontSize:12},xsm:{fontSize:10},xxsm:{fontSize:8}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{BASE_THEME as MOBILE_BASE_THEME}from"./base.native";export var BASE_THEME=MOBILE_BASE_THEME;
|
package/src/actions/Button.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { pipe } from 'ramda'
|
|
2
|
-
|
|
3
|
-
import { AbsTouchableOpacity } from '../abstractions/TouchableOpacity'
|
|
4
|
-
import { Text } from '../text/Text'
|
|
5
|
-
import { useBackgroundModifier } from '../modifiers/background'
|
|
6
|
-
import { useBorderModifier } from '../modifiers/border'
|
|
7
|
-
import { useFlexModifier } from '../modifiers/flex'
|
|
8
|
-
import { useFlexWrapperModifier } from '../modifiers/flexWrapper'
|
|
9
|
-
import { useFullColorModifier } from '../modifiers/fullColor.js'
|
|
10
|
-
import { useMarginModifier } from '../modifiers/margin'
|
|
11
|
-
import { useMergeThemeComponent } from '../theme/ThemeHandler'
|
|
12
|
-
import { usePaddingModifier } from '../modifiers/padding'
|
|
13
|
-
import { usePositionModifier } from '../modifiers/position'
|
|
14
|
-
import { useSizeModifier } from '../modifiers/size'
|
|
15
|
-
|
|
16
|
-
export function Button(rootProps) {
|
|
17
|
-
let { label, style, textProps, size = 'md', ...props } = useMergeThemeComponent('Button', rootProps)
|
|
18
|
-
const defaultProps = {
|
|
19
|
-
paddingH: size,
|
|
20
|
-
paddingV: 2,
|
|
21
|
-
height: size,
|
|
22
|
-
br: size,
|
|
23
|
-
borderWidth: 1,
|
|
24
|
-
color: 'primary',
|
|
25
|
-
center: true,
|
|
26
|
-
row: true,
|
|
27
|
-
}
|
|
28
|
-
const [fontColor, formattedProps] = useFullColorModifier({ ...defaultProps, ...props, style })
|
|
29
|
-
|
|
30
|
-
props = pipe(
|
|
31
|
-
useSizeModifier, //
|
|
32
|
-
usePositionModifier,
|
|
33
|
-
usePaddingModifier,
|
|
34
|
-
useMarginModifier,
|
|
35
|
-
useFlexModifier,
|
|
36
|
-
useFlexWrapperModifier,
|
|
37
|
-
useBackgroundModifier,
|
|
38
|
-
useBorderModifier
|
|
39
|
-
)(formattedProps)
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<AbsTouchableOpacity className="neko-button neko-wave-click-effect" {...props}>
|
|
43
|
-
<Text center color={fontColor} strong size={size} {...textProps}>
|
|
44
|
-
{label}
|
|
45
|
-
</Text>
|
|
46
|
-
</AbsTouchableOpacity>
|
|
47
|
-
)
|
|
48
|
-
}
|
package/src/actions/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Button'
|
package/src/form/Form.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { FormWrapperComponent } from './FormWrapperComponent'
|
|
4
|
-
|
|
5
|
-
const FormContext = React.createContext(null)
|
|
6
|
-
export const useFormInstance = () => React.useContext(FormContext)
|
|
7
|
-
|
|
8
|
-
export function Form({ form, children }) {
|
|
9
|
-
return (
|
|
10
|
-
<FormContext.Provider value={form}>
|
|
11
|
-
<FormWrapperComponent form={form}>{children}</FormWrapperComponent>
|
|
12
|
-
</FormContext.Provider>
|
|
13
|
-
)
|
|
14
|
-
}
|
package/src/form/FormItem.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Text } from 'react-native'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { FormGroup, useRelativePath } from './FormGroup'
|
|
5
|
-
import { useFormInstance } from './Form'
|
|
6
|
-
|
|
7
|
-
export function FormItem({ name, relative, children }) {
|
|
8
|
-
const form = useFormInstance()
|
|
9
|
-
const listPath = useRelativePath(name, { relative })
|
|
10
|
-
const [value, setValue] = React.useState(form.getFieldValue(listPath))
|
|
11
|
-
const error = form.getError(listPath)
|
|
12
|
-
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
return form.registerListener(listPath, (val) => setValue(val))
|
|
15
|
-
}, [listPath.join('$NEKOJOIN$')])
|
|
16
|
-
|
|
17
|
-
const handleChange = (e) => {
|
|
18
|
-
const val = e?.target?.value ?? e
|
|
19
|
-
form.setFieldValue(listPath, val)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const child = React.Children.only(children)
|
|
23
|
-
const childWithProps = React.cloneElement(child, {
|
|
24
|
-
value,
|
|
25
|
-
onChange: handleChange,
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<FormGroup name={listPath}>
|
|
30
|
-
{childWithProps}
|
|
31
|
-
{error && <Text style={{ color: 'red' }}>{error}</Text>}
|
|
32
|
-
</FormGroup>
|
|
33
|
-
)
|
|
34
|
-
}
|
package/src/form/useForm.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { assocPath, path } from 'ramda'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
export function useForm({ initialValues = {}, validate } = {}) {
|
|
5
|
-
const valuesRef = React.useRef({ ...initialValues })
|
|
6
|
-
const errorsRef = React.useRef({})
|
|
7
|
-
const listenersRef = React.useRef({})
|
|
8
|
-
|
|
9
|
-
const notify = (name) => {
|
|
10
|
-
const key = Array.isArray(name) ? name.join('.') : name
|
|
11
|
-
if (listenersRef.current[key]) {
|
|
12
|
-
listenersRef.current[key].forEach((cb) => cb(path(name, valuesRef.current)))
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const setFieldValue = (name, value) => {
|
|
17
|
-
valuesRef.current = assocPath(name, value, valuesRef.current)
|
|
18
|
-
notify(name)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const getFieldValue = (name) => path(name, valuesRef.current)
|
|
22
|
-
|
|
23
|
-
const getError = (name) => path(name, errorsRef.current)
|
|
24
|
-
|
|
25
|
-
const setError = (name, error) => {
|
|
26
|
-
errorsRef.current = assocPath(name, error, errorsRef.current)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const registerListener = (name, cb) => {
|
|
30
|
-
const key = Array.isArray(name) ? name.join('.') : name
|
|
31
|
-
if (!listenersRef.current[key]) {
|
|
32
|
-
listenersRef.current[key] = []
|
|
33
|
-
}
|
|
34
|
-
listenersRef.current[key].push(cb)
|
|
35
|
-
return () => {
|
|
36
|
-
listenersRef.current[key] = listenersRef.current[key].filter((fn) => fn !== cb)
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const validateForm = () => {
|
|
41
|
-
if (!validate) return true
|
|
42
|
-
const newErrors = validate(valuesRef.current) || {}
|
|
43
|
-
errorsRef.current = newErrors
|
|
44
|
-
return Object.keys(newErrors).length === 0
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const handleSubmit = (onValid) => {
|
|
48
|
-
return () => {
|
|
49
|
-
const isValid = validateForm()
|
|
50
|
-
if (isValid) {
|
|
51
|
-
onValid(valuesRef.current)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
setFieldValue,
|
|
58
|
-
getFieldValue,
|
|
59
|
-
getError,
|
|
60
|
-
setError,
|
|
61
|
-
registerListener,
|
|
62
|
-
handleSubmit,
|
|
63
|
-
valuesRef,
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import tinycolor from 'tinycolor2'
|
|
2
|
-
|
|
3
|
-
import { useGetColor } from '../theme/ThemeHandler'
|
|
4
|
-
|
|
5
|
-
export function useFullColorModifier(props) {
|
|
6
|
-
const getColor = useGetColor()
|
|
7
|
-
let { color, outline, ...restProps } = props
|
|
8
|
-
|
|
9
|
-
let bg = color
|
|
10
|
-
const bgObj = tinycolor(getColor(bg))
|
|
11
|
-
let borderColor = color
|
|
12
|
-
let textColor = 'text'
|
|
13
|
-
let textColorObj = tinycolor(getColor('text'))
|
|
14
|
-
|
|
15
|
-
if (!!outline) {
|
|
16
|
-
bg = 'transparent'
|
|
17
|
-
textColor = color
|
|
18
|
-
} else if (bgObj.isDark() === textColorObj.isDark()) {
|
|
19
|
-
textColor = 'overlayBG'
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return [
|
|
23
|
-
textColor,
|
|
24
|
-
{
|
|
25
|
-
...restProps,
|
|
26
|
-
bg,
|
|
27
|
-
borderColor,
|
|
28
|
-
},
|
|
29
|
-
]
|
|
30
|
-
}
|
package/src/presentation/Icon.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AbsIcon } from '../abstractions/Icon'
|
|
2
|
-
import { useGetColor, useMergeThemeComponent } from '../theme/ThemeHandler'
|
|
3
|
-
|
|
4
|
-
export function Icon({ name, color, ...rootProps }) {
|
|
5
|
-
const getColor = useGetColor()
|
|
6
|
-
let props = useMergeThemeComponent('Icon', rootProps)
|
|
7
|
-
|
|
8
|
-
// props = pipe(
|
|
9
|
-
// useSizeModifier, //
|
|
10
|
-
// usePositionModifier,
|
|
11
|
-
// )(props)
|
|
12
|
-
|
|
13
|
-
return <AbsIcon className="neko-icon" name={name} color={getColor(color || 'text')} {...props} />
|
|
14
|
-
}
|