@fountain-ui/core 2.0.0-beta.91 → 2.0.0-beta.93
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/build/commonjs/Button/Button.js +51 -63
- package/build/commonjs/Button/Button.js.map +1 -1
- package/build/commonjs/Button/ButtonProps.js +11 -0
- package/build/commonjs/Button/ButtonProps.js.map +1 -1
- package/build/commonjs/Button/LegacyButton.js +144 -0
- package/build/commonjs/Button/LegacyButton.js.map +1 -0
- package/build/commonjs/Button/LegacyButtonProps.js +2 -0
- package/build/commonjs/Button/LegacyButtonProps.js.map +1 -0
- package/build/commonjs/Button/index.js +2 -2
- package/build/commonjs/Button/index.js.map +1 -1
- package/build/commonjs/Button/useVariantStyleMap.js +95 -0
- package/build/commonjs/Button/useVariantStyleMap.js.map +1 -0
- package/build/commonjs/ButtonSet/ButtonSet.js +54 -0
- package/build/commonjs/ButtonSet/ButtonSet.js.map +1 -0
- package/build/commonjs/ButtonSet/ButtonSetProps.js +11 -0
- package/build/commonjs/ButtonSet/ButtonSetProps.js.map +1 -0
- package/build/commonjs/ButtonSet/index.js +30 -0
- package/build/commonjs/ButtonSet/index.js.map +1 -0
- package/build/commonjs/ButtonSet/useVariantStyleMap.js +85 -0
- package/build/commonjs/ButtonSet/useVariantStyleMap.js.map +1 -0
- package/build/commonjs/Checkbox/Checkbox.js +33 -23
- package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
- package/build/commonjs/Checkbox/CheckboxProps.js +7 -0
- package/build/commonjs/Checkbox/CheckboxProps.js.map +1 -1
- package/build/commonjs/Checkbox/LegacyCheckbox.js +65 -0
- package/build/commonjs/Checkbox/LegacyCheckbox.js.map +1 -0
- package/build/commonjs/Checkbox/LegacyCheckboxProps.js +2 -0
- package/build/commonjs/Checkbox/LegacyCheckboxProps.js.map +1 -0
- package/build/commonjs/Checkbox/index.js +2 -2
- package/build/commonjs/Checkbox/index.js.map +1 -1
- package/build/commonjs/Checkbox/useVariantStyleMap.js +70 -0
- package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -0
- package/build/commonjs/CheckboxGroup/CheckboxGroup.js +50 -0
- package/build/commonjs/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/build/commonjs/CheckboxGroup/CheckboxGroupProps.js +2 -0
- package/build/commonjs/CheckboxGroup/CheckboxGroupProps.js.map +1 -0
- package/build/commonjs/CheckboxGroup/index.js +16 -0
- package/build/commonjs/CheckboxGroup/index.js.map +1 -0
- package/build/commonjs/Divider/Divider.js +16 -4
- package/build/commonjs/Divider/Divider.js.map +1 -1
- package/build/commonjs/Divider/DividerProps.js +9 -0
- package/build/commonjs/Divider/DividerProps.js.map +1 -1
- package/build/commonjs/Divider/LegacyDivider.js +114 -0
- package/build/commonjs/Divider/LegacyDivider.js.map +1 -0
- package/build/commonjs/Divider/LegacyDividerProps.js +2 -0
- package/build/commonjs/Divider/LegacyDividerProps.js.map +1 -0
- package/build/commonjs/Divider/index.js +2 -2
- package/build/commonjs/Divider/index.js.map +1 -1
- package/build/commonjs/IconButton/IconButton.js +39 -42
- package/build/commonjs/IconButton/IconButton.js.map +1 -1
- package/build/commonjs/IconButton/IconButtonProps.js +7 -0
- package/build/commonjs/IconButton/IconButtonProps.js.map +1 -1
- package/build/commonjs/IconButton/LegacyIconButton.js +88 -0
- package/build/commonjs/IconButton/LegacyIconButton.js.map +1 -0
- package/build/commonjs/IconButton/LegacyIconButtonProps.js +2 -0
- package/build/commonjs/IconButton/LegacyIconButtonProps.js.map +1 -0
- package/build/commonjs/IconButton/index.js +2 -2
- package/build/commonjs/IconButton/index.js.map +1 -1
- package/build/commonjs/Modal/index.js +0 -10
- package/build/commonjs/Modal/index.js.map +1 -1
- package/build/commonjs/Radio/LegacyRadio.js +82 -0
- package/build/commonjs/Radio/LegacyRadio.js.map +1 -0
- package/build/commonjs/Radio/LegacyRadioProps.js +2 -0
- package/build/commonjs/Radio/LegacyRadioProps.js.map +1 -0
- package/build/commonjs/Radio/Radio.js +40 -19
- package/build/commonjs/Radio/Radio.js.map +1 -1
- package/build/commonjs/Radio/RadioProps.js.map +1 -1
- package/build/commonjs/Radio/index.js +2 -2
- package/build/commonjs/Radio/index.js.map +1 -1
- package/build/commonjs/RadioGroup/LegacyRadioGroup.js +31 -0
- package/build/commonjs/RadioGroup/LegacyRadioGroup.js.map +1 -0
- package/build/commonjs/RadioGroup/RadioGroup.js +28 -2
- package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
- package/build/commonjs/RadioGroup/index.js +2 -2
- package/build/commonjs/RadioGroup/index.js.map +1 -1
- package/build/commonjs/ShadowView/ShadowView.js +35 -0
- package/build/commonjs/ShadowView/ShadowView.js.map +1 -0
- package/build/commonjs/ShadowView/ShadowView.native.js +35 -0
- package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -0
- package/build/commonjs/ShadowView/ShadowViewProps.js +2 -0
- package/build/commonjs/ShadowView/ShadowViewProps.js.map +1 -0
- package/build/commonjs/ShadowView/index.js +16 -0
- package/build/commonjs/ShadowView/index.js.map +1 -0
- package/build/commonjs/SvgIcon/LegacySvgIcon.js +43 -0
- package/build/commonjs/SvgIcon/LegacySvgIcon.js.map +1 -0
- package/build/commonjs/SvgIcon/LegacySvgIconProps.js +2 -0
- package/build/commonjs/SvgIcon/LegacySvgIconProps.js.map +1 -0
- package/build/commonjs/SvgIcon/SvgIcon.js +16 -4
- package/build/commonjs/SvgIcon/SvgIcon.js.map +1 -1
- package/build/commonjs/SvgIcon/SvgIconProps.js +15 -0
- package/build/commonjs/SvgIcon/SvgIconProps.js.map +1 -1
- package/build/commonjs/SvgIcon/index.js +2 -2
- package/build/commonjs/SvgIcon/index.js.map +1 -1
- package/build/commonjs/Toggle/Toggle.js +110 -0
- package/build/commonjs/Toggle/Toggle.js.map +1 -0
- package/build/commonjs/Toggle/ToggleProps.js +2 -0
- package/build/commonjs/Toggle/ToggleProps.js.map +1 -0
- package/build/commonjs/Toggle/index.js +16 -0
- package/build/commonjs/Toggle/index.js.map +1 -0
- package/build/commonjs/Typography/LegacyTypography.js +142 -0
- package/build/commonjs/Typography/LegacyTypography.js.map +1 -0
- package/build/commonjs/Typography/LegacyTypographyProps.js +2 -0
- package/build/commonjs/Typography/LegacyTypographyProps.js.map +1 -0
- package/build/commonjs/Typography/Typography.js +15 -54
- package/build/commonjs/Typography/Typography.js.map +1 -1
- package/build/commonjs/Typography/TypographyProps.js +7 -0
- package/build/commonjs/Typography/TypographyProps.js.map +1 -1
- package/build/commonjs/Typography/index.js +2 -2
- package/build/commonjs/Typography/index.js.map +1 -1
- package/build/commonjs/hooks/useCollapsibleAppBar.js +11 -2
- package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/commonjs/index.js +80 -3
- package/build/commonjs/index.js.map +1 -1
- package/build/commonjs/internal/icons/Check.js +23 -0
- package/build/commonjs/internal/icons/Check.js.map +1 -0
- package/build/commonjs/internal/icons/CheckboxOn.js +23 -0
- package/build/commonjs/internal/icons/CheckboxOn.js.map +1 -0
- package/build/commonjs/internal/icons/index.js +16 -0
- package/build/commonjs/internal/icons/index.js.map +1 -1
- package/build/commonjs/styles/createFontStyle.js.map +1 -1
- package/build/commonjs/utils/cloneElementSafely.js.map +1 -1
- package/build/commonjs/utils/createSvgIcon.js +15 -3
- package/build/commonjs/utils/createSvgIcon.js.map +1 -1
- package/build/commonjs/utils/index.js.map +1 -1
- package/build/module/Button/Button.js +53 -63
- package/build/module/Button/Button.js.map +1 -1
- package/build/module/Button/ButtonProps.js +3 -1
- package/build/module/Button/ButtonProps.js.map +1 -1
- package/build/module/Button/LegacyButton.js +127 -0
- package/build/module/Button/LegacyButton.js.map +1 -0
- package/build/module/Button/LegacyButtonProps.js +2 -0
- package/build/module/Button/LegacyButtonProps.js.map +1 -0
- package/build/module/Button/index.js +1 -1
- package/build/module/Button/index.js.map +1 -1
- package/build/module/Button/useVariantStyleMap.js +85 -0
- package/build/module/Button/useVariantStyleMap.js.map +1 -0
- package/build/module/ButtonSet/ButtonSet.js +34 -0
- package/build/module/ButtonSet/ButtonSet.js.map +1 -0
- package/build/module/ButtonSet/ButtonSetProps.js +3 -0
- package/build/module/ButtonSet/ButtonSetProps.js.map +1 -0
- package/build/module/ButtonSet/index.js +3 -0
- package/build/module/ButtonSet/index.js.map +1 -0
- package/build/module/ButtonSet/useVariantStyleMap.js +76 -0
- package/build/module/ButtonSet/useVariantStyleMap.js.map +1 -0
- package/build/module/Checkbox/Checkbox.js +32 -26
- package/build/module/Checkbox/Checkbox.js.map +1 -1
- package/build/module/Checkbox/CheckboxProps.js +1 -1
- package/build/module/Checkbox/CheckboxProps.js.map +1 -1
- package/build/module/Checkbox/LegacyCheckbox.js +52 -0
- package/build/module/Checkbox/LegacyCheckbox.js.map +1 -0
- package/build/module/Checkbox/LegacyCheckboxProps.js +2 -0
- package/build/module/Checkbox/LegacyCheckboxProps.js.map +1 -0
- package/build/module/Checkbox/index.js +1 -1
- package/build/module/Checkbox/index.js.map +1 -1
- package/build/module/Checkbox/useVariantStyleMap.js +59 -0
- package/build/module/Checkbox/useVariantStyleMap.js.map +1 -0
- package/build/module/CheckboxGroup/CheckboxGroup.js +34 -0
- package/build/module/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/build/module/CheckboxGroup/CheckboxGroupProps.js +2 -0
- package/build/module/CheckboxGroup/CheckboxGroupProps.js.map +1 -0
- package/build/module/CheckboxGroup/index.js +2 -0
- package/build/module/CheckboxGroup/index.js.map +1 -0
- package/build/module/Divider/Divider.js +17 -4
- package/build/module/Divider/Divider.js.map +1 -1
- package/build/module/Divider/DividerProps.js +2 -1
- package/build/module/Divider/DividerProps.js.map +1 -1
- package/build/module/Divider/LegacyDivider.js +100 -0
- package/build/module/Divider/LegacyDivider.js.map +1 -0
- package/build/module/Divider/LegacyDividerProps.js +2 -0
- package/build/module/Divider/LegacyDividerProps.js.map +1 -0
- package/build/module/Divider/index.js +1 -1
- package/build/module/Divider/index.js.map +1 -1
- package/build/module/IconButton/IconButton.js +36 -40
- package/build/module/IconButton/IconButton.js.map +1 -1
- package/build/module/IconButton/IconButtonProps.js +1 -1
- package/build/module/IconButton/IconButtonProps.js.map +1 -1
- package/build/module/IconButton/LegacyIconButton.js +73 -0
- package/build/module/IconButton/LegacyIconButton.js.map +1 -0
- package/build/module/IconButton/LegacyIconButtonProps.js +2 -0
- package/build/module/IconButton/LegacyIconButtonProps.js.map +1 -0
- package/build/module/IconButton/index.js +1 -1
- package/build/module/IconButton/index.js.map +1 -1
- package/build/module/Modal/index.js +0 -1
- package/build/module/Modal/index.js.map +1 -1
- package/build/module/Radio/LegacyRadio.js +63 -0
- package/build/module/Radio/LegacyRadio.js.map +1 -0
- package/build/module/Radio/LegacyRadioProps.js +2 -0
- package/build/module/Radio/LegacyRadioProps.js.map +1 -0
- package/build/module/Radio/Radio.js +35 -18
- package/build/module/Radio/Radio.js.map +1 -1
- package/build/module/Radio/RadioProps.js.map +1 -1
- package/build/module/Radio/index.js +1 -1
- package/build/module/Radio/index.js.map +1 -1
- package/build/module/RadioGroup/LegacyRadioGroup.js +18 -0
- package/build/module/RadioGroup/LegacyRadioGroup.js.map +1 -0
- package/build/module/RadioGroup/RadioGroup.js +21 -2
- package/build/module/RadioGroup/RadioGroup.js.map +1 -1
- package/build/module/RadioGroup/index.js +1 -1
- package/build/module/RadioGroup/index.js.map +1 -1
- package/build/module/ShadowView/ShadowView.js +23 -0
- package/build/module/ShadowView/ShadowView.js.map +1 -0
- package/build/module/ShadowView/ShadowView.native.js +23 -0
- package/build/module/ShadowView/ShadowView.native.js.map +1 -0
- package/build/module/ShadowView/ShadowViewProps.js +2 -0
- package/build/module/ShadowView/ShadowViewProps.js.map +1 -0
- package/build/module/ShadowView/index.js +2 -0
- package/build/module/ShadowView/index.js.map +1 -0
- package/build/module/SvgIcon/LegacySvgIcon.js +30 -0
- package/build/module/SvgIcon/LegacySvgIcon.js.map +1 -0
- package/build/module/SvgIcon/LegacySvgIconProps.js +2 -0
- package/build/module/SvgIcon/LegacySvgIconProps.js.map +1 -0
- package/build/module/SvgIcon/SvgIcon.js +15 -4
- package/build/module/SvgIcon/SvgIcon.js.map +1 -1
- package/build/module/SvgIcon/SvgIconProps.js +7 -1
- package/build/module/SvgIcon/SvgIconProps.js.map +1 -1
- package/build/module/SvgIcon/index.js +1 -1
- package/build/module/SvgIcon/index.js.map +1 -1
- package/build/module/Toggle/Toggle.js +90 -0
- package/build/module/Toggle/Toggle.js.map +1 -0
- package/build/module/Toggle/ToggleProps.js +2 -0
- package/build/module/Toggle/ToggleProps.js.map +1 -0
- package/build/module/Toggle/index.js +2 -0
- package/build/module/Toggle/index.js.map +1 -0
- package/build/module/Typography/LegacyTypography.js +126 -0
- package/build/module/Typography/LegacyTypography.js.map +1 -0
- package/build/module/Typography/LegacyTypographyProps.js +2 -0
- package/build/module/Typography/LegacyTypographyProps.js.map +1 -0
- package/build/module/Typography/Typography.js +15 -54
- package/build/module/Typography/Typography.js.map +1 -1
- package/build/module/Typography/TypographyProps.js +1 -1
- package/build/module/Typography/TypographyProps.js.map +1 -1
- package/build/module/Typography/index.js +1 -1
- package/build/module/Typography/index.js.map +1 -1
- package/build/module/hooks/useCollapsibleAppBar.js +12 -3
- package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/module/index.js +9 -1
- package/build/module/index.js.map +1 -1
- package/build/module/internal/icons/Check.js +9 -0
- package/build/module/internal/icons/Check.js.map +1 -0
- package/build/module/internal/icons/CheckboxOn.js +9 -0
- package/build/module/internal/icons/CheckboxOn.js.map +1 -0
- package/build/module/internal/icons/index.js +2 -0
- package/build/module/internal/icons/index.js.map +1 -1
- package/build/module/styles/createFontStyle.js.map +1 -1
- package/build/module/utils/cloneElementSafely.js.map +1 -1
- package/build/module/utils/createSvgIcon.js +14 -3
- package/build/module/utils/createSvgIcon.js.map +1 -1
- package/build/module/utils/index.js.map +1 -1
- package/build/typescript/Button/ButtonProps.d.ts +13 -11
- package/build/typescript/Button/LegacyButton.d.ts +3 -0
- package/build/typescript/Button/LegacyButtonProps.d.ts +51 -0
- package/build/typescript/Button/index.d.ts +2 -2
- package/build/typescript/Button/useVariantStyleMap.d.ts +9 -0
- package/build/typescript/ButtonSet/ButtonSet.d.ts +3 -0
- package/build/typescript/ButtonSet/ButtonSetProps.d.ts +20 -0
- package/build/typescript/ButtonSet/index.d.ts +3 -0
- package/build/typescript/ButtonSet/useVariantStyleMap.d.ts +10 -0
- package/build/typescript/Checkbox/CheckboxProps.d.ts +10 -14
- package/build/typescript/Checkbox/LegacyCheckbox.d.ts +3 -0
- package/build/typescript/Checkbox/LegacyCheckboxProps.d.ts +36 -0
- package/build/typescript/Checkbox/index.d.ts +2 -2
- package/build/typescript/Checkbox/useVariantStyleMap.d.ts +9 -0
- package/build/typescript/CheckboxGroup/CheckboxGroup.d.ts +3 -0
- package/build/typescript/CheckboxGroup/CheckboxGroupProps.d.ts +11 -0
- package/build/typescript/CheckboxGroup/index.d.ts +2 -0
- package/build/typescript/Divider/DividerProps.d.ts +12 -9
- package/build/typescript/Divider/LegacyDivider.d.ts +3 -0
- package/build/typescript/Divider/LegacyDividerProps.d.ts +41 -0
- package/build/typescript/Divider/index.d.ts +2 -2
- package/build/typescript/IconButton/IconButtonProps.d.ts +7 -10
- package/build/typescript/IconButton/LegacyIconButton.d.ts +3 -0
- package/build/typescript/IconButton/LegacyIconButtonProps.d.ts +26 -0
- package/build/typescript/IconButton/index.d.ts +2 -2
- package/build/typescript/Modal/index.d.ts +0 -2
- package/build/typescript/Radio/LegacyRadio.d.ts +3 -0
- package/build/typescript/Radio/LegacyRadioProps.d.ts +43 -0
- package/build/typescript/Radio/RadioProps.d.ts +9 -14
- package/build/typescript/Radio/index.d.ts +2 -2
- package/build/typescript/RadioGroup/LegacyRadioGroup.d.ts +3 -0
- package/build/typescript/RadioGroup/index.d.ts +1 -1
- package/build/typescript/ShadowView/ShadowView.d.ts +3 -0
- package/build/typescript/ShadowView/ShadowView.native.d.ts +3 -0
- package/build/typescript/ShadowView/ShadowViewProps.d.ts +11 -0
- package/build/typescript/ShadowView/index.d.ts +2 -0
- package/build/typescript/SvgIcon/LegacySvgIcon.d.ts +3 -0
- package/build/typescript/SvgIcon/LegacySvgIconProps.d.ts +35 -0
- package/build/typescript/SvgIcon/SvgIconProps.d.ts +17 -6
- package/build/typescript/SvgIcon/index.d.ts +2 -2
- package/build/typescript/Toggle/Toggle.d.ts +3 -0
- package/build/typescript/Toggle/ToggleProps.d.ts +19 -0
- package/build/typescript/Toggle/index.d.ts +2 -0
- package/build/typescript/Typography/LegacyTypography.d.ts +5 -0
- package/build/typescript/Typography/LegacyTypographyProps.d.ts +81 -0
- package/build/typescript/Typography/Typography.d.ts +1 -1
- package/build/typescript/Typography/TypographyProps.d.ts +12 -9
- package/build/typescript/Typography/index.d.ts +2 -2
- package/build/typescript/hooks/useCollapsibleAppBar.d.ts +1 -0
- package/build/typescript/index.d.ts +10 -2
- package/build/typescript/internal/icons/Check.d.ts +8 -0
- package/build/typescript/internal/icons/Checkbox.d.ts +2 -124
- package/build/typescript/internal/icons/CheckboxChecked.d.ts +2 -124
- package/build/typescript/internal/icons/CheckboxOn.d.ts +8 -0
- package/build/typescript/internal/icons/ChevronDown.d.ts +2 -124
- package/build/typescript/internal/icons/ChevronLeft.d.ts +2 -124
- package/build/typescript/internal/icons/ChevronRight.d.ts +2 -124
- package/build/typescript/internal/icons/Close.d.ts +2 -124
- package/build/typescript/internal/icons/Radio.d.ts +2 -124
- package/build/typescript/internal/icons/RadioChecked.d.ts +2 -124
- package/build/typescript/internal/icons/index.d.ts +2 -0
- package/build/typescript/styles/createFontStyle.d.ts +1 -1
- package/build/typescript/utils/cloneElementSafely.d.ts +1 -2
- package/build/typescript/utils/createSvgIcon.d.ts +8 -3
- package/build/typescript/utils/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/Button/Button.tsx +53 -71
- package/src/Button/ButtonProps.ts +29 -12
- package/src/Button/LegacyButton.tsx +157 -0
- package/src/Button/LegacyButtonProps.ts +62 -0
- package/src/Button/index.ts +2 -2
- package/src/Button/useVariantStyleMap.ts +99 -0
- package/src/ButtonSet/ButtonSet.tsx +43 -0
- package/src/ButtonSet/ButtonSetProps.ts +27 -0
- package/src/ButtonSet/index.ts +3 -0
- package/src/ButtonSet/useVariantStyleMap.ts +84 -0
- package/src/Checkbox/Checkbox.tsx +48 -33
- package/src/Checkbox/CheckboxProps.ts +10 -15
- package/src/Checkbox/LegacyCheckbox.tsx +62 -0
- package/src/Checkbox/LegacyCheckboxProps.ts +42 -0
- package/src/Checkbox/index.ts +2 -2
- package/src/Checkbox/useVariantStyleMap.ts +71 -0
- package/src/CheckboxGroup/CheckboxGroup.tsx +47 -0
- package/src/CheckboxGroup/CheckboxGroupProps.ts +11 -0
- package/src/CheckboxGroup/index.ts +2 -0
- package/src/Divider/Divider.tsx +17 -8
- package/src/Divider/DividerProps.ts +14 -10
- package/src/Divider/LegacyDivider.tsx +114 -0
- package/src/Divider/LegacyDividerProps.ts +48 -0
- package/src/Divider/index.ts +2 -2
- package/src/IconButton/IconButton.tsx +36 -54
- package/src/IconButton/IconButtonProps.ts +12 -12
- package/src/IconButton/LegacyIconButton.tsx +96 -0
- package/src/IconButton/LegacyIconButtonProps.ts +31 -0
- package/src/IconButton/index.ts +2 -2
- package/src/Modal/index.ts +0 -2
- package/src/Radio/LegacyRadio.tsx +72 -0
- package/src/Radio/LegacyRadioProps.ts +50 -0
- package/src/Radio/Radio.tsx +47 -16
- package/src/Radio/RadioProps.ts +10 -16
- package/src/Radio/index.ts +2 -2
- package/src/RadioGroup/LegacyRadioGroup.tsx +20 -0
- package/src/RadioGroup/RadioGroup.tsx +31 -4
- package/src/RadioGroup/index.ts +2 -2
- package/src/ShadowView/ShadowView.native.tsx +37 -0
- package/src/ShadowView/ShadowView.tsx +33 -0
- package/src/ShadowView/ShadowViewProps.ts +11 -0
- package/src/ShadowView/index.ts +2 -0
- package/src/SvgIcon/LegacySvgIcon.tsx +36 -0
- package/src/SvgIcon/LegacySvgIconProps.ts +41 -0
- package/src/SvgIcon/SvgIcon.tsx +19 -5
- package/src/SvgIcon/SvgIconProps.ts +33 -6
- package/src/SvgIcon/index.ts +2 -2
- package/src/Toggle/Toggle.tsx +113 -0
- package/src/Toggle/ToggleProps.ts +21 -0
- package/src/Toggle/index.ts +2 -0
- package/src/Typography/LegacyTypography.tsx +107 -0
- package/src/Typography/LegacyTypographyProps.ts +122 -0
- package/src/Typography/Typography.tsx +24 -30
- package/src/Typography/TypographyProps.ts +29 -34
- package/src/Typography/index.ts +2 -2
- package/src/hooks/useCollapsibleAppBar.ts +12 -2
- package/src/index.ts +14 -2
- package/src/internal/icons/Check.tsx +13 -0
- package/src/internal/icons/CheckboxOn.tsx +13 -0
- package/src/internal/icons/index.ts +2 -0
- package/src/styles/createFontStyle.ts +1 -1
- package/src/utils/cloneElementSafely.ts +1 -1
- package/src/utils/createSvgIcon.tsx +29 -6
- package/src/utils/index.ts +1 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { CommonComponentColor, OverridableComponentProps } from '../types';
|
|
1
|
+
import type { OverridableComponentProps } from '../types';
|
|
3
2
|
import type { ButtonBaseProps } from '../ButtonBase';
|
|
4
3
|
|
|
5
4
|
type BaseProps = Omit<ButtonBaseProps, 'onPress' | 'children'>;
|
|
6
5
|
|
|
7
|
-
export
|
|
6
|
+
export const checkboxVariants = ['square', 'round'] as const;
|
|
7
|
+
export type CheckboxVariant = typeof checkboxVariants[number];
|
|
8
8
|
|
|
9
9
|
export default interface CheckboxProps extends OverridableComponentProps<BaseProps, {
|
|
10
10
|
/**
|
|
@@ -14,15 +14,9 @@ export default interface CheckboxProps extends OverridableComponentProps<BasePro
|
|
|
14
14
|
checked?: boolean;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Content which is sharing pressable next to checkbox.
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The color of the component. It supports those theme colors that make sense for this component.
|
|
23
|
-
* @default 'primary'
|
|
24
|
-
*/
|
|
25
|
-
color?: CheckboxColor;
|
|
19
|
+
children?: string;
|
|
26
20
|
|
|
27
21
|
/**
|
|
28
22
|
* If `true`, the checkbox is disabled.
|
|
@@ -31,12 +25,13 @@ export default interface CheckboxProps extends OverridableComponentProps<BasePro
|
|
|
31
25
|
disabled?: boolean;
|
|
32
26
|
|
|
33
27
|
/**
|
|
34
|
-
*
|
|
28
|
+
* Callback fired when the state is changed.
|
|
35
29
|
*/
|
|
36
|
-
|
|
30
|
+
onChange?: (newChecked: boolean) => void;
|
|
37
31
|
|
|
38
32
|
/**
|
|
39
|
-
*
|
|
33
|
+
* Determines the shape and style of the checkbox.
|
|
34
|
+
* @default 'square'
|
|
40
35
|
*/
|
|
41
|
-
|
|
36
|
+
variant?: CheckboxVariant
|
|
42
37
|
}> {}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
3
|
+
import ButtonBase from '../ButtonBase';
|
|
4
|
+
import { Checkbox as CheckboxIcon, CheckboxChecked as CheckboxCheckedIcon } from '../internal/icons';
|
|
5
|
+
import { css } from '../styles';
|
|
6
|
+
import type CheckboxProps from './LegacyCheckboxProps';
|
|
7
|
+
|
|
8
|
+
type CheckboxStyle = NamedStylesStringUnion<'root'>;
|
|
9
|
+
|
|
10
|
+
const useStyles: UseStyles<CheckboxStyle> = function (): CheckboxStyle {
|
|
11
|
+
return {
|
|
12
|
+
root: {
|
|
13
|
+
width: 24,
|
|
14
|
+
height: 24,
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default function Checkbox(props: CheckboxProps) {
|
|
22
|
+
const {
|
|
23
|
+
checked = false,
|
|
24
|
+
checkedIcon: checkedIconProp,
|
|
25
|
+
color = 'primary',
|
|
26
|
+
disabled = false,
|
|
27
|
+
icon: iconProp,
|
|
28
|
+
onChange,
|
|
29
|
+
style,
|
|
30
|
+
...otherProps
|
|
31
|
+
} = props;
|
|
32
|
+
|
|
33
|
+
const styles = useStyles();
|
|
34
|
+
|
|
35
|
+
const uncheckedIcon = iconProp ? iconProp : <CheckboxIcon color={color}/>;
|
|
36
|
+
const checkedIcon = checkedIconProp ? checkedIconProp : <CheckboxCheckedIcon color={color}/>;
|
|
37
|
+
|
|
38
|
+
const handlePress = () => {
|
|
39
|
+
if (onChange) {
|
|
40
|
+
onChange(!checked);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const rootStyle = css([
|
|
45
|
+
styles.root,
|
|
46
|
+
style,
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<ButtonBase
|
|
51
|
+
disabled={disabled}
|
|
52
|
+
onPress={handlePress}
|
|
53
|
+
style={rootStyle}
|
|
54
|
+
{...otherProps}
|
|
55
|
+
>
|
|
56
|
+
{checked
|
|
57
|
+
? checkedIcon
|
|
58
|
+
: uncheckedIcon
|
|
59
|
+
}
|
|
60
|
+
</ButtonBase>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CommonComponentColor, OverridableComponentProps } from '../types';
|
|
3
|
+
import type { ButtonBaseProps } from '../ButtonBase';
|
|
4
|
+
|
|
5
|
+
type BaseProps = Omit<ButtonBaseProps, 'onPress' | 'children'>;
|
|
6
|
+
|
|
7
|
+
export type CheckboxColor = CommonComponentColor;
|
|
8
|
+
|
|
9
|
+
export default interface CheckboxProps extends OverridableComponentProps<BaseProps, {
|
|
10
|
+
/**
|
|
11
|
+
* If `true`, the component is checked.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The checked Icon which is replaced.
|
|
18
|
+
*/
|
|
19
|
+
checkedIcon?: React.ReactElement;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The color of the component. It supports those theme colors that make sense for this component.
|
|
23
|
+
* @default 'primary'
|
|
24
|
+
*/
|
|
25
|
+
color?: CheckboxColor;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* If `true`, the checkbox is disabled.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The unchecked Icon which is replaced.
|
|
35
|
+
*/
|
|
36
|
+
icon?: React.ReactElement;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Callback fired when the state is changed.
|
|
40
|
+
*/
|
|
41
|
+
onChange?: (newChecked: boolean) => void;
|
|
42
|
+
}> {}
|
package/src/Checkbox/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './
|
|
2
|
-
export type { default as CheckboxProps } from './
|
|
1
|
+
export { default } from './LegacyCheckbox';
|
|
2
|
+
export type { default as CheckboxProps } from './LegacyCheckboxProps';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { commonColors, FountainUiStyle } from '@fountain-ui/styles';
|
|
3
|
+
import { css, useTheme } from '../styles';
|
|
4
|
+
import type { CheckboxVariant } from './CheckboxProps';
|
|
5
|
+
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
checkbox: {
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
borderWidth: 1,
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
type useVariantStyleMapReturns = {
|
|
15
|
+
checkboxStyle?: FountainUiStyle;
|
|
16
|
+
containerStyle?: FountainUiStyle;
|
|
17
|
+
iconColor?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default function useVariantStyleMap(variant: CheckboxVariant, checked: boolean): useVariantStyleMapReturns {
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
|
|
23
|
+
switch (variant) {
|
|
24
|
+
case 'square':
|
|
25
|
+
return {
|
|
26
|
+
checkboxStyle: css([
|
|
27
|
+
styles.checkbox,
|
|
28
|
+
{
|
|
29
|
+
borderColor: theme.palette.border.base,
|
|
30
|
+
borderRadius: theme.shape.radius.xs,
|
|
31
|
+
height: 18,
|
|
32
|
+
width: 18,
|
|
33
|
+
...(checked ? {
|
|
34
|
+
backgroundColor: theme.palette.fill.base,
|
|
35
|
+
borderColor: theme.palette.fill.base,
|
|
36
|
+
} : {}),
|
|
37
|
+
},
|
|
38
|
+
]),
|
|
39
|
+
containerStyle: {
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
flexDirection: 'row',
|
|
42
|
+
gap: theme.spacing(3),
|
|
43
|
+
},
|
|
44
|
+
iconColor: theme.palette.fill.baseAlt,
|
|
45
|
+
};
|
|
46
|
+
case 'round':
|
|
47
|
+
return {
|
|
48
|
+
checkboxStyle: css([
|
|
49
|
+
styles.checkbox,
|
|
50
|
+
{
|
|
51
|
+
borderColor: theme.palette.border.base,
|
|
52
|
+
borderRadius: theme.shape.radius.full,
|
|
53
|
+
height: 20,
|
|
54
|
+
width: 20,
|
|
55
|
+
...(checked ? {
|
|
56
|
+
backgroundColor: theme.palette.fill.accent,
|
|
57
|
+
borderColor: theme.palette.fill.accent,
|
|
58
|
+
} : {}),
|
|
59
|
+
},
|
|
60
|
+
]),
|
|
61
|
+
containerStyle: {
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
flexDirection: 'row-reverse',
|
|
64
|
+
gap: theme.spacing(8),
|
|
65
|
+
},
|
|
66
|
+
iconColor: commonColors.static.strongInverse,
|
|
67
|
+
};
|
|
68
|
+
default:
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { Children } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
+
import type { CheckboxVariant } from '../Checkbox/CheckboxProps';
|
|
5
|
+
import { useTheme } from '../styles';
|
|
6
|
+
import type { FalsyReactElement } from '../utils';
|
|
7
|
+
import { cloneElementSafely } from '../utils';
|
|
8
|
+
import type CheckboxGroupProps from './CheckboxGroupProps';
|
|
9
|
+
|
|
10
|
+
type CheckboxItemStyles = NamedStylesStringUnion<CheckboxVariant>;
|
|
11
|
+
|
|
12
|
+
const useStyles: UseStyles<CheckboxItemStyles> = function (): CheckboxItemStyles {
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
square: {
|
|
17
|
+
paddingVertical: theme.spacing(2),
|
|
18
|
+
},
|
|
19
|
+
round: {
|
|
20
|
+
borderBottomColor: theme.palette.border.weak,
|
|
21
|
+
borderBottomWidth: 0.5,
|
|
22
|
+
paddingVertical: theme.spacing(3.5),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default function CheckboxGroup(props: CheckboxGroupProps) {
|
|
28
|
+
const {
|
|
29
|
+
children,
|
|
30
|
+
variant = 'square' as CheckboxVariant,
|
|
31
|
+
...otherProps
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
const styles = useStyles();
|
|
35
|
+
|
|
36
|
+
const content = Children.map(children, (child) => (
|
|
37
|
+
<View style={styles[variant]}>
|
|
38
|
+
{cloneElementSafely(child as FalsyReactElement, { variant })}
|
|
39
|
+
</View>
|
|
40
|
+
));
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View {...otherProps}>
|
|
44
|
+
{content}
|
|
45
|
+
</View>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
import type { OverridableComponentProps } from '../types';
|
|
3
|
+
import type { CheckboxVariant } from '../Checkbox/CheckboxProps';
|
|
4
|
+
|
|
5
|
+
export default interface CheckboxGroupProps extends OverridableComponentProps<ViewProps, {
|
|
6
|
+
/**
|
|
7
|
+
* Determines the shape and style of the checkbox.
|
|
8
|
+
* @default 'square'
|
|
9
|
+
*/
|
|
10
|
+
variant?: CheckboxVariant;
|
|
11
|
+
}> {}
|
package/src/Divider/Divider.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
|
+
import type { Theme } from '@fountain-ui/styles';
|
|
3
4
|
import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
|
|
4
5
|
import { ExtendedStyle } from '../types';
|
|
5
6
|
import type DividerProps from './DividerProps';
|
|
7
|
+
import type { DividerVariant } from './DividerProps';
|
|
6
8
|
|
|
7
9
|
const styles = StyleSheet.create({
|
|
8
10
|
container: {
|
|
@@ -20,27 +22,34 @@ const styles = StyleSheet.create({
|
|
|
20
22
|
},
|
|
21
23
|
});
|
|
22
24
|
|
|
25
|
+
function selectBorderColor(theme: Theme, variant: DividerVariant, vertical: boolean) {
|
|
26
|
+
switch (variant) {
|
|
27
|
+
default:
|
|
28
|
+
case 'base':
|
|
29
|
+
return vertical ? theme.palette.border.weaker : theme.palette.border.weak;
|
|
30
|
+
case 'strong':
|
|
31
|
+
return vertical ? theme.palette.border.weak : theme.palette.border.base;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
export default function Divider(props: DividerProps) {
|
|
24
36
|
const {
|
|
25
|
-
borderWidth
|
|
37
|
+
borderWidth: borderWidthProp,
|
|
26
38
|
children: childrenProp,
|
|
27
|
-
color = 'divider',
|
|
28
39
|
elementAlign = 'center',
|
|
29
40
|
inset = 0,
|
|
30
41
|
marginBetweenChildren = 2,
|
|
31
42
|
style,
|
|
43
|
+
variant = 'base' as DividerVariant,
|
|
32
44
|
vertical = false,
|
|
33
45
|
...otherProps
|
|
34
46
|
} = props;
|
|
35
47
|
|
|
36
48
|
const theme = useTheme();
|
|
37
49
|
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
: color === 'border'
|
|
42
|
-
? theme.palette.border.default
|
|
43
|
-
: theme.palette[color].main;
|
|
50
|
+
const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);
|
|
51
|
+
const fontColor = theme.palette.text.weak;
|
|
52
|
+
const borderColor = selectBorderColor(theme, variant, vertical);
|
|
44
53
|
const marginSize = theme.spacing(1);
|
|
45
54
|
const insetSize = theme.spacing(inset);
|
|
46
55
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OverridableComponentProps } from '../types';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const elementAligns = ['start', 'center', 'end'] as const;
|
|
6
|
+
export type ElementAlign = typeof elementAligns[number];
|
|
7
|
+
|
|
8
|
+
export const dividerVariants = ['base', 'strong'] as const;
|
|
9
|
+
export type DividerVariant = typeof dividerVariants[number];
|
|
6
10
|
|
|
7
11
|
export default interface DividerProps extends OverridableComponentProps<ViewProps, {
|
|
8
12
|
/**
|
|
@@ -22,12 +26,6 @@ export default interface DividerProps extends OverridableComponentProps<ViewProp
|
|
|
22
26
|
*/
|
|
23
27
|
vertical?: boolean;
|
|
24
28
|
|
|
25
|
-
/**
|
|
26
|
-
* The color of divider. It supports default divider color and those theme colors that make sense for this component.
|
|
27
|
-
* @default 'divider'
|
|
28
|
-
*/
|
|
29
|
-
color?: DividerColor;
|
|
30
|
-
|
|
31
29
|
/**
|
|
32
30
|
* The size of margin between child element and the divider. It works as a multiplier factor based on spacing system.
|
|
33
31
|
* @default 2
|
|
@@ -36,7 +34,7 @@ export default interface DividerProps extends OverridableComponentProps<ViewProp
|
|
|
36
34
|
|
|
37
35
|
/**
|
|
38
36
|
* The size of border width. It works as an actual pixel-based border width value of a divider.
|
|
39
|
-
* @default 1
|
|
37
|
+
* @default if vertical is true 1, otherwise 0.5
|
|
40
38
|
*/
|
|
41
39
|
borderWidth?: number;
|
|
42
40
|
|
|
@@ -44,5 +42,11 @@ export default interface DividerProps extends OverridableComponentProps<ViewProp
|
|
|
44
42
|
* Set position of children.
|
|
45
43
|
* @default center
|
|
46
44
|
*/
|
|
47
|
-
elementAlign?:
|
|
45
|
+
elementAlign?: ElementAlign;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Select the style of the divider based on this value.
|
|
49
|
+
* @default base
|
|
50
|
+
*/
|
|
51
|
+
variant?: DividerVariant;
|
|
48
52
|
}> {}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
|
|
4
|
+
import { ExtendedStyle } from '../types';
|
|
5
|
+
import type DividerProps from './LegacyDividerProps';
|
|
6
|
+
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
container: {
|
|
9
|
+
alignSelf: 'stretch',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
},
|
|
12
|
+
row: {
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
},
|
|
15
|
+
column: {
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
},
|
|
18
|
+
divider: {
|
|
19
|
+
flexGrow: 1,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default function Divider(props: DividerProps) {
|
|
24
|
+
const {
|
|
25
|
+
borderWidth = 1,
|
|
26
|
+
children: childrenProp,
|
|
27
|
+
color = 'divider',
|
|
28
|
+
elementAlign = 'center',
|
|
29
|
+
inset = 0,
|
|
30
|
+
marginBetweenChildren = 2,
|
|
31
|
+
style,
|
|
32
|
+
vertical = false,
|
|
33
|
+
...otherProps
|
|
34
|
+
} = props;
|
|
35
|
+
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
|
|
38
|
+
const fontColor = theme.palette.text.secondary;
|
|
39
|
+
const borderColor = color === 'divider'
|
|
40
|
+
? theme.palette.divider
|
|
41
|
+
: color === 'border'
|
|
42
|
+
? theme.palette.border.default
|
|
43
|
+
: theme.palette[color].main;
|
|
44
|
+
const marginSize = theme.spacing(1);
|
|
45
|
+
const insetSize = theme.spacing(inset);
|
|
46
|
+
|
|
47
|
+
const marginLeft = marginSize;
|
|
48
|
+
const marginRight = marginSize;
|
|
49
|
+
const marginTop = marginSize;
|
|
50
|
+
const marginBottom = marginSize;
|
|
51
|
+
|
|
52
|
+
const marginStyle = vertical
|
|
53
|
+
? { marginLeft, marginRight }
|
|
54
|
+
: { marginTop, marginBottom };
|
|
55
|
+
|
|
56
|
+
const insetStyle = vertical
|
|
57
|
+
? { marginTop: insetSize, marginBottom: insetSize }
|
|
58
|
+
: { marginLeft: insetSize, marginRight: insetSize };
|
|
59
|
+
|
|
60
|
+
const borderColorStyle = { borderColor };
|
|
61
|
+
const borderWidthStyle = (vertical ? { borderRightWidth: borderWidth } : { borderBottomWidth: borderWidth });
|
|
62
|
+
|
|
63
|
+
const containerStyle = css([
|
|
64
|
+
insetStyle,
|
|
65
|
+
marginStyle,
|
|
66
|
+
styles.container,
|
|
67
|
+
vertical ? styles.column : styles.row,
|
|
68
|
+
childrenProp ? undefined : borderColorStyle,
|
|
69
|
+
childrenProp ? undefined : borderWidthStyle,
|
|
70
|
+
style,
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
const dividerStyle = css([
|
|
74
|
+
borderColorStyle,
|
|
75
|
+
borderWidthStyle,
|
|
76
|
+
styles.divider,
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
const dividerMarginSize = theme.spacing(marginBetweenChildren);
|
|
80
|
+
const startDividerStyle: ExtendedStyle = {
|
|
81
|
+
display: elementAlign !== 'start' ? 'flex' : 'none',
|
|
82
|
+
...(vertical ? { marginBottom: dividerMarginSize } : { marginRight: dividerMarginSize }),
|
|
83
|
+
};
|
|
84
|
+
const endDividerStyle: ExtendedStyle = {
|
|
85
|
+
display: elementAlign !== 'end' ? 'flex' : 'none',
|
|
86
|
+
...(vertical ? { marginTop: dividerMarginSize } : { marginLeft: dividerMarginSize }),
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const fontStyle = createFontStyle(theme, {
|
|
90
|
+
selector: (typo) => typo.caption2,
|
|
91
|
+
color: fontColor,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const element = typeof childrenProp === 'string'
|
|
95
|
+
? <Text style={css(fontStyle)}>{childrenProp}</Text>
|
|
96
|
+
: childrenProp;
|
|
97
|
+
|
|
98
|
+
const children = childrenProp ? (
|
|
99
|
+
<React.Fragment>
|
|
100
|
+
<View style={css([dividerStyle, startDividerStyle])}/>
|
|
101
|
+
{element}
|
|
102
|
+
<View style={css([dividerStyle, endDividerStyle])}/>
|
|
103
|
+
</React.Fragment>
|
|
104
|
+
) : null;
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<View
|
|
108
|
+
style={containerStyle}
|
|
109
|
+
{...otherProps}
|
|
110
|
+
>
|
|
111
|
+
{children}
|
|
112
|
+
</View>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { CommonComponentColor, OverridableComponentProps } from '../types';
|
|
4
|
+
|
|
5
|
+
export type DividerColor = 'divider' | 'border' | CommonComponentColor;
|
|
6
|
+
|
|
7
|
+
export default interface DividerProps extends OverridableComponentProps<ViewProps, {
|
|
8
|
+
/**
|
|
9
|
+
* The content of the component.
|
|
10
|
+
*/
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The size of the inset. It works as a multiplier factor based on spacing system.
|
|
15
|
+
* @default 0
|
|
16
|
+
*/
|
|
17
|
+
inset?: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* If `true`, the divider orientation is set to vertical.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
vertical?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The color of divider. It supports default divider color and those theme colors that make sense for this component.
|
|
27
|
+
* @default 'divider'
|
|
28
|
+
*/
|
|
29
|
+
color?: DividerColor;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The size of margin between child element and the divider. It works as a multiplier factor based on spacing system.
|
|
33
|
+
* @default 2
|
|
34
|
+
*/
|
|
35
|
+
marginBetweenChildren?: number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The size of border width. It works as an actual pixel-based border width value of a divider.
|
|
39
|
+
* @default 1
|
|
40
|
+
*/
|
|
41
|
+
borderWidth?: number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Set position of children.
|
|
45
|
+
* @default center
|
|
46
|
+
*/
|
|
47
|
+
elementAlign?: 'start' | 'center' | 'end';
|
|
48
|
+
}> {}
|
package/src/Divider/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './
|
|
2
|
-
export type { default as DividerProps } from './
|
|
1
|
+
export { default } from './LegacyDivider';
|
|
2
|
+
export type { default as DividerProps } from './LegacyDividerProps';
|