@hzblj/kara-components 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js +6 -1
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js.map +1 -1
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js +2 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js.map +1 -1
- package/lib/module/atoms/avatar/avatar.js +5 -0
- package/lib/module/atoms/avatar/avatar.js.map +1 -1
- package/lib/module/atoms/box/box.js +3 -0
- package/lib/module/atoms/box/box.js.map +1 -1
- package/lib/module/atoms/box/index.js +0 -1
- package/lib/module/atoms/box/index.js.map +1 -1
- package/lib/module/atoms/button/button-tokens.js +2 -2
- package/lib/module/atoms/button/button-tokens.js.map +1 -1
- package/lib/module/atoms/button/button.android.js +6 -2
- package/lib/module/atoms/button/button.android.js.map +1 -1
- package/lib/module/atoms/button/button.ios.js +7 -2
- package/lib/module/atoms/button/button.ios.js.map +1 -1
- package/lib/module/atoms/card/card.android.js +5 -3
- package/lib/module/atoms/card/card.android.js.map +1 -1
- package/lib/module/atoms/card/card.ios.js +7 -3
- package/lib/module/atoms/card/card.ios.js.map +1 -1
- package/lib/module/atoms/checkbox/checkbox.android.js +1 -1
- package/lib/module/atoms/checkbox/checkbox.android.js.map +1 -1
- package/lib/module/atoms/fab/fab.android.js +9 -1
- package/lib/module/atoms/fab/fab.android.js.map +1 -1
- package/lib/module/atoms/fab/fab.ios.js +9 -3
- package/lib/module/atoms/fab/fab.ios.js.map +1 -1
- package/lib/module/atoms/glass-view/glass-view.android.js +1 -1
- package/lib/module/atoms/glass-view/glass-view.android.js.map +1 -1
- package/lib/module/atoms/h-stack/h-stack.ios.js +5 -3
- package/lib/module/atoms/h-stack/h-stack.ios.js.map +1 -1
- package/lib/module/atoms/icon-button/icon-button.android.js +9 -0
- package/lib/module/atoms/icon-button/icon-button.android.js.map +1 -1
- package/lib/module/atoms/icon-button/icon-button.ios.js +9 -2
- package/lib/module/atoms/icon-button/icon-button.ios.js.map +1 -1
- package/lib/module/atoms/image/image.js +4 -4
- package/lib/module/atoms/image/image.js.map +1 -1
- package/lib/module/atoms/index.js +1 -0
- package/lib/module/atoms/index.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +75 -27
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/module/atoms/progress/progress.android.js +7 -0
- package/lib/module/atoms/progress/progress.android.js.map +1 -1
- package/lib/module/atoms/progress/progress.ios.js +6 -1
- package/lib/module/atoms/progress/progress.ios.js.map +1 -1
- package/lib/module/atoms/rn-text/rn-text.js +66 -26
- package/lib/module/atoms/rn-text/rn-text.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.ios.js +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.ios.js.map +1 -1
- package/lib/module/atoms/skeleton/skeleton.js +22 -8
- package/lib/module/atoms/skeleton/skeleton.js.map +1 -1
- package/lib/module/atoms/stagger/index.js +5 -0
- package/lib/module/atoms/stagger/index.js.map +1 -0
- package/lib/module/atoms/stagger/stagger.js +102 -0
- package/lib/module/atoms/stagger/stagger.js.map +1 -0
- package/lib/module/atoms/stagger/stagger.types.js +4 -0
- package/lib/module/atoms/stagger/stagger.types.js.map +1 -0
- package/lib/module/atoms/surface/surface.android.js +5 -3
- package/lib/module/atoms/surface/surface.android.js.map +1 -1
- package/lib/module/atoms/surface/surface.ios.js +7 -3
- package/lib/module/atoms/surface/surface.ios.js.map +1 -1
- package/lib/module/atoms/switch/switch.android.js +1 -1
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/atoms/text/text.android.js +5 -3
- package/lib/module/atoms/text/text.android.js.map +1 -1
- package/lib/module/atoms/text/text.ios.js +6 -4
- package/lib/module/atoms/text/text.ios.js.map +1 -1
- package/lib/module/atoms/v-stack/v-stack.ios.js +5 -3
- package/lib/module/atoms/v-stack/v-stack.ios.js.map +1 -1
- package/lib/module/atoms/z-stack/z-stack.ios.js +5 -3
- package/lib/module/atoms/z-stack/z-stack.ios.js.map +1 -1
- package/lib/module/glyph/glyph.android.js +2 -0
- package/lib/module/glyph/glyph.android.js.map +1 -1
- package/lib/module/glyph/glyph.ios.js +5 -2
- package/lib/module/glyph/glyph.ios.js.map +1 -1
- package/lib/module/molecules/collapsible/collapsible.android.js +18 -8
- package/lib/module/molecules/collapsible/collapsible.android.js.map +1 -1
- package/lib/module/molecules/labeled-content/labeled-content.js +4 -1
- package/lib/module/molecules/labeled-content/labeled-content.js.map +1 -1
- package/lib/module/molecules/link/link.js +4 -1
- package/lib/module/molecules/link/link.js.map +1 -1
- package/lib/module/molecules/list-item/list-item.js +4 -1
- package/lib/module/molecules/list-item/list-item.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.ios.js +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.ios.js.map +1 -1
- package/lib/module/molecules/rn-list-item/rn-list-item.js +10 -2
- package/lib/module/molecules/rn-list-item/rn-list-item.js.map +1 -1
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js +5 -6
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js.map +1 -1
- package/lib/module/molecules/stepper/stepper.ios.js +6 -2
- package/lib/module/molecules/stepper/stepper.ios.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.android.js +8 -5
- package/lib/module/organisms/fab-menu/fab-menu.android.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.ios.js +5 -2
- package/lib/module/organisms/fab-menu/fab-menu.ios.js.map +1 -1
- package/lib/module/organisms/snackbar/snackbar.js +155 -18
- package/lib/module/organisms/snackbar/snackbar.js.map +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js.map +1 -1
- package/lib/module/use-stack-modifiers.js +10 -8
- package/lib/module/use-stack-modifiers.js.map +1 -1
- package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +2 -0
- package/lib/typescript/atoms/avatar/avatar.types.d.ts +5 -0
- package/lib/typescript/atoms/box/box.d.ts +3 -0
- package/lib/typescript/atoms/box/index.d.ts +0 -1
- package/lib/typescript/atoms/button/button-tokens.d.ts +1 -1
- package/lib/typescript/atoms/button/button.types.d.ts +2 -0
- package/lib/typescript/atoms/card/card.types.d.ts +2 -2
- package/lib/typescript/atoms/fab/fab.types.d.ts +8 -1
- package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +6 -3
- package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +7 -0
- package/lib/typescript/atoms/image/image.d.ts +2 -2
- package/lib/typescript/atoms/index.d.ts +1 -0
- package/lib/typescript/atoms/pressable/pressable.types.d.ts +10 -9
- package/lib/typescript/atoms/progress/progress.types.d.ts +2 -0
- package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +7 -4
- package/lib/typescript/atoms/skeleton/skeleton.types.d.ts +3 -2
- package/lib/typescript/atoms/stagger/index.d.ts +2 -0
- package/lib/typescript/atoms/stagger/stagger.d.ts +2 -0
- package/lib/typescript/atoms/stagger/stagger.types.d.ts +32 -0
- package/lib/typescript/atoms/surface/surface.types.d.ts +2 -2
- package/lib/typescript/atoms/text/text.types.d.ts +2 -2
- package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +3 -3
- package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +3 -3
- package/lib/typescript/glyph/glyph.types.d.ts +2 -0
- package/lib/typescript/molecules/labeled-content/labeled-content.types.d.ts +4 -2
- package/lib/typescript/molecules/link/link.types.d.ts +2 -1
- package/lib/typescript/molecules/list-item/list-item.types.d.ts +5 -3
- package/lib/typescript/molecules/stepper/stepper.ios.d.ts +1 -1
- package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +5 -0
- package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +35 -4
- package/lib/typescript/use-stack-modifiers.d.ts +6 -5
- package/package.json +4 -4
- package/src/atoms/activity-indicator/activity-indicator.android.tsx +7 -1
- package/src/atoms/activity-indicator/activity-indicator.ios.tsx +9 -1
- package/src/atoms/activity-indicator/activity-indicator.types.ts +2 -0
- package/src/atoms/avatar/avatar.tsx +5 -1
- package/src/atoms/avatar/avatar.types.ts +5 -0
- package/src/atoms/box/box.tsx +3 -0
- package/src/atoms/box/index.ts +0 -1
- package/src/atoms/button/button-tokens.ts +2 -2
- package/src/atoms/button/button.android.tsx +5 -3
- package/src/atoms/button/button.ios.tsx +10 -2
- package/src/atoms/button/button.types.ts +2 -0
- package/src/atoms/card/card.android.tsx +6 -4
- package/src/atoms/card/card.ios.tsx +7 -3
- package/src/atoms/card/card.types.ts +8 -7
- package/src/atoms/checkbox/checkbox.android.tsx +1 -1
- package/src/atoms/fab/fab.android.tsx +5 -3
- package/src/atoms/fab/fab.ios.tsx +8 -4
- package/src/atoms/fab/fab.types.ts +8 -1
- package/src/atoms/glass-view/glass-view.android.tsx +1 -1
- package/src/atoms/h-stack/h-stack.ios.tsx +6 -4
- package/src/atoms/h-stack/h-stack.types.ts +17 -13
- package/src/atoms/icon-button/icon-button.android.tsx +16 -3
- package/src/atoms/icon-button/icon-button.ios.tsx +13 -4
- package/src/atoms/icon-button/icon-button.types.ts +7 -0
- package/src/atoms/image/image.tsx +3 -3
- package/src/atoms/index.ts +1 -0
- package/src/atoms/pressable/pressable.tsx +164 -100
- package/src/atoms/pressable/pressable.types.ts +32 -29
- package/src/atoms/progress/progress.android.tsx +5 -3
- package/src/atoms/progress/progress.ios.tsx +5 -2
- package/src/atoms/progress/progress.types.ts +2 -0
- package/src/atoms/rn-text/rn-text.tsx +101 -32
- package/src/atoms/rn-text/rn-text.types.ts +7 -3
- package/src/atoms/segmented-control/segmented-control.android.tsx +1 -1
- package/src/atoms/segmented-control/segmented-control.ios.tsx +1 -1
- package/src/atoms/skeleton/skeleton.tsx +20 -6
- package/src/atoms/skeleton/skeleton.types.ts +3 -2
- package/src/atoms/stagger/index.ts +2 -0
- package/src/atoms/stagger/stagger.tsx +98 -0
- package/src/atoms/stagger/stagger.types.ts +35 -0
- package/src/atoms/surface/surface.android.tsx +6 -4
- package/src/atoms/surface/surface.ios.tsx +7 -3
- package/src/atoms/surface/surface.types.ts +10 -9
- package/src/atoms/switch/switch.android.tsx +1 -1
- package/src/atoms/text/text.android.tsx +6 -4
- package/src/atoms/text/text.ios.tsx +6 -4
- package/src/atoms/text/text.types.ts +23 -22
- package/src/atoms/v-stack/v-stack.ios.tsx +6 -4
- package/src/atoms/v-stack/v-stack.types.ts +17 -16
- package/src/atoms/z-stack/z-stack.ios.tsx +6 -4
- package/src/atoms/z-stack/z-stack.types.ts +15 -14
- package/src/glyph/glyph.android.tsx +14 -2
- package/src/glyph/glyph.ios.tsx +13 -3
- package/src/glyph/glyph.types.ts +2 -0
- package/src/molecules/collapsible/collapsible.android.tsx +27 -7
- package/src/molecules/labeled-content/labeled-content.tsx +12 -1
- package/src/molecules/labeled-content/labeled-content.types.ts +4 -2
- package/src/molecules/link/link.tsx +2 -1
- package/src/molecules/link/link.types.ts +2 -1
- package/src/molecules/list-item/list-item.tsx +20 -2
- package/src/molecules/list-item/list-item.types.ts +5 -3
- package/src/molecules/navigation-bar/navigation-bar.android.tsx +1 -1
- package/src/molecules/navigation-bar/navigation-bar.ios.tsx +1 -1
- package/src/molecules/rn-list-item/rn-list-item.tsx +18 -3
- package/src/molecules/scroll-edge-container/scroll-edge-container.android.tsx +5 -4
- package/src/molecules/stepper/stepper.ios.tsx +8 -2
- package/src/organisms/fab-menu/fab-menu.android.tsx +9 -5
- package/src/organisms/fab-menu/fab-menu.ios.tsx +6 -2
- package/src/organisms/fab-menu/fab-menu.types.ts +5 -0
- package/src/organisms/snackbar/snackbar.tsx +125 -21
- package/src/organisms/snackbar/snackbar.types.ts +38 -4
- package/src/organisms/swipe-actions/swipe-actions.android.tsx +1 -1
- package/src/use-stack-modifiers.ts +20 -7
- package/lib/module/atoms/box/a-box.js +0 -6
- package/lib/module/atoms/box/a-box.js.map +0 -1
- package/lib/typescript/atoms/box/a-box.d.ts +0 -49
- package/src/atoms/box/a-box.ts +0 -5
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { IconButton as ComposeIconButton } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { useAccessibilityModifiers } from '@hzblj/kara-sx';
|
|
4
5
|
import { useHostGuard } from "../../host-context.js";
|
|
5
6
|
import { Icon } from "../icon/index.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export const IconButton = ({
|
|
9
|
+
accessibilityHint,
|
|
10
|
+
accessibilityLabel,
|
|
8
11
|
disabled = false,
|
|
9
12
|
name,
|
|
10
13
|
onPress
|
|
11
14
|
}) => {
|
|
12
15
|
useHostGuard('IconButton');
|
|
16
|
+
// The label rides on the icon, as Material's own icon buttons carry it; the hint labels the click.
|
|
17
|
+
const modifiers = useAccessibilityModifiers({
|
|
18
|
+
accessibilityHint
|
|
19
|
+
}, accessibilityHint !== undefined);
|
|
13
20
|
return /*#__PURE__*/_jsx(ComposeIconButton, {
|
|
14
21
|
enabled: !disabled,
|
|
22
|
+
modifiers: modifiers,
|
|
15
23
|
onClick: onPress,
|
|
16
24
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
25
|
+
accessibilityLabel: accessibilityLabel,
|
|
17
26
|
color: disabled ? 'btn.content.disabled' : 'content.primary',
|
|
18
27
|
name: name
|
|
19
28
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IconButton","ComposeIconButton","useHostGuard","Icon","jsx","_jsx","disabled","name","onPress","enabled","onClick","children","color"],"sourceRoot":"../../../../src","sources":["atoms/icon-button/icon-button.android.tsx"],"mappings":";;AAAA,SAAQA,UAAU,IAAIC,iBAAiB,QAAO,0BAA0B;
|
|
1
|
+
{"version":3,"names":["IconButton","ComposeIconButton","useAccessibilityModifiers","useHostGuard","Icon","jsx","_jsx","accessibilityHint","accessibilityLabel","disabled","name","onPress","modifiers","undefined","enabled","onClick","children","color"],"sourceRoot":"../../../../src","sources":["atoms/icon-button/icon-button.android.tsx"],"mappings":";;AAAA,SAAQA,UAAU,IAAIC,iBAAiB,QAAO,0BAA0B;AACxE,SAAQC,yBAAyB,QAAO,gBAAgB;AAExD,SAAQC,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,IAAI,QAAO,kBAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG5B,OAAO,MAAMN,UAA+B,GAAGA,CAAC;EAC9CO,iBAAiB;EACjBC,kBAAkB;EAClBC,QAAQ,GAAG,KAAK;EAChBC,IAAI;EACJC;AACe,CAAC,KAAK;EACrBR,YAAY,CAAC,YAAY,CAAC;EAC1B;EACA,MAAMS,SAAS,GAAGV,yBAAyB,CAAC;IAACK;EAAiB,CAAC,EAAEA,iBAAiB,KAAKM,SAAS,CAAC;EAEjG,oBACEP,IAAA,CAACL,iBAAiB;IAACa,OAAO,EAAE,CAACL,QAAS;IAACG,SAAS,EAAEA,SAAU;IAACG,OAAO,EAAEJ,OAAQ;IAAAK,QAAA,eAC5EV,IAAA,CAACF,IAAI;MACHI,kBAAkB,EAAEA,kBAAmB;MACvCS,KAAK,EAAER,QAAQ,GAAG,sBAAsB,GAAG,iBAAkB;MAC7DC,IAAI,EAAEA;IAAK,CACZ;EAAC,CACe,CAAC;AAExB,CAAC","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Button } from '@expo/ui/swift-ui';
|
|
4
4
|
import { buttonStyle, contentShape, disabled as disabledModifier, shapes } from '@expo/ui/swift-ui/modifiers';
|
|
5
|
+
import { useAccessibilityModifiers } from '@hzblj/kara-sx';
|
|
5
6
|
import { useMemo } from 'react';
|
|
6
7
|
import { useHostGuard } from "../../host-context.js";
|
|
7
8
|
import { Icon } from "../icon/index.js";
|
|
@@ -15,19 +16,24 @@ const WHOLE_TARGET = {
|
|
|
15
16
|
modifiers: [contentShape(shapes.circle())]
|
|
16
17
|
};
|
|
17
18
|
export const IconButton = ({
|
|
19
|
+
accessibilityHint,
|
|
20
|
+
accessibilityLabel,
|
|
18
21
|
disabled = false,
|
|
19
22
|
name,
|
|
20
23
|
onPress,
|
|
21
24
|
testID
|
|
22
25
|
}) => {
|
|
23
26
|
useHostGuard('IconButton');
|
|
27
|
+
const accessibilityModifiers = useAccessibilityModifiers({
|
|
28
|
+
accessibilityHint
|
|
29
|
+
});
|
|
24
30
|
const modifiers = useMemo(() => {
|
|
25
|
-
const list = [buttonStyle('plain')];
|
|
31
|
+
const list = [buttonStyle('plain'), ...accessibilityModifiers];
|
|
26
32
|
if (disabled) {
|
|
27
33
|
list.push(disabledModifier(true));
|
|
28
34
|
}
|
|
29
35
|
return list;
|
|
30
|
-
}, [disabled]);
|
|
36
|
+
}, [accessibilityModifiers, disabled]);
|
|
31
37
|
return /*#__PURE__*/_jsx(Button, {
|
|
32
38
|
modifiers: modifiers,
|
|
33
39
|
onPress: onPress,
|
|
@@ -37,6 +43,7 @@ export const IconButton = ({
|
|
|
37
43
|
ios: WHOLE_TARGET,
|
|
38
44
|
w: TARGET,
|
|
39
45
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
46
|
+
accessibilityLabel: accessibilityLabel,
|
|
40
47
|
color: "content.primary",
|
|
41
48
|
name: name
|
|
42
49
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","buttonStyle","contentShape","disabled","disabledModifier","shapes","useMemo","useHostGuard","Icon","ZStack","jsx","_jsx","TARGET","WHOLE_TARGET","modifiers","circle","IconButton","name","onPress","testID","list","push","children","h","ios","w","color"],"sourceRoot":"../../../../src","sources":["atoms/icon-button/icon-button.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,QAAO,mBAAmB;AACxC,SAAQC,WAAW,EAAEC,YAAY,EAAEC,QAAQ,IAAIC,gBAAgB,EAAEC,MAAM,QAAO,6BAA6B;AAC3G,SAAQC,OAAO,QAAO,OAAO;AAE7B,SAAQC,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,IAAI,QAAO,kBAAS;AAC5B,SAAQC,MAAM,QAAO,qBAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGjC;AACA,MAAMC,MAAM,GAAG,EAAE;;AAEjB;AACA,MAAMC,YAAY,GAAG;EAACC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"names":["Button","buttonStyle","contentShape","disabled","disabledModifier","shapes","useAccessibilityModifiers","useMemo","useHostGuard","Icon","ZStack","jsx","_jsx","TARGET","WHOLE_TARGET","modifiers","circle","IconButton","accessibilityHint","accessibilityLabel","name","onPress","testID","accessibilityModifiers","list","push","children","h","ios","w","color"],"sourceRoot":"../../../../src","sources":["atoms/icon-button/icon-button.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,QAAO,mBAAmB;AACxC,SAAQC,WAAW,EAAEC,YAAY,EAAEC,QAAQ,IAAIC,gBAAgB,EAAEC,MAAM,QAAO,6BAA6B;AAC3G,SAAQC,yBAAyB,QAAO,gBAAgB;AACxD,SAAQC,OAAO,QAAO,OAAO;AAE7B,SAAQC,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,IAAI,QAAO,kBAAS;AAC5B,SAAQC,MAAM,QAAO,qBAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGjC;AACA,MAAMC,MAAM,GAAG,EAAE;;AAEjB;AACA,MAAMC,YAAY,GAAG;EAACC,SAAS,EAAE,CAACb,YAAY,CAACG,MAAM,CAACW,MAAM,CAAC,CAAC,CAAC;AAAC,CAAC;AAEjE,OAAO,MAAMC,UAA+B,GAAGA,CAAC;EAC9CC,iBAAiB;EACjBC,kBAAkB;EAClBhB,QAAQ,GAAG,KAAK;EAChBiB,IAAI;EACJC,OAAO;EACPC;AACe,CAAC,KAAK;EACrBd,YAAY,CAAC,YAAY,CAAC;EAC1B,MAAMe,sBAAsB,GAAGjB,yBAAyB,CAAC;IAACY;EAAiB,CAAC,CAAC;EAE7E,MAAMH,SAAS,GAAGR,OAAO,CAAC,MAAM;IAC9B,MAAMiB,IAAI,GAAG,CAACvB,WAAW,CAAC,OAAO,CAAC,EAAE,GAAGsB,sBAAsB,CAAC;IAE9D,IAAIpB,QAAQ,EAAE;MACZqB,IAAI,CAACC,IAAI,CAACrB,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACnC;IAEA,OAAOoB,IAAI;EACb,CAAC,EAAE,CAACD,sBAAsB,EAAEpB,QAAQ,CAAC,CAAC;EAEtC,oBACES,IAAA,CAACZ,MAAM;IAACe,SAAS,EAAEA,SAAU;IAACM,OAAO,EAAEA,OAAQ;IAACC,MAAM,EAAEA,MAAO;IAAAI,QAAA,eAC7Dd,IAAA,CAACF,MAAM;MAACiB,CAAC,EAAEd,MAAO;MAACe,GAAG,EAAEd,YAAa;MAACe,CAAC,EAAEhB,MAAO;MAAAa,QAAA,eAE9Cd,IAAA,CAACH,IAAI;QAACU,kBAAkB,EAAEA,kBAAmB;QAACW,KAAK,EAAC,iBAAiB;QAACV,IAAI,EAAEA;MAAK,CAAE;IAAC,CAC9E;EAAC,CACH,CAAC;AAEb,CAAC","ignoreList":[]}
|
|
@@ -5,8 +5,8 @@ import { duration } from '@hzblj/kara-theme';
|
|
|
5
5
|
import { Image as ExpoImage } from 'expo-image';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const FADE = {
|
|
8
|
-
duration: duration.
|
|
9
|
-
timing: '
|
|
8
|
+
duration: duration.quick,
|
|
9
|
+
timing: 'ease-out'
|
|
10
10
|
};
|
|
11
11
|
const FadingImage = props => /*#__PURE__*/_jsx(ExpoImage, {
|
|
12
12
|
transition: FADE,
|
|
@@ -14,8 +14,8 @@ const FadingImage = props => /*#__PURE__*/_jsx(ExpoImage, {
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* `expo-image` with the `sx` props, the way `Box` is a `View` with them, and the design system's
|
|
18
|
-
* already applied, so a loaded image never pops in. An explicit `transition` wins, and so does an explicit `style`.
|
|
17
|
+
* `expo-image` with the `sx` props, the way `Box` is a `View` with them, and the design system's fade (`quick`,
|
|
18
|
+
* eased out) already applied, so a loaded image never pops in. An explicit `transition` wins, and so does an explicit `style`.
|
|
19
19
|
*/
|
|
20
20
|
export const Image = sx(FadingImage);
|
|
21
21
|
//# sourceMappingURL=image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sx","duration","Image","ExpoImage","jsx","_jsx","FADE","
|
|
1
|
+
{"version":3,"names":["sx","duration","Image","ExpoImage","jsx","_jsx","FADE","quick","timing","FadingImage","props","transition"],"sourceRoot":"../../../../src","sources":["atoms/image/image.tsx"],"mappings":";;AAAA,SAAQA,EAAE,QAAO,gBAAgB;AACjC,SAAQC,QAAQ,QAAO,mBAAmB;AAC1C,SAAQC,KAAK,IAAIC,SAAS,QAA0C,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGhF,MAAMC,IAAI,GAAG;EAACL,QAAQ,EAAEA,QAAQ,CAACM,KAAK;EAAEC,MAAM,EAAE;AAAU,CAAU;AAEpE,MAAMC,WAAW,GAAIC,KAA8C,iBAAKL,IAAA,CAACF,SAAS;EAACQ,UAAU,EAAEL,IAAK;EAAA,GAAKI;AAAK,CAAG,CAAC;;AAElH;AACA;AACA;AACA;AACA,OAAO,MAAMR,KAAK,GAAGF,EAAE,CAACS,WAAW,CAAC","ignoreList":[]}
|
|
@@ -34,6 +34,7 @@ export * from "./segmented-control/index.js";
|
|
|
34
34
|
export * from "./skeleton/index.js";
|
|
35
35
|
export * from "./slider/index.js";
|
|
36
36
|
export * from "./spacer/index.js";
|
|
37
|
+
export * from "./stagger/index.js";
|
|
37
38
|
export * from "./surface/index.js";
|
|
38
39
|
export * from "./switch/index.js";
|
|
39
40
|
export * from "./text/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":";;AAAA,cAAc,+BAAsB;AACpC,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,gBAAO;AACrB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,yBAAgB;AAC9B,cAAc,wBAAe;AAC7B,cAAc,oBAAW;AACzB,cAAc,gBAAO;AACrB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,mBAAU;AACxB,cAAc,sBAAa;AAC3B,cAAc,qBAAY;AAC1B,cAAc,yBAAgB;AAC9B,cAAc,oBAAW;AACzB,cAAc,2BAAkB;AAChC,cAAc,4BAAmB;AACjC,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,wBAAe;AAC7B,cAAc,8BAAqB;AACnC,cAAc,qBAAY;AAC1B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,oBAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":";;AAAA,cAAc,+BAAsB;AACpC,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,gBAAO;AACrB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,yBAAgB;AAC9B,cAAc,wBAAe;AAC7B,cAAc,oBAAW;AACzB,cAAc,gBAAO;AACrB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,mBAAU;AACxB,cAAc,sBAAa;AAC3B,cAAc,qBAAY;AAC1B,cAAc,yBAAgB;AAC9B,cAAc,oBAAW;AACzB,cAAc,2BAAkB;AAChC,cAAc,4BAAmB;AACjC,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,wBAAe;AAC7B,cAAc,8BAAqB;AACnC,cAAc,qBAAY;AAC1B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,oBAAW","ignoreList":[]}
|
|
@@ -1,28 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { accessibilityProps, markMotionComponent, splitAccessibility, spring, timing, useSplitSxMotion } from '@hzblj/kara-sx';
|
|
4
|
+
import { opacity, springs, useAppTheme, useReducedMotion, withOpacity } from '@hzblj/kara-theme';
|
|
5
5
|
import { useCallback, useMemo } from 'react';
|
|
6
6
|
import { Platform, Pressable as RNPressable } from 'react-native';
|
|
7
7
|
import Animated, { useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
8
8
|
import { haptics } from "../../haptics/index.js";
|
|
9
9
|
import { splitForRipple } from "../../ripple-clip.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The scale follows the finger on springs, as UIKit's own presses do: down on `interactive`, back on `smooth`, neither
|
|
13
|
+
* with a bounce (a press is not a toy). A spring keeps the speed it has, so a tap let go halfway down eases back instead
|
|
14
|
+
* of turning on the spot, which a timed curve restarted from rest cannot do.
|
|
15
|
+
*/
|
|
16
|
+
const SCALE_IN = spring('interactive');
|
|
17
|
+
const SCALE_OUT = spring('smooth');
|
|
15
18
|
|
|
16
|
-
/** A dim comes in
|
|
17
|
-
const DIM_IN =
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
const DIM_OUT = {
|
|
21
|
-
duration: duration.d200
|
|
22
|
-
};
|
|
19
|
+
/** A dim comes in at once and leaves a little slower, as UIKit's own highlight does. */
|
|
20
|
+
const DIM_IN = timing('micro', 'out');
|
|
21
|
+
const DIM_OUT = timing('quick', 'out');
|
|
23
22
|
const PLATFORM_EFFECT = Platform.OS === 'ios' ? 'scale' : 'none';
|
|
24
23
|
const AnimatedPressable = Animated.createAnimatedComponent(RNPressable);
|
|
25
|
-
|
|
24
|
+
|
|
25
|
+
/** What `animate` covers by default, less the transform. */
|
|
26
|
+
const VISUAL_KEYS = ['bg', 'borderColor', 'opacity'];
|
|
27
|
+
const TRANSFORM_KEYS = new Set(['offsetX', 'offsetY', 'rotate', 'scale']);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The press scale owns the transform, so `animate` leaves it alone: a transition on the same transform would take it
|
|
31
|
+
* back from the press at every re-render. A duration or spring token keeps its timing.
|
|
32
|
+
*/
|
|
33
|
+
const withoutTransform = animate => {
|
|
34
|
+
if (animate === undefined || animate === false) {
|
|
35
|
+
return animate;
|
|
36
|
+
}
|
|
37
|
+
if (animate === true) {
|
|
38
|
+
return {
|
|
39
|
+
keys: VISUAL_KEYS
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (typeof animate === 'string') {
|
|
43
|
+
return animate in springs ? {
|
|
44
|
+
keys: VISUAL_KEYS,
|
|
45
|
+
spring: animate
|
|
46
|
+
} : {
|
|
47
|
+
duration: animate,
|
|
48
|
+
keys: VISUAL_KEYS
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
...animate,
|
|
53
|
+
keys: (animate.keys ?? VISUAL_KEYS).filter(key => !TRANSFORM_KEYS.has(key))
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export const Pressable = markMotionComponent(({
|
|
26
57
|
children,
|
|
27
58
|
disabled = false,
|
|
28
59
|
haptic = false,
|
|
@@ -34,25 +65,34 @@ export const Pressable = ({
|
|
|
34
65
|
testID,
|
|
35
66
|
...props
|
|
36
67
|
}) => {
|
|
37
|
-
const [
|
|
68
|
+
const [accessibility, ownProps] = splitAccessibility(props);
|
|
69
|
+
const reduced = useReducedMotion();
|
|
70
|
+
// With motion reduced the press still shows, and nothing moves: a scale dims instead.
|
|
71
|
+
const effect = reduced && pressEffect === 'scale' ? 'opacity' : pressEffect;
|
|
72
|
+
// Always a Reanimated view (the press effect is one), so the motion props need no latch here.
|
|
73
|
+
const [resolved, motion, rest] = useSplitSxMotion(effect === 'scale' && ownProps.animate !== undefined ? {
|
|
74
|
+
...ownProps,
|
|
75
|
+
animate: withoutTransform(ownProps.animate)
|
|
76
|
+
} : ownProps);
|
|
38
77
|
// 0 at rest, 1 held: one value drives whichever effect is picked, so a change of effect needs no second animation.
|
|
39
78
|
const pressed = useSharedValue(0);
|
|
40
79
|
const feedback = haptic === true ? 'light' : haptic || undefined;
|
|
80
|
+
const a11y = accessibilityProps(accessibility, 'button');
|
|
41
81
|
const dimmed = opacity[pressedOpacity];
|
|
42
82
|
const theme = useAppTheme();
|
|
43
83
|
const isAndroid = Platform.OS === 'android';
|
|
44
84
|
const rStyle = useAnimatedStyle(() => {
|
|
45
|
-
if (
|
|
85
|
+
if (effect === 'scale') {
|
|
46
86
|
return {
|
|
47
87
|
transform: [{
|
|
48
88
|
scale: 1 - (1 - pressedScale) * pressed.value
|
|
49
89
|
}]
|
|
50
90
|
};
|
|
51
91
|
}
|
|
52
|
-
return
|
|
92
|
+
return effect === 'opacity' ? {
|
|
53
93
|
opacity: 1 - (1 - dimmed) * pressed.value
|
|
54
94
|
} : {};
|
|
55
|
-
}, [dimmed,
|
|
95
|
+
}, [dimmed, effect, pressedScale]);
|
|
56
96
|
|
|
57
97
|
// Android's press is Material's: a ripple over the content (the pressed state layer, `onSurface` at 10 %) clipped to
|
|
58
98
|
// the shape by an outer view (`splitForRipple`). The effect, when there is one, moves that outer view, ripple and all.
|
|
@@ -64,18 +104,18 @@ export const Pressable = ({
|
|
|
64
104
|
|
|
65
105
|
// The finger is down: the Taptic Engine has until the release to wake, so the haptic lands with the press.
|
|
66
106
|
const onPressIn = useCallback(() => {
|
|
67
|
-
if (
|
|
68
|
-
pressed.value = withSpring(1,
|
|
69
|
-
} else if (
|
|
107
|
+
if (effect === 'scale') {
|
|
108
|
+
pressed.value = withSpring(1, SCALE_IN);
|
|
109
|
+
} else if (effect === 'opacity') {
|
|
70
110
|
pressed.value = withTiming(1, DIM_IN);
|
|
71
111
|
}
|
|
72
112
|
if (feedback) {
|
|
73
113
|
haptics.prepare(feedback);
|
|
74
114
|
}
|
|
75
|
-
}, [
|
|
115
|
+
}, [effect, feedback, pressed]);
|
|
76
116
|
const onPressOut = useCallback(() => {
|
|
77
|
-
pressed.value =
|
|
78
|
-
}, [
|
|
117
|
+
pressed.value = effect === 'scale' ? withSpring(0, SCALE_OUT) : withTiming(0, DIM_OUT);
|
|
118
|
+
}, [effect, pressed]);
|
|
79
119
|
const onPressWithHaptic = useCallback(() => {
|
|
80
120
|
if (feedback) {
|
|
81
121
|
haptics.play(feedback);
|
|
@@ -84,8 +124,12 @@ export const Pressable = ({
|
|
|
84
124
|
}, [feedback, onPress]);
|
|
85
125
|
if (androidStyle) {
|
|
86
126
|
return /*#__PURE__*/_jsx(Animated.View, {
|
|
87
|
-
|
|
127
|
+
entering: motion.entering,
|
|
128
|
+
exiting: motion.exiting,
|
|
129
|
+
layout: motion.layout,
|
|
130
|
+
style: [androidStyle.outer, motion.style, rStyle],
|
|
88
131
|
children: /*#__PURE__*/_jsx(RNPressable, {
|
|
132
|
+
...a11y,
|
|
89
133
|
android_ripple: ripple,
|
|
90
134
|
disabled: disabled,
|
|
91
135
|
hitSlop: 8,
|
|
@@ -100,15 +144,19 @@ export const Pressable = ({
|
|
|
100
144
|
});
|
|
101
145
|
}
|
|
102
146
|
return /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
147
|
+
...a11y,
|
|
103
148
|
disabled: disabled,
|
|
149
|
+
entering: motion.entering,
|
|
150
|
+
exiting: motion.exiting,
|
|
104
151
|
hitSlop: 8,
|
|
152
|
+
layout: motion.layout,
|
|
105
153
|
onPress: onPressWithHaptic,
|
|
106
154
|
onPressIn: onPressIn,
|
|
107
155
|
onPressOut: onPressOut,
|
|
108
|
-
style: [resolved, rStyle],
|
|
156
|
+
style: [resolved, motion.style, rStyle],
|
|
109
157
|
testID: testID,
|
|
110
158
|
...rest,
|
|
111
159
|
children: children
|
|
112
160
|
});
|
|
113
|
-
};
|
|
161
|
+
});
|
|
114
162
|
//# sourceMappingURL=pressable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["accessibilityProps","markMotionComponent","splitAccessibility","spring","timing","useSplitSxMotion","opacity","springs","useAppTheme","useReducedMotion","withOpacity","useCallback","useMemo","Platform","Pressable","RNPressable","Animated","useAnimatedStyle","useSharedValue","withSpring","withTiming","haptics","splitForRipple","jsx","_jsx","SCALE_IN","SCALE_OUT","DIM_IN","DIM_OUT","PLATFORM_EFFECT","OS","AnimatedPressable","createAnimatedComponent","VISUAL_KEYS","TRANSFORM_KEYS","Set","withoutTransform","animate","undefined","keys","duration","filter","key","has","children","disabled","haptic","onPress","pressEffect","pressedOpacity","pressedScale","ripple","withRipple","testID","props","accessibility","ownProps","reduced","effect","resolved","motion","rest","pressed","feedback","a11y","dimmed","theme","isAndroid","rStyle","transform","scale","value","color","String","foreground","androidStyle","onPressIn","prepare","onPressOut","onPressWithHaptic","play","View","entering","exiting","layout","style","outer","android_ripple","hitSlop","inner"],"sourceRoot":"../../../../src","sources":["atoms/pressable/pressable.tsx"],"mappings":";;AAAA,SAEEA,kBAAkB,EAClBC,mBAAmB,EAEnBC,kBAAkB,EAClBC,MAAM,EACNC,MAAM,EACNC,gBAAgB,QACX,gBAAgB;AACvB,SAAQC,OAAO,EAAmBC,OAAO,EAAEC,WAAW,EAAEC,gBAAgB,EAAEC,WAAW,QAAO,mBAAmB;AAC/G,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAC1C,SAAQC,QAAQ,EAAEC,SAAS,IAAIC,WAAW,QAAuB,cAAc;AAC/E,OAAOC,QAAQ,IAAGC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,UAAU,QAAO,yBAAyB;AAE1G,SAAQC,OAAO,QAAO,wBAAe;AACrC,SAAQC,cAAc,QAAO,sBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGhD;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GAAGtB,MAAM,CAAC,aAAa,CAAC;AACtC,MAAMuB,SAAS,GAAGvB,MAAM,CAAC,QAAQ,CAAC;;AAElC;AACA,MAAMwB,MAAM,GAAGvB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;AACrC,MAAMwB,OAAO,GAAGxB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;AAEtC,MAAMyB,eAAe,GAAGhB,QAAQ,CAACiB,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM;AAEhE,MAAMC,iBAAiB,GAAGf,QAAQ,CAACgB,uBAAuB,CAACjB,WAAW,CAAC;;AAEvE;AACA,MAAMkB,WAAqC,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,CAAC;AAE9E,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAgB,CAAC,SAAS,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o/ui/jetpack-compose';
|
|
4
|
+
import { useAccessibilityModifiers } from '@hzblj/kara-sx';
|
|
4
5
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
5
6
|
import { useHostGuard } from "../../host-context.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export const Progress = ({
|
|
9
|
+
accessibilityLabel,
|
|
8
10
|
circular = false,
|
|
9
11
|
value
|
|
10
12
|
}) => {
|
|
11
13
|
useHostGuard('Progress');
|
|
12
14
|
const theme = useAppTheme();
|
|
13
15
|
const color = theme.color('fill.accent.primary');
|
|
16
|
+
const modifiers = useAccessibilityModifiers({
|
|
17
|
+
accessibilityLabel
|
|
18
|
+
});
|
|
14
19
|
if (circular) {
|
|
15
20
|
return /*#__PURE__*/_jsx(CircularProgressIndicator, {
|
|
16
21
|
color: color,
|
|
22
|
+
modifiers: modifiers,
|
|
17
23
|
progress: value
|
|
18
24
|
});
|
|
19
25
|
}
|
|
20
26
|
return /*#__PURE__*/_jsx(LinearProgressIndicator, {
|
|
21
27
|
color: color,
|
|
28
|
+
modifiers: modifiers,
|
|
22
29
|
progress: value
|
|
23
30
|
});
|
|
24
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CircularProgressIndicator","LinearProgressIndicator","useAppTheme","useHostGuard","jsx","_jsx","Progress","circular","value","theme","color","progress"],"sourceRoot":"../../../../src","sources":["atoms/progress/progress.android.tsx"],"mappings":";;AAAA,SAAQA,yBAAyB,EAAEC,uBAAuB,QAAO,0BAA0B;AAC3F,SAAQC,WAAW,QAAO,mBAAmB;AAE7C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,OAAO,MAAMC,QAA2B,GAAGA,CAAC;EAACC,QAAQ,GAAG,KAAK;EAAEC;AAAoB,CAAC,KAAK;
|
|
1
|
+
{"version":3,"names":["CircularProgressIndicator","LinearProgressIndicator","useAccessibilityModifiers","useAppTheme","useHostGuard","jsx","_jsx","Progress","accessibilityLabel","circular","value","theme","color","modifiers","progress"],"sourceRoot":"../../../../src","sources":["atoms/progress/progress.android.tsx"],"mappings":";;AAAA,SAAQA,yBAAyB,EAAEC,uBAAuB,QAAO,0BAA0B;AAC3F,SAAQC,yBAAyB,QAAO,gBAAgB;AACxD,SAAQC,WAAW,QAAO,mBAAmB;AAE7C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,OAAO,MAAMC,QAA2B,GAAGA,CAAC;EAACC,kBAAkB;EAAEC,QAAQ,GAAG,KAAK;EAAEC;AAAoB,CAAC,KAAK;EAC3GN,YAAY,CAAC,UAAU,CAAC;EACxB,MAAMO,KAAK,GAAGR,WAAW,CAAC,CAAC;EAC3B,MAAMS,KAAK,GAAGD,KAAK,CAACC,KAAK,CAAC,qBAAqB,CAAC;EAChD,MAAMC,SAAS,GAAGX,yBAAyB,CAAC;IAACM;EAAkB,CAAC,CAAC;EAEjE,IAAIC,QAAQ,EAAE;IACZ,oBAAOH,IAAA,CAACN,yBAAyB;MAACY,KAAK,EAAEA,KAAM;MAACC,SAAS,EAAEA,SAAU;MAACC,QAAQ,EAAEJ;IAAM,CAAE,CAAC;EAC3F;EAEA,oBAAOJ,IAAA,CAACL,uBAAuB;IAACW,KAAK,EAAEA,KAAM;IAACC,SAAS,EAAEA,SAAU;IAACC,QAAQ,EAAEJ;EAAM,CAAE,CAAC;AACzF,CAAC","ignoreList":[]}
|
|
@@ -2,18 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import { Gauge, ProgressView } from '@expo/ui/swift-ui';
|
|
4
4
|
import { gaugeStyle, progressViewStyle, tint } from '@expo/ui/swift-ui/modifiers';
|
|
5
|
+
import { useAccessibilityModifiers } from '@hzblj/kara-sx';
|
|
5
6
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
7
|
import { useMemo } from 'react';
|
|
7
8
|
import { useHostGuard } from "../../host-context.js";
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
export const Progress = ({
|
|
11
|
+
accessibilityLabel,
|
|
10
12
|
circular = false,
|
|
11
13
|
value
|
|
12
14
|
}) => {
|
|
13
15
|
useHostGuard('Progress');
|
|
14
16
|
const theme = useAppTheme();
|
|
17
|
+
const accessibilityModifiers = useAccessibilityModifiers({
|
|
18
|
+
accessibilityLabel
|
|
19
|
+
});
|
|
15
20
|
const ring = circular && value !== undefined;
|
|
16
|
-
const modifiers = useMemo(() => [ring ? gaugeStyle('circularCapacity') : progressViewStyle(circular ? 'circular' : 'linear'), tint(theme.color('fill.accent.primary'))], [circular, ring, theme]);
|
|
21
|
+
const modifiers = useMemo(() => [ring ? gaugeStyle('circularCapacity') : progressViewStyle(circular ? 'circular' : 'linear'), tint(theme.color('fill.accent.primary')), ...accessibilityModifiers], [accessibilityModifiers, circular, ring, theme]);
|
|
17
22
|
|
|
18
23
|
// SwiftUI's circular `ProgressView` ignores its value on iOS and spins; a ring that fills is a capacity `Gauge`.
|
|
19
24
|
return ring ? /*#__PURE__*/_jsx(Gauge, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Gauge","ProgressView","gaugeStyle","progressViewStyle","tint","useAppTheme","useMemo","useHostGuard","jsx","_jsx","Progress","circular","value","theme","ring","undefined","modifiers","color"],"sourceRoot":"../../../../src","sources":["atoms/progress/progress.ios.tsx"],"mappings":";;AAAA,SAAQA,KAAK,EAAEC,YAAY,QAAO,mBAAmB;AACrD,SAAQC,UAAU,EAAEC,iBAAiB,EAAEC,IAAI,QAAO,6BAA6B;AAC/E,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,OAAO,QAAO,OAAO;AAE7B,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,OAAO,MAAMC,QAA2B,GAAGA,CAAC;EAACC,QAAQ,GAAG,KAAK;EAAEC;AAAoB,CAAC,KAAK;
|
|
1
|
+
{"version":3,"names":["Gauge","ProgressView","gaugeStyle","progressViewStyle","tint","useAccessibilityModifiers","useAppTheme","useMemo","useHostGuard","jsx","_jsx","Progress","accessibilityLabel","circular","value","theme","accessibilityModifiers","ring","undefined","modifiers","color"],"sourceRoot":"../../../../src","sources":["atoms/progress/progress.ios.tsx"],"mappings":";;AAAA,SAAQA,KAAK,EAAEC,YAAY,QAAO,mBAAmB;AACrD,SAAQC,UAAU,EAAEC,iBAAiB,EAAEC,IAAI,QAAO,6BAA6B;AAC/E,SAAQC,yBAAyB,QAAO,gBAAgB;AACxD,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,OAAO,QAAO,OAAO;AAE7B,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,OAAO,MAAMC,QAA2B,GAAGA,CAAC;EAACC,kBAAkB;EAAEC,QAAQ,GAAG,KAAK;EAAEC;AAAoB,CAAC,KAAK;EAC3GN,YAAY,CAAC,UAAU,CAAC;EACxB,MAAMO,KAAK,GAAGT,WAAW,CAAC,CAAC;EAC3B,MAAMU,sBAAsB,GAAGX,yBAAyB,CAAC;IAACO;EAAkB,CAAC,CAAC;EAE9E,MAAMK,IAAI,GAAGJ,QAAQ,IAAIC,KAAK,KAAKI,SAAS;EAC5C,MAAMC,SAAS,GAAGZ,OAAO,CACvB,MAAM,CACJU,IAAI,GAAGf,UAAU,CAAC,kBAAkB,CAAC,GAAGC,iBAAiB,CAACU,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC,EAC3FT,IAAI,CAACW,KAAK,CAACK,KAAK,CAAC,qBAAqB,CAAC,CAAC,EACxC,GAAGJ,sBAAsB,CAC1B,EACD,CAACA,sBAAsB,EAAEH,QAAQ,EAAEI,IAAI,EAAEF,KAAK,CAChD,CAAC;;EAED;EACA,OAAOE,IAAI,gBACTP,IAAA,CAACV,KAAK;IAACmB,SAAS,EAAEA,SAAU;IAACL,KAAK,EAAEA;EAAM,CAAE,CAAC,gBAE7CJ,IAAA,CAACT,YAAY;IAACkB,SAAS,EAAEA,SAAU;IAACL,KAAK,EAAEA,KAAK,IAAI;EAAK,CAAE,CAC5D;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,40 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { MAX_FONT_SCALE, useAppTheme } from '@hzblj/kara-theme';
|
|
5
|
-
import { Text as RNText
|
|
3
|
+
import { isAnimatedStyle, markMotionComponent, themeKey, useAnimatedLatch, useSplitSxMotion } from '@hzblj/kara-sx';
|
|
4
|
+
import { MAX_FONT_SCALE, useAppTheme, useFontScale } from '@hzblj/kara-theme';
|
|
5
|
+
import { Platform, Text as RNText } from 'react-native';
|
|
6
|
+
import Animated from 'react-native-reanimated';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* A hundredth of a point off every line on iOS, which no one can see and which keeps the last line on screen. React
|
|
10
|
+
* Native measures a paragraph and rounds the height up to the pixel grid, then draws it into the frame Yoga laid out,
|
|
11
|
+
* and that frame can come back a hair short of the exact height (`53.9998` for three 18 pt lines, depending on where
|
|
12
|
+
* the text sits on the page). With `lineHeight` fixed, the lines need exactly 54 and the text container drops the last
|
|
13
|
+
* one, cutting the line before it off mid-word. Lines a hair shorter leave the rounding room to absorb the error.
|
|
14
|
+
*/
|
|
15
|
+
const LINE_HEIGHT_SLACK = Platform.OS === 'ios' ? 0.01 : 0;
|
|
16
|
+
|
|
17
|
+
/** Variants, colours and alignments are few, so the text half of the style is shared like the `sx` half. */
|
|
18
|
+
const MAX_TEXT_STYLES = 512;
|
|
19
|
+
const textStyles = new Map();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The variant at the user's text size, in its colour. React Native scales `fontSize` for the user's setting but leaves
|
|
23
|
+
* `lineHeight` alone, so a grown glyph ends up in an ungrown line and clips. Scaling it here by the same factor keeps
|
|
24
|
+
* the ratio the variant was designed at, and by the same ceiling `maxFontSizeMultiplier` caps the glyph with
|
|
25
|
+
* (`useFontScale` is capped already), so the two cannot disagree.
|
|
26
|
+
*
|
|
27
|
+
* The native tiers need none of this: SwiftUI's `lineSpacing` is extra space *on top of* the font's own line
|
|
28
|
+
* height, which scales with it, and Compose reads `lineHeight` in `sp`.
|
|
29
|
+
*/
|
|
30
|
+
const textStyle = (theme, variant, color, align, fontScale) => {
|
|
31
|
+
const key = `${themeKey(theme)}|${variant}|${color}|${align}|${fontScale}`;
|
|
32
|
+
const existing = textStyles.get(key);
|
|
33
|
+
if (existing) {
|
|
34
|
+
return existing;
|
|
35
|
+
}
|
|
36
|
+
if (textStyles.size >= MAX_TEXT_STYLES) {
|
|
37
|
+
textStyles.clear();
|
|
38
|
+
}
|
|
39
|
+
const typography = theme.typography[variant];
|
|
40
|
+
const style = {
|
|
41
|
+
...typography,
|
|
42
|
+
color: theme.color(color),
|
|
43
|
+
lineHeight: typography.lineHeight * fontScale - LINE_HEIGHT_SLACK
|
|
44
|
+
};
|
|
45
|
+
if (align) {
|
|
46
|
+
style.textAlign = align;
|
|
47
|
+
}
|
|
48
|
+
textStyles.set(key, style);
|
|
49
|
+
return style;
|
|
50
|
+
};
|
|
51
|
+
export const RnText = markMotionComponent(({
|
|
8
52
|
align,
|
|
9
53
|
color = 'content.primary',
|
|
54
|
+
style,
|
|
10
55
|
variant = 'body',
|
|
11
56
|
...props
|
|
12
57
|
}) => {
|
|
13
58
|
const theme = useAppTheme();
|
|
59
|
+
const fontScale = useFontScale();
|
|
14
60
|
// A view style, which a text accepts whole — only React Native's types disagree, on `userSelect`'s width.
|
|
15
|
-
const [sx, rest] =
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const lineHeight = style.lineHeight * Math.min(fontScale, MAX_FONT_SCALE);
|
|
30
|
-
return /*#__PURE__*/_jsx(RNText, {
|
|
61
|
+
const [sx, motion, rest] = useSplitSxMotion(props);
|
|
62
|
+
const animated = useAnimatedLatch(motion.animated || isAnimatedStyle(style), 'RnText');
|
|
63
|
+
const text = textStyle(theme, variant, color, align, fontScale);
|
|
64
|
+
if (!animated) {
|
|
65
|
+
return /*#__PURE__*/_jsx(RNText, {
|
|
66
|
+
maxFontSizeMultiplier: MAX_FONT_SCALE,
|
|
67
|
+
style: [text, sx, style],
|
|
68
|
+
...rest
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/_jsx(Animated.Text, {
|
|
72
|
+
entering: motion.entering,
|
|
73
|
+
exiting: motion.exiting,
|
|
74
|
+
layout: motion.layout,
|
|
31
75
|
maxFontSizeMultiplier: MAX_FONT_SCALE,
|
|
32
|
-
style: [
|
|
33
|
-
color: theme.color(color),
|
|
34
|
-
lineHeight,
|
|
35
|
-
textAlign: align
|
|
36
|
-
}],
|
|
76
|
+
style: [text, sx, motion.style, style],
|
|
37
77
|
...rest
|
|
38
78
|
});
|
|
39
|
-
};
|
|
79
|
+
});
|
|
40
80
|
//# sourceMappingURL=rn-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["isAnimatedStyle","markMotionComponent","themeKey","useAnimatedLatch","useSplitSxMotion","MAX_FONT_SCALE","useAppTheme","useFontScale","Platform","Text","RNText","Animated","jsx","_jsx","LINE_HEIGHT_SLACK","OS","MAX_TEXT_STYLES","textStyles","Map","textStyle","theme","variant","color","align","fontScale","key","existing","get","size","clear","typography","style","lineHeight","textAlign","set","RnText","props","sx","motion","rest","animated","text","maxFontSizeMultiplier","entering","exiting","layout"],"sourceRoot":"../../../../src","sources":["atoms/rn-text/rn-text.tsx"],"mappings":";;AAAA,SACEA,eAAe,EACfC,mBAAmB,EAEnBC,QAAQ,EACRC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mentedControl = ({
|
|
|
30
30
|
const colors = useMemo(() => ({
|
|
31
31
|
activeBorderColor: theme.color('fill.accent.primary'),
|
|
32
32
|
activeContainerColor: theme.color('fill.accent.primary'),
|
|
33
|
-
activeContentColor: theme.color('content.on.
|
|
33
|
+
activeContentColor: theme.color('content.on.accent'),
|
|
34
34
|
disabledActiveBorderColor: theme.color('fill.accent.disabled'),
|
|
35
35
|
disabledActiveContainerColor: theme.color('fill.accent.disabled'),
|
|
36
36
|
disabledActiveContentColor: theme.color('btn.content.disabled'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Host","SegmentedButton","SingleChoiceSegmentedButtonRow","Text","fillMaxWidth","testID","testIdModifier","weight","useAppTheme","useCallback","useMemo","haptics","jsx","_jsx","MATCH_HEIGHT_ONLY","horizontal","vertical","SEGMENT","SegmentedControl","disabled","onChange","selectedIndex","values","theme","colors","activeBorderColor","color","activeContainerColor","activeContentColor","disabledActiveBorderColor","disabledActiveContainerColor","disabledActiveContentColor","disabledInactiveBorderColor","disabledInactiveContentColor","inactiveBorderColor","inactiveContentColor","rowModifiers","select","index","selection","colorScheme","dark","matchContents","seedColor","materialSeed","children","modifiers","map","label","enabled","onClick","selected","Label","style","typography","subheadlineMedium"],"sourceRoot":"../../../../src","sources":["atoms/segmented-control/segmented-control.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,EAAEC,eAAe,EAAEC,8BAA8B,EAAEC,IAAI,QAAO,0BAA0B;AACpG,SAAQC,YAAY,EAAEC,MAAM,IAAIC,cAAc,EAAEC,MAAM,QAAO,oCAAoC;AACjG,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAE1C,SAAQC,OAAO,QAAO,wBAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGrC,MAAMC,iBAAiB,GAAG;EAACC,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAI,CAAC;;AAE7D;AACA,MAAMC,OAAO,GAAG,CAACV,MAAM,CAAC,CAAC,CAAC,CAAC;;AAE3B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMW,gBAA2C,GAAGA,CAAC;EAC1DC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,aAAa;EACbhB,MAAM;EACNiB;AACqB,CAAC,KAAK;EAC3B,MAAMC,KAAK,GAAGf,WAAW,CAAC,CAAC;EAE3B,MAAMgB,MAAM,GAAGd,OAAO,CACpB,OAAO;IACLe,iBAAiB,EAAEF,KAAK,CAACG,KAAK,CAAC,qBAAqB,CAAC;IACrDC,oBAAoB,EAAEJ,KAAK,CAACG,KAAK,CAAC,qBAAqB,CAAC;IACxDE,kBAAkB,EAAEL,KAAK,CAACG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"names":["Host","SegmentedButton","SingleChoiceSegmentedButtonRow","Text","fillMaxWidth","testID","testIdModifier","weight","useAppTheme","useCallback","useMemo","haptics","jsx","_jsx","MATCH_HEIGHT_ONLY","horizontal","vertical","SEGMENT","SegmentedControl","disabled","onChange","selectedIndex","values","theme","colors","activeBorderColor","color","activeContainerColor","activeContentColor","disabledActiveBorderColor","disabledActiveContainerColor","disabledActiveContentColor","disabledInactiveBorderColor","disabledInactiveContentColor","inactiveBorderColor","inactiveContentColor","rowModifiers","select","index","selection","colorScheme","dark","matchContents","seedColor","materialSeed","children","modifiers","map","label","enabled","onClick","selected","Label","style","typography","subheadlineMedium"],"sourceRoot":"../../../../src","sources":["atoms/segmented-control/segmented-control.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,EAAEC,eAAe,EAAEC,8BAA8B,EAAEC,IAAI,QAAO,0BAA0B;AACpG,SAAQC,YAAY,EAAEC,MAAM,IAAIC,cAAc,EAAEC,MAAM,QAAO,oCAAoC;AACjG,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAE1C,SAAQC,OAAO,QAAO,wBAAe;AAAA,SAAAC,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/*#__PURE__*/_jsx(NativeSegmentedControl, {
|
|
32
32
|
activePillColor: theme.color('fill.accent.primary'),
|
|
33
|
-
activeTextColor: theme.color('content.on.
|
|
33
|
+
activeTextColor: theme.color('content.on.accent'),
|
|
34
34
|
disabled: disabled,
|
|
35
35
|
fontFamily: face.fontFamily,
|
|
36
36
|
fontSize: face.fontSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SegmentedControl","NativeSegmentedControl","useAppTheme","useCallback","useMemo","jsx","_jsx","disabled","onChange","selectedIndex","testID","values","theme","face","typography","footnoteMedium","options","map","label","index","value","String","onValueChange","Number","activePillColor","color","activeTextColor","fontFamily","fontSize","inactiveTextColor","selectedValue"],"sourceRoot":"../../../../src","sources":["atoms/segmented-control/segmented-control.ios.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,IAAIC,sBAAsB,QAAO,6BAA6B;AACtF,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI1C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMN,gBAA2C,GAAGA,CAAC;EAC1DO,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,aAAa;EACbC,MAAM;EACNC;AACqB,CAAC,KAAK;EAC3B,MAAMC,KAAK,GAAGV,WAAW,CAAC,CAAC;EAC3B,MAAMW,IAAI,GAAGD,KAAK,CAACE,UAAU,CAACC,cAAc;;EAE5C;EACA,MAAMC,OAAO,GAAGZ,OAAO,CAAC,MAAMO,MAAM,CAACM,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,MAAM;IAACD,KAAK;IAAEE,KAAK,EAAEC,MAAM,CAACF,KAAK;EAAC,CAAC,CAAC,CAAC,EAAE,CAACR,MAAM,CAAC,CAAC;EAEtG,MAAMW,aAAa,GAAGnB,WAAW,CAC9BiB,KAAa,IAAK;IACjB,MAAMD,KAAK,GAAGI,MAAM,CAACH,KAAK,CAAC;IAC3BZ,QAAQ,GAAGW,KAAK,EAAER,MAAM,CAACQ,KAAK,CAAC,IAAI,EAAE,CAAC;EACxC,CAAC,EACD,CAACX,QAAQ,EAAEG,MAAM,CACnB,CAAC;EAED,oBACEL,IAAA,CAACL,sBAAsB;IACrBuB,eAAe,EAAEZ,KAAK,CAACa,KAAK,CAAC,qBAAqB,CAAE;IACpDC,eAAe,EAAEd,KAAK,CAACa,KAAK,CAAC,
|
|
1
|
+
{"version":3,"names":["SegmentedControl","NativeSegmentedControl","useAppTheme","useCallback","useMemo","jsx","_jsx","disabled","onChange","selectedIndex","testID","values","theme","face","typography","footnoteMedium","options","map","label","index","value","String","onValueChange","Number","activePillColor","color","activeTextColor","fontFamily","fontSize","inactiveTextColor","selectedValue"],"sourceRoot":"../../../../src","sources":["atoms/segmented-control/segmented-control.ios.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,IAAIC,sBAAsB,QAAO,6BAA6B;AACtF,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI1C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMN,gBAA2C,GAAGA,CAAC;EAC1DO,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,aAAa;EACbC,MAAM;EACNC;AACqB,CAAC,KAAK;EAC3B,MAAMC,KAAK,GAAGV,WAAW,CAAC,CAAC;EAC3B,MAAMW,IAAI,GAAGD,KAAK,CAACE,UAAU,CAACC,cAAc;;EAE5C;EACA,MAAMC,OAAO,GAAGZ,OAAO,CAAC,MAAMO,MAAM,CAACM,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,MAAM;IAACD,KAAK;IAAEE,KAAK,EAAEC,MAAM,CAACF,KAAK;EAAC,CAAC,CAAC,CAAC,EAAE,CAACR,MAAM,CAAC,CAAC;EAEtG,MAAMW,aAAa,GAAGnB,WAAW,CAC9BiB,KAA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