@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,2 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.elementAligns = exports.dividerVariants = void 0;
|
|
7
|
+
const elementAligns = ['start', 'center', 'end'];
|
|
8
|
+
exports.elementAligns = elementAligns;
|
|
9
|
+
const dividerVariants = ['base', 'strong'];
|
|
10
|
+
exports.dividerVariants = dividerVariants;
|
|
2
11
|
//# sourceMappingURL=DividerProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["DividerProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type {
|
|
1
|
+
{"version":3,"names":["elementAligns","dividerVariants"],"sources":["DividerProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const elementAligns = ['start', 'center', 'end'] as const;\nexport type ElementAlign = typeof elementAligns[number];\n\nexport const dividerVariants = ['base', 'strong'] as const;\nexport type DividerVariant = typeof dividerVariants[number];\n\nexport default interface DividerProps extends OverridableComponentProps<ViewProps, {\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The size of the inset. It works as a multiplier factor based on spacing system.\n * @default 0\n */\n inset?: number;\n\n /**\n * If `true`, the divider orientation is set to vertical.\n * @default false\n */\n vertical?: boolean;\n\n /**\n * The size of margin between child element and the divider. It works as a multiplier factor based on spacing system.\n * @default 2\n */\n marginBetweenChildren?: number;\n\n /**\n * The size of border width. It works as an actual pixel-based border width value of a divider.\n * @default if vertical is true 1, otherwise 0.5\n */\n borderWidth?: number;\n\n /**\n * Set position of children.\n * @default center\n */\n elementAlign?: ElementAlign;\n\n /**\n * Select the style of the divider based on this value.\n * @default base\n */\n variant?: DividerVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,aAAa,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,KAApB,CAAtB;;AAGA,MAAMC,eAAe,GAAG,CAAC,MAAD,EAAS,QAAT,CAAxB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Divider;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _styles = require("../styles");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
|
|
18
|
+
const styles = _styles.StyleSheet.create({
|
|
19
|
+
container: {
|
|
20
|
+
alignSelf: 'stretch',
|
|
21
|
+
alignItems: 'center'
|
|
22
|
+
},
|
|
23
|
+
row: {
|
|
24
|
+
flexDirection: 'row'
|
|
25
|
+
},
|
|
26
|
+
column: {
|
|
27
|
+
flexDirection: 'column'
|
|
28
|
+
},
|
|
29
|
+
divider: {
|
|
30
|
+
flexGrow: 1
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function Divider(props) {
|
|
35
|
+
const {
|
|
36
|
+
borderWidth = 1,
|
|
37
|
+
children: childrenProp,
|
|
38
|
+
color = 'divider',
|
|
39
|
+
elementAlign = 'center',
|
|
40
|
+
inset = 0,
|
|
41
|
+
marginBetweenChildren = 2,
|
|
42
|
+
style,
|
|
43
|
+
vertical = false,
|
|
44
|
+
...otherProps
|
|
45
|
+
} = props;
|
|
46
|
+
const theme = (0, _styles.useTheme)();
|
|
47
|
+
const fontColor = theme.palette.text.secondary;
|
|
48
|
+
const borderColor = color === 'divider' ? theme.palette.divider : color === 'border' ? theme.palette.border.default : theme.palette[color].main;
|
|
49
|
+
const marginSize = theme.spacing(1);
|
|
50
|
+
const insetSize = theme.spacing(inset);
|
|
51
|
+
const marginLeft = marginSize;
|
|
52
|
+
const marginRight = marginSize;
|
|
53
|
+
const marginTop = marginSize;
|
|
54
|
+
const marginBottom = marginSize;
|
|
55
|
+
const marginStyle = vertical ? {
|
|
56
|
+
marginLeft,
|
|
57
|
+
marginRight
|
|
58
|
+
} : {
|
|
59
|
+
marginTop,
|
|
60
|
+
marginBottom
|
|
61
|
+
};
|
|
62
|
+
const insetStyle = vertical ? {
|
|
63
|
+
marginTop: insetSize,
|
|
64
|
+
marginBottom: insetSize
|
|
65
|
+
} : {
|
|
66
|
+
marginLeft: insetSize,
|
|
67
|
+
marginRight: insetSize
|
|
68
|
+
};
|
|
69
|
+
const borderColorStyle = {
|
|
70
|
+
borderColor
|
|
71
|
+
};
|
|
72
|
+
const borderWidthStyle = vertical ? {
|
|
73
|
+
borderRightWidth: borderWidth
|
|
74
|
+
} : {
|
|
75
|
+
borderBottomWidth: borderWidth
|
|
76
|
+
};
|
|
77
|
+
const containerStyle = (0, _styles.css)([insetStyle, marginStyle, styles.container, vertical ? styles.column : styles.row, childrenProp ? undefined : borderColorStyle, childrenProp ? undefined : borderWidthStyle, style]);
|
|
78
|
+
const dividerStyle = (0, _styles.css)([borderColorStyle, borderWidthStyle, styles.divider]);
|
|
79
|
+
const dividerMarginSize = theme.spacing(marginBetweenChildren);
|
|
80
|
+
const startDividerStyle = {
|
|
81
|
+
display: elementAlign !== 'start' ? 'flex' : 'none',
|
|
82
|
+
...(vertical ? {
|
|
83
|
+
marginBottom: dividerMarginSize
|
|
84
|
+
} : {
|
|
85
|
+
marginRight: dividerMarginSize
|
|
86
|
+
})
|
|
87
|
+
};
|
|
88
|
+
const endDividerStyle = {
|
|
89
|
+
display: elementAlign !== 'end' ? 'flex' : 'none',
|
|
90
|
+
...(vertical ? {
|
|
91
|
+
marginTop: dividerMarginSize
|
|
92
|
+
} : {
|
|
93
|
+
marginLeft: dividerMarginSize
|
|
94
|
+
})
|
|
95
|
+
};
|
|
96
|
+
const fontStyle = (0, _styles.createFontStyle)(theme, {
|
|
97
|
+
selector: typo => typo.caption2,
|
|
98
|
+
color: fontColor
|
|
99
|
+
});
|
|
100
|
+
const element = typeof childrenProp === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
101
|
+
style: (0, _styles.css)(fontStyle)
|
|
102
|
+
}, childrenProp) : childrenProp;
|
|
103
|
+
const children = childrenProp ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
104
|
+
style: (0, _styles.css)([dividerStyle, startDividerStyle])
|
|
105
|
+
}), element, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
106
|
+
style: (0, _styles.css)([dividerStyle, endDividerStyle])
|
|
107
|
+
})) : null;
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
109
|
+
style: containerStyle
|
|
110
|
+
}, otherProps), children);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
;
|
|
114
|
+
//# sourceMappingURL=LegacyDivider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","container","alignSelf","alignItems","row","flexDirection","column","divider","flexGrow","Divider","props","borderWidth","children","childrenProp","color","elementAlign","inset","marginBetweenChildren","style","vertical","otherProps","theme","useTheme","fontColor","palette","text","secondary","borderColor","border","default","main","marginSize","spacing","insetSize","marginLeft","marginRight","marginTop","marginBottom","marginStyle","insetStyle","borderColorStyle","borderWidthStyle","borderRightWidth","borderBottomWidth","containerStyle","css","undefined","dividerStyle","dividerMarginSize","startDividerStyle","display","endDividerStyle","fontStyle","createFontStyle","selector","typo","caption2","element"],"sources":["LegacyDivider.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { ExtendedStyle } from '../types';\nimport type DividerProps from './LegacyDividerProps';\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'stretch',\n alignItems: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n divider: {\n flexGrow: 1,\n },\n});\n\nexport default function Divider(props: DividerProps) {\n const {\n borderWidth = 1,\n children: childrenProp,\n color = 'divider',\n elementAlign = 'center',\n inset = 0,\n marginBetweenChildren = 2,\n style,\n vertical = false,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const fontColor = theme.palette.text.secondary;\n const borderColor = color === 'divider'\n ? theme.palette.divider\n : color === 'border'\n ? theme.palette.border.default\n : theme.palette[color].main;\n const marginSize = theme.spacing(1);\n const insetSize = theme.spacing(inset);\n\n const marginLeft = marginSize;\n const marginRight = marginSize;\n const marginTop = marginSize;\n const marginBottom = marginSize;\n\n const marginStyle = vertical\n ? { marginLeft, marginRight }\n : { marginTop, marginBottom };\n\n const insetStyle = vertical\n ? { marginTop: insetSize, marginBottom: insetSize }\n : { marginLeft: insetSize, marginRight: insetSize };\n\n const borderColorStyle = { borderColor };\n const borderWidthStyle = (vertical ? { borderRightWidth: borderWidth } : { borderBottomWidth: borderWidth });\n\n const containerStyle = css([\n insetStyle,\n marginStyle,\n styles.container,\n vertical ? styles.column : styles.row,\n childrenProp ? undefined : borderColorStyle,\n childrenProp ? undefined : borderWidthStyle,\n style,\n ]);\n\n const dividerStyle = css([\n borderColorStyle,\n borderWidthStyle,\n styles.divider,\n ]);\n\n const dividerMarginSize = theme.spacing(marginBetweenChildren);\n const startDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'start' ? 'flex' : 'none',\n ...(vertical ? { marginBottom: dividerMarginSize } : { marginRight: dividerMarginSize }),\n };\n const endDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'end' ? 'flex' : 'none',\n ...(vertical ? { marginTop: dividerMarginSize } : { marginLeft: dividerMarginSize }),\n };\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2,\n color: fontColor,\n });\n\n const element = typeof childrenProp === 'string'\n ? <Text style={css(fontStyle)}>{childrenProp}</Text>\n : childrenProp;\n\n const children = childrenProp ? (\n <React.Fragment>\n <View style={css([dividerStyle, startDividerStyle])}/>\n {element}\n <View style={css([dividerStyle, endDividerStyle])}/>\n </React.Fragment>\n ) : null;\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAIA,MAAMA,MAAM,GAAGC,kBAAA,CAAWC,MAAX,CAAkB;EAC7BC,SAAS,EAAE;IACPC,SAAS,EAAE,SADJ;IAEPC,UAAU,EAAE;EAFL,CADkB;EAK7BC,GAAG,EAAE;IACDC,aAAa,EAAE;EADd,CALwB;EAQ7BC,MAAM,EAAE;IACJD,aAAa,EAAE;EADX,CARqB;EAW7BE,OAAO,EAAE;IACLC,QAAQ,EAAE;EADL;AAXoB,CAAlB,CAAf;;AAgBe,SAASC,OAAT,CAAiBC,KAAjB,EAAsC;EACjD,MAAM;IACFC,WAAW,GAAG,CADZ;IAEFC,QAAQ,EAAEC,YAFR;IAGFC,KAAK,GAAG,SAHN;IAIFC,YAAY,GAAG,QAJb;IAKFC,KAAK,GAAG,CALN;IAMFC,qBAAqB,GAAG,CANtB;IAOFC,KAPE;IAQFC,QAAQ,GAAG,KART;IASF,GAAGC;EATD,IAUFV,KAVJ;EAYA,MAAMW,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMC,SAAS,GAAGF,KAAK,CAACG,OAAN,CAAcC,IAAd,CAAmBC,SAArC;EACA,MAAMC,WAAW,GAAGb,KAAK,KAAK,SAAV,GACdO,KAAK,CAACG,OAAN,CAAcjB,OADA,GAEdO,KAAK,KAAK,QAAV,GACIO,KAAK,CAACG,OAAN,CAAcI,MAAd,CAAqBC,OADzB,GAEIR,KAAK,CAACG,OAAN,CAAcV,KAAd,EAAqBgB,IAJ/B;EAKA,MAAMC,UAAU,GAAGV,KAAK,CAACW,OAAN,CAAc,CAAd,CAAnB;EACA,MAAMC,SAAS,GAAGZ,KAAK,CAACW,OAAN,CAAchB,KAAd,CAAlB;EAEA,MAAMkB,UAAU,GAAGH,UAAnB;EACA,MAAMI,WAAW,GAAGJ,UAApB;EACA,MAAMK,SAAS,GAAGL,UAAlB;EACA,MAAMM,YAAY,GAAGN,UAArB;EAEA,MAAMO,WAAW,GAAGnB,QAAQ,GACtB;IAAEe,UAAF;IAAcC;EAAd,CADsB,GAEtB;IAAEC,SAAF;IAAaC;EAAb,CAFN;EAIA,MAAME,UAAU,GAAGpB,QAAQ,GACrB;IAAEiB,SAAS,EAAEH,SAAb;IAAwBI,YAAY,EAAEJ;EAAtC,CADqB,GAErB;IAAEC,UAAU,EAAED,SAAd;IAAyBE,WAAW,EAAEF;EAAtC,CAFN;EAIA,MAAMO,gBAAgB,GAAG;IAAEb;EAAF,CAAzB;EACA,MAAMc,gBAAgB,GAAItB,QAAQ,GAAG;IAAEuB,gBAAgB,EAAE/B;EAApB,CAAH,GAAuC;IAAEgC,iBAAiB,EAAEhC;EAArB,CAAzE;EAEA,MAAMiC,cAAc,GAAG,IAAAC,WAAA,EAAI,CACvBN,UADuB,EAEvBD,WAFuB,EAGvBxC,MAAM,CAACG,SAHgB,EAIvBkB,QAAQ,GAAGrB,MAAM,CAACQ,MAAV,GAAmBR,MAAM,CAACM,GAJX,EAKvBS,YAAY,GAAGiC,SAAH,GAAeN,gBALJ,EAMvB3B,YAAY,GAAGiC,SAAH,GAAeL,gBANJ,EAOvBvB,KAPuB,CAAJ,CAAvB;EAUA,MAAM6B,YAAY,GAAG,IAAAF,WAAA,EAAI,CACrBL,gBADqB,EAErBC,gBAFqB,EAGrB3C,MAAM,CAACS,OAHc,CAAJ,CAArB;EAMA,MAAMyC,iBAAiB,GAAG3B,KAAK,CAACW,OAAN,CAAcf,qBAAd,CAA1B;EACA,MAAMgC,iBAAgC,GAAG;IACrCC,OAAO,EAAEnC,YAAY,KAAK,OAAjB,GAA2B,MAA3B,GAAoC,MADR;IAErC,IAAII,QAAQ,GAAG;MAAEkB,YAAY,EAAEW;IAAhB,CAAH,GAAyC;MAAEb,WAAW,EAAEa;IAAf,CAArD;EAFqC,CAAzC;EAIA,MAAMG,eAA8B,GAAG;IACnCD,OAAO,EAAEnC,YAAY,KAAK,KAAjB,GAAyB,MAAzB,GAAkC,MADR;IAEnC,IAAII,QAAQ,GAAG;MAAEiB,SAAS,EAAEY;IAAb,CAAH,GAAsC;MAAEd,UAAU,EAAEc;IAAd,CAAlD;EAFmC,CAAvC;EAKA,MAAMI,SAAS,GAAG,IAAAC,uBAAA,EAAgBhC,KAAhB,EAAuB;IACrCiC,QAAQ,EAAGC,IAAD,IAAUA,IAAI,CAACC,QADY;IAErC1C,KAAK,EAAES;EAF8B,CAAvB,CAAlB;EAKA,MAAMkC,OAAO,GAAG,OAAO5C,YAAP,KAAwB,QAAxB,gBACV,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAgC,WAAA,EAAIO,SAAJ;EAAb,GAA8BvC,YAA9B,CADU,GAEVA,YAFN;EAIA,MAAMD,QAAQ,GAAGC,YAAY,gBACzB,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAgC,WAAA,EAAI,CAACE,YAAD,EAAeE,iBAAf,CAAJ;EAAb,EADJ,EAEKQ,OAFL,eAGI,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAZ,WAAA,EAAI,CAACE,YAAD,EAAeI,eAAf,CAAJ;EAAb,EAHJ,CADyB,GAMzB,IANJ;EAQA,oBACI,6BAAC,iBAAD;IACI,KAAK,EAAEP;EADX,GAEQxB,UAFR,GAIKR,QAJL,CADJ;AAQH;;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["LegacyDividerProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { CommonComponentColor, OverridableComponentProps } from '../types';\n\nexport type DividerColor = 'divider' | 'border' | CommonComponentColor;\n\nexport default interface DividerProps extends OverridableComponentProps<ViewProps, {\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The size of the inset. It works as a multiplier factor based on spacing system.\n * @default 0\n */\n inset?: number;\n\n /**\n * If `true`, the divider orientation is set to vertical.\n * @default false\n */\n vertical?: boolean;\n\n /**\n * The color of divider. It supports default divider color and those theme colors that make sense for this component.\n * @default 'divider'\n */\n color?: DividerColor;\n\n /**\n * The size of margin between child element and the divider. It works as a multiplier factor based on spacing system.\n * @default 2\n */\n marginBetweenChildren?: number;\n\n /**\n * The size of border width. It works as an actual pixel-based border width value of a divider.\n * @default 1\n */\n borderWidth?: number;\n\n /**\n * Set position of children.\n * @default center\n */\n elementAlign?: 'start' | 'center' | 'end';\n}> {}\n"],"mappings":""}
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _LegacyDivider.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _LegacyDivider = _interopRequireDefault(require("./LegacyDivider"));
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyDivider';\nexport type { default as DividerProps } from './LegacyDividerProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -9,9 +9,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
+
var _styles = require("@fountain-ui/styles");
|
|
13
|
+
|
|
12
14
|
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
var _styles2 = require("../styles");
|
|
15
17
|
|
|
16
18
|
var _utils = require("../utils");
|
|
17
19
|
|
|
@@ -19,69 +21,64 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
21
|
|
|
20
22
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
23
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
const styles = _reactNative.StyleSheet.create({
|
|
25
|
+
root: {
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
height: 32,
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
width: 32
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function selectIconColor(theme, color) {
|
|
34
|
+
switch (color) {
|
|
35
|
+
default:
|
|
36
|
+
case 'strong':
|
|
37
|
+
return theme.palette.icon.strong;
|
|
38
|
+
|
|
39
|
+
case 'base':
|
|
40
|
+
return theme.palette.icon.base;
|
|
41
|
+
|
|
42
|
+
case 'staticStrongInverse':
|
|
43
|
+
return _styles.commonColors.static.strongInverse;
|
|
44
|
+
|
|
45
|
+
case 'disabled':
|
|
46
|
+
return theme.palette.status.disabled;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
40
49
|
|
|
41
50
|
function IconButton(props) {
|
|
42
51
|
const {
|
|
43
52
|
children,
|
|
44
|
-
color = '
|
|
53
|
+
color = 'strong',
|
|
45
54
|
disabled = false,
|
|
46
|
-
label,
|
|
47
55
|
onPress,
|
|
48
|
-
|
|
56
|
+
iconSize = 'medium',
|
|
49
57
|
style,
|
|
50
58
|
...otherProps
|
|
51
59
|
} = props;
|
|
52
|
-
const theme = (0,
|
|
53
|
-
const
|
|
60
|
+
const theme = (0, _styles2.useTheme)();
|
|
61
|
+
const iconColor = selectIconColor(theme, color);
|
|
54
62
|
const icon = (0, _utils.cloneElementSafely)(children, {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
enableV2: true,
|
|
64
|
+
fill: iconColor,
|
|
65
|
+
size: iconSize
|
|
58
66
|
});
|
|
59
|
-
const
|
|
60
|
-
selector: typo => typo.caption1,
|
|
61
|
-
color: theme.palette[color].main
|
|
62
|
-
});
|
|
63
|
-
const labelStyle = (0, _styles.css)([fontStyle]);
|
|
64
|
-
const rootStyle = (0, _styles.css)([styles.root, style]);
|
|
67
|
+
const rootStyle = (0, _styles2.css)([styles.root, style]);
|
|
65
68
|
|
|
66
|
-
const handlePress =
|
|
69
|
+
const handlePress = () => {
|
|
67
70
|
if (disabled) {
|
|
68
71
|
return;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
onPress();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
74
|
+
onPress === null || onPress === void 0 ? void 0 : onPress();
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
return /*#__PURE__*/_react.default.createElement(_ButtonBase.default, _extends({
|
|
78
78
|
disabled: disabled,
|
|
79
79
|
onPress: handlePress,
|
|
80
80
|
style: rootStyle
|
|
81
|
-
}, otherProps), icon
|
|
82
|
-
children: label,
|
|
83
|
-
style: labelStyle
|
|
84
|
-
}) : null);
|
|
81
|
+
}, otherProps), icon);
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","root","alignItems","height","justifyContent","width","selectIconColor","theme","color","palette","icon","strong","base","commonColors","static","strongInverse","status","disabled","IconButton","props","children","onPress","iconSize","style","otherProps","useTheme","iconColor","cloneElementSafely","enableV2","fill","size","rootStyle","css","handlePress"],"sources":["IconButton.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet } from 'react-native';\nimport { commonColors, Theme } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport { css, useTheme } from '../styles';\nimport type { SvgIconSize } from '../SvgIcon/SvgIconProps';\nimport { cloneElementSafely } from '../utils';\nimport type IconButtonProps from './IconButtonProps';\nimport type { IconButtonColor } from './IconButtonProps';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n height: 32,\n justifyContent: 'center',\n width: 32,\n },\n});\n\nfunction selectIconColor(theme: Theme, color: IconButtonColor) {\n switch (color) {\n default:\n case 'strong':\n return theme.palette.icon.strong;\n case 'base':\n return theme.palette.icon.base;\n case 'staticStrongInverse':\n return commonColors.static.strongInverse;\n case 'disabled':\n return theme.palette.status.disabled;\n }\n}\n\nexport default function IconButton(props: IconButtonProps) {\n const {\n children,\n color = 'strong' as IconButtonColor,\n disabled = false,\n onPress,\n iconSize = 'medium' as SvgIconSize,\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const iconColor = selectIconColor(theme, color);\n\n const icon = cloneElementSafely(children, {\n enableV2: true,\n fill: iconColor,\n size: iconSize,\n });\n\n const rootStyle = css([\n styles.root,\n style,\n ]);\n\n const handlePress = () => {\n if (disabled) {\n return;\n }\n\n onPress?.();\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n {icon}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAIA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,UAAU,EAAE,QADV;IAEFC,MAAM,EAAE,EAFN;IAGFC,cAAc,EAAE,QAHd;IAIFC,KAAK,EAAE;EAJL;AADuB,CAAlB,CAAf;;AASA,SAASC,eAAT,CAAyBC,KAAzB,EAAuCC,KAAvC,EAA+D;EAC3D,QAAQA,KAAR;IACI;IACA,KAAK,QAAL;MACI,OAAOD,KAAK,CAACE,OAAN,CAAcC,IAAd,CAAmBC,MAA1B;;IACJ,KAAK,MAAL;MACI,OAAOJ,KAAK,CAACE,OAAN,CAAcC,IAAd,CAAmBE,IAA1B;;IACJ,KAAK,qBAAL;MACI,OAAOC,oBAAA,CAAaC,MAAb,CAAoBC,aAA3B;;IACJ,KAAK,UAAL;MACI,OAAOR,KAAK,CAACE,OAAN,CAAcO,MAAd,CAAqBC,QAA5B;EATR;AAWH;;AAEc,SAASC,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFZ,KAAK,GAAG,QAFN;IAGFS,QAAQ,GAAG,KAHT;IAIFI,OAJE;IAKFC,QAAQ,GAAG,QALT;IAMFC,KANE;IAOF,GAAGC;EAPD,IAQFL,KARJ;EAUA,MAAMZ,KAAK,GAAG,IAAAkB,iBAAA,GAAd;EAEA,MAAMC,SAAS,GAAGpB,eAAe,CAACC,KAAD,EAAQC,KAAR,CAAjC;EAEA,MAAME,IAAI,GAAG,IAAAiB,yBAAA,EAAmBP,QAAnB,EAA6B;IACtCQ,QAAQ,EAAE,IAD4B;IAEtCC,IAAI,EAAEH,SAFgC;IAGtCI,IAAI,EAAER;EAHgC,CAA7B,CAAb;EAMA,MAAMS,SAAS,GAAG,IAAAC,YAAA,EAAI,CAClBlC,MAAM,CAACG,IADW,EAElBsB,KAFkB,CAAJ,CAAlB;;EAKA,MAAMU,WAAW,GAAG,MAAM;IACtB,IAAIhB,QAAJ,EAAc;MACV;IACH;;IAEDI,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO;EACV,CAND;;EAQA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEJ,QADd;IAEI,OAAO,EAAEgB,WAFb;IAGI,KAAK,EAAEF;EAHX,GAIQP,UAJR,GAMKd,IANL,CADJ;AAUH;;AAAA"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.iconButtonColors = void 0;
|
|
7
|
+
const iconButtonColors = ['strong', 'base', 'staticStrongInverse', 'disabled'];
|
|
8
|
+
exports.iconButtonColors = iconButtonColors;
|
|
2
9
|
//# sourceMappingURL=IconButtonProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["IconButtonProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ButtonBaseProps } from '../ButtonBase';\nimport type {
|
|
1
|
+
{"version":3,"names":["iconButtonColors"],"sources":["IconButtonProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ButtonBaseProps } from '../ButtonBase';\nimport type { SvgIconSize } from '../SvgIcon/SvgIconProps';\nimport type { OverridableComponentProps } from '../types';\n\nexport const iconButtonColors = [\n 'strong',\n 'base',\n 'staticStrongInverse',\n 'disabled',\n] as const;\nexport type IconButtonColor = typeof iconButtonColors[number];\n\nexport default interface IconButtonProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The icon element.\n */\n children: React.ReactElement;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'strong'\n */\n color?: IconButtonColor;\n\n /**\n * Determines the size of the icon that goes inside the button.\n * @default 'medium'\n */\n iconSize?: SvgIconSize;\n}> {}\n"],"mappings":";;;;;;AAKO,MAAMA,gBAAgB,GAAG,CAC5B,QAD4B,EAE5B,MAF4B,EAG5B,qBAH4B,EAI5B,UAJ4B,CAAzB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = IconButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
13
|
+
|
|
14
|
+
var _styles = require("../styles");
|
|
15
|
+
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
const iconSizes = {
|
|
23
|
+
tiny: 16,
|
|
24
|
+
small: 20,
|
|
25
|
+
medium: 24,
|
|
26
|
+
large: 28
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const useStyles = function () {
|
|
30
|
+
const theme = (0, _styles.useTheme)();
|
|
31
|
+
return {
|
|
32
|
+
root: {
|
|
33
|
+
flexDirection: 'column',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
padding: theme.spacing(1)
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function IconButton(props) {
|
|
42
|
+
const {
|
|
43
|
+
children,
|
|
44
|
+
color = 'primary',
|
|
45
|
+
disabled = false,
|
|
46
|
+
label,
|
|
47
|
+
onPress,
|
|
48
|
+
size = 'medium',
|
|
49
|
+
style,
|
|
50
|
+
...otherProps
|
|
51
|
+
} = props;
|
|
52
|
+
const theme = (0, _styles.useTheme)();
|
|
53
|
+
const styles = useStyles();
|
|
54
|
+
const icon = (0, _utils.cloneElementSafely)(children, {
|
|
55
|
+
width: iconSizes[size],
|
|
56
|
+
height: iconSizes[size],
|
|
57
|
+
color: color
|
|
58
|
+
});
|
|
59
|
+
const fontStyle = (0, _styles.createFontStyle)(theme, {
|
|
60
|
+
selector: typo => typo.caption1,
|
|
61
|
+
color: theme.palette[color].main
|
|
62
|
+
});
|
|
63
|
+
const labelStyle = (0, _styles.css)([fontStyle]);
|
|
64
|
+
const rootStyle = (0, _styles.css)([styles.root, style]);
|
|
65
|
+
|
|
66
|
+
const handlePress = async () => {
|
|
67
|
+
if (disabled) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (onPress) {
|
|
72
|
+
onPress();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonBase.default, _extends({
|
|
78
|
+
disabled: disabled,
|
|
79
|
+
onPress: handlePress,
|
|
80
|
+
style: rootStyle
|
|
81
|
+
}, otherProps), icon, label ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
82
|
+
children: label,
|
|
83
|
+
style: labelStyle
|
|
84
|
+
}) : null);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
;
|
|
88
|
+
//# sourceMappingURL=LegacyIconButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["iconSizes","tiny","small","medium","large","useStyles","theme","useTheme","root","flexDirection","justifyContent","alignItems","padding","spacing","IconButton","props","children","color","disabled","label","onPress","size","style","otherProps","styles","icon","cloneElementSafely","width","height","fontStyle","createFontStyle","selector","typo","caption1","palette","main","labelStyle","css","rootStyle","handlePress"],"sources":["LegacyIconButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type IconButtonProps from './LegacyIconButtonProps';\nimport type { IconButtonSize } from './LegacyIconButtonProps';\n\ntype IconButtonStyles = NamedStylesStringUnion<'root'>;\n\ntype IconSizes = { [n in IconButtonSize]: number };\n\nconst iconSizes: IconSizes = {\n tiny: 16,\n small: 20,\n medium: 24,\n large: 28,\n};\n\nconst useStyles: UseStyles<IconButtonStyles> = function (): IconButtonStyles {\n const theme = useTheme();\n\n return {\n root: {\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n padding: theme.spacing(1),\n },\n };\n};\n\nexport default function IconButton(props: IconButtonProps) {\n const {\n children,\n color = 'primary',\n disabled = false,\n label,\n onPress,\n size = 'medium',\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n const styles = useStyles();\n\n const icon = cloneElementSafely(children, {\n width: iconSizes[size],\n height: iconSizes[size],\n color: color,\n });\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption1,\n color: theme.palette[color].main,\n });\n\n const labelStyle = css([\n fontStyle,\n ]);\n\n const rootStyle = css([\n styles.root,\n style,\n ]);\n\n const handlePress = async () => {\n if (disabled) {\n return;\n }\n if (onPress) {\n onPress();\n return;\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n {icon}\n\n {label ? (\n <Text\n children={label}\n style={labelStyle}\n />\n ) : null}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAQA,MAAMA,SAAoB,GAAG;EACzBC,IAAI,EAAE,EADmB;EAEzBC,KAAK,EAAE,EAFkB;EAGzBC,MAAM,EAAE,EAHiB;EAIzBC,KAAK,EAAE;AAJkB,CAA7B;;AAOA,MAAMC,SAAsC,GAAG,YAA8B;EACzE,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,aAAa,EAAE,QADb;MAEFC,cAAc,EAAE,QAFd;MAGFC,UAAU,EAAE,QAHV;MAIFC,OAAO,EAAEN,KAAK,CAACO,OAAN,CAAc,CAAd;IAJP;EADH,CAAP;AAQH,CAXD;;AAae,SAASC,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,QAAQ,GAAG,KAHT;IAIFC,KAJE;IAKFC,OALE;IAMFC,IAAI,GAAG,QANL;IAOFC,KAPE;IAQF,GAAGC;EARD,IASFR,KATJ;EAWA,MAAMT,KAAK,GAAG,IAAAC,gBAAA,GAAd;EACA,MAAMiB,MAAM,GAAGnB,SAAS,EAAxB;EAEA,MAAMoB,IAAI,GAAG,IAAAC,yBAAA,EAAmBV,QAAnB,EAA6B;IACtCW,KAAK,EAAE3B,SAAS,CAACqB,IAAD,CADsB;IAEtCO,MAAM,EAAE5B,SAAS,CAACqB,IAAD,CAFqB;IAGtCJ,KAAK,EAAEA;EAH+B,CAA7B,CAAb;EAMA,MAAMY,SAAS,GAAG,IAAAC,uBAAA,EAAgBxB,KAAhB,EAAuB;IACrCyB,QAAQ,EAAGC,IAAD,IAAUA,IAAI,CAACC,QADY;IAErChB,KAAK,EAAEX,KAAK,CAAC4B,OAAN,CAAcjB,KAAd,EAAqBkB;EAFS,CAAvB,CAAlB;EAKA,MAAMC,UAAU,GAAG,IAAAC,WAAA,EAAI,CACnBR,SADmB,CAAJ,CAAnB;EAIA,MAAMS,SAAS,GAAG,IAAAD,WAAA,EAAI,CAClBb,MAAM,CAAChB,IADW,EAElBc,KAFkB,CAAJ,CAAlB;;EAKA,MAAMiB,WAAW,GAAG,YAAY;IAC5B,IAAIrB,QAAJ,EAAc;MACV;IACH;;IACD,IAAIE,OAAJ,EAAa;MACTA,OAAO;MACP;IACH;EACJ,CARD;;EAUA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEF,QADd;IAEI,OAAO,EAAEqB,WAFb;IAGI,KAAK,EAAED;EAHX,GAIQf,UAJR,GAMKE,IANL,EAQKN,KAAK,gBACF,6BAAC,iBAAD;IACI,QAAQ,EAAEA,KADd;IAEI,KAAK,EAAEiB;EAFX,EADE,GAKF,IAbR,CADJ;AAiBH;;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["LegacyIconButtonProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ButtonBaseProps } from '../ButtonBase';\nimport type { CommonComponentColor, OverridableComponentProps } from '../types';\n\nexport type IconButtonColor = CommonComponentColor;\n\nexport type IconButtonSize = 'medium' | 'large' | 'small' | 'tiny';\n\nexport default interface IconButtonProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The icon element.\n */\n children: React.ReactElement;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'primary'\n */\n color?: IconButtonColor;\n\n /**\n * If present, this is typography displayed at the bottom of the icon.\n */\n label?: string;\n\n /**\n * The size of the button.\n * @default 'medium'\n */\n size?: IconButtonSize;\n}> {}\n"],"mappings":""}
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _LegacyIconButton.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _LegacyIconButton = _interopRequireDefault(require("./LegacyIconButton"));
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyIconButton';\nexport type { default as IconButtonProps } from './LegacyIconButtonProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "ANIMATION_TYPE", {
|
|
|
9
9
|
return _ModalProps.ANIMATION_TYPE;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "SimpleBackdrop", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _SimpleBackdrop.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "createModalCloseEvent", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
@@ -30,12 +24,8 @@ Object.defineProperty(exports, "default", {
|
|
|
30
24
|
|
|
31
25
|
var _Modal = _interopRequireWildcard(require("./Modal"));
|
|
32
26
|
|
|
33
|
-
var _SimpleBackdrop = _interopRequireDefault(require("./SimpleBackdrop"));
|
|
34
|
-
|
|
35
27
|
var _ModalProps = require("./ModalProps");
|
|
36
28
|
|
|
37
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
38
|
-
|
|
39
29
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
40
30
|
|
|
41
31
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default, createModalCloseEvent } from './Modal';\nexport
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default, createModalCloseEvent } from './Modal';\nexport type { ModalCloseEvent } from './Modal';\nexport type { default as ModalProps, AnimationUnit } from './ModalProps';\nexport { ANIMATION_TYPE } from './ModalProps';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAGA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Radio;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
11
|
+
|
|
12
|
+
var _internal = require("../internal");
|
|
13
|
+
|
|
14
|
+
var _styles = require("../styles");
|
|
15
|
+
|
|
16
|
+
var _RadioContextProvider = require("../RadioGroup/RadioContextProvider");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
22
|
+
const ICON_SIZE = 20;
|
|
23
|
+
|
|
24
|
+
const useStyles = function () {
|
|
25
|
+
return {
|
|
26
|
+
root: {
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
flexDirection: 'row'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function Radio(props) {
|
|
34
|
+
const {
|
|
35
|
+
checked = false,
|
|
36
|
+
children,
|
|
37
|
+
checkedIcon: checkIconProp,
|
|
38
|
+
uncheckedIcon: uncheckedIconProp,
|
|
39
|
+
disabled = false,
|
|
40
|
+
iconPlacement = 'left',
|
|
41
|
+
onChange: onChangeProp,
|
|
42
|
+
style,
|
|
43
|
+
value,
|
|
44
|
+
...otherProps
|
|
45
|
+
} = props;
|
|
46
|
+
const styles = useStyles();
|
|
47
|
+
|
|
48
|
+
const context = _react.default.useContext(_RadioContextProvider.RadioContext);
|
|
49
|
+
|
|
50
|
+
const handlePress = () => {
|
|
51
|
+
const onChange = (context === null || context === void 0 ? void 0 : context.onChange) ?? onChangeProp;
|
|
52
|
+
|
|
53
|
+
if (onChange) {
|
|
54
|
+
onChange(value);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const isChecked = (context === null || context === void 0 ? void 0 : context.value) === value ?? checked;
|
|
59
|
+
|
|
60
|
+
const checkedIcon = checkIconProp ?? /*#__PURE__*/_react.default.createElement(_internal.RadioChecked, {
|
|
61
|
+
width: ICON_SIZE,
|
|
62
|
+
height: ICON_SIZE,
|
|
63
|
+
color: 'primary'
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const uncheckedIcon = uncheckedIconProp ?? /*#__PURE__*/_react.default.createElement(_internal.Radio, {
|
|
67
|
+
width: ICON_SIZE,
|
|
68
|
+
height: ICON_SIZE,
|
|
69
|
+
color: 'tertiary'
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const icon = isChecked ? checkedIcon : uncheckedIcon;
|
|
73
|
+
const rootStyle = (0, _styles.css)([styles.root, style]);
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement(_ButtonBase.default, _extends({
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
onPress: handlePress,
|
|
77
|
+
style: rootStyle
|
|
78
|
+
}, otherProps), iconPlacement === 'left' ? icon : null, children ? children : null, iconPlacement === 'right' ? icon : null);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
;
|
|
82
|
+
//# sourceMappingURL=LegacyRadio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ICON_SIZE","useStyles","root","alignItems","flexDirection","Radio","props","checked","children","checkedIcon","checkIconProp","uncheckedIcon","uncheckedIconProp","disabled","iconPlacement","onChange","onChangeProp","style","value","otherProps","styles","context","React","useContext","RadioContext","handlePress","isChecked","icon","rootStyle","css"],"sources":["LegacyRadio.tsx"],"sourcesContent":["import React from 'react';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport { Radio as RadioIcon, RadioChecked as RadioCheckedIcon } from '../internal';\nimport { css } from '../styles';\nimport { RadioContext } from '../RadioGroup/RadioContextProvider';\nimport type RadioProps from './LegacyRadioProps';\n\ntype RadioStyles = NamedStylesStringUnion<'root'>;\n\nconst ICON_SIZE = 20;\n\nconst useStyles: UseStyles<RadioStyles> = function (): RadioStyles {\n return {\n root: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n };\n};\n\nexport default function Radio(props: RadioProps) {\n const {\n checked = false,\n children,\n checkedIcon: checkIconProp,\n uncheckedIcon: uncheckedIconProp,\n disabled = false,\n iconPlacement = 'left',\n onChange: onChangeProp,\n style,\n value,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const context = React.useContext(RadioContext);\n\n const handlePress = () => {\n const onChange = context?.onChange ?? onChangeProp;\n if (onChange) {\n onChange(value);\n }\n };\n\n const isChecked = context?.value === value ?? checked;\n\n const checkedIcon = checkIconProp ?? <RadioCheckedIcon width={ICON_SIZE} height={ICON_SIZE} color={'primary'}/>;\n const uncheckedIcon = uncheckedIconProp ?? <RadioIcon width={ICON_SIZE} height={ICON_SIZE} color={'tertiary'}/>;\n const icon = isChecked ? checkedIcon : uncheckedIcon;\n\n const rootStyle = css([\n styles.root,\n style,\n ]);\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n {iconPlacement === 'left' ? icon : null}\n\n {children ? children : null}\n\n {iconPlacement === 'right' ? icon : null}\n </ButtonBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAS,GAAG,EAAlB;;AAEA,MAAMC,SAAiC,GAAG,YAAyB;EAC/D,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,aAAa,EAAE;IAFb;EADH,CAAP;AAMH,CAPD;;AASe,SAASC,KAAT,CAAeC,KAAf,EAAkC;EAC7C,MAAM;IACFC,OAAO,GAAG,KADR;IAEFC,QAFE;IAGFC,WAAW,EAAEC,aAHX;IAIFC,aAAa,EAAEC,iBAJb;IAKFC,QAAQ,GAAG,KALT;IAMFC,aAAa,GAAG,MANd;IAOFC,QAAQ,EAAEC,YAPR;IAQFC,KARE;IASFC,KATE;IAUF,GAAGC;EAVD,IAWFb,KAXJ;EAaA,MAAMc,MAAM,GAAGnB,SAAS,EAAxB;;EAEA,MAAMoB,OAAO,GAAGC,cAAA,CAAMC,UAAN,CAAiBC,kCAAjB,CAAhB;;EAEA,MAAMC,WAAW,GAAG,MAAM;IACtB,MAAMV,QAAQ,GAAG,CAAAM,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEN,QAAT,KAAqBC,YAAtC;;IACA,IAAID,QAAJ,EAAc;MACVA,QAAQ,CAACG,KAAD,CAAR;IACH;EACJ,CALD;;EAOA,MAAMQ,SAAS,GAAG,CAAAL,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEH,KAAT,MAAmBA,KAAnB,IAA4BX,OAA9C;;EAEA,MAAME,WAAW,GAAGC,aAAa,iBAAI,6BAAC,sBAAD;IAAkB,KAAK,EAAEV,SAAzB;IAAoC,MAAM,EAAEA,SAA5C;IAAuD,KAAK,EAAE;EAA9D,EAArC;;EACA,MAAMW,aAAa,GAAGC,iBAAiB,iBAAI,6BAAC,eAAD;IAAW,KAAK,EAAEZ,SAAlB;IAA6B,MAAM,EAAEA,SAArC;IAAgD,KAAK,EAAE;EAAvD,EAA3C;;EACA,MAAM2B,IAAI,GAAGD,SAAS,GAAGjB,WAAH,GAAiBE,aAAvC;EAEA,MAAMiB,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBT,MAAM,CAAClB,IADW,EAElBe,KAFkB,CAAJ,CAAlB;EAKA,oBACI,6BAAC,mBAAD;IACI,QAAQ,EAAEJ,QADd;IAEI,OAAO,EAAEY,WAFb;IAGI,KAAK,EAAEG;EAHX,GAIQT,UAJR,GAMKL,aAAa,KAAK,MAAlB,GAA2Ba,IAA3B,GAAkC,IANvC,EAQKnB,QAAQ,GAAGA,QAAH,GAAc,IAR3B,EAUKM,aAAa,KAAK,OAAlB,GAA4Ba,IAA5B,GAAmC,IAVxC,CADJ;AAcH;;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["LegacyRadioProps.ts"],"sourcesContent":["import React from 'react';\nimport type { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\ntype BaseProps = Omit<ButtonBaseProps, 'onPress' | 'children'>;\n\nexport default interface RadioProps extends OverridableComponentProps<BaseProps, {\n /**\n * If `true`, the component is checked.\n * @default false\n */\n checked?: boolean;\n\n /**\n * Content which is sharing pressable next to radio.\n */\n children?: React.ReactNode;\n\n /**\n * If `true`, the radio is disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback fired when the component is pressed.\n */\n onChange?: (newValue: string) => void;\n\n /**\n * Value of the component.\n */\n value: string;\n\n /**\n * Determines the placement of the icon relative to the children.\n * @default 'left'\n */\n iconPlacement?: 'right' | 'left';\n\n /**\n * Custom icon element to display when the radio is unchecked.\n */\n uncheckedIcon?: React.ReactNode;\n\n /**\n * Custom icon element to display when the radio is checked.\n */\n checkedIcon?: React.ReactNode;\n}> {}\n"],"mappings":""}
|