@nexara/nativeflow 0.1.6 → 0.1.8
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 +1 -1
- package/lib/commonjs/components/Avatar/AvatarImage.js +3 -9
- package/lib/commonjs/components/Avatar/AvatarImage.js.map +1 -1
- package/lib/commonjs/components/Avatar/AvatarText.js +2 -4
- package/lib/commonjs/components/Avatar/AvatarText.js.map +1 -1
- package/lib/commonjs/components/Button/Button.js +24 -23
- package/lib/commonjs/components/Button/Button.js.map +1 -1
- package/lib/commonjs/components/Button/utils.js +34 -27
- package/lib/commonjs/components/Button/utils.js.map +1 -1
- package/lib/commonjs/components/CheckBox/CheckBox.js +43 -39
- package/lib/commonjs/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/commonjs/components/Chip/Chip.js +21 -25
- package/lib/commonjs/components/Chip/Chip.js.map +1 -1
- package/lib/commonjs/components/Chip/utils.js +31 -18
- package/lib/commonjs/components/Chip/utils.js.map +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js +14 -10
- package/lib/commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogBody.js +7 -7
- package/lib/commonjs/components/Dialog/DialogBody.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogDescription.js +7 -9
- package/lib/commonjs/components/Dialog/DialogDescription.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogFoot.js +13 -16
- package/lib/commonjs/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogHead.js +22 -27
- package/lib/commonjs/components/Dialog/DialogHead.js.map +1 -1
- package/lib/commonjs/components/Divider/Divider.js +4 -8
- package/lib/commonjs/components/Divider/Divider.js.map +1 -1
- package/lib/commonjs/components/Grid/Grid.js +3 -4
- package/lib/commonjs/components/Grid/Grid.js.map +1 -1
- package/lib/commonjs/components/Icon/Icon.js +4 -5
- package/lib/commonjs/components/Icon/Icon.js.map +1 -1
- package/lib/commonjs/components/IconButton/IconButton.js +21 -20
- package/lib/commonjs/components/IconButton/IconButton.js.map +1 -1
- package/lib/commonjs/components/Link/Link.js +13 -17
- package/lib/commonjs/components/Link/Link.js.map +1 -1
- package/lib/commonjs/components/Menu/Menu.js +14 -9
- package/lib/commonjs/components/Menu/Menu.js.map +1 -1
- package/lib/commonjs/components/Menu/MenuItem.js +3 -5
- package/lib/commonjs/components/Menu/MenuItem.js.map +1 -1
- package/lib/commonjs/components/Menu/MenuItemLabel.js +2 -8
- package/lib/commonjs/components/Menu/MenuItemLabel.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalContext.js +1 -2
- package/lib/commonjs/components/Portal/PortalContext.js.map +1 -1
- package/lib/commonjs/components/Portal/PortalProvider.js +1 -2
- package/lib/commonjs/components/Portal/PortalProvider.js.map +1 -1
- package/lib/commonjs/components/Progress/Progress.js +6 -7
- package/lib/commonjs/components/Progress/Progress.js.map +1 -1
- package/lib/commonjs/components/Provider/ContextManager.js +16 -0
- package/lib/commonjs/components/Provider/ContextManager.js.map +1 -0
- package/lib/commonjs/components/Provider/NativeProvider.js +18 -9
- package/lib/commonjs/components/Provider/NativeProvider.js.map +1 -1
- package/lib/commonjs/components/Radio/RadioGroup.js +46 -0
- package/lib/commonjs/components/Radio/RadioGroup.js.map +1 -0
- package/lib/commonjs/components/Radio/RadioItem.js +77 -0
- package/lib/commonjs/components/Radio/RadioItem.js.map +1 -0
- package/lib/commonjs/components/Radio/index.js +15 -0
- package/lib/commonjs/components/Radio/index.js.map +1 -0
- package/lib/commonjs/components/Slider/Slider.js +4 -4
- package/lib/commonjs/components/Slider/Slider.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +3 -9
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +4 -10
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/StyledText.js +20 -9
- package/lib/commonjs/components/StyledComponents/StyledText.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/StyledView.js +6 -8
- package/lib/commonjs/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/commonjs/components/Surface/Surface.js +24 -21
- package/lib/commonjs/components/Surface/Surface.js.map +1 -1
- package/lib/commonjs/components/Switch/Switch.js +13 -10
- package/lib/commonjs/components/Switch/Switch.js.map +1 -1
- package/lib/commonjs/components/UserInput/UserInput.js +23 -18
- package/lib/commonjs/components/UserInput/UserInput.js.map +1 -1
- package/lib/commonjs/components/UserInput/generateColors.js +3 -3
- package/lib/commonjs/components/UserInput/generateColors.js.map +1 -1
- package/lib/commonjs/constants/typographySizes.js +11 -7
- package/lib/commonjs/constants/typographySizes.js.map +1 -1
- package/lib/commonjs/helpers/ResponsiveCalculations.js +47 -53
- package/lib/commonjs/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/commonjs/hooks/index.js +3 -3
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/{useResponsive.js → useScalingMode.js} +3 -3
- package/lib/commonjs/hooks/useScalingMode.js.map +1 -0
- package/lib/commonjs/index.d.js +2 -0
- package/lib/commonjs/index.d.js.map +1 -0
- package/lib/commonjs/index.js +27 -40
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/themes/DarkTheme.js +185 -25
- package/lib/commonjs/themes/DarkTheme.js.map +1 -1
- package/lib/commonjs/themes/LightTheme.js +89 -81
- package/lib/commonjs/themes/LightTheme.js.map +1 -1
- package/lib/commonjs/types/divider.type.js +6 -0
- package/lib/commonjs/types/divider.type.js.map +1 -0
- package/lib/commonjs/types/index.js +44 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/link.type.js +6 -0
- package/lib/commonjs/types/link.type.js.map +1 -0
- package/lib/commonjs/types/radio.type.js +6 -0
- package/lib/commonjs/types/radio.type.js.map +1 -0
- package/lib/commonjs/types/surface.type.js +6 -0
- package/lib/commonjs/types/surface.type.js.map +1 -0
- package/lib/commonjs/utils/index.js +2 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/components/Avatar/AvatarImage.js +3 -8
- package/lib/module/components/Avatar/AvatarImage.js.map +1 -1
- package/lib/module/components/Avatar/AvatarText.js +2 -3
- package/lib/module/components/Avatar/AvatarText.js.map +1 -1
- package/lib/module/components/Button/Button.js +23 -22
- package/lib/module/components/Button/Button.js.map +1 -1
- package/lib/module/components/Button/utils.js +34 -27
- package/lib/module/components/Button/utils.js.map +1 -1
- package/lib/module/components/CheckBox/CheckBox.js +37 -31
- package/lib/module/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/module/components/Chip/Chip.js +22 -26
- package/lib/module/components/Chip/Chip.js.map +1 -1
- package/lib/module/components/Chip/utils.js +30 -18
- package/lib/module/components/Chip/utils.js.map +1 -1
- package/lib/module/components/Dialog/Dialog.js +13 -8
- package/lib/module/components/Dialog/Dialog.js.map +1 -1
- package/lib/module/components/Dialog/DialogBody.js +9 -8
- package/lib/module/components/Dialog/DialogBody.js.map +1 -1
- package/lib/module/components/Dialog/DialogDescription.js +8 -9
- package/lib/module/components/Dialog/DialogDescription.js.map +1 -1
- package/lib/module/components/Dialog/DialogFoot.js +14 -16
- package/lib/module/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/module/components/Dialog/DialogHead.js +24 -28
- package/lib/module/components/Dialog/DialogHead.js.map +1 -1
- package/lib/module/components/Divider/Divider.js +5 -8
- package/lib/module/components/Divider/Divider.js.map +1 -1
- package/lib/module/components/Grid/Grid.js +4 -3
- package/lib/module/components/Grid/Grid.js.map +1 -1
- package/lib/module/components/Icon/Icon.js +3 -3
- package/lib/module/components/Icon/Icon.js.map +1 -1
- package/lib/module/components/IconButton/IconButton.js +20 -19
- package/lib/module/components/IconButton/IconButton.js.map +1 -1
- package/lib/module/components/Link/Link.js +15 -19
- package/lib/module/components/Link/Link.js.map +1 -1
- package/lib/module/components/Menu/Menu.js +14 -8
- package/lib/module/components/Menu/Menu.js.map +1 -1
- package/lib/module/components/Menu/MenuItem.js +4 -5
- package/lib/module/components/Menu/MenuItem.js.map +1 -1
- package/lib/module/components/Menu/MenuItemLabel.js +2 -7
- package/lib/module/components/Menu/MenuItemLabel.js.map +1 -1
- package/lib/module/components/Progress/Progress.js +7 -6
- package/lib/module/components/Progress/Progress.js.map +1 -1
- package/lib/module/components/Provider/ContextManager.js +10 -0
- package/lib/module/components/Provider/ContextManager.js.map +1 -0
- package/lib/module/components/Provider/NativeProvider.js +17 -7
- package/lib/module/components/Provider/NativeProvider.js.map +1 -1
- package/lib/module/components/Radio/RadioGroup.js +41 -0
- package/lib/module/components/Radio/RadioGroup.js.map +1 -0
- package/lib/module/components/Radio/RadioItem.js +73 -0
- package/lib/module/components/Radio/RadioItem.js.map +1 -0
- package/lib/module/components/Radio/index.js +10 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Slider/Slider.js +5 -5
- package/lib/module/components/Slider/Slider.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +3 -7
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +4 -8
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/components/StyledComponents/StyledText.js +20 -8
- package/lib/module/components/StyledComponents/StyledText.js.map +1 -1
- package/lib/module/components/StyledComponents/StyledView.js +6 -7
- package/lib/module/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/module/components/Surface/Surface.js +24 -20
- package/lib/module/components/Surface/Surface.js.map +1 -1
- package/lib/module/components/Switch/Switch.js +14 -11
- package/lib/module/components/Switch/Switch.js.map +1 -1
- package/lib/module/components/UserInput/UserInput.js +24 -19
- package/lib/module/components/UserInput/UserInput.js.map +1 -1
- package/lib/module/components/UserInput/generateColors.js +3 -3
- package/lib/module/components/UserInput/generateColors.js.map +1 -1
- package/lib/module/constants/typographySizes.js +11 -7
- package/lib/module/constants/typographySizes.js.map +1 -1
- package/lib/module/helpers/ResponsiveCalculations.js +46 -48
- package/lib/module/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/module/hooks/index.js +1 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useScalingMode.js +7 -0
- package/lib/module/hooks/useScalingMode.js.map +1 -0
- package/lib/module/index.d.js +2 -0
- package/lib/module/index.d.js.map +1 -0
- package/lib/module/index.js +4 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/themes/DarkTheme.js +188 -24
- package/lib/module/themes/DarkTheme.js.map +1 -1
- package/lib/module/themes/LightTheme.js +88 -81
- package/lib/module/themes/LightTheme.js.map +1 -1
- package/lib/module/themes/index.js +0 -1
- package/lib/module/themes/index.js.map +1 -1
- package/lib/module/types/divider.type.js +4 -0
- package/lib/module/types/divider.type.js.map +1 -0
- package/lib/module/types/index.js +4 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/link.type.js +4 -0
- package/lib/module/types/link.type.js.map +1 -0
- package/lib/module/types/radio.type.js +4 -0
- package/lib/module/types/radio.type.js.map +1 -0
- package/lib/module/types/surface.type.js +4 -0
- package/lib/module/types/surface.type.js.map +1 -0
- package/lib/module/utils/index.js +2 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/commonjs/scripts/generateConfig.d.ts +1 -0
- package/lib/typescript/commonjs/scripts/generateConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/scripts/readConfig.d.ts +1 -0
- package/lib/typescript/commonjs/scripts/readConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Avatar/AvatarImage.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Avatar/AvatarImage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Avatar/AvatarText.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Avatar/AvatarText.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/Button.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/utils.d.ts +0 -1
- package/lib/typescript/commonjs/src/components/Button/utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/CheckBox/CheckBox.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Chip/Chip.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Chip/utils.d.ts +3 -2
- package/lib/typescript/commonjs/src/components/Chip/utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogBody.d.ts +4 -4
- package/lib/typescript/commonjs/src/components/Dialog/DialogBody.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogDescription.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Dialog/DialogDescription.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogFoot.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Dialog/DialogFoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogHead.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Dialog/DialogHead.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Divider/Divider.d.ts +3 -8
- package/lib/typescript/commonjs/src/components/Divider/Divider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Grid/Grid.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Grid/Grid.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts +4 -2
- package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Link/Link.d.ts +3 -10
- package/lib/typescript/commonjs/src/components/Link/Link.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/Menu.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/MenuItem.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/MenuItemLabel.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Menu/MenuItemLabel.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Progress/Progress.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Progress/Progress.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Provider/ContextManager.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/Provider/ContextManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Provider/NativeProvider.d.ts +9 -4
- package/lib/typescript/commonjs/src/components/Provider/NativeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Radio/RadioGroup.d.ts +5 -0
- package/lib/typescript/commonjs/src/components/Radio/RadioGroup.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Radio/RadioItem.d.ts +5 -0
- package/lib/typescript/commonjs/src/components/Radio/RadioItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Radio/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Stack/HStack.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Stack/VStack.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledText.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledText.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledView.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Surface/Surface.d.ts +3 -3
- package/lib/typescript/commonjs/src/components/Surface/Surface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Switch/Switch.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/Switch/Switch.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts +36 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/constants/typographySizes.d.ts +2 -8
- package/lib/typescript/commonjs/src/constants/typographySizes.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts +0 -3
- package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useScalingMode.d.ts +5 -0
- package/lib/typescript/commonjs/src/hooks/useScalingMode.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +5 -5
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/themes/DarkTheme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/themes/LightTheme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/avatar.type.d.ts +0 -2
- package/lib/typescript/commonjs/src/types/avatar.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/button.type.d.ts +20 -20
- package/lib/typescript/commonjs/src/types/button.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/checkbox.type.d.ts +20 -14
- package/lib/typescript/commonjs/src/types/checkbox.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/chip.type.d.ts +21 -13
- package/lib/typescript/commonjs/src/types/chip.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/common.type.d.ts +72 -22
- package/lib/typescript/commonjs/src/types/common.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/dialog.type.d.ts +13 -12
- package/lib/typescript/commonjs/src/types/dialog.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/divider.type.d.ts +11 -0
- package/lib/typescript/commonjs/src/types/divider.type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/grid.type.d.ts +2 -1
- package/lib/typescript/commonjs/src/types/grid.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/link.type.d.ts +12 -0
- package/lib/typescript/commonjs/src/types/link.type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/menu.type.d.ts +4 -16
- package/lib/typescript/commonjs/src/types/menu.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/radio.type.d.ts +61 -0
- package/lib/typescript/commonjs/src/types/radio.type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/stack.type.d.ts +6 -14
- package/lib/typescript/commonjs/src/types/stack.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts +25 -72
- package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/surface.type.d.ts +16 -0
- package/lib/typescript/commonjs/src/types/surface.type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/userInput.type.d.ts +10 -13
- package/lib/typescript/commonjs/src/types/userInput.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/scripts/generateConfig.d.ts +1 -0
- package/lib/typescript/module/scripts/generateConfig.d.ts.map +1 -0
- package/lib/typescript/module/scripts/readConfig.d.ts +1 -0
- package/lib/typescript/module/scripts/readConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Avatar/AvatarImage.d.ts +2 -2
- package/lib/typescript/module/src/components/Avatar/AvatarImage.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Avatar/AvatarText.d.ts +2 -2
- package/lib/typescript/module/src/components/Avatar/AvatarText.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/Button.d.ts +2 -2
- package/lib/typescript/module/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/utils.d.ts +0 -1
- package/lib/typescript/module/src/components/Button/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/components/CheckBox/CheckBox.d.ts +2 -2
- package/lib/typescript/module/src/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Chip/Chip.d.ts +2 -2
- package/lib/typescript/module/src/components/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Chip/utils.d.ts +3 -2
- package/lib/typescript/module/src/components/Chip/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogBody.d.ts +4 -4
- package/lib/typescript/module/src/components/Dialog/DialogBody.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogDescription.d.ts +2 -2
- package/lib/typescript/module/src/components/Dialog/DialogDescription.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogFoot.d.ts +2 -2
- package/lib/typescript/module/src/components/Dialog/DialogFoot.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogHead.d.ts +2 -2
- package/lib/typescript/module/src/components/Dialog/DialogHead.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Divider/Divider.d.ts +3 -8
- package/lib/typescript/module/src/components/Divider/Divider.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Grid/Grid.d.ts +2 -2
- package/lib/typescript/module/src/components/Grid/Grid.d.ts.map +1 -1
- package/lib/typescript/module/src/components/IconButton/IconButton.d.ts +4 -2
- package/lib/typescript/module/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Link/Link.d.ts +3 -10
- package/lib/typescript/module/src/components/Link/Link.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/Menu.d.ts +2 -2
- package/lib/typescript/module/src/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/MenuItem.d.ts +2 -2
- package/lib/typescript/module/src/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/MenuItemLabel.d.ts +2 -2
- package/lib/typescript/module/src/components/Menu/MenuItemLabel.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Progress/Progress.d.ts +2 -2
- package/lib/typescript/module/src/components/Progress/Progress.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Provider/ContextManager.d.ts +3 -0
- package/lib/typescript/module/src/components/Provider/ContextManager.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Provider/NativeProvider.d.ts +9 -4
- package/lib/typescript/module/src/components/Provider/NativeProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Radio/RadioGroup.d.ts +5 -0
- package/lib/typescript/module/src/components/Radio/RadioGroup.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Radio/RadioItem.d.ts +5 -0
- package/lib/typescript/module/src/components/Radio/RadioItem.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Radio/index.d.ts +6 -0
- package/lib/typescript/module/src/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Stack/HStack.d.ts +2 -2
- package/lib/typescript/module/src/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Stack/VStack.d.ts +2 -2
- package/lib/typescript/module/src/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/module/src/components/StyledComponents/StyledText.d.ts +2 -2
- package/lib/typescript/module/src/components/StyledComponents/StyledText.d.ts.map +1 -1
- package/lib/typescript/module/src/components/StyledComponents/StyledView.d.ts +2 -2
- package/lib/typescript/module/src/components/StyledComponents/StyledView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Surface/Surface.d.ts +3 -3
- package/lib/typescript/module/src/components/Surface/Surface.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Switch/Switch.d.ts +2 -2
- package/lib/typescript/module/src/components/Switch/Switch.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserInput/UserInput.d.ts +36 -1
- package/lib/typescript/module/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/module/src/constants/typographySizes.d.ts +2 -8
- package/lib/typescript/module/src/constants/typographySizes.d.ts.map +1 -1
- package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts +0 -3
- package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/index.d.ts +1 -1
- package/lib/typescript/module/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useScalingMode.d.ts +5 -0
- package/lib/typescript/module/src/hooks/useScalingMode.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +5 -5
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/themes/DarkTheme.d.ts.map +1 -1
- package/lib/typescript/module/src/themes/LightTheme.d.ts.map +1 -1
- package/lib/typescript/module/src/types/avatar.type.d.ts +0 -2
- package/lib/typescript/module/src/types/avatar.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/button.type.d.ts +20 -20
- package/lib/typescript/module/src/types/button.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/checkbox.type.d.ts +20 -14
- package/lib/typescript/module/src/types/checkbox.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/chip.type.d.ts +21 -13
- package/lib/typescript/module/src/types/chip.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/common.type.d.ts +72 -22
- package/lib/typescript/module/src/types/common.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/dialog.type.d.ts +13 -12
- package/lib/typescript/module/src/types/dialog.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/divider.type.d.ts +11 -0
- package/lib/typescript/module/src/types/divider.type.d.ts.map +1 -0
- package/lib/typescript/module/src/types/grid.type.d.ts +2 -1
- package/lib/typescript/module/src/types/grid.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/index.d.ts +4 -0
- package/lib/typescript/module/src/types/index.d.ts.map +1 -1
- package/lib/typescript/module/src/types/link.type.d.ts +12 -0
- package/lib/typescript/module/src/types/link.type.d.ts.map +1 -0
- package/lib/typescript/module/src/types/menu.type.d.ts +4 -16
- package/lib/typescript/module/src/types/menu.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/radio.type.d.ts +61 -0
- package/lib/typescript/module/src/types/radio.type.d.ts.map +1 -0
- package/lib/typescript/module/src/types/stack.type.d.ts +6 -14
- package/lib/typescript/module/src/types/stack.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/styledComponents.type.d.ts +25 -72
- package/lib/typescript/module/src/types/styledComponents.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/surface.type.d.ts +16 -0
- package/lib/typescript/module/src/types/surface.type.d.ts.map +1 -0
- package/lib/typescript/module/src/types/userInput.type.d.ts +10 -13
- package/lib/typescript/module/src/types/userInput.type.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +1 -0
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
- package/package.json +9 -4
- package/src/components/Avatar/AvatarImage.tsx +2 -7
- package/src/components/Avatar/AvatarText.tsx +4 -4
- package/src/components/Button/Button.tsx +35 -26
- package/src/components/Button/utils.ts +30 -30
- package/src/components/CheckBox/CheckBox.tsx +33 -29
- package/src/components/Chip/Chip.tsx +25 -32
- package/src/components/Chip/utils.ts +34 -20
- package/src/components/Dialog/Dialog.tsx +11 -6
- package/src/components/Dialog/DialogBody.tsx +13 -13
- package/src/components/Dialog/DialogDescription.tsx +9 -9
- package/src/components/Dialog/DialogFoot.tsx +19 -20
- package/src/components/Dialog/DialogHead.tsx +17 -21
- package/src/components/Divider/Divider.tsx +7 -15
- package/src/components/Grid/Grid.tsx +6 -5
- package/src/components/Icon/Icon.tsx +3 -3
- package/src/components/IconButton/IconButton.tsx +26 -17
- package/src/components/Link/Link.tsx +20 -29
- package/src/components/Menu/Menu.tsx +11 -7
- package/src/components/Menu/MenuItem.tsx +6 -6
- package/src/components/Menu/MenuItemLabel.tsx +4 -9
- package/src/components/Progress/Progress.tsx +8 -7
- package/src/components/Provider/ContextManager.tsx +9 -0
- package/src/components/Provider/NativeProvider.tsx +25 -10
- package/src/components/Radio/RadioGroup.tsx +40 -0
- package/src/components/Radio/RadioItem.tsx +72 -0
- package/src/components/Radio/index.ts +9 -0
- package/src/components/Slider/Slider.tsx +3 -3
- package/src/components/Stack/HStack.tsx +5 -8
- package/src/components/Stack/VStack.tsx +6 -11
- package/src/components/StyledComponents/StyledText.tsx +17 -8
- package/src/components/StyledComponents/StyledView.tsx +7 -8
- package/src/components/Surface/Surface.tsx +20 -27
- package/src/components/Switch/Switch.tsx +12 -10
- package/src/components/UserInput/UserInput.tsx +25 -19
- package/src/components/UserInput/generateColors.ts +3 -3
- package/src/constants/typographySizes.ts +13 -15
- package/src/helpers/ResponsiveCalculations.ts +50 -49
- package/src/hooks/index.ts +1 -1
- package/src/hooks/{useResponsive.tsx → useScalingMode.tsx} +2 -2
- package/src/index.d.ts +3 -0
- package/src/index.ts +7 -7
- package/src/themes/DarkTheme.ts +169 -30
- package/src/themes/LightTheme.ts +78 -85
- package/src/themes/index.ts +0 -1
- package/src/types/avatar.type.ts +0 -3
- package/src/types/button.type.ts +20 -20
- package/src/types/checkbox.type.ts +22 -15
- package/src/types/chip.type.ts +24 -15
- package/src/types/common.type.ts +82 -23
- package/src/types/dialog.type.ts +15 -14
- package/src/types/divider.type.ts +15 -0
- package/src/types/grid.type.ts +2 -1
- package/src/types/index.ts +5 -1
- package/src/types/link.type.ts +15 -0
- package/src/types/menu.type.ts +4 -19
- package/src/types/radio.type.ts +78 -0
- package/src/types/stack.type.ts +7 -17
- package/src/types/styledComponents.type.ts +27 -75
- package/src/types/surface.type.ts +19 -0
- package/src/types/userInput.type.ts +10 -14
- package/src/utils/index.ts +0 -0
- package/lib/commonjs/components/Header/Header.js +0 -78
- package/lib/commonjs/components/Header/Header.js.map +0 -1
- package/lib/commonjs/helpers/LightenColorShades.js +0 -27
- package/lib/commonjs/helpers/LightenColorShades.js.map +0 -1
- package/lib/commonjs/hooks/useResponsive.js.map +0 -1
- package/lib/commonjs/themes/createTheme.js +0 -25
- package/lib/commonjs/themes/createTheme.js.map +0 -1
- package/lib/module/components/Header/Header.js +0 -73
- package/lib/module/components/Header/Header.js.map +0 -1
- package/lib/module/helpers/LightenColorShades.js +0 -23
- package/lib/module/helpers/LightenColorShades.js.map +0 -1
- package/lib/module/hooks/useResponsive.js +0 -7
- package/lib/module/hooks/useResponsive.js.map +0 -1
- package/lib/module/themes/createTheme.js +0 -25
- package/lib/module/themes/createTheme.js.map +0 -1
- package/lib/typescript/commonjs/src/components/Header/Header.d.ts +0 -16
- package/lib/typescript/commonjs/src/components/Header/Header.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/helpers/LightenColorShades.d.ts +0 -3
- package/lib/typescript/commonjs/src/helpers/LightenColorShades.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useResponsive.d.ts +0 -3
- package/lib/typescript/commonjs/src/hooks/useResponsive.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/themes/createTheme.d.ts +0 -1
- package/lib/typescript/commonjs/src/themes/createTheme.d.ts.map +0 -1
- package/lib/typescript/module/src/components/Header/Header.d.ts +0 -16
- package/lib/typescript/module/src/components/Header/Header.d.ts.map +0 -1
- package/lib/typescript/module/src/helpers/LightenColorShades.d.ts +0 -3
- package/lib/typescript/module/src/helpers/LightenColorShades.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useResponsive.d.ts +0 -3
- package/lib/typescript/module/src/hooks/useResponsive.d.ts.map +0 -1
- package/lib/typescript/module/src/themes/createTheme.d.ts +0 -1
- package/lib/typescript/module/src/themes/createTheme.d.ts.map +0 -1
- package/src/components/Header/Header.tsx +0 -82
- package/src/helpers/LightenColorShades.ts +0 -27
- package/src/themes/createTheme.ts +0 -23
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { createContext, useMemo, useState } from 'react';
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { LightTheme, DarkTheme } from '../../themes';
|
|
4
|
-
import type { Theme, themeModeTypes, ThemeTypes } from '../../types';
|
|
4
|
+
import type { scalingModeTypes, Theme, themeModeTypes, ThemeTypes } from '../../types';
|
|
5
|
+
import { setGlobalContext } from './ContextManager';
|
|
5
6
|
|
|
6
7
|
type ProviderProps = {
|
|
7
8
|
/**
|
|
@@ -14,40 +15,54 @@ type ProviderProps = {
|
|
|
14
15
|
* Determines whether the theme should be responsive based on screen size.
|
|
15
16
|
* Default: `true`
|
|
16
17
|
*/
|
|
17
|
-
isResponsive?: boolean;
|
|
18
|
+
// isResponsive?: boolean;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Custom theme object that overrides the default light/dark themes.
|
|
21
22
|
* If not provided, the default themes (LightTheme/DarkTheme) will be used.
|
|
22
23
|
*/
|
|
23
24
|
theme?: Theme;
|
|
25
|
+
|
|
26
|
+
options?: {
|
|
27
|
+
defaultTheme?: themeModeTypes;
|
|
28
|
+
scalingMode?: scalingModeTypes;
|
|
29
|
+
}
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
type ThemeContextType = {
|
|
27
|
-
isResponsive?: boolean;
|
|
28
33
|
theme?: ThemeTypes & {
|
|
29
34
|
toggleThemeMode: () => void;
|
|
30
35
|
};
|
|
31
36
|
mode?: themeModeTypes;
|
|
37
|
+
scaling: { mode: scalingModeTypes }
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
|
|
35
|
-
export const Context = createContext<ThemeContextType
|
|
36
|
-
isResponsive: true,
|
|
41
|
+
export const Context = createContext<ThemeContextType>({
|
|
37
42
|
mode: 'light',
|
|
38
|
-
theme: { ...LightTheme, toggleThemeMode: () => { } }
|
|
43
|
+
theme: { ...LightTheme, toggleThemeMode: () => { } },
|
|
44
|
+
scaling: { mode: 'partial' }
|
|
39
45
|
});
|
|
40
46
|
|
|
41
47
|
const NativeProvider: React.FC<ProviderProps> = ({
|
|
42
48
|
children,
|
|
43
|
-
isResponsive = true,
|
|
44
49
|
theme,
|
|
50
|
+
options
|
|
45
51
|
}) => {
|
|
46
|
-
const [mode, setMode] = useState<themeModeTypes>('light');
|
|
47
|
-
|
|
52
|
+
const [mode, setMode] = useState<themeModeTypes>(options?.defaultTheme ?? 'light');
|
|
48
53
|
const toggleThemeMode = () => setMode((prev) => prev === 'dark' ? 'light' : 'dark');
|
|
49
54
|
const setTheme = { ...((theme && theme[mode]) || (mode === 'light' ? LightTheme : DarkTheme)), toggleThemeMode };
|
|
50
|
-
const value = useMemo(() => ({
|
|
55
|
+
const value = useMemo(() => ({
|
|
56
|
+
theme: setTheme,
|
|
57
|
+
mode,
|
|
58
|
+
scaling: { mode: options?.scalingMode ?? 'partial' }
|
|
59
|
+
}), [theme, mode, options]);
|
|
60
|
+
|
|
61
|
+
// useLayoutEffect(() => {
|
|
62
|
+
// setGlobalContext(value);
|
|
63
|
+
// }, [value]);
|
|
64
|
+
setGlobalContext(value);
|
|
65
|
+
|
|
51
66
|
return (<>
|
|
52
67
|
<Context.Provider value={value}>
|
|
53
68
|
{children}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useCallback, useState, type FC } from "react";
|
|
2
|
+
import { StyledView } from "../StyledComponents";
|
|
3
|
+
import type { RadioGroupProps } from "../../types";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const RadioGroup: FC<RadioGroupProps> = ({
|
|
7
|
+
name,
|
|
8
|
+
defaultValue,
|
|
9
|
+
children,
|
|
10
|
+
onSelect,
|
|
11
|
+
...rest
|
|
12
|
+
}) => {
|
|
13
|
+
|
|
14
|
+
const [selectedChildren, setSelectedChildren] = useState<string>(defaultValue ?? '');
|
|
15
|
+
|
|
16
|
+
const renderChildren = useCallback(() => {
|
|
17
|
+
return React.Children.toArray(children).map((child) => {
|
|
18
|
+
if (React.isValidElement<{ name: string; value: string; active: boolean; disabled?: boolean; onPress: () => void; }>(child)) {
|
|
19
|
+
return React.cloneElement(child, {
|
|
20
|
+
active: selectedChildren === child.props.value,
|
|
21
|
+
onPress: () => {
|
|
22
|
+
if (!('disabled' in child.props) && !child?.props?.disabled) {
|
|
23
|
+
child.props?.onPress?.();
|
|
24
|
+
onSelect?.(name || child.props.name, child.props.value);
|
|
25
|
+
setSelectedChildren(child?.props?.value);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
})
|
|
32
|
+
}, [children, selectedChildren]);
|
|
33
|
+
|
|
34
|
+
return (<>
|
|
35
|
+
<StyledView flexDirection='row' gap={15} {...rest}>
|
|
36
|
+
{renderChildren()}
|
|
37
|
+
</StyledView>
|
|
38
|
+
</>);
|
|
39
|
+
}
|
|
40
|
+
export default RadioGroup;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useMemo, type FC } from "react";
|
|
2
|
+
import { StyledText, StyledView } from "../StyledComponents";
|
|
3
|
+
import { StyleSheet, TouchableOpacity, type ViewStyle } from "react-native";
|
|
4
|
+
import { horizontalScale } from "../../helpers";
|
|
5
|
+
import { useTheme } from "../../hooks";
|
|
6
|
+
import type { RadioItemProps } from "../../types";
|
|
7
|
+
|
|
8
|
+
const RadioItem: FC<RadioItemProps> = ({
|
|
9
|
+
size = 22,
|
|
10
|
+
stroke = 2,
|
|
11
|
+
color,
|
|
12
|
+
active = false,
|
|
13
|
+
name,
|
|
14
|
+
disabled,
|
|
15
|
+
label,
|
|
16
|
+
fs,
|
|
17
|
+
fScale = 'base',
|
|
18
|
+
ff,
|
|
19
|
+
labelStyle,
|
|
20
|
+
...rest
|
|
21
|
+
}) => {
|
|
22
|
+
|
|
23
|
+
const STYLES = useMemo(customStyles, []);
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
|
|
26
|
+
const themedColor = (disabled && theme?.colors.states.disabled) || (color ?? theme?.colors.brand.primary);
|
|
27
|
+
|
|
28
|
+
const dynamicStyles: ViewStyle = {
|
|
29
|
+
borderColor: themedColor,
|
|
30
|
+
borderWidth: stroke,
|
|
31
|
+
padding: 2,
|
|
32
|
+
height: size,
|
|
33
|
+
width: size,
|
|
34
|
+
}
|
|
35
|
+
return (<>
|
|
36
|
+
<TouchableOpacity
|
|
37
|
+
{...rest}
|
|
38
|
+
>
|
|
39
|
+
<StyledView style={STYLES.MAIN_CONT}>
|
|
40
|
+
<StyledView style={[STYLES.RADIO_OUTER_CONT, dynamicStyles]}>
|
|
41
|
+
{
|
|
42
|
+
active &&
|
|
43
|
+
<StyledView style={[STYLES.RADIO_INNER_CONT]} bg={themedColor} />
|
|
44
|
+
}
|
|
45
|
+
</StyledView>
|
|
46
|
+
{
|
|
47
|
+
label &&
|
|
48
|
+
<StyledText variant={disabled ? 'disabled' : 'primary'} ff={ff} fs={fs} fScale={fScale} style={labelStyle} >{label}</StyledText>
|
|
49
|
+
}
|
|
50
|
+
</StyledView>
|
|
51
|
+
</TouchableOpacity>
|
|
52
|
+
</>);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default RadioItem;
|
|
56
|
+
|
|
57
|
+
const customStyles = () => StyleSheet.create({
|
|
58
|
+
MAIN_CONT: {
|
|
59
|
+
flexDirection: 'row',
|
|
60
|
+
gap: horizontalScale(15),
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
},
|
|
63
|
+
RADIO_OUTER_CONT: {
|
|
64
|
+
borderRadius: 100,
|
|
65
|
+
overflow: 'hidden'
|
|
66
|
+
},
|
|
67
|
+
RADIO_INNER_CONT: {
|
|
68
|
+
width: '100%',
|
|
69
|
+
height: '100%',
|
|
70
|
+
borderRadius: 100
|
|
71
|
+
}
|
|
72
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { verticalScale, } from "../../helpers/ResponsiveCalculations";
|
|
4
4
|
import { StyledView } from '../StyledComponents';
|
|
5
5
|
|
|
6
6
|
|
|
@@ -21,14 +21,14 @@ const Slider: React.FC<SliderProps> = ({
|
|
|
21
21
|
const STYLES = StyleSheet.create({
|
|
22
22
|
TRACK: {
|
|
23
23
|
backgroundColor: trackColor,
|
|
24
|
-
borderRadius: moderateScale(100),
|
|
24
|
+
// borderRadius: moderateScale(100),
|
|
25
25
|
// overflow: 'hidden'
|
|
26
26
|
},
|
|
27
27
|
TRACK_ITEM: {
|
|
28
28
|
backgroundColor: progressColor,
|
|
29
29
|
height: verticalScale(size),
|
|
30
30
|
width: `${value}%`,
|
|
31
|
-
borderRadius: moderateScale(100)
|
|
31
|
+
// borderRadius: moderateScale(100)
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from "react";
|
|
2
2
|
import type { ViewStyle } from "react-native";
|
|
3
3
|
import { horizontalScale } from "../../helpers/ResponsiveCalculations";
|
|
4
4
|
import type { HStackProps } from "../../types";
|
|
5
5
|
import { StyledView } from "../StyledComponents";
|
|
6
6
|
|
|
7
|
-
const HStack:
|
|
8
|
-
justify,
|
|
7
|
+
const HStack: FC<HStackProps> = ({
|
|
9
8
|
align = 'center',
|
|
10
9
|
fWrap = 'wrap',
|
|
11
10
|
gap = 10,
|
|
12
|
-
|
|
11
|
+
containerStyle,
|
|
13
12
|
children,
|
|
14
13
|
...rest
|
|
15
14
|
}) => {
|
|
16
|
-
const calculatedGap: number = useMemo(() => horizontalScale(gap), [gap]);
|
|
17
15
|
|
|
18
16
|
const viewProps: ViewStyle = {
|
|
19
|
-
gap:
|
|
17
|
+
gap: horizontalScale(gap),
|
|
20
18
|
flexDirection: 'row',
|
|
21
|
-
justifyContent: justify,
|
|
22
19
|
alignItems: align,
|
|
23
20
|
flexWrap: fWrap,
|
|
24
21
|
};
|
|
25
22
|
|
|
26
23
|
return (<>
|
|
27
24
|
<StyledView
|
|
28
|
-
style={[viewProps,
|
|
25
|
+
style={[viewProps, containerStyle]}
|
|
29
26
|
{...rest}
|
|
30
27
|
>
|
|
31
28
|
{children}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from "react";
|
|
2
2
|
import { verticalScale } from "../../helpers/ResponsiveCalculations";
|
|
3
3
|
import type { VStackProps } from "../../types";
|
|
4
4
|
import { StyledView } from "../StyledComponents";
|
|
5
5
|
import type { ViewStyle } from "react-native";
|
|
6
6
|
|
|
7
|
-
const VStack:
|
|
8
|
-
children,
|
|
9
|
-
align,
|
|
7
|
+
const VStack: FC<VStackProps> = ({
|
|
10
8
|
gap = 10,
|
|
11
|
-
|
|
9
|
+
containerStyle,
|
|
10
|
+
children,
|
|
12
11
|
...rest
|
|
13
12
|
}) => {
|
|
14
|
-
|
|
15
|
-
const calculatedGap: number = useMemo(() => verticalScale(gap), [gap]);
|
|
16
|
-
|
|
17
13
|
const viewProps: ViewStyle = {
|
|
18
14
|
flexDirection: 'column',
|
|
19
|
-
|
|
20
|
-
gap: calculatedGap,
|
|
15
|
+
gap: verticalScale(gap),
|
|
21
16
|
};
|
|
22
17
|
return (<>
|
|
23
18
|
<StyledView
|
|
24
|
-
style={[viewProps,
|
|
19
|
+
style={[viewProps, containerStyle]}
|
|
25
20
|
{...rest}
|
|
26
21
|
>
|
|
27
22
|
{children}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
3
|
import { responsiveFontSize } from '../../helpers/ResponsiveCalculations';
|
|
4
4
|
import { useTheme } from '../../hooks';
|
|
5
5
|
import type { StyledTextProps } from '../../types';
|
|
6
6
|
|
|
7
|
-
const StyledText:
|
|
8
|
-
variant = '
|
|
7
|
+
const StyledText: FC<StyledTextProps> = ({
|
|
8
|
+
variant = 'primary',
|
|
9
|
+
fScale = 'base',
|
|
9
10
|
children,
|
|
10
11
|
style,
|
|
11
12
|
ff,
|
|
@@ -14,19 +15,27 @@ const StyledText: React.FC<StyledTextProps> = ({
|
|
|
14
15
|
fw,
|
|
15
16
|
color,
|
|
16
17
|
themeColor,
|
|
17
|
-
primary,
|
|
18
|
-
secondary,
|
|
19
18
|
...rest
|
|
20
19
|
}) => {
|
|
21
|
-
const { colors,
|
|
20
|
+
const { colors, sizes: { typography: typographyScales } }: any = useTheme();
|
|
21
|
+
|
|
22
|
+
const getVariantColor = () => {
|
|
23
|
+
switch (variant) {
|
|
24
|
+
case 'secondary': return colors.typography.secondary;
|
|
25
|
+
case 'tertiary': return colors.typography.tertiary;
|
|
26
|
+
case 'disabled': return colors.typography.disabled;
|
|
27
|
+
case 'inverse': return colors.typography.inverse;
|
|
28
|
+
default: return colors.typography.primary;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
22
31
|
return (
|
|
23
32
|
<Text
|
|
24
33
|
style={[{
|
|
25
|
-
fontSize: responsiveFontSize(fs ??
|
|
34
|
+
fontSize: responsiveFontSize(fs ?? typographyScales[fScale]),
|
|
26
35
|
fontFamily: ff ?? '',
|
|
27
36
|
textAlign: tas ? 'center' : 'auto',
|
|
28
37
|
fontWeight: fw ?? 'normal',
|
|
29
|
-
color: color ?? (themeColor && colors.primary ||
|
|
38
|
+
color: color ?? (themeColor && colors.brand.primary || getVariantColor()),
|
|
30
39
|
},
|
|
31
40
|
style,
|
|
32
41
|
]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTheme } from '../../hooks';
|
|
4
4
|
import type { StyledViewProps } from '../../types';
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
const StyledView
|
|
7
|
+
const StyledView = forwardRef<View, StyledViewProps>(({
|
|
8
8
|
f,
|
|
9
9
|
justify,
|
|
10
10
|
align,
|
|
@@ -15,12 +15,11 @@ const StyledView: React.FC<StyledViewProps> = ({
|
|
|
15
15
|
w,
|
|
16
16
|
children,
|
|
17
17
|
style,
|
|
18
|
-
ref,
|
|
19
18
|
...rest
|
|
20
|
-
}) => {
|
|
21
|
-
|
|
22
|
-
const theme = useTheme(themeBg);
|
|
19
|
+
}, ref) => {
|
|
23
20
|
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
|
|
24
23
|
return (
|
|
25
24
|
<View
|
|
26
25
|
style={[{
|
|
@@ -28,7 +27,7 @@ const StyledView: React.FC<StyledViewProps> = ({
|
|
|
28
27
|
justifyContent: justify,
|
|
29
28
|
alignItems: align,
|
|
30
29
|
flexWrap: fWrap,
|
|
31
|
-
backgroundColor: bg ?? (themeBg ? theme?.colors.
|
|
30
|
+
backgroundColor: bg ?? (themeBg ? theme?.colors.background.default : 'transparent'),
|
|
32
31
|
height: h,
|
|
33
32
|
width: w,
|
|
34
33
|
},
|
|
@@ -40,7 +39,7 @@ const StyledView: React.FC<StyledViewProps> = ({
|
|
|
40
39
|
{children}
|
|
41
40
|
</View>
|
|
42
41
|
);
|
|
43
|
-
};
|
|
42
|
+
});
|
|
44
43
|
|
|
45
44
|
export default StyledView;
|
|
46
45
|
export type { StyledViewProps };
|
|
@@ -1,36 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyleSheet} from "react-native";
|
|
1
|
+
import type { FC } from 'react';
|
|
3
2
|
import { StyledView } from '../StyledComponents';
|
|
3
|
+
import { useTheme } from '../../hooks';
|
|
4
|
+
import { verticalScale } from '../../helpers';
|
|
5
|
+
import type { SurfaceProps } from '../../types';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const Surface: FC<SurfaceProps> = ({
|
|
8
|
+
variant = 'elevated',
|
|
9
|
+
padding = 10,
|
|
10
|
+
br = 5,
|
|
11
|
+
children,
|
|
12
|
+
...rest
|
|
12
13
|
}) => {
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
height: 100,
|
|
17
|
-
width: 100,
|
|
18
|
-
backgroundColor: '#fff',
|
|
19
|
-
shadowColor: "#000",
|
|
20
|
-
// shadowOffset: {
|
|
21
|
-
// width: 100,
|
|
22
|
-
// height: 100,
|
|
23
|
-
// },
|
|
24
|
-
// shadowOpacity: 0.43,
|
|
25
|
-
// shadowRadius: 9.51,
|
|
26
|
-
|
|
27
|
-
elevation: 15,
|
|
28
|
-
}
|
|
29
|
-
});
|
|
15
|
+
const { colors }: any = useTheme();
|
|
16
|
+
const styles = variant === 'elevated' ? { boxShadow: colors.elevation.level1 } : { borderColor: colors.border.default, borderWidth: 0.5 };
|
|
30
17
|
|
|
31
18
|
return (<>
|
|
32
|
-
<StyledView
|
|
33
|
-
|
|
19
|
+
<StyledView
|
|
20
|
+
padding={verticalScale(padding)}
|
|
21
|
+
borderRadius={verticalScale(br)}
|
|
22
|
+
bg={colors.background.surface}
|
|
23
|
+
{...styles}
|
|
24
|
+
{...rest}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
34
27
|
</StyledView>
|
|
35
28
|
</>);
|
|
36
29
|
};
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { FC } from "react";
|
|
2
2
|
import { Switch as NativeSwitch } from "react-native";
|
|
3
|
-
import
|
|
4
|
-
import { moderateScale } from "../../helpers/ResponsiveCalculations";
|
|
3
|
+
import { verticalScale } from "../../helpers/ResponsiveCalculations";
|
|
5
4
|
import { useTheme } from "../../hooks";
|
|
6
5
|
import type { SwitchProps } from "../../types";
|
|
6
|
+
import Color from "color";
|
|
7
7
|
|
|
8
|
-
const Switch:
|
|
8
|
+
const Switch: FC<SwitchProps> = ({
|
|
9
9
|
checked = true,
|
|
10
10
|
color,
|
|
11
11
|
disabled = false,
|
|
12
|
-
size = 0.
|
|
12
|
+
size = 0.9,
|
|
13
13
|
activeTrackColor,
|
|
14
|
-
inactiveTrackColor
|
|
14
|
+
inactiveTrackColor,
|
|
15
15
|
onChange,
|
|
16
16
|
...rest
|
|
17
17
|
}) => {
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
const switchColor = disabled ?
|
|
19
|
+
const { colors }: any = useTheme();
|
|
20
|
+
const switchColor = disabled ? colors.states.disabled : color ?? colors.brand.primary;
|
|
21
|
+
const disabledAndInActiveTrackColor = colors.palette.natural[200];
|
|
22
|
+
const generateActiveTrackColor = Color(colors.brand.primary).lighten(0).alpha(0.3).rgb().string();
|
|
21
23
|
|
|
22
24
|
return (<>
|
|
23
25
|
<NativeSwitch
|
|
24
26
|
value={checked}
|
|
25
|
-
trackColor={{ true:
|
|
27
|
+
trackColor={{ true: (disabled && disabledAndInActiveTrackColor) || (activeTrackColor ?? generateActiveTrackColor), false: (disabled && disabledAndInActiveTrackColor) || (inactiveTrackColor ?? disabledAndInActiveTrackColor) }}
|
|
26
28
|
thumbColor={switchColor}
|
|
27
29
|
onValueChange={onChange}
|
|
28
|
-
style={{ transform: [{ scaleX:
|
|
30
|
+
style={{ transform: [{ scaleX: verticalScale(size) }, { scaleY: verticalScale(size) }] }}
|
|
29
31
|
disabled={disabled}
|
|
30
32
|
{...rest}
|
|
31
33
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { forwardRef, useMemo, useState } from 'react';
|
|
2
2
|
import { TextInput, StyleSheet, type ViewStyle } from 'react-native';
|
|
3
3
|
import type { TextStyle } from 'react-native';
|
|
4
4
|
import { responsiveFontSize, verticalScale, horizontalScale } from '../../helpers/ResponsiveCalculations';
|
|
@@ -7,37 +7,40 @@ import { StyledText, StyledView } from '../StyledComponents';
|
|
|
7
7
|
import type { UserInputProps } from '../../types';
|
|
8
8
|
import generateColors from './generateColors';
|
|
9
9
|
|
|
10
|
-
const UserInput
|
|
10
|
+
const UserInput = forwardRef<TextInput, UserInputProps>(({
|
|
11
11
|
variant = 'standard',
|
|
12
12
|
label,
|
|
13
13
|
bg,
|
|
14
14
|
br = 10,
|
|
15
15
|
stroke = 1,
|
|
16
16
|
labelColor,
|
|
17
|
-
|
|
18
|
-
label: '
|
|
19
|
-
|
|
17
|
+
textScale = {
|
|
18
|
+
label: 'sm',
|
|
19
|
+
inputText: 'sm',
|
|
20
|
+
helperText: 'xs',
|
|
20
21
|
},
|
|
21
22
|
inputTextColor,
|
|
22
23
|
strokeColor,
|
|
23
24
|
cursorColor,
|
|
24
25
|
placeholderColor,
|
|
25
|
-
inputFs
|
|
26
|
+
inputFs,
|
|
26
27
|
labelFs,
|
|
27
28
|
helperTextFS,
|
|
28
29
|
placeholder = 'Please enter...',
|
|
29
30
|
disabled = false,
|
|
30
31
|
isError = false,
|
|
31
|
-
helperText
|
|
32
|
+
helperText,
|
|
32
33
|
multiline = false,
|
|
33
34
|
renderLeftIcon,
|
|
34
35
|
renderRightIcon,
|
|
35
36
|
styles,
|
|
36
|
-
ref,
|
|
37
37
|
...rest
|
|
38
|
-
}) => {
|
|
38
|
+
}, ref) => {
|
|
39
|
+
|
|
40
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
39
41
|
|
|
40
42
|
const theme: any = useTheme();
|
|
43
|
+
const STYLES = useMemo(Styles, []);
|
|
41
44
|
|
|
42
45
|
const {
|
|
43
46
|
computedCursorColor,
|
|
@@ -48,23 +51,24 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
48
51
|
const dynamicStyles = {
|
|
49
52
|
INPUT_CONT: {
|
|
50
53
|
alignItems: multiline ? 'flex-start' : 'center' as ViewStyle['alignItems'],
|
|
51
|
-
backgroundColor: disabled
|
|
52
|
-
borderColor: isError
|
|
54
|
+
backgroundColor: disabled && theme.colors.states.disabled || isFocused && theme.colors.states.focus || (bg ?? theme.colors.background.default),
|
|
55
|
+
borderColor: isError && theme.colors.semantic.danger || isFocused && theme.colors.brand.primary || (strokeColor ?? theme.colors.border.default),
|
|
53
56
|
borderWidth: variant === 'standard' ? 0 : stroke,
|
|
54
57
|
borderBottomWidth: stroke,
|
|
55
58
|
borderRadius: verticalScale(br),
|
|
56
|
-
height: multiline ? undefined : verticalScale(
|
|
59
|
+
height: multiline ? undefined : verticalScale(47),
|
|
57
60
|
paddingVertical: multiline ? horizontalScale(10) : undefined,
|
|
58
61
|
},
|
|
59
62
|
INPUT: {
|
|
60
|
-
color: disabled ? theme.colors.
|
|
61
|
-
|
|
63
|
+
color: disabled ? theme.colors.typography.disabled : isError ? theme.colors.semantic.danger : inputTextColor ?? theme.colors.typography.primary,
|
|
64
|
+
//@ts-ignore
|
|
65
|
+
fontSize: responsiveFontSize(inputFs ?? theme.sizes.typography[textScale.inputText]),
|
|
62
66
|
textAlignVertical: (multiline ? 'top' : 'center') as TextStyle['textAlignVertical'],
|
|
63
67
|
minHeight: multiline ? 100 : undefined,
|
|
64
68
|
maxHeight: multiline ? 150 : undefined,
|
|
65
69
|
},
|
|
66
70
|
ERROR_HELPER_TEXT: {
|
|
67
|
-
color: theme.colors.
|
|
71
|
+
color: theme.colors.semantic.danger,
|
|
68
72
|
}
|
|
69
73
|
};
|
|
70
74
|
|
|
@@ -72,7 +76,7 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
72
76
|
<StyledView gap={verticalScale(5)} style={styles?.mainContainer} w='100%'>
|
|
73
77
|
{
|
|
74
78
|
label &&
|
|
75
|
-
<StyledText
|
|
79
|
+
<StyledText fScale={textScale?.label} fs={labelFs} color={computedLabelColor} style={styles?.label}>{label}</StyledText>
|
|
76
80
|
}
|
|
77
81
|
<StyledView
|
|
78
82
|
style={[STYLES.INPUT_CONT, dynamicStyles.INPUT_CONT, styles?.inputContainer]}
|
|
@@ -88,6 +92,8 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
88
92
|
editable={!disabled}
|
|
89
93
|
multiline={multiline}
|
|
90
94
|
cursorColor={computedCursorColor}
|
|
95
|
+
onFocus={() => setIsFocused(true)}
|
|
96
|
+
onBlur={() => setIsFocused(false)}
|
|
91
97
|
{...rest}
|
|
92
98
|
/>
|
|
93
99
|
{
|
|
@@ -97,7 +103,7 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
97
103
|
{
|
|
98
104
|
(isError && helperText) &&
|
|
99
105
|
<StyledText
|
|
100
|
-
|
|
106
|
+
fScale={textScale?.helperText}
|
|
101
107
|
fs={helperTextFS}
|
|
102
108
|
style={[
|
|
103
109
|
STYLES.ERROR_HELPER_TEXT,
|
|
@@ -110,11 +116,11 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
110
116
|
}
|
|
111
117
|
</StyledView>
|
|
112
118
|
</>)
|
|
113
|
-
};
|
|
119
|
+
});
|
|
114
120
|
export default UserInput;
|
|
115
121
|
export type { UserInputProps };
|
|
116
122
|
|
|
117
|
-
const
|
|
123
|
+
const Styles = () => StyleSheet.create({
|
|
118
124
|
INPUT_CONT: {
|
|
119
125
|
flexDirection: 'row',
|
|
120
126
|
paddingHorizontal: horizontalScale(14),
|
|
@@ -2,9 +2,9 @@ import type { ThemeTypes } from "../../types";
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
const generateColors = (theme: ThemeTypes, isError: boolean, cursorColor?: string, placeholderColor?: string, labelColor?: string) => {
|
|
5
|
-
const computedCursorColor = isError ? theme.colors.
|
|
6
|
-
const computedPlaceholderColor = placeholderColor ?? theme.colors.
|
|
7
|
-
const computedLabelColor = isError ? theme.colors.
|
|
5
|
+
const computedCursorColor = isError ? theme.colors.semantic.danger : (cursorColor ?? theme.colors.brand.primary);
|
|
6
|
+
const computedPlaceholderColor = placeholderColor ?? theme.colors.typography.tertiary;
|
|
7
|
+
const computedLabelColor = isError ? theme.colors.semantic.danger : labelColor ?? theme.colors.typography.primary;
|
|
8
8
|
return {
|
|
9
9
|
computedCursorColor,
|
|
10
10
|
computedPlaceholderColor,
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
type typographySizeTypes = {
|
|
2
|
-
|
|
3
|
-
h2: number,
|
|
4
|
-
h3: number,
|
|
5
|
-
h4: number,
|
|
6
|
-
h6: number,
|
|
7
|
-
h5: number,
|
|
8
|
-
h7: number,
|
|
2
|
+
[key: string]: number
|
|
9
3
|
}
|
|
10
4
|
|
|
11
|
-
const typographySizes:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
const typographySizes: Record<string, number> = {
|
|
6
|
+
xxs: 10,
|
|
7
|
+
xs: 12,
|
|
8
|
+
sm: 14,
|
|
9
|
+
base: 16,
|
|
10
|
+
lg: 18,
|
|
11
|
+
xl: 24,
|
|
12
|
+
'2xl': 28,
|
|
13
|
+
'3xl': 32,
|
|
14
|
+
'4xl': 36,
|
|
15
|
+
'5xl': 45,
|
|
16
|
+
'6xl': 57,
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
export default typographySizes;
|