react-native-mantine 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -358
- package/lib/commonjs/components/Anchor/index.js +6 -1
- package/lib/commonjs/components/Anchor/index.js.map +1 -1
- package/lib/commonjs/components/Badge/index.js +12 -13
- package/lib/commonjs/components/Badge/index.js.map +1 -1
- package/lib/commonjs/components/Blockquote/index.js +8 -12
- package/lib/commonjs/components/Blockquote/index.js.map +1 -1
- package/lib/commonjs/components/Button/Button.styles.js +4 -4
- package/lib/commonjs/components/Button/Button.styles.js.map +1 -1
- package/lib/commonjs/components/Button/index.js +17 -17
- package/lib/commonjs/components/Button/index.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +8 -9
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/CloseButton/index.js +5 -30
- package/lib/commonjs/components/CloseButton/index.js.map +1 -1
- package/lib/commonjs/components/Code/index.js +13 -8
- package/lib/commonjs/components/Code/index.js.map +1 -1
- package/lib/commonjs/components/Collapse/index.js +10 -2
- package/lib/commonjs/components/Collapse/index.js.map +1 -1
- package/lib/commonjs/components/Dialog/index.js +51 -8
- package/lib/commonjs/components/Dialog/index.js.map +1 -1
- package/lib/commonjs/components/Drawer/index.js +4 -13
- package/lib/commonjs/components/Drawer/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +53 -0
- package/lib/commonjs/components/Icon/index.js.map +1 -0
- package/lib/commonjs/components/Kbd/index.js +7 -8
- package/lib/commonjs/components/Kbd/index.js.map +1 -1
- package/lib/commonjs/components/List/index.js +6 -5
- package/lib/commonjs/components/List/index.js.map +1 -1
- package/lib/commonjs/components/Mark/index.js +4 -0
- package/lib/commonjs/components/Mark/index.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js +20 -22
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/Modal/index.js +10 -16
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/components/NavLink/index.js +7 -11
- package/lib/commonjs/components/NavLink/index.js.map +1 -1
- package/lib/commonjs/components/Notification/index.js +5 -8
- package/lib/commonjs/components/Notification/index.js.map +1 -1
- package/lib/commonjs/components/NumberInput/index.js +2 -1
- package/lib/commonjs/components/NumberInput/index.js.map +1 -1
- package/lib/commonjs/components/PasswordInput/index.js +5 -6
- package/lib/commonjs/components/PasswordInput/index.js.map +1 -1
- package/lib/commonjs/components/PinInput/index.js +7 -2
- package/lib/commonjs/components/PinInput/index.js.map +1 -1
- package/lib/commonjs/components/Popover/index.js +8 -7
- package/lib/commonjs/components/Popover/index.js.map +1 -1
- package/lib/commonjs/components/RingProgress/index.js +49 -7
- package/lib/commonjs/components/RingProgress/index.js.map +1 -1
- package/lib/commonjs/components/SegmentedControl/index.js +7 -4
- package/lib/commonjs/components/SegmentedControl/index.js.map +1 -1
- package/lib/commonjs/components/Slider/index.js +28 -3
- package/lib/commonjs/components/Slider/index.js.map +1 -1
- package/lib/commonjs/components/Stepper/index.js.map +1 -1
- package/lib/commonjs/components/Table/Table.example.js +131 -0
- package/lib/commonjs/components/Table/Table.example.js.map +1 -0
- package/lib/commonjs/components/Table/index.js +85 -29
- package/lib/commonjs/components/Table/index.js.map +1 -1
- package/lib/commonjs/components/TextInput/index.js +2 -2
- package/lib/commonjs/components/TextInput/index.js.map +1 -1
- package/lib/commonjs/components/Timeline/index.js +12 -5
- package/lib/commonjs/components/Timeline/index.js.map +1 -1
- package/lib/commonjs/components/Title/index.js +4 -0
- package/lib/commonjs/components/Title/index.js.map +1 -1
- package/lib/commonjs/components/Tooltip/index.js +12 -11
- package/lib/commonjs/components/Tooltip/index.js.map +1 -1
- package/lib/commonjs/components/TransferList/index.js +3 -8
- package/lib/commonjs/components/TransferList/index.js.map +1 -1
- package/lib/commonjs/components/Transition/index.js +4 -0
- package/lib/commonjs/components/Transition/index.js.map +1 -1
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.js +4 -0
- package/lib/commonjs/components/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/commonjs/components/index.js +22 -22
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/theme/functions/attach-functions.js +3 -0
- package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/helpers.js +12 -1
- package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/index.js +4 -0
- package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
- package/lib/commonjs/theme/functions/fns/rgba.js +50 -0
- package/lib/commonjs/theme/functions/fns/rgba.js.map +1 -0
- package/lib/commonjs/theme/functions/fns/size.js +19 -0
- package/lib/commonjs/theme/functions/fns/size.js.map +1 -0
- package/lib/commonjs/theme/utils/index.js +26 -0
- package/lib/commonjs/theme/utils/index.js.map +1 -0
- package/lib/commonjs/theme/utils/withTextWrapper.js +49 -0
- package/lib/commonjs/theme/utils/withTextWrapper.js.map +1 -0
- package/lib/module/components/Anchor/index.js +6 -1
- package/lib/module/components/Anchor/index.js.map +1 -1
- package/lib/module/components/Badge/index.js +5 -6
- package/lib/module/components/Badge/index.js.map +1 -1
- package/lib/module/components/Blockquote/index.js +6 -10
- package/lib/module/components/Blockquote/index.js.map +1 -1
- package/lib/module/components/Button/Button.styles.js +4 -4
- package/lib/module/components/Button/Button.styles.js.map +1 -1
- package/lib/module/components/Button/index.js +17 -17
- package/lib/module/components/Button/index.js.map +1 -1
- package/lib/module/components/Chip/index.js +5 -6
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/CloseButton/index.js +6 -31
- package/lib/module/components/CloseButton/index.js.map +1 -1
- package/lib/module/components/Code/index.js +13 -8
- package/lib/module/components/Code/index.js.map +1 -1
- package/lib/module/components/Collapse/index.js +10 -2
- package/lib/module/components/Collapse/index.js.map +1 -1
- package/lib/module/components/Dialog/index.js +52 -9
- package/lib/module/components/Dialog/index.js.map +1 -1
- package/lib/module/components/Drawer/index.js +4 -13
- package/lib/module/components/Drawer/index.js.map +1 -1
- package/lib/module/components/Icon/index.js +48 -0
- package/lib/module/components/Icon/index.js.map +1 -0
- package/lib/module/components/Kbd/index.js +5 -6
- package/lib/module/components/Kbd/index.js.map +1 -1
- package/lib/module/components/List/index.js +6 -5
- package/lib/module/components/List/index.js.map +1 -1
- package/lib/module/components/Mark/index.js +4 -0
- package/lib/module/components/Mark/index.js.map +1 -1
- package/lib/module/components/Menu/index.js +16 -18
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/Modal/index.js +10 -16
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/components/NavLink/index.js +5 -9
- package/lib/module/components/NavLink/index.js.map +1 -1
- package/lib/module/components/Notification/index.js +5 -8
- package/lib/module/components/Notification/index.js.map +1 -1
- package/lib/module/components/NumberInput/index.js +2 -1
- package/lib/module/components/NumberInput/index.js.map +1 -1
- package/lib/module/components/PasswordInput/index.js +5 -6
- package/lib/module/components/PasswordInput/index.js.map +1 -1
- package/lib/module/components/PinInput/index.js +7 -2
- package/lib/module/components/PinInput/index.js.map +1 -1
- package/lib/module/components/Popover/index.js +9 -8
- package/lib/module/components/Popover/index.js.map +1 -1
- package/lib/module/components/RingProgress/index.js +51 -9
- package/lib/module/components/RingProgress/index.js.map +1 -1
- package/lib/module/components/SegmentedControl/index.js +7 -4
- package/lib/module/components/SegmentedControl/index.js.map +1 -1
- package/lib/module/components/Slider/index.js +28 -3
- package/lib/module/components/Slider/index.js.map +1 -1
- package/lib/module/components/Stepper/index.js.map +1 -1
- package/lib/module/components/Table/Table.example.js +128 -0
- package/lib/module/components/Table/Table.example.js.map +1 -0
- package/lib/module/components/Table/index.js +86 -29
- package/lib/module/components/Table/index.js.map +1 -1
- package/lib/module/components/TextInput/index.js +2 -2
- package/lib/module/components/TextInput/index.js.map +1 -1
- package/lib/module/components/Timeline/index.js +12 -5
- package/lib/module/components/Timeline/index.js.map +1 -1
- package/lib/module/components/Title/index.js +4 -0
- package/lib/module/components/Title/index.js.map +1 -1
- package/lib/module/components/Tooltip/index.js +11 -10
- package/lib/module/components/Tooltip/index.js.map +1 -1
- package/lib/module/components/TransferList/index.js +4 -9
- package/lib/module/components/TransferList/index.js.map +1 -1
- package/lib/module/components/Transition/index.js +5 -1
- package/lib/module/components/Transition/index.js.map +1 -1
- package/lib/module/components/UnstyledButton/UnstyledButton.js +4 -0
- package/lib/module/components/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/theme/functions/attach-functions.js +3 -0
- package/lib/module/theme/functions/attach-functions.js.map +1 -1
- package/lib/module/theme/functions/fns/helpers.js +10 -0
- package/lib/module/theme/functions/fns/helpers.js.map +1 -1
- package/lib/module/theme/functions/fns/index.js +4 -0
- package/lib/module/theme/functions/fns/index.js.map +1 -1
- package/lib/module/theme/functions/fns/rgba.js +46 -0
- package/lib/module/theme/functions/fns/rgba.js.map +1 -0
- package/lib/module/theme/functions/fns/size.js +15 -0
- package/lib/module/theme/functions/fns/size.js.map +1 -0
- package/lib/module/theme/utils/index.js +5 -0
- package/lib/module/theme/utils/index.js.map +1 -0
- package/lib/module/theme/utils/withTextWrapper.js +45 -0
- package/lib/module/theme/utils/withTextWrapper.js.map +1 -0
- package/lib/typescript/commonjs/src/components/Anchor/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Anchor/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Badge/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Badge/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Blockquote/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Blockquote/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Button/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Chip/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/CloseButton/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Code/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Code/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Collapse/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Drawer/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Icon/index.d.ts +26 -0
- package/lib/typescript/commonjs/src/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Kbd/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Kbd/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/List/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/List/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Mark/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Mark/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/index.d.ts +3 -2
- package/lib/typescript/commonjs/src/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Modal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/NavLink/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/NavLink/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Notification/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Notification/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/NumberInput/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/PinInput/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Popover/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/SegmentedControl/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Slider/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Stepper/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Table/index.d.ts +23 -9
- package/lib/typescript/commonjs/src/components/Table/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/TextInput/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Timeline/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Title/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/Title/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Tooltip/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/TransferList/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Transition/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +7 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts +8 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts +6 -0
- package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/utils/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/theme/utils/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts +41 -0
- package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Anchor/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Anchor/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Badge/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Badge/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Blockquote/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Blockquote/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Chip/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/CloseButton/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Code/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Code/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Collapse/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/index.d.ts +2 -0
- package/lib/typescript/module/src/components/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Drawer/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Icon/index.d.ts +26 -0
- package/lib/typescript/module/src/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Kbd/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Kbd/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/List/index.d.ts +2 -1
- package/lib/typescript/module/src/components/List/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Mark/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Mark/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/index.d.ts +3 -2
- package/lib/typescript/module/src/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Modal/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/NavLink/index.d.ts +2 -1
- package/lib/typescript/module/src/components/NavLink/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Notification/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Notification/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/NumberInput/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/PinInput/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Popover/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/SegmentedControl/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Slider/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Stepper/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Table/Table.example.d.ts +3 -0
- package/lib/typescript/module/src/components/Table/Table.example.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Table/index.d.ts +23 -9
- package/lib/typescript/module/src/components/Table/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/TextInput/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Timeline/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Title/index.d.ts +2 -1
- package/lib/typescript/module/src/components/Title/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Tooltip/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/TransferList/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Transition/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
- package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/typescript/module/src/components/index.d.ts +1 -1
- package/lib/typescript/module/src/components/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +7 -0
- package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/index.d.ts +7 -0
- package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts +8 -0
- package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/functions/fns/size.d.ts +6 -0
- package/lib/typescript/module/src/theme/functions/fns/size.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/utils/index.d.ts +3 -0
- package/lib/typescript/module/src/theme/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts +41 -0
- package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts.map +1 -0
- package/package.json +12 -9
- package/src/components/Anchor/index.tsx +8 -2
- package/src/components/Badge/index.tsx +5 -3
- package/src/components/Blockquote/index.tsx +6 -5
- package/src/components/Button/Button.styles.ts +3 -3
- package/src/components/Button/index.tsx +57 -63
- package/src/components/Chip/index.tsx +8 -6
- package/src/components/CloseButton/index.tsx +2 -23
- package/src/components/Code/index.tsx +19 -14
- package/src/components/Collapse/index.tsx +11 -2
- package/src/components/Dialog/index.tsx +54 -9
- package/src/components/Drawer/index.tsx +7 -13
- package/src/components/Icon/index.tsx +74 -0
- package/src/components/Kbd/index.tsx +5 -4
- package/src/components/List/index.tsx +8 -9
- package/src/components/Mark/index.tsx +7 -2
- package/src/components/Menu/index.tsx +21 -17
- package/src/components/Modal/index.tsx +11 -16
- package/src/components/NavLink/index.tsx +6 -4
- package/src/components/Notification/index.tsx +6 -7
- package/src/components/NumberInput/index.tsx +57 -15
- package/src/components/PasswordInput/index.tsx +2 -2
- package/src/components/PinInput/index.tsx +24 -9
- package/src/components/Popover/index.tsx +13 -10
- package/src/components/RingProgress/index.tsx +51 -8
- package/src/components/SegmentedControl/index.tsx +6 -4
- package/src/components/Slider/index.tsx +14 -3
- package/src/components/Stepper/index.tsx +5 -4
- package/src/components/Table/Table.example.tsx +85 -0
- package/src/components/Table/index.tsx +162 -43
- package/src/components/TextInput/index.tsx +93 -66
- package/src/components/Timeline/index.tsx +19 -12
- package/src/components/Title/index.tsx +7 -2
- package/src/components/Tooltip/index.tsx +13 -10
- package/src/components/TransferList/index.tsx +1 -5
- package/src/components/Transition/index.tsx +14 -2
- package/src/components/UnstyledButton/UnstyledButton.tsx +5 -1
- package/src/components/index.tsx +1 -1
- package/src/theme/functions/attach-functions.ts +3 -0
- package/src/theme/functions/fns/helpers.ts +19 -7
- package/src/theme/functions/fns/index.ts +4 -0
- package/src/theme/functions/fns/rgba.ts +45 -0
- package/src/theme/functions/fns/size.ts +14 -0
- package/src/theme/utils/index.ts +2 -0
- package/src/theme/utils/withTextWrapper.tsx +58 -0
- package/lib/commonjs/components/Portal/index.js +0 -69
- package/lib/commonjs/components/Portal/index.js.map +0 -1
- package/lib/module/components/Portal/index.js +0 -62
- package/lib/module/components/Portal/index.js.map +0 -1
- package/lib/typescript/commonjs/src/components/Portal/index.d.ts +0 -10
- package/lib/typescript/commonjs/src/components/Portal/index.d.ts.map +0 -1
- package/lib/typescript/module/src/components/Portal/index.d.ts +0 -10
- package/lib/typescript/module/src/components/Portal/index.d.ts.map +0 -1
- package/src/components/Portal/index.tsx +0 -75
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import React, { forwardRef, createContext, useContext } from 'react';
|
|
1
|
+
import React, { forwardRef, createContext, useContext, useState, useCallback } from 'react';
|
|
2
2
|
import { ScrollView } from 'react-native';
|
|
3
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
3
4
|
import { BoxView } from '../BoxView';
|
|
4
5
|
import { Text } from '../Text';
|
|
5
6
|
import type { DefaultProps, SpacingValue } from '../../theme/types';
|
|
6
7
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
7
8
|
import { createStyles } from '../../theme';
|
|
8
9
|
import { rem } from '../../theme/utils/rem';
|
|
10
|
+
import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
9
11
|
|
|
10
12
|
interface TableContextValue {
|
|
11
13
|
striped: boolean;
|
|
@@ -15,6 +17,8 @@ interface TableContextValue {
|
|
|
15
17
|
fontSize: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
16
18
|
verticalSpacing: SpacingValue;
|
|
17
19
|
horizontalSpacing: SpacingValue;
|
|
20
|
+
columnWidths: number[];
|
|
21
|
+
onCellLayout: (columnIndex: number, width: number) => void;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
const TableContext = createContext<TableContextValue | null>(null);
|
|
@@ -94,20 +98,26 @@ export interface TableTrProps extends DefaultProps {
|
|
|
94
98
|
__index?: number;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
|
-
export interface TableThProps extends DefaultProps {
|
|
101
|
+
export interface TableThProps extends DefaultProps, WithTextWrapperProps {
|
|
98
102
|
/** Th children */
|
|
99
103
|
children?: React.ReactNode;
|
|
100
104
|
|
|
101
105
|
/** Additional styles */
|
|
102
106
|
style?: any;
|
|
107
|
+
|
|
108
|
+
/** Internal column index */
|
|
109
|
+
__columnIndex?: number;
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
export interface TableTdProps extends DefaultProps {
|
|
112
|
+
export interface TableTdProps extends DefaultProps, WithTextWrapperProps {
|
|
106
113
|
/** Td children */
|
|
107
114
|
children?: React.ReactNode;
|
|
108
115
|
|
|
109
116
|
/** Additional styles */
|
|
110
117
|
style?: any;
|
|
118
|
+
|
|
119
|
+
/** Internal column index */
|
|
120
|
+
__columnIndex?: number;
|
|
111
121
|
}
|
|
112
122
|
|
|
113
123
|
const fontSizes = {
|
|
@@ -130,19 +140,25 @@ const useTableStyles = createStyles(
|
|
|
130
140
|
}
|
|
131
141
|
) => ({
|
|
132
142
|
wrapper: {
|
|
133
|
-
flex: 1
|
|
143
|
+
// No flex: 1 here to avoid constraining the table
|
|
134
144
|
},
|
|
135
145
|
root: {
|
|
136
146
|
width: '100%',
|
|
137
147
|
borderCollapse: 'collapse' as any,
|
|
138
148
|
...(withBorder && {
|
|
139
149
|
borderWidth: 1,
|
|
140
|
-
borderColor:
|
|
150
|
+
borderColor:
|
|
151
|
+
theme.colorScheme === 'dark'
|
|
152
|
+
? theme.colors.dark?.[4]
|
|
153
|
+
: theme.colors.gray?.[3],
|
|
141
154
|
}),
|
|
142
155
|
},
|
|
143
156
|
caption: {
|
|
144
157
|
fontSize: theme.fontSizes.sm as number,
|
|
145
|
-
color:
|
|
158
|
+
color:
|
|
159
|
+
theme.colorScheme === 'dark'
|
|
160
|
+
? theme.colors.dark?.[2]
|
|
161
|
+
: theme.colors.gray?.[6],
|
|
146
162
|
paddingVertical: theme.spacing.xs,
|
|
147
163
|
textAlign: 'center',
|
|
148
164
|
...(captionSide === 'bottom' && { order: 1 }),
|
|
@@ -153,7 +169,10 @@ const useTableStyles = createStyles(
|
|
|
153
169
|
const useTableHeadStyles = createStyles((theme) => ({
|
|
154
170
|
thead: {
|
|
155
171
|
borderBottomWidth: 1,
|
|
156
|
-
borderBottomColor:
|
|
172
|
+
borderBottomColor:
|
|
173
|
+
theme.colorScheme === 'dark'
|
|
174
|
+
? theme.colors.dark?.[4]
|
|
175
|
+
: theme.colors.gray?.[3],
|
|
157
176
|
},
|
|
158
177
|
}));
|
|
159
178
|
|
|
@@ -170,12 +189,18 @@ const useTableRowStyles = createStyles(
|
|
|
170
189
|
}
|
|
171
190
|
) => ({
|
|
172
191
|
tr: {
|
|
192
|
+
flexDirection: 'row',
|
|
173
193
|
borderBottomWidth: 1,
|
|
174
|
-
borderBottomColor:
|
|
194
|
+
borderBottomColor:
|
|
195
|
+
theme.colorScheme === 'dark'
|
|
196
|
+
? theme.colors.dark?.[4]
|
|
197
|
+
: theme.colors.gray?.[3],
|
|
175
198
|
...(striped &&
|
|
176
199
|
isEven && {
|
|
177
200
|
backgroundColor:
|
|
178
|
-
theme.colorScheme === 'dark'
|
|
201
|
+
theme.colorScheme === 'dark'
|
|
202
|
+
? theme.colors.dark?.[6]
|
|
203
|
+
: theme.colors.gray?.[0],
|
|
179
204
|
}),
|
|
180
205
|
},
|
|
181
206
|
})
|
|
@@ -190,12 +215,14 @@ const useTableCellStyles = createStyles(
|
|
|
190
215
|
horizontalSpacing,
|
|
191
216
|
withColumnBorders,
|
|
192
217
|
isHeader,
|
|
218
|
+
width,
|
|
193
219
|
}: {
|
|
194
220
|
fontSize: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
195
221
|
verticalSpacing: SpacingValue;
|
|
196
222
|
horizontalSpacing: SpacingValue;
|
|
197
223
|
withColumnBorders: boolean;
|
|
198
224
|
isHeader: boolean;
|
|
225
|
+
width?: number;
|
|
199
226
|
}
|
|
200
227
|
) => {
|
|
201
228
|
const getVerticalPadding = () => {
|
|
@@ -210,6 +237,9 @@ const useTableCellStyles = createStyles(
|
|
|
210
237
|
|
|
211
238
|
return {
|
|
212
239
|
cell: {
|
|
240
|
+
// Remove flex: 1 to prevent equal spacing
|
|
241
|
+
// Use explicit width when available for column alignment
|
|
242
|
+
...(width && { width }),
|
|
213
243
|
paddingVertical: getVerticalPadding() as any,
|
|
214
244
|
paddingHorizontal: getHorizontalPadding() as any,
|
|
215
245
|
fontSize: fontSizes[fontSize],
|
|
@@ -218,7 +248,9 @@ const useTableCellStyles = createStyles(
|
|
|
218
248
|
...(withColumnBorders && {
|
|
219
249
|
borderRightWidth: 1,
|
|
220
250
|
borderRightColor:
|
|
221
|
-
theme.colorScheme === 'dark'
|
|
251
|
+
theme.colorScheme === 'dark'
|
|
252
|
+
? theme.colors.dark?.[4]
|
|
253
|
+
: theme.colors.gray?.[3],
|
|
222
254
|
}),
|
|
223
255
|
...(isHeader && {
|
|
224
256
|
fontWeight: '600',
|
|
@@ -239,7 +271,7 @@ const defaultProps: Partial<TableProps> = {
|
|
|
239
271
|
captionSide: 'top',
|
|
240
272
|
};
|
|
241
273
|
|
|
242
|
-
|
|
274
|
+
const Table = forwardRef<any, TableProps>((props, ref) => {
|
|
243
275
|
const {
|
|
244
276
|
children,
|
|
245
277
|
horizontalSpacing,
|
|
@@ -255,11 +287,25 @@ export const Table = forwardRef<any, TableProps>((props, ref) => {
|
|
|
255
287
|
...others
|
|
256
288
|
} = useComponentDefaultProps('Table', defaultProps, props);
|
|
257
289
|
|
|
258
|
-
const { styles, sx} = useTableStyles(
|
|
290
|
+
const { styles, sx } = useTableStyles(
|
|
259
291
|
{ withBorder, captionSide },
|
|
260
292
|
{ name: 'Table' }
|
|
261
293
|
) as any;
|
|
262
294
|
|
|
295
|
+
// Track column widths to ensure alignment across rows
|
|
296
|
+
const [columnWidths, setColumnWidths] = useState<number[]>([]);
|
|
297
|
+
|
|
298
|
+
const onCellLayout = useCallback((columnIndex: number, width: number) => {
|
|
299
|
+
setColumnWidths((prevWidths) => {
|
|
300
|
+
const newWidths = [...prevWidths];
|
|
301
|
+
// Store the maximum width for each column to ensure all cells in that column have the same width
|
|
302
|
+
if (!newWidths[columnIndex] || width > newWidths[columnIndex]) {
|
|
303
|
+
newWidths[columnIndex] = width;
|
|
304
|
+
}
|
|
305
|
+
return newWidths;
|
|
306
|
+
});
|
|
307
|
+
}, []);
|
|
308
|
+
|
|
263
309
|
return (
|
|
264
310
|
<TableContext.Provider
|
|
265
311
|
value={{
|
|
@@ -270,9 +316,15 @@ export const Table = forwardRef<any, TableProps>((props, ref) => {
|
|
|
270
316
|
fontSize: fontSize!,
|
|
271
317
|
verticalSpacing: verticalSpacing!,
|
|
272
318
|
horizontalSpacing: horizontalSpacing!,
|
|
319
|
+
columnWidths,
|
|
320
|
+
onCellLayout,
|
|
273
321
|
}}
|
|
274
322
|
>
|
|
275
|
-
<ScrollView
|
|
323
|
+
<ScrollView
|
|
324
|
+
horizontal
|
|
325
|
+
style={styles.wrapper}
|
|
326
|
+
showsHorizontalScrollIndicator
|
|
327
|
+
>
|
|
276
328
|
<BoxView ref={ref} style={sx(styles.root, style)} {...others}>
|
|
277
329
|
{caption && <Text style={styles.caption}>{caption}</Text>}
|
|
278
330
|
{children}
|
|
@@ -282,9 +334,9 @@ export const Table = forwardRef<any, TableProps>((props, ref) => {
|
|
|
282
334
|
);
|
|
283
335
|
});
|
|
284
336
|
|
|
285
|
-
|
|
286
|
-
const { children, style, ...others} = props;
|
|
287
|
-
const { styles, sx} = useTableHeadStyles({}, { name: 'Thead' }) as any;
|
|
337
|
+
const Thead = forwardRef<any, TableTheadProps>((props, ref) => {
|
|
338
|
+
const { children, style, ...others } = props;
|
|
339
|
+
const { styles, sx } = useTableHeadStyles({}, { name: 'Thead' }) as any;
|
|
288
340
|
|
|
289
341
|
return (
|
|
290
342
|
<BoxView ref={ref} style={sx(styles.thead, style)} {...others}>
|
|
@@ -293,7 +345,7 @@ export const Thead = forwardRef<any, TableTheadProps>((props, ref) => {
|
|
|
293
345
|
);
|
|
294
346
|
});
|
|
295
347
|
|
|
296
|
-
|
|
348
|
+
const Tbody = forwardRef<any, TableTbodyProps>((props, ref) => {
|
|
297
349
|
const { children, style, ...others } = props;
|
|
298
350
|
|
|
299
351
|
const childrenArray = React.Children.toArray(children);
|
|
@@ -302,16 +354,19 @@ export const Tbody = forwardRef<any, TableTbodyProps>((props, ref) => {
|
|
|
302
354
|
<BoxView ref={ref} style={style} {...others}>
|
|
303
355
|
{childrenArray.map((child, index) => {
|
|
304
356
|
if (!React.isValidElement(child)) return child;
|
|
305
|
-
return React.cloneElement(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
357
|
+
return React.cloneElement<TableTrProps>(
|
|
358
|
+
child as React.ReactElement<TableTrProps>,
|
|
359
|
+
{
|
|
360
|
+
key: index,
|
|
361
|
+
__index: index,
|
|
362
|
+
}
|
|
363
|
+
);
|
|
309
364
|
})}
|
|
310
365
|
</BoxView>
|
|
311
366
|
);
|
|
312
367
|
});
|
|
313
368
|
|
|
314
|
-
|
|
369
|
+
const Tfoot = forwardRef<any, TableTfootProps>((props, ref) => {
|
|
315
370
|
const { children, style, ...others } = props;
|
|
316
371
|
|
|
317
372
|
return (
|
|
@@ -321,11 +376,11 @@ export const Tfoot = forwardRef<any, TableTfootProps>((props, ref) => {
|
|
|
321
376
|
);
|
|
322
377
|
});
|
|
323
378
|
|
|
324
|
-
|
|
325
|
-
const { children, style, __index, ...others} = props;
|
|
379
|
+
const Tr = forwardRef<any, TableTrProps>((props, ref) => {
|
|
380
|
+
const { children, style, __index, ...others } = props;
|
|
326
381
|
const context = useTableContext();
|
|
327
382
|
|
|
328
|
-
const { styles, sx} = useTableRowStyles(
|
|
383
|
+
const { styles, sx } = useTableRowStyles(
|
|
329
384
|
{
|
|
330
385
|
striped: context?.striped ?? false,
|
|
331
386
|
highlightOnHover: context?.highlightOnHover ?? false,
|
|
@@ -334,53 +389,103 @@ export const Tr = forwardRef<any, TableTrProps>((props, ref) => {
|
|
|
334
389
|
{ name: 'Tr' }
|
|
335
390
|
) as any;
|
|
336
391
|
|
|
392
|
+
// Add column indices to children (Th and Td components)
|
|
393
|
+
const childrenArray = React.Children.toArray(children);
|
|
394
|
+
const childrenWithColumnIndex = childrenArray.map((child, index) => {
|
|
395
|
+
if (!React.isValidElement(child)) return child;
|
|
396
|
+
return React.cloneElement<TableThProps | TableTdProps>(
|
|
397
|
+
child as React.ReactElement<TableThProps | TableTdProps>,
|
|
398
|
+
{
|
|
399
|
+
__columnIndex: index,
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
});
|
|
403
|
+
|
|
337
404
|
return (
|
|
338
405
|
<BoxView ref={ref} style={sx(styles.tr, style)} {...others}>
|
|
339
|
-
{
|
|
406
|
+
{childrenWithColumnIndex}
|
|
340
407
|
</BoxView>
|
|
341
408
|
);
|
|
342
409
|
});
|
|
343
410
|
|
|
344
|
-
|
|
345
|
-
const { children, style, ...others} = props;
|
|
411
|
+
const Th = forwardRef<any, TableThProps>((props, ref) => {
|
|
412
|
+
const { children, style, withTextWrapper: shouldWrapInText = true, __columnIndex, ...others } = props;
|
|
346
413
|
const context = useTableContext();
|
|
347
414
|
|
|
348
|
-
const
|
|
415
|
+
const columnIndex = __columnIndex ?? 0;
|
|
416
|
+
const columnWidth = context?.columnWidths?.[columnIndex];
|
|
417
|
+
|
|
418
|
+
const { styles, sx } = useTableCellStyles(
|
|
349
419
|
{
|
|
350
420
|
fontSize: context?.fontSize ?? 'sm',
|
|
351
421
|
verticalSpacing: context?.verticalSpacing ?? 'xs',
|
|
352
422
|
horizontalSpacing: context?.horizontalSpacing ?? 'xs',
|
|
353
423
|
withColumnBorders: context?.withColumnBorders ?? false,
|
|
354
424
|
isHeader: true,
|
|
425
|
+
width: columnWidth,
|
|
355
426
|
},
|
|
356
427
|
{ name: 'Th' }
|
|
357
428
|
) as any;
|
|
358
429
|
|
|
430
|
+
const handleLayout = useCallback(
|
|
431
|
+
(event: LayoutChangeEvent) => {
|
|
432
|
+
const { width } = event.nativeEvent.layout;
|
|
433
|
+
if (context?.onCellLayout && width > 0) {
|
|
434
|
+
context.onCellLayout(columnIndex, width);
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
[context, columnIndex]
|
|
438
|
+
);
|
|
439
|
+
|
|
359
440
|
return (
|
|
360
|
-
<BoxView
|
|
361
|
-
|
|
441
|
+
<BoxView
|
|
442
|
+
ref={ref}
|
|
443
|
+
style={sx(styles.cell, style)}
|
|
444
|
+
onLayout={handleLayout}
|
|
445
|
+
{...others}
|
|
446
|
+
>
|
|
447
|
+
{withTextWrapper(children, shouldWrapInText, styles.cell)}
|
|
362
448
|
</BoxView>
|
|
363
449
|
);
|
|
364
450
|
});
|
|
365
451
|
|
|
366
|
-
|
|
367
|
-
const { children, style, ...others} = props;
|
|
452
|
+
const Td = forwardRef<any, TableTdProps>((props, ref) => {
|
|
453
|
+
const { children, style, withTextWrapper: shouldWrapInText = true, __columnIndex, ...others } = props;
|
|
368
454
|
const context = useTableContext();
|
|
369
455
|
|
|
370
|
-
const
|
|
456
|
+
const columnIndex = __columnIndex ?? 0;
|
|
457
|
+
const columnWidth = context?.columnWidths?.[columnIndex];
|
|
458
|
+
|
|
459
|
+
const { styles, sx } = useTableCellStyles(
|
|
371
460
|
{
|
|
372
461
|
fontSize: context?.fontSize ?? 'sm',
|
|
373
462
|
verticalSpacing: context?.verticalSpacing ?? 'xs',
|
|
374
463
|
horizontalSpacing: context?.horizontalSpacing ?? 'xs',
|
|
375
464
|
withColumnBorders: context?.withColumnBorders ?? false,
|
|
376
465
|
isHeader: false,
|
|
466
|
+
width: columnWidth,
|
|
377
467
|
},
|
|
378
468
|
{ name: 'Td' }
|
|
379
469
|
) as any;
|
|
380
470
|
|
|
471
|
+
const handleLayout = useCallback(
|
|
472
|
+
(event: LayoutChangeEvent) => {
|
|
473
|
+
const { width } = event.nativeEvent.layout;
|
|
474
|
+
if (context?.onCellLayout && width > 0) {
|
|
475
|
+
context.onCellLayout(columnIndex, width);
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
[context, columnIndex]
|
|
479
|
+
);
|
|
480
|
+
|
|
381
481
|
return (
|
|
382
|
-
<BoxView
|
|
383
|
-
|
|
482
|
+
<BoxView
|
|
483
|
+
ref={ref}
|
|
484
|
+
style={sx(styles.cell, style)}
|
|
485
|
+
onLayout={handleLayout}
|
|
486
|
+
{...others}
|
|
487
|
+
>
|
|
488
|
+
{withTextWrapper(children, shouldWrapInText, styles.cell)}
|
|
384
489
|
</BoxView>
|
|
385
490
|
);
|
|
386
491
|
});
|
|
@@ -393,10 +498,24 @@ Tr.displayName = 'Table.Tr';
|
|
|
393
498
|
Th.displayName = 'Table.Th';
|
|
394
499
|
Td.displayName = 'Table.Td';
|
|
395
500
|
|
|
396
|
-
// Attach sub-components
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
501
|
+
// Attach sub-components with proper typing
|
|
502
|
+
interface TableComponent extends React.ForwardRefExoticComponent<
|
|
503
|
+
TableProps & React.RefAttributes<any>
|
|
504
|
+
> {
|
|
505
|
+
Thead: typeof Thead;
|
|
506
|
+
Tbody: typeof Tbody;
|
|
507
|
+
Tfoot: typeof Tfoot;
|
|
508
|
+
Tr: typeof Tr;
|
|
509
|
+
Th: typeof Th;
|
|
510
|
+
Td: typeof Td;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const TableWithSubComponents = Table as TableComponent;
|
|
514
|
+
TableWithSubComponents.Thead = Thead;
|
|
515
|
+
TableWithSubComponents.Tbody = Tbody;
|
|
516
|
+
TableWithSubComponents.Tfoot = Tfoot;
|
|
517
|
+
TableWithSubComponents.Tr = Tr;
|
|
518
|
+
TableWithSubComponents.Th = Th;
|
|
519
|
+
TableWithSubComponents.Td = Td;
|
|
520
|
+
|
|
521
|
+
export { TableWithSubComponents as Table };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
TextInput as RNTextInput,
|
|
4
|
+
type TextInputProps as RNTextInputProps,
|
|
5
|
+
} from 'react-native';
|
|
3
6
|
import { BoxView } from '../BoxView';
|
|
4
7
|
import { Text } from '../Text';
|
|
5
8
|
import type {
|
|
@@ -12,7 +15,8 @@ import { createStyles, getSize } from '../../theme';
|
|
|
12
15
|
import { rem } from '../../theme/utils/rem';
|
|
13
16
|
import { INPUT_SIZES } from '../Input';
|
|
14
17
|
|
|
15
|
-
export interface TextInputProps
|
|
18
|
+
export interface TextInputProps
|
|
19
|
+
extends DefaultProps, Omit<RNTextInputProps, 'style'> {
|
|
16
20
|
/** Input label */
|
|
17
21
|
label?: React.ReactNode;
|
|
18
22
|
|
|
@@ -71,7 +75,10 @@ const useStyles = createStyles(
|
|
|
71
75
|
const getVariantStyles = () => {
|
|
72
76
|
if (variant === 'filled') {
|
|
73
77
|
return {
|
|
74
|
-
backgroundColor:
|
|
78
|
+
backgroundColor:
|
|
79
|
+
theme.colorScheme === 'dark'
|
|
80
|
+
? (theme.colors.dark || [])[5]
|
|
81
|
+
: (theme.colors.gray || [])[1],
|
|
75
82
|
borderWidth: 1,
|
|
76
83
|
borderColor: 'transparent',
|
|
77
84
|
};
|
|
@@ -87,13 +94,20 @@ const useStyles = createStyles(
|
|
|
87
94
|
|
|
88
95
|
// default variant
|
|
89
96
|
return {
|
|
90
|
-
backgroundColor:
|
|
97
|
+
backgroundColor:
|
|
98
|
+
theme.colorScheme === 'dark'
|
|
99
|
+
? (theme.colors.dark || [])[6]
|
|
100
|
+
: theme.white,
|
|
91
101
|
borderWidth: 1,
|
|
92
|
-
borderColor:
|
|
102
|
+
borderColor:
|
|
103
|
+
theme.colorScheme === 'dark'
|
|
104
|
+
? (theme.colors.dark || [])[4]
|
|
105
|
+
: (theme.colors.gray || [])[4],
|
|
93
106
|
};
|
|
94
107
|
};
|
|
95
108
|
|
|
96
|
-
const sizeValue =
|
|
109
|
+
const sizeValue =
|
|
110
|
+
INPUT_SIZES[size as keyof typeof INPUT_SIZES] || INPUT_SIZES.md;
|
|
97
111
|
|
|
98
112
|
return {
|
|
99
113
|
wrapper: {
|
|
@@ -102,7 +116,10 @@ const useStyles = createStyles(
|
|
|
102
116
|
label: {
|
|
103
117
|
fontSize: theme.fontSizes.sm as number,
|
|
104
118
|
fontWeight: '500',
|
|
105
|
-
color:
|
|
119
|
+
color:
|
|
120
|
+
theme.colorScheme === 'dark'
|
|
121
|
+
? (theme.colors.dark || [])[0]
|
|
122
|
+
: theme.black,
|
|
106
123
|
marginBottom: theme.spacing.xs / 2,
|
|
107
124
|
},
|
|
108
125
|
required: {
|
|
@@ -110,7 +127,10 @@ const useStyles = createStyles(
|
|
|
110
127
|
},
|
|
111
128
|
description: {
|
|
112
129
|
fontSize: theme.fontSizes.xs as number,
|
|
113
|
-
color:
|
|
130
|
+
color:
|
|
131
|
+
theme.colorScheme === 'dark'
|
|
132
|
+
? (theme.colors.dark || [])[2]
|
|
133
|
+
: (theme.colors.gray || [])[6],
|
|
114
134
|
marginTop: theme.spacing.xs / 2,
|
|
115
135
|
marginBottom: theme.spacing.xs / 2,
|
|
116
136
|
},
|
|
@@ -123,23 +143,30 @@ const useStyles = createStyles(
|
|
|
123
143
|
position: 'relative',
|
|
124
144
|
},
|
|
125
145
|
input: {
|
|
126
|
-
...theme.fn.fontStyles(),
|
|
127
146
|
height: sizeValue as any,
|
|
128
147
|
fontSize: getSize({ size, sizes: theme.fontSizes }) as any,
|
|
129
148
|
paddingHorizontal: (variant === 'unstyled' ? 0 : rem(12)) as any,
|
|
130
|
-
paddingLeft: (withIcon
|
|
149
|
+
paddingLeft: (withIcon
|
|
150
|
+
? sizeValue
|
|
151
|
+
: variant === 'unstyled'
|
|
152
|
+
? 0
|
|
153
|
+
: rem(12)) as any,
|
|
131
154
|
paddingRight: (withRightSection
|
|
132
155
|
? rem(rightSectionWidth || sizeValue)
|
|
133
156
|
: variant === 'unstyled'
|
|
134
|
-
|
|
135
|
-
|
|
157
|
+
? 0
|
|
158
|
+
: rem(12)) as any,
|
|
136
159
|
borderRadius: theme.fn.radius(radius),
|
|
137
|
-
color:
|
|
160
|
+
color:
|
|
161
|
+
theme.colorScheme === 'dark'
|
|
162
|
+
? (theme.colors.dark || [])[0]
|
|
163
|
+
: theme.black,
|
|
138
164
|
...getVariantStyles(),
|
|
139
165
|
...(invalid && {
|
|
140
166
|
borderColor: (theme.colors.red || [])[6],
|
|
141
167
|
color: (theme.colors.red || [])[6],
|
|
142
168
|
}),
|
|
169
|
+
fontFamily: theme.fontFamilyInput,
|
|
143
170
|
},
|
|
144
171
|
icon: {
|
|
145
172
|
position: 'absolute',
|
|
@@ -171,62 +198,62 @@ const defaultProps: Partial<TextInputProps> = {
|
|
|
171
198
|
required: false,
|
|
172
199
|
};
|
|
173
200
|
|
|
174
|
-
export const TextInput = forwardRef<RNTextInput, TextInputProps>(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
icon,
|
|
182
|
-
rightSection,
|
|
183
|
-
rightSectionWidth,
|
|
184
|
-
required,
|
|
185
|
-
variant,
|
|
186
|
-
style,
|
|
187
|
-
wrapperStyle,
|
|
188
|
-
...others
|
|
189
|
-
} = useComponentDefaultProps('TextInput', defaultProps, props);
|
|
190
|
-
|
|
191
|
-
const { styles, sx} = useStyles(
|
|
192
|
-
{
|
|
201
|
+
export const TextInput = forwardRef<RNTextInput, TextInputProps>(
|
|
202
|
+
(props, ref) => {
|
|
203
|
+
const {
|
|
204
|
+
label,
|
|
205
|
+
description,
|
|
206
|
+
error,
|
|
207
|
+
size,
|
|
193
208
|
radius,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
withRightSection: !!rightSection,
|
|
209
|
+
icon,
|
|
210
|
+
rightSection,
|
|
197
211
|
rightSectionWidth,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
{
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<BoxView style={styles.rightSectionContainer}>{rightSection}</BoxView>
|
|
212
|
+
required,
|
|
213
|
+
variant,
|
|
214
|
+
style,
|
|
215
|
+
wrapperStyle,
|
|
216
|
+
...others
|
|
217
|
+
} = useComponentDefaultProps('TextInput', defaultProps, props);
|
|
218
|
+
|
|
219
|
+
const { styles, sx } = useStyles(
|
|
220
|
+
{
|
|
221
|
+
radius,
|
|
222
|
+
invalid: !!error,
|
|
223
|
+
withIcon: !!icon,
|
|
224
|
+
withRightSection: !!rightSection,
|
|
225
|
+
rightSectionWidth,
|
|
226
|
+
},
|
|
227
|
+
{ name: 'TextInput', variant, size }
|
|
228
|
+
) as any;
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<BoxView style={sx(styles.wrapper, wrapperStyle)}>
|
|
232
|
+
{label && (
|
|
233
|
+
<Text style={styles.label}>
|
|
234
|
+
{label}
|
|
235
|
+
{required && <Text style={styles.required}> *</Text>}
|
|
236
|
+
</Text>
|
|
224
237
|
)}
|
|
225
|
-
</BoxView>
|
|
226
238
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
239
|
+
{description && <Text style={styles.description}>{description}</Text>}
|
|
240
|
+
|
|
241
|
+
<BoxView style={styles.inputWrapper}>
|
|
242
|
+
{icon && <BoxView style={styles.icon}>{icon}</BoxView>}
|
|
243
|
+
|
|
244
|
+
<RNTextInput ref={ref} style={sx(styles.input, style)} {...others} />
|
|
245
|
+
|
|
246
|
+
{rightSection && (
|
|
247
|
+
<BoxView style={styles.rightSectionContainer}>
|
|
248
|
+
{rightSection}
|
|
249
|
+
</BoxView>
|
|
250
|
+
)}
|
|
251
|
+
</BoxView>
|
|
252
|
+
|
|
253
|
+
{error && <Text style={styles.error}>{error}</Text>}
|
|
254
|
+
</BoxView>
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
);
|
|
231
258
|
|
|
232
259
|
TextInput.displayName = 'TextInput';
|
|
@@ -244,12 +244,15 @@ const TimelineRoot = forwardRef<any, TimelineProps>((props, ref) => {
|
|
|
244
244
|
? index >= itemsCount - (active! + 1)
|
|
245
245
|
: index <= active!;
|
|
246
246
|
|
|
247
|
-
return React.cloneElement
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
return React.cloneElement<TimelineItemProps & { __isActive?: boolean }>(
|
|
248
|
+
child as React.ReactElement<TimelineItemProps & { __isActive?: boolean }>,
|
|
249
|
+
{
|
|
250
|
+
key: index,
|
|
251
|
+
__index: index,
|
|
252
|
+
__isLast: index === itemsCount - 1,
|
|
253
|
+
__isActive: isActive,
|
|
254
|
+
}
|
|
255
|
+
);
|
|
253
256
|
})}
|
|
254
257
|
</BoxView>
|
|
255
258
|
</TimelineContext.Provider>
|
|
@@ -304,14 +307,18 @@ export const TimelineItem = forwardRef<
|
|
|
304
307
|
|
|
305
308
|
<BoxView style={styles.itemBody}>
|
|
306
309
|
{title && (
|
|
307
|
-
|
|
308
|
-
{
|
|
309
|
-
|
|
310
|
+
typeof title === 'string' ? (
|
|
311
|
+
<Text style={styles.title}>{title}</Text>
|
|
312
|
+
) : (
|
|
313
|
+
<BoxView style={{ marginBottom: rem(4) }}>{title}</BoxView>
|
|
314
|
+
)
|
|
310
315
|
)}
|
|
311
316
|
{children && (
|
|
312
|
-
|
|
313
|
-
{
|
|
314
|
-
|
|
317
|
+
typeof children === 'string' ? (
|
|
318
|
+
<Text style={styles.content}>{children}</Text>
|
|
319
|
+
) : (
|
|
320
|
+
<BoxView>{children}</BoxView>
|
|
321
|
+
)
|
|
315
322
|
)}
|
|
316
323
|
</BoxView>
|
|
317
324
|
</BoxView>
|