@yahoo/uds-mobile 2.23.2 → 2.24.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -12
- package/dist/bin/automated-config/dist/generated/generatedConfigs.mjs +92 -46
- package/dist/components/Button/buttonTheme.cjs +63 -23
- package/dist/components/Button/buttonTheme.d.cts +29 -12
- package/dist/components/Button/buttonTheme.d.cts.map +1 -1
- package/dist/components/Button/buttonTheme.d.ts +29 -12
- package/dist/components/Button/buttonTheme.d.ts.map +1 -1
- package/dist/components/Button/buttonTheme.js +62 -23
- package/dist/components/Button/buttonTheme.js.map +1 -1
- package/dist/components/Button.cjs +34 -13
- package/dist/components/Button.d.cts +7 -0
- package/dist/components/Button.d.cts.map +1 -1
- package/dist/components/Button.d.ts +7 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +34 -13
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Checkbox.cjs +30 -7
- package/dist/components/Checkbox.d.cts +7 -0
- package/dist/components/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox.d.ts +7 -0
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +30 -7
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Chip/ChipBase.cjs +23 -9
- package/dist/components/Chip/ChipBase.d.cts.map +1 -1
- package/dist/components/Chip/ChipBase.d.ts.map +1 -1
- package/dist/components/Chip/ChipBase.js +23 -9
- package/dist/components/Chip/ChipBase.js.map +1 -1
- package/dist/components/Chip/ChipDismissible.cjs +3 -1
- package/dist/components/Chip/ChipDismissible.js +3 -1
- package/dist/components/Chip/ChipDismissible.js.map +1 -1
- package/dist/components/Chip/types.d.cts +7 -0
- package/dist/components/Chip/types.d.cts.map +1 -1
- package/dist/components/Chip/types.d.ts +7 -0
- package/dist/components/Chip/types.d.ts.map +1 -1
- package/dist/components/Icon.cjs +7 -3
- package/dist/components/Icon.d.cts +9 -1
- package/dist/components/Icon.d.cts.map +1 -1
- package/dist/components/Icon.d.ts +9 -1
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.js +7 -3
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/IconButton.cjs +18 -8
- package/dist/components/IconButton.js +18 -8
- package/dist/components/IconButton.js.map +1 -1
- package/dist/components/Radio/Radio.cjs +29 -11
- package/dist/components/Radio/Radio.d.cts +7 -0
- package/dist/components/Radio/Radio.d.cts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +7 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +29 -11
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Switch.cjs +25 -2
- package/dist/components/Switch.d.cts +7 -0
- package/dist/components/Switch.d.cts.map +1 -1
- package/dist/components/Switch.d.ts +7 -0
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +25 -2
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Tabs/Tab.cjs +12 -2
- package/dist/components/Tabs/Tab.d.cts.map +1 -1
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.js +12 -2
- package/dist/components/Tabs/Tab.js.map +1 -1
- package/dist/components/Tabs/Tabs.cjs +8 -3
- package/dist/components/Tabs/Tabs.d.cts +9 -1
- package/dist/components/Tabs/Tabs.d.cts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +9 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +8 -3
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/tabsContexts.d.cts +2 -0
- package/dist/components/Tabs/tabsContexts.d.cts.map +1 -1
- package/dist/components/Tabs/tabsContexts.d.ts +2 -0
- package/dist/components/Tabs/tabsContexts.d.ts.map +1 -1
- package/dist/components/Tabs/tabsContexts.js.map +1 -1
- package/dist/components/Text.cjs +4 -1
- package/dist/components/Text.d.cts +10 -2
- package/dist/components/Text.d.cts.map +1 -1
- package/dist/components/Text.d.ts +10 -2
- package/dist/components/Text.d.ts.map +1 -1
- package/dist/components/Text.js +4 -1
- package/dist/components/Text.js.map +1 -1
- package/dist/components/UDSProvider.cjs +6 -2
- package/dist/components/UDSProvider.d.cts +8 -0
- package/dist/components/UDSProvider.d.cts.map +1 -1
- package/dist/components/UDSProvider.d.ts +8 -0
- package/dist/components/UDSProvider.d.ts.map +1 -1
- package/dist/components/UDSProvider.js +6 -2
- package/dist/components/UDSProvider.js.map +1 -1
- package/dist/fontScaling/FontScalingContext.cjs +35 -0
- package/dist/fontScaling/FontScalingContext.d.cts +38 -0
- package/dist/fontScaling/FontScalingContext.d.cts.map +1 -0
- package/dist/fontScaling/FontScalingContext.d.ts +38 -0
- package/dist/fontScaling/FontScalingContext.d.ts.map +1 -0
- package/dist/fontScaling/FontScalingContext.js +34 -0
- package/dist/fontScaling/FontScalingContext.js.map +1 -0
- package/dist/fontScaling/constants.cjs +72 -0
- package/dist/fontScaling/constants.d.cts +49 -0
- package/dist/fontScaling/constants.d.cts.map +1 -0
- package/dist/fontScaling/constants.d.ts +49 -0
- package/dist/fontScaling/constants.d.ts.map +1 -0
- package/dist/fontScaling/constants.js +70 -0
- package/dist/fontScaling/constants.js.map +1 -0
- package/dist/fontScaling/index.cjs +13 -0
- package/dist/fontScaling/index.d.cts +8 -0
- package/dist/fontScaling/index.d.ts +8 -0
- package/dist/fontScaling/index.js +6 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.cjs +38 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts +36 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts.map +1 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts +36 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts.map +1 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.js +39 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.js.map +1 -0
- package/dist/fontScaling/types.cjs +1 -0
- package/dist/fontScaling/types.d.cts +51 -0
- package/dist/fontScaling/types.d.cts.map +1 -0
- package/dist/fontScaling/types.d.ts +51 -0
- package/dist/fontScaling/types.d.ts.map +1 -0
- package/dist/fontScaling/types.js +1 -0
- package/dist/fontScaling/useFontScale.cjs +32 -0
- package/dist/fontScaling/useFontScale.d.cts +18 -0
- package/dist/fontScaling/useFontScale.d.cts.map +1 -0
- package/dist/fontScaling/useFontScale.d.ts +18 -0
- package/dist/fontScaling/useFontScale.d.ts.map +1 -0
- package/dist/fontScaling/useFontScale.js +32 -0
- package/dist/fontScaling/useFontScale.js.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.cjs +24 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.cts +16 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.cts.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.ts +16 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.ts.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.js +24 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.js.map +1 -0
- package/dist/jest/mocks/react-native.cjs +19 -4
- package/dist/jest/mocks/react-native.d.cts +8 -5
- package/dist/jest/mocks/react-native.d.cts.map +1 -1
- package/dist/jest/mocks/react-native.d.ts +8 -5
- package/dist/jest/mocks/react-native.d.ts.map +1 -1
- package/dist/jest/mocks/react-native.js +18 -5
- package/dist/jest/mocks/react-native.js.map +1 -1
- package/dist/jest/mocks/styles.cjs +14 -0
- package/dist/jest/mocks/styles.d.cts.map +1 -1
- package/dist/jest/mocks/styles.d.ts.map +1 -1
- package/dist/jest/mocks/styles.js +14 -0
- package/dist/jest/mocks/styles.js.map +1 -1
- package/dist/jest/setup.cjs +4 -0
- package/dist/jest/setup.d.cts.map +1 -1
- package/dist/jest/setup.d.ts.map +1 -1
- package/dist/jest/setup.js +4 -0
- package/dist/jest/setup.js.map +1 -1
- package/dist/mobile/generated/fontMetrics.cjs +1166 -0
- package/dist/mobile/generated/fontMetrics.js +1168 -0
- package/dist/mobile/generated/fontMetrics.js.map +1 -0
- package/dist/portal.d.cts.map +1 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.js.map +1 -1
- package/dist/types/dist/index.d.cts.map +1 -1
- package/dist/types/dist/index.d.ts.map +1 -1
- package/fonts/uds-icons.ttf +0 -0
- package/generated/fontMetrics.ts +1173 -0
- package/generated/styles.d.ts +5 -28
- package/generated/unistyles.d.ts +0 -27
- package/package.json +11 -1
|
@@ -3,12 +3,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
4
4
|
const require_index = require("../motion-tokens/dist/index.cjs");
|
|
5
5
|
const require_motion = require("../motion.cjs");
|
|
6
|
+
const require_fontScaling_useMaxFontSizeMultiplier = require("../fontScaling/useMaxFontSizeMultiplier.cjs");
|
|
6
7
|
const require_components_Icon = require("./Icon.cjs");
|
|
8
|
+
const require_fontScaling_useFontScale = require("../fontScaling/useFontScale.cjs");
|
|
7
9
|
const require_components_Pressable = require("./Pressable.cjs");
|
|
8
10
|
const require_components_FormLabel = require("./FormLabel.cjs");
|
|
9
11
|
let react = require("react");
|
|
10
12
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
13
|
let generated_styles = require("../../generated/styles");
|
|
14
|
+
let _yahoo_uds_icons_tokens = require("@yahoo/uds-icons/tokens");
|
|
12
15
|
let react_native_reanimated = require("react-native-reanimated");
|
|
13
16
|
react_native_reanimated = require_runtime.__toESM(react_native_reanimated);
|
|
14
17
|
//#region src/components/Checkbox.tsx
|
|
@@ -50,8 +53,11 @@ const VARIANT_ERROR_MAP = {
|
|
|
50
53
|
* @see {@link Radio} for single-select options
|
|
51
54
|
* @see {@link Switch} for binary toggles
|
|
52
55
|
*/
|
|
53
|
-
const Checkbox = (0, react.memo)(function Checkbox({ label, labelPosition = "start", variant: variantProp = "primary", size = "md", checked: checkedProp, hasError, reduceMotion, defaultChecked, disabled, required, onChange, ref, ...viewProps }) {
|
|
56
|
+
const Checkbox = (0, react.memo)(function Checkbox({ label, labelPosition = "start", variant: variantProp = "primary", size = "md", checked: checkedProp, hasError, reduceMotion, defaultChecked, disabled, required, maxFontSizeMultiplier, onChange, ref, ...viewProps }) {
|
|
54
57
|
const uid = `uds-checkbox-${(0, react.useId)()}`;
|
|
58
|
+
const resolvedMaxFontSizeMultiplier = require_fontScaling_useMaxFontSizeMultiplier.useMaxFontSizeMultiplier("control", maxFontSizeMultiplier) ?? 0;
|
|
59
|
+
const fontScaleFactor = require_fontScaling_useFontScale.useFontScale(resolvedMaxFontSizeMultiplier);
|
|
60
|
+
const scaledMarkSize = Math.round(_yahoo_uds_icons_tokens.ICON_SIZE_MAP.sm * fontScaleFactor);
|
|
55
61
|
const isControlled = checkedProp !== void 0;
|
|
56
62
|
const [internalChecked, setInternalChecked] = (0, react.useState)(isControlled ? checkedProp : defaultChecked ?? false);
|
|
57
63
|
const [pressed, setPressed] = (0, react.useState)(false);
|
|
@@ -91,14 +97,27 @@ const Checkbox = (0, react.memo)(function Checkbox({ label, labelPosition = "sta
|
|
|
91
97
|
pressed
|
|
92
98
|
});
|
|
93
99
|
const rootStyle = (0, react.useMemo)(() => [generated_styles.checkboxStyles.root, { opacity: disabled ? .5 : 1 }], [generated_styles.checkboxStyles.root, disabled]);
|
|
94
|
-
const checkboxBoxStyle = (0, react.useMemo)(() =>
|
|
100
|
+
const checkboxBoxStyle = (0, react.useMemo)(() => {
|
|
101
|
+
const { width, height, borderRadius } = generated_styles.checkboxStyles.checkbox;
|
|
102
|
+
const scaledBox = fontScaleFactor !== 1 && typeof width === "number" && typeof height === "number" ? {
|
|
103
|
+
width: Math.round(width * fontScaleFactor),
|
|
104
|
+
height: Math.round(height * fontScaleFactor),
|
|
105
|
+
...typeof borderRadius === "number" && { borderRadius: Math.round(borderRadius * fontScaleFactor) }
|
|
106
|
+
} : void 0;
|
|
107
|
+
return [
|
|
108
|
+
generated_styles.checkboxStyles.checkbox,
|
|
109
|
+
scaledBox,
|
|
110
|
+
{
|
|
111
|
+
alignItems: "center",
|
|
112
|
+
justifyContent: "center"
|
|
113
|
+
},
|
|
114
|
+
checkboxAnimatedStyle
|
|
115
|
+
];
|
|
116
|
+
}, [
|
|
95
117
|
generated_styles.checkboxStyles.checkbox,
|
|
96
|
-
|
|
97
|
-
alignItems: "center",
|
|
98
|
-
justifyContent: "center"
|
|
99
|
-
},
|
|
118
|
+
fontScaleFactor,
|
|
100
119
|
checkboxAnimatedStyle
|
|
101
|
-
]
|
|
120
|
+
]);
|
|
102
121
|
const labelContent = (0, react.useMemo)(() => {
|
|
103
122
|
if (!label) return null;
|
|
104
123
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_FormLabel.FormLabel, {
|
|
@@ -108,12 +127,14 @@ const Checkbox = (0, react.memo)(function Checkbox({ label, labelPosition = "sta
|
|
|
108
127
|
required,
|
|
109
128
|
showRequiredAsterisk: required,
|
|
110
129
|
hasError,
|
|
130
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
111
131
|
style: generated_styles.checkboxStyles.text
|
|
112
132
|
});
|
|
113
133
|
}, [
|
|
114
134
|
label,
|
|
115
135
|
required,
|
|
116
136
|
hasError,
|
|
137
|
+
resolvedMaxFontSizeMultiplier,
|
|
117
138
|
generated_styles.checkboxStyles.text
|
|
118
139
|
]);
|
|
119
140
|
const a11yState = (0, react.useMemo)(() => ({
|
|
@@ -140,6 +161,8 @@ const Checkbox = (0, react.memo)(function Checkbox({ label, labelPosition = "sta
|
|
|
140
161
|
children: showIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
141
162
|
name: iconName,
|
|
142
163
|
size: "sm",
|
|
164
|
+
dangerouslySetSize: scaledMarkSize,
|
|
165
|
+
allowFontScaling: false,
|
|
143
166
|
style: generated_styles.checkboxStyles.checkboxIcon
|
|
144
167
|
})
|
|
145
168
|
}), labelContent]
|
|
@@ -14,6 +14,13 @@ interface CheckboxProps extends Omit<ViewProps, 'style'>, UniversalCheckboxProps
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/** Whether the checkbox is required */
|
|
16
16
|
required?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Caps how far the box, checkmark, and label grow with the OS text-size
|
|
19
|
+
* setting; all three scale by the same factor. Set null to remove the cap;
|
|
20
|
+
* override app-wide via UDSFontScalingProvider.
|
|
21
|
+
* @default 2
|
|
22
|
+
*/
|
|
23
|
+
maxFontSizeMultiplier?: number | null;
|
|
17
24
|
/** Callback fired when the checked state changes */
|
|
18
25
|
onChange?: (checked: boolean) => void;
|
|
19
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.cts","names":[],"sources":["../../src/components/Checkbox.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.cts","names":[],"sources":["../../src/components/Checkbox.tsx"],"mappings":";;;;;;;UAsBU,aAAA,SAAsB,IAAA,CAAK,SAAA,YAAqB,sBAAA;;EAExD,GAAA,GAAM,GAAA,CAAI,IAAA;EAFF;EAIR,cAAA;;EAEA,QAAA;EAJU;EAMV,QAAA;EAR8B;;;;;;EAe9B,qBAAA;EAbA;EAeA,QAAA,IAAY,OAAA;AAAA;;;;;;;;;AAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;cAqDxB,QAAA,EAAQ,OAAA,CAAA,oBAAA,CAAA,aAAA"}
|
|
@@ -14,6 +14,13 @@ interface CheckboxProps extends Omit<ViewProps, 'style'>, UniversalCheckboxProps
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/** Whether the checkbox is required */
|
|
16
16
|
required?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Caps how far the box, checkmark, and label grow with the OS text-size
|
|
19
|
+
* setting; all three scale by the same factor. Set null to remove the cap;
|
|
20
|
+
* override app-wide via UDSFontScalingProvider.
|
|
21
|
+
* @default 2
|
|
22
|
+
*/
|
|
23
|
+
maxFontSizeMultiplier?: number | null;
|
|
17
24
|
/** Callback fired when the checked state changes */
|
|
18
25
|
onChange?: (checked: boolean) => void;
|
|
19
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","names":[],"sources":["../../src/components/Checkbox.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","names":[],"sources":["../../src/components/Checkbox.tsx"],"mappings":";;;;;;;UAsBU,aAAA,SAAsB,IAAA,CAAK,SAAA,YAAqB,sBAAA;;EAExD,GAAA,GAAM,GAAA,CAAI,IAAA;EAFF;EAIR,cAAA;;EAEA,QAAA;EAJU;EAMV,QAAA;EAR8B;;;;;;EAe9B,qBAAA;EAbA;EAeA,QAAA,IAAY,OAAA;AAAA;;;;;;;;;AAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;cAqDxB,QAAA,EAAQ,OAAA,CAAA,oBAAA,CAAA,aAAA"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
import { SCALE_EFFECTS } from "../motion-tokens/dist/index.js";
|
|
3
3
|
import { BUTTON_SPRING_CONFIG } from "../motion.js";
|
|
4
|
+
import { useMaxFontSizeMultiplier } from "../fontScaling/useMaxFontSizeMultiplier.js";
|
|
4
5
|
import { Icon } from "./Icon.js";
|
|
6
|
+
import { useFontScale } from "../fontScaling/useFontScale.js";
|
|
5
7
|
import { Pressable } from "./Pressable.js";
|
|
6
8
|
import { FormLabel } from "./FormLabel.js";
|
|
7
9
|
import { memo, useCallback, useId, useMemo, useState } from "react";
|
|
8
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
import { checkboxStyles } from "../../generated/styles";
|
|
12
|
+
import { ICON_SIZE_MAP } from "@yahoo/uds-icons/tokens";
|
|
10
13
|
import Animated, { useAnimatedStyle, useDerivedValue, withSpring } from "react-native-reanimated";
|
|
11
14
|
//#region src/components/Checkbox.tsx
|
|
12
15
|
const VARIANT_ERROR_MAP = {
|
|
@@ -47,8 +50,11 @@ const VARIANT_ERROR_MAP = {
|
|
|
47
50
|
* @see {@link Radio} for single-select options
|
|
48
51
|
* @see {@link Switch} for binary toggles
|
|
49
52
|
*/
|
|
50
|
-
const Checkbox = memo(function Checkbox({ label, labelPosition = "start", variant: variantProp = "primary", size = "md", checked: checkedProp, hasError, reduceMotion, defaultChecked, disabled, required, onChange, ref, ...viewProps }) {
|
|
53
|
+
const Checkbox = memo(function Checkbox({ label, labelPosition = "start", variant: variantProp = "primary", size = "md", checked: checkedProp, hasError, reduceMotion, defaultChecked, disabled, required, maxFontSizeMultiplier, onChange, ref, ...viewProps }) {
|
|
51
54
|
const uid = `uds-checkbox-${useId()}`;
|
|
55
|
+
const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier("control", maxFontSizeMultiplier) ?? 0;
|
|
56
|
+
const fontScaleFactor = useFontScale(resolvedMaxFontSizeMultiplier);
|
|
57
|
+
const scaledMarkSize = Math.round(ICON_SIZE_MAP.sm * fontScaleFactor);
|
|
52
58
|
const isControlled = checkedProp !== void 0;
|
|
53
59
|
const [internalChecked, setInternalChecked] = useState(isControlled ? checkedProp : defaultChecked ?? false);
|
|
54
60
|
const [pressed, setPressed] = useState(false);
|
|
@@ -88,14 +94,27 @@ const Checkbox = memo(function Checkbox({ label, labelPosition = "start", varian
|
|
|
88
94
|
pressed
|
|
89
95
|
});
|
|
90
96
|
const rootStyle = useMemo(() => [checkboxStyles.root, { opacity: disabled ? .5 : 1 }], [checkboxStyles.root, disabled]);
|
|
91
|
-
const checkboxBoxStyle = useMemo(() =>
|
|
97
|
+
const checkboxBoxStyle = useMemo(() => {
|
|
98
|
+
const { width, height, borderRadius } = checkboxStyles.checkbox;
|
|
99
|
+
const scaledBox = fontScaleFactor !== 1 && typeof width === "number" && typeof height === "number" ? {
|
|
100
|
+
width: Math.round(width * fontScaleFactor),
|
|
101
|
+
height: Math.round(height * fontScaleFactor),
|
|
102
|
+
...typeof borderRadius === "number" && { borderRadius: Math.round(borderRadius * fontScaleFactor) }
|
|
103
|
+
} : void 0;
|
|
104
|
+
return [
|
|
105
|
+
checkboxStyles.checkbox,
|
|
106
|
+
scaledBox,
|
|
107
|
+
{
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
justifyContent: "center"
|
|
110
|
+
},
|
|
111
|
+
checkboxAnimatedStyle
|
|
112
|
+
];
|
|
113
|
+
}, [
|
|
92
114
|
checkboxStyles.checkbox,
|
|
93
|
-
|
|
94
|
-
alignItems: "center",
|
|
95
|
-
justifyContent: "center"
|
|
96
|
-
},
|
|
115
|
+
fontScaleFactor,
|
|
97
116
|
checkboxAnimatedStyle
|
|
98
|
-
]
|
|
117
|
+
]);
|
|
99
118
|
const labelContent = useMemo(() => {
|
|
100
119
|
if (!label) return null;
|
|
101
120
|
return /* @__PURE__ */ jsx(FormLabel, {
|
|
@@ -105,12 +124,14 @@ const Checkbox = memo(function Checkbox({ label, labelPosition = "start", varian
|
|
|
105
124
|
required,
|
|
106
125
|
showRequiredAsterisk: required,
|
|
107
126
|
hasError,
|
|
127
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
108
128
|
style: checkboxStyles.text
|
|
109
129
|
});
|
|
110
130
|
}, [
|
|
111
131
|
label,
|
|
112
132
|
required,
|
|
113
133
|
hasError,
|
|
134
|
+
resolvedMaxFontSizeMultiplier,
|
|
114
135
|
checkboxStyles.text
|
|
115
136
|
]);
|
|
116
137
|
const a11yState = useMemo(() => ({
|
|
@@ -137,6 +158,8 @@ const Checkbox = memo(function Checkbox({ label, labelPosition = "start", varian
|
|
|
137
158
|
children: showIcon && /* @__PURE__ */ jsx(Icon, {
|
|
138
159
|
name: iconName,
|
|
139
160
|
size: "sm",
|
|
161
|
+
dangerouslySetSize: scaledMarkSize,
|
|
162
|
+
allowFontScaling: false,
|
|
140
163
|
style: checkboxStyles.checkboxIcon
|
|
141
164
|
})
|
|
142
165
|
}), labelContent]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","names":[],"sources":["../../src/components/Checkbox.tsx"],"sourcesContent":["import type { CheckboxValue, CheckboxVariant, UniversalCheckboxProps } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useDerivedValue, withSpring } from 'react-native-reanimated';\n\nimport { checkboxStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport { FormLabel } from './FormLabel';\nimport { Icon } from './Icon';\nimport { Pressable } from './Pressable';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** Derived from CheckboxValue - maps boolean to 'checked'/'unchecked' string literals */\ntype CheckboxValueState = Exclude<CheckboxValue, boolean> | 'checked' | 'unchecked';\n\ninterface CheckboxProps extends Omit<ViewProps, 'style'>, UniversalCheckboxProps {\n /** Ref to the underlying View */\n ref?: Ref<View>;\n /** Default checked state for uncontrolled mode */\n defaultChecked?: boolean;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Whether the checkbox is required */\n required?: boolean;\n /** Callback fired when the checked state changes */\n onChange?: (checked: boolean) => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Variant Mapping */\n/* -------------------------------------------------------------------------- */\n\n/** All style variants available in the generated styles (includes error variants) */\ntype CheckboxStyleVariant = 'primary' | 'secondary' | 'alert' | 'alert-secondary';\n\nconst VARIANT_ERROR_MAP: Record<CheckboxVariant, CheckboxStyleVariant> = {\n primary: 'alert',\n secondary: 'alert-secondary',\n};\n\n/* -------------------------------------------------------------------------- */\n/* Checkbox Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **⚙️ A checkbox component**\n *\n * @description\n * A checkbox component allows users to select one or multiple options from a set.\n * It represents a binary state, typically as checked or unchecked, and optionally\n * includes a third \"indeterminate\" state to indicate partial selection.\n *\n * @category Form\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Checkbox } from '@yahoo/uds-mobile/Checkbox';\n *\n * <Checkbox label=\"Agree to terms\" />\n * <Checkbox label=\"Subscribe\" checked={true} onChange={setChecked} />\n * <Checkbox label=\"Partial\" checked=\"indeterminate\" />\n * ```\n *\n * @usage\n * - Forms: For selecting options\n * - Settings: For toggling preferences\n * - Filters: For multi-select filtering\n *\n * @accessibility\n * - Sets `accessibilityRole=\"checkbox\"` automatically\n * - Announces checked/unchecked/mixed state\n * - Label is used as accessibility label\n * - Supports `reduceMotion` for users who prefer reduced motion\n *\n * @see {@link Radio} for single-select options\n * @see {@link Switch} for binary toggles\n */\nconst Checkbox = memo(function Checkbox({\n // Checkbox props\n label,\n labelPosition = 'start',\n variant: variantProp = 'primary',\n size = 'md',\n checked: checkedProp,\n hasError,\n reduceMotion,\n // Native props\n defaultChecked,\n disabled,\n required,\n onChange,\n ref,\n ...viewProps\n}: CheckboxProps) {\n const generatedId = useId();\n const uid = `uds-checkbox-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const isControlled = checkedProp !== undefined;\n const [internalChecked, setInternalChecked] = useState<CheckboxValue>(\n isControlled ? checkedProp : (defaultChecked ?? false),\n );\n const [pressed, setPressed] = useState(false);\n\n // Use controlled value if provided, otherwise use internal state\n const checked = isControlled ? checkedProp : internalChecked;\n\n /* ------------------------------ Derived Values ---------------------------- */\n const valueState: CheckboxValueState = useMemo(() => {\n if (checked === 'indeterminate') {\n return 'indeterminate';\n }\n return checked ? 'checked' : 'unchecked';\n }, [checked]);\n\n const iconName = valueState === 'indeterminate' ? 'Minus' : 'Check';\n const showIcon = valueState !== 'unchecked';\n\n /* -------------------------------- Animation ------------------------------- */\n const shouldAnimate = !reduceMotion;\n\n // Scale animation for press feedback (disabled when reduceMotion is true)\n const scaleProgress = useDerivedValue(\n () =>\n shouldAnimate\n ? withSpring(pressed ? SCALE_EFFECTS.down : SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG)\n : SCALE_EFFECTS.none, // No scale effect when reduceMotion is true\n [pressed, shouldAnimate],\n );\n\n const checkboxAnimatedStyle = useAnimatedStyle(() => ({\n transform: [{ scale: scaleProgress.value }],\n }));\n\n /* -------------------------------- Handlers -------------------------------- */\n const handlePress = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const newChecked = checked === 'indeterminate' ? true : !checked;\n\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n\n onChange?.(newChecked);\n }, [disabled, checked, isControlled, onChange]);\n\n const handlePressIn = useCallback(() => {\n setPressed(true);\n }, []);\n\n const handlePressOut = useCallback(() => {\n setPressed(false);\n }, []);\n\n /* --------------------------------- Styles --------------------------------- */\n // Compute the style variant (primary/secondary maps to alert variants when hasError)\n const styleVariant: CheckboxStyleVariant = hasError\n ? VARIANT_ERROR_MAP[variantProp]\n : variantProp;\n\n checkboxStyles.useVariants({\n size,\n variant: styleVariant, // primary, secondary, alert, alert-secondary\n value: valueState, // checked, unchecked, indeterminate\n disabled,\n pressed,\n });\n\n const rootStyle = useMemo(\n () => [checkboxStyles.root, { opacity: disabled ? 0.5 : 1 }],\n [checkboxStyles.root, disabled],\n );\n\n const checkboxBoxStyle = useMemo(\n () => [\n checkboxStyles.checkbox,\n { alignItems: 'center' as const, justifyContent: 'center' as const },\n checkboxAnimatedStyle,\n ],\n [checkboxStyles.checkbox, checkboxAnimatedStyle],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n\n return (\n <FormLabel\n color=\"inherit\"\n variant=\"inherit\"\n label={label}\n required={required}\n showRequiredAsterisk={required}\n hasError={hasError}\n style={checkboxStyles.text}\n />\n );\n }, [label, required, hasError, checkboxStyles.text]);\n\n const a11yState = useMemo(\n () => ({\n disabled,\n checked:\n valueState === 'checked'\n ? true\n : valueState === 'indeterminate'\n ? ('mixed' as const)\n : false,\n }),\n [disabled, valueState],\n );\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <Pressable\n ref={ref}\n nativeID={uid}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n disabled={disabled}\n flexDirection={labelPosition === 'start' ? 'row' : 'row-reverse'}\n alignItems=\"center\"\n alignSelf=\"flex-start\"\n accessibilityRole=\"checkbox\"\n accessibilityState={a11yState}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n {...viewProps}\n style={rootStyle}\n >\n <Animated.View style={checkboxBoxStyle}>\n {showIcon && <Icon name={iconName} size=\"sm\" style={checkboxStyles.checkboxIcon} />}\n </Animated.View>\n\n {labelContent}\n </Pressable>\n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox, type CheckboxProps };\n"],"mappings":";;;;;;;;;;;AAuCA,MAAM,oBAAmE;CACvE,SAAS;CACT,WAAW;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCD,MAAM,WAAW,KAAK,SAAS,SAAS,EAEtC,OACA,gBAAgB,SAChB,SAAS,cAAc,WACvB,OAAO,MACP,SAAS,aACT,UACA,cAEA,gBACA,UACA,UACA,UACA,KACA,GAAG,aACa;CAEhB,MAAM,MAAM,gBADQ,OACmB;CAGvC,MAAM,eAAe,gBAAgB,KAAA;CACrC,MAAM,CAAC,iBAAiB,sBAAsB,SAC5C,eAAe,cAAe,kBAAkB,MACjD;CACD,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAG7C,MAAM,UAAU,eAAe,cAAc;CAG7C,MAAM,aAAiC,cAAc;EACnD,IAAI,YAAY,iBACd,OAAO;EAET,OAAO,UAAU,YAAY;IAC5B,CAAC,QAAQ,CAAC;CAEb,MAAM,WAAW,eAAe,kBAAkB,UAAU;CAC5D,MAAM,WAAW,eAAe;CAGhC,MAAM,gBAAgB,CAAC;CAGvB,MAAM,gBAAgB,sBAElB,gBACI,WAAW,UAAU,cAAc,OAAO,cAAc,MAAM,qBAAqB,GACnF,cAAc,MACpB,CAAC,SAAS,cAAc,CACzB;CAED,MAAM,wBAAwB,wBAAwB,EACpD,WAAW,CAAC,EAAE,OAAO,cAAc,OAAO,CAAC,EAC5C,EAAE;CAGH,MAAM,cAAc,kBAAkB;EACpC,IAAI,UACF;EAGF,MAAM,aAAa,YAAY,kBAAkB,OAAO,CAAC;EAEzD,IAAI,CAAC,cACH,mBAAmB,WAAW;EAGhC,WAAW,WAAW;IACrB;EAAC;EAAU;EAAS;EAAc;EAAS,CAAC;CAE/C,MAAM,gBAAgB,kBAAkB;EACtC,WAAW,KAAK;IACf,EAAE,CAAC;CAEN,MAAM,iBAAiB,kBAAkB;EACvC,WAAW,MAAM;IAChB,EAAE,CAAC;CAIN,MAAM,eAAqC,WACvC,kBAAkB,eAClB;CAEJ,eAAe,YAAY;EACzB;EACA,SAAS;EACT,OAAO;EACP;EACA;EACD,CAAC;CAEF,MAAM,YAAY,cACV,CAAC,eAAe,MAAM,EAAE,SAAS,WAAW,KAAM,GAAG,CAAC,EAC5D,CAAC,eAAe,MAAM,SAAS,CAChC;CAED,MAAM,mBAAmB,cACjB;EACJ,eAAe;EACf;GAAE,YAAY;GAAmB,gBAAgB;GAAmB;EACpE;EACD,EACD,CAAC,eAAe,UAAU,sBAAsB,CACjD;CAGD,MAAM,eAAe,cAAc;EACjC,IAAI,CAAC,OACH,OAAO;EAGT,OACE,oBAAC,WAAD;GACE,OAAM;GACN,SAAQ;GACD;GACG;GACV,sBAAsB;GACZ;GACV,OAAO,eAAe;GACtB,CAAA;IAEH;EAAC;EAAO;EAAU;EAAU,eAAe;EAAK,CAAC;CAEpD,MAAM,YAAY,eACT;EACL;EACA,SACE,eAAe,YACX,OACA,eAAe,kBACZ,UACD;EACT,GACD,CAAC,UAAU,WAAW,CACvB;CAGD,OACE,qBAAC,WAAD;EACO;EACL,UAAU;EACV,SAAS;EACT,WAAW;EACX,YAAY;EACF;EACV,eAAe,kBAAkB,UAAU,QAAQ;EACnD,YAAW;EACX,WAAU;EACV,mBAAkB;EAClB,oBAAoB;EACpB,oBAAoB,OAAO,UAAU,WAAW,QAAQ,KAAA;EACxD,GAAI;EACJ,OAAO;YAdT,CAgBE,oBAAC,SAAS,MAAV;GAAe,OAAO;aACnB,YAAY,oBAAC,MAAD;IAAM,MAAM;IAAU,MAAK;IAAK,OAAO,eAAe;IAAgB,CAAA;GACrE,CAAA,EAEf,aACS;;EAEd;AAEF,SAAS,cAAc"}
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":[],"sources":["../../src/components/Checkbox.tsx"],"sourcesContent":["import { ICON_SIZE_MAP } from '@yahoo/uds-icons/tokens';\nimport type { CheckboxValue, CheckboxVariant, UniversalCheckboxProps } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useDerivedValue, withSpring } from 'react-native-reanimated';\n\nimport { checkboxStyles } from '../../generated/styles';\nimport { useFontScale } from '../fontScaling/useFontScale';\nimport { useMaxFontSizeMultiplier } from '../fontScaling/useMaxFontSizeMultiplier';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport { FormLabel } from './FormLabel';\nimport { Icon } from './Icon';\nimport { Pressable } from './Pressable';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** Derived from CheckboxValue - maps boolean to 'checked'/'unchecked' string literals */\ntype CheckboxValueState = Exclude<CheckboxValue, boolean> | 'checked' | 'unchecked';\n\ninterface CheckboxProps extends Omit<ViewProps, 'style'>, UniversalCheckboxProps {\n /** Ref to the underlying View */\n ref?: Ref<View>;\n /** Default checked state for uncontrolled mode */\n defaultChecked?: boolean;\n /** Whether the checkbox is disabled */\n disabled?: boolean;\n /** Whether the checkbox is required */\n required?: boolean;\n /**\n * Caps how far the box, checkmark, and label grow with the OS text-size\n * setting; all three scale by the same factor. Set null to remove the cap;\n * override app-wide via UDSFontScalingProvider.\n * @default 2\n */\n maxFontSizeMultiplier?: number | null;\n /** Callback fired when the checked state changes */\n onChange?: (checked: boolean) => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Variant Mapping */\n/* -------------------------------------------------------------------------- */\n\n/** All style variants available in the generated styles (includes error variants) */\ntype CheckboxStyleVariant = 'primary' | 'secondary' | 'alert' | 'alert-secondary';\n\nconst VARIANT_ERROR_MAP: Record<CheckboxVariant, CheckboxStyleVariant> = {\n primary: 'alert',\n secondary: 'alert-secondary',\n};\n\n/* -------------------------------------------------------------------------- */\n/* Checkbox Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **⚙️ A checkbox component**\n *\n * @description\n * A checkbox component allows users to select one or multiple options from a set.\n * It represents a binary state, typically as checked or unchecked, and optionally\n * includes a third \"indeterminate\" state to indicate partial selection.\n *\n * @category Form\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Checkbox } from '@yahoo/uds-mobile/Checkbox';\n *\n * <Checkbox label=\"Agree to terms\" />\n * <Checkbox label=\"Subscribe\" checked={true} onChange={setChecked} />\n * <Checkbox label=\"Partial\" checked=\"indeterminate\" />\n * ```\n *\n * @usage\n * - Forms: For selecting options\n * - Settings: For toggling preferences\n * - Filters: For multi-select filtering\n *\n * @accessibility\n * - Sets `accessibilityRole=\"checkbox\"` automatically\n * - Announces checked/unchecked/mixed state\n * - Label is used as accessibility label\n * - Supports `reduceMotion` for users who prefer reduced motion\n *\n * @see {@link Radio} for single-select options\n * @see {@link Switch} for binary toggles\n */\nconst Checkbox = memo(function Checkbox({\n // Checkbox props\n label,\n labelPosition = 'start',\n variant: variantProp = 'primary',\n size = 'md',\n checked: checkedProp,\n hasError,\n reduceMotion,\n // Native props\n defaultChecked,\n disabled,\n required,\n maxFontSizeMultiplier,\n onChange,\n ref,\n ...viewProps\n}: CheckboxProps) {\n const generatedId = useId();\n const uid = `uds-checkbox-${generatedId}`;\n\n // One capped factor governs box, checkmark, and label so they stay cohesive.\n const resolvedMaxFontSizeMultiplier =\n useMaxFontSizeMultiplier('control', maxFontSizeMultiplier) ?? 0;\n const fontScaleFactor = useFontScale(resolvedMaxFontSizeMultiplier);\n // The check/minus glyph is drawn at the 'sm' icon size; scale it in step with\n // the box rather than letting native font scaling size it independently.\n const scaledMarkSize = Math.round(ICON_SIZE_MAP.sm * fontScaleFactor);\n\n /* --------------------------------- State ---------------------------------- */\n const isControlled = checkedProp !== undefined;\n const [internalChecked, setInternalChecked] = useState<CheckboxValue>(\n isControlled ? checkedProp : (defaultChecked ?? false),\n );\n const [pressed, setPressed] = useState(false);\n\n // Use controlled value if provided, otherwise use internal state\n const checked = isControlled ? checkedProp : internalChecked;\n\n /* ------------------------------ Derived Values ---------------------------- */\n const valueState: CheckboxValueState = useMemo(() => {\n if (checked === 'indeterminate') {\n return 'indeterminate';\n }\n return checked ? 'checked' : 'unchecked';\n }, [checked]);\n\n const iconName = valueState === 'indeterminate' ? 'Minus' : 'Check';\n const showIcon = valueState !== 'unchecked';\n\n /* -------------------------------- Animation ------------------------------- */\n const shouldAnimate = !reduceMotion;\n\n // Scale animation for press feedback (disabled when reduceMotion is true)\n const scaleProgress = useDerivedValue(\n () =>\n shouldAnimate\n ? withSpring(pressed ? SCALE_EFFECTS.down : SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG)\n : SCALE_EFFECTS.none, // No scale effect when reduceMotion is true\n [pressed, shouldAnimate],\n );\n\n const checkboxAnimatedStyle = useAnimatedStyle(() => ({\n transform: [{ scale: scaleProgress.value }],\n }));\n\n /* -------------------------------- Handlers -------------------------------- */\n const handlePress = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const newChecked = checked === 'indeterminate' ? true : !checked;\n\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n\n onChange?.(newChecked);\n }, [disabled, checked, isControlled, onChange]);\n\n const handlePressIn = useCallback(() => {\n setPressed(true);\n }, []);\n\n const handlePressOut = useCallback(() => {\n setPressed(false);\n }, []);\n\n /* --------------------------------- Styles --------------------------------- */\n // Compute the style variant (primary/secondary maps to alert variants when hasError)\n const styleVariant: CheckboxStyleVariant = hasError\n ? VARIANT_ERROR_MAP[variantProp]\n : variantProp;\n\n checkboxStyles.useVariants({\n size,\n variant: styleVariant, // primary, secondary, alert, alert-secondary\n value: valueState, // checked, unchecked, indeterminate\n disabled,\n pressed,\n });\n\n const rootStyle = useMemo(\n () => [checkboxStyles.root, { opacity: disabled ? 0.5 : 1 }],\n [checkboxStyles.root, disabled],\n );\n\n const checkboxBoxStyle = useMemo(() => {\n // The box grows by the capped factor to keep containing the checkmark.\n // borderWidth stays fixed (stroke weight doesn't scale in the OS's own\n // controls either).\n const { width, height, borderRadius } = checkboxStyles.checkbox;\n const scaledBox =\n fontScaleFactor !== 1 && typeof width === 'number' && typeof height === 'number'\n ? {\n width: Math.round(width * fontScaleFactor),\n height: Math.round(height * fontScaleFactor),\n ...(typeof borderRadius === 'number' && {\n borderRadius: Math.round(borderRadius * fontScaleFactor),\n }),\n }\n : undefined;\n\n return [\n checkboxStyles.checkbox,\n scaledBox,\n { alignItems: 'center' as const, justifyContent: 'center' as const },\n checkboxAnimatedStyle,\n ];\n }, [checkboxStyles.checkbox, fontScaleFactor, checkboxAnimatedStyle]);\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n\n return (\n <FormLabel\n color=\"inherit\"\n variant=\"inherit\"\n label={label}\n required={required}\n showRequiredAsterisk={required}\n hasError={hasError}\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={checkboxStyles.text}\n />\n );\n }, [label, required, hasError, resolvedMaxFontSizeMultiplier, checkboxStyles.text]);\n\n const a11yState = useMemo(\n () => ({\n disabled,\n checked:\n valueState === 'checked'\n ? true\n : valueState === 'indeterminate'\n ? ('mixed' as const)\n : false,\n }),\n [disabled, valueState],\n );\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <Pressable\n ref={ref}\n nativeID={uid}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n disabled={disabled}\n flexDirection={labelPosition === 'start' ? 'row' : 'row-reverse'}\n alignItems=\"center\"\n alignSelf=\"flex-start\"\n accessibilityRole=\"checkbox\"\n accessibilityState={a11yState}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n {...viewProps}\n style={rootStyle}\n >\n <Animated.View style={checkboxBoxStyle}>\n {showIcon && (\n <Icon\n name={iconName}\n size=\"sm\"\n // Size the mark from the same factor that scaled the box, with\n // native scaling off: letting the box scale in JS while the glyph\n // scaled natively left the two to round independently (and to\n // disagree outright under Android's non-linear scaling), which\n // drifted the mark off-centre as sizes grew.\n dangerouslySetSize={scaledMarkSize}\n allowFontScaling={false}\n style={checkboxStyles.checkboxIcon}\n />\n )}\n </Animated.View>\n\n {labelContent}\n </Pressable>\n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox, type CheckboxProps };\n"],"mappings":";;;;;;;;;;;;;;AAiDA,MAAM,oBAAmE;CACvE,SAAS;CACT,WAAW;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCD,MAAM,WAAW,KAAK,SAAS,SAAS,EAEtC,OACA,gBAAgB,SAChB,SAAS,cAAc,WACvB,OAAO,MACP,SAAS,aACT,UACA,cAEA,gBACA,UACA,UACA,uBACA,UACA,KACA,GAAG,aACa;CAEhB,MAAM,MAAM,gBADQ,OACmB;CAGvC,MAAM,gCACJ,yBAAyB,WAAW,sBAAsB,IAAI;CAChE,MAAM,kBAAkB,aAAa,8BAA8B;CAGnE,MAAM,iBAAiB,KAAK,MAAM,cAAc,KAAK,gBAAgB;CAGrE,MAAM,eAAe,gBAAgB,KAAA;CACrC,MAAM,CAAC,iBAAiB,sBAAsB,SAC5C,eAAe,cAAe,kBAAkB,MACjD;CACD,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAG7C,MAAM,UAAU,eAAe,cAAc;CAG7C,MAAM,aAAiC,cAAc;EACnD,IAAI,YAAY,iBACd,OAAO;EAET,OAAO,UAAU,YAAY;IAC5B,CAAC,QAAQ,CAAC;CAEb,MAAM,WAAW,eAAe,kBAAkB,UAAU;CAC5D,MAAM,WAAW,eAAe;CAGhC,MAAM,gBAAgB,CAAC;CAGvB,MAAM,gBAAgB,sBAElB,gBACI,WAAW,UAAU,cAAc,OAAO,cAAc,MAAM,qBAAqB,GACnF,cAAc,MACpB,CAAC,SAAS,cAAc,CACzB;CAED,MAAM,wBAAwB,wBAAwB,EACpD,WAAW,CAAC,EAAE,OAAO,cAAc,OAAO,CAAC,EAC5C,EAAE;CAGH,MAAM,cAAc,kBAAkB;EACpC,IAAI,UACF;EAGF,MAAM,aAAa,YAAY,kBAAkB,OAAO,CAAC;EAEzD,IAAI,CAAC,cACH,mBAAmB,WAAW;EAGhC,WAAW,WAAW;IACrB;EAAC;EAAU;EAAS;EAAc;EAAS,CAAC;CAE/C,MAAM,gBAAgB,kBAAkB;EACtC,WAAW,KAAK;IACf,EAAE,CAAC;CAEN,MAAM,iBAAiB,kBAAkB;EACvC,WAAW,MAAM;IAChB,EAAE,CAAC;CAIN,MAAM,eAAqC,WACvC,kBAAkB,eAClB;CAEJ,eAAe,YAAY;EACzB;EACA,SAAS;EACT,OAAO;EACP;EACA;EACD,CAAC;CAEF,MAAM,YAAY,cACV,CAAC,eAAe,MAAM,EAAE,SAAS,WAAW,KAAM,GAAG,CAAC,EAC5D,CAAC,eAAe,MAAM,SAAS,CAChC;CAED,MAAM,mBAAmB,cAAc;EAIrC,MAAM,EAAE,OAAO,QAAQ,iBAAiB,eAAe;EACvD,MAAM,YACJ,oBAAoB,KAAK,OAAO,UAAU,YAAY,OAAO,WAAW,WACpE;GACE,OAAO,KAAK,MAAM,QAAQ,gBAAgB;GAC1C,QAAQ,KAAK,MAAM,SAAS,gBAAgB;GAC5C,GAAI,OAAO,iBAAiB,YAAY,EACtC,cAAc,KAAK,MAAM,eAAe,gBAAgB,EACzD;GACF,GACD,KAAA;EAEN,OAAO;GACL,eAAe;GACf;GACA;IAAE,YAAY;IAAmB,gBAAgB;IAAmB;GACpE;GACD;IACA;EAAC,eAAe;EAAU;EAAiB;EAAsB,CAAC;CAGrE,MAAM,eAAe,cAAc;EACjC,IAAI,CAAC,OACH,OAAO;EAGT,OACE,oBAAC,WAAD;GACE,OAAM;GACN,SAAQ;GACD;GACG;GACV,sBAAsB;GACZ;GACV,uBAAuB;GACvB,OAAO,eAAe;GACtB,CAAA;IAEH;EAAC;EAAO;EAAU;EAAU;EAA+B,eAAe;EAAK,CAAC;CAEnF,MAAM,YAAY,eACT;EACL;EACA,SACE,eAAe,YACX,OACA,eAAe,kBACZ,UACD;EACT,GACD,CAAC,UAAU,WAAW,CACvB;CAGD,OACE,qBAAC,WAAD;EACO;EACL,UAAU;EACV,SAAS;EACT,WAAW;EACX,YAAY;EACF;EACV,eAAe,kBAAkB,UAAU,QAAQ;EACnD,YAAW;EACX,WAAU;EACV,mBAAkB;EAClB,oBAAoB;EACpB,oBAAoB,OAAO,UAAU,WAAW,QAAQ,KAAA;EACxD,GAAI;EACJ,OAAO;YAdT,CAgBE,oBAAC,SAAS,MAAV;GAAe,OAAO;aACnB,YACC,oBAAC,MAAD;IACE,MAAM;IACN,MAAK;IAML,oBAAoB;IACpB,kBAAkB;IAClB,OAAO,eAAe;IACtB,CAAA;GAEU,CAAA,EAEf,aACS;;EAEd;AAEF,SAAS,cAAc"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_fontScaling_useMaxFontSizeMultiplier = require("../../fontScaling/useMaxFontSizeMultiplier.cjs");
|
|
4
5
|
const require_components_IconSlot = require("../IconSlot.cjs");
|
|
5
6
|
const require_components_Text = require("../Text.cjs");
|
|
7
|
+
const require_fontScaling_useFontScale = require("../../fontScaling/useFontScale.cjs");
|
|
6
8
|
const require_components_Chip_chipTheme = require("./chipTheme.cjs");
|
|
7
9
|
let react = require("react");
|
|
8
10
|
let react_native = require("react-native");
|
|
@@ -13,19 +15,28 @@ const DEFAULT_CHIP_SIZE = "md";
|
|
|
13
15
|
const DEFAULT_CHIP_VARIANT = "primary";
|
|
14
16
|
const DEFAULT_MAX_WIDTH = 200;
|
|
15
17
|
const DEFAULT_TOGGLE_STATE = "off";
|
|
16
|
-
const ChipBase = (0, react.memo)(function ChipBase({ kind, toggleState = DEFAULT_TOGGLE_STATE, variant = DEFAULT_CHIP_VARIANT, size = "md", minWidth, maxWidth = 200, startIcon, endIcon, endContent, disabled = false, pressable = false, onPress, accessibilityRole, accessibilityState, children, style, ref, ...viewProps }) {
|
|
18
|
+
const ChipBase = (0, react.memo)(function ChipBase({ kind, toggleState = DEFAULT_TOGGLE_STATE, variant = DEFAULT_CHIP_VARIANT, size = "md", minWidth, maxWidth = 200, startIcon, endIcon, endContent, disabled = false, pressable = false, maxFontSizeMultiplier, onPress, accessibilityRole, accessibilityState, children, style, ref, ...viewProps }) {
|
|
17
19
|
const { theme } = (0, react_native_unistyles.useUnistyles)();
|
|
18
20
|
const [pressed, setPressed] = (0, react.useState)(false);
|
|
19
21
|
const interactionState = pressed ? "pressed" : "rest";
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
const resolvedMaxFontSizeMultiplier = require_fontScaling_useMaxFontSizeMultiplier.useMaxFontSizeMultiplier("control", maxFontSizeMultiplier) ?? 0;
|
|
23
|
+
const fontScaleFactor = require_fontScaling_useFontScale.useFontScale(resolvedMaxFontSizeMultiplier);
|
|
24
|
+
const rootStyle = (0, react.useMemo)(() => {
|
|
25
|
+
const layerStyle = require_components_Chip_chipTheme.getMergedChipLayerStyle(theme, kind, variant, size, toggleState, "root", interactionState);
|
|
26
|
+
const scaledLayer = fontScaleFactor !== 1 && typeof layerStyle.height === "number" ? { height: Math.round(layerStyle.height * fontScaleFactor) } : void 0;
|
|
27
|
+
const resolvedMaxWidth = maxWidth === 200 ? Math.round(maxWidth * fontScaleFactor) : maxWidth;
|
|
28
|
+
return [
|
|
29
|
+
chipStaticStyles.root,
|
|
30
|
+
layerStyle,
|
|
31
|
+
scaledLayer,
|
|
32
|
+
minWidth === void 0 ? void 0 : { minWidth },
|
|
33
|
+
resolvedMaxWidth === void 0 ? void 0 : { maxWidth: resolvedMaxWidth },
|
|
34
|
+
disabled ? chipStaticStyles.disabled : void 0,
|
|
35
|
+
style
|
|
36
|
+
];
|
|
37
|
+
}, [
|
|
28
38
|
disabled,
|
|
39
|
+
fontScaleFactor,
|
|
29
40
|
interactionState,
|
|
30
41
|
kind,
|
|
31
42
|
maxWidth,
|
|
@@ -56,18 +67,21 @@ const ChipBase = (0, react.memo)(function ChipBase({ kind, toggleState = DEFAULT
|
|
|
56
67
|
startIcon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
57
68
|
icon: startIcon,
|
|
58
69
|
variant: "fill",
|
|
70
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
59
71
|
style: iconStyle
|
|
60
72
|
}) : null,
|
|
61
73
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
62
74
|
color: "inherit",
|
|
63
75
|
variant: "inherit",
|
|
64
76
|
numberOfLines: 1,
|
|
77
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
65
78
|
style: textStyle,
|
|
66
79
|
children
|
|
67
80
|
}),
|
|
68
81
|
endContent ?? (endIcon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
69
82
|
icon: endIcon,
|
|
70
83
|
variant: "fill",
|
|
84
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
71
85
|
style: iconStyle
|
|
72
86
|
}) : null)
|
|
73
87
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipBase.d.cts","names":[],"sources":["../../../src/components/Chip/ChipBase.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"ChipBase.d.cts","names":[],"sources":["../../../src/components/Chip/ChipBase.tsx"],"mappings":";;;;;;cAaM,iBAAA,EAAmB,QAAA;AAAA,cACnB,oBAAA,EAAsB,WAAA;AAAA,cACtB,iBAAA;AAAA,cAGA,QAAA,EAAQ,OAAA,CAAA,oBAAA,CAAA,aAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipBase.d.ts","names":[],"sources":["../../../src/components/Chip/ChipBase.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"ChipBase.d.ts","names":[],"sources":["../../../src/components/Chip/ChipBase.tsx"],"mappings":";;;;;;cAaM,iBAAA,EAAmB,QAAA;AAAA,cACnB,oBAAA,EAAsB,WAAA;AAAA,cACtB,iBAAA;AAAA,cAGA,QAAA,EAAQ,OAAA,CAAA,oBAAA,CAAA,aAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useMaxFontSizeMultiplier } from "../../fontScaling/useMaxFontSizeMultiplier.js";
|
|
2
3
|
import { IconSlot } from "../IconSlot.js";
|
|
3
4
|
import { Text as Text$1 } from "../Text.js";
|
|
5
|
+
import { useFontScale } from "../../fontScaling/useFontScale.js";
|
|
4
6
|
import { getMergedChipLayerStyle } from "./chipTheme.js";
|
|
5
7
|
import { memo, useMemo, useState } from "react";
|
|
6
8
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
@@ -11,19 +13,28 @@ const DEFAULT_CHIP_SIZE = "md";
|
|
|
11
13
|
const DEFAULT_CHIP_VARIANT = "primary";
|
|
12
14
|
const DEFAULT_MAX_WIDTH = 200;
|
|
13
15
|
const DEFAULT_TOGGLE_STATE = "off";
|
|
14
|
-
const ChipBase = memo(function ChipBase({ kind, toggleState = DEFAULT_TOGGLE_STATE, variant = DEFAULT_CHIP_VARIANT, size = "md", minWidth, maxWidth = 200, startIcon, endIcon, endContent, disabled = false, pressable = false, onPress, accessibilityRole, accessibilityState, children, style, ref, ...viewProps }) {
|
|
16
|
+
const ChipBase = memo(function ChipBase({ kind, toggleState = DEFAULT_TOGGLE_STATE, variant = DEFAULT_CHIP_VARIANT, size = "md", minWidth, maxWidth = 200, startIcon, endIcon, endContent, disabled = false, pressable = false, maxFontSizeMultiplier, onPress, accessibilityRole, accessibilityState, children, style, ref, ...viewProps }) {
|
|
15
17
|
const { theme } = useUnistyles();
|
|
16
18
|
const [pressed, setPressed] = useState(false);
|
|
17
19
|
const interactionState = pressed ? "pressed" : "rest";
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier("control", maxFontSizeMultiplier) ?? 0;
|
|
21
|
+
const fontScaleFactor = useFontScale(resolvedMaxFontSizeMultiplier);
|
|
22
|
+
const rootStyle = useMemo(() => {
|
|
23
|
+
const layerStyle = getMergedChipLayerStyle(theme, kind, variant, size, toggleState, "root", interactionState);
|
|
24
|
+
const scaledLayer = fontScaleFactor !== 1 && typeof layerStyle.height === "number" ? { height: Math.round(layerStyle.height * fontScaleFactor) } : void 0;
|
|
25
|
+
const resolvedMaxWidth = maxWidth === 200 ? Math.round(maxWidth * fontScaleFactor) : maxWidth;
|
|
26
|
+
return [
|
|
27
|
+
chipStaticStyles.root,
|
|
28
|
+
layerStyle,
|
|
29
|
+
scaledLayer,
|
|
30
|
+
minWidth === void 0 ? void 0 : { minWidth },
|
|
31
|
+
resolvedMaxWidth === void 0 ? void 0 : { maxWidth: resolvedMaxWidth },
|
|
32
|
+
disabled ? chipStaticStyles.disabled : void 0,
|
|
33
|
+
style
|
|
34
|
+
];
|
|
35
|
+
}, [
|
|
26
36
|
disabled,
|
|
37
|
+
fontScaleFactor,
|
|
27
38
|
interactionState,
|
|
28
39
|
kind,
|
|
29
40
|
maxWidth,
|
|
@@ -54,18 +65,21 @@ const ChipBase = memo(function ChipBase({ kind, toggleState = DEFAULT_TOGGLE_STA
|
|
|
54
65
|
startIcon ? /* @__PURE__ */ jsx(IconSlot, {
|
|
55
66
|
icon: startIcon,
|
|
56
67
|
variant: "fill",
|
|
68
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
57
69
|
style: iconStyle
|
|
58
70
|
}) : null,
|
|
59
71
|
/* @__PURE__ */ jsx(Text$1, {
|
|
60
72
|
color: "inherit",
|
|
61
73
|
variant: "inherit",
|
|
62
74
|
numberOfLines: 1,
|
|
75
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
63
76
|
style: textStyle,
|
|
64
77
|
children
|
|
65
78
|
}),
|
|
66
79
|
endContent ?? (endIcon ? /* @__PURE__ */ jsx(IconSlot, {
|
|
67
80
|
icon: endIcon,
|
|
68
81
|
variant: "fill",
|
|
82
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
69
83
|
style: iconStyle
|
|
70
84
|
}) : null)
|
|
71
85
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipBase.js","names":["Text"],"sources":["../../../src/components/Chip/ChipBase.tsx"],"sourcesContent":["import { memo, useMemo, useState } from 'react';\nimport type { StyleProp, TextStyle, ViewStyle } from 'react-native';\nimport { Pressable, StyleSheet, View } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- chip toggle styles need variant + active token lookups\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { IconSlot } from '../IconSlot';\nimport { Text } from '../Text';\nimport { getMergedChipLayerStyle } from './chipTheme';\nimport type { ChipBaseProps, ChipInteractionState, ChipSize, ChipVariant } from './types';\n\nconst DEFAULT_CHIP_SIZE: ChipSize = 'md';\nconst DEFAULT_CHIP_VARIANT: ChipVariant = 'primary';\nconst DEFAULT_MAX_WIDTH = 200;\nconst DEFAULT_TOGGLE_STATE = 'off';\n\nconst ChipBase = memo(function ChipBase({\n kind,\n toggleState = DEFAULT_TOGGLE_STATE,\n variant = DEFAULT_CHIP_VARIANT,\n size = DEFAULT_CHIP_SIZE,\n minWidth,\n maxWidth = DEFAULT_MAX_WIDTH,\n startIcon,\n endIcon,\n endContent,\n disabled = false,\n pressable = false,\n onPress,\n accessibilityRole,\n accessibilityState,\n children,\n style,\n ref,\n ...viewProps\n}: ChipBaseProps) {\n const { theme } = useUnistyles();\n const [pressed, setPressed] = useState(false);\n const interactionState: ChipInteractionState = pressed ? 'pressed' : 'rest';\n\n const rootStyle = useMemo<StyleProp<ViewStyle>>(
|
|
1
|
+
{"version":3,"file":"ChipBase.js","names":["Text"],"sources":["../../../src/components/Chip/ChipBase.tsx"],"sourcesContent":["import { memo, useMemo, useState } from 'react';\nimport type { StyleProp, TextStyle, ViewStyle } from 'react-native';\nimport { Pressable, StyleSheet, View } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- chip toggle styles need variant + active token lookups\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { useFontScale } from '../../fontScaling/useFontScale';\nimport { useMaxFontSizeMultiplier } from '../../fontScaling/useMaxFontSizeMultiplier';\nimport { IconSlot } from '../IconSlot';\nimport { Text } from '../Text';\nimport { getMergedChipLayerStyle } from './chipTheme';\nimport type { ChipBaseProps, ChipInteractionState, ChipSize, ChipVariant } from './types';\n\nconst DEFAULT_CHIP_SIZE: ChipSize = 'md';\nconst DEFAULT_CHIP_VARIANT: ChipVariant = 'primary';\nconst DEFAULT_MAX_WIDTH = 200;\nconst DEFAULT_TOGGLE_STATE = 'off';\n\nconst ChipBase = memo(function ChipBase({\n kind,\n toggleState = DEFAULT_TOGGLE_STATE,\n variant = DEFAULT_CHIP_VARIANT,\n size = DEFAULT_CHIP_SIZE,\n minWidth,\n maxWidth = DEFAULT_MAX_WIDTH,\n startIcon,\n endIcon,\n endContent,\n disabled = false,\n pressable = false,\n maxFontSizeMultiplier,\n onPress,\n accessibilityRole,\n accessibilityState,\n children,\n style,\n ref,\n ...viewProps\n}: ChipBaseProps) {\n const { theme } = useUnistyles();\n const [pressed, setPressed] = useState(false);\n const interactionState: ChipInteractionState = pressed ? 'pressed' : 'rest';\n\n // One capped factor governs the label, icons, and the chip's fixed height.\n const resolvedMaxFontSizeMultiplier =\n useMaxFontSizeMultiplier('control', maxFontSizeMultiplier) ?? 0;\n const fontScaleFactor = useFontScale(resolvedMaxFontSizeMultiplier);\n\n const rootStyle = useMemo<StyleProp<ViewStyle>>(() => {\n const layerStyle = getMergedChipLayerStyle(\n theme,\n kind,\n variant,\n size,\n toggleState,\n 'root',\n interactionState,\n ) as ViewStyle;\n // The chip's fixed height grows with its capped content; the default max\n // width grows too so capped labels don't truncate earlier than today. An\n // explicit maxWidth/minWidth from the consumer is respected as-is.\n const scaledLayer =\n fontScaleFactor !== 1 && typeof layerStyle.height === 'number'\n ? { height: Math.round(layerStyle.height * fontScaleFactor) }\n : undefined;\n const resolvedMaxWidth =\n maxWidth === DEFAULT_MAX_WIDTH ? Math.round(maxWidth * fontScaleFactor) : maxWidth;\n\n return [\n chipStaticStyles.root,\n layerStyle,\n scaledLayer,\n minWidth === undefined ? undefined : { minWidth },\n resolvedMaxWidth === undefined ? undefined : { maxWidth: resolvedMaxWidth },\n disabled ? chipStaticStyles.disabled : undefined,\n style,\n ];\n }, [\n disabled,\n fontScaleFactor,\n interactionState,\n kind,\n maxWidth,\n minWidth,\n size,\n style,\n theme,\n toggleState,\n variant,\n ]);\n\n const textStyle = useMemo<StyleProp<TextStyle>>(\n () => [\n chipStaticStyles.text,\n getMergedChipLayerStyle(\n theme,\n kind,\n variant,\n size,\n toggleState,\n 'rootText',\n interactionState,\n ) as TextStyle,\n ],\n [interactionState, kind, size, theme, toggleState, variant],\n );\n\n const iconStyle = useMemo<StyleProp<TextStyle>>(\n () =>\n getMergedChipLayerStyle(\n theme,\n kind,\n variant,\n size,\n toggleState,\n 'icon',\n interactionState,\n ) as TextStyle,\n [interactionState, kind, size, theme, toggleState, variant],\n );\n\n const content = (\n <>\n {startIcon ? (\n <IconSlot\n icon={startIcon}\n variant=\"fill\"\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={iconStyle}\n />\n ) : null}\n <Text\n color=\"inherit\"\n variant=\"inherit\"\n numberOfLines={1}\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={textStyle}\n >\n {children}\n </Text>\n {endContent ??\n (endIcon ? (\n <IconSlot\n icon={endIcon}\n variant=\"fill\"\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={iconStyle}\n />\n ) : null)}\n </>\n );\n\n if (pressable) {\n return (\n <Pressable\n ref={ref}\n accessibilityRole={accessibilityRole}\n accessibilityState={{ disabled, ...accessibilityState }}\n disabled={disabled}\n onPress={disabled ? undefined : onPress}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n {...viewProps}\n style={rootStyle}\n >\n {content}\n </Pressable>\n );\n }\n\n return (\n <View\n ref={ref}\n accessibilityRole={accessibilityRole}\n accessibilityState={{ disabled, ...accessibilityState }}\n {...viewProps}\n style={rootStyle}\n >\n {content}\n </View>\n );\n});\n\nChipBase.displayName = 'ChipBase';\n\nconst chipStaticStyles = StyleSheet.create({\n disabled: {\n opacity: 0.5,\n },\n root: {\n alignItems: 'center',\n alignSelf: 'flex-start',\n flexDirection: 'row',\n overflow: 'hidden',\n },\n text: {\n flexShrink: 1,\n textAlign: 'center',\n },\n});\n\nexport { ChipBase, DEFAULT_CHIP_SIZE, DEFAULT_CHIP_VARIANT, DEFAULT_MAX_WIDTH };\n"],"mappings":";;;;;;;;;;;AAaA,MAAM,oBAA8B;AACpC,MAAM,uBAAoC;AAC1C,MAAM,oBAAoB;AAC1B,MAAM,uBAAuB;AAE7B,MAAM,WAAW,KAAK,SAAS,SAAS,EACtC,MACA,cAAc,sBACd,UAAU,sBACV,OAAA,MACA,UACA,WAAA,KACA,WACA,SACA,YACA,WAAW,OACX,YAAY,OACZ,uBACA,SACA,mBACA,oBACA,UACA,OACA,KACA,GAAG,aACa;CAChB,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAC7C,MAAM,mBAAyC,UAAU,YAAY;CAGrE,MAAM,gCACJ,yBAAyB,WAAW,sBAAsB,IAAI;CAChE,MAAM,kBAAkB,aAAa,8BAA8B;CAEnE,MAAM,YAAY,cAAoC;EACpD,MAAM,aAAa,wBACjB,OACA,MACA,SACA,MACA,aACA,QACA,iBACD;EAID,MAAM,cACJ,oBAAoB,KAAK,OAAO,WAAW,WAAW,WAClD,EAAE,QAAQ,KAAK,MAAM,WAAW,SAAS,gBAAgB,EAAE,GAC3D,KAAA;EACN,MAAM,mBACJ,aAAA,MAAiC,KAAK,MAAM,WAAW,gBAAgB,GAAG;EAE5E,OAAO;GACL,iBAAiB;GACjB;GACA;GACA,aAAa,KAAA,IAAY,KAAA,IAAY,EAAE,UAAU;GACjD,qBAAqB,KAAA,IAAY,KAAA,IAAY,EAAE,UAAU,kBAAkB;GAC3E,WAAW,iBAAiB,WAAW,KAAA;GACvC;GACD;IACA;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,YAAY,cACV,CACJ,iBAAiB,MACjB,wBACE,OACA,MACA,SACA,MACA,aACA,YACA,iBACD,CACF,EACD;EAAC;EAAkB;EAAM;EAAM;EAAO;EAAa;EAAQ,CAC5D;CAED,MAAM,YAAY,cAEd,wBACE,OACA,MACA,SACA,MACA,aACA,QACA,iBACD,EACH;EAAC;EAAkB;EAAM;EAAM;EAAO;EAAa;EAAQ,CAC5D;CAED,MAAM,UACJ,qBAAA,UAAA,EAAA,UAAA;EACG,YACC,oBAAC,UAAD;GACE,MAAM;GACN,SAAQ;GACR,uBAAuB;GACvB,OAAO;GACP,CAAA,GACA;EACJ,oBAACA,QAAD;GACE,OAAM;GACN,SAAQ;GACR,eAAe;GACf,uBAAuB;GACvB,OAAO;GAEN;GACI,CAAA;EACN,eACE,UACC,oBAAC,UAAD;GACE,MAAM;GACN,SAAQ;GACR,uBAAuB;GACvB,OAAO;GACP,CAAA,GACA;EACL,EAAA,CAAA;CAGL,IAAI,WACF,OACE,oBAAC,WAAD;EACO;EACc;EACnB,oBAAoB;GAAE;GAAU,GAAG;GAAoB;EAC7C;EACV,SAAS,WAAW,KAAA,IAAY;EAChC,iBAAiB,WAAW,KAAK;EACjC,kBAAkB,WAAW,MAAM;EACnC,GAAI;EACJ,OAAO;YAEN;EACS,CAAA;CAIhB,OACE,oBAAC,MAAD;EACO;EACc;EACnB,oBAAoB;GAAE;GAAU,GAAG;GAAoB;EACvD,GAAI;EACJ,OAAO;YAEN;EACI,CAAA;EAET;AAEF,SAAS,cAAc;AAEvB,MAAM,mBAAmB,WAAW,OAAO;CACzC,UAAU,EACR,SAAS,IACV;CACD,MAAM;EACJ,YAAY;EACZ,WAAW;EACX,eAAe;EACf,UAAU;EACX;CACD,MAAM;EACJ,YAAY;EACZ,WAAW;EACZ;CACF,CAAC"}
|
|
@@ -9,7 +9,7 @@ let react_native = require("react-native");
|
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
let react_native_unistyles = require("react-native-unistyles");
|
|
11
11
|
//#region src/components/Chip/ChipDismissible.tsx
|
|
12
|
-
const ChipDismissible = (0, react.memo)(function ChipDismissible({ onDismiss, dismissButtonAriaLabel = "Dismiss", dismissIcon, disabled = false, variant = require_components_Chip_ChipBase.DEFAULT_CHIP_VARIANT, size = "md", ...props }) {
|
|
12
|
+
const ChipDismissible = (0, react.memo)(function ChipDismissible({ onDismiss, dismissButtonAriaLabel = "Dismiss", dismissIcon, disabled = false, variant = require_components_Chip_ChipBase.DEFAULT_CHIP_VARIANT, size = "md", maxFontSizeMultiplier, ...props }) {
|
|
13
13
|
const { theme } = (0, react_native_unistyles.useUnistyles)();
|
|
14
14
|
const handleDismiss = (0, react.useCallback)(() => {
|
|
15
15
|
if (!disabled) onDismiss?.();
|
|
@@ -24,6 +24,7 @@ const ChipDismissible = (0, react.memo)(function ChipDismissible({ onDismiss, di
|
|
|
24
24
|
variant,
|
|
25
25
|
size,
|
|
26
26
|
disabled,
|
|
27
|
+
maxFontSizeMultiplier,
|
|
27
28
|
endContent: onDismiss ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Pressable, {
|
|
28
29
|
accessibilityLabel: dismissButtonAriaLabel,
|
|
29
30
|
accessibilityRole: "button",
|
|
@@ -34,6 +35,7 @@ const ChipDismissible = (0, react.memo)(function ChipDismissible({ onDismiss, di
|
|
|
34
35
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
35
36
|
icon: dismissIcon ?? "Cross",
|
|
36
37
|
variant: "fill",
|
|
38
|
+
maxFontSizeMultiplier,
|
|
37
39
|
style: iconStyle
|
|
38
40
|
})
|
|
39
41
|
}) : null,
|
|
@@ -7,7 +7,7 @@ import { Pressable, StyleSheet } from "react-native";
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { useUnistyles } from "react-native-unistyles";
|
|
9
9
|
//#region src/components/Chip/ChipDismissible.tsx
|
|
10
|
-
const ChipDismissible = memo(function ChipDismissible({ onDismiss, dismissButtonAriaLabel = "Dismiss", dismissIcon, disabled = false, variant = DEFAULT_CHIP_VARIANT, size = "md", ...props }) {
|
|
10
|
+
const ChipDismissible = memo(function ChipDismissible({ onDismiss, dismissButtonAriaLabel = "Dismiss", dismissIcon, disabled = false, variant = DEFAULT_CHIP_VARIANT, size = "md", maxFontSizeMultiplier, ...props }) {
|
|
11
11
|
const { theme } = useUnistyles();
|
|
12
12
|
const handleDismiss = useCallback(() => {
|
|
13
13
|
if (!disabled) onDismiss?.();
|
|
@@ -22,6 +22,7 @@ const ChipDismissible = memo(function ChipDismissible({ onDismiss, dismissButton
|
|
|
22
22
|
variant,
|
|
23
23
|
size,
|
|
24
24
|
disabled,
|
|
25
|
+
maxFontSizeMultiplier,
|
|
25
26
|
endContent: onDismiss ? /* @__PURE__ */ jsx(Pressable, {
|
|
26
27
|
accessibilityLabel: dismissButtonAriaLabel,
|
|
27
28
|
accessibilityRole: "button",
|
|
@@ -32,6 +33,7 @@ const ChipDismissible = memo(function ChipDismissible({ onDismiss, dismissButton
|
|
|
32
33
|
children: /* @__PURE__ */ jsx(IconSlot, {
|
|
33
34
|
icon: dismissIcon ?? "Cross",
|
|
34
35
|
variant: "fill",
|
|
36
|
+
maxFontSizeMultiplier,
|
|
35
37
|
style: iconStyle
|
|
36
38
|
})
|
|
37
39
|
}) : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipDismissible.js","names":[],"sources":["../../../src/components/Chip/ChipDismissible.tsx"],"sourcesContent":["import { memo, useCallback, useMemo } from 'react';\nimport type { StyleProp, TextStyle } from 'react-native';\nimport { Pressable, StyleSheet } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- dismiss icon must match chip subcomponent tokens\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { IconSlot } from '../IconSlot';\nimport { ChipBase, DEFAULT_CHIP_SIZE, DEFAULT_CHIP_VARIANT } from './ChipBase';\nimport { getMergedChipLayerStyle } from './chipTheme';\nimport type { ChipDismissibleProps } from './types';\n\nconst ChipDismissible = memo(function ChipDismissible({\n onDismiss,\n dismissButtonAriaLabel = 'Dismiss',\n dismissIcon,\n disabled = false,\n variant = DEFAULT_CHIP_VARIANT,\n size = DEFAULT_CHIP_SIZE,\n ...props\n}: ChipDismissibleProps) {\n const { theme } = useUnistyles();\n const handleDismiss = useCallback(() => {\n if (!disabled) {\n onDismiss?.();\n }\n }, [disabled, onDismiss]);\n\n const iconStyle = useMemo<StyleProp<TextStyle>>(\n () =>\n getMergedChipLayerStyle(\n theme,\n 'dismissible',\n variant,\n size,\n 'off',\n 'icon',\n 'rest',\n ) as TextStyle,\n [size, theme, variant],\n );\n\n return (\n <ChipBase\n kind=\"dismissible\"\n variant={variant}\n size={size}\n disabled={disabled}\n endContent={\n onDismiss ? (\n <Pressable\n accessibilityLabel={dismissButtonAriaLabel}\n accessibilityRole=\"button\"\n disabled={disabled}\n hitSlop={8}\n onPress={handleDismiss}\n style={chipDismissibleStyles.button}\n >\n <IconSlot
|
|
1
|
+
{"version":3,"file":"ChipDismissible.js","names":[],"sources":["../../../src/components/Chip/ChipDismissible.tsx"],"sourcesContent":["import { memo, useCallback, useMemo } from 'react';\nimport type { StyleProp, TextStyle } from 'react-native';\nimport { Pressable, StyleSheet } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- dismiss icon must match chip subcomponent tokens\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { IconSlot } from '../IconSlot';\nimport { ChipBase, DEFAULT_CHIP_SIZE, DEFAULT_CHIP_VARIANT } from './ChipBase';\nimport { getMergedChipLayerStyle } from './chipTheme';\nimport type { ChipDismissibleProps } from './types';\n\nconst ChipDismissible = memo(function ChipDismissible({\n onDismiss,\n dismissButtonAriaLabel = 'Dismiss',\n dismissIcon,\n disabled = false,\n variant = DEFAULT_CHIP_VARIANT,\n size = DEFAULT_CHIP_SIZE,\n maxFontSizeMultiplier,\n ...props\n}: ChipDismissibleProps) {\n const { theme } = useUnistyles();\n const handleDismiss = useCallback(() => {\n if (!disabled) {\n onDismiss?.();\n }\n }, [disabled, onDismiss]);\n\n const iconStyle = useMemo<StyleProp<TextStyle>>(\n () =>\n getMergedChipLayerStyle(\n theme,\n 'dismissible',\n variant,\n size,\n 'off',\n 'icon',\n 'rest',\n ) as TextStyle,\n [size, theme, variant],\n );\n\n return (\n <ChipBase\n kind=\"dismissible\"\n variant={variant}\n size={size}\n disabled={disabled}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n endContent={\n onDismiss ? (\n <Pressable\n accessibilityLabel={dismissButtonAriaLabel}\n accessibilityRole=\"button\"\n disabled={disabled}\n hitSlop={8}\n onPress={handleDismiss}\n style={chipDismissibleStyles.button}\n >\n <IconSlot\n icon={dismissIcon ?? 'Cross'}\n variant=\"fill\"\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n style={iconStyle}\n />\n </Pressable>\n ) : null\n }\n {...props}\n />\n );\n});\n\nChipDismissible.displayName = 'ChipDismissible';\n\nconst chipDismissibleStyles = StyleSheet.create({\n button: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport { ChipDismissible };\n"],"mappings":";;;;;;;;;AAWA,MAAM,kBAAkB,KAAK,SAAS,gBAAgB,EACpD,WACA,yBAAyB,WACzB,aACA,WAAW,OACX,UAAU,sBACV,OAAA,MACA,uBACA,GAAG,SACoB;CACvB,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,gBAAgB,kBAAkB;EACtC,IAAI,CAAC,UACH,aAAa;IAEd,CAAC,UAAU,UAAU,CAAC;CAEzB,MAAM,YAAY,cAEd,wBACE,OACA,eACA,SACA,MACA,OACA,QACA,OACD,EACH;EAAC;EAAM;EAAO;EAAQ,CACvB;CAED,OACE,oBAAC,UAAD;EACE,MAAK;EACI;EACH;EACI;EACa;EACvB,YACE,YACE,oBAAC,WAAD;GACE,oBAAoB;GACpB,mBAAkB;GACR;GACV,SAAS;GACT,SAAS;GACT,OAAO,sBAAsB;aAE7B,oBAAC,UAAD;IACE,MAAM,eAAe;IACrB,SAAQ;IACe;IACvB,OAAO;IACP,CAAA;GACQ,CAAA,GACV;EAEN,GAAI;EACJ,CAAA;EAEJ;AAEF,gBAAgB,cAAc;AAE9B,MAAM,wBAAwB,WAAW,OAAO,EAC9C,QAAQ;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
|
|
@@ -25,6 +25,13 @@ interface ChipSharedProps extends Omit<ViewProps, 'children' | 'style'> {
|
|
|
25
25
|
endIcon?: IconSlotType;
|
|
26
26
|
/** Whether the chip is disabled. */
|
|
27
27
|
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Caps how far the chip's label and icons grow with the OS text-size
|
|
30
|
+
* setting; the chip grows to fit. Set null to remove the cap; override
|
|
31
|
+
* app-wide via UDSFontScalingProvider.
|
|
32
|
+
* @default 2
|
|
33
|
+
*/
|
|
34
|
+
maxFontSizeMultiplier?: number | null;
|
|
28
35
|
/** Chip label content. */
|
|
29
36
|
children?: ReactNode;
|
|
30
37
|
/** Style override for the chip root. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/Chip/types.ts"],"mappings":";;;;;;;KAMK,oBAAA;AAAA,KACA,QAAA;AAAA,KACA,eAAA;AAAA,UAEK,eAAA,SAAwB,IAAA,CAAK,SAAA;;EAErC,GAAA,GAAM,GAAA,CAAI,IAAA;EANa;EAQvB,OAAA,GAAU,WAAA;EAPC;EASX,IAAA,GAAO,QAAA;EATI;EAWX,QAAA;EAVG;EAYH,QAAA;;EAEA,SAAA,GAAY,YAAA;EAdM;EAgBlB,OAAA,GAAU,YAAA;EAdc;EAgBxB,QAAA;EAhBqC;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/Chip/types.ts"],"mappings":";;;;;;;KAMK,oBAAA;AAAA,KACA,QAAA;AAAA,KACA,eAAA;AAAA,UAEK,eAAA,SAAwB,IAAA,CAAK,SAAA;;EAErC,GAAA,GAAM,GAAA,CAAI,IAAA;EANa;EAQvB,OAAA,GAAU,WAAA;EAPC;EASX,IAAA,GAAO,QAAA;EATI;EAWX,QAAA;EAVG;EAYH,QAAA;;EAEA,SAAA,GAAY,YAAA;EAdM;EAgBlB,OAAA,GAAU,YAAA;EAdc;EAgBxB,QAAA;EAhBqC;;;;;;EAuBrC,qBAAA;EAEW;EAAX,QAAA,GAAW,SAAA;EAEH;EAAR,KAAA,GAAQ,SAAA,CAAU,SAAA;AAAA;AAAA,UAGV,eAAA,SAAwB,eAAA;EA9BA;EAgChC,OAAA;AAAA;AAAA,UAGQ,oBAAA,SAA6B,IAAA,CAAK,eAAA;EAjChC;EAmCV,SAAA;EAjCU;EAmCV,sBAAA;EAjCO;EAmCP,WAAA,GAAc,YAAA;AAAA;AAAA,UAGN,eAAA,SAAwB,eAAA;EAhCpB;EAkCZ,SAAA;EAhCU;EAkCV,QAAA,IAAY,SAAA;AAAA;AAAA,UAGJ,SAAA,SAAkB,eAAA;EA1Bf;EA4BX,OAAA;EA1BQ;EA4BR,SAAA;EA5B2B;EA8B3B,QAAA,IAAY,SAAA;EA3BJ;EA6BR,SAAA;;EAEA,sBAAA;EA7BO;EA+BP,WAAA,GAAc,YAAA;AAAA;AAAA,UAGN,aAAA,SAAsB,eAAA;EAC9B,IAAA,EAAM,QAAA;EACN,WAAA,GAAc,eAAA;EACd,gBAAA,GAAmB,oBAAA;EACnB,SAAA;EACA,iBAAA,GAAoB,SAAA;EACpB,OAAA;EACA,UAAA,GAAa,SAAA;AAAA"}
|
|
@@ -25,6 +25,13 @@ interface ChipSharedProps extends Omit<ViewProps, 'children' | 'style'> {
|
|
|
25
25
|
endIcon?: IconSlotType;
|
|
26
26
|
/** Whether the chip is disabled. */
|
|
27
27
|
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Caps how far the chip's label and icons grow with the OS text-size
|
|
30
|
+
* setting; the chip grows to fit. Set null to remove the cap; override
|
|
31
|
+
* app-wide via UDSFontScalingProvider.
|
|
32
|
+
* @default 2
|
|
33
|
+
*/
|
|
34
|
+
maxFontSizeMultiplier?: number | null;
|
|
28
35
|
/** Chip label content. */
|
|
29
36
|
children?: ReactNode;
|
|
30
37
|
/** Style override for the chip root. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/Chip/types.ts"],"mappings":";;;;;;;KAMK,oBAAA;AAAA,KACA,QAAA;AAAA,KACA,eAAA;AAAA,UAEK,eAAA,SAAwB,IAAA,CAAK,SAAA;;EAErC,GAAA,GAAM,GAAA,CAAI,IAAA;EANa;EAQvB,OAAA,GAAU,WAAA;EAPC;EASX,IAAA,GAAO,QAAA;EATI;EAWX,QAAA;EAVG;EAYH,QAAA;;EAEA,SAAA,GAAY,YAAA;EAdM;EAgBlB,OAAA,GAAU,YAAA;EAdc;EAgBxB,QAAA;EAhBqC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/Chip/types.ts"],"mappings":";;;;;;;KAMK,oBAAA;AAAA,KACA,QAAA;AAAA,KACA,eAAA;AAAA,UAEK,eAAA,SAAwB,IAAA,CAAK,SAAA;;EAErC,GAAA,GAAM,GAAA,CAAI,IAAA;EANa;EAQvB,OAAA,GAAU,WAAA;EAPC;EASX,IAAA,GAAO,QAAA;EATI;EAWX,QAAA;EAVG;EAYH,QAAA;;EAEA,SAAA,GAAY,YAAA;EAdM;EAgBlB,OAAA,GAAU,YAAA;EAdc;EAgBxB,QAAA;EAhBqC;;;;;;EAuBrC,qBAAA;EAEW;EAAX,QAAA,GAAW,SAAA;EAEH;EAAR,KAAA,GAAQ,SAAA,CAAU,SAAA;AAAA;AAAA,UAGV,eAAA,SAAwB,eAAA;EA9BA;EAgChC,OAAA;AAAA;AAAA,UAGQ,oBAAA,SAA6B,IAAA,CAAK,eAAA;EAjChC;EAmCV,SAAA;EAjCU;EAmCV,sBAAA;EAjCO;EAmCP,WAAA,GAAc,YAAA;AAAA;AAAA,UAGN,eAAA,SAAwB,eAAA;EAhCpB;EAkCZ,SAAA;EAhCU;EAkCV,QAAA,IAAY,SAAA;AAAA;AAAA,UAGJ,SAAA,SAAkB,eAAA;EA1Bf;EA4BX,OAAA;EA1BQ;EA4BR,SAAA;EA5B2B;EA8B3B,QAAA,IAAY,SAAA;EA3BJ;EA6BR,SAAA;;EAEA,sBAAA;EA7BO;EA+BP,WAAA,GAAc,YAAA;AAAA;AAAA,UAGN,aAAA,SAAsB,eAAA;EAC9B,IAAA,EAAM,QAAA;EACN,WAAA,GAAc,eAAA;EACd,gBAAA,GAAmB,oBAAA;EACnB,SAAA;EACA,iBAAA,GAAoB,SAAA;EACpB,OAAA;EACA,UAAA,GAAa,SAAA;AAAA"}
|