@hzblj/kara-components 0.5.0 → 0.7.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 +71 -0
- package/README.md +31 -3
- 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/chip/chip.js +1 -1
- package/lib/module/atoms/chip/chip.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/index.js +0 -1
- package/lib/module/atoms/index.js.map +1 -1
- package/lib/module/atoms/pressable/pressable.js +11 -5
- 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/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/slider/slider.android.js +26 -2
- package/lib/module/atoms/slider/slider.android.js.map +1 -1
- package/lib/module/atoms/switch/switch.android.js +14 -4
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/haptics/haptics.js +56 -0
- package/lib/module/haptics/haptics.js.map +1 -0
- package/lib/module/haptics/index.js +5 -0
- package/lib/module/haptics/index.js.map +1 -0
- package/lib/module/haptics/use-haptic-feedback.js +33 -0
- package/lib/module/haptics/use-haptic-feedback.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.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/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/context-menu/context-menu.android.js +2 -2
- package/lib/module/organisms/context-menu/context-menu.android.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/templates/screen/screen.android.js +31 -10
- package/lib/module/templates/screen/screen.android.js.map +1 -1
- 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/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 +1 -0
- 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/index.d.ts +0 -1
- package/lib/typescript/atoms/island/island.types.d.ts +4 -0
- 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 +11 -1
- 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 +4 -0
- 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 -2
- 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 +5 -0
- 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 +12 -0
- 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/haptics/haptics.d.ts +61 -0
- package/lib/typescript/haptics/index.d.ts +2 -0
- package/lib/typescript/haptics/use-haptic-feedback.d.ts +15 -0
- package/lib/typescript/index.d.ts +1 -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 +3 -0
- package/lib/typescript/molecules/search-bar/search-bar.types.d.ts +8 -0
- package/lib/typescript/molecules/stepper/stepper.types.d.ts +13 -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 -9
- package/src/atoms/avatar/avatar.types.ts +5 -0
- package/src/atoms/badge/badge.types.ts +3 -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.tsx +1 -1
- 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.types.ts +1 -0
- 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/index.ts +0 -1
- package/src/atoms/island/island.types.ts +4 -0
- package/src/atoms/list/list.types.ts +2 -0
- package/src/atoms/picker/picker.types.ts +12 -0
- package/src/atoms/pressable/pressable.tsx +12 -5
- package/src/atoms/pressable/pressable.types.ts +12 -1
- 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.types.ts +4 -0
- 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.types.ts +5 -0
- package/src/atoms/slider/slider.android.tsx +33 -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 +18 -5
- package/src/atoms/switch/switch.types.ts +8 -0
- package/src/atoms/text/text.types.ts +12 -0
- 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/haptics/haptics.ts +68 -0
- package/src/haptics/index.ts +2 -0
- package/src/haptics/use-haptic-feedback.ts +36 -0
- package/src/index.ts +1 -0
- 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.types.ts +8 -0
- 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.types.ts +3 -0
- 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.types.ts +13 -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.android.tsx +2 -2
- 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/templates/screen/screen.android.tsx +33 -12
- package/src/templates/screen/screen.types.ts +9 -0
- 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 -28
- 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/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 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Slider","ComposeSlider","useAppTheme","useHostGuard","jsx","_jsx","disabled","max","min","onValueChange","step","value","theme","colors","activeTrackColor","color","thumbColor","enabled"
|
|
1
|
+
{"version":3,"names":["Slider","ComposeSlider","useAppTheme","useCallback","useEffect","useRef","haptics","useHostGuard","jsx","_jsx","disabled","max","min","onValueChange","step","value","theme","steps","Math","round","stopOf","at","stop","current","onChange","next","reached","tick","colors","activeTrackColor","color","thumbColor","enabled"],"sourceRoot":"../../../../src","sources":["atoms/slider/slider.android.tsx"],"mappings":";;AAAA,SAAQA,MAAM,IAAIC,aAAa,QAAO,0BAA0B;AAChE,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAO,OAAO;AAEpD,SAAQC,OAAO,QAAO,wBAAe;AACrC,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMT,MAAuB,GAAGA,CAAC;EACtCU,QAAQ,GAAG,KAAK;EAChBC,GAAG,GAAG,CAAC;EACPC,GAAG,GAAG,CAAC;EACPC,aAAa;EACbC,IAAI;EACJC;AACW,CAAC,KAAK;EACjBR,YAAY,CAAC,QAAQ,CAAC;EACtB,MAAMS,KAAK,GAAGd,WAAW,CAAC,CAAC;EAC3B,MAAMe,KAAK,GAAGH,IAAI,GAAGI,IAAI,CAACP,GAAG,CAAC,CAAC,EAAEO,IAAI,CAACC,KAAK,CAAC,CAACR,GAAG,GAAGC,GAAG,IAAIE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;;EAExE;EACA;EACA,MAAMM,MAAM,GAAGjB,WAAW,CAAEkB,EAAU,IAAMP,IAAI,GAAGI,IAAI,CAACC,KAAK,CAAC,CAACE,EAAE,GAAGT,GAAG,IAAIE,IAAI,CAAC,GAAG,CAAE,EAAE,CAACF,GAAG,EAAEE,IAAI,CAAC,CAAC;EACnG,MAAMQ,IAAI,GAAGjB,MAAM,CAACe,MAAM,CAACL,KAAK,CAAC,CAAC;EAElCX,SAAS,CAAC,MAAM;IACdkB,IAAI,CAACC,OAAO,GAAGH,MAAM,CAACL,KAAK,CAAC;EAC9B,CAAC,EAAE,CAACK,MAAM,EAAEL,KAAK,CAAC,CAAC;EAEnB,MAAMS,QAAQ,GAAGrB,WAAW,CACzBsB,IAAY,IAAK;IAChB,MAAMC,OAAO,GAAGN,MAAM,CAACK,IAAI,CAAC;IAE5B,IAAIR,KAAK,GAAG,CAAC,IAAIS,OAAO,KAAKJ,IAAI,CAACC,OAAO,EAAE;MACzCjB,OAAO,CAACqB,IAAI,CAAC,CAAC;IAChB;IAEAL,IAAI,CAACC,OAAO,GAAGG,OAAO;IACtBb,aAAa,GAAGY,IAAI,CAAC;EACvB,CAAC,EACD,CAACZ,aAAa,EAAEO,MAAM,EAAEH,KAAK,CAC/B,CAAC;EAED,oBACER,IAAA,CAACR,aAAa;IACZ2B,MAAM,EAAE;MACNC,gBAAgB,EAAEb,KAAK,CAACc,KAAK,CAAC,qBAAqB,CAAC;MACpDC,UAAU,EAAEf,KAAK,CAACc,KAAK,CAAC,qBAAqB;IAC/C,CAAE;IACFE,OAAO,EAAE,CAACtB,QAAS;IACnBC,GAAG,EAAEA,GAAI;IACTC,GAAG,EAAEA,GAAI;IACTC,aAAa,EAAEW,QAAS;IACxBP,KAAK,EAAEA,KAAM;IACbF,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
import { Switch as ComposeSwitch, Row, Text } from '@expo/ui/jetpack-compose';
|
|
4
4
|
import { clickable, fillMaxWidth } from '@expo/ui/jetpack-compose/modifiers';
|
|
5
5
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
-
import { useMemo } from 'react';
|
|
6
|
+
import { useCallback, useMemo } from 'react';
|
|
7
|
+
import { haptics } from "../../haptics/index.js";
|
|
7
8
|
import { useHostGuard } from "../../host-context.js";
|
|
8
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
|
+
|
|
9
13
|
/**
|
|
10
14
|
* Material's switch, tinted with the accent like SwiftUI's toggle. With a label it is a full-width row — label at the
|
|
11
|
-
* start, switch at the end — and the whole row toggles, the way a Material settings row does.
|
|
15
|
+
* start, switch at the end — and the whole row toggles, the way a Material settings row does. A flip plays
|
|
16
|
+
* `toggleOn`/`toggleOff` — Android 14's constants made for switches — since Compose's Material switch plays nothing
|
|
17
|
+
* of its own. iOS stays silent, as `UISwitch` does.
|
|
12
18
|
*/
|
|
13
19
|
export const Switch = ({
|
|
14
20
|
disabled = false,
|
|
@@ -18,7 +24,11 @@ export const Switch = ({
|
|
|
18
24
|
}) => {
|
|
19
25
|
useHostGuard('Switch');
|
|
20
26
|
const theme = useAppTheme();
|
|
21
|
-
const
|
|
27
|
+
const toggle = useCallback(next => {
|
|
28
|
+
haptics.play(next ? 'toggleOn' : 'toggleOff');
|
|
29
|
+
onValueChange?.(next);
|
|
30
|
+
}, [onValueChange]);
|
|
31
|
+
const rowModifiers = useMemo(() => disabled || !onValueChange ? [fillMaxWidth()] : [fillMaxWidth(), clickable(() => toggle(!value))], [disabled, onValueChange, toggle, value]);
|
|
22
32
|
const control = /*#__PURE__*/_jsx(ComposeSwitch, {
|
|
23
33
|
colors: {
|
|
24
34
|
checkedBorderColor: theme.color('fill.accent.primary'),
|
|
@@ -26,7 +36,7 @@ export const Switch = ({
|
|
|
26
36
|
checkedTrackColor: theme.color('fill.accent.primary')
|
|
27
37
|
},
|
|
28
38
|
enabled: !disabled,
|
|
29
|
-
onCheckedChange: onValueChange,
|
|
39
|
+
onCheckedChange: onValueChange ? toggle : NOOP,
|
|
30
40
|
value: value
|
|
31
41
|
});
|
|
32
42
|
if (!label) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Switch","ComposeSwitch","Row","Text","clickable","fillMaxWidth","useAppTheme","useMemo","useHostGuard","jsx","_jsx","jsxs","_jsxs","disabled","label","onValueChange","value","theme","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,OAAO,QAAO,OAAO;
|
|
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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":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { HAPTICS, playHaptic, prepareHaptic } from '@hzblj/kara-native';
|
|
4
|
+
let enabled = true;
|
|
5
|
+
const play = (haptic, options) => {
|
|
6
|
+
if (enabled) {
|
|
7
|
+
playHaptic(haptic, options?.intensity);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const prepare = haptic => {
|
|
11
|
+
if (enabled) {
|
|
12
|
+
prepareHaptic(haptic);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const shorthands = Object.fromEntries(HAPTICS.map(haptic => [haptic, options => play(haptic, options)]));
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The platform's own haptic feedback, named for what happened: UIKit's feedback generators on iOS, the system's
|
|
19
|
+
* `HapticFeedbackConstants` on Android — never a raw vibration. Both follow the user's system haptics setting, and
|
|
20
|
+
* every call is synchronous, with nothing to await.
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* haptics.success() // a name you know: one function per haptic
|
|
24
|
+
* haptics.play(haptic) // a name that arrives as data
|
|
25
|
+
* haptics.light({intensity: 0.6}) // impacts scale on iOS
|
|
26
|
+
* haptics.prepare('selection') // iOS: warm the Taptic Engine as a gesture begins
|
|
27
|
+
* haptics.setEnabled(userPreference) // silences every kara haptic, the components' own too
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* - `selection` — a choice changed: a segment, a chip, a picker row.
|
|
31
|
+
* - `tick` — one step of a continuous gesture: a slider detent, a scrubbed value.
|
|
32
|
+
* - `toggleOn` / `toggleOff` — a switch flipped.
|
|
33
|
+
* - `success` / `warning` / `error` — how a task ended. Android has no warning of its own; it plays a rejection.
|
|
34
|
+
* - `longPress` / `dragStart` — a long press was recognised; an item lifted to be dragged.
|
|
35
|
+
* - `thresholdActivate` / `thresholdDeactivate` — a gesture crossed its commit point, or went back over it.
|
|
36
|
+
* - `keyPress` — a key of the app's own keypad.
|
|
37
|
+
* - `soft`, `light`, `medium`, `rigid`, `heavy` — a collision none of the names above describes.
|
|
38
|
+
*
|
|
39
|
+
* On Android the names that came with Android 14's constants fall back to the nearest older feedback, so every name
|
|
40
|
+
* plays on every version. Haptics are silent in a build without kara's native module.
|
|
41
|
+
*/
|
|
42
|
+
export const haptics = {
|
|
43
|
+
...shorthands,
|
|
44
|
+
/** Whether kara plays haptics — `true` until `setEnabled(false)`. */
|
|
45
|
+
isEnabled: () => enabled,
|
|
46
|
+
play,
|
|
47
|
+
prepare,
|
|
48
|
+
/**
|
|
49
|
+
* Switches every kara haptic on or off, the ones its components play included — for an app's own "Haptics" setting.
|
|
50
|
+
* Not persisted: call it at start-up with the stored preference. The system setting applies either way.
|
|
51
|
+
*/
|
|
52
|
+
setEnabled: value => {
|
|
53
|
+
enabled = value;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=haptics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HAPTICS","playHaptic","prepareHaptic","enabled","play","haptic","options","intensity","prepare","shorthands","Object","fromEntries","map","haptics","isEnabled","setEnabled","value"],"sourceRoot":"../../../src","sources":["haptics/haptics.ts"],"mappings":";;AAAA,SAAQA,OAAO,EAAeC,UAAU,EAAEC,aAAa,QAAO,oBAAoB;AAWlF,IAAIC,OAAO,GAAG,IAAI;AAElB,MAAMC,IAAI,GAAGA,CAACC,MAAc,EAAEC,OAAuB,KAAW;EAC9D,IAAIH,OAAO,EAAE;IACXF,UAAU,CAACI,MAAM,EAAEC,OAAO,EAAEC,SAAS,CAAC;EACxC;AACF,CAAC;AAED,MAAMC,OAAO,GAAIH,MAAc,IAAW;EACxC,IAAIF,OAAO,EAAE;IACXD,aAAa,CAACG,MAAM,CAAC;EACvB;AACF,CAAC;AAED,MAAMI,UAAU,GAAGC,MAAM,CAACC,WAAW,CACnCX,OAAO,CAACY,GAAG,CAACP,MAAM,IAAI,CAACA,MAAM,EAAGC,OAAuB,IAAKF,IAAI,CAACC,MAAM,EAAEC,OAAO,CAAC,CAAC,CACpF,CAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,OAAO,GAAG;EACrB,GAAGJ,UAAU;EACb;EACAK,SAAS,EAAEA,CAAA,KAAeX,OAAO;EACjCC,IAAI;EACJI,OAAO;EACP;AACF;AACA;AACA;EACEO,UAAU,EAAGC,KAAc,IAAW;IACpCb,OAAO,GAAGa,KAAK;EACjB;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["haptics","useHapticFeedback"],"sourceRoot":"../../../src","sources":["haptics/index.ts"],"mappings":";;AAAA,SAAyCA,OAAO,QAAO,cAAW;AAClE,SAA6BC,iBAAiB,QAAO,0BAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { haptics } from "./haptics.js";
|
|
5
|
+
|
|
6
|
+
/** Picks the haptic for one change of a trigger — or none, to stay silent for that change. */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Plays a haptic whenever `trigger` changes — never on mount — like SwiftUI's `sensoryFeedback(_:trigger:)`. Give it
|
|
10
|
+
* a haptic, or a function of the previous and next value that picks one per change. Changes are compared with
|
|
11
|
+
* `Object.is`, so a trigger is a primitive or a stable reference.
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* useHapticFeedback(tab, 'selection')
|
|
15
|
+
* useHapticFeedback(quantity, (before, after) => (after > before ? 'tick' : 'soft'))
|
|
16
|
+
* useHapticFeedback(payment.status, (_, status) => status === 'paid' ? 'success' : status === 'failed' && 'error')
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const useHapticFeedback = (trigger, feedback) => {
|
|
20
|
+
const previous = useRef(trigger);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const before = previous.current;
|
|
23
|
+
if (Object.is(before, trigger)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
previous.current = trigger;
|
|
27
|
+
const haptic = typeof feedback === 'function' ? feedback(before, trigger) : feedback;
|
|
28
|
+
if (haptic) {
|
|
29
|
+
haptics.play(haptic);
|
|
30
|
+
}
|
|
31
|
+
}, [feedback, trigger]);
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=use-haptic-feedback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","haptics","useHapticFeedback","trigger","feedback","previous","before","current","Object","is","haptic","play"],"sourceRoot":"../../../src","sources":["haptics/use-haptic-feedback.ts"],"mappings":";;AAAA,SAAQA,SAAS,EAAEC,MAAM,QAAO,OAAO;AAEvC,SAAqBC,OAAO,QAAO,cAAW;;AAE9C;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAAIC,OAAU,EAAEC,QAAoC,KAAW;EAC9F,MAAMC,QAAQ,GAAGL,MAAM,CAACG,OAAO,CAAC;EAEhCJ,SAAS,CAAC,MAAM;IACd,MAAMO,MAAM,GAAGD,QAAQ,CAACE,OAAO;IAE/B,IAAIC,MAAM,CAACC,EAAE,CAACH,MAAM,EAAEH,OAAO,CAAC,EAAE;MAC9B;IACF;IAEAE,QAAQ,CAACE,OAAO,GAAGJ,OAAO;IAC1B,MAAMO,MAAM,GAAG,OAAON,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACE,MAAM,EAAEH,OAAO,CAAC,GAAGC,QAAQ;IAEpF,IAAIM,MAAM,EAAE;MACVT,OAAO,CAACU,IAAI,CAACD,MAAM,CAAC;IACtB;EACF,CAAC,EAAE,CAACN,QAAQ,EAAED,OAAO,CAAC,CAAC;AACzB,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,sBAAa;AAC3B,cAAc,sBAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,kBAAS;AACvB,cAAc,oBAAW;AACzB,cAAc,sBAAa;AAC3B,cAAc,sBAAa;AAC3B,cAAc,sBAAa","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
4
|
-
import { TextInput } from 'react-native';
|
|
4
|
+
import { Platform, TextInput } from 'react-native';
|
|
5
5
|
import { Box } from "../../atoms/box/index.js";
|
|
6
6
|
import { Pressable } from "../../atoms/pressable/index.js";
|
|
7
7
|
import { RnGlyph } from "../../glyph/index.js";
|
|
@@ -13,6 +13,19 @@ export const SearchBar = ({
|
|
|
13
13
|
value
|
|
14
14
|
}) => {
|
|
15
15
|
const theme = useAppTheme();
|
|
16
|
+
const {
|
|
17
|
+
lineHeight,
|
|
18
|
+
...face
|
|
19
|
+
} = theme.typography.body;
|
|
20
|
+
/**
|
|
21
|
+
* A single-line `UITextField` sets its text against the bottom of a line taller than the font, so the variant's
|
|
22
|
+
* `lineHeight` pushed the text below the magnifier beside it. iOS takes the face without it, in a field as tall as
|
|
23
|
+
* the line would have been; Android centres the line and keeps it.
|
|
24
|
+
*/
|
|
25
|
+
const text = Platform.OS === 'ios' ? {
|
|
26
|
+
...face,
|
|
27
|
+
height: lineHeight
|
|
28
|
+
} : theme.typography.body;
|
|
16
29
|
return /*#__PURE__*/_jsxs(Box, {
|
|
17
30
|
align: "center",
|
|
18
31
|
bg: "fill.quaternary",
|
|
@@ -31,7 +44,7 @@ export const SearchBar = ({
|
|
|
31
44
|
onChangeText: onChangeText,
|
|
32
45
|
placeholder: placeholder,
|
|
33
46
|
placeholderTextColor: theme.color('content.quaternary'),
|
|
34
|
-
style: [
|
|
47
|
+
style: [text, {
|
|
35
48
|
color: theme.color('content.primary'),
|
|
36
49
|
flex: 1,
|
|
37
50
|
padding: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAppTheme","TextInput","Box","Pressable","RnGlyph","jsx","_jsx","jsxs","_jsxs","SearchBar","onChangeText","placeholder","testID","value","theme","align","bg","borderRadius","flexDirection","gap","px","py","wide","children","color","name","size","placeholderTextColor","style","
|
|
1
|
+
{"version":3,"names":["useAppTheme","Platform","TextInput","Box","Pressable","RnGlyph","jsx","_jsx","jsxs","_jsxs","SearchBar","onChangeText","placeholder","testID","value","theme","lineHeight","face","typography","body","text","OS","height","align","bg","borderRadius","flexDirection","gap","px","py","wide","children","color","name","size","placeholderTextColor","style","flex","padding","length","onPress"],"sourceRoot":"../../../../src","sources":["molecules/search-bar/search-bar.tsx"],"mappings":";;AAAA,SAAQA,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,QAAQ,EAAEC,SAAS,QAAO,cAAc;AAEhD,SAAQC,GAAG,QAAO,0BAAiB;AACnC,SAAQC,SAAS,QAAO,gCAAuB;AAC/C,SAAQC,OAAO,QAAO,sBAAa;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGnC,OAAO,MAAMC,SAA6B,GAAGA,CAAC;EAC5CC,YAAY;EACZC,WAAW,GAAG,QAAQ;EACtBC,MAAM;EACNC;AACc,CAAC,KAAK;EACpB,MAAMC,KAAK,GAAGf,WAAW,CAAC,CAAC;EAC3B,MAAM;IAACgB,UAAU;IAAE,GAAGC;EAAI,CAAC,GAAGF,KAAK,CAACG,UAAU,CAACC,IAAI;EACnD;AACF;AACA;AACA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
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Text as ComposeText
|
|
3
|
+
import { Text as ComposeText } from '@expo/ui/jetpack-compose';
|
|
4
|
+
import { TooltipBox } from '@hzblj/kara-native/jetpack-compose';
|
|
4
5
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
+
import { useCallback } from 'react';
|
|
5
7
|
import { useHostGuard } from "../../host-context.js";
|
|
6
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
/**
|
|
10
|
+
* Material's plain tooltip in kara's controlled `TooltipBox`: shown while `visible`, centred above the anchor and kept
|
|
11
|
+
* inside the window. Material's own would open on a long press and hide itself without a word to JS.
|
|
12
|
+
*/
|
|
7
13
|
export const Tooltip = ({
|
|
8
14
|
children,
|
|
9
|
-
|
|
15
|
+
onDismiss,
|
|
16
|
+
text,
|
|
17
|
+
visible
|
|
10
18
|
}) => {
|
|
11
19
|
useHostGuard('Tooltip');
|
|
12
20
|
const theme = useAppTheme();
|
|
21
|
+
const onDismissRequest = useCallback(() => onDismiss(), [onDismiss]);
|
|
13
22
|
return /*#__PURE__*/_jsxs(TooltipBox, {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
containerColor: theme.color('surface.high.contrast'),
|
|
24
|
+
isPresented: visible,
|
|
25
|
+
onDismissRequest: onDismissRequest,
|
|
26
|
+
plain: true,
|
|
27
|
+
children: [/*#__PURE__*/_jsx(TooltipBox.Text, {
|
|
17
28
|
children: /*#__PURE__*/_jsx(ComposeText, {
|
|
18
29
|
color: theme.colorString('content.on.high.contrast'),
|
|
19
30
|
style: theme.typography.footnote,
|
|
@@ -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,QAA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,eAC/DpB,IAAA,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":[]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { Text as ComposeText, DropdownMenu, DropdownMenuItem, Host } from '@expo/ui/jetpack-compose';
|
|
4
4
|
import { useSx } from '@hzblj/kara-sx';
|
|
5
5
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
-
import * as Haptics from 'expo-haptics';
|
|
7
6
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
8
7
|
import { Pressable, StyleSheet, View } from 'react-native';
|
|
9
8
|
import { Icon } from "../../atoms/icon/index.js";
|
|
9
|
+
import { haptics } from "../../haptics/index.js";
|
|
10
10
|
import { HostBoundary } from "../../host-context.js";
|
|
11
11
|
import { splitForRipple } from "../../ripple-clip.js";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -87,7 +87,7 @@ const ContextMenuRoot = ({
|
|
|
87
87
|
pageX,
|
|
88
88
|
pageY
|
|
89
89
|
} = event.nativeEvent;
|
|
90
|
-
|
|
90
|
+
haptics.longPress();
|
|
91
91
|
// The touch in the trigger's own coordinates: `locationX/Y` are relative to whichever child was touched.
|
|
92
92
|
trigger.current?.measure((_x, _y, _width, _height, left, top) => {
|
|
93
93
|
setAnchor({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","ComposeText","DropdownMenu","DropdownMenuItem","Host","useSx","useAppTheme","
|
|
1
|
+
{"version":3,"names":["Text","ComposeText","DropdownMenu","DropdownMenuItem","Host","useSx","useAppTheme","useCallback","useMemo","useRef","useState","Pressable","StyleSheet","View","Icon","haptics","HostBoundary","splitForRipple","jsx","_jsx","jsxs","_jsxs","styles","create","anchor","height","position","width","MenuRow","action","onDismiss","theme","color","destructive","onClick","onPress","children","colorString","style","typography","body","label","icon","LeadingIcon","name","size","ContextMenuRoot","actions","testID","props","onPreviewPress","_onPreviewPress","preview","_preview","previewTransition","_previewTransition","sx","resolved","trigger","setAnchor","expanded","setExpanded","inner","outer","ripple","highlight","backgroundColor","open","event","pageX","pageY","nativeEvent","longPress","current","measure","_x","_y","_width","_height","left","top","x","y","dismiss","android_ripple","onLongPress","ref","pointerEvents","absoluteFill","colorScheme","dark","seedColor","materialSeed","onDismissRequest","Items","map","Exclusion","ContextMenu","Object","assign"],"sourceRoot":"../../../../src","sources":["organisms/context-menu/context-menu.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,IAAIC,WAAW,EAAEC,YAAY,EAAEC,gBAAgB,EAAEC,IAAI,QAAO,0BAA0B;AAClG,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAO,OAAO;AAC5D,SAAoCC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAO,cAAc;AACpF,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,OAAO,QAAO,wBAAe;AACrC,SAAQC,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,cAAc,QAAO,sBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMhD,MAAMC,MAAM,GAAGV,UAAU,CAACW,MAAM,CAAC;EAC/B;EACAC,MAAM,EAAE;IAACC,MAAM,EAAE,CAAC;IAAEC,QAAQ,EAAE,UAAU;IAAEC,KAAK,EAAE;EAAC;AACpD,CAAC,CAAC;AAOF;AACA,MAAMC,OAAO,GAAGA,CAAC;EAACC,MAAM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AC,CACgB;UAAC,CACT;QAAC,CACH;MAAC,CACX,CAAC,GACL,IAAI;IAAA,CACC;EAAC,CACR,CAAC;AAEX,CAAC;;AAED;AACA,MAAMuD,SAAS,GAAGA,CAAC;EAAC5D;AAAmC,CAAC,kBAAKjB,IAAA,CAACN,IAAI;EAAAuB,QAAA,EAAEA;AAAQ,CAAO,CAAC;AAEpF,OAAO,MAAM6D,WAAiC,GAAGC,MAAM,CAACC,MAAM,CAACrD,eAAe,EAAE;EAACkD;AAAS,CAAC,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, {
|