@hzblj/kara-components 0.6.0 → 0.8.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 +91 -0
- package/README.md +31 -3
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js +42 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.android.js.map +1 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js +19 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.ios.js.map +1 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.types.js +4 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.types.js.map +1 -0
- package/lib/module/atoms/activity-indicator/index.js +2 -1
- package/lib/module/atoms/activity-indicator/index.js.map +1 -1
- package/lib/module/atoms/avatar/avatar.js +2 -4
- package/lib/module/atoms/avatar/avatar.js.map +1 -1
- package/lib/module/atoms/blur-view/blur-view.android.js +100 -0
- package/lib/module/atoms/blur-view/blur-view.android.js.map +1 -0
- package/lib/module/atoms/blur-view/blur-view.ios.js +43 -0
- package/lib/module/atoms/blur-view/blur-view.ios.js.map +1 -0
- package/lib/module/atoms/blur-view/blur-view.types.js +4 -0
- package/lib/module/atoms/blur-view/blur-view.types.js.map +1 -0
- package/lib/module/atoms/blur-view/index.js +5 -0
- package/lib/module/atoms/blur-view/index.js.map +1 -0
- package/lib/module/atoms/checkbox/checkbox.android.js +7 -3
- package/lib/module/atoms/checkbox/checkbox.android.js.map +1 -1
- package/lib/module/atoms/date-picker/date-picker.ios.js +32 -11
- package/lib/module/atoms/date-picker/date-picker.ios.js.map +1 -1
- package/lib/module/atoms/glass-view/glass-view.android.js +36 -5
- package/lib/module/atoms/glass-view/glass-view.android.js.map +1 -1
- package/lib/module/atoms/image/image.js +13 -6
- package/lib/module/atoms/image/image.js.map +1 -1
- package/lib/module/atoms/image/image.types.js +4 -0
- package/lib/module/atoms/image/image.types.js.map +1 -0
- package/lib/module/atoms/image/index.js +1 -0
- package/lib/module/atoms/image/index.js.map +1 -1
- package/lib/module/atoms/index.js +1 -1
- package/lib/module/atoms/index.js.map +1 -1
- package/lib/module/atoms/island/island.android.js +6 -2
- package/lib/module/atoms/island/island.android.js.map +1 -1
- package/lib/module/atoms/island/island.ios.js +5 -2
- package/lib/module/atoms/island/island.ios.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +38 -6
- package/lib/module/atoms/pressable/pressable.js.map +1 -1
- package/lib/module/atoms/rn-flat-list/rn-flat-list.js +10 -9
- package/lib/module/atoms/rn-flat-list/rn-flat-list.js.map +1 -1
- package/lib/module/atoms/rn-section-list/rn-section-list.js +5 -8
- package/lib/module/atoms/rn-section-list/rn-section-list.js.map +1 -1
- package/lib/module/atoms/rn-text/rn-text.js +5 -2
- package/lib/module/atoms/rn-text/rn-text.js.map +1 -1
- package/lib/module/atoms/segmented-control/index.js +1 -1
- package/lib/module/atoms/segmented-control/index.js.map +1 -1
- package/lib/module/atoms/segmented-control/segmented-control.android.js +74 -0
- package/lib/module/atoms/segmented-control/segmented-control.android.js.map +1 -0
- package/lib/module/atoms/segmented-control/segmented-control.ios.js +44 -0
- package/lib/module/atoms/segmented-control/segmented-control.ios.js.map +1 -0
- package/lib/module/atoms/skeleton/skeleton.js +5 -5
- package/lib/module/atoms/skeleton/skeleton.js.map +1 -1
- package/lib/module/atoms/switch/switch.android.js +4 -1
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/atoms/text/text.android.js +5 -2
- package/lib/module/atoms/text/text.android.js.map +1 -1
- package/lib/module/atoms/text/text.ios.js +14 -3
- package/lib/module/atoms/text/text.ios.js.map +1 -1
- package/lib/module/molecules/collapsible/collapsible.android.js +37 -7
- package/lib/module/molecules/collapsible/collapsible.android.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js +2 -8
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js.map +1 -1
- package/lib/module/molecules/pager/pager.android.js +5 -4
- package/lib/module/molecules/pager/pager.android.js.map +1 -1
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js +114 -11
- package/lib/module/molecules/scroll-edge-container/scroll-edge-container.android.js.map +1 -1
- package/lib/module/molecules/search-bar/search-bar.js +15 -2
- package/lib/module/molecules/search-bar/search-bar.js.map +1 -1
- package/lib/module/molecules/stepper/stepper.ios.js +45 -8
- package/lib/module/molecules/stepper/stepper.ios.js.map +1 -1
- package/lib/module/molecules/tooltip/tooltip.android.js +16 -5
- package/lib/module/molecules/tooltip/tooltip.android.js.map +1 -1
- package/lib/module/organisms/action-sheet/action-sheet.android.js +41 -20
- package/lib/module/organisms/action-sheet/action-sheet.android.js.map +1 -1
- package/lib/module/organisms/action-sheet/action-sheet.ios.js +24 -8
- package/lib/module/organisms/action-sheet/action-sheet.ios.js.map +1 -1
- package/lib/module/organisms/alert/alert.ios.js +15 -2
- package/lib/module/organisms/alert/alert.ios.js.map +1 -1
- package/lib/module/organisms/form/form.android.js +22 -9
- package/lib/module/organisms/form/form.android.js.map +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js +125 -11
- package/lib/module/organisms/swipe-actions/swipe-actions.android.js.map +1 -1
- package/lib/module/organisms/swipe-actions/swipe-actions.ios.js +46 -18
- package/lib/module/organisms/swipe-actions/swipe-actions.ios.js.map +1 -1
- package/lib/module/ripple-clip.js +9 -1
- package/lib/module/ripple-clip.js.map +1 -1
- package/lib/module/templates/screen/screen.android.js +31 -10
- package/lib/module/templates/screen/screen.android.js.map +1 -1
- package/lib/typescript/atoms/activity-indicator/activity-indicator.d.ts +1 -3
- package/lib/typescript/atoms/activity-indicator/activity-indicator.ios.d.ts +3 -0
- package/lib/typescript/atoms/activity-indicator/activity-indicator.types.d.ts +17 -0
- package/lib/typescript/atoms/activity-indicator/index.d.ts +1 -0
- package/lib/typescript/atoms/avatar/avatar.types.d.ts +5 -0
- package/lib/typescript/atoms/badge/badge.types.d.ts +3 -0
- package/lib/typescript/atoms/blur-view/blur-view.d.ts +1 -0
- package/lib/typescript/atoms/blur-view/blur-view.ios.d.ts +3 -0
- package/lib/typescript/atoms/blur-view/blur-view.types.d.ts +31 -0
- package/lib/typescript/atoms/blur-view/index.d.ts +2 -0
- package/lib/typescript/atoms/box/a-box.d.ts +1 -1
- package/lib/typescript/atoms/button/button.types.d.ts +12 -0
- package/lib/typescript/atoms/card/card.types.d.ts +6 -0
- package/lib/typescript/atoms/checkbox/checkbox.types.d.ts +5 -0
- package/lib/typescript/atoms/chip/chip.types.d.ts +5 -0
- package/lib/typescript/atoms/color-picker/color-picker.types.d.ts +4 -0
- package/lib/typescript/atoms/date-picker/date-picker.ios.d.ts +6 -1
- package/lib/typescript/atoms/date-picker/date-picker.types.d.ts +14 -0
- package/lib/typescript/atoms/divider/divider.types.d.ts +3 -0
- package/lib/typescript/atoms/fab/fab.types.d.ts +7 -0
- package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +13 -5
- package/lib/typescript/atoms/h-stack/h-stack.types.d.ts +6 -0
- package/lib/typescript/atoms/icon/icon.types.d.ts +8 -0
- package/lib/typescript/atoms/icon-button/icon-button.types.d.ts +5 -0
- package/lib/typescript/atoms/image/image.d.ts +12 -4
- package/lib/typescript/atoms/image/image.types.d.ts +4 -0
- package/lib/typescript/atoms/image/index.d.ts +1 -0
- package/lib/typescript/atoms/index.d.ts +1 -1
- package/lib/typescript/atoms/island/island.types.d.ts +10 -2
- package/lib/typescript/atoms/list/list.types.d.ts +2 -0
- package/lib/typescript/atoms/picker/picker.types.d.ts +12 -0
- package/lib/typescript/atoms/pressable/pressable.types.d.ts +10 -0
- package/lib/typescript/atoms/progress/progress.types.d.ts +6 -0
- package/lib/typescript/atoms/rn-flat-list/rn-flat-list.d.ts +5 -8
- package/lib/typescript/atoms/rn-flat-list/rn-flat-list.types.d.ts +3 -1
- package/lib/typescript/atoms/rn-scroll-view/rn-scroll-view.types.d.ts +4 -0
- package/lib/typescript/atoms/rn-section-list/rn-section-list.d.ts +2 -8
- package/lib/typescript/atoms/rn-section-list/rn-section-list.types.d.ts +3 -1
- package/lib/typescript/atoms/rn-text/rn-text.types.d.ts +10 -1
- package/lib/typescript/atoms/rn-view/rn-view.types.d.ts +2 -0
- package/lib/typescript/atoms/scroll-view/scroll-view.types.d.ts +4 -0
- package/lib/typescript/atoms/segmented-control/segmented-control.d.ts +1 -6
- package/lib/typescript/atoms/segmented-control/segmented-control.ios.d.ts +7 -0
- package/lib/typescript/atoms/segmented-control/segmented-control.types.d.ts +13 -0
- package/lib/typescript/atoms/skeleton/skeleton.types.d.ts +11 -2
- package/lib/typescript/atoms/slider/slider.types.d.ts +7 -0
- package/lib/typescript/atoms/spacer/spacer.types.d.ts +3 -0
- package/lib/typescript/atoms/surface/surface.types.d.ts +7 -0
- package/lib/typescript/atoms/switch/switch.types.d.ts +8 -0
- package/lib/typescript/atoms/text/text.types.d.ts +18 -1
- package/lib/typescript/atoms/text-field/text-field.types.d.ts +12 -0
- package/lib/typescript/atoms/v-stack/v-stack.types.d.ts +9 -0
- package/lib/typescript/atoms/z-stack/z-stack.types.d.ts +8 -0
- package/lib/typescript/molecules/collapsible/collapsible.types.d.ts +8 -0
- package/lib/typescript/molecules/empty-state/empty-state.types.d.ts +5 -0
- package/lib/typescript/molecules/label/label.types.d.ts +6 -0
- package/lib/typescript/molecules/labeled-content/labeled-content.types.d.ts +6 -0
- package/lib/typescript/molecules/link/link.types.d.ts +6 -0
- package/lib/typescript/molecules/list-item/list-item.types.d.ts +9 -0
- package/lib/typescript/molecules/navigation-bar/navigation-bar.types.d.ts +8 -0
- package/lib/typescript/molecules/pager/pager.types.d.ts +2 -0
- package/lib/typescript/molecules/radio-group/radio-group.types.d.ts +10 -0
- package/lib/typescript/molecules/rn-list-item/rn-list-item.types.d.ts +1 -1
- package/lib/typescript/molecules/rn-tooltip/rn-tooltip.types.d.ts +11 -0
- package/lib/typescript/molecules/scroll-edge-container/scroll-edge-container.types.d.ts +7 -2
- package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +8 -0
- package/lib/typescript/molecules/stepper/stepper.ios.d.ts +5 -0
- package/lib/typescript/molecules/stepper/stepper.types.d.ts +10 -0
- package/lib/typescript/molecules/tooltip/tooltip.types.d.ts +12 -0
- package/lib/typescript/organisms/action-sheet/action-sheet.types.d.ts +8 -0
- package/lib/typescript/organisms/alert/alert.types.d.ts +11 -0
- package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +4 -0
- package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +2 -0
- package/lib/typescript/organisms/form/form.types.d.ts +6 -0
- package/lib/typescript/organisms/menu/menu.types.d.ts +17 -0
- package/lib/typescript/organisms/sheet/sheet.types.d.ts +19 -0
- package/lib/typescript/organisms/snackbar/snackbar.types.d.ts +8 -0
- package/lib/typescript/organisms/swipe-actions/swipe-actions.types.d.ts +36 -13
- package/lib/typescript/templates/screen/screen.types.d.ts +9 -0
- package/package.json +5 -7
- package/src/atoms/activity-indicator/activity-indicator.android.tsx +32 -0
- package/src/atoms/activity-indicator/activity-indicator.ios.tsx +15 -0
- package/src/atoms/activity-indicator/activity-indicator.types.ts +20 -0
- package/src/atoms/activity-indicator/index.ts +1 -0
- package/src/atoms/avatar/avatar.tsx +1 -1
- package/src/atoms/avatar/avatar.types.ts +5 -0
- package/src/atoms/badge/badge.types.ts +3 -0
- package/src/atoms/blur-view/blur-view.android.tsx +68 -0
- package/src/atoms/blur-view/blur-view.ios.tsx +37 -0
- package/src/atoms/blur-view/blur-view.types.ts +34 -0
- package/src/atoms/blur-view/index.ts +2 -0
- package/src/atoms/button/button.types.ts +12 -0
- package/src/atoms/card/card.types.ts +6 -0
- package/src/atoms/checkbox/checkbox.android.tsx +7 -3
- package/src/atoms/checkbox/checkbox.types.ts +5 -0
- package/src/atoms/chip/chip.types.ts +5 -0
- package/src/atoms/color-picker/color-picker.types.ts +4 -0
- package/src/atoms/date-picker/date-picker.ios.tsx +33 -13
- package/src/atoms/date-picker/date-picker.types.ts +14 -0
- package/src/atoms/divider/divider.types.ts +3 -0
- package/src/atoms/fab/fab.types.ts +7 -0
- package/src/atoms/glass-view/glass-view.android.tsx +41 -3
- package/src/atoms/glass-view/glass-view.types.ts +13 -5
- package/src/atoms/h-stack/h-stack.types.ts +6 -0
- package/src/atoms/icon/icon.types.ts +8 -0
- package/src/atoms/icon-button/icon-button.types.ts +5 -0
- package/src/atoms/image/image.tsx +11 -12
- package/src/atoms/image/image.types.ts +6 -0
- package/src/atoms/image/index.ts +1 -0
- package/src/atoms/index.ts +1 -1
- package/src/atoms/island/island.android.tsx +10 -2
- package/src/atoms/island/island.ios.tsx +4 -2
- package/src/atoms/island/island.types.ts +10 -2
- package/src/atoms/list/list.types.ts +2 -0
- package/src/atoms/picker/picker.types.ts +12 -0
- package/src/atoms/pressable/pressable.tsx +46 -6
- package/src/atoms/pressable/pressable.types.ts +10 -0
- package/src/atoms/progress/progress.types.ts +6 -0
- package/src/atoms/rn-flat-list/rn-flat-list.tsx +8 -8
- package/src/atoms/rn-flat-list/rn-flat-list.types.ts +3 -1
- package/src/atoms/rn-scroll-view/rn-scroll-view.types.ts +4 -0
- package/src/atoms/rn-section-list/rn-section-list.tsx +5 -8
- package/src/atoms/rn-section-list/rn-section-list.types.ts +3 -1
- package/src/atoms/rn-text/rn-text.tsx +6 -3
- package/src/atoms/rn-text/rn-text.types.ts +15 -5
- package/src/atoms/rn-view/rn-view.types.ts +2 -0
- package/src/atoms/scroll-view/scroll-view.types.ts +4 -0
- package/src/atoms/segmented-control/segmented-control.android.tsx +79 -0
- package/src/atoms/segmented-control/segmented-control.ios.tsx +47 -0
- package/src/atoms/segmented-control/segmented-control.types.ts +13 -0
- package/src/atoms/skeleton/skeleton.tsx +4 -4
- package/src/atoms/skeleton/skeleton.types.ts +11 -2
- package/src/atoms/slider/slider.types.ts +7 -0
- package/src/atoms/spacer/spacer.types.ts +3 -0
- package/src/atoms/surface/surface.types.ts +7 -0
- package/src/atoms/switch/switch.android.tsx +4 -1
- package/src/atoms/switch/switch.types.ts +8 -0
- package/src/atoms/text/text.android.tsx +7 -1
- package/src/atoms/text/text.ios.tsx +14 -3
- package/src/atoms/text/text.types.ts +18 -1
- package/src/atoms/text-field/text-field.types.ts +12 -0
- package/src/atoms/v-stack/v-stack.types.ts +9 -0
- package/src/atoms/z-stack/z-stack.types.ts +8 -0
- package/src/molecules/collapsible/collapsible.android.tsx +47 -7
- package/src/molecules/collapsible/collapsible.types.ts +8 -0
- package/src/molecules/empty-state/empty-state.types.ts +5 -0
- package/src/molecules/label/label.types.ts +6 -0
- package/src/molecules/labeled-content/labeled-content.types.ts +6 -0
- package/src/molecules/link/link.types.ts +6 -0
- package/src/molecules/list-item/list-item.types.ts +9 -0
- package/src/molecules/navigation-bar/navigation-bar.android.tsx +1 -6
- package/src/molecules/navigation-bar/navigation-bar.types.ts +8 -0
- package/src/molecules/pager/pager.android.tsx +4 -1
- package/src/molecules/pager/pager.types.ts +2 -0
- package/src/molecules/radio-group/radio-group.types.ts +10 -0
- package/src/molecules/rn-list-item/rn-list-item.types.ts +1 -1
- package/src/molecules/rn-tooltip/rn-tooltip.types.ts +11 -0
- package/src/molecules/scroll-edge-container/scroll-edge-container.android.tsx +103 -10
- package/src/molecules/scroll-edge-container/scroll-edge-container.types.ts +7 -2
- package/src/molecules/search-bar/search-bar.tsx +9 -2
- package/src/molecules/search-bar/search-bar.types.ts +8 -0
- package/src/molecules/stepper/stepper.ios.tsx +37 -1
- package/src/molecules/stepper/stepper.types.ts +10 -0
- package/src/molecules/tooltip/tooltip.android.tsx +17 -9
- package/src/molecules/tooltip/tooltip.types.ts +12 -0
- package/src/organisms/action-sheet/action-sheet.android.tsx +37 -19
- package/src/organisms/action-sheet/action-sheet.ios.tsx +22 -9
- package/src/organisms/action-sheet/action-sheet.types.ts +8 -0
- package/src/organisms/alert/alert.ios.tsx +11 -1
- package/src/organisms/alert/alert.types.ts +11 -0
- package/src/organisms/context-menu/context-menu.types.ts +4 -0
- package/src/organisms/fab-menu/fab-menu.types.ts +2 -0
- package/src/organisms/form/form.android.tsx +15 -7
- package/src/organisms/form/form.types.ts +6 -0
- package/src/organisms/menu/menu.types.ts +17 -0
- package/src/organisms/sheet/sheet.types.ts +19 -0
- package/src/organisms/snackbar/snackbar.types.ts +8 -0
- package/src/organisms/swipe-actions/swipe-actions.android.tsx +129 -9
- package/src/organisms/swipe-actions/swipe-actions.ios.tsx +45 -11
- package/src/organisms/swipe-actions/swipe-actions.types.ts +37 -14
- package/src/ripple-clip.ts +10 -1
- package/src/templates/screen/screen.android.tsx +33 -12
- package/src/templates/screen/screen.types.ts +9 -0
- package/lib/module/atoms/activity-indicator/activity-indicator.js +0 -14
- package/lib/module/atoms/activity-indicator/activity-indicator.js.map +0 -1
- package/lib/module/atoms/flash-list/flash-list.js +0 -31
- package/lib/module/atoms/flash-list/flash-list.js.map +0 -1
- package/lib/module/atoms/flash-list/flash-list.types.js +0 -4
- package/lib/module/atoms/flash-list/flash-list.types.js.map +0 -1
- package/lib/module/atoms/flash-list/index.js +0 -5
- package/lib/module/atoms/flash-list/index.js.map +0 -1
- package/lib/module/atoms/segmented-control/segmented-control.js +0 -40
- package/lib/module/atoms/segmented-control/segmented-control.js.map +0 -1
- package/lib/typescript/atoms/flash-list/flash-list.d.ts +0 -8
- package/lib/typescript/atoms/flash-list/flash-list.types.d.ts +0 -18
- package/lib/typescript/atoms/flash-list/index.d.ts +0 -2
- package/src/atoms/activity-indicator/activity-indicator.tsx +0 -9
- package/src/atoms/flash-list/flash-list.tsx +0 -28
- package/src/atoms/flash-list/flash-list.types.ts +0 -20
- package/src/atoms/flash-list/index.ts +0 -2
- package/src/atoms/segmented-control/segmented-control.tsx +0 -47
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { sx } from '@hzblj/kara-sx';
|
|
3
4
|
import { duration } from '@hzblj/kara-theme';
|
|
4
5
|
import { Image as ExpoImage } from 'expo-image';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const FADE = {
|
|
8
|
+
duration: duration.d100,
|
|
9
|
+
timing: 'linear'
|
|
10
|
+
};
|
|
11
|
+
const FadingImage = props => /*#__PURE__*/_jsx(ExpoImage, {
|
|
12
|
+
transition: FADE,
|
|
11
13
|
...props
|
|
12
14
|
});
|
|
13
|
-
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* `expo-image` with the `sx` props, the way `Box` is a `View` with them, and the design system's 100 ms linear fade
|
|
18
|
+
* already applied, so a loaded image never pops in. An explicit `transition` wins, and so does an explicit `style`.
|
|
19
|
+
*/
|
|
20
|
+
export const Image = sx(FadingImage);
|
|
14
21
|
//# sourceMappingURL=image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["duration","Image","ExpoImage","jsx","_jsx","
|
|
1
|
+
{"version":3,"names":["sx","duration","Image","ExpoImage","jsx","_jsx","FADE","d100","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,IAAI;EAAEC,MAAM,EAAE;AAAQ,CAAU;AAEjE,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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/image/image.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/image/index.ts"],"mappings":";;AAAA,cAAc,YAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/image/index.ts"],"mappings":";;AAAA,cAAc,YAAS;AACvB,cAAc,kBAAe","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export * from "./activity-indicator/index.js";
|
|
4
4
|
export * from "./avatar/index.js";
|
|
5
5
|
export * from "./badge/index.js";
|
|
6
|
+
export * from "./blur-view/index.js";
|
|
6
7
|
export * from "./box/index.js";
|
|
7
8
|
export * from "./button/index.js";
|
|
8
9
|
export * from "./card/index.js";
|
|
@@ -12,7 +13,6 @@ export * from "./color-picker/index.js";
|
|
|
12
13
|
export * from "./date-picker/index.js";
|
|
13
14
|
export * from "./divider/index.js";
|
|
14
15
|
export * from "./fab/index.js";
|
|
15
|
-
export * from "./flash-list/index.js";
|
|
16
16
|
export * from "./glass-view/index.js";
|
|
17
17
|
export * from "./h-stack/index.js";
|
|
18
18
|
export * from "./icon/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,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,
|
|
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,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Host } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { useSx } from '@hzblj/kara-sx';
|
|
4
5
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
5
6
|
import { HostBoundary } from "../../host-context.js";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -15,14 +16,17 @@ const MATCH_NEITHER = {
|
|
|
15
16
|
export const Island = ({
|
|
16
17
|
children,
|
|
17
18
|
matchContents = true,
|
|
18
|
-
style
|
|
19
|
+
style,
|
|
20
|
+
testID: _testID,
|
|
21
|
+
...sx
|
|
19
22
|
}) => {
|
|
20
23
|
const theme = useAppTheme();
|
|
24
|
+
const resolved = useSx(sx);
|
|
21
25
|
return /*#__PURE__*/_jsx(Host, {
|
|
22
26
|
colorScheme: theme.dark ? 'dark' : 'light',
|
|
23
27
|
matchContents: matchContents ? MATCH_HEIGHT_ONLY : MATCH_NEITHER,
|
|
24
28
|
seedColor: theme.materialSeed,
|
|
25
|
-
style: style,
|
|
29
|
+
style: style ? [resolved, style] : resolved,
|
|
26
30
|
children: /*#__PURE__*/_jsx(HostBoundary, {
|
|
27
31
|
children: children
|
|
28
32
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Host","useAppTheme","HostBoundary","jsx","_jsx","MATCH_HEIGHT_ONLY","horizontal","vertical","MATCH_NEITHER","Island","children","matchContents","style","theme","colorScheme","dark","seedColor","materialSeed"],"sourceRoot":"../../../../src","sources":["atoms/island/island.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,0BAA0B;AAC7C,SAAQC,WAAW,QAAO,mBAAmB;AAE7C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,MAAMC,iBAAiB,GAAG;EAACC,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAI,CAAC;AAE7D,MAAMC,aAAa,GAAG;EAACF,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAK,CAAC;AAE1D,OAAO,MAAME,MAAuB,GAAGA,CAAC;
|
|
1
|
+
{"version":3,"names":["Host","useSx","useAppTheme","HostBoundary","jsx","_jsx","MATCH_HEIGHT_ONLY","horizontal","vertical","MATCH_NEITHER","Island","children","matchContents","style","testID","_testID","sx","theme","resolved","colorScheme","dark","seedColor","materialSeed"],"sourceRoot":"../../../../src","sources":["atoms/island/island.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,0BAA0B;AAC7C,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAAQC,WAAW,QAAO,mBAAmB;AAE7C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,MAAMC,iBAAiB,GAAG;EAACC,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAI,CAAC;AAE7D,MAAMC,aAAa,GAAG;EAACF,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAK,CAAC;AAE1D,OAAO,MAAME,MAAuB,GAAGA,CAAC;EACtCC,QAAQ;EACRC,aAAa,GAAG,IAAI;EACpBC,KAAK;EACLC,MAAM,EAAEC,OAAO;EACf,GAAGC;AACQ,CAAC,KAAK;EACjB,MAAMC,KAAK,GAAGf,WAAW,CAAC,CAAC;EAC3B,MAAMgB,QAAQ,GAAGjB,KAAK,CAACe,EAAE,CAAC;EAE1B,oBACEX,IAAA,CAACL,IAAI;IACHmB,WAAW,EAAEF,KAAK,CAACG,IAAI,GAAG,MAAM,GAAG,OAAQ;IAC3CR,aAAa,EAAEA,aAAa,GAAGN,iBAAiB,GAAGG,aAAc;IACjEY,SAAS,EAAEJ,KAAK,CAACK,YAAa;IAC9BT,KAAK,EAAEA,KAAK,GAAG,CAACK,QAAQ,EAAEL,KAAK,CAAC,GAAGK,QAAS;IAAAP,QAAA,eAE5CN,IAAA,CAACF,YAAY;MAAAQ,QAAA,EAAEA;IAAQ,CAAe;EAAC,CACnC,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Host } from '@expo/ui/swift-ui';
|
|
4
4
|
import { dynamicTypeSize } from '@expo/ui/swift-ui/modifiers';
|
|
5
|
+
import { useSx } from '@hzblj/kara-sx';
|
|
5
6
|
import { MAX_DYNAMIC_TYPE_SIZE, useAppTheme } from '@hzblj/kara-theme';
|
|
6
7
|
import { HostBoundary } from "../../host-context.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -20,15 +21,17 @@ export const Island = ({
|
|
|
20
21
|
children,
|
|
21
22
|
matchContents = true,
|
|
22
23
|
style,
|
|
23
|
-
testID
|
|
24
|
+
testID,
|
|
25
|
+
...sx
|
|
24
26
|
}) => {
|
|
25
27
|
const theme = useAppTheme();
|
|
28
|
+
const resolved = useSx(sx);
|
|
26
29
|
return /*#__PURE__*/_jsx(Host, {
|
|
27
30
|
colorScheme: theme.dark ? 'dark' : 'light',
|
|
28
31
|
matchContents: matchContents ? MATCH_HEIGHT_ONLY : MATCH_NEITHER,
|
|
29
32
|
modifiers: DYNAMIC_TYPE_CAP,
|
|
30
33
|
seedColor: theme.materialSeed,
|
|
31
|
-
style: style,
|
|
34
|
+
style: style ? [resolved, style] : resolved,
|
|
32
35
|
testID: testID,
|
|
33
36
|
children: /*#__PURE__*/_jsx(HostBoundary, {
|
|
34
37
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Host","dynamicTypeSize","MAX_DYNAMIC_TYPE_SIZE","useAppTheme","HostBoundary","jsx","_jsx","DYNAMIC_TYPE_CAP","max","MATCH_HEIGHT_ONLY","horizontal","vertical","MATCH_NEITHER","Island","children","matchContents","style","testID","theme","colorScheme","dark","modifiers","seedColor","materialSeed"],"sourceRoot":"../../../../src","sources":["atoms/island/island.ios.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,mBAAmB;AACtC,SAAQC,eAAe,QAAO,6BAA6B;AAC3D,SAAQC,qBAAqB,EAAEC,WAAW,QAAO,mBAAmB;AAEpE,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,MAAMC,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"names":["Host","dynamicTypeSize","useSx","MAX_DYNAMIC_TYPE_SIZE","useAppTheme","HostBoundary","jsx","_jsx","DYNAMIC_TYPE_CAP","max","MATCH_HEIGHT_ONLY","horizontal","vertical","MATCH_NEITHER","Island","children","matchContents","style","testID","sx","theme","resolved","colorScheme","dark","modifiers","seedColor","materialSeed"],"sourceRoot":"../../../../src","sources":["atoms/island/island.ios.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,mBAAmB;AACtC,SAAQC,eAAe,QAAO,6BAA6B;AAC3D,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAAQC,qBAAqB,EAAEC,WAAW,QAAO,mBAAmB;AAEpE,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C,MAAMC,gBAAgB,GAAG,CAACP,eAAe,CAAC;EAACQ,GAAG,EAAEN;AAAqB,CAAC,CAAC,CAAC;AAExE,MAAMO,iBAAiB,GAAG;EAACC,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAI,CAAC;AAE7D,MAAMC,aAAa,GAAG;EAACF,UAAU,EAAE,KAAK;EAAEC,QAAQ,EAAE;AAAK,CAAC;AAE1D,OAAO,MAAME,MAAuB,GAAGA,CAAC;EAACC,QAAQ;EAAEC,aAAa,GAAG,IAAI;EAAEC,KAAK;EAAEC,MAAM;EAAE,GAAGC;AAAe,CAAC,KAAK;EAC9G,MAAMC,KAAK,GAAGhB,WAAW,CAAC,CAAC;EAC3B,MAAMiB,QAAQ,GAAGnB,KAAK,CAACiB,EAAE,CAAC;EAE1B,oBACEZ,IAAA,CAACP,IAAI;IACHsB,WAAW,EAAEF,KAAK,CAACG,IAAI,GAAG,MAAM,GAAG,OAAQ;IAC3CP,aAAa,EAAEA,aAAa,GAAGN,iBAAiB,GAAGG,aAAc;IACjEW,SAAS,EAAEhB,gBAAiB;IAC5BiB,SAAS,EAAEL,KAAK,CAACM,YAAa;IAC9BT,KAAK,EAAEA,KAAK,GAAG,CAACI,QAAQ,EAAEJ,KAAK,CAAC,GAAGI,QAAS;IAC5CH,MAAM,EAAEA,MAAO;IAAAH,QAAA,eAEfR,IAAA,CAACF,YAAY;MAAAU,QAAA,EAAEA;IAAQ,CAAe;EAAC,CACnC,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useSplitSx } from '@hzblj/kara-sx';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useAppTheme, withOpacity } from '@hzblj/kara-theme';
|
|
5
|
+
import { useCallback, useMemo } from 'react';
|
|
6
|
+
import { Platform, Pressable as RNPressable, View } from 'react-native';
|
|
6
7
|
import Animated, { useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
|
7
8
|
import { haptics } from "../../haptics/index.js";
|
|
9
|
+
import { splitForRipple } from "../../ripple-clip.js";
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
11
|
const SPRING = {
|
|
10
12
|
damping: 20,
|
|
@@ -22,28 +24,58 @@ export const Pressable = ({
|
|
|
22
24
|
const [resolved, rest] = useSplitSx(props);
|
|
23
25
|
const scale = useSharedValue(1);
|
|
24
26
|
const feedback = haptic === true ? 'light' : haptic || undefined;
|
|
27
|
+
const theme = useAppTheme();
|
|
28
|
+
const isAndroid = Platform.OS === 'android';
|
|
25
29
|
const rStyle = useAnimatedStyle(() => ({
|
|
26
30
|
transform: [{
|
|
27
31
|
scale: scale.value
|
|
28
32
|
}]
|
|
29
33
|
}), []);
|
|
30
34
|
|
|
35
|
+
// Android's press is Material's: a ripple over the content — the pressed state layer, `onSurface` at 10 % — clipped to
|
|
36
|
+
// the shape by an outer view (`splitForRipple`), and nothing moves. iOS springs down.
|
|
37
|
+
const ripple = useMemo(() => isAndroid ? {
|
|
38
|
+
color: withOpacity(String(theme.color('content.primary')), 'o10'),
|
|
39
|
+
foreground: true
|
|
40
|
+
} : undefined, [isAndroid, theme]);
|
|
41
|
+
const androidStyle = useMemo(() => isAndroid ? splitForRipple(resolved) : undefined, [isAndroid, resolved]);
|
|
42
|
+
|
|
31
43
|
// The finger is down: the Taptic Engine has until the release to wake, so the haptic lands with the press.
|
|
32
44
|
const onPressIn = useCallback(() => {
|
|
33
|
-
|
|
45
|
+
if (!isAndroid) {
|
|
46
|
+
scale.value = withSpring(0.96, SPRING);
|
|
47
|
+
}
|
|
34
48
|
if (feedback) {
|
|
35
49
|
haptics.prepare(feedback);
|
|
36
50
|
}
|
|
37
|
-
}, [feedback, scale]);
|
|
51
|
+
}, [feedback, isAndroid, scale]);
|
|
38
52
|
const onPressOut = useCallback(() => {
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
if (!isAndroid) {
|
|
54
|
+
scale.value = withSpring(1, SPRING);
|
|
55
|
+
}
|
|
56
|
+
}, [isAndroid, scale]);
|
|
41
57
|
const onPressWithHaptic = useCallback(() => {
|
|
42
58
|
if (feedback) {
|
|
43
59
|
haptics.play(feedback);
|
|
44
60
|
}
|
|
45
61
|
onPress?.();
|
|
46
62
|
}, [feedback, onPress]);
|
|
63
|
+
if (androidStyle) {
|
|
64
|
+
return /*#__PURE__*/_jsx(View, {
|
|
65
|
+
style: androidStyle.outer,
|
|
66
|
+
children: /*#__PURE__*/_jsx(RNPressable, {
|
|
67
|
+
android_ripple: ripple,
|
|
68
|
+
disabled: disabled,
|
|
69
|
+
hitSlop: 8,
|
|
70
|
+
onPress: onPressWithHaptic,
|
|
71
|
+
onPressIn: onPressIn,
|
|
72
|
+
style: androidStyle.inner,
|
|
73
|
+
testID: testID,
|
|
74
|
+
...rest,
|
|
75
|
+
children: children
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
}
|
|
47
79
|
return /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
48
80
|
disabled: disabled,
|
|
49
81
|
hitSlop: 8,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSplitSx","useCallback","Pressable","RNPressable","Animated","useAnimatedStyle","useSharedValue","withSpring","haptics","jsx","_jsx","SPRING","damping","stiffness","AnimatedPressable","createAnimatedComponent","children","disabled","haptic","onPress","testID","props","resolved","rest","scale","feedback","undefined","rStyle","transform","value","onPressIn","prepare","onPressOut","onPressWithHaptic","play","hitSlop","
|
|
1
|
+
{"version":3,"names":["useSplitSx","useAppTheme","withOpacity","useCallback","useMemo","Platform","Pressable","RNPressable","View","Animated","useAnimatedStyle","useSharedValue","withSpring","haptics","splitForRipple","jsx","_jsx","SPRING","damping","stiffness","AnimatedPressable","createAnimatedComponent","children","disabled","haptic","onPress","testID","props","resolved","rest","scale","feedback","undefined","theme","isAndroid","OS","rStyle","transform","value","ripple","color","String","foreground","androidStyle","onPressIn","prepare","onPressOut","onPressWithHaptic","play","style","outer","android_ripple","hitSlop","inner"],"sourceRoot":"../../../../src","sources":["atoms/pressable/pressable.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -7,14 +7,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
const NO_SX = {};
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* ends up drawn where the layout no longer is. `VirtualizedList` renders its cells in normal flow
|
|
16
|
-
* inside a scroll view, using blank spacers for the range it has not rendered, so a hosted view stays
|
|
17
|
-
* exactly where the layout put it. This is `SectionList`'s reason to exist too, without the sections.
|
|
10
|
+
* kara's list for React Native content: React Native's own `VirtualizedList`, styled through `sx`. It renders its
|
|
11
|
+
* cells in normal flow inside a scroll view, with blank spacers for the range it has not rendered, so a row that hosts
|
|
12
|
+
* native views keeps them where the layout put it. A recycling list (absolutely positioned, reused cells) cannot
|
|
13
|
+
* promise that — an `@expo/ui` host survives neither, and draws where the layout no longer is — which is why kara
|
|
14
|
+
* ships none.
|
|
18
15
|
*/
|
|
19
16
|
export const RnFlatList = ({
|
|
20
17
|
content,
|
|
@@ -25,7 +22,11 @@ export const RnFlatList = ({
|
|
|
25
22
|
const [style, rest] = useSplitSx(props);
|
|
26
23
|
const contentStyle = useSx(content ?? NO_SX);
|
|
27
24
|
return /*#__PURE__*/_jsx(RNFlatList, {
|
|
28
|
-
data: data
|
|
25
|
+
data: data
|
|
26
|
+
// Android clips by default, and a host is measured after its first layout — at zero height it counts as
|
|
27
|
+
// off-screen, is detached, and its native view never comes back.
|
|
28
|
+
,
|
|
29
|
+
removeClippedSubviews: false,
|
|
29
30
|
renderItem: renderItem,
|
|
30
31
|
...rest,
|
|
31
32
|
contentContainerStyle: content === undefined ? undefined : contentStyle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSplitSx","useSx","FlatList","RNFlatList","jsx","_jsx","NO_SX","RnFlatList","content","data","renderItem","props","style","rest","contentStyle","contentContainerStyle","undefined"],"sourceRoot":"../../../../src","sources":["atoms/rn-flat-list/rn-flat-list.tsx"],"mappings":";;AAAA,SAAQA,UAAU,EAAEC,KAAK,QAAO,gBAAgB;AAChD,SAAQC,QAAQ,IAAIC,UAAU,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAInD;AACA,MAAMC,KAAK,GAAG,CAAC,CAAC;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["useSplitSx","useSx","FlatList","RNFlatList","jsx","_jsx","NO_SX","RnFlatList","content","data","renderItem","props","style","rest","contentStyle","removeClippedSubviews","contentContainerStyle","undefined"],"sourceRoot":"../../../../src","sources":["atoms/rn-flat-list/rn-flat-list.tsx"],"mappings":";;AAAA,SAAQA,UAAU,EAAEC,KAAK,QAAO,gBAAgB;AAChD,SAAQC,QAAQ,IAAIC,UAAU,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAInD;AACA,MAAMC,KAAK,GAAG,CAAC,CAAC;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAAS;EAACC,OAAO;EAAEC,IAAI;EAAEC,UAAU;EAAE,GAAGC;AAA6B,CAAC,KAAK;EACnG,MAAM,CAACC,KAAK,EAAEC,IAAI,CAAC,GAAGb,UAAU,CAACW,KAAgC,CAAC;EAClE,MAAMG,YAAY,GAAGb,KAAK,CAACO,OAAO,IAAIF,KAAK,CAAC;EAE5C,oBACED,IAAA,CAACF,UAAU;IACTM,IAAI,EAAEA;IACN;IACA;IAAA;IACAM,qBAAqB,EAAE,KAAM;IAC7BL,UAAU,EAAEA,UAAW;IAAA,GACnBG,IAAI;IACRG,qBAAqB,EAAER,OAAO,KAAKS,SAAS,GAAGA,SAAS,GAAGH,YAAa;IACxEF,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -7,14 +7,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
const NO_SX = {};
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* FlashList is the default for lists in this codebase and should stay that way for data rows. This
|
|
13
|
-
* exists for the case it cannot serve: content that hosts native views. FlashList positions its rows
|
|
14
|
-
* absolutely and recycles their cells, and an `@expo/ui` host does not survive either — the hosted
|
|
15
|
-
* view ends up drawn where the layout no longer is. `VirtualizedList` renders its cells in normal flow
|
|
16
|
-
* inside a scroll view, using blank spacers for the range it has not rendered, so a hosted view stays
|
|
17
|
-
* exactly where the layout put it.
|
|
10
|
+
* `RnFlatList` with sections: React Native's own `VirtualizedList`, cells in normal flow inside a scroll view, so a
|
|
11
|
+
* row that hosts native views keeps them where the layout put it.
|
|
18
12
|
*
|
|
19
13
|
* Sticky headers default off, unlike React Native, where they are on for vertical lists. A header that
|
|
20
14
|
* detaches and floats over the content is a deliberate effect, not something a list should do unasked.
|
|
@@ -28,6 +22,9 @@ export const RnSectionList = ({
|
|
|
28
22
|
const [style, rest] = useSplitSx(props);
|
|
29
23
|
const contentStyle = useSx(content ?? NO_SX);
|
|
30
24
|
return /*#__PURE__*/_jsx(RNSectionList, {
|
|
25
|
+
// Android clips by default, and a host is measured after its first layout — at zero height it counts as
|
|
26
|
+
// off-screen, is detached, and its native view never comes back.
|
|
27
|
+
removeClippedSubviews: false,
|
|
31
28
|
sections: sections,
|
|
32
29
|
...rest,
|
|
33
30
|
contentContainerStyle: content === undefined ? undefined : contentStyle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSplitSx","useSx","SectionList","RNSectionList","jsx","_jsx","NO_SX","RnSectionList","content","sections","stickySectionHeadersEnabled","props","style","rest","contentStyle","contentContainerStyle","undefined"],"sourceRoot":"../../../../src","sources":["atoms/rn-section-list/rn-section-list.tsx"],"mappings":";;AAAA,SAAQA,UAAU,EAAEC,KAAK,QAAO,gBAAgB;AAChD,SAA8BC,WAAW,IAAIC,aAAa,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI/E;AACA,MAAMC,KAAK,GAAG,CAAC,CAAC;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["useSplitSx","useSx","SectionList","RNSectionList","jsx","_jsx","NO_SX","RnSectionList","content","sections","stickySectionHeadersEnabled","props","style","rest","contentStyle","removeClippedSubviews","contentContainerStyle","undefined"],"sourceRoot":"../../../../src","sources":["atoms/rn-section-list/rn-section-list.tsx"],"mappings":";;AAAA,SAAQA,UAAU,EAAEC,KAAK,QAAO,gBAAgB;AAChD,SAA8BC,WAAW,IAAIC,aAAa,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI/E;AACA,MAAMC,KAAK,GAAG,CAAC,CAAC;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGA,CAAoC;EAC/DC,OAAO;EACPC,QAAQ;EACRC,2BAA2B,GAAG,KAAK;EACnC,GAAGC;AACgC,CAAC,KAAK;EACzC,MAAM,CAACC,KAAK,EAAEC,IAAI,CAAC,GAAGb,UAAU,CAACW,KAAgC,CAAC;EAClE,MAAMG,YAAY,GAAGb,KAAK,CAACO,OAAO,IAAIF,KAAK,CAAC;EAE5C,oBACED,IAAA,CAACF,aAAa;IACZ;IACA;IACAY,qBAAqB,EAAE,KAAM;IAC7BN,QAAQ,EAAEA,QAAS;IAAA,GACfI,IAAI;IACRG,qBAAqB,EAAER,OAAO,KAAKS,SAAS,GAAGA,SAAS,GAAGH,YAAa;IACxEJ,2BAA2B,EAAEA,2BAA4B;IACzDE,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { useSplitSx } from '@hzblj/kara-sx';
|
|
3
4
|
import { MAX_FONT_SCALE, useAppTheme } from '@hzblj/kara-theme';
|
|
4
5
|
import { Text as RNText, useWindowDimensions } from 'react-native';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -10,6 +11,8 @@ export const RnText = ({
|
|
|
10
11
|
...props
|
|
11
12
|
}) => {
|
|
12
13
|
const theme = useAppTheme();
|
|
14
|
+
// A view style, which a text accepts whole — only React Native's types disagree, on `userSelect`'s width.
|
|
15
|
+
const [sx, rest] = useSplitSx(props);
|
|
13
16
|
const {
|
|
14
17
|
fontScale
|
|
15
18
|
} = useWindowDimensions();
|
|
@@ -26,12 +29,12 @@ export const RnText = ({
|
|
|
26
29
|
const lineHeight = style.lineHeight * Math.min(fontScale, MAX_FONT_SCALE);
|
|
27
30
|
return /*#__PURE__*/_jsx(RNText, {
|
|
28
31
|
maxFontSizeMultiplier: MAX_FONT_SCALE,
|
|
29
|
-
style: [style, {
|
|
32
|
+
style: [style, sx, {
|
|
30
33
|
color: theme.color(color),
|
|
31
34
|
lineHeight,
|
|
32
35
|
textAlign: align
|
|
33
36
|
}],
|
|
34
|
-
...
|
|
37
|
+
...rest
|
|
35
38
|
});
|
|
36
39
|
};
|
|
37
40
|
//# sourceMappingURL=rn-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MAX_FONT_SCALE","useAppTheme","Text","RNText","useWindowDimensions","jsx","_jsx","RnText","align","color","variant","props","theme","fontScale","style","typography","lineHeight","Math","min","maxFontSizeMultiplier","textAlign"],"sourceRoot":"../../../../src","sources":["atoms/rn-text/rn-text.tsx"],"mappings":";;AAAA,SAAQA,cAAc,EAAEC,WAAW,QAAO,mBAAmB;AAC7D,SAAQC,IAAI,IAAIC,MAAM,
|
|
1
|
+
{"version":3,"names":["useSplitSx","MAX_FONT_SCALE","useAppTheme","Text","RNText","useWindowDimensions","jsx","_jsx","RnText","align","color","variant","props","theme","sx","rest","fontScale","style","typography","lineHeight","Math","min","maxFontSizeMultiplier","textAlign"],"sourceRoot":"../../../../src","sources":["atoms/rn-text/rn-text.tsx"],"mappings":";;AAAA,SAAQA,UAAU,QAAO,gBAAgB;AACzC,SAAQC,cAAc,EAAEC,WAAW,QAAO,mBAAmB;AAC7D,SAAQC,IAAI,IAAIC,MAAM,EAAkBC,mBAAmB,QAAO,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIhF,OAAO,MAAMC,MAAuB,GAAGA,CAAC;EACtCC,KAAK;EACLC,KAAK,GAAG,iBAAiB;EACzBC,OAAO,GAAG,MAAM;EAChB,GAAGC;AACQ,CAAC,KAAK;EACjB,MAAMC,KAAK,GAAGX,WAAW,CAAC,CAAC;EAC3B;EACA,MAAM,CAACY,EAAE,EAAEC,IAAI,CAAC,GAAGf,UAAU,CAACY,KAAK,CAAyC;EAC5E,MAAM;IAACI;EAAS,CAAC,GAAGX,mBAAmB,CAAC,CAAC;EACzC,MAAMY,KAAK,GAAGJ,KAAK,CAACK,UAAU,CAACP,OAAO,CAAC;;EAEvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMQ,UAAU,GAAGF,KAAK,CAACE,UAAU,GAAGC,IAAI,CAACC,GAAG,CAACL,SAAS,EAAEf,cAAc,CAAC;EAEzE,oBACEM,IAAA,CAACH,MAAM;IACLkB,qBAAqB,EAAErB,cAAe;IACtCgB,KAAK,EAAE,CAACA,KAAK,EAAEH,EAAE,EAAE;MAACJ,KAAK,EAAEG,KAAK,CAACH,KAAK,CAACA,KAAK,CAAC;MAAES,UAAU;MAAEI,SAAS,EAAEd;IAAK,CAAC,CAAE;IAAA,GAC1EM;EAAI,CACT,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/segmented-control/index.ts"],"mappings":";;AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/segmented-control/index.ts"],"mappings":";;AAAA,cAAc,qBAAqB;AACnC,cAAc,8BAA2B","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Host, SegmentedButton, SingleChoiceSegmentedButtonRow, Text } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { fillMaxWidth, testID as testIdModifier, weight } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
+
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
+
import { useCallback, useMemo } from 'react';
|
|
7
|
+
import { haptics } from "../../haptics/index.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const MATCH_HEIGHT_ONLY = {
|
|
10
|
+
horizontal: false,
|
|
11
|
+
vertical: true
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** Every segment the same width, like UIKit's: Material's would size each to its label. */
|
|
15
|
+
const SEGMENT = [weight(1)];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Material's single-choice segmented buttons, the selected one filled with the accent like a checked `Switch`. Its own
|
|
19
|
+
* host, themed like an `Island`, so it drops into React Native layout the way the iOS control does. Material plays
|
|
20
|
+
* nothing on a new segment, so this plays `selection`.
|
|
21
|
+
*/
|
|
22
|
+
export const SegmentedControl = ({
|
|
23
|
+
disabled = false,
|
|
24
|
+
onChange,
|
|
25
|
+
selectedIndex,
|
|
26
|
+
testID,
|
|
27
|
+
values
|
|
28
|
+
}) => {
|
|
29
|
+
const theme = useAppTheme();
|
|
30
|
+
const colors = useMemo(() => ({
|
|
31
|
+
activeBorderColor: theme.color('fill.accent.primary'),
|
|
32
|
+
activeContainerColor: theme.color('fill.accent.primary'),
|
|
33
|
+
activeContentColor: theme.color('content.on.bg'),
|
|
34
|
+
disabledActiveBorderColor: theme.color('fill.accent.disabled'),
|
|
35
|
+
disabledActiveContainerColor: theme.color('fill.accent.disabled'),
|
|
36
|
+
disabledActiveContentColor: theme.color('btn.content.disabled'),
|
|
37
|
+
disabledInactiveBorderColor: theme.color('border.tertiary'),
|
|
38
|
+
disabledInactiveContentColor: theme.color('btn.content.disabled'),
|
|
39
|
+
inactiveBorderColor: theme.color('border.secondary.base'),
|
|
40
|
+
inactiveContentColor: theme.color('content.primary')
|
|
41
|
+
}), [theme]);
|
|
42
|
+
const rowModifiers = useMemo(() => testID ? [fillMaxWidth(), testIdModifier(testID)] : [fillMaxWidth()], [testID]);
|
|
43
|
+
|
|
44
|
+
// Material reports a tap on the segment that is already selected too; iOS does not, and neither does this.
|
|
45
|
+
const select = useCallback(index => {
|
|
46
|
+
if (index === selectedIndex) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
haptics.selection();
|
|
50
|
+
onChange?.(index, values[index] ?? '');
|
|
51
|
+
}, [onChange, selectedIndex, values]);
|
|
52
|
+
return /*#__PURE__*/_jsx(Host, {
|
|
53
|
+
colorScheme: theme.dark ? 'dark' : 'light',
|
|
54
|
+
matchContents: MATCH_HEIGHT_ONLY,
|
|
55
|
+
seedColor: theme.materialSeed,
|
|
56
|
+
children: /*#__PURE__*/_jsx(SingleChoiceSegmentedButtonRow, {
|
|
57
|
+
modifiers: rowModifiers,
|
|
58
|
+
children: values.map((label, index) => /*#__PURE__*/_jsx(SegmentedButton, {
|
|
59
|
+
colors: colors,
|
|
60
|
+
enabled: !disabled,
|
|
61
|
+
modifiers: SEGMENT,
|
|
62
|
+
onClick: () => select(index),
|
|
63
|
+
selected: index === selectedIndex,
|
|
64
|
+
children: /*#__PURE__*/_jsx(SegmentedButton.Label, {
|
|
65
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
66
|
+
style: theme.typography.subheadlineMedium,
|
|
67
|
+
children: label
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}, index))
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=segmented-control.android.js.map
|
|
@@ -0,0 +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,eAAe,CAAC;IAChDG,yBAAyB,EAAEN,KAAK,CAACG,KAAK,CAAC,sBAAsB,CAAC;IAC9DI,4BAA4B,EAAEP,KAAK,CAACG,KAAK,CAAC,sBAAsB,CAAC;IACjEK,0BAA0B,EAAER,KAAK,CAACG,KAAK,CAAC,sBAAsB,CAAC;IAC/DM,2BAA2B,EAAET,KAAK,CAACG,KAAK,CAAC,iBAAiB,CAAC;IAC3DO,4BAA4B,EAAEV,KAAK,CAACG,KAAK,CAAC,sBAAsB,CAAC;IACjEQ,mBAAmB,EAAEX,KAAK,CAACG,KAAK,CAAC,uBAAuB,CAAC;IACzDS,oBAAoB,EAAEZ,KAAK,CAACG,KAAK,CAAC,iBAAiB;EACrD,CAAC,CAAC,EACF,CAACH,KAAK,CACR,CAAC;EAED,MAAMa,YAAY,GAAG1B,OAAO,CAAC,MAAOL,MAAM,GAAG,CAACD,YAAY,CAAC,CAAC,EAAEE,cAAc,CAACD,MAAM,CAAC,CAAC,GAAG,CAACD,YAAY,CAAC,CAAC,CAAE,EAAE,CAACC,MAAM,CAAC,CAAC;;EAEpH;EACA,MAAMgC,MAAM,GAAG5B,WAAW,CACvB6B,KAAa,IAAK;IACjB,IAAIA,KAAK,KAAKjB,aAAa,EAAE;MAC3B;IACF;IAEAV,OAAO,CAAC4B,SAAS,CAAC,CAAC;IACnBnB,QAAQ,GAAGkB,KAAK,EAAEhB,MAAM,CAACgB,KAAK,CAAC,IAAI,EAAE,CAAC;EACxC,CAAC,EACD,CAAClB,QAAQ,EAAEC,aAAa,EAAEC,MAAM,CAClC,CAAC;EAED,oBACET,IAAA,CAACb,IAAI;IAACwC,WAAW,EAAEjB,KAAK,CAACkB,IAAI,GAAG,MAAM,GAAG,OAAQ;IAACC,aAAa,EAAE5B,iBAAkB;IAAC6B,SAAS,EAAEpB,KAAK,CAACqB,YAAa;IAAAC,QAAA,eAChHhC,IAAA,CAACX,8BAA8B;MAAC4C,SAAS,EAAEV,YAAa;MAAAS,QAAA,EACrDvB,MAAM,CAACyB,GAAG,CAAC,CAACC,KAAK,EAAEV,KAAK,kBACvBzB,IAAA,CAACZ,eAAe;QACduB,MAAM,EAAEA,MAAO;QACfyB,OAAO,EAAE,CAAC9B,QAAS;QAEnB2B,SAAS,EAAE7B,OAAQ;QACnBiC,OAAO,EAAEA,CAAA,KAAMb,MAAM,CAACC,KAAK,CAAE;QAC7Ba,QAAQ,EAAEb,KAAK,KAAKjB,aAAc;QAAAwB,QAAA,eAElChC,IAAA,CAACZ,eAAe,CAACmD,KAAK;UAAAP,QAAA,eACpBhC,IAAA,CAACV,IAAI;YAACkD,KAAK,EAAE9B,KAAK,CAAC+B,UAAU,CAACC,iBAAkB;YAAAV,QAAA,EAAEG;UAAK,CAAO;QAAC,CAC1C;MAAC,GAPnBV,KAQU,CAClB;IAAC,CAC4B;EAAC,CAC7B,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { SegmentedControl as NativeSegmentedControl } from '@hzblj/kara-native/swift-ui';
|
|
4
|
+
import { useAppTheme } from '@hzblj/kara-theme';
|
|
5
|
+
import { useCallback, useMemo } from 'react';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* kara's own `UISegmentedControl`, with the pill in the accent and white text on it — the system control tints only the
|
|
9
|
+
* pill, and SwiftUI's segmented picker not even that. A plain `UIView` in React Native layout: it needs no host, takes
|
|
10
|
+
* the width it is given and UIKit's height. UIKit plays the control's own feedback.
|
|
11
|
+
*/
|
|
12
|
+
export const SegmentedControl = ({
|
|
13
|
+
disabled = false,
|
|
14
|
+
onChange,
|
|
15
|
+
selectedIndex,
|
|
16
|
+
testID,
|
|
17
|
+
values
|
|
18
|
+
}) => {
|
|
19
|
+
const theme = useAppTheme();
|
|
20
|
+
const face = theme.typography.footnoteMedium;
|
|
21
|
+
|
|
22
|
+
// The native control speaks in values; a segment's is its index, so two labels may read the same.
|
|
23
|
+
const options = useMemo(() => values.map((label, index) => ({
|
|
24
|
+
label,
|
|
25
|
+
value: String(index)
|
|
26
|
+
})), [values]);
|
|
27
|
+
const onValueChange = useCallback(value => {
|
|
28
|
+
const index = Number(value);
|
|
29
|
+
onChange?.(index, values[index] ?? '');
|
|
30
|
+
}, [onChange, values]);
|
|
31
|
+
return /*#__PURE__*/_jsx(NativeSegmentedControl, {
|
|
32
|
+
activePillColor: theme.color('fill.accent.primary'),
|
|
33
|
+
activeTextColor: theme.color('content.on.bg'),
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
fontFamily: face.fontFamily,
|
|
36
|
+
fontSize: face.fontSize,
|
|
37
|
+
inactiveTextColor: theme.color('content.primary'),
|
|
38
|
+
onValueChange: onValueChange,
|
|
39
|
+
options: options,
|
|
40
|
+
selectedValue: String(selectedIndex),
|
|
41
|
+
testID: testID
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=segmented-control.ios.js.map
|
|
@@ -0,0 +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,eAAe,CAAE;IAC9ClB,QAAQ,EAAEA,QAAS;IACnBoB,UAAU,EAAEd,IAAI,CAACc,UAAW;IAC5BC,QAAQ,EAAEf,IAAI,CAACe,QAAS;IACxBC,iBAAiB,EAAEjB,KAAK,CAACa,KAAK,CAAC,iBAAiB,CAAE;IAClDH,aAAa,EAAEA,aAAc;IAC7BN,OAAO,EAAEA,OAAQ;IACjBc,aAAa,EAAET,MAAM,CAACZ,aAAa,CAAE;IACrCC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -7,9 +7,9 @@ import { ABox } from "../box/index.js";
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
export const Skeleton = ({
|
|
9
9
|
borderRadius = 'small',
|
|
10
|
-
|
|
10
|
+
h,
|
|
11
11
|
testID,
|
|
12
|
-
|
|
12
|
+
w
|
|
13
13
|
}) => {
|
|
14
14
|
const pulse = useSharedValue(opacity.o40);
|
|
15
15
|
useEffect(() => {
|
|
@@ -23,11 +23,11 @@ export const Skeleton = ({
|
|
|
23
23
|
return /*#__PURE__*/_jsx(ABox, {
|
|
24
24
|
bg: "fill.quaternary",
|
|
25
25
|
borderRadius: borderRadius,
|
|
26
|
-
h:
|
|
26
|
+
h: h,
|
|
27
27
|
style: rStyle,
|
|
28
28
|
testID: testID,
|
|
29
|
-
w:
|
|
30
|
-
wide:
|
|
29
|
+
w: w,
|
|
30
|
+
wide: w === undefined
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["duration","opacity","useEffect","useAnimatedStyle","useSharedValue","withRepeat","withTiming","ABox","jsx","_jsx","Skeleton","borderRadius","
|
|
1
|
+
{"version":3,"names":["duration","opacity","useEffect","useAnimatedStyle","useSharedValue","withRepeat","withTiming","ABox","jsx","_jsx","Skeleton","borderRadius","h","testID","w","pulse","o40","value","o100","d800","rStyle","bg","style","wide","undefined"],"sourceRoot":"../../../../src","sources":["atoms/skeleton/skeleton.tsx"],"mappings":";;AAAA,SAAQA,QAAQ,EAAEC,OAAO,QAAO,mBAAmB;AACnD,SAAQC,SAAS,QAAO,OAAO;AAC/B,SAAQC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,UAAU,QAAO,yBAAyB;AAEhG,SAAQC,IAAI,QAAO,iBAAQ;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG3B,OAAO,MAAMC,QAA2B,GAAGA,CAAC;EAACC,YAAY,GAAG,OAAO;EAAEC,CAAC;EAAEC,MAAM;EAAEC;AAAgB,CAAC,KAAK;EACpG,MAAMC,KAAK,GAAGX,cAAc,CAASH,OAAO,CAACe,GAAG,CAAC;EAEjDd,SAAS,CAAC,MAAM;IACda,KAAK,CAACE,KAAK,GAAGZ,UAAU,CAACC,UAAU,CAACL,OAAO,CAACiB,IAAI,EAAE;MAAClB,QAAQ,EAAEA,QAAQ,CAACmB;IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;EACzF,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;EAEX,MAAMK,MAAM,GAAGjB,gBAAgB,CAAC,OAAO;IAACF,OAAO,EAAEc,KAAK,CAACE;EAAK,CAAC,CAAC,EAAE,EAAE,CAAC;EAEnE,oBACER,IAAA,CAACF,IAAI;IACHc,EAAE,EAAC,iBAAiB;IACpBV,YAAY,EAAEA,YAAa;IAC3BC,CAAC,EAAEA,CAAE;IACLU,KAAK,EAAEF,MAAO;IACdP,MAAM,EAAEA,MAAO;IACfC,CAAC,EAAEA,CAAE;IACLS,IAAI,EAAET,CAAC,KAAKU;EAAU,CACvB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -7,6 +7,9 @@ import { useCallback, useMemo } from 'react';
|
|
|
7
7
|
import { haptics } from "../../haptics/index.js";
|
|
8
8
|
import { useHostGuard } from "../../host-context.js";
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
/** Stands in for a missing handler: Material drops its 48dp touch target without one, and the switch moves. */
|
|
11
|
+
const NOOP = () => undefined;
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
14
|
* Material's switch, tinted with the accent like SwiftUI's toggle. With a label it is a full-width row — label at the
|
|
12
15
|
* start, switch at the end — and the whole row toggles, the way a Material settings row does. A flip plays
|
|
@@ -33,7 +36,7 @@ export const Switch = ({
|
|
|
33
36
|
checkedTrackColor: theme.color('fill.accent.primary')
|
|
34
37
|
},
|
|
35
38
|
enabled: !disabled,
|
|
36
|
-
onCheckedChange: onValueChange ? toggle :
|
|
39
|
+
onCheckedChange: onValueChange ? toggle : NOOP,
|
|
37
40
|
value: value
|
|
38
41
|
});
|
|
39
42
|
if (!label) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Switch","ComposeSwitch","Row","Text","clickable","fillMaxWidth","useAppTheme","useCallback","useMemo","haptics","useHostGuard","jsx","_jsx","jsxs","_jsxs","disabled","label","onValueChange","value","theme","toggle","next","play","rowModifiers","control","colors","checkedBorderColor","color","checkedThumbColor","checkedTrackColor","enabled","onCheckedChange","
|
|
1
|
+
{"version":3,"names":["Switch","ComposeSwitch","Row","Text","clickable","fillMaxWidth","useAppTheme","useCallback","useMemo","haptics","useHostGuard","jsx","_jsx","jsxs","_jsxs","NOOP","undefined","disabled","label","onValueChange","value","theme","toggle","next","play","rowModifiers","control","colors","checkedBorderColor","color","checkedThumbColor","checkedTrackColor","enabled","onCheckedChange","horizontalArrangement","modifiers","verticalAlignment","children","colorString","style","typography","body"],"sourceRoot":"../../../../src","sources":["atoms/switch/switch.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,IAAIC,aAAa,EAAEC,GAAG,EAAEC,IAAI,QAAO,0BAA0B;AAC3E,SAAQC,SAAS,EAAEC,YAAY,QAAO,oCAAoC;AAC1E,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAE1C,SAAQC,OAAO,QAAO,wBAAe;AACrC,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C;AACA,MAAMC,IAAI,GAAGA,CAAA,KAAMC,SAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMhB,MAAuB,GAAGA,CAAC;EAACiB,QAAQ,GAAG,KAAK;EAAEC,KAAK;EAAEC,aAAa;EAAEC;AAAkB,CAAC,KAAK;EACvGV,YAAY,CAAC,QAAQ,CAAC;EACtB,MAAMW,KAAK,GAAGf,WAAW,CAAC,CAAC;EAC3B,MAAMgB,MAAM,GAAGf,WAAW,CACvBgB,IAAa,IAAK;IACjBd,OAAO,CAACe,IAAI,CAACD,IAAI,GAAG,UAAU,GAAG,WAAW,CAAC;IAC7CJ,aAAa,GAAGI,IAAI,CAAC;EACvB,CAAC,EACD,CAACJ,aAAa,CAChB,CAAC;EACD,MAAMM,YAAY,GAAGjB,OAAO,CAC1B,MAAOS,QAAQ,IAAI,CAACE,aAAa,GAAG,CAACd,YAAY,CAAC,CAAC,CAAC,GAAG,CAACA,YAAY,CAAC,CAAC,EAAED,SAAS,CAAC,MAAMkB,MAAM,CAAC,CAACF,KAAK,CAAC,CAAC,CAAE,EACzG,CAACH,QAAQ,EAAEE,aAAa,EAAEG,MAAM,EAAEF,KAAK,CACzC,CAAC;EACD,MAAMM,OAAO,gBACXd,IAAA,CAACX,aAAa;IACZ0B,MAAM,EAAE;MACNC,kBAAkB,EAAEP,KAAK,CAACQ,KAAK,CAAC,qBAAqB,CAAC;MACtDC,iBAAiB,EAAET,KAAK,CAACQ,KAAK,CAAC,eAAe,CAAC;MAC/CE,iBAAiB,EAAEV,KAAK,CAACQ,KAAK,CAAC,qBAAqB;IACtD,CAAE;IACFG,OAAO,EAAE,CAACf,QAAS;IACnBgB,eAAe,EAAEd,aAAa,GAAGG,MAAM,GAAGP,IAAK;IAC/CK,KAAK,EAAEA;EAAM,CACd,CACF;EAED,IAAI,CAACF,KAAK,EAAE;IACV,OAAOQ,OAAO;EAChB;EAEA,oBACEZ,KAAA,CAACZ,GAAG;IAACgC,qBAAqB,EAAC,cAAc;IAACC,SAAS,EAAEV,YAAa;IAACW,iBAAiB,EAAC,QAAQ;IAAAC,QAAA,gBAC3FzB,IAAA,CAACT,IAAI;MAAC0B,KAAK,EAAER,KAAK,CAACiB,WAAW,CAACrB,QAAQ,GAAG,kBAAkB,GAAG,iBAAiB,CAAE;MAACsB,KAAK,EAAElB,KAAK,CAACmB,UAAU,CAACC,IAAK;MAAAJ,QAAA,EAC7GnB;IAAK,CACF,CAAC,EACNQ,OAAO;EAAA,CACL,CAAC;AAEV,CAAC","ignoreList":[]}
|