@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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","ComposeText","TooltipBox","useAppTheme","useHostGuard","jsx","_jsx","jsxs","_jsxs","Tooltip","children","text","theme","
|
|
1
|
+
{"version":3,"names":["Text","ComposeText","TooltipBox","useAppTheme","useCallback","useHostGuard","jsx","_jsx","jsxs","_jsxs","Tooltip","children","onDismiss","text","visible","theme","onDismissRequest","containerColor","color","isPresented","plain","colorString","style","typography","footnote"],"sourceRoot":"../../../../src","sources":["molecules/tooltip/tooltip.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,IAAIC,WAAW,QAAO,0BAA0B;AAC5D,SAAQC,UAAU,QAAO,oCAAoC;AAC7D,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,QAAO,OAAO;AAEjC,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAyB,GAAGA,CAAC;EAACC,QAAQ;EAAEC,SAAS;EAAEC,IAAI;EAAEC;AAAqB,CAAC,KAAK;EAC/FT,YAAY,CAAC,SAAS,CAAC;EACvB,MAAMU,KAAK,GAAGZ,WAAW,CAAC,CAAC;EAC3B,MAAMa,gBAAgB,GAAGZ,WAAW,CAAC,MAAMQ,SAAS,CAAC,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;EAEpE,oBACEH,KAAA,CAACP,UAAU;IACTe,cAAc,EAAEF,KAAK,CAACG,KAAK,CAAC,uBAAuB,CAAE;IACrDC,WAAW,EAAEL,OAAQ;IACrBE,gBAAgB,EAAEA,gBAAiB;IACnCI,KAAK;IAAAT,QAAA,gBAELJ,IAAA,CAACL,UAAU,CAACF,IAAI;MAAAW,QAAA,eACdJ,IAAA,CAACN,WAAW;QAACiB,KAAK,EAAEH,KAAK,CAACM,WAAW,CAAC,0BAA0B,CAAE;QAACC,KAAK,EAAEP,KAAK,CAACQ,UAAU,CAACC,QAAS;QAAAb,QAAA,EACjGE;MAAI,CACM;IAAC,CACC,CAAC,EACjBF,QAAQ;EAAA,CACC,CAAC;AAEjB,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Divider } from "../../atoms/divider/index.js";
|
|
4
3
|
import { HStack } from "../../atoms/h-stack/index.js";
|
|
4
|
+
import { Icon } from "../../atoms/icon/index.js";
|
|
5
|
+
import { Island } from "../../atoms/island/index.js";
|
|
5
6
|
import { Text } from "../../atoms/text/index.js";
|
|
6
7
|
import { VStack } from "../../atoms/v-stack/index.js";
|
|
7
8
|
import { useHostGuard } from "../../host-context.js";
|
|
8
9
|
import { Sheet } from "../sheet/index.js";
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
/**
|
|
12
|
+
* Material's bottom-sheet menu: the title, then a full-width row per action, its icon leading. The sheet is the React
|
|
13
|
+
* Native tier, so the rows — Compose views — sit in an `Island` of their own; rendered straight into the sheet they had
|
|
14
|
+
* no host and threw.
|
|
15
|
+
*/
|
|
10
16
|
export const ActionSheet = ({
|
|
11
17
|
actions,
|
|
12
18
|
onDismiss,
|
|
@@ -17,26 +23,41 @@ export const ActionSheet = ({
|
|
|
17
23
|
return /*#__PURE__*/_jsx(Sheet, {
|
|
18
24
|
onDismiss: onDismiss,
|
|
19
25
|
visible: visible,
|
|
20
|
-
children: /*#__PURE__*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
wide: true,
|
|
24
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
25
|
-
color: "content.secondary",
|
|
26
|
-
variant: "labelMedium",
|
|
27
|
-
children: title
|
|
28
|
-
}), /*#__PURE__*/_jsx(Divider, {}), actions.map(action => /*#__PURE__*/_jsx(HStack, {
|
|
29
|
-
onPress: () => {
|
|
30
|
-
onDismiss();
|
|
31
|
-
action.onPress();
|
|
32
|
-
},
|
|
33
|
-
py: "s12",
|
|
26
|
+
children: /*#__PURE__*/_jsx(Island, {
|
|
27
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
28
|
+
pb: "s16",
|
|
34
29
|
wide: true,
|
|
35
|
-
children: /*#__PURE__*/_jsx(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
children: [/*#__PURE__*/_jsx(HStack, {
|
|
31
|
+
px: "s24",
|
|
32
|
+
py: "s12",
|
|
33
|
+
wide: true,
|
|
34
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
35
|
+
color: "content.secondary",
|
|
36
|
+
variant: "labelMedium",
|
|
37
|
+
children: title
|
|
38
|
+
})
|
|
39
|
+
}), actions.map(action => {
|
|
40
|
+
const color = action.destructive ? 'content.destructive' : 'content.primary';
|
|
41
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
42
|
+
onPress: () => {
|
|
43
|
+
onDismiss();
|
|
44
|
+
action.onPress();
|
|
45
|
+
},
|
|
46
|
+
px: "s24",
|
|
47
|
+
py: "s16",
|
|
48
|
+
spacing: "s16",
|
|
49
|
+
wide: true,
|
|
50
|
+
children: [action.icon ? /*#__PURE__*/_jsx(Icon, {
|
|
51
|
+
color: color,
|
|
52
|
+
name: action.icon
|
|
53
|
+
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
54
|
+
color: color,
|
|
55
|
+
variant: "body",
|
|
56
|
+
children: action.label
|
|
57
|
+
})]
|
|
58
|
+
}, action.label);
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
40
61
|
})
|
|
41
62
|
});
|
|
42
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["HStack","Icon","Island","Text","VStack","useHostGuard","Sheet","jsx","_jsx","jsxs","_jsxs","ActionSheet","actions","onDismiss","title","visible","children","pb","wide","px","py","color","variant","map","action","destructive","onPress","spacing","icon","name","label"],"sourceRoot":"../../../../src","sources":["organisms/action-sheet/action-sheet.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,QAAO,8BAAqB;AAC1C,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,MAAM,QAAO,6BAAoB;AACzC,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,MAAM,QAAO,8BAAqB;AAC1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,CAACL,IAAI;cAACkB,KAAK,EAAEA,KAAM;cAACC,OAAO,EAAC,MAAM;cAAAN,QAAA,EAC/BQ,MAAM,CAACM;YAAK,CACT,CAAC;UAAA,GAbFN,MAAM,CAACM,KAcN,CAAC;QAEb,CAAC,CAAC;MAAA,CACI;IAAC,CACH;EAAC,CACJ,CAAC;AAEZ,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Button, ConfirmationDialog } from '@expo/ui/swift-ui';
|
|
3
|
+
import { Button, ConfirmationDialog, Spacer } from '@expo/ui/swift-ui';
|
|
4
|
+
import { frame } from '@expo/ui/swift-ui/modifiers';
|
|
4
5
|
import { useHostGuard } from "../../host-context.js";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* `@expo/ui` hangs the dialog on its `Trigger` and reads the buttons from its `Actions` slot. Without a trigger it
|
|
9
|
+
* attaches to an `EmptyView`, which SwiftUI never presents from — a spacer framed to nothing is a real view that takes
|
|
10
|
+
* no room.
|
|
11
|
+
*/
|
|
12
|
+
const ANCHOR = [frame({
|
|
13
|
+
height: 0,
|
|
14
|
+
width: 0
|
|
15
|
+
})];
|
|
6
16
|
export const ActionSheet = ({
|
|
7
17
|
actions,
|
|
8
18
|
onDismiss,
|
|
@@ -10,7 +20,7 @@ export const ActionSheet = ({
|
|
|
10
20
|
visible
|
|
11
21
|
}) => {
|
|
12
22
|
useHostGuard('ActionSheet');
|
|
13
|
-
return /*#__PURE__*/
|
|
23
|
+
return /*#__PURE__*/_jsxs(ConfirmationDialog, {
|
|
14
24
|
isPresented: visible,
|
|
15
25
|
onIsPresentedChange: next => {
|
|
16
26
|
if (!next) {
|
|
@@ -18,11 +28,17 @@ export const ActionSheet = ({
|
|
|
18
28
|
}
|
|
19
29
|
},
|
|
20
30
|
title: title,
|
|
21
|
-
children:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
31
|
+
children: [/*#__PURE__*/_jsx(ConfirmationDialog.Trigger, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(Spacer, {
|
|
33
|
+
modifiers: ANCHOR
|
|
34
|
+
})
|
|
35
|
+
}), /*#__PURE__*/_jsx(ConfirmationDialog.Actions, {
|
|
36
|
+
children: actions.map(action => /*#__PURE__*/_jsx(Button, {
|
|
37
|
+
label: action.label,
|
|
38
|
+
onPress: action.onPress,
|
|
39
|
+
role: action.destructive ? 'destructive' : 'default'
|
|
40
|
+
}, action.label))
|
|
41
|
+
})]
|
|
26
42
|
});
|
|
27
43
|
};
|
|
28
44
|
//# sourceMappingURL=action-sheet.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","ConfirmationDialog","useHostGuard","jsx","_jsx","ActionSheet","actions","onDismiss","title","visible","isPresented","onIsPresentedChange","next","children","map","action","label","onPress","role","destructive"],"sourceRoot":"../../../../src","sources":["organisms/action-sheet/action-sheet.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAEC,kBAAkB,QAAO,mBAAmB;
|
|
1
|
+
{"version":3,"names":["Button","ConfirmationDialog","Spacer","frame","useHostGuard","jsx","_jsx","jsxs","_jsxs","ANCHOR","height","width","ActionSheet","actions","onDismiss","title","visible","isPresented","onIsPresentedChange","next","children","Trigger","modifiers","Actions","map","action","label","onPress","role","destructive"],"sourceRoot":"../../../../src","sources":["organisms/action-sheet/action-sheet.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAEC,kBAAkB,EAAEC,MAAM,QAAO,mBAAmB;AACpE,SAAQC,KAAK,QAAO,6BAA6B;AAEjD,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAM,GAAG,CAACN,KAAK,CAAC;EAACO,MAAM,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAC,CAAC,CAAC,CAAC;AAE7C,OAAO,MAAMC,WAAiC,GAAGA,CAAC;EAACC,OAAO;EAAEC,SAAS;EAAEC,KAAK;EAAEC;AAAyB,CAAC,KAAK;EAC3GZ,YAAY,CAAC,aAAa,CAAC;EAE3B,oBACEI,KAAA,CAACP,kBAAkB;IACjBgB,WAAW,EAAED,OAAQ;IACrBE,mBAAmB,EAAEC,IAAI,IAAI;MAC3B,IAAI,CAACA,IAAI,EAAE;QACTL,SAAS,CAAC,CAAC;MACb;IACF,CAAE;IACFC,KAAK,EAAEA,KAAM;IAAAK,QAAA,gBAEbd,IAAA,CAACL,kBAAkB,CAACoB,OAAO;MAAAD,QAAA,eACzBd,IAAA,CAACJ,MAAM;QAACoB,SAAS,EAAEb;MAAO,CAAE;IAAC,CACH,CAAC,eAC7BH,IAAA,CAACL,kBAAkB,CAACsB,OAAO;MAAAH,QAAA,EACxBP,OAAO,CAACW,GAAG,CAACC,MAAM,iBACjBnB,IAAA,CAACN,MAAM;QAEL0B,KAAK,EAAED,MAAM,CAACC,KAAM;QACpBC,OAAO,EAAEF,MAAM,CAACE,OAAQ;QACxBC,IAAI,EAAEH,MAAM,CAACI,WAAW,GAAG,aAAa,GAAG;MAAU,GAHhDJ,MAAM,CAACC,KAIb,CACF;IAAC,CACwB,CAAC;EAAA,CACX,CAAC;AAEzB,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Button, Alert as SwiftUIAlert, Text as SwiftUIText } from '@expo/ui/swift-ui';
|
|
3
|
+
import { Button, Spacer, Alert as SwiftUIAlert, Text as SwiftUIText } from '@expo/ui/swift-ui';
|
|
4
|
+
import { frame } from '@expo/ui/swift-ui/modifiers';
|
|
4
5
|
import { useHostGuard } from "../../host-context.js";
|
|
5
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* `@expo/ui` hangs the alert on its `Alert.Trigger`, and on an `EmptyView` when there is none — which SwiftUI never
|
|
9
|
+
* presents from, so the alert would not appear at all. A spacer framed to nothing is a real view that takes no room.
|
|
10
|
+
*/
|
|
11
|
+
const ANCHOR = [frame({
|
|
12
|
+
height: 0,
|
|
13
|
+
width: 0
|
|
14
|
+
})];
|
|
6
15
|
export const Alert = ({
|
|
7
16
|
confirmLabel = 'OK',
|
|
8
17
|
destructive = false,
|
|
@@ -21,7 +30,11 @@ export const Alert = ({
|
|
|
21
30
|
}
|
|
22
31
|
},
|
|
23
32
|
title: title,
|
|
24
|
-
children: [/*#__PURE__*/
|
|
33
|
+
children: [/*#__PURE__*/_jsx(SwiftUIAlert.Trigger, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(Spacer, {
|
|
35
|
+
modifiers: ANCHOR
|
|
36
|
+
})
|
|
37
|
+
}), /*#__PURE__*/_jsxs(SwiftUIAlert.Actions, {
|
|
25
38
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
26
39
|
label: confirmLabel,
|
|
27
40
|
onPress: onConfirm ?? onDismiss,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","Alert","SwiftUIAlert","Text","SwiftUIText","useHostGuard","jsx","_jsx","jsxs","_jsxs","confirmLabel","destructive","message","onConfirm","onDismiss","title","visible","isPresented","onIsPresentedChange","next","children","Actions","label","onPress","role","Message"],"sourceRoot":"../../../../src","sources":["organisms/alert/alert.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAEC,KAAK,IAAIC,YAAY,EAAEC,IAAI,IAAIC,WAAW,QAAO,mBAAmB;
|
|
1
|
+
{"version":3,"names":["Button","Spacer","Alert","SwiftUIAlert","Text","SwiftUIText","frame","useHostGuard","jsx","_jsx","jsxs","_jsxs","ANCHOR","height","width","confirmLabel","destructive","message","onConfirm","onDismiss","title","visible","isPresented","onIsPresentedChange","next","children","Trigger","modifiers","Actions","label","onPress","role","Message"],"sourceRoot":"../../../../src","sources":["organisms/alert/alert.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAEC,MAAM,EAAEC,KAAK,IAAIC,YAAY,EAAEC,IAAI,IAAIC,WAAW,QAAO,mBAAmB;AAC5F,SAAQC,KAAK,QAAO,6BAA6B;AAEjD,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C;AACA;AACA;AACA;AACA,MAAMC,MAAM,GAAG,CAACN,KAAK,CAAC;EAACO,MAAM,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAC,CAAC,CAAC,CAAC;AAE7C,OAAO,MAAMZ,KAAqB,GAAGA,CAAC;EACpCa,YAAY,GAAG,IAAI;EACnBC,WAAW,GAAG,KAAK;EACnBC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,KAAK;EACLC;AACU,CAAC,KAAK;EAChBd,YAAY,CAAC,OAAO,CAAC;EAErB,oBACEI,KAAA,CAACR,YAAY;IACXmB,WAAW,EAAED,OAAQ;IACrBE,mBAAmB,EAAEC,IAAI,IAAI;MAC3B,IAAI,CAACA,IAAI,EAAE;QACTL,SAAS,CAAC,CAAC;MACb;IACF,CAAE;IACFC,KAAK,EAAEA,KAAM;IAAAK,QAAA,gBAEbhB,IAAA,CAACN,YAAY,CAACuB,OAAO;MAAAD,QAAA,eACnBhB,IAAA,CAACR,MAAM;QAAC0B,SAAS,EAAEf;MAAO,CAAE;IAAC,CACT,CAAC,eACvBD,KAAA,CAACR,YAAY,CAACyB,OAAO;MAAAH,QAAA,gBACnBhB,IAAA,CAACT,MAAM;QAAC6B,KAAK,EAAEd,YAAa;QAACe,OAAO,EAAEZ,SAAS,IAAIC,SAAU;QAACY,IAAI,EAAEf,WAAW,GAAG,aAAa,GAAG;MAAU,CAAE,CAAC,eAC/GP,IAAA,CAACT,MAAM;QAAC6B,KAAK,EAAC,QAAQ;QAACC,OAAO,EAAEX,SAAU;QAACY,IAAI,EAAC;MAAQ,CAAE,CAAC;IAAA,CACvC,CAAC,EAQtBd,OAAO,gBACNR,IAAA,CAACN,YAAY,CAAC6B,OAAO;MAAAP,QAAA,eACnBhB,IAAA,CAACJ,WAAW;QAAAoB,QAAA,EAAER;MAAO,CAAc;IAAC,CAChB,CAAC,GACrB,IAAI;EAAA,CACI,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -5,12 +5,17 @@ import { Text } from "../../atoms/text/index.js";
|
|
|
5
5
|
import { VStack } from "../../atoms/v-stack/index.js";
|
|
6
6
|
import { useHostGuard } from "../../host-context.js";
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* Inset from its container on every side, as SwiftUI's grouped form is — in a `Screen` the cards would otherwise run
|
|
10
|
+
* into the screen's edges — and the section titles and footers indented to the cards' content.
|
|
11
|
+
*/
|
|
8
12
|
const FormRoot = ({
|
|
9
13
|
children,
|
|
10
14
|
testID
|
|
11
15
|
}) => {
|
|
12
16
|
useHostGuard('Form');
|
|
13
17
|
return /*#__PURE__*/_jsx(VStack, {
|
|
18
|
+
p: "s16",
|
|
14
19
|
spacing: "s16",
|
|
15
20
|
testID: testID,
|
|
16
21
|
wide: true,
|
|
@@ -24,18 +29,26 @@ const FormSection = ({
|
|
|
24
29
|
}) => /*#__PURE__*/_jsxs(VStack, {
|
|
25
30
|
spacing: "s4",
|
|
26
31
|
wide: true,
|
|
27
|
-
children: [title ? /*#__PURE__*/_jsx(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
children: [title ? /*#__PURE__*/_jsx(VStack, {
|
|
33
|
+
px: "s16",
|
|
34
|
+
wide: true,
|
|
35
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
36
|
+
color: "content.secondary",
|
|
37
|
+
transform: "uppercase",
|
|
38
|
+
variant: "labelMedium",
|
|
39
|
+
children: title
|
|
40
|
+
})
|
|
32
41
|
}) : null, /*#__PURE__*/_jsx(Card, {
|
|
33
42
|
wide: true,
|
|
34
43
|
children: children
|
|
35
|
-
}), footer ? /*#__PURE__*/_jsx(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children:
|
|
44
|
+
}), footer ? /*#__PURE__*/_jsx(VStack, {
|
|
45
|
+
px: "s16",
|
|
46
|
+
wide: true,
|
|
47
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
48
|
+
color: "content.tertiary",
|
|
49
|
+
variant: "footnote",
|
|
50
|
+
children: footer
|
|
51
|
+
})
|
|
39
52
|
}) : null]
|
|
40
53
|
});
|
|
41
54
|
export const Form = Object.assign(FormRoot, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Card","Text","VStack","useHostGuard","jsx","_jsx","jsxs","_jsxs","FormRoot","children","testID","spacing","wide","FormSection","footer","title","color","transform","variant","Form","Object","assign","Section"],"sourceRoot":"../../../../src","sources":["organisms/form/form.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,2BAAkB;AACrC,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,MAAM,QAAO,8BAAqB;AAC1C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C,MAAMC,QAAQ,GAAGA,CAAC;EAACC,QAAQ;EAAEC;AAAiB,CAAC,KAAK;EAClDP,YAAY,CAAC,MAAM,CAAC;EAEpB,oBACEE,IAAA,CAACH,MAAM;IAACS,OAAO,EAAC,KAAK;
|
|
1
|
+
{"version":3,"names":["Card","Text","VStack","useHostGuard","jsx","_jsx","jsxs","_jsxs","FormRoot","children","testID","p","spacing","wide","FormSection","footer","title","px","color","transform","variant","Form","Object","assign","Section"],"sourceRoot":"../../../../src","sources":["organisms/form/form.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,2B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M,CAACC,MAAM,CAACf,QAAQ,EAAE;EAACgB,OAAO,EAAEV;AAAW,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,17 +1,131 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { FilledIconButton } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { size } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
|
+
import { SwipeActionsBox } from '@hzblj/kara-native/jetpack-compose';
|
|
6
|
+
import { spacing, useAppTheme } from '@hzblj/kara-theme';
|
|
7
|
+
import { useCallback, useEffect, useId, useState, useSyncExternalStore } from 'react';
|
|
8
|
+
import { HStack } from "../../atoms/h-stack/index.js";
|
|
9
|
+
import { Icon } from "../../atoms/icon/index.js";
|
|
10
|
+
import { Text } from "../../atoms/text/index.js";
|
|
11
|
+
import { VStack } from "../../atoms/v-stack/index.js";
|
|
12
|
+
import { useHostGuard } from "../../host-context.js";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
/** A Material 3 Expressive wide icon button: wider than tall, a stadium, the label under it. */
|
|
15
|
+
const BUTTON = [size(52, 32)];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Which row is open, app-wide — SwiftUI's list keeps one row open, and so does this: opening one closes the last.
|
|
19
|
+
* React state cannot be shared between rows that know nothing of each other, so it lives in the module.
|
|
20
|
+
*/
|
|
21
|
+
let openRow = null;
|
|
22
|
+
const listeners = new Set();
|
|
23
|
+
const setOpenRow = row => {
|
|
24
|
+
if (openRow === row) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
openRow = row;
|
|
28
|
+
for (const listener of listeners) {
|
|
29
|
+
listener();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const subscribe = listener => {
|
|
33
|
+
listeners.add(listener);
|
|
34
|
+
return () => {
|
|
35
|
+
listeners.delete(listener);
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const getOpenRow = () => openRow;
|
|
39
|
+
const ActionButton = ({
|
|
40
|
+
action,
|
|
41
|
+
onDone
|
|
7
42
|
}) => {
|
|
8
|
-
|
|
9
|
-
|
|
43
|
+
const theme = useAppTheme();
|
|
44
|
+
const fill = action.tint ?? (action.destructive ? 'fill.destructive.primary' : 'fill.accent.primary');
|
|
45
|
+
const content = !action.tint && action.destructive ? 'content.on.destructive' : 'content.on.bg';
|
|
46
|
+
const onClick = useCallback(() => {
|
|
47
|
+
onDone();
|
|
48
|
+
action.onPress();
|
|
49
|
+
}, [action, onDone]);
|
|
50
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
51
|
+
align: "center",
|
|
52
|
+
spacing: "s2",
|
|
53
|
+
children: [/*#__PURE__*/_jsx(FilledIconButton, {
|
|
54
|
+
colors: {
|
|
55
|
+
containerColor: theme.color(fill),
|
|
56
|
+
contentColor: theme.color(content)
|
|
57
|
+
},
|
|
58
|
+
modifiers: BUTTON,
|
|
59
|
+
onClick: onClick,
|
|
60
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
61
|
+
accessibilityLabel: action.label,
|
|
62
|
+
color: content,
|
|
63
|
+
name: action.icon,
|
|
64
|
+
size: "s20"
|
|
65
|
+
})
|
|
66
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
67
|
+
color: "content.secondary",
|
|
68
|
+
variant: "labelMedium",
|
|
69
|
+
children: action.label
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
10
72
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
73
|
+
const Actions = ({
|
|
74
|
+
actions,
|
|
75
|
+
onDone
|
|
76
|
+
}) => /*#__PURE__*/_jsx(HStack, {
|
|
77
|
+
align: "center",
|
|
78
|
+
spacing: "s8",
|
|
79
|
+
children: actions.map(action => /*#__PURE__*/_jsx(ActionButton, {
|
|
80
|
+
action: action,
|
|
81
|
+
onDone: onDone
|
|
82
|
+
}, action.label))
|
|
16
83
|
});
|
|
84
|
+
const close = () => setOpenRow(null);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* kara's `SwipeActionsBox`: the row slides on an anchored drag and the buttons show in the strip it leaves, fading in.
|
|
88
|
+
* Controlled from here so one row is open at a time; a press closes the row before the action runs.
|
|
89
|
+
*/
|
|
90
|
+
export const SwipeActions = ({
|
|
91
|
+
children,
|
|
92
|
+
leading = [],
|
|
93
|
+
trailing = []
|
|
94
|
+
}) => {
|
|
95
|
+
useHostGuard('SwipeActions');
|
|
96
|
+
const row = useId();
|
|
97
|
+
const isOpenRow = useSyncExternalStore(subscribe, getOpenRow) === row;
|
|
98
|
+
const [edge, setEdge] = useState(null);
|
|
99
|
+
const onOpenChange = useCallback(next => {
|
|
100
|
+
setEdge(next);
|
|
101
|
+
if (next) {
|
|
102
|
+
setOpenRow(row);
|
|
103
|
+
} else if (openRow === row) {
|
|
104
|
+
setOpenRow(null);
|
|
105
|
+
}
|
|
106
|
+
}, [row]);
|
|
107
|
+
|
|
108
|
+
// A row that goes away open must not keep the others from opening.
|
|
109
|
+
useEffect(() => () => {
|
|
110
|
+
if (openRow === row) {
|
|
111
|
+
setOpenRow(null);
|
|
112
|
+
}
|
|
113
|
+
}, [row]);
|
|
114
|
+
return /*#__PURE__*/_jsxs(SwipeActionsBox, {
|
|
115
|
+
actionsSpacing: spacing.s12,
|
|
116
|
+
onOpenChange: onOpenChange,
|
|
117
|
+
openEdge: isOpenRow ? edge : null,
|
|
118
|
+
children: [leading.length > 0 ? /*#__PURE__*/_jsx(SwipeActionsBox.Leading, {
|
|
119
|
+
children: /*#__PURE__*/_jsx(Actions, {
|
|
120
|
+
actions: leading,
|
|
121
|
+
onDone: close
|
|
122
|
+
})
|
|
123
|
+
}) : null, trailing.length > 0 ? /*#__PURE__*/_jsx(SwipeActionsBox.Trailing, {
|
|
124
|
+
children: /*#__PURE__*/_jsx(Actions, {
|
|
125
|
+
actions: [...trailing].reverse(),
|
|
126
|
+
onDone: close
|
|
127
|
+
})
|
|
128
|
+
}) : null, children]
|
|
129
|
+
});
|
|
130
|
+
};
|
|
17
131
|
//# sourceMappingURL=swipe-actions.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["FilledIconButton","size","SwipeActionsBox","spacing","useAppTheme","useCallback","useEffect","useId","useState","useSyncExternalStore","HStack","Icon","Text","VStack","useHostGuard","jsx","_jsx","jsxs","_jsxs","BUTTON","openRow","listeners","Set","setOpenRow","row","listener","subscribe","add","delete","getOpenRow","ActionButton","action","onDone","theme","fill","tint","destructive","content","onClick","onPress","align","children","colors","containerColor","color","contentColor","modifiers","accessibilityLabel","label","name","icon","variant","Actions","actions","map","close","SwipeActions","leading","trailing","isOpenRow","edge","setEdge","onOpenChange","next","actionsSpacing","s12","openEdge","length","Leading","Trailing","reverse"],"sourceRoot":"../../../../src","sources":["organisms/swipe-actions/swipe-actions.android.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,QAAO,0BAA0B;AACzD,SAAQC,IAAI,QAAO,oCAAoC;AACvD,SAAQC,eAAe,QAAiC,oCAAoC;AAC5F,SAAQC,OAAO,EAAEC,WAAW,QAAO,mBAAmB;AACtD,SAAQC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,oBAAoB,QAAO,OAAO;AAEnF,SAAQC,MAAM,QAAO,8BAAqB;AAC1C,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,MAAM,QAAO,8BAAqB;AAC1C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C;AACA,MAAMC,MAAM,GAAG,CAAClB,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;;AAE7B;AACA;AACA;AACA;AACA,IAAIm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sD,YAAY,GAAGzD,WAAW,CAC7B0D,IAAgC,IAAK;IACpCF,OAAO,CAACE,IAAI,CAAC;IAEb,IAAIA,IAAI,EAAE;MACRxC,UAAU,CAACC,GAAG,CAAC;IACjB,CAAC,MAAM,IAAIJ,OAAO,KAAKI,GAAG,EAAE;MAC1BD,UAAU,CAAC,IAAI,CAAC;IAClB;EACF,CAAC,EACD,CAACC,GAAG,CACN,CAAC;;EAED;EACAlB,SAAS,CACP,MAAM,MAAM;IACV,IAAIc,OAAO,KAAKI,GAAG,EAAE;MACnBD,UAAU,CAAC,IAAI,CAAC;IAClB;EACF,CAAC,EACD,CAACC,GAAG,CACN,CAAC;EAED,oBACEN,KAAA,CAAChB,eAAe;IAAC8D,cAAc,EAAE7D,OAAO,CAAC8D,GAAI;IAACH,YAAY,EAAEA,YAAa;IAACI,QAAQ,EAAEP,SAAS,GAAGC,IAAI,GAAG,IAAK;IAAAnB,QAAA,GACzGgB,OAAO,CAACU,MAAM,GAAG,CAAC,gBACjBnD,IAAA,CAACd,eAAe,CAACkE,OAAO;MAAA3B,QAAA,eACtBzB,IAAA,CAACoC,OAAO;QAACC,OAAO,EAAEI,OAAQ;QAACzB,MAAM,EAAEuB;MAAM,CAAE;IAAC,CACrB,CAAC,GACxB,IAAI,EACPG,QAAQ,CAACS,MAAM,GAAG,CAAC,gBAClBnD,IAAA,CAACd,eAAe,CAACmE,QAAQ;MAAA5B,QAAA,eAEvBzB,IAAA,CAACoC,OAAO;QAACC,OAAO,EAAE,CAAC,GAAGK,QAAQ,CAAC,CAACY,OAAO,CAAC,CAAE;QAACtC,MAAM,EAAEuB;MAAM,CAAE;IAAC,CACpC,CAAC,GACzB,IAAI,EACPd,QAAQ;EAAA,CACM,CAAC;AAEtB,CAAC","ignoreList":[]}
|
|
@@ -1,28 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { SwipeActions as SwiftUISwipeActions } from '@expo/ui/swift-ui';
|
|
3
|
+
import { Button, Image, Label, SwipeActions as SwiftUISwipeActions } from '@expo/ui/swift-ui';
|
|
4
|
+
import { tint } from '@expo/ui/swift-ui/modifiers';
|
|
5
|
+
import { iconResourceName } from '@hzblj/kara-native';
|
|
6
|
+
import { useAppTheme } from '@hzblj/kara-theme';
|
|
4
7
|
import { useHostGuard } from "../../host-context.js";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
/**
|
|
10
|
+
* The edge's buttons, a `Label` each — iOS 26 draws its icon on a round button with the title under it; earlier
|
|
11
|
+
* versions, in a row of the usual height, the icon alone. No `destructive` role: SwiftUI would animate the row out by itself, and whether it goes is
|
|
12
|
+
* the list's data to say.
|
|
13
|
+
*/
|
|
14
|
+
const Actions = ({
|
|
15
|
+
actions,
|
|
16
|
+
allowsFullSwipe,
|
|
17
|
+
edge
|
|
18
|
+
}) => {
|
|
19
|
+
const theme = useAppTheme();
|
|
20
|
+
return /*#__PURE__*/_jsx(SwiftUISwipeActions.Actions, {
|
|
21
|
+
allowsFullSwipe: allowsFullSwipe,
|
|
22
|
+
edge: edge,
|
|
23
|
+
children: actions.map(action => /*#__PURE__*/_jsx(Button, {
|
|
24
|
+
modifiers: [tint(theme.color(action.tint ?? (action.destructive ? 'fill.destructive.primary' : 'fill.accent.primary')))],
|
|
25
|
+
onPress: action.onPress,
|
|
26
|
+
children: /*#__PURE__*/_jsx(Label, {
|
|
27
|
+
icon: /*#__PURE__*/_jsx(Image, {
|
|
28
|
+
assetName: iconResourceName(action.icon)
|
|
29
|
+
}),
|
|
30
|
+
title: action.label
|
|
31
|
+
})
|
|
32
|
+
}, action.label))
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export const SwipeActions = ({
|
|
36
|
+
allowsFullSwipe = true,
|
|
7
37
|
children,
|
|
8
|
-
|
|
38
|
+
leading = [],
|
|
39
|
+
testID,
|
|
40
|
+
trailing = []
|
|
9
41
|
}) => {
|
|
10
42
|
useHostGuard('SwipeActions');
|
|
11
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/_jsxs(SwiftUISwipeActions, {
|
|
12
44
|
testID: testID,
|
|
13
|
-
children: children
|
|
45
|
+
children: [children, leading.length > 0 ? /*#__PURE__*/_jsx(Actions, {
|
|
46
|
+
actions: leading,
|
|
47
|
+
allowsFullSwipe: allowsFullSwipe,
|
|
48
|
+
edge: "leading"
|
|
49
|
+
}) : null, trailing.length > 0 ? /*#__PURE__*/_jsx(Actions, {
|
|
50
|
+
actions: trailing,
|
|
51
|
+
allowsFullSwipe: allowsFullSwipe,
|
|
52
|
+
edge: "trailing"
|
|
53
|
+
}) : null]
|
|
14
54
|
});
|
|
15
55
|
};
|
|
16
|
-
const SwipeActionsGroup = ({
|
|
17
|
-
allowsFullSwipe = true,
|
|
18
|
-
children,
|
|
19
|
-
edge = 'trailing'
|
|
20
|
-
}) => /*#__PURE__*/_jsx(SwiftUISwipeActions.Actions, {
|
|
21
|
-
allowsFullSwipe: allowsFullSwipe,
|
|
22
|
-
edge: edge,
|
|
23
|
-
children: children
|
|
24
|
-
});
|
|
25
|
-
export const SwipeActions = Object.assign(SwipeActionsRoot, {
|
|
26
|
-
Actions: SwipeActionsGroup
|
|
27
|
-
});
|
|
28
56
|
//# sourceMappingURL=swipe-actions.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SwipeActions","SwiftUISwipeActions","useHostGuard","jsx","_jsx","
|
|
1
|
+
{"version":3,"names":["Button","Image","Label","SwipeActions","SwiftUISwipeActions","tint","iconResourceName","useAppTheme","useHostGuard","jsx","_jsx","jsxs","_jsxs","Actions","actions","allowsFullSwipe","edge","theme","children","map","action","modifiers","color","destructive","onPress","icon","assetName","title","label","leading","testID","trailing","length"],"sourceRoot":"../../../../src","sources":["organisms/swipe-actions/swipe-actions.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAE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AAC;EAE5B,oBACEI,KAAA,CAACR,mBAAmB;IAAC0B,MAAM,EAAEA,MAAO;IAAAZ,QAAA,GACjCA,QAAQ,EACRW,OAAO,CAACG,MAAM,GAAG,CAAC,gBAAGtB,IAAA,CAACG,OAAO;MAACC,OAAO,EAAEe,OAAQ;MAACd,eAAe,EAAEA,eAAgB;MAACC,IAAI,EAAC;IAAS,CAAE,CAAC,GAAG,IAAI,EAC1Ge,QAAQ,CAACC,MAAM,GAAG,CAAC,gBAAGtB,IAAA,CAACG,OAAO;MAACC,OAAO,EAAEiB,QAAS;MAAChB,eAAe,EAAEA,eAAgB;MAACC,IAAI,EAAC;IAAU,CAAE,CAAC,GAAG,IAAI;EAAA,CAC3F,CAAC;AAE1B,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,9 @@ const FILL = {
|
|
|
8
8
|
flexGrow: 1
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
/** What gives the outer view a height of its own, rather than its content's. */
|
|
12
|
+
const SIZING_KEYS = ['aspectRatio', 'flex', 'flexBasis', 'flexGrow', 'height', 'minHeight'];
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* Splits a resolved style for a pressable with an Android ripple. The ripple is drawn as the pressable's foreground,
|
|
13
16
|
* which its own `overflow: hidden` does not clip — so it would spill past rounded corners. A parent clips its
|
|
@@ -28,8 +31,13 @@ export const splitForRipple = style => {
|
|
|
28
31
|
outer[key] = value;
|
|
29
32
|
}
|
|
30
33
|
}
|
|
34
|
+
|
|
35
|
+
// Only a sized outer view needs the pressable stretched to it. Sized by its content it must not be: Yoga grows a
|
|
36
|
+
// `flexGrow` child of a fit-content parent to the most it may take — inside a row centred on its cross axis, the
|
|
37
|
+
// pressable would stretch to the row's full height and leave its content at the top.
|
|
38
|
+
const sized = SIZING_KEYS.some(key => flat[key] !== undefined) || flat.top !== undefined && flat.bottom !== undefined;
|
|
31
39
|
return {
|
|
32
|
-
inner: [FILL, inner],
|
|
40
|
+
inner: sized ? [FILL, inner] : [inner],
|
|
33
41
|
outer: outer
|
|
34
42
|
};
|
|
35
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","CONTENT_KEYS","Set","FILL","flexGrow","splitForRipple","style","flat","flatten","outer","overflow","inner","key","value","Object","entries","has"],"sourceRoot":"../../src","sources":["ripple-clip.ts"],"mappings":";;AAAA,SAAQA,UAAU,QAAuB,cAAc;;AAEvD;AACA,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAS,CACnC,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,QAAQ,CACT,CAAC;AAEF,MAAMC,IAAe,GAAG;EAACC,QAAQ,EAAE;AAAC,CAAC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAIC,KAA4B,IAA6C;EACtG,MAAMC,IAAI,
|
|
1
|
+
{"version":3,"names":["StyleSheet","CONTENT_KEYS","Set","FILL","flexGrow","SIZING_KEYS","splitForRipple","style","flat","flatten","outer","overflow","inner","key","value","Object","entries","has","sized","some","undefined","top","bottom"],"sourceRoot":"../../src","sources":["ripple-clip.ts"],"mappings":";;AAAA,SAAQA,UAAU,QAAuB,cAAc;;AAEvD;AACA,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAS,CACnC,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,QAAQ,CACT,CAAC;AAEF,MAAMC,IAAe,GAAG;EAACC,QAAQ,EAAE;AAAC,CAAC;;AAErC;AACA,MAAMC,WAAW,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAU;;AAEpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAIC,KAA4B,IAA6C;EACtG,MAAMC,IAAI,GAAGR,UAAU,CAACS,OAAO,CAACF,KAAK,CAAC,IAAI,CAAC,CAAC;EAC5C,MAAMG,KAA8B,GAAG;IAACC,QAAQ,EAAE;EAAQ,CAAC;EAC3D,MAAMC,KAA8B,GAAG,CAAC,CAAC;EAEzC,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACR,IAAI,CAAC,EAAE;IAC/C,IAAIP,YAAY,CAACgB,GAAG,CAACJ,GAAG,CAAC,EAAE;MACzBD,KAAK,CAACC,GAAG,CAAC,GAAGC,KAAK;IACpB,CAAC,MAAM,IAAID,GAAG,KAAK,UAAU,EAAE;MAC7BH,KAAK,CAACG,GAAG,CAAC,GAAGC,KAAK;IACpB;EACF;;EAEA;EACA;EACA;EACA,MAAMI,KAAK,GACTb,WAAW,CAACc,IAAI,CAACN,GAAG,IAAIL,IAAI,CAACK,GAAG,CAAC,KAAKO,SAAS,CAAC,IAAKZ,IAAI,CAACa,GAAG,KAAKD,SAAS,IAAIZ,IAAI,CAACc,MAAM,KAAKF,SAAU;EAE3G,OAAO;IAACR,KAAK,EAAEM,KAAK,GAAG,CAACf,IAAI,EAAES,KAAK,CAAc,GAAG,CAACA,KAAK,CAAc;IAAEF,KAAK,EAAEA;EAAkB,CAAC;AACtG,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Column, Host } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { padding } from '@expo/ui/jetpack-compose/modifiers';
|
|
4
5
|
import { useSxModifiers } from '@hzblj/kara-sx';
|
|
5
6
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
-
import {
|
|
7
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
8
|
+
import { StatusBar, StyleSheet, View } from 'react-native';
|
|
7
9
|
import { HostBoundary } from "../../host-context.js";
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
/**
|
|
12
|
+
* The content keeps clear of as much of the status bar as the screen covers — all of it when nothing sits above the
|
|
13
|
+
* screen, none under a navigation bar — the way a SwiftUI host keeps to the safe area. Compose would draw under it:
|
|
14
|
+
* the app is edge to edge, and `Host` pads for nothing. The background still runs to the edge.
|
|
15
|
+
*/
|
|
9
16
|
export const Screen = ({
|
|
10
17
|
bg = 'surface.base',
|
|
11
18
|
children,
|
|
@@ -13,20 +20,34 @@ export const Screen = ({
|
|
|
13
20
|
testID
|
|
14
21
|
}) => {
|
|
15
22
|
const theme = useAppTheme();
|
|
16
|
-
const
|
|
23
|
+
const frame = useRef(null);
|
|
24
|
+
const [statusBarOverlap, setStatusBarOverlap] = useState(0);
|
|
25
|
+
const sx = useSxModifiers({
|
|
17
26
|
bg,
|
|
18
27
|
tall: true,
|
|
19
28
|
wide: true
|
|
20
29
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
const modifiers = useMemo(() => statusBarOverlap > 0 ? [...sx, padding(0, statusBarOverlap, 0, 0)] : sx, [statusBarOverlap, sx]);
|
|
31
|
+
const onLayout = useCallback(() => {
|
|
32
|
+
frame.current?.measureInWindow((_x, y) => {
|
|
33
|
+
setStatusBarOverlap(Math.max(0, Math.round((StatusBar.currentHeight ?? 0) - y)));
|
|
34
|
+
});
|
|
35
|
+
}, []);
|
|
36
|
+
return /*#__PURE__*/_jsx(View, {
|
|
37
|
+
onLayout: onLayout,
|
|
38
|
+
ref: frame,
|
|
25
39
|
style: StyleSheet.absoluteFill,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
testID: testID,
|
|
41
|
+
children: /*#__PURE__*/_jsx(Host, {
|
|
42
|
+
colorScheme: theme.dark ? 'dark' : 'light',
|
|
43
|
+
ignoreSafeAreaKeyboardInsets: ignoreKeyboardInset,
|
|
44
|
+
seedColor: theme.materialSeed,
|
|
45
|
+
style: StyleSheet.absoluteFill,
|
|
46
|
+
children: /*#__PURE__*/_jsx(Column, {
|
|
47
|
+
modifiers: modifiers,
|
|
48
|
+
children: /*#__PURE__*/_jsx(HostBoundary, {
|
|
49
|
+
children: children
|
|
50
|
+
})
|
|
30
51
|
})
|
|
31
52
|
})
|
|
32
53
|
});
|