@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,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { JSX } from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import type { FC, JSX } from 'react';
|
|
3
3
|
import { StyleSheet, TouchableOpacity, type ViewStyle } from "react-native";
|
|
4
4
|
import { verticalScale, horizontalScale } from "../../helpers/ResponsiveCalculations";
|
|
5
5
|
import { StyledText, StyledView } from '../StyledComponents';
|
|
@@ -8,35 +8,36 @@ import { getButtonColors } from './utils';
|
|
|
8
8
|
import type { ButtonProps } from '../../types';
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
const Button:
|
|
11
|
+
const Button: FC<ButtonProps> = ({
|
|
12
12
|
variant = 'contained',
|
|
13
13
|
type = 'flat',
|
|
14
14
|
fullWidth = false,
|
|
15
15
|
paddingH = 19,
|
|
16
|
-
paddingV =
|
|
16
|
+
paddingV = 12,
|
|
17
17
|
bg,
|
|
18
|
-
br =
|
|
18
|
+
br = 8,
|
|
19
19
|
stroke = 1,
|
|
20
20
|
strokeColor,
|
|
21
21
|
titleColor,
|
|
22
|
-
title
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
title,
|
|
23
|
+
fScale = 'base',
|
|
24
|
+
fs,
|
|
25
|
+
ff,
|
|
26
26
|
size = 50,
|
|
27
27
|
rippleColor,
|
|
28
28
|
renderIcon,
|
|
29
29
|
renderLeftIcon,
|
|
30
30
|
renderRightIcon,
|
|
31
31
|
disabled = false,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
containerStyle,
|
|
33
|
+
titleStyle,
|
|
34
34
|
onPress,
|
|
35
|
+
children,
|
|
35
36
|
...rest
|
|
36
37
|
}) => {
|
|
37
38
|
const theme: any = useTheme();
|
|
38
39
|
|
|
39
|
-
const { backgroundColor, buttonTextColor, buttonBorderColor
|
|
40
|
+
const { backgroundColor, buttonTextColor, buttonBorderColor } = getButtonColors({
|
|
40
41
|
theme,
|
|
41
42
|
variant,
|
|
42
43
|
bg,
|
|
@@ -44,6 +45,9 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
44
45
|
strokeColor,
|
|
45
46
|
disabled
|
|
46
47
|
});
|
|
48
|
+
|
|
49
|
+
const STYLES = useMemo(customStyles, []);
|
|
50
|
+
|
|
47
51
|
const dynamicStyles = {
|
|
48
52
|
BUTTON_CONT: {
|
|
49
53
|
backgroundColor: backgroundColor,
|
|
@@ -52,7 +56,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
52
56
|
},
|
|
53
57
|
BUTTON_TEXT: {
|
|
54
58
|
color: buttonTextColor,
|
|
55
|
-
fontFamily:
|
|
59
|
+
fontFamily: ff ?? '',
|
|
56
60
|
},
|
|
57
61
|
FLAT_BTN_MAIN_CONT: {
|
|
58
62
|
borderRadius: verticalScale(br),
|
|
@@ -72,7 +76,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
72
76
|
const cloneElement = (element: JSX.Element): JSX.Element | null => {
|
|
73
77
|
if (React.isValidElement<{ color?: string }>(element)) {
|
|
74
78
|
return React.cloneElement(element, {
|
|
75
|
-
color:
|
|
79
|
+
color: element.props.color ?? buttonTextColor
|
|
76
80
|
})
|
|
77
81
|
}
|
|
78
82
|
return null;
|
|
@@ -102,7 +106,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
102
106
|
STYLES.BUTTON_CONT,
|
|
103
107
|
dynamicStyles.FLAT_BTN_INNER_CONT,
|
|
104
108
|
dynamicStyles.BUTTON_CONT,
|
|
105
|
-
|
|
109
|
+
containerStyle
|
|
106
110
|
]}>
|
|
107
111
|
{(renderLeftIcon || (fullWidth && renderRightIcon)) && (
|
|
108
112
|
<StyledView f={fullWidth ? 1 : undefined}>
|
|
@@ -114,15 +118,20 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
114
118
|
flexShrink={1}
|
|
115
119
|
f={fullWidth ? 8 : undefined}
|
|
116
120
|
>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
{
|
|
122
|
+
(title ?? children) ?
|
|
123
|
+
<StyledText numberOfLines={1} fs={fs} fScale={fScale}
|
|
124
|
+
style={[
|
|
125
|
+
STYLES.BUTTON_TEXT,
|
|
126
|
+
dynamicStyles.BUTTON_TEXT,
|
|
127
|
+
titleStyle,
|
|
128
|
+
]}
|
|
129
|
+
>
|
|
130
|
+
{title ?? children}
|
|
131
|
+
</StyledText>
|
|
132
|
+
:
|
|
133
|
+
(renderIcon && cloneElement(renderIcon))
|
|
134
|
+
}
|
|
126
135
|
</StyledView>
|
|
127
136
|
|
|
128
137
|
{(renderRightIcon || (fullWidth && renderLeftIcon)) && (
|
|
@@ -150,7 +159,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
150
159
|
STYLES.ROUND_BTN_INNER_CONT,
|
|
151
160
|
dynamicStyles.BUTTON_CONT,
|
|
152
161
|
dynamicStyles.ROUND_BTN_INNER_CONT,
|
|
153
|
-
|
|
162
|
+
containerStyle
|
|
154
163
|
]}
|
|
155
164
|
>
|
|
156
165
|
{renderIcon && cloneElement(renderIcon)}
|
|
@@ -165,7 +174,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
165
174
|
export default Button;
|
|
166
175
|
export type { ButtonProps };
|
|
167
176
|
|
|
168
|
-
const
|
|
177
|
+
const customStyles = () => StyleSheet.create({
|
|
169
178
|
BUTTON_CONT: {
|
|
170
179
|
maxWidth: '100%',
|
|
171
180
|
},
|
|
@@ -11,12 +11,12 @@ const getButtonBorderColor = ({
|
|
|
11
11
|
disabled: boolean;
|
|
12
12
|
}) => {
|
|
13
13
|
if (disabled) {
|
|
14
|
-
return theme.colors.
|
|
14
|
+
return theme.colors.border.default;
|
|
15
15
|
}
|
|
16
16
|
if (strokeColor) {
|
|
17
17
|
return strokeColor
|
|
18
18
|
}
|
|
19
|
-
return theme.colors.
|
|
19
|
+
return theme.colors.border.default;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
|
|
@@ -33,15 +33,15 @@ const getButtonTextColor = ({
|
|
|
33
33
|
}) => {
|
|
34
34
|
|
|
35
35
|
if (disabled) {
|
|
36
|
-
return theme.colors.
|
|
36
|
+
return theme.colors.typography.disabled;
|
|
37
37
|
}
|
|
38
38
|
else if (titleColor) {
|
|
39
39
|
return titleColor
|
|
40
40
|
}
|
|
41
41
|
else if (checkVariant('outlined')) {
|
|
42
|
-
return theme.colors.
|
|
42
|
+
return theme.colors.typography.primary;
|
|
43
43
|
}
|
|
44
|
-
return theme.colors.
|
|
44
|
+
return theme.colors.brand.onPrimary;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const getButtonBackgroundColor = ({
|
|
@@ -57,37 +57,37 @@ const getButtonBackgroundColor = ({
|
|
|
57
57
|
}) => {
|
|
58
58
|
|
|
59
59
|
if (disabled) {
|
|
60
|
-
return theme.colors.
|
|
60
|
+
return theme.colors.states.disabled;
|
|
61
61
|
}
|
|
62
62
|
else if (bg) {
|
|
63
63
|
return bg
|
|
64
64
|
}
|
|
65
65
|
else if (checkVariant('contained')) {
|
|
66
|
-
return theme.colors.primary;
|
|
66
|
+
return theme.colors.brand.primary;
|
|
67
67
|
}
|
|
68
68
|
else if (checkVariant('outlined')) {
|
|
69
69
|
return 'transparent';
|
|
70
70
|
}
|
|
71
|
-
return theme.colors.primary;
|
|
71
|
+
return theme.colors.brand.primary;
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
const getButtonIconColor = ({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}) => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
};
|
|
75
|
+
// const getButtonIconColor = ({
|
|
76
|
+
// theme,
|
|
77
|
+
// checkVariant,
|
|
78
|
+
// disabled,
|
|
79
|
+
// }: {
|
|
80
|
+
// theme: ThemeTypes;
|
|
81
|
+
// checkVariant: (variant: ButtonVariant) => boolean;
|
|
82
|
+
// disabled: boolean;
|
|
83
|
+
// }) => {
|
|
84
|
+
// if (disabled) {
|
|
85
|
+
// return theme.colors.iconDisable;
|
|
86
|
+
// } else if (checkVariant('outlined')) {
|
|
87
|
+
// return theme.colors.iconPrimary
|
|
88
|
+
// }
|
|
89
|
+
// return theme.colors.iconSecondary;
|
|
90
|
+
// };
|
|
91
91
|
|
|
92
92
|
const getButtonColors = ({
|
|
93
93
|
theme,
|
|
@@ -125,17 +125,17 @@ const getButtonColors = ({
|
|
|
125
125
|
strokeColor,
|
|
126
126
|
disabled
|
|
127
127
|
});
|
|
128
|
-
const buttonIconColor = getButtonIconColor({
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
128
|
+
// const buttonIconColor = getButtonIconColor({
|
|
129
|
+
// checkVariant,
|
|
130
|
+
// theme,
|
|
131
|
+
// disabled
|
|
132
|
+
// });
|
|
133
133
|
|
|
134
134
|
return {
|
|
135
135
|
backgroundColor,
|
|
136
136
|
buttonTextColor,
|
|
137
137
|
buttonBorderColor,
|
|
138
|
-
buttonIconColor
|
|
138
|
+
// buttonIconColor
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useMemo, useRef, useState, type FC } from "react";
|
|
2
2
|
import { StyleSheet, TouchableWithoutFeedback, Animated, type ViewStyle } from "react-native";
|
|
3
3
|
import { StyledText, StyledView } from "../StyledComponents";
|
|
4
4
|
import { useTheme } from "../../hooks";
|
|
5
|
-
import { horizontalScale, verticalScale } from "../../helpers
|
|
5
|
+
import { horizontalScale, verticalScale } from "../../helpers";
|
|
6
6
|
import { Check } from "../../assets/svg";
|
|
7
7
|
import type { CheckBoxProps } from "../../types";
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
const CheckBox:
|
|
10
|
+
const CheckBox: FC<CheckBoxProps> = ({
|
|
11
11
|
variant = 'square',
|
|
12
12
|
isChecked = false,
|
|
13
13
|
defaultValue = false,
|
|
@@ -16,13 +16,15 @@ const CheckBox: React.FC<CheckBoxProps> = ({
|
|
|
16
16
|
iconColor,
|
|
17
17
|
disableBuiltInState = false,
|
|
18
18
|
disabled = false,
|
|
19
|
-
|
|
19
|
+
label = 'Checkbox',
|
|
20
|
+
fScale = 'xs',
|
|
20
21
|
fs,
|
|
21
|
-
|
|
22
|
+
ff,
|
|
23
|
+
// size = 22,
|
|
22
24
|
size = 20,
|
|
23
25
|
iconSize,
|
|
24
26
|
containerStyle,
|
|
25
|
-
|
|
27
|
+
labelStyle,
|
|
26
28
|
checkBoxStyle,
|
|
27
29
|
onPress,
|
|
28
30
|
}) => {
|
|
@@ -32,18 +34,20 @@ const CheckBox: React.FC<CheckBoxProps> = ({
|
|
|
32
34
|
setIsCheckboxChecked(defaultValue);
|
|
33
35
|
}, [defaultValue]);
|
|
34
36
|
|
|
37
|
+
const STYLES = useMemo(Styles, []);
|
|
38
|
+
|
|
35
39
|
const scaleVal = useRef(new Animated.Value(1)).current;
|
|
36
40
|
const { colors }: any = useTheme();
|
|
37
|
-
activeBgColor = disabled ? colors.
|
|
41
|
+
activeBgColor = disabled ? colors.states.disabled : activeBgColor ?? colors.brand.primary;
|
|
38
42
|
iconSize = iconSize ?? size / 1.5;
|
|
39
43
|
const bgColor = (!disableBuiltInState && isCheckboxChecked) || (disableBuiltInState && isChecked) ? activeBgColor : inActiveBgColor;
|
|
40
|
-
const textColor = disabled ? colors.
|
|
44
|
+
const textColor = disabled ? colors.typography.disabled : colors.typography.primary;
|
|
41
45
|
|
|
42
46
|
const dynamicMainContStyles: ViewStyle = {
|
|
43
47
|
height: verticalScale(size),
|
|
44
48
|
width: verticalScale(size),
|
|
45
|
-
borderColor: disabled ? colors.
|
|
46
|
-
borderRadius: variant === 'square' ? 5 :
|
|
49
|
+
borderColor: disabled ? colors.border.default : activeBgColor,
|
|
50
|
+
borderRadius: verticalScale(variant === 'square' ? 5 : size),
|
|
47
51
|
backgroundColor: bgColor
|
|
48
52
|
};
|
|
49
53
|
|
|
@@ -68,38 +72,38 @@ const CheckBox: React.FC<CheckBoxProps> = ({
|
|
|
68
72
|
}
|
|
69
73
|
};
|
|
70
74
|
return (
|
|
71
|
-
<StyledView>
|
|
75
|
+
// <StyledView>
|
|
76
|
+
<StyledView style={[STYLES.CONTAINER, containerStyle]}>
|
|
77
|
+
|
|
72
78
|
<TouchableWithoutFeedback
|
|
73
79
|
onPressIn={() => animateScale(0.8)}
|
|
74
80
|
onPressOut={() => animateScale(1)}
|
|
75
81
|
onPress={onUserClick}
|
|
76
82
|
disabled={disabled}
|
|
77
83
|
>
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
<Animated.View style={[STYLES.CHECKBOX_PARENT_CONT, dynamicMainContStyles, checkBoxStyle, animatedStyle]}>
|
|
81
|
-
{
|
|
82
|
-
(disableBuiltInState ? isChecked : isCheckboxChecked) &&
|
|
83
|
-
<Check
|
|
84
|
-
color={iconColor ?? colors.iconSecondary}
|
|
85
|
-
size={verticalScale(iconSize)}
|
|
86
|
-
/>
|
|
87
|
-
}
|
|
88
|
-
</Animated.View>
|
|
84
|
+
<Animated.View style={[STYLES.CHECKBOX_PARENT_CONT, dynamicMainContStyles, checkBoxStyle, animatedStyle]}>
|
|
89
85
|
{
|
|
90
|
-
|
|
91
|
-
<
|
|
86
|
+
(disableBuiltInState ? isChecked : isCheckboxChecked) &&
|
|
87
|
+
<Check
|
|
88
|
+
color={disabled ? colors.states.disabled : iconColor ?? colors.brand.onPrimary}
|
|
89
|
+
size={verticalScale(iconSize)}
|
|
90
|
+
/>
|
|
92
91
|
}
|
|
93
|
-
|
|
94
|
-
</StyledView>
|
|
92
|
+
</Animated.View>
|
|
95
93
|
</TouchableWithoutFeedback>
|
|
94
|
+
{
|
|
95
|
+
label &&
|
|
96
|
+
<StyledText style={labelStyle} fs={fs} ff={ff} color={textColor} fScale={fScale}>{label}</StyledText>
|
|
97
|
+
}
|
|
98
|
+
|
|
96
99
|
</StyledView>
|
|
100
|
+
// </StyledView>
|
|
97
101
|
)
|
|
98
102
|
}
|
|
99
103
|
export default CheckBox;
|
|
100
104
|
export type { CheckBoxProps };
|
|
101
105
|
|
|
102
|
-
const
|
|
106
|
+
const Styles = () => StyleSheet.create({
|
|
103
107
|
CONTAINER: {
|
|
104
108
|
flexDirection: 'row',
|
|
105
109
|
gap: horizontalScale(10),
|
|
@@ -109,6 +113,6 @@ const STYLES = StyleSheet.create({
|
|
|
109
113
|
borderWidth: 0.8,
|
|
110
114
|
alignItems: 'center',
|
|
111
115
|
justifyContent: 'center',
|
|
112
|
-
padding:
|
|
116
|
+
padding: horizontalScale(7)
|
|
113
117
|
}
|
|
114
|
-
});
|
|
118
|
+
});
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSheet,
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
|
+
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { StyledText, StyledView } from '../StyledComponents';
|
|
4
4
|
import { horizontalScale, verticalScale } from "../../helpers/ResponsiveCalculations";
|
|
5
5
|
import { useTheme } from '../../hooks';
|
|
6
6
|
import { getChipColors } from './utils';
|
|
7
7
|
import type { ChipProps } from '../../types';
|
|
8
8
|
|
|
9
|
-
const Chip:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
titleColor,
|
|
9
|
+
const Chip: FC<ChipProps> = ({
|
|
10
|
+
label = 'Chip',
|
|
11
|
+
labelColor,
|
|
13
12
|
fs,
|
|
13
|
+
fScale = 'sm',
|
|
14
|
+
ff,
|
|
15
|
+
bg,
|
|
14
16
|
br = 7,
|
|
15
17
|
gap = 7,
|
|
16
|
-
paddingV =
|
|
17
|
-
paddingH =
|
|
18
|
-
stroke = 0.
|
|
18
|
+
paddingV = 6,
|
|
19
|
+
paddingH = 15,
|
|
20
|
+
stroke = 0.8,
|
|
19
21
|
strokeColor,
|
|
20
22
|
rippleColor,
|
|
21
23
|
disabled = false,
|
|
@@ -23,6 +25,7 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
23
25
|
renderRightIcon,
|
|
24
26
|
containerStyle,
|
|
25
27
|
textStyle,
|
|
28
|
+
active = false,
|
|
26
29
|
...rest
|
|
27
30
|
}) => {
|
|
28
31
|
|
|
@@ -31,9 +34,10 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
31
34
|
const { buttonTextColor, buttonBorderColor, backgroundColor } = getChipColors({
|
|
32
35
|
theme,
|
|
33
36
|
bg,
|
|
34
|
-
|
|
37
|
+
labelColor,
|
|
35
38
|
strokeColor,
|
|
36
|
-
disabled
|
|
39
|
+
disabled,
|
|
40
|
+
active
|
|
37
41
|
});
|
|
38
42
|
|
|
39
43
|
const STYLES = StyleSheet.create({
|
|
@@ -45,7 +49,8 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
45
49
|
backgroundColor: backgroundColor,
|
|
46
50
|
borderRadius: verticalScale(br),
|
|
47
51
|
paddingVertical: verticalScale(paddingV),
|
|
48
|
-
|
|
52
|
+
paddingLeft: horizontalScale((renderLeftIcon && paddingH / 2) ?? paddingH),
|
|
53
|
+
paddingRight: horizontalScale((renderRightIcon && paddingH / 2) ?? paddingH),
|
|
49
54
|
gap: horizontalScale(gap)
|
|
50
55
|
},
|
|
51
56
|
TEXT: {
|
|
@@ -54,36 +59,24 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
54
59
|
});
|
|
55
60
|
return (<>
|
|
56
61
|
<StyledView alignSelf='flex-start'>
|
|
57
|
-
<
|
|
58
|
-
android_ripple={{
|
|
59
|
-
color: rippleColor,
|
|
60
|
-
}}
|
|
61
|
-
{...rest}
|
|
62
|
+
<TouchableOpacity
|
|
62
63
|
disabled={disabled}
|
|
64
|
+
{...rest}
|
|
63
65
|
>
|
|
64
66
|
<StyledView style={[STYLES.CONTAINER, containerStyle]}>
|
|
65
67
|
{
|
|
66
|
-
renderLeftIcon &&
|
|
67
|
-
<TouchableOpacity
|
|
68
|
-
disabled={disabled}
|
|
69
|
-
>
|
|
70
|
-
{renderLeftIcon}
|
|
71
|
-
</TouchableOpacity>
|
|
68
|
+
React.isValidElement(renderLeftIcon) && renderLeftIcon
|
|
72
69
|
}
|
|
73
|
-
<StyledText
|
|
70
|
+
<StyledText fScale={fScale} ff={ff} fs={fs} style={[STYLES.TEXT, textStyle]}>{label}</StyledText>
|
|
74
71
|
{
|
|
75
|
-
renderRightIcon &&
|
|
76
|
-
<TouchableOpacity
|
|
77
|
-
disabled={disabled}
|
|
78
|
-
>
|
|
79
|
-
{renderRightIcon}
|
|
80
|
-
</TouchableOpacity>
|
|
72
|
+
React.isValidElement(renderRightIcon) && renderRightIcon
|
|
81
73
|
}
|
|
82
74
|
</StyledView>
|
|
83
75
|
|
|
84
|
-
</
|
|
76
|
+
</TouchableOpacity>
|
|
85
77
|
</StyledView>
|
|
86
78
|
</>);
|
|
87
79
|
}
|
|
88
80
|
export default Chip;
|
|
89
|
-
export type { ChipProps };
|
|
81
|
+
export type { ChipProps };
|
|
82
|
+
|
|
@@ -1,89 +1,103 @@
|
|
|
1
|
+
import Color from "color";
|
|
1
2
|
import type { ThemeTypes } from "../../types";
|
|
2
3
|
|
|
3
4
|
const getBorderColor = ({
|
|
4
5
|
theme,
|
|
5
6
|
strokeColor,
|
|
6
7
|
disabled,
|
|
8
|
+
active
|
|
7
9
|
}: {
|
|
8
10
|
theme: ThemeTypes;
|
|
9
11
|
strokeColor: string | undefined;
|
|
10
12
|
disabled: boolean;
|
|
13
|
+
active: boolean;
|
|
11
14
|
}) => {
|
|
12
15
|
if (disabled) {
|
|
13
|
-
return theme.colors.
|
|
14
|
-
}
|
|
15
|
-
if (strokeColor) {
|
|
16
|
+
return theme.colors.border.strong;
|
|
17
|
+
} else if (strokeColor) {
|
|
16
18
|
return strokeColor
|
|
19
|
+
} else if (active) {
|
|
20
|
+
return Color(theme.colors.brand.primary).alpha(0.3).rgb().toString();
|
|
17
21
|
}
|
|
18
|
-
return theme.colors.
|
|
22
|
+
return theme.colors.border.default;
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
|
|
22
26
|
const getTextColor = ({
|
|
23
27
|
theme,
|
|
24
|
-
|
|
28
|
+
labelColor,
|
|
25
29
|
disabled
|
|
26
30
|
}: {
|
|
27
31
|
theme: ThemeTypes;
|
|
28
|
-
|
|
32
|
+
labelColor: string | undefined;
|
|
29
33
|
disabled: boolean;
|
|
30
34
|
}) => {
|
|
31
35
|
if (disabled) {
|
|
32
|
-
return theme.colors.
|
|
36
|
+
return theme.colors.typography.disabled;
|
|
33
37
|
}
|
|
34
|
-
else if (
|
|
35
|
-
return
|
|
38
|
+
else if (labelColor) {
|
|
39
|
+
return labelColor;
|
|
36
40
|
}
|
|
37
|
-
return theme.colors.
|
|
41
|
+
return theme.colors.typography.secondary;
|
|
38
42
|
};
|
|
39
43
|
|
|
40
44
|
const getBgColor = ({
|
|
41
45
|
theme,
|
|
42
46
|
bg,
|
|
43
|
-
disabled
|
|
47
|
+
disabled,
|
|
48
|
+
active
|
|
44
49
|
}: {
|
|
45
50
|
theme: ThemeTypes;
|
|
46
51
|
bg: string | undefined;
|
|
47
52
|
disabled: boolean;
|
|
53
|
+
active: boolean;
|
|
48
54
|
}) => {
|
|
49
55
|
if (disabled) {
|
|
50
|
-
return theme.colors.
|
|
51
|
-
}
|
|
52
|
-
else if (bg) {
|
|
56
|
+
return theme.colors.states.disabled;
|
|
57
|
+
} else if (bg) {
|
|
53
58
|
return bg
|
|
59
|
+
} else if (active) {
|
|
60
|
+
return Color(theme.colors.brand.primary).alpha(0.1).rgb().toString();
|
|
54
61
|
}
|
|
55
|
-
return
|
|
62
|
+
return 'transparent'
|
|
63
|
+
// return theme.colors.background.default
|
|
64
|
+
// return Color(theme.colors.brand.primary).alpha(0.2).rgb().toString();
|
|
65
|
+
// return Color(theme.colors.brand.primary).alpha(0.1).rgb().toString();
|
|
56
66
|
};
|
|
57
67
|
|
|
58
68
|
const getChipColors = ({
|
|
59
69
|
theme,
|
|
60
70
|
bg,
|
|
61
|
-
|
|
71
|
+
labelColor,
|
|
62
72
|
strokeColor,
|
|
63
|
-
disabled
|
|
73
|
+
disabled,
|
|
74
|
+
active
|
|
64
75
|
}: {
|
|
65
76
|
theme: ThemeTypes;
|
|
66
77
|
bg: string | undefined;
|
|
67
|
-
|
|
78
|
+
labelColor: string | undefined;
|
|
68
79
|
strokeColor: string | undefined;
|
|
69
80
|
disabled: boolean;
|
|
81
|
+
active: boolean;
|
|
70
82
|
}) => {
|
|
71
83
|
|
|
72
84
|
|
|
73
85
|
const backgroundColor = getBgColor({
|
|
74
86
|
theme,
|
|
75
87
|
bg,
|
|
76
|
-
disabled
|
|
88
|
+
disabled,
|
|
89
|
+
active
|
|
77
90
|
});
|
|
78
91
|
const buttonTextColor = getTextColor({
|
|
79
92
|
theme,
|
|
80
|
-
|
|
93
|
+
labelColor,
|
|
81
94
|
disabled
|
|
82
95
|
});
|
|
83
96
|
const buttonBorderColor = getBorderColor({
|
|
84
97
|
theme,
|
|
85
98
|
strokeColor,
|
|
86
99
|
disabled,
|
|
100
|
+
active
|
|
87
101
|
});
|
|
88
102
|
|
|
89
103
|
return {
|
|
@@ -5,14 +5,15 @@ import type { ViewStyle } from 'react-native';
|
|
|
5
5
|
import { dialogSizes } from '../../constants';
|
|
6
6
|
import Portal from '../Portal/Portal';
|
|
7
7
|
import type { DialogProps, DialogRefProps } from '../../types';
|
|
8
|
+
import { useTheme } from '../../hooks';
|
|
9
|
+
import { verticalScale } from '../../helpers';
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
11
|
-
variant = '
|
|
13
|
+
variant = 'classic',
|
|
12
14
|
size = 'lg',
|
|
13
15
|
fullScreen,
|
|
14
|
-
backdropColor
|
|
15
|
-
// animationDuration = 800,
|
|
16
|
+
backdropColor,
|
|
16
17
|
onClose,
|
|
17
18
|
containerStyle,
|
|
18
19
|
children,
|
|
@@ -21,6 +22,7 @@ const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
|
21
22
|
const [dialogVisible, setDialogVisible] = useState(false);
|
|
22
23
|
const scale = useRef(new Animated.Value(0.9)).current;
|
|
23
24
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
25
|
+
const theme = useTheme();
|
|
24
26
|
|
|
25
27
|
useEffect(() => {
|
|
26
28
|
Animated.timing(opacity, {
|
|
@@ -53,7 +55,7 @@ const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
|
53
55
|
|
|
54
56
|
const backdropAnimatedStyles = {
|
|
55
57
|
opacity: opacity,
|
|
56
|
-
backgroundColor:
|
|
58
|
+
backgroundColor: backdropColor ?? theme?.colors.background.backdrop,
|
|
57
59
|
};
|
|
58
60
|
const modalContAnimatedStyles = {
|
|
59
61
|
transform: [{ scale }],
|
|
@@ -63,6 +65,9 @@ const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
|
63
65
|
minHeight: fullScreen ? '100%' : 'auto',
|
|
64
66
|
maxHeight: fullScreen ? '100%' : '80%',
|
|
65
67
|
width: `${dialogSizes[size]}%`,
|
|
68
|
+
backgroundColor:theme?.colors.background.elevated,
|
|
69
|
+
borderColor: theme?.colors.border.default,
|
|
70
|
+
borderRadius: verticalScale(40)
|
|
66
71
|
};
|
|
67
72
|
|
|
68
73
|
const renderChildrenWithVariant = () => {
|
|
@@ -112,9 +117,9 @@ const STYLES = StyleSheet.create({
|
|
|
112
117
|
alignItems: 'center',
|
|
113
118
|
},
|
|
114
119
|
MODAL_CONT: {
|
|
115
|
-
backgroundColor: '#fff',
|
|
120
|
+
// backgroundColor: '#fff',
|
|
116
121
|
borderRadius: 5,
|
|
117
122
|
borderWidth: 1,
|
|
118
|
-
borderColor: '#d4d4d4'
|
|
123
|
+
// borderColor: '#d4d4d4'
|
|
119
124
|
}
|
|
120
125
|
});
|