@fountain-ui/core 2.0.0-beta.92 → 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/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/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 +84 -0
- 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/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/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 +8 -0
- 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/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/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 +8 -0
- 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/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/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 +12 -0
- 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
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
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
|
+
const accessibilityMap = {
|
|
17
|
+
h1: {
|
|
18
|
+
accessibilityRole: 'header',
|
|
19
|
+
'area-level': 1
|
|
20
|
+
},
|
|
21
|
+
h2: {
|
|
22
|
+
accessibilityRole: 'header',
|
|
23
|
+
'area-level': 2
|
|
24
|
+
},
|
|
25
|
+
h3: {
|
|
26
|
+
accessibilityRole: 'header',
|
|
27
|
+
'area-level': 3
|
|
28
|
+
},
|
|
29
|
+
subtitle1: {
|
|
30
|
+
accessibilityRole: 'header',
|
|
31
|
+
'area-level': 6
|
|
32
|
+
},
|
|
33
|
+
subtitle2: {
|
|
34
|
+
accessibilityRole: 'header',
|
|
35
|
+
'area-level': 6
|
|
36
|
+
},
|
|
37
|
+
body1: {
|
|
38
|
+
accessibilityRole: 'text'
|
|
39
|
+
},
|
|
40
|
+
body2: {
|
|
41
|
+
accessibilityRole: 'text'
|
|
42
|
+
},
|
|
43
|
+
caption1: {
|
|
44
|
+
accessibilityRole: 'text'
|
|
45
|
+
},
|
|
46
|
+
caption2: {
|
|
47
|
+
accessibilityRole: 'text'
|
|
48
|
+
},
|
|
49
|
+
flag: {
|
|
50
|
+
accessibilityRole: 'text'
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function selectColor(theme, colorProp) {
|
|
55
|
+
var _theme$palette$colorP;
|
|
56
|
+
|
|
57
|
+
const palette = theme.palette.text;
|
|
58
|
+
|
|
59
|
+
switch (colorProp) {
|
|
60
|
+
case 'inherit':
|
|
61
|
+
return _reactNative.Platform.OS === 'web' ? 'inherit' : undefined;
|
|
62
|
+
|
|
63
|
+
case 'textPrimary':
|
|
64
|
+
return palette.primary;
|
|
65
|
+
|
|
66
|
+
case 'textSecondary':
|
|
67
|
+
return palette.secondary;
|
|
68
|
+
|
|
69
|
+
case 'textAccent':
|
|
70
|
+
return palette.accent;
|
|
71
|
+
|
|
72
|
+
case 'textHint':
|
|
73
|
+
return palette.hint;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (_theme$palette$colorP = theme.palette[colorProp]) === null || _theme$palette$colorP === void 0 ? void 0 : _theme$palette$colorP.main;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const styles = _styles.StyleSheet.create({
|
|
80
|
+
root: {
|
|
81
|
+
flexShrink: 1,
|
|
82
|
+
...(_reactNative.Platform.OS === 'web' ? {
|
|
83
|
+
maxWidth: '100%'
|
|
84
|
+
} : {})
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const Typography = /*#__PURE__*/_react.default.forwardRef(function Typography(props, ref) {
|
|
89
|
+
const {
|
|
90
|
+
accessibilityRole,
|
|
91
|
+
align = 'inherit',
|
|
92
|
+
ariaLevel,
|
|
93
|
+
disableFontScaling = false,
|
|
94
|
+
children,
|
|
95
|
+
color: colorProp = 'inherit',
|
|
96
|
+
ellipsizeMode = 'tail',
|
|
97
|
+
href,
|
|
98
|
+
numberOfLines,
|
|
99
|
+
onPress,
|
|
100
|
+
selectable,
|
|
101
|
+
style,
|
|
102
|
+
variant = 'body1',
|
|
103
|
+
onLayout,
|
|
104
|
+
onTextLayout
|
|
105
|
+
} = props;
|
|
106
|
+
const theme = (0, _styles.useTheme)();
|
|
107
|
+
const fontStyle = (0, _styles.createFontStyle)(theme, {
|
|
108
|
+
selector: typography => typography[variant],
|
|
109
|
+
color: selectColor(theme, colorProp)
|
|
110
|
+
}); // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.
|
|
111
|
+
|
|
112
|
+
const textWrapStyle = numberOfLines && numberOfLines > 0 && _reactNative.Platform.OS === 'web' ? {
|
|
113
|
+
wordWrap: 'normal'
|
|
114
|
+
} : {};
|
|
115
|
+
const textStyle = (0, _styles.css)([styles.root, {
|
|
116
|
+
textAlign: align === 'inherit' ? 'auto' : align
|
|
117
|
+
}, textWrapStyle, fontStyle, style]);
|
|
118
|
+
const accessibility = accessibilityMap[variant];
|
|
119
|
+
const variantRole = href !== undefined ? 'link' : accessibility === null || accessibility === void 0 ? void 0 : accessibility.accessibilityRole;
|
|
120
|
+
const variantLevel = accessibility === null || accessibility === void 0 ? void 0 : accessibility['area-level'];
|
|
121
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
122
|
+
ref: ref,
|
|
123
|
+
accessibilityRole: accessibilityRole || variantRole,
|
|
124
|
+
allowFontScaling: !disableFontScaling,
|
|
125
|
+
"aria-level": ariaLevel || variantLevel,
|
|
126
|
+
children: children,
|
|
127
|
+
ellipsizeMode: ellipsizeMode // @ts-ignore
|
|
128
|
+
,
|
|
129
|
+
href: href,
|
|
130
|
+
numberOfLines: numberOfLines,
|
|
131
|
+
onPress: onPress,
|
|
132
|
+
selectable: selectable,
|
|
133
|
+
style: textStyle,
|
|
134
|
+
onLayout: onLayout,
|
|
135
|
+
onTextLayout: onTextLayout
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
var _default = /*#__PURE__*/_react.default.memo(Typography);
|
|
140
|
+
|
|
141
|
+
exports.default = _default;
|
|
142
|
+
//# sourceMappingURL=LegacyTypography.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["accessibilityMap","h1","accessibilityRole","h2","h3","subtitle1","subtitle2","body1","body2","caption1","caption2","flag","selectColor","theme","colorProp","palette","text","Platform","OS","undefined","primary","secondary","accent","hint","main","styles","StyleSheet","create","root","flexShrink","maxWidth","Typography","React","forwardRef","props","ref","align","ariaLevel","disableFontScaling","children","color","ellipsizeMode","href","numberOfLines","onPress","selectable","style","variant","onLayout","onTextLayout","useTheme","fontStyle","createFontStyle","selector","typography","textWrapStyle","wordWrap","textStyle","css","textAlign","accessibility","variantRole","variantLevel","memo"],"sources":["LegacyTypography.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, Text, TextStyle } from 'react-native';\nimport type { Theme } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport TypographyProps, { AccessibilityMap, TypographyColor } from './LegacyTypographyProps';\n\nconst accessibilityMap: AccessibilityMap = {\n h1: { accessibilityRole: 'header', 'area-level': 1 },\n h2: { accessibilityRole: 'header', 'area-level': 2 },\n h3: { accessibilityRole: 'header', 'area-level': 3 },\n subtitle1: { accessibilityRole: 'header', 'area-level': 6 },\n subtitle2: { accessibilityRole: 'header', 'area-level': 6 },\n body1: { accessibilityRole: 'text' },\n body2: { accessibilityRole: 'text' },\n caption1: { accessibilityRole: 'text' },\n caption2: { accessibilityRole: 'text' },\n flag: { accessibilityRole: 'text' },\n};\n\nfunction selectColor(theme: Theme, colorProp: TypographyColor): string | undefined {\n const palette = theme.palette.text;\n\n switch (colorProp) {\n case 'inherit':\n return Platform.OS === 'web' ? 'inherit' : undefined;\n case 'textPrimary':\n return palette.primary;\n case 'textSecondary':\n return palette.secondary;\n case 'textAccent':\n return palette.accent;\n case 'textHint':\n return palette.hint;\n }\n\n return theme.palette[colorProp]?.main;\n}\n\nconst styles = StyleSheet.create({\n root: {\n flexShrink: 1,\n ...(Platform.OS === 'web' ? { maxWidth: '100%' } : {}),\n },\n});\n\nconst Typography = React.forwardRef<Text, TypographyProps>(function Typography(props, ref) {\n const {\n accessibilityRole,\n align = 'inherit',\n ariaLevel,\n disableFontScaling = false,\n children,\n color: colorProp = 'inherit',\n ellipsizeMode = 'tail',\n href,\n numberOfLines,\n onPress,\n selectable,\n style,\n variant = 'body1',\n onLayout,\n onTextLayout,\n } = props;\n\n const theme = useTheme();\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography[variant],\n color: selectColor(theme, colorProp),\n });\n\n // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.\n const textWrapStyle = numberOfLines && numberOfLines > 0 && Platform.OS === 'web' ? { wordWrap: 'normal' } : {};\n\n const textStyle = css([\n styles.root,\n { textAlign: align === 'inherit' ? 'auto' : align },\n textWrapStyle as TextStyle,\n fontStyle,\n style,\n ]);\n\n const accessibility = accessibilityMap[variant];\n const variantRole = href !== undefined ? 'link' : accessibility?.accessibilityRole;\n const variantLevel = accessibility?.['area-level'];\n\n return (\n <Text\n ref={ref}\n accessibilityRole={accessibilityRole || variantRole}\n allowFontScaling={!disableFontScaling}\n aria-level={ariaLevel || variantLevel}\n children={children}\n ellipsizeMode={ellipsizeMode}\n // @ts-ignore\n href={href}\n numberOfLines={numberOfLines}\n onPress={onPress}\n selectable={selectable}\n style={textStyle}\n onLayout={onLayout}\n onTextLayout={onTextLayout}\n />\n );\n});\n\nexport default React.memo(Typography);\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAGA,MAAMA,gBAAkC,GAAG;EACvCC,EAAE,EAAE;IAAEC,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CADmC;EAEvCC,EAAE,EAAE;IAAED,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAFmC;EAGvCE,EAAE,EAAE;IAAEF,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAHmC;EAIvCG,SAAS,EAAE;IAAEH,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAJ4B;EAKvCI,SAAS,EAAE;IAAEJ,iBAAiB,EAAE,QAArB;IAA+B,cAAc;EAA7C,CAL4B;EAMvCK,KAAK,EAAE;IAAEL,iBAAiB,EAAE;EAArB,CANgC;EAOvCM,KAAK,EAAE;IAAEN,iBAAiB,EAAE;EAArB,CAPgC;EAQvCO,QAAQ,EAAE;IAAEP,iBAAiB,EAAE;EAArB,CAR6B;EASvCQ,QAAQ,EAAE;IAAER,iBAAiB,EAAE;EAArB,CAT6B;EAUvCS,IAAI,EAAE;IAAET,iBAAiB,EAAE;EAArB;AAViC,CAA3C;;AAaA,SAASU,WAAT,CAAqBC,KAArB,EAAmCC,SAAnC,EAAmF;EAAA;;EAC/E,MAAMC,OAAO,GAAGF,KAAK,CAACE,OAAN,CAAcC,IAA9B;;EAEA,QAAQF,SAAR;IACI,KAAK,SAAL;MACI,OAAOG,qBAAA,CAASC,EAAT,KAAgB,KAAhB,GAAwB,SAAxB,GAAoCC,SAA3C;;IACJ,KAAK,aAAL;MACI,OAAOJ,OAAO,CAACK,OAAf;;IACJ,KAAK,eAAL;MACI,OAAOL,OAAO,C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AZ,CAA9D,GAAuF,EAA7G;EAEA,MAAMC,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBjC,MAAM,CAACG,IADW,EAElB;IAAE+B,SAAS,EAAEvB,KAAK,KAAK,SAAV,GAAsB,MAAtB,GAA+BA;EAA5C,CAFkB,EAGlBmB,aAHkB,EAIlBJ,SAJkB,EAKlBL,KALkB,CAAJ,CAAlB;EAQA,MAAMc,aAAa,GAAG5D,gBAAgB,CAAC+C,OAAD,CAAtC;EACA,MAAMc,WAAW,GAAGnB,IAAI,KAAKvB,SAAT,GAAqB,MAArB,GAA8ByC,aAA9B,aAA8BA,aAA9B,uBAA8BA,aAAa,CAAE1D,iBAAjE;EACA,MAAM4D,YAAY,GAAGF,aAAH,aAAGA,aAAH,uBAAGA,aAAa,CAAG,YAAH,CAAlC;EAEA,oBACI,6BAAC,iBAAD;IACI,GAAG,EAAEzB,GADT;IAEI,iBAAiB,EAAEjC,iBAAiB,IAAI2D,WAF5C;IAGI,gBAAgB,EAAE,CAACvB,kBAHvB;IAII,cAAYD,SAAS,IAAIyB,YAJ7B;IAKI,QAAQ,EAAEvB,QALd;IAMI,aAAa,EAAEE,aANnB,CAOI;IAPJ;IAQI,IAAI,EAAEC,IARV;IASI,aAAa,EAAEC,aATnB;IAUI,OAAO,EAAEC,OAVb;IAWI,UAAU,EAAEC,UAXhB;IAYI,KAAK,EAAEY,SAZX;IAaI,QAAQ,EAAET,QAbd;IAcI,YAAY,EAAEC;EAdlB,EADJ;AAkBH,CA3DkB,CAAnB;;4BA6DejB,cAAA,CAAM+B,IAAN,CAAWhC,UAAX,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["LegacyTypographyProps.ts"],"sourcesContent":["import React from 'react';\nimport type { AccessibilityProps, TextProps } from 'react-native';\nimport type { ComponentProps } from '../types';\n\nexport type TypographyAlign = 'inherit' | 'left' | 'center' | 'right' | 'justify';\n\nexport type TypographyColor =\n | 'inherit'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'warning'\n | 'error'\n | 'accent'\n | 'textPrimary'\n | 'textSecondary'\n | 'textAccent'\n | 'textHint';\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'caption1'\n | 'caption2'\n | 'flag'\n | 'button1'\n | 'button2';\n\nexport interface Accessibility {\n accessibilityRole: AccessibilityProps['accessibilityRole'];\n 'area-level'?: number;\n}\n\nexport interface AccessibilityMap extends Partial<{\n [key: string]: Accessibility;\n}> {}\n\nexport default interface TypographyProps extends ComponentProps<{\n /**\n * Applies HTML tag at web and communicates purpose of component at app\n */\n accessibilityRole?: AccessibilityProps['accessibilityRole'];\n\n /**\n * Set the text-align on the component.\n * The value 'justify' is not supported on Android and fallbacks to left.\n * @default 'inherit'\n */\n align?: TypographyAlign;\n\n /**\n * Applies HTML heading level\n */\n ariaLevel?: number;\n\n /**\n * Specifies whether fonts should scale to respect Text Size accessibility settings.\n * @default false\n */\n disableFontScaling?: boolean;\n\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'inherit'\n */\n color?: TypographyColor;\n\n /**\n * The text ellipsis mode.\n * @default 'tail'\n */\n ellipsizeMode?: TextProps['ellipsizeMode'];\n\n /**\n * Internal use only. The hyperlink of the text.\n */\n href?: string;\n\n /**\n * Used to truncate the text with an ellipsis after computing the text\n * layout, including line wrapping, such that the total number of lines\n * does not exceed this number.\n */\n numberOfLines?: TextProps['numberOfLines'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n onPress?: TextProps['onPress'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n selectable?: boolean;\n\n /**\n * Applies the theme typography styles.\n * @default 'body1'\n */\n variant?: TypographyVariant;\n\n\n /**\n * Callback that is called when the text layout has been calculated.\n */\n onTextLayout?: TextProps['onTextLayout'];\n\n /**\n * Callback that is called when the layout of the Text component changes.\n */\n onLayout?: TextProps['onLayout'];\n}> {}\n"],"mappings":""}
|
|
@@ -13,67 +13,27 @@ var _styles = require("../styles");
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
const accessibilityMap = {
|
|
17
|
-
h1: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
'area-level': 3
|
|
28
|
-
},
|
|
29
|
-
subtitle1: {
|
|
30
|
-
accessibilityRole: 'header',
|
|
31
|
-
'area-level': 6
|
|
32
|
-
},
|
|
33
|
-
subtitle2: {
|
|
34
|
-
accessibilityRole: 'header',
|
|
35
|
-
'area-level': 6
|
|
36
|
-
},
|
|
37
|
-
body1: {
|
|
38
|
-
accessibilityRole: 'text'
|
|
39
|
-
},
|
|
40
|
-
body2: {
|
|
41
|
-
accessibilityRole: 'text'
|
|
42
|
-
},
|
|
43
|
-
caption1: {
|
|
44
|
-
accessibilityRole: 'text'
|
|
45
|
-
},
|
|
46
|
-
caption2: {
|
|
47
|
-
accessibilityRole: 'text'
|
|
48
|
-
},
|
|
49
|
-
flag: {
|
|
50
|
-
accessibilityRole: 'text'
|
|
51
|
-
}
|
|
16
|
+
const accessibilityMap = {// TODO: set accessibilityRole.
|
|
17
|
+
// h1: { accessibilityRole: 'header', 'aria-level': 1 },
|
|
18
|
+
// h2: { accessibilityRole: 'header', 'aria-level': 2 },
|
|
19
|
+
// h3: { accessibilityRole: 'header', 'aria-level': 3 },
|
|
20
|
+
// subtitle1: { accessibilityRole: 'header', 'aria-level': 6 },
|
|
21
|
+
// subtitle2: { accessibilityRole: 'header', 'aria-level': 6 },
|
|
22
|
+
// body1: { accessibilityRole: 'text' },
|
|
23
|
+
// body2: { accessibilityRole: 'text' },
|
|
24
|
+
// caption1: { accessibilityRole: 'text' },
|
|
25
|
+
// caption2: { accessibilityRole: 'text' },
|
|
26
|
+
// flag: { accessibilityRole: 'text' },
|
|
52
27
|
};
|
|
53
28
|
|
|
54
29
|
function selectColor(theme, colorProp) {
|
|
55
|
-
var _theme$palette$colorP;
|
|
56
|
-
|
|
57
|
-
const palette = theme.palette.text;
|
|
58
|
-
|
|
59
30
|
switch (colorProp) {
|
|
60
31
|
case 'inherit':
|
|
61
32
|
return _reactNative.Platform.OS === 'web' ? 'inherit' : undefined;
|
|
62
33
|
|
|
63
|
-
|
|
64
|
-
return palette.
|
|
65
|
-
|
|
66
|
-
case 'textSecondary':
|
|
67
|
-
return palette.secondary;
|
|
68
|
-
|
|
69
|
-
case 'textAccent':
|
|
70
|
-
return palette.accent;
|
|
71
|
-
|
|
72
|
-
case 'textHint':
|
|
73
|
-
return palette.hint;
|
|
34
|
+
default:
|
|
35
|
+
return theme.palette.text[colorProp];
|
|
74
36
|
}
|
|
75
|
-
|
|
76
|
-
return (_theme$palette$colorP = theme.palette[colorProp]) === null || _theme$palette$colorP === void 0 ? void 0 : _theme$palette$colorP.main;
|
|
77
37
|
}
|
|
78
38
|
|
|
79
39
|
const styles = _styles.StyleSheet.create({
|
|
@@ -100,12 +60,13 @@ const Typography = /*#__PURE__*/_react.default.forwardRef(function Typography(pr
|
|
|
100
60
|
selectable,
|
|
101
61
|
style,
|
|
102
62
|
variant = 'body1',
|
|
63
|
+
weight = 'medium',
|
|
103
64
|
onLayout,
|
|
104
65
|
onTextLayout
|
|
105
66
|
} = props;
|
|
106
67
|
const theme = (0, _styles.useTheme)();
|
|
107
68
|
const fontStyle = (0, _styles.createFontStyle)(theme, {
|
|
108
|
-
selector: typography => typography[variant],
|
|
69
|
+
selector: typography => typography[variant][weight],
|
|
109
70
|
color: selectColor(theme, colorProp)
|
|
110
71
|
}); // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.
|
|
111
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["accessibilityMap","
|
|
1
|
+
{"version":3,"names":["accessibilityMap","selectColor","theme","colorProp","Platform","OS","undefined","palette","text","styles","StyleSheet","create","root","flexShrink","maxWidth","Typography","React","forwardRef","props","ref","accessibilityRole","align","ariaLevel","disableFontScaling","children","color","ellipsizeMode","href","numberOfLines","onPress","selectable","style","variant","weight","onLayout","onTextLayout","useTheme","fontStyle","createFontStyle","selector","typography","textWrapStyle","wordWrap","textStyle","css","textAlign","accessibility","variantRole","variantLevel","memo"],"sources":["Typography.tsx"],"sourcesContent":["import React from 'react';\nimport type { TextProps, TextStyle } from 'react-native';\nimport { Platform, Text } from 'react-native';\nimport type { FontVariant, FontWeight, Theme } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport type TypographyProps from './TypographyProps';\nimport type { AccessibilityMap, TypographyAlign, TypographyColor } from './TypographyProps';\n\nconst accessibilityMap: AccessibilityMap = {\n // TODO: set accessibilityRole.\n // h1: { accessibilityRole: 'header', 'aria-level': 1 },\n // h2: { accessibilityRole: 'header', 'aria-level': 2 },\n // h3: { accessibilityRole: 'header', 'aria-level': 3 },\n // subtitle1: { accessibilityRole: 'header', 'aria-level': 6 },\n // subtitle2: { accessibilityRole: 'header', 'aria-level': 6 },\n // body1: { accessibilityRole: 'text' },\n // body2: { accessibilityRole: 'text' },\n // caption1: { accessibilityRole: 'text' },\n // caption2: { accessibilityRole: 'text' },\n // flag: { accessibilityRole: 'text' },\n};\n\nfunction selectColor(theme: Theme, colorProp: TypographyColor): string | undefined {\n switch (colorProp) {\n case 'inherit':\n return Platform.OS === 'web' ? 'inherit' : undefined;\n default:\n return theme.palette.text[colorProp];\n }\n}\n\nconst styles = StyleSheet.create({\n root: {\n flexShrink: 1,\n ...(Platform.OS === 'web' ? { maxWidth: '100%' } : {}),\n },\n});\n\nconst Typography = React.forwardRef<Text, TypographyProps>(function Typography(props, ref) {\n const {\n accessibilityRole,\n align = 'inherit' as TypographyAlign,\n ariaLevel,\n disableFontScaling = false,\n children,\n color: colorProp = 'inherit' as TypographyColor,\n ellipsizeMode = 'tail' as TextProps['ellipsizeMode'],\n href,\n numberOfLines,\n onPress,\n selectable,\n style,\n variant = 'body1' as FontVariant,\n weight = 'medium' as FontWeight,\n onLayout,\n onTextLayout,\n } = props;\n\n const theme = useTheme();\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography[variant][weight],\n color: selectColor(theme, colorProp),\n });\n\n // To prevent white-space: pre, word-wrap:break-word style conflicting issue at safari browser.\n const textWrapStyle = numberOfLines && numberOfLines > 0 && Platform.OS === 'web' ? { wordWrap: 'normal' } : {};\n\n const textStyle = css([\n styles.root,\n { textAlign: align === 'inherit' ? 'auto' : align },\n textWrapStyle as TextStyle,\n fontStyle,\n style,\n ]);\n\n const accessibility = accessibilityMap[variant];\n const variantRole = href !== undefined ? 'link' : accessibility?.accessibilityRole;\n const variantLevel = accessibility?.['area-level'];\n\n return (\n <Text\n ref={ref}\n accessibilityRole={accessibilityRole || variantRole}\n allowFontScaling={!disableFontScaling}\n aria-level={ariaLevel || variantLevel}\n children={children}\n ellipsizeMode={ellipsizeMode}\n // @ts-ignore\n href={href}\n numberOfLines={numberOfLines}\n onPress={onPress}\n selectable={selectable}\n style={textStyle}\n onLayout={onLayout}\n onTextLayout={onTextLayout}\n />\n );\n});\n\nexport default React.memo(Typography);\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;;;AAIA,MAAMA,gBAAkC,GAAG,CACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAXuC,CAA3C;;AAcA,SAASC,WAAT,CAAqBC,KAArB,EAAmCC,SAAnC,EAAmF;EAC/E,QAAQA,SAAR;IACI,KAAK,SAAL;MACI,OAAOC,qBAAA,CAASC,EAAT,KAAgB,KAAhB,GAAwB,SAAxB,GAAoCC,SAA3C;;IACJ;MACI,OAAOJ,KAAK,CAACK,OAAN,CAAcC,IAAd,CAAmBL,SAAnB,CAAP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,GAAsB,MAAtB,GAA+BA;EAA5C,CAFkB,EAGlBoB,aAHkB,EAIlBJ,SAJkB,EAKlBN,KALkB,CAAJ,CAAlB;EAQA,MAAMe,aAAa,GAAG9C,gBAAgB,CAACgC,OAAD,CAAtC;EACA,MAAMe,WAAW,GAAGpB,IAAI,KAAKrB,SAAT,GAAqB,MAArB,GAA8BwC,aAA9B,aAA8BA,aAA9B,uBAA8BA,aAAa,CAAE1B,iBAAjE;EACA,MAAM4B,YAAY,GAAGF,aAAH,aAAGA,aAAH,uBAAGA,aAAa,CAAG,YAAH,CAAlC;EAEA,oBACI,6BAAC,iBAAD;IACI,GAAG,EAAE3B,GADT;IAEI,iBAAiB,EAAEC,iBAAiB,IAAI2B,WAF5C;IAGI,gBAAgB,EAAE,CAACxB,kBAHvB;IAII,cAAYD,SAAS,IAAI0B,YAJ7B;IAKI,QAAQ,EAAExB,QALd;IAMI,aAAa,EAAEE,aANnB,CAOI;IAPJ;IAQI,IAAI,EAAEC,IARV;IASI,aAAa,EAAEC,aATnB;IAUI,OAAO,EAAEC,OAVb;IAWI,UAAU,EAAEC,UAXhB;IAYI,KAAK,EAAEa,SAZX;IAaI,QAAQ,EAAET,QAbd;IAcI,YAAY,EAAEC;EAdlB,EADJ;AAkBH,CA5DkB,CAAnB;;4BA8DenB,cAAA,CAAMiC,IAAN,CAAWlC,UAAX,C"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.typographyColors = void 0;
|
|
7
|
+
const typographyColors = ['inherit', 'accent', 'accentAlt', 'strong', 'strongInverse', 'base', 'baseInverse', 'baseOpacity', 'baseOpacityInverse', 'weak', 'weakOpacity', 'weakInverse', 'weakOpacityInverse'];
|
|
8
|
+
exports.typographyColors = typographyColors;
|
|
2
9
|
//# sourceMappingURL=TypographyProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["TypographyProps.ts"],"sourcesContent":["import React from 'react';\nimport type { AccessibilityProps, TextProps } from 'react-native';\nimport type { ComponentProps } from '../types';\n\nexport type TypographyAlign = 'inherit' | '
|
|
1
|
+
{"version":3,"names":["typographyColors"],"sources":["TypographyProps.ts"],"sourcesContent":["import React from 'react';\nimport type { AccessibilityProps, TextProps, TextStyle } from 'react-native';\nimport type { FontVariant, FontWeight } from '@fountain-ui/styles';\nimport type { ComponentProps } from '../types';\n\nexport type TypographyAlign = 'inherit' | TextStyle['textAlign'];\n\nexport const typographyColors = [\n 'inherit',\n 'accent',\n 'accentAlt',\n 'strong',\n 'strongInverse',\n 'base',\n 'baseInverse',\n 'baseOpacity',\n 'baseOpacityInverse',\n 'weak',\n 'weakOpacity',\n 'weakInverse',\n 'weakOpacityInverse',\n] as const;\n\nexport type TypographyColor = typeof typographyColors[number];\n\nexport interface Accessibility {\n accessibilityRole: AccessibilityProps['accessibilityRole'];\n 'area-level'?: number;\n}\n\nexport type AccessibilityMap = Partial<Record<FontVariant, Accessibility>>;\n\nexport default interface TypographyProps extends ComponentProps<{\n /**\n * Applies HTML tag at web and communicates purpose of component at app\n */\n accessibilityRole?: AccessibilityProps['accessibilityRole'];\n\n /**\n * Set the text-align on the component.\n * The value 'justify' is not supported on Android and fallbacks to left.\n * @default 'inherit'\n */\n align?: TypographyAlign;\n\n /**\n * Applies HTML heading level\n */\n ariaLevel?: number;\n\n /**\n * Specifies whether fonts should scale to respect Text Size accessibility settings.\n * @default false\n */\n disableFontScaling?: boolean;\n\n /**\n * The content of the component.\n */\n children?: React.ReactNode;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'inherit'\n */\n color?: TypographyColor;\n\n /**\n * The text ellipsis mode.\n * @default 'tail'\n */\n ellipsizeMode?: TextProps['ellipsizeMode'];\n\n /**\n * Internal use only. The hyperlink of the text.\n */\n href?: string;\n\n /**\n * Used to truncate the text with an ellipsis after computing the text\n * layout, including line wrapping, such that the total number of lines\n * does not exceed this number.\n */\n numberOfLines?: TextProps['numberOfLines'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n onPress?: TextProps['onPress'];\n\n /**\n * Lets the user select text, to use the native copy and paste functionality.\n */\n selectable?: boolean;\n\n /**\n * Applies the theme typography styles.\n * @default 'body1'\n */\n variant?: FontVariant;\n\n /**\n * Determines the font weight.\n * @default 'medium'\n */\n weight?: FontWeight;\n\n /**\n * Callback that is called when the text layout has been calculated.\n */\n onTextLayout?: TextProps['onTextLayout'];\n\n /**\n * Callback that is called when the layout of the Text component changes.\n */\n onLayout?: TextProps['onLayout'];\n}> {}\n"],"mappings":";;;;;;AAOO,MAAMA,gBAAgB,GAAG,CAC5B,SAD4B,EAE5B,QAF4B,EAG5B,WAH4B,EAI5B,QAJ4B,EAK5B,eAL4B,EAM5B,MAN4B,EAO5B,aAP4B,EAQ5B,aAR4B,EAS5B,oBAT4B,EAU5B,MAV4B,EAW5B,aAX4B,EAY5B,aAZ4B,EAa5B,oBAb4B,CAAzB"}
|
|
@@ -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 _LegacyTypography.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _LegacyTypography = _interopRequireDefault(require("./LegacyTypography"));
|
|
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 './LegacyTypography';\nexport type { default as TypographyProps } from './LegacyTypographyProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -52,6 +52,7 @@ function useCollapsibleAppBar() {
|
|
|
52
52
|
const lastTranslateY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
53
53
|
const lastOffsetY = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
54
54
|
const overlapped = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
55
|
+
const [isScrolled, setIsScrolled] = (0, _react.useState)(false);
|
|
55
56
|
const theme = (0, _styles.useTheme)();
|
|
56
57
|
const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
|
|
57
58
|
const transform = [{
|
|
@@ -96,6 +97,13 @@ function useCollapsibleAppBar() {
|
|
|
96
97
|
},
|
|
97
98
|
onScroll: event => {
|
|
98
99
|
const offsetY = event.contentOffset.y;
|
|
100
|
+
|
|
101
|
+
if (!isScrolled && offsetY > 0) {
|
|
102
|
+
(0, _reactNativeReanimated.runOnJS)(setIsScrolled)(true);
|
|
103
|
+
} else if (isScrolled && offsetY <= 0) {
|
|
104
|
+
(0, _reactNativeReanimated.runOnJS)(setIsScrolled)(false);
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
const maxTy = maxTranslateY.value;
|
|
100
108
|
|
|
101
109
|
if (SUPPORTS_DRAG_DETECTION) {
|
|
@@ -133,7 +141,7 @@ function useCollapsibleAppBar() {
|
|
|
133
141
|
overlapped.value = offsetY + nextTranslateY > 0;
|
|
134
142
|
translateY.value = (0, _reactNativeReanimated.withTiming)(nextTranslateY, ANIMATION_CONFIG);
|
|
135
143
|
}
|
|
136
|
-
}, [keyboardDismissMode, appBarHeight]);
|
|
144
|
+
}, [keyboardDismissMode, appBarHeight, isScrolled]);
|
|
137
145
|
const hasCollapsible = collapsibleToolbarHeight > 0;
|
|
138
146
|
const appBarStyle = [animatedStyle, {
|
|
139
147
|
paddingTop: safeAreaInsets.top
|
|
@@ -146,7 +154,8 @@ function useCollapsibleAppBar() {
|
|
|
146
154
|
onScrollViewChanged,
|
|
147
155
|
scrollContentInsets: {
|
|
148
156
|
top: hasCollapsible ? appBarHeight : 0
|
|
149
|
-
}
|
|
157
|
+
},
|
|
158
|
+
isScrolled
|
|
150
159
|
};
|
|
151
160
|
}
|
|
152
161
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defaultOptions","keyboardDismissMode","dividerExposureMode","supportsReverseScroll","ANIMATION_CONFIG","duration","TRANSPARENT","SUPPORTS_DRAG_DETECTION","Platform","OS","dismissKeyboard","Keyboard","dismiss","useCollapsibleAppBar","userOptions","styles","useAppbarStyles","safeAreaInsets","useSafeAreaInsets","appBarHeight","onAppBarLayout","useHeight","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","useDerivedValue","translateY","useSharedValue","lastTranslateY","lastOffsetY","overlapped","theme","useTheme","animatedStyle","useAnimatedStyle","transform","value","borderColor","palette","divider","borderBottomWidth","StyleSheet","hairlineWidth","indexRef","useRef","offsetsRef","onScrollViewChanged","useCallback","nextIndex","prevIndex","current","savedOffsetY","withTiming","scrollHandler","useAnimatedScrollHandler","onBeginDrag","runOnJS","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","maxTy","dy","Math","min","max","minOffsetY","maxOffsetY","contentSize","height","layoutMeasurement","safeOffsetY","safeLastOffsetY","newTranslateY","onEndDrag","onMomentumEnd","ty","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","floating","undefined","scrollContentInsets"],"sources":["useCollapsibleAppBar.ts"],"sourcesContent":["import { useCallback, useRef } from 'react';\nimport {\n Falsy,\n Keyboard,\n Platform,\n RegisteredStyle,\n ScrollViewProps,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport {\n runOnJS,\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/styles';\nimport { useHeight } from '../internal/hooks';\nimport useAppbarStyles from './useAppbarStyles';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n keyboardDismissMode?: 'none' | 'on-drag';\n dividerExposureMode?: 'always' | 'overlapped';\n supportsReverseScroll?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n}\n\nconst defaultOptions: Required<Options> = {\n keyboardDismissMode: 'none',\n dividerExposureMode: 'overlapped',\n supportsReverseScroll: true,\n};\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 100 };\nconst TRANSPARENT = '#FFFFFF00';\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\nconst dismissKeyboard = () => Keyboard.dismiss();\n\nexport default function useCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const { keyboardDismissMode, dividerExposureMode, supportsReverseScroll }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);\n\n const translateY = useSharedValue<number>(0);\n const lastTranslateY = useSharedValue<number>(0);\n const lastOffsetY = useSharedValue<number>(0);\n const overlapped = useSharedValue<boolean>(false);\n\n const theme = useTheme();\n\n const animatedStyle = useAnimatedStyle(() => {\n const transform = [{ translateY: translateY.value }];\n\n return {\n transform,\n borderColor: dividerExposureMode === 'always' || overlapped.value ? theme.palette.divider : TRANSPARENT,\n borderBottomWidth: StyleSheet.hairlineWidth,\n };\n }, [\n theme,\n dividerExposureMode,\n ]);\n\n const indexRef = useRef<number>(0);\n const offsetsRef = useRef<Array<number>>([]);\n\n const onScrollViewChanged = useCallback((nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = withTiming(0, ANIMATION_CONFIG);\n }\n }, [appBarHeight]);\n\n const scrollHandler = useAnimatedScrollHandler({\n onBeginDrag: () => {\n if (keyboardDismissMode === 'on-drag') {\n runOnJS(dismissKeyboard)();\n }\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n const maxTy = maxTranslateY.value;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n const minOffsetY = -maxTy;\n const maxOffsetY = event.contentSize.height - event.layoutMeasurement.height;\n\n const safeOffsetY = Math.min(Math.max(offsetY, minOffsetY), maxOffsetY);\n const safeLastOffsetY = Math.min(Math.max(lastOffsetY.value, minOffsetY), maxOffsetY);\n const dy = safeOffsetY - safeLastOffsetY;\n\n const newTranslateY = supportsReverseScroll\n ? dy === 0\n ? lastTranslateY.value\n : dy > 0\n ? maxTy\n : 0\n : safeLastOffsetY === minOffsetY\n ? 0\n : maxTy;\n\n translateY.value = withTiming(newTranslateY, ANIMATION_CONFIG);\n lastTranslateY.value = newTranslateY;\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = withTiming(nextTranslateY, ANIMATION_CONFIG);\n },\n }, [keyboardDismissMode, appBarHeight]);\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n { paddingTop: safeAreaInsets.top },\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarHeight : 0 },\n };\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAWA;;AAQA;;AACA;;AACA;;AACA;;;;AAgCA,MAAMA,cAAiC,GAAG;EACtCC,mBAAmB,EAAE,MADiB;EAEtCC,mBAAmB,EAAE,YAFiB;EAGtCC,qBAAqB,EAAE;AAHe,CAA1C;AAMA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,WAAW,GAAG,WAApB;AAEA,MAAMC,uBAAuB,GAAGC,qBAAA,CAASC,EAAT,KAAgB,KAAhD;;AACA,MAAMC,eAAe,GAAG,MAAMC,qBAAA,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,EAAE;MAAEH,GAAG,EAAEH,cAAc,GAAG9D,YAAH,GAAkB;IAAvC;EANlB,CAAP;AAQH;;AAAA"}
|
|
1
|
+
{"version":3,"names":["defaultOptions","keyboardDismissMode","dividerExposureMode","supportsReverseScroll","ANIMATION_CONFIG","duration","TRANSPARENT","SUPPORTS_DRAG_DETECTION","Platform","OS","dismissKeyboard","Keyboard","dismiss","useCollapsibleAppBar","userOptions","styles","useAppbarStyles","safeAreaInsets","useSafeAreaInsets","appBarHeight","onAppBarLayout","useHeight","collapsibleToolbarHeight","onCollapsibleToolbarLayout","maxTranslateY","useDerivedValue","translateY","useSharedValue","lastTranslateY","lastOffsetY","overlapped","isScrolled","setIsScrolled","useState","theme","useTheme","animatedStyle","useAnimatedStyle","transform","value","borderColor","palette","divider","borderBottomWidth","StyleSheet","hairlineWidth","indexRef","useRef","offsetsRef","onScrollViewChanged","useCallback","nextIndex","prevIndex","current","savedOffsetY","withTiming","scrollHandler","useAnimatedScrollHandler","onBeginDrag","runOnJS","onMomentumBegin","onScroll","event","offsetY","contentOffset","y","maxTy","dy","Math","min","max","minOffsetY","maxOffsetY","contentSize","height","layoutMeasurement","safeOffsetY","safeLastOffsetY","newTranslateY","onEndDrag","onMomentumEnd","ty","threshold","nextTranslateY","hasCollapsible","appBarStyle","paddingTop","top","floating","undefined","scrollContentInsets"],"sources":["useCollapsibleAppBar.ts"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\nimport {\n Falsy,\n Keyboard,\n Platform,\n RegisteredStyle,\n ScrollViewProps,\n StyleSheet,\n ViewProps,\n ViewStyle,\n} from 'react-native';\nimport type { WithTimingConfig } from 'react-native-reanimated';\nimport {\n runOnJS,\n useAnimatedScrollHandler,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { useTheme } from '@fountain-ui/styles';\nimport { useHeight } from '../internal/hooks';\nimport useAppbarStyles from './useAppbarStyles';\n\ntype WebOnlyStyle = { boxShadow: any };\n\ntype ViewStyleProp = Array<ViewStyle | RegisteredStyle<ViewStyle> | WebOnlyStyle | Falsy>;\n\ntype OnScroll = ScrollViewProps['onScroll'];\n\ntype OnLayoutCallback = ViewProps['onLayout'];\n\nexport interface ContentInsets {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\nexport interface Options {\n keyboardDismissMode?: 'none' | 'on-drag';\n dividerExposureMode?: 'always' | 'overlapped';\n supportsReverseScroll?: boolean;\n}\n\nexport interface CollapsibleAppBar {\n appBarStyle: ViewStyleProp;\n onAppBarLayout: OnLayoutCallback;\n onCollapsibleToolbarLayout: OnLayoutCallback;\n onScroll: OnScroll;\n onScrollViewChanged: (index: number) => void;\n scrollContentInsets: ContentInsets;\n isScrolled: boolean;\n}\n\nconst defaultOptions: Required<Options> = {\n keyboardDismissMode: 'none',\n dividerExposureMode: 'overlapped',\n supportsReverseScroll: true,\n};\n\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 100 };\nconst TRANSPARENT = '#FFFFFF00';\n\nconst SUPPORTS_DRAG_DETECTION = Platform.OS !== 'web';\nconst dismissKeyboard = () => Keyboard.dismiss();\n\nexport default function useCollapsibleAppBar(userOptions: Options = defaultOptions): CollapsibleAppBar {\n const { keyboardDismissMode, dividerExposureMode, supportsReverseScroll }: Required<Options> = {\n ...defaultOptions,\n ...userOptions,\n };\n\n const styles = useAppbarStyles();\n\n const safeAreaInsets = useSafeAreaInsets();\n\n const [appBarHeight, onAppBarLayout] = useHeight();\n const [collapsibleToolbarHeight, onCollapsibleToolbarLayout] = useHeight();\n\n const maxTranslateY = useDerivedValue(() => -collapsibleToolbarHeight, [collapsibleToolbarHeight]);\n\n const translateY = useSharedValue<number>(0);\n const lastTranslateY = useSharedValue<number>(0);\n const lastOffsetY = useSharedValue<number>(0);\n const overlapped = useSharedValue<boolean>(false);\n\n const [isScrolled, setIsScrolled] = useState<boolean>(false);\n\n const theme = useTheme();\n\n const animatedStyle = useAnimatedStyle(() => {\n const transform = [{ translateY: translateY.value }];\n\n return {\n transform,\n borderColor: dividerExposureMode === 'always' || overlapped.value ? theme.palette.divider : TRANSPARENT,\n borderBottomWidth: StyleSheet.hairlineWidth,\n };\n }, [\n theme,\n dividerExposureMode,\n ]);\n\n const indexRef = useRef<number>(0);\n const offsetsRef = useRef<Array<number>>([]);\n\n const onScrollViewChanged = useCallback((nextIndex: number) => {\n const prevIndex = indexRef.current;\n if (prevIndex === nextIndex) {\n return;\n }\n\n offsetsRef.current[prevIndex] = lastOffsetY.value;\n\n const savedOffsetY = offsetsRef.current[nextIndex] ?? 0;\n lastOffsetY.value = savedOffsetY;\n\n indexRef.current = nextIndex;\n\n // Determine whether to overlap every time index is changed.\n overlapped.value = savedOffsetY > 0;\n\n // If next ScrollView's offset is too short, expand app bar.\n if (translateY.value < 0 && savedOffsetY < appBarHeight) {\n translateY.value = withTiming(0, ANIMATION_CONFIG);\n }\n }, [appBarHeight]);\n\n const scrollHandler = useAnimatedScrollHandler({\n onBeginDrag: () => {\n if (keyboardDismissMode === 'on-drag') {\n runOnJS(dismissKeyboard)();\n }\n lastTranslateY.value = translateY.value;\n },\n onMomentumBegin: () => {\n lastTranslateY.value = translateY.value;\n },\n onScroll: (event) => {\n const offsetY = event.contentOffset.y;\n\n if (!isScrolled && offsetY > 0) {\n runOnJS(setIsScrolled)(true);\n } else if (isScrolled && offsetY <= 0) {\n runOnJS(setIsScrolled)(false);\n }\n\n const maxTy = maxTranslateY.value;\n\n if (SUPPORTS_DRAG_DETECTION) {\n const dy = offsetY - lastOffsetY.value;\n\n translateY.value = offsetY <= 0 ? 0 : Math.min(Math.max(lastTranslateY.value - dy, maxTy), 0);\n\n overlapped.value = offsetY + translateY.value > 0;\n } else {\n const minOffsetY = -maxTy;\n const maxOffsetY = event.contentSize.height - event.layoutMeasurement.height;\n\n const safeOffsetY = Math.min(Math.max(offsetY, minOffsetY), maxOffsetY);\n const safeLastOffsetY = Math.min(Math.max(lastOffsetY.value, minOffsetY), maxOffsetY);\n const dy = safeOffsetY - safeLastOffsetY;\n\n const newTranslateY = supportsReverseScroll\n ? dy === 0\n ? lastTranslateY.value\n : dy > 0\n ? maxTy\n : 0\n : safeLastOffsetY === minOffsetY\n ? 0\n : maxTy;\n\n translateY.value = withTiming(newTranslateY, ANIMATION_CONFIG);\n lastTranslateY.value = newTranslateY;\n\n overlapped.value = offsetY > 0;\n\n lastOffsetY.value = offsetY;\n }\n },\n onEndDrag: (event) => {\n lastOffsetY.value = event.contentOffset.y;\n },\n onMomentumEnd: (event) => {\n const offsetY = event.contentOffset.y;\n\n lastOffsetY.value = offsetY;\n\n const ty = translateY.value;\n const maxTy = maxTranslateY.value;\n\n // If toolbar is already positioned on edge, do nothing.\n if (ty <= maxTy || ty >= 0) {\n return;\n }\n\n const threshold = maxTy * 0.5;\n\n const nextTranslateY = (ty > threshold || offsetY < appBarHeight) ? 0 : maxTy;\n\n overlapped.value = offsetY + nextTranslateY > 0;\n\n translateY.value = withTiming(nextTranslateY, ANIMATION_CONFIG);\n },\n }, [keyboardDismissMode, appBarHeight, isScrolled]);\n\n const hasCollapsible = collapsibleToolbarHeight > 0;\n\n const appBarStyle = [\n animatedStyle,\n { paddingTop: safeAreaInsets.top },\n hasCollapsible ? styles.floating : undefined,\n ];\n\n return {\n appBarStyle,\n onAppBarLayout,\n onCollapsibleToolbarLayout,\n onScroll: scrollHandler,\n onScrollViewChanged,\n scrollContentInsets: { top: hasCollapsible ? appBarHeight : 0 },\n isScrolled,\n };\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAWA;;AAQA;;AACA;;AACA;;AACA;;;;AAiCA,MAAMA,cAAiC,GAAG;EACtCC,mBAAmB,EAAE,MADiB;EAEtCC,mBAAmB,EAAE,YAFiB;EAGtCC,qBAAqB,EAAE;AAHe,CAA1C;AAMA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,WAAW,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2B/E,gBAA3B,CAAnB;IACH;EA5E0C,CAAzB,EA6EnB,CAACH,mBAAD,EAAsBkB,YAAtB,EAAoCY,UAApC,CA7EmB,CAAtB;EA+EA,MAAMqD,cAAc,GAAG9D,wBAAwB,GAAG,CAAlD;EAEA,MAAM+D,WAAW,GAAG,CAChBjD,aADgB,EAEhB;IAAEkD,UAAU,EAAErE,cAAc,CAACsE;EAA7B,CAFgB,EAGhBH,cAAc,GAAGrE,MAAM,CAACyE,QAAV,GAAqBC,SAHnB,CAApB;EAMA,OAAO;IACHJ,WADG;IAEHjE,cAFG;IAGHG,0BAHG;IAIHsC,QAAQ,EAAEL,aAJP;IAKHP,mBALG;IAMHyC,mBAAmB,EAAE;MAAEH,GAAG,EAAEH,cAAc,GAAGjE,YAAH,GAAkB;IAAvC,CANlB;IAOHY;EAPG,CAAP;AASH;;AAAA"}
|
package/build/commonjs/index.js
CHANGED
|
@@ -11,11 +11,13 @@ var _exportNames = {
|
|
|
11
11
|
Badge: true,
|
|
12
12
|
Button: true,
|
|
13
13
|
ButtonBase: true,
|
|
14
|
+
ButtonSet: true,
|
|
14
15
|
Card: true,
|
|
15
16
|
CardActions: true,
|
|
16
17
|
CardContent: true,
|
|
17
18
|
CardMedia: true,
|
|
18
19
|
Checkbox: true,
|
|
20
|
+
CheckboxGroup: true,
|
|
19
21
|
Chip: true,
|
|
20
22
|
CircularProgress: true,
|
|
21
23
|
Column: true,
|
|
@@ -46,6 +48,7 @@ var _exportNames = {
|
|
|
46
48
|
Radio: true,
|
|
47
49
|
RadioGroup: true,
|
|
48
50
|
Row: true,
|
|
51
|
+
ShadowView: true,
|
|
49
52
|
Slide: true,
|
|
50
53
|
Slider: true,
|
|
51
54
|
Snackbar: true,
|
|
@@ -57,6 +60,7 @@ var _exportNames = {
|
|
|
57
60
|
TabBase: true,
|
|
58
61
|
Tabs: true,
|
|
59
62
|
TextField: true,
|
|
63
|
+
Toggle: true,
|
|
60
64
|
Toolbar: true,
|
|
61
65
|
Tooltip: true,
|
|
62
66
|
Typography: true
|
|
@@ -103,6 +107,12 @@ Object.defineProperty(exports, "ButtonBase", {
|
|
|
103
107
|
return _ButtonBase.default;
|
|
104
108
|
}
|
|
105
109
|
});
|
|
110
|
+
Object.defineProperty(exports, "ButtonSet", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function () {
|
|
113
|
+
return _ButtonSet.default;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
106
116
|
Object.defineProperty(exports, "Card", {
|
|
107
117
|
enumerable: true,
|
|
108
118
|
get: function () {
|
|
@@ -133,6 +143,12 @@ Object.defineProperty(exports, "Checkbox", {
|
|
|
133
143
|
return _Checkbox.default;
|
|
134
144
|
}
|
|
135
145
|
});
|
|
146
|
+
Object.defineProperty(exports, "CheckboxGroup", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function () {
|
|
149
|
+
return _CheckboxGroup.default;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
136
152
|
Object.defineProperty(exports, "Chip", {
|
|
137
153
|
enumerable: true,
|
|
138
154
|
get: function () {
|
|
@@ -307,6 +323,12 @@ Object.defineProperty(exports, "Row", {
|
|
|
307
323
|
return _Row.default;
|
|
308
324
|
}
|
|
309
325
|
});
|
|
326
|
+
Object.defineProperty(exports, "ShadowView", {
|
|
327
|
+
enumerable: true,
|
|
328
|
+
get: function () {
|
|
329
|
+
return _ShadowView.default;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
310
332
|
Object.defineProperty(exports, "Slide", {
|
|
311
333
|
enumerable: true,
|
|
312
334
|
get: function () {
|
|
@@ -373,6 +395,12 @@ Object.defineProperty(exports, "TextField", {
|
|
|
373
395
|
return _TextField.default;
|
|
374
396
|
}
|
|
375
397
|
});
|
|
398
|
+
Object.defineProperty(exports, "Toggle", {
|
|
399
|
+
enumerable: true,
|
|
400
|
+
get: function () {
|
|
401
|
+
return _Toggle.default;
|
|
402
|
+
}
|
|
403
|
+
});
|
|
376
404
|
Object.defineProperty(exports, "Toolbar", {
|
|
377
405
|
enumerable: true,
|
|
378
406
|
get: function () {
|
|
@@ -566,6 +594,20 @@ Object.keys(_ButtonBase).forEach(function (key) {
|
|
|
566
594
|
});
|
|
567
595
|
});
|
|
568
596
|
|
|
597
|
+
var _ButtonSet = _interopRequireWildcard(require("./ButtonSet"));
|
|
598
|
+
|
|
599
|
+
Object.keys(_ButtonSet).forEach(function (key) {
|
|
600
|
+
if (key === "default" || key === "__esModule") return;
|
|
601
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
602
|
+
if (key in exports && exports[key] === _ButtonSet[key]) return;
|
|
603
|
+
Object.defineProperty(exports, key, {
|
|
604
|
+
enumerable: true,
|
|
605
|
+
get: function () {
|
|
606
|
+
return _ButtonSet[key];
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
|
|
569
611
|
var _Card = _interopRequireWildcard(require("./Card"));
|
|
570
612
|
|
|
571
613
|
Object.keys(_Card).forEach(function (key) {
|
|
@@ -636,6 +678,20 @@ Object.keys(_Checkbox).forEach(function (key) {
|
|
|
636
678
|
});
|
|
637
679
|
});
|
|
638
680
|
|
|
681
|
+
var _CheckboxGroup = _interopRequireWildcard(require("./CheckboxGroup"));
|
|
682
|
+
|
|
683
|
+
Object.keys(_CheckboxGroup).forEach(function (key) {
|
|
684
|
+
if (key === "default" || key === "__esModule") return;
|
|
685
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
686
|
+
if (key in exports && exports[key] === _CheckboxGroup[key]) return;
|
|
687
|
+
Object.defineProperty(exports, key, {
|
|
688
|
+
enumerable: true,
|
|
689
|
+
get: function () {
|
|
690
|
+
return _CheckboxGroup[key];
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
});
|
|
694
|
+
|
|
639
695
|
var _Chip = _interopRequireWildcard(require("./Chip"));
|
|
640
696
|
|
|
641
697
|
Object.keys(_Chip).forEach(function (key) {
|
|
@@ -1056,6 +1112,20 @@ Object.keys(_Row).forEach(function (key) {
|
|
|
1056
1112
|
});
|
|
1057
1113
|
});
|
|
1058
1114
|
|
|
1115
|
+
var _ShadowView = _interopRequireWildcard(require("./ShadowView"));
|
|
1116
|
+
|
|
1117
|
+
Object.keys(_ShadowView).forEach(function (key) {
|
|
1118
|
+
if (key === "default" || key === "__esModule") return;
|
|
1119
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1120
|
+
if (key in exports && exports[key] === _ShadowView[key]) return;
|
|
1121
|
+
Object.defineProperty(exports, key, {
|
|
1122
|
+
enumerable: true,
|
|
1123
|
+
get: function () {
|
|
1124
|
+
return _ShadowView[key];
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1059
1129
|
var _Slide = _interopRequireWildcard(require("./Slide"));
|
|
1060
1130
|
|
|
1061
1131
|
Object.keys(_Slide).forEach(function (key) {
|
|
@@ -1210,6 +1280,20 @@ Object.keys(_TextField).forEach(function (key) {
|
|
|
1210
1280
|
});
|
|
1211
1281
|
});
|
|
1212
1282
|
|
|
1283
|
+
var _Toggle = _interopRequireWildcard(require("./Toggle"));
|
|
1284
|
+
|
|
1285
|
+
Object.keys(_Toggle).forEach(function (key) {
|
|
1286
|
+
if (key === "default" || key === "__esModule") return;
|
|
1287
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1288
|
+
if (key in exports && exports[key] === _Toggle[key]) return;
|
|
1289
|
+
Object.defineProperty(exports, key, {
|
|
1290
|
+
enumerable: true,
|
|
1291
|
+
get: function () {
|
|
1292
|
+
return _Toggle[key];
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
});
|
|
1296
|
+
|
|
1213
1297
|
var _Toolbar = _interopRequireWildcard(require("./Toolbar"));
|
|
1214
1298
|
|
|
1215
1299
|
Object.keys(_Toolbar).forEach(function (key) {
|