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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,eAAO,MAAM,GAAG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,eAAO,MAAM,GAAG;iBALG,iDACZ;;;sBAYA,iDAAmB;;;kBAAwH,kDAAoB;wBAAgM,kDAAoB;;;YAA8F,kDAAoB,MAAQ,eAAkB;;;;;;;YAAkJ,kDAAoB,MAAM,WAAW;mBAAuM,kDAAoB;;;;;;;;;qEAA3oB,uCAAmB;;CAD/R,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a hex or rgb color string to rgba with the specified alpha value
|
|
3
|
+
* @param color - The color string (hex or rgb)
|
|
4
|
+
* @param alpha - Alpha value between 0 and 1
|
|
5
|
+
* @returns rgba color string
|
|
6
|
+
*/
|
|
7
|
+
export declare function rgba(_theme: any): (color: string, alpha: number) => string;
|
|
8
|
+
//# sourceMappingURL=rgba.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rgba.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/rgba.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,GAAG,IACtB,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,MAAM,CAqC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/size.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAgB,IAAI,CAAC,MAAM,EAAE,GAAG,IACtB,KAAK,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,kBAGrC;IACD,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;CACd,KAAG,MAAM,CAGX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/theme/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TextProps } from '../../components/Text';
|
|
3
|
+
/**
|
|
4
|
+
* Conditionally wraps content in a Text component based on the withTextWrapper prop.
|
|
5
|
+
*
|
|
6
|
+
* In React Native, all text must be wrapped in a Text component. However, some
|
|
7
|
+
* components may need flexibility to render with or without this wrapper depending
|
|
8
|
+
* on whether their content is text or other components (like icons, views, etc.).
|
|
9
|
+
*
|
|
10
|
+
* @param children - The content to potentially wrap
|
|
11
|
+
* @param shouldWrap - Whether to wrap the content in a Text component
|
|
12
|
+
* @param textStyle - Optional style to apply to the Text wrapper
|
|
13
|
+
* @param textProps - Optional additional props to pass to the Text component
|
|
14
|
+
* @returns The children wrapped in Text if shouldWrap is true, otherwise just the children
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Wrap text content
|
|
18
|
+
* withTextWrapper('Hello', true, styles.text)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Don't wrap components
|
|
22
|
+
* withTextWrapper(<Icon />, false)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Default behavior (wrap)
|
|
26
|
+
* withTextWrapper('Text', true, styles.text, { numberOfLines: 1 })
|
|
27
|
+
*/
|
|
28
|
+
export declare function withTextWrapper(children: ReactNode, shouldWrap?: boolean, textStyle?: any, textProps?: Omit<TextProps, 'children' | 'style'>): ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Type helper for components that support the withTextWrapper pattern.
|
|
31
|
+
* Add this to your component props interface.
|
|
32
|
+
*/
|
|
33
|
+
export interface WithTextWrapperProps {
|
|
34
|
+
/**
|
|
35
|
+
* If false, children will not be wrapped in a Text component.
|
|
36
|
+
* This is useful when the children contain non-text elements like icons or custom components.
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
withTextWrapper?: boolean;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=withTextWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withTextWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/theme/utils/withTextWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,EACnB,UAAU,GAAE,OAAc,EAC1B,SAAS,CAAC,EAAE,GAAG,EACf,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,GAChD,SAAS,CAUX;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-mantine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Make Mantine Accessable on React Native",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -74,7 +74,8 @@
|
|
|
74
74
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
75
75
|
"@types/jest": "^29.5.5",
|
|
76
76
|
"@types/lodash-es": "^4.17.12",
|
|
77
|
-
"@types/react": "^
|
|
77
|
+
"@types/react": "^19.0.0",
|
|
78
|
+
"@types/react-native-vector-icons": "^6.4.18",
|
|
78
79
|
"commitlint": "^17.0.2",
|
|
79
80
|
"del-cli": "^5.1.0",
|
|
80
81
|
"eslint": "^8.51.0",
|
|
@@ -83,18 +84,20 @@
|
|
|
83
84
|
"jest": "^29.7.0",
|
|
84
85
|
"prettier": "^3.0.3",
|
|
85
86
|
"prettier-eslint": "^16.3.0",
|
|
86
|
-
"react": "
|
|
87
|
-
"react-native": "0.
|
|
87
|
+
"react": "19.1.0",
|
|
88
|
+
"react-native": "0.81.5",
|
|
88
89
|
"react-native-builder-bob": "latest",
|
|
90
|
+
"react-native-vector-icons": "^10.0.0",
|
|
89
91
|
"release-it": "^15.0.0",
|
|
90
92
|
"typescript": "^5.2.2"
|
|
91
93
|
},
|
|
92
94
|
"resolutions": {
|
|
93
|
-
"@types/react": "^
|
|
95
|
+
"@types/react": "^19.0.0"
|
|
94
96
|
},
|
|
95
97
|
"peerDependencies": {
|
|
96
98
|
"react": "*",
|
|
97
|
-
"react-native": "*"
|
|
99
|
+
"react-native": "*",
|
|
100
|
+
"react-native-vector-icons": "^10.0.0"
|
|
98
101
|
},
|
|
99
102
|
"workspaces": [
|
|
100
103
|
"example"
|
|
@@ -189,9 +192,9 @@
|
|
|
189
192
|
"version": "0.41.2"
|
|
190
193
|
},
|
|
191
194
|
"dependencies": {
|
|
192
|
-
"expo-clipboard": "~
|
|
193
|
-
"expo-font": "~
|
|
194
|
-
"expo-linear-gradient": "~
|
|
195
|
+
"expo-clipboard": "~8.0.8",
|
|
196
|
+
"expo-font": "~14.0.10",
|
|
197
|
+
"expo-linear-gradient": "~15.0.8",
|
|
195
198
|
"lodash-es": "^4.17.21"
|
|
196
199
|
}
|
|
197
200
|
}
|
|
@@ -10,8 +10,9 @@ import type {
|
|
|
10
10
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
11
11
|
import { createStyles } from '../../theme';
|
|
12
12
|
import { rem } from '../../theme/utils/rem';
|
|
13
|
+
import type { WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
13
14
|
|
|
14
|
-
export interface AnchorProps extends DefaultProps {
|
|
15
|
+
export interface AnchorProps extends DefaultProps, WithTextWrapperProps {
|
|
15
16
|
/** Anchor text color from theme */
|
|
16
17
|
color?: MantineColor;
|
|
17
18
|
|
|
@@ -103,10 +104,11 @@ const defaultProps: Partial<AnchorProps> = {
|
|
|
103
104
|
weight: '400',
|
|
104
105
|
underline: true,
|
|
105
106
|
variant: 'link',
|
|
107
|
+
withTextWrapper: true,
|
|
106
108
|
};
|
|
107
109
|
|
|
108
110
|
export const Anchor = forwardRef<RNText, AnchorProps>((props, ref) => {
|
|
109
|
-
const { color, size, weight, underline, variant, href, onPress, children, style, ...others} =
|
|
111
|
+
const { color, size, weight, underline, variant, href, onPress, children, style, withTextWrapper: shouldWrapInText, ...others} =
|
|
110
112
|
useComponentDefaultProps('Anchor', defaultProps, props);
|
|
111
113
|
|
|
112
114
|
const { styles, sx} = useStyles(
|
|
@@ -124,6 +126,10 @@ export const Anchor = forwardRef<RNText, AnchorProps>((props, ref) => {
|
|
|
124
126
|
}
|
|
125
127
|
};
|
|
126
128
|
|
|
129
|
+
if (!shouldWrapInText) {
|
|
130
|
+
return children;
|
|
131
|
+
}
|
|
132
|
+
|
|
127
133
|
return (
|
|
128
134
|
<Text
|
|
129
135
|
ref={ref}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { Text } from '../Text';
|
|
3
2
|
import { BoxView } from '../BoxView';
|
|
4
3
|
import type {
|
|
5
4
|
DefaultProps,
|
|
@@ -11,8 +10,9 @@ import type {
|
|
|
11
10
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
12
11
|
import { createStyles } from '../../theme';
|
|
13
12
|
import { rem } from '../../theme/utils/rem';
|
|
13
|
+
import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
14
14
|
|
|
15
|
-
export interface BadgeProps extends DefaultProps {
|
|
15
|
+
export interface BadgeProps extends DefaultProps, WithTextWrapperProps {
|
|
16
16
|
/** Badge color from theme */
|
|
17
17
|
color?: MantineColor;
|
|
18
18
|
|
|
@@ -157,6 +157,7 @@ const defaultProps: Partial<BadgeProps> = {
|
|
|
157
157
|
size: 'md',
|
|
158
158
|
radius: 'xl',
|
|
159
159
|
fullWidth: false,
|
|
160
|
+
withTextWrapper: true,
|
|
160
161
|
};
|
|
161
162
|
|
|
162
163
|
export const Badge = forwardRef<any, BadgeProps>((props, ref) => {
|
|
@@ -170,6 +171,7 @@ export const Badge = forwardRef<any, BadgeProps>((props, ref) => {
|
|
|
170
171
|
rightSection,
|
|
171
172
|
children,
|
|
172
173
|
style,
|
|
174
|
+
withTextWrapper: shouldWrapInText,
|
|
173
175
|
...others
|
|
174
176
|
} = useComponentDefaultProps('Badge', defaultProps, props);
|
|
175
177
|
|
|
@@ -183,7 +185,7 @@ export const Badge = forwardRef<any, BadgeProps>((props, ref) => {
|
|
|
183
185
|
<BoxView style={styles.inner}>
|
|
184
186
|
{variant === 'dot' && <BoxView style={styles.dot} />}
|
|
185
187
|
{leftSection && <BoxView style={styles.leftSection}>{leftSection}</BoxView>}
|
|
186
|
-
|
|
188
|
+
{withTextWrapper(children, shouldWrapInText, styles.label)}
|
|
187
189
|
{rightSection && <BoxView style={styles.rightSection}>{rightSection}</BoxView>}
|
|
188
190
|
</BoxView>
|
|
189
191
|
</BoxView>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { BoxView } from '../BoxView';
|
|
3
|
-
import { Text } from '../Text';
|
|
4
3
|
import type {
|
|
5
4
|
DefaultProps,
|
|
6
5
|
MantineColor,
|
|
@@ -9,8 +8,9 @@ import type {
|
|
|
9
8
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
10
9
|
import { createStyles } from '../../theme';
|
|
11
10
|
import { rem } from '../../theme/utils/rem';
|
|
11
|
+
import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
12
12
|
|
|
13
|
-
export interface BlockquoteProps extends DefaultProps {
|
|
13
|
+
export interface BlockquoteProps extends DefaultProps, WithTextWrapperProps {
|
|
14
14
|
/** Blockquote color from theme */
|
|
15
15
|
color?: MantineColor;
|
|
16
16
|
|
|
@@ -80,10 +80,11 @@ const useStyles = createStyles(
|
|
|
80
80
|
const defaultProps: Partial<BlockquoteProps> = {
|
|
81
81
|
color: 'blue',
|
|
82
82
|
radius: 'sm',
|
|
83
|
+
withTextWrapper: true,
|
|
83
84
|
};
|
|
84
85
|
|
|
85
86
|
export const Blockquote = forwardRef<any, BlockquoteProps>((props, ref) => {
|
|
86
|
-
const { color, icon, cite, radius, children, style} =
|
|
87
|
+
const { color, icon, cite, radius, children, style, withTextWrapper: shouldWrapInText} =
|
|
87
88
|
useComponentDefaultProps('Blockquote', defaultProps, props);
|
|
88
89
|
|
|
89
90
|
const { styles, sx, ...others} = useStyles({ color, radius}, { name: 'Blockquote' }) as any;
|
|
@@ -93,8 +94,8 @@ export const Blockquote = forwardRef<any, BlockquoteProps>((props, ref) => {
|
|
|
93
94
|
<BoxView style={styles.inner}>
|
|
94
95
|
{icon && <BoxView style={styles.icon}>{icon}</BoxView>}
|
|
95
96
|
<BoxView style={styles.body}>
|
|
96
|
-
|
|
97
|
-
{cite &&
|
|
97
|
+
{withTextWrapper(children, shouldWrapInText, styles.content)}
|
|
98
|
+
{cite && withTextWrapper(cite, shouldWrapInText, styles.cite)}
|
|
98
99
|
</BoxView>
|
|
99
100
|
</BoxView>
|
|
100
101
|
</BoxView>
|
|
@@ -189,10 +189,8 @@ const useStyles = createStyles(
|
|
|
189
189
|
|
|
190
190
|
inner: {
|
|
191
191
|
display: 'flex',
|
|
192
|
-
alignItems: 'center',
|
|
193
|
-
justifyContent: 'center',
|
|
194
192
|
height: '100%',
|
|
195
|
-
|
|
193
|
+
flex: 1,
|
|
196
194
|
},
|
|
197
195
|
|
|
198
196
|
label: {
|
|
@@ -202,6 +200,8 @@ const useStyles = createStyles(
|
|
|
202
200
|
display: 'flex',
|
|
203
201
|
alignItems: 'center',
|
|
204
202
|
justifyContent: 'center',
|
|
203
|
+
flexDirection: 'row',
|
|
204
|
+
flex: 1,
|
|
205
205
|
},
|
|
206
206
|
};
|
|
207
207
|
}
|
|
@@ -13,11 +13,11 @@ import { ActivityIndicator, View } from 'react-native';
|
|
|
13
13
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
14
14
|
import useStyles from './Button.styles';
|
|
15
15
|
import { BoxView } from '../BoxView';
|
|
16
|
-
import {
|
|
16
|
+
import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
17
17
|
|
|
18
18
|
export type ButtonStylesNames = any;
|
|
19
19
|
|
|
20
|
-
export interface ButtonProps extends DefaultProps {
|
|
20
|
+
export interface ButtonProps extends DefaultProps, WithTextWrapperProps {
|
|
21
21
|
/** Predefined button size */
|
|
22
22
|
size?: MantineSize;
|
|
23
23
|
|
|
@@ -76,60 +76,62 @@ const defaultProps: Partial<ButtonProps> = {
|
|
|
76
76
|
type: 'button',
|
|
77
77
|
variant: 'filled',
|
|
78
78
|
loaderPosition: 'left',
|
|
79
|
+
withTextWrapper: true,
|
|
79
80
|
};
|
|
80
81
|
|
|
81
|
-
export const _Button = forwardRef<View, ButtonProps>(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
export const _Button = forwardRef<View, ButtonProps>((props, ref) => {
|
|
83
|
+
const {
|
|
84
|
+
size,
|
|
85
|
+
color,
|
|
86
|
+
type,
|
|
87
|
+
disabled,
|
|
88
|
+
children,
|
|
89
|
+
leftIcon,
|
|
90
|
+
rightIcon,
|
|
91
|
+
fullWidth,
|
|
92
|
+
variant,
|
|
93
|
+
radius,
|
|
94
|
+
uppercase,
|
|
95
|
+
compact,
|
|
96
|
+
loading,
|
|
97
|
+
loaderPosition,
|
|
98
|
+
loaderProps,
|
|
99
|
+
gradient,
|
|
100
|
+
style,
|
|
101
|
+
withTextWrapper: shouldWrapInText,
|
|
102
|
+
...others
|
|
103
|
+
} = useComponentDefaultProps('Button', defaultProps, props);
|
|
104
|
+
|
|
105
|
+
const { styles, sx } = useStyles(
|
|
106
|
+
{
|
|
107
|
+
radius,
|
|
85
108
|
color,
|
|
86
|
-
type,
|
|
87
|
-
disabled,
|
|
88
|
-
children,
|
|
89
|
-
leftIcon,
|
|
90
|
-
rightIcon,
|
|
91
109
|
fullWidth,
|
|
92
|
-
variant,
|
|
93
|
-
radius,
|
|
94
|
-
uppercase,
|
|
95
110
|
compact,
|
|
96
|
-
loading,
|
|
97
|
-
loaderPosition,
|
|
98
|
-
loaderProps,
|
|
99
111
|
gradient,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return (
|
|
124
|
-
<UnstyledButton
|
|
125
|
-
style={sx(styles.root, style)}
|
|
126
|
-
data-button
|
|
127
|
-
data-disabled={disabled || undefined}
|
|
128
|
-
data-loading={loading || undefined}
|
|
129
|
-
ref={ref}
|
|
130
|
-
{...others}
|
|
131
|
-
>
|
|
132
|
-
<BoxView style={styles.inner}>
|
|
112
|
+
withLeftIcon: !!leftIcon,
|
|
113
|
+
withRightIcon: !!rightIcon,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Button',
|
|
117
|
+
variant,
|
|
118
|
+
size,
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const loader = <ActivityIndicator />;
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<UnstyledButton
|
|
126
|
+
style={sx(styles.root, style)}
|
|
127
|
+
data-button
|
|
128
|
+
data-disabled={disabled || undefined}
|
|
129
|
+
data-loading={loading || undefined}
|
|
130
|
+
ref={ref}
|
|
131
|
+
{...others}
|
|
132
|
+
>
|
|
133
|
+
<BoxView style={styles.inner}>
|
|
134
|
+
<BoxView style={styles.label}>
|
|
133
135
|
{(leftIcon || (loading && loaderPosition === 'left')) && (
|
|
134
136
|
<BoxView style={sx(styles.icon, styles.leftIcon)}>
|
|
135
137
|
{loading && loaderPosition === 'left' ? loader : leftIcon}
|
|
@@ -139,24 +141,16 @@ export const _Button = forwardRef<View, ButtonProps>(
|
|
|
139
141
|
{loading && loaderPosition === 'center' && (
|
|
140
142
|
<BoxView style={styles.centerLoader}>{loader}</BoxView>
|
|
141
143
|
)}
|
|
142
|
-
|
|
143
|
-
<BoxView style={styles.label}>
|
|
144
|
-
{typeof children === 'string' || typeof children === 'number' ? (
|
|
145
|
-
<Text>{children}</Text>
|
|
146
|
-
) : (
|
|
147
|
-
children
|
|
148
|
-
)}
|
|
149
|
-
</BoxView>
|
|
150
|
-
|
|
144
|
+
{withTextWrapper(children, shouldWrapInText)}
|
|
151
145
|
{(rightIcon || (loading && loaderPosition === 'right')) && (
|
|
152
146
|
<BoxView style={sx(styles.icon, styles.rightIcon)}>
|
|
153
147
|
{loading && loaderPosition === 'right' ? loader : rightIcon}
|
|
154
148
|
</BoxView>
|
|
155
149
|
)}
|
|
156
150
|
</BoxView>
|
|
157
|
-
</
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
) as any;
|
|
151
|
+
</BoxView>
|
|
152
|
+
</UnstyledButton>
|
|
153
|
+
);
|
|
154
|
+
}) as any;
|
|
161
155
|
|
|
162
156
|
export const Button = _Button;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import { BoxView } from '../BoxView';
|
|
4
|
-
import { Text } from '../Text';
|
|
5
4
|
import type {
|
|
6
5
|
DefaultProps,
|
|
7
6
|
MantineColor,
|
|
@@ -12,8 +11,9 @@ import type {
|
|
|
12
11
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
13
12
|
import { createStyles } from '../../theme';
|
|
14
13
|
import { rem } from '../../theme/utils/rem';
|
|
14
|
+
import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
15
15
|
|
|
16
|
-
export interface ChipProps extends DefaultProps {
|
|
16
|
+
export interface ChipProps extends DefaultProps, WithTextWrapperProps {
|
|
17
17
|
/** Chip label */
|
|
18
18
|
children: React.ReactNode;
|
|
19
19
|
|
|
@@ -174,6 +174,7 @@ const defaultProps: Partial<ChipProps> = {
|
|
|
174
174
|
variant: 'filled',
|
|
175
175
|
disabled: false,
|
|
176
176
|
type: 'checkbox',
|
|
177
|
+
withTextWrapper: true,
|
|
177
178
|
};
|
|
178
179
|
|
|
179
180
|
export const Chip = forwardRef<any, ChipProps>((props, ref) => {
|
|
@@ -192,6 +193,7 @@ export const Chip = forwardRef<any, ChipProps>((props, ref) => {
|
|
|
192
193
|
textStyle,
|
|
193
194
|
value,
|
|
194
195
|
type,
|
|
196
|
+
withTextWrapper: shouldWrapInText,
|
|
195
197
|
...others
|
|
196
198
|
} = useComponentDefaultProps('Chip', defaultProps, props);
|
|
197
199
|
|
|
@@ -226,7 +228,7 @@ export const Chip = forwardRef<any, ChipProps>((props, ref) => {
|
|
|
226
228
|
{...others}
|
|
227
229
|
>
|
|
228
230
|
{showIcon && <BoxView style={styles.icon}>{icon}</BoxView>}
|
|
229
|
-
|
|
231
|
+
{withTextWrapper(children, shouldWrapInText, sx(styles.text, textStyle))}
|
|
230
232
|
</TouchableOpacity>
|
|
231
233
|
);
|
|
232
234
|
});
|
|
@@ -325,10 +327,10 @@ export const ChipGroup = forwardRef<any, ChipGroupProps>((props, ref) => {
|
|
|
325
327
|
};
|
|
326
328
|
|
|
327
329
|
const enhancedChildren = React.Children.map(children, (child) => {
|
|
328
|
-
if (React.isValidElement(child) && child.type === Chip) {
|
|
329
|
-
const chipValue = child.props.value;
|
|
330
|
+
if (React.isValidElement(child) && (child.type as any) === Chip) {
|
|
331
|
+
const chipValue = (child.props as ChipProps).value;
|
|
330
332
|
if (chipValue !== undefined) {
|
|
331
|
-
return React.cloneElement(child as React.ReactElement<ChipProps>, {
|
|
333
|
+
return React.cloneElement<ChipProps>(child as React.ReactElement<ChipProps>, {
|
|
332
334
|
checked: isChecked(chipValue),
|
|
333
335
|
onChange: (checked: boolean) => handleChipChange(chipValue, checked),
|
|
334
336
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { Icon } from '../Icon';
|
|
4
4
|
import type { DefaultProps, MantineSize } from '../../theme/types';
|
|
5
5
|
import { useComponentDefaultProps } from '../../theme/theme-provider';
|
|
6
6
|
import { createStyles } from '../../theme';
|
|
@@ -81,28 +81,7 @@ const useStyles = createStyles(
|
|
|
81
81
|
);
|
|
82
82
|
|
|
83
83
|
const CloseIcon = ({ size, color }: { size: number; color: string }) => (
|
|
84
|
-
<
|
|
85
|
-
<BoxView
|
|
86
|
-
style={{
|
|
87
|
-
position: 'absolute',
|
|
88
|
-
width: size,
|
|
89
|
-
height: 2,
|
|
90
|
-
backgroundColor: color,
|
|
91
|
-
top: (size - 2) / 2,
|
|
92
|
-
transform: [{ rotate: '45deg' }],
|
|
93
|
-
}}
|
|
94
|
-
/>
|
|
95
|
-
<BoxView
|
|
96
|
-
style={{
|
|
97
|
-
position: 'absolute',
|
|
98
|
-
width: size,
|
|
99
|
-
height: 2,
|
|
100
|
-
backgroundColor: color,
|
|
101
|
-
top: (size - 2) / 2,
|
|
102
|
-
transform: [{ rotate: '-45deg' }],
|
|
103
|
-
}}
|
|
104
|
-
/>
|
|
105
|
-
</BoxView>
|
|
84
|
+
<Icon name="times" size={size} color={color} />
|
|
106
85
|
);
|
|
107
86
|
|
|
108
87
|
const defaultProps: Partial<CloseButtonProps> = {
|
|
@@ -3,8 +3,9 @@ import { Text } from '../Text';
|
|
|
3
3
|
import type { TextProps } from '../Text';
|
|
4
4
|
import { useTheme } from '../../theme/theme-provider';
|
|
5
5
|
import { BoxView } from '../BoxView';
|
|
6
|
+
import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
|
|
6
7
|
|
|
7
|
-
export interface CodeProps extends Omit<TextProps, 'children'
|
|
8
|
+
export interface CodeProps extends Omit<TextProps, 'children'>, WithTextWrapperProps {
|
|
8
9
|
/** Code content */
|
|
9
10
|
children?: React.ReactNode;
|
|
10
11
|
|
|
@@ -19,7 +20,7 @@ export interface CodeProps extends Omit<TextProps, 'children'> {
|
|
|
19
20
|
* Code component renders inline code or code blocks with monospace font
|
|
20
21
|
*/
|
|
21
22
|
export const Code = forwardRef<any, CodeProps>((props, ref) => {
|
|
22
|
-
const { children, color, block = false, style, ...others} = props;
|
|
23
|
+
const { children, color, block = false, style, withTextWrapper: shouldWrapInText = true, ...others} = props;
|
|
23
24
|
|
|
24
25
|
const theme = useTheme();
|
|
25
26
|
|
|
@@ -52,23 +53,27 @@ export const Code = forwardRef<any, CodeProps>((props, ref) => {
|
|
|
52
53
|
},
|
|
53
54
|
style,
|
|
54
55
|
]}
|
|
56
|
+
{...others}
|
|
55
57
|
>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
>
|
|
66
|
-
{children}
|
|
67
|
-
</Text>
|
|
58
|
+
{withTextWrapper(
|
|
59
|
+
children,
|
|
60
|
+
shouldWrapInText,
|
|
61
|
+
{
|
|
62
|
+
fontFamily: 'Courier',
|
|
63
|
+
fontSize: theme.fontSizes.sm as number || 14,
|
|
64
|
+
color: textColor,
|
|
65
|
+
}
|
|
66
|
+
)}
|
|
68
67
|
</BoxView>
|
|
69
68
|
);
|
|
70
69
|
}
|
|
71
70
|
|
|
71
|
+
// For inline code, we need to return a component that can accept the ref
|
|
72
|
+
// So we wrap in a View-like Text component
|
|
73
|
+
if (!shouldWrapInText) {
|
|
74
|
+
return children;
|
|
75
|
+
}
|
|
76
|
+
|
|
72
77
|
return (
|
|
73
78
|
<Text
|
|
74
79
|
ref={ref}
|
|
@@ -46,6 +46,7 @@ export const Collapse = forwardRef<any, CollapseProps>((props, ref) => {
|
|
|
46
46
|
} = useComponentDefaultProps('Collapse', defaultProps, props);
|
|
47
47
|
|
|
48
48
|
const [contentHeight, setContentHeight] = useState<number>(0);
|
|
49
|
+
const [isFirstLayout, setIsFirstLayout] = useState(true);
|
|
49
50
|
const heightAnim = useRef(new Animated.Value(opened ? 1 : 0)).current;
|
|
50
51
|
const opacityAnim = useRef(new Animated.Value(opened ? 1 : 0)).current;
|
|
51
52
|
|
|
@@ -53,10 +54,18 @@ export const Collapse = forwardRef<any, CollapseProps>((props, ref) => {
|
|
|
53
54
|
const { height } = event.nativeEvent.layout;
|
|
54
55
|
if (height > 0 && height !== contentHeight) {
|
|
55
56
|
setContentHeight(height);
|
|
57
|
+
if (isFirstLayout) {
|
|
58
|
+
setIsFirstLayout(false);
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
};
|
|
58
62
|
|
|
59
63
|
useEffect(() => {
|
|
64
|
+
// Don't animate on first render or if content height hasn't been measured yet
|
|
65
|
+
if (isFirstLayout || contentHeight === 0) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
const animations = [
|
|
61
70
|
Animated.timing(heightAnim, {
|
|
62
71
|
toValue: opened ? 1 : 0,
|
|
@@ -80,11 +89,11 @@ export const Collapse = forwardRef<any, CollapseProps>((props, ref) => {
|
|
|
80
89
|
onTransitionEnd();
|
|
81
90
|
}
|
|
82
91
|
});
|
|
83
|
-
}, [opened, heightAnim, opacityAnim, transitionDuration, animateOpacity, onTransitionEnd]);
|
|
92
|
+
}, [opened, heightAnim, opacityAnim, transitionDuration, animateOpacity, onTransitionEnd, contentHeight, isFirstLayout]);
|
|
84
93
|
|
|
85
94
|
const animatedHeight = heightAnim.interpolate({
|
|
86
95
|
inputRange: [0, 1],
|
|
87
|
-
outputRange: [0, contentHeight
|
|
96
|
+
outputRange: [0, contentHeight],
|
|
88
97
|
});
|
|
89
98
|
|
|
90
99
|
return (
|