@hzblj/kara-components 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/lib/module/atoms/badge/badge.android.js +8 -2
- package/lib/module/atoms/badge/badge.android.js.map +1 -1
- package/lib/module/atoms/button/button-tokens.js +39 -0
- package/lib/module/atoms/button/button-tokens.js.map +1 -1
- package/lib/module/atoms/button/button.android.js +40 -12
- package/lib/module/atoms/button/button.android.js.map +1 -1
- package/lib/module/atoms/button/button.ios.js +5 -2
- package/lib/module/atoms/button/button.ios.js.map +1 -1
- package/lib/module/atoms/checkbox/checkbox.android.js +17 -2
- package/lib/module/atoms/checkbox/checkbox.android.js.map +1 -1
- package/lib/module/atoms/date-picker/date-picker.android.js +72 -0
- package/lib/module/atoms/date-picker/date-picker.android.js.map +1 -0
- package/lib/module/atoms/date-picker/{date-picker.js → date-picker.ios.js} +4 -7
- package/lib/module/atoms/date-picker/date-picker.ios.js.map +1 -0
- package/lib/module/atoms/date-picker/index.js +1 -1
- package/lib/module/atoms/date-picker/index.js.map +1 -1
- package/lib/module/atoms/fab/fab.android.js +5 -3
- package/lib/module/atoms/fab/fab.android.js.map +1 -1
- package/lib/module/atoms/glass-view/glass-fallback.js +5 -2
- package/lib/module/atoms/glass-view/glass-fallback.js.map +1 -1
- package/lib/module/atoms/icon/icon.android.js +10 -12
- package/lib/module/atoms/icon/icon.android.js.map +1 -1
- package/lib/module/atoms/icon/icon.ios.js +15 -3
- package/lib/module/atoms/icon/icon.ios.js.map +1 -1
- package/lib/module/atoms/icon/index.js +0 -1
- package/lib/module/atoms/icon/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/list/list.android.js +8 -2
- package/lib/module/atoms/list/list.android.js.map +1 -1
- package/lib/module/atoms/picker/index.js +1 -1
- package/lib/module/atoms/picker/index.js.map +1 -1
- package/lib/module/atoms/picker/picker.android.js +87 -0
- package/lib/module/atoms/picker/picker.android.js.map +1 -0
- package/lib/module/atoms/picker/{picker.js → picker.ios.js} +1 -1
- package/lib/module/atoms/picker/picker.ios.js.map +1 -0
- package/lib/module/atoms/rn-icon/index.js +5 -0
- package/lib/module/atoms/rn-icon/index.js.map +1 -0
- package/lib/module/atoms/rn-icon/rn-icon.android.js +29 -0
- package/lib/module/atoms/rn-icon/rn-icon.android.js.map +1 -0
- package/lib/module/atoms/rn-icon/rn-icon.ios.js +29 -0
- package/lib/module/atoms/rn-icon/rn-icon.ios.js.map +1 -0
- package/lib/module/atoms/rn-icon/rn-icon.types.js +4 -0
- package/lib/module/atoms/rn-icon/rn-icon.types.js.map +1 -0
- package/lib/module/atoms/surface/surface.android.js +33 -5
- package/lib/module/atoms/surface/surface.android.js.map +1 -1
- package/lib/module/atoms/switch/switch.android.js +14 -1
- package/lib/module/atoms/switch/switch.android.js.map +1 -1
- package/lib/module/glyph/glyph-button.android.js +25 -0
- package/lib/module/glyph/glyph-button.android.js.map +1 -0
- package/lib/module/glyph/glyph-button.ios.js +33 -0
- package/lib/module/glyph/glyph-button.ios.js.map +1 -0
- package/lib/module/glyph/glyph-button.types.js +4 -0
- package/lib/module/glyph/glyph-button.types.js.map +1 -0
- package/lib/module/glyph/glyph.android.js +20 -0
- package/lib/module/glyph/glyph.android.js.map +1 -0
- package/lib/module/glyph/glyph.ios.js +24 -0
- package/lib/module/glyph/glyph.ios.js.map +1 -0
- package/lib/module/glyph/glyph.types.js +4 -0
- package/lib/module/glyph/glyph.types.js.map +1 -0
- package/lib/module/glyph/index.js +8 -0
- package/lib/module/glyph/index.js.map +1 -0
- package/lib/module/glyph/rn-glyph.android.js +25 -0
- package/lib/module/glyph/rn-glyph.android.js.map +1 -0
- package/lib/module/glyph/rn-glyph.ios.js +26 -0
- package/lib/module/glyph/rn-glyph.ios.js.map +1 -0
- package/lib/module/molecules/collapsible/collapsible.android.js +2 -2
- package/lib/module/molecules/collapsible/collapsible.android.js.map +1 -1
- package/lib/module/molecules/labeled-content/labeled-content.js +2 -1
- package/lib/module/molecules/labeled-content/labeled-content.js.map +1 -1
- package/lib/module/molecules/list-item/list-item.js +2 -1
- package/lib/module/molecules/list-item/list-item.js.map +1 -1
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js +8 -4
- package/lib/module/molecules/navigation-bar/navigation-bar.android.js.map +1 -1
- package/lib/module/molecules/radio-group/radio-group.android.js +5 -0
- package/lib/module/molecules/radio-group/radio-group.android.js.map +1 -1
- package/lib/module/molecules/radio-group/radio-group.ios.js +2 -2
- package/lib/module/molecules/radio-group/radio-group.ios.js.map +1 -1
- package/lib/module/molecules/search-bar/search-bar.js +10 -23
- package/lib/module/molecules/search-bar/search-bar.js.map +1 -1
- package/lib/module/molecules/stepper/stepper.android.js +7 -5
- package/lib/module/molecules/stepper/stepper.android.js.map +1 -1
- package/lib/module/organisms/alert/alert.android.js +42 -13
- package/lib/module/organisms/alert/alert.android.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.android.js +82 -31
- package/lib/module/organisms/context-menu/context-menu.android.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.ios.js +37 -16
- package/lib/module/organisms/context-menu/context-menu.ios.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.android.js +6 -2
- package/lib/module/organisms/fab-menu/fab-menu.android.js.map +1 -1
- package/lib/module/organisms/fab-menu/fab-menu.ios.js +15 -6
- package/lib/module/organisms/fab-menu/fab-menu.ios.js.map +1 -1
- package/lib/module/organisms/form/form.android.js +1 -0
- package/lib/module/organisms/form/form.android.js.map +1 -1
- package/lib/module/organisms/index.js +0 -1
- package/lib/module/organisms/index.js.map +1 -1
- package/lib/module/organisms/menu/menu.android.js +51 -33
- package/lib/module/organisms/menu/menu.android.js.map +1 -1
- package/lib/typescript/atoms/button/button-tokens.d.ts +6 -1
- package/lib/typescript/atoms/date-picker/date-picker.d.ts +1 -2
- package/lib/typescript/atoms/date-picker/date-picker.ios.d.ts +3 -0
- package/lib/typescript/atoms/glass-view/glass-fallback.d.ts +4 -1
- package/lib/typescript/atoms/glass-view/glass-view.types.d.ts +1 -1
- package/lib/typescript/atoms/icon/icon.ios.d.ts +4 -0
- package/lib/typescript/atoms/icon/icon.types.d.ts +18 -1
- package/lib/typescript/atoms/icon/index.d.ts +0 -1
- package/lib/typescript/atoms/index.d.ts +1 -1
- package/lib/typescript/atoms/list/list.types.d.ts +9 -0
- package/lib/typescript/atoms/picker/picker.d.ts +1 -2
- package/lib/typescript/atoms/picker/picker.ios.d.ts +2 -0
- package/lib/typescript/atoms/rn-icon/index.d.ts +2 -0
- package/lib/typescript/atoms/rn-icon/rn-icon.d.ts +1 -0
- package/lib/typescript/atoms/rn-icon/rn-icon.ios.d.ts +3 -0
- package/lib/typescript/atoms/rn-icon/rn-icon.types.d.ts +5 -0
- package/lib/typescript/glyph/glyph-button.d.ts +1 -0
- package/lib/typescript/glyph/glyph-button.ios.d.ts +2 -0
- package/lib/typescript/glyph/glyph-button.types.d.ts +10 -0
- package/lib/typescript/glyph/glyph.d.ts +1 -0
- package/lib/typescript/glyph/glyph.ios.d.ts +3 -0
- package/lib/typescript/glyph/glyph.types.d.ts +13 -0
- package/lib/typescript/glyph/index.d.ts +5 -0
- package/lib/typescript/glyph/rn-glyph.d.ts +1 -0
- package/lib/typescript/glyph/rn-glyph.ios.d.ts +3 -0
- package/lib/typescript/molecules/scroll-edge-container/scroll-edge-container.types.d.ts +3 -0
- package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +28 -2
- package/lib/typescript/organisms/fab-menu/fab-menu.types.d.ts +1 -1
- package/lib/typescript/organisms/form/form.types.d.ts +5 -0
- package/lib/typescript/organisms/index.d.ts +0 -1
- package/package.json +4 -6
- package/src/atoms/badge/badge.android.tsx +5 -2
- package/src/atoms/button/button-tokens.ts +49 -0
- package/src/atoms/button/button.android.tsx +46 -12
- package/src/atoms/button/button.ios.tsx +5 -2
- package/src/atoms/checkbox/checkbox.android.tsx +21 -4
- package/src/atoms/date-picker/date-picker.android.tsx +74 -0
- package/src/atoms/date-picker/date-picker.ios.tsx +27 -0
- package/src/atoms/fab/fab.android.tsx +4 -1
- package/src/atoms/glass-view/glass-fallback.tsx +5 -2
- package/src/atoms/glass-view/glass-view.types.ts +1 -1
- package/src/atoms/icon/icon.android.tsx +11 -7
- package/src/atoms/icon/icon.ios.tsx +25 -5
- package/src/atoms/icon/icon.types.ts +18 -24
- package/src/atoms/icon/index.ts +0 -1
- package/src/atoms/index.ts +1 -1
- package/src/atoms/list/list.android.tsx +12 -1
- package/src/atoms/list/list.types.ts +9 -0
- package/src/atoms/picker/picker.android.tsx +88 -0
- package/src/atoms/rn-icon/index.ts +2 -0
- package/src/atoms/rn-icon/rn-icon.android.tsx +28 -0
- package/src/atoms/rn-icon/rn-icon.ios.tsx +28 -0
- package/src/atoms/rn-icon/rn-icon.types.ts +8 -0
- package/src/atoms/surface/surface.android.tsx +28 -4
- package/src/atoms/switch/switch.android.tsx +24 -3
- package/src/glyph/glyph-button.android.tsx +25 -0
- package/src/glyph/glyph-button.ios.tsx +37 -0
- package/src/glyph/glyph-button.types.ts +12 -0
- package/src/glyph/glyph.android.tsx +12 -0
- package/src/glyph/glyph.ios.tsx +15 -0
- package/src/glyph/glyph.types.ts +15 -0
- package/src/glyph/index.ts +5 -0
- package/src/glyph/rn-glyph.android.tsx +14 -0
- package/src/glyph/rn-glyph.ios.tsx +16 -0
- package/src/molecules/collapsible/collapsible.android.tsx +2 -2
- package/src/molecules/labeled-content/labeled-content.tsx +2 -1
- package/src/molecules/list-item/list-item.tsx +2 -1
- package/src/molecules/navigation-bar/navigation-bar.android.tsx +11 -4
- package/src/molecules/radio-group/radio-group.android.tsx +11 -2
- package/src/molecules/radio-group/radio-group.ios.tsx +2 -2
- package/src/molecules/scroll-edge-container/scroll-edge-container.types.ts +3 -0
- package/src/molecules/search-bar/search-bar.tsx +4 -9
- package/src/molecules/stepper/stepper.android.tsx +3 -3
- package/src/organisms/alert/alert.android.tsx +44 -7
- package/src/organisms/context-menu/context-menu.android.tsx +71 -37
- package/src/organisms/context-menu/context-menu.ios.tsx +40 -18
- package/src/organisms/context-menu/context-menu.types.ts +29 -3
- package/src/organisms/fab-menu/fab-menu.android.tsx +3 -2
- package/src/organisms/fab-menu/fab-menu.ios.tsx +13 -12
- package/src/organisms/fab-menu/fab-menu.types.ts +1 -1
- package/src/organisms/form/form.android.tsx +1 -1
- package/src/organisms/form/form.types.ts +5 -0
- package/src/organisms/index.ts +0 -1
- package/src/organisms/menu/menu.android.tsx +36 -30
- package/lib/module/atoms/countdown/countdown-frame.js +0 -115
- package/lib/module/atoms/countdown/countdown-frame.js.map +0 -1
- package/lib/module/atoms/countdown/countdown-units.js +0 -25
- package/lib/module/atoms/countdown/countdown-units.js.map +0 -1
- package/lib/module/atoms/countdown/countdown.android.js +0 -53
- package/lib/module/atoms/countdown/countdown.android.js.map +0 -1
- package/lib/module/atoms/countdown/countdown.ios.js +0 -50
- package/lib/module/atoms/countdown/countdown.ios.js.map +0 -1
- package/lib/module/atoms/countdown/countdown.types.js +0 -4
- package/lib/module/atoms/countdown/countdown.types.js.map +0 -1
- package/lib/module/atoms/countdown/index.js +0 -5
- package/lib/module/atoms/countdown/index.js.map +0 -1
- package/lib/module/atoms/date-picker/date-picker.js.map +0 -1
- package/lib/module/atoms/icon/icon-names.js +0 -53
- package/lib/module/atoms/icon/icon-names.js.map +0 -1
- package/lib/module/atoms/picker/picker.js.map +0 -1
- package/lib/module/organisms/rn-context-menu/index.js +0 -5
- package/lib/module/organisms/rn-context-menu/index.js.map +0 -1
- package/lib/module/organisms/rn-context-menu/rn-context-menu.android.js +0 -101
- package/lib/module/organisms/rn-context-menu/rn-context-menu.android.js.map +0 -1
- package/lib/module/organisms/rn-context-menu/rn-context-menu.ios.js +0 -44
- package/lib/module/organisms/rn-context-menu/rn-context-menu.ios.js.map +0 -1
- package/lib/module/organisms/rn-context-menu/rn-context-menu.types.js +0 -4
- package/lib/module/organisms/rn-context-menu/rn-context-menu.types.js.map +0 -1
- package/lib/typescript/atoms/countdown/countdown-frame.d.ts +0 -17
- package/lib/typescript/atoms/countdown/countdown-units.d.ts +0 -5
- package/lib/typescript/atoms/countdown/countdown.d.ts +0 -1
- package/lib/typescript/atoms/countdown/countdown.ios.d.ts +0 -2
- package/lib/typescript/atoms/countdown/countdown.types.d.ts +0 -21
- package/lib/typescript/atoms/countdown/index.d.ts +0 -2
- package/lib/typescript/atoms/icon/icon-names.d.ts +0 -50
- package/lib/typescript/organisms/rn-context-menu/index.d.ts +0 -2
- package/lib/typescript/organisms/rn-context-menu/rn-context-menu.d.ts +0 -1
- package/lib/typescript/organisms/rn-context-menu/rn-context-menu.ios.d.ts +0 -2
- package/lib/typescript/organisms/rn-context-menu/rn-context-menu.types.d.ts +0 -33
- package/src/atoms/countdown/countdown-frame.tsx +0 -123
- package/src/atoms/countdown/countdown-units.ts +0 -37
- package/src/atoms/countdown/countdown.android.tsx +0 -49
- package/src/atoms/countdown/countdown.ios.tsx +0 -46
- package/src/atoms/countdown/countdown.types.ts +0 -24
- package/src/atoms/countdown/index.ts +0 -2
- package/src/atoms/date-picker/date-picker.tsx +0 -26
- package/src/atoms/icon/icon-names.ts +0 -53
- package/src/organisms/rn-context-menu/index.ts +0 -2
- package/src/organisms/rn-context-menu/rn-context-menu.android.tsx +0 -90
- package/src/organisms/rn-context-menu/rn-context-menu.ios.tsx +0 -47
- package/src/organisms/rn-context-menu/rn-context-menu.types.ts +0 -36
- /package/src/atoms/picker/{picker.tsx → picker.ios.tsx} +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
const FALLBACK_UNITS = ['d', 'h', 'm', 's'];
|
|
5
|
-
/** The first letter of the locale's short unit name — `d`, `h`, `m`, `s` in English, `d`, `h`, `m`, `s` in Czech too. */
|
|
6
|
-
const unitInitial = (locale, unit, fallback) => {
|
|
7
|
-
try {
|
|
8
|
-
const parts = new Intl.NumberFormat(locale, {
|
|
9
|
-
style: 'unit',
|
|
10
|
-
unit,
|
|
11
|
-
unitDisplay: 'short'
|
|
12
|
-
}).formatToParts(1);
|
|
13
|
-
const initial = parts.find(part => part.type === 'unit')?.value.trim().charAt(0);
|
|
14
|
-
return initial || fallback;
|
|
15
|
-
} catch {
|
|
16
|
-
return fallback;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/** The caller's units, else the locale's initials, else English ones. */
|
|
21
|
-
export const useCountdownUnits = (locale, units) => useMemo(() => units ?? [unitInitial(locale, 'day', FALLBACK_UNITS[0]), unitInitial(locale, 'hour', FALLBACK_UNITS[1]), unitInitial(locale, 'minute', FALLBACK_UNITS[2]), unitInitial(locale, 'second', FALLBACK_UNITS[3])], [locale, units]);
|
|
22
|
-
|
|
23
|
-
/** `endsAt` as the epoch milliseconds the native views take. */
|
|
24
|
-
export const toEpochMs = endsAt => typeof endsAt === 'number' ? endsAt : endsAt.getTime();
|
|
25
|
-
//# sourceMappingURL=countdown-units.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","FALLBACK_UNITS","unitInitial","locale","unit","fallback","parts","Intl","NumberFormat","style","unitDisplay","formatToParts","initial","find","part","type","value","trim","charAt","useCountdownUnits","units","toEpochMs","endsAt","getTime"],"sourceRoot":"../../../../src","sources":["atoms/countdown/countdown-units.ts"],"mappings":";;AACA,SAAQA,OAAO,QAAO,OAAO;AAE7B,MAAMC,cAA8B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAI3D;AACA,MAAMC,WAAW,GAAGA,CAACC,MAA0B,EAAEC,IAAU,EAAEC,QAAgB,KAAK;EAChF,IAAI;IACF,MAAMC,KAAK,GAAG,IAAIC,IAAI,CAACC,YAAY,CAACL,MAAM,EAAE;MAACM,KAAK,EAAE,MAAM;MAAEL,IAAI;MAAEM,WAAW,EAAE;IAAO,CAAC,CAAC,CAACC,aAAa,CAAC,CAAC,CAAC;IACzG,MAAMC,OAAO,GAAGN,KAAK,CAClBO,IAAI,CAACC,IAAI,IAAIA,IAAI,CAACC,IAAI,KAAK,MAAM,CAAC,EACjCC,KAAK,CAACC,IAAI,CAAC,CAAC,CACbC,MAAM,CAAC,CAAC,CAAC;IAEZ,OAAON,OAAO,IAAIP,QAAQ;EAC5B,CAAC,CAAC,MAAM;IACN,OAAOA,QAAQ;EACjB;AACF,CAAC;;AAED;AACA,OAAO,MAAMc,iBAAiB,GAAGA,CAAChB,MAA0B,EAAEiB,KAAiC,KAC7FpB,OAAO,CACL,MACEoB,KAAK,IAAI,CACPlB,WAAW,CAACC,MAAM,EAAE,KAAK,EAAEF,cAAc,CAAC,CAAC,CAAC,CAAC,EAC7CC,WAAW,CAACC,MAAM,EAAE,MAAM,EAAEF,cAAc,CAAC,CAAC,CAAC,CAAC,EAC9CC,WAAW,CAACC,MAAM,EAAE,QAAQ,EAAEF,cAAc,CAAC,CAAC,CAAC,CAAC,EAChDC,WAAW,CAACC,MAAM,EAAE,QAAQ,EAAEF,cAAc,CAAC,CAAC,CAAC,CAAC,CACjD,EACH,CAACE,MAAM,EAAEiB,KAAK,CAChB,CAAC;;AAEH;AACA,OAAO,MAAMC,SAAS,GAAIC,MAAqB,IAAM,OAAOA,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGA,MAAM,CAACC,OAAO,CAAC,CAAE","ignoreList":[]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Host } from '@expo/ui/jetpack-compose';
|
|
4
|
-
import { Countdown as NativeCountdown } from '@hzblj/kara-native/jetpack-compose';
|
|
5
|
-
import { MAX_FONT_SCALE, useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
-
import { StyleSheet, useWindowDimensions } from 'react-native';
|
|
7
|
-
import { CountdownFrame } from "./countdown-frame.js";
|
|
8
|
-
import { toEpochMs, useCountdownUnits } from "./countdown-units.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export const Countdown = ({
|
|
11
|
-
color = 'content.primary',
|
|
12
|
-
endsAt,
|
|
13
|
-
locale,
|
|
14
|
-
testID,
|
|
15
|
-
units,
|
|
16
|
-
variant = 'body'
|
|
17
|
-
}) => {
|
|
18
|
-
const theme = useAppTheme();
|
|
19
|
-
const {
|
|
20
|
-
fontScale
|
|
21
|
-
} = useWindowDimensions();
|
|
22
|
-
const resolvedUnits = useCountdownUnits(locale, units);
|
|
23
|
-
const endsAtMs = toEpochMs(endsAt);
|
|
24
|
-
const style = theme.typography[variant];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Compose reads `sp` and scales it by the font scale itself — uncapped — while the React Native frame under it stops
|
|
28
|
-
* at `MAX_FONT_SCALE`. Pre-dividing by the part Compose would add past the cap lands both on the same size.
|
|
29
|
-
*/
|
|
30
|
-
const scale = Math.min(fontScale, MAX_FONT_SCALE) / fontScale;
|
|
31
|
-
return /*#__PURE__*/_jsx(CountdownFrame, {
|
|
32
|
-
endsAt: endsAtMs,
|
|
33
|
-
testID: testID,
|
|
34
|
-
units: resolvedUnits,
|
|
35
|
-
variant: variant,
|
|
36
|
-
children: /*#__PURE__*/_jsx(Host, {
|
|
37
|
-
colorScheme: theme.dark ? 'dark' : 'light',
|
|
38
|
-
pointerEvents: "none",
|
|
39
|
-
seedColor: theme.materialSeed,
|
|
40
|
-
style: StyleSheet.absoluteFill,
|
|
41
|
-
children: /*#__PURE__*/_jsx(NativeCountdown, {
|
|
42
|
-
color: theme.color(color),
|
|
43
|
-
endsAt: endsAtMs,
|
|
44
|
-
fontFamily: style.fontFamily,
|
|
45
|
-
fontSize: style.fontSize * scale,
|
|
46
|
-
fontWeight: style.weight,
|
|
47
|
-
lineHeight: style.lineHeight * scale,
|
|
48
|
-
units: resolvedUnits
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=countdown.android.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Host","Countdown","NativeCountdown","MAX_FONT_SCALE","useAppTheme","StyleSheet","useWindowDimensions","CountdownFrame","toEpochMs","useCountdownUnits","jsx","_jsx","color","endsAt","locale","testID","units","variant","theme","fontScale","resolvedUnits","endsAtMs","style","typography","scale","Math","min","children","colorScheme","dark","pointerEvents","seedColor","materialSeed","absoluteFill","fontFamily","fontSize","fontWeight","weight","lineHeight"],"sourceRoot":"../../../../src","sources":["atoms/countdown/countdown.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,0BAA0B;AAC7C,SAAQC,SAAS,IAAIC,eAAe,QAAO,oCAAoC;AAC/E,SAAQC,cAAc,EAAEC,WAAW,QAAO,mBAAmB;AAC7D,SAAQC,UAAU,EAAEC,mBAAmB,QAAO,cAAc;AAE5D,SAAQC,cAAc,QAAO,sBAAmB;AAChD,SAAQC,SAAS,EAAEC,iBAAiB,QAAO,sBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE9D,OAAO,MAAMV,SAA6B,GAAGA,CAAC;EAC5CW,KAAK,GAAG,iBAAiB;EACzBC,MAAM;EACNC,MAAM;EACNC,MAAM;EACNC,KAAK;EACLC,OAAO,GAAG;AACI,CAAC,KAAK;EACpB,MAAMC,KAAK,GAAGd,WAAW,CAAC,CAAC;EAC3B,MAAM;IAACe;EAAS,CAAC,GAAGb,mBAAmB,CAAC,CAAC;EACzC,MAAMc,aAAa,GAAGX,iBAAiB,CAACK,MAAM,EAAEE,KAAK,CAAC;EACtD,MAAMK,QAAQ,GAAGb,SAAS,CAACK,MAAM,CAAC;EAClC,MAAMS,KAAK,GAAGJ,KAAK,CAACK,UAAU,CAACN,OAAO,CAAC;;EAEvC;AACF;AACA;AACA;EACE,MAAMO,KAAK,GAAGC,IAAI,CAACC,GAAG,CAACP,SAAS,EAAEhB,cAAc,CAAC,GAAGgB,SAAS;EAE7D,oBACER,IAAA,CAACJ,cAAc;IAACM,MAAM,EAAEQ,QAAS;IAACN,MAAM,EAAEA,MAAO;IAACC,KAAK,EAAEI,aAAc;IAACH,OAAO,EAAEA,OAAQ;IAAAU,QAAA,eACvFhB,IAAA,CAACX,IAAI;MACH4B,WAAW,EAAEV,KAAK,CAACW,IAAI,GAAG,MAAM,GAAG,OAAQ;MAC3CC,aAAa,EAAC,MAAM;MACpBC,SAAS,EAAEb,KAAK,CAACc,YAAa;MAC9BV,KAAK,EAAEjB,UAAU,CAAC4B,YAAa;MAAAN,QAAA,eAE/BhB,IAAA,CAACT,eAAe;QACdU,KAAK,EAAEM,KAAK,CAACN,KAAK,CAACA,KAAK,CAAE;QAC1BC,MAAM,EAAEQ,QAAS;QACjBa,UAAU,EAAEZ,KAAK,CAACY,UAAW;QAC7BC,QAAQ,EAAEb,KAAK,CAACa,QAAQ,GAAGX,KAAM;QACjCY,UAAU,EAAEd,KAAK,CAACe,MAAO;QACzBC,UAAU,EAAEhB,KAAK,CAACgB,UAAU,GAAGd,KAAM;QACrCR,KAAK,EAAEI;MAAc,CACtB;IAAC,CACE;EAAC,CACO,CAAC;AAErB,CAAC","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Host } from '@expo/ui/swift-ui';
|
|
4
|
-
import { Countdown as NativeCountdown } from '@hzblj/kara-native/swift-ui';
|
|
5
|
-
import { MAX_FONT_SCALE, useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
-
import { StyleSheet, useWindowDimensions } from 'react-native';
|
|
7
|
-
import { CountdownFrame } from "./countdown-frame.js";
|
|
8
|
-
import { toEpochMs, useCountdownUnits } from "./countdown-units.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export const Countdown = ({
|
|
11
|
-
color = 'content.primary',
|
|
12
|
-
endsAt,
|
|
13
|
-
locale,
|
|
14
|
-
testID,
|
|
15
|
-
units,
|
|
16
|
-
variant = 'body'
|
|
17
|
-
}) => {
|
|
18
|
-
const theme = useAppTheme();
|
|
19
|
-
const {
|
|
20
|
-
fontScale
|
|
21
|
-
} = useWindowDimensions();
|
|
22
|
-
const resolvedUnits = useCountdownUnits(locale, units);
|
|
23
|
-
const endsAtMs = toEpochMs(endsAt);
|
|
24
|
-
const style = theme.typography[variant];
|
|
25
|
-
|
|
26
|
-
/** SwiftUI is handed points, so it is scaled here exactly as React Native scales the frame text under it. */
|
|
27
|
-
const scale = Math.min(fontScale, MAX_FONT_SCALE);
|
|
28
|
-
return /*#__PURE__*/_jsx(CountdownFrame, {
|
|
29
|
-
endsAt: endsAtMs,
|
|
30
|
-
testID: testID,
|
|
31
|
-
units: resolvedUnits,
|
|
32
|
-
variant: variant,
|
|
33
|
-
children: /*#__PURE__*/_jsx(Host, {
|
|
34
|
-
colorScheme: theme.dark ? 'dark' : 'light',
|
|
35
|
-
ignoreSafeArea: "all",
|
|
36
|
-
pointerEvents: "none",
|
|
37
|
-
style: StyleSheet.absoluteFill,
|
|
38
|
-
children: /*#__PURE__*/_jsx(NativeCountdown, {
|
|
39
|
-
color: theme.color(color),
|
|
40
|
-
endsAt: endsAtMs,
|
|
41
|
-
fontFamily: style.fontFamily,
|
|
42
|
-
fontSize: style.fontSize * scale,
|
|
43
|
-
fontWeight: style.weight,
|
|
44
|
-
lineHeight: style.lineHeight * scale,
|
|
45
|
-
units: resolvedUnits
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=countdown.ios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Host","Countdown","NativeCountdown","MAX_FONT_SCALE","useAppTheme","StyleSheet","useWindowDimensions","CountdownFrame","toEpochMs","useCountdownUnits","jsx","_jsx","color","endsAt","locale","testID","units","variant","theme","fontScale","resolvedUnits","endsAtMs","style","typography","scale","Math","min","children","colorScheme","dark","ignoreSafeArea","pointerEvents","absoluteFill","fontFamily","fontSize","fontWeight","weight","lineHeight"],"sourceRoot":"../../../../src","sources":["atoms/countdown/countdown.ios.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,mBAAmB;AACtC,SAAQC,SAAS,IAAIC,eAAe,QAAO,6BAA6B;AACxE,SAAQC,cAAc,EAAEC,WAAW,QAAO,mBAAmB;AAC7D,SAAQC,UAAU,EAAEC,mBAAmB,QAAO,cAAc;AAE5D,SAAQC,cAAc,QAAO,sBAAmB;AAChD,SAAQC,SAAS,EAAEC,iBAAiB,QAAO,sBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE9D,OAAO,MAAMV,SAA6B,GAAGA,CAAC;EAC5CW,KAAK,GAAG,iBAAiB;EACzBC,MAAM;EACNC,MAAM;EACNC,MAAM;EACNC,KAAK;EACLC,OAAO,GAAG;AACI,CAAC,KAAK;EACpB,MAAMC,KAAK,GAAGd,WAAW,CAAC,CAAC;EAC3B,MAAM;IAACe;EAAS,CAAC,GAAGb,mBAAmB,CAAC,CAAC;EACzC,MAAMc,aAAa,GAAGX,iBAAiB,CAACK,MAAM,EAAEE,KAAK,CAAC;EACtD,MAAMK,QAAQ,GAAGb,SAAS,CAACK,MAAM,CAAC;EAClC,MAAMS,KAAK,GAAGJ,KAAK,CAACK,UAAU,CAACN,OAAO,CAAC;;EAEvC;EACA,MAAMO,KAAK,GAAGC,IAAI,CAACC,GAAG,CAACP,SAAS,EAAEhB,cAAc,CAAC;EAEjD,oBACEQ,IAAA,CAACJ,cAAc;IAACM,MAAM,EAAEQ,QAAS;IAACN,MAAM,EAAEA,MAAO;IAACC,KAAK,EAAEI,aAAc;IAACH,OAAO,EAAEA,OAAQ;IAAAU,QAAA,eACvFhB,IAAA,CAACX,IAAI;MACH4B,WAAW,EAAEV,KAAK,CAACW,IAAI,GAAG,MAAM,GAAG,OAAQ;MAC3CC,cAAc,EAAC,KAAK;MACpBC,aAAa,EAAC,MAAM;MACpBT,KAAK,EAAEjB,UAAU,CAAC2B,YAAa;MAAAL,QAAA,eAE/BhB,IAAA,CAACT,eAAe;QACdU,KAAK,EAAEM,KAAK,CAACN,KAAK,CAACA,KAAK,CAAE;QAC1BC,MAAM,EAAEQ,QAAS;QACjBY,UAAU,EAAEX,KAAK,CAACW,UAAW;QAC7BC,QAAQ,EAAEZ,KAAK,CAACY,QAAQ,GAAGV,KAAM;QACjCW,UAAU,EAAEb,KAAK,CAACc,MAAO;QACzBC,UAAU,EAAEf,KAAK,CAACe,UAAU,GAAGb,KAAM;QACrCR,KAAK,EAAEI;MAAc,CACtB;IAAC,CACE;EAAC,CACO,CAAC;AAErB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/countdown/countdown.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["atoms/countdown/index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,sBAAmB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DateTimePicker","useCallback","jsx","_jsx","DatePicker","max","min","mode","onValueChange","testID","value","onChange","_event","date","maximumDate","minimumDate"],"sourceRoot":"../../../../src","sources":["atoms/date-picker/date-picker.tsx"],"mappings":";;AAAA,SAAQA,cAAc,QAAO,oCAAoC;AACjE,SAAQC,WAAW,QAAO,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIjC,OAAO,MAAMC,UAA+B,GAAGA,CAAC;EAC9CC,GAAG;EACHC,GAAG;EACHC,IAAI,GAAG,MAAM;EACbC,aAAa;EACbC,MAAM;EACNC;AACe,CAAC,KAAK;EACrB,MAAMC,QAAQ,GAAGV,WAAW,CAC1B,CAACW,MAAe,EAAEC,IAAW,KAAK;IAChC,IAAIA,IAAI,EAAE;MACRL,aAAa,GAAGK,IAAI,CAAC;IACvB;EACF,CAAC,EACD,CAACL,aAAa,CAChB,CAAC;EAED,oBACEL,IAAA,CAACH,cAAc;IAACc,WAAW,EAAET,GAAI;IAACU,WAAW,EAAET,GAAI;IAACC,IAAI,EAAEA,IAAK;IAACI,QAAQ,EAAEA,QAAS;IAACF,MAAM,EAAEA,MAAO;IAACC,KAAK,EAAEA;EAAM,CAAE,CAAC;AAExH,CAAC","ignoreList":[]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export const SF_SYMBOLS = {
|
|
4
|
-
add: 'plus',
|
|
5
|
-
arrowLeft: 'arrow.left',
|
|
6
|
-
arrowRight: 'arrow.right',
|
|
7
|
-
calendar: 'calendar',
|
|
8
|
-
check: 'checkmark',
|
|
9
|
-
chevronDown: 'chevron.down',
|
|
10
|
-
chevronRight: 'chevron.right',
|
|
11
|
-
close: 'xmark',
|
|
12
|
-
error: 'exclamationmark.octagon',
|
|
13
|
-
grid: 'square.grid.2x2',
|
|
14
|
-
heart: 'heart',
|
|
15
|
-
home: 'house',
|
|
16
|
-
info: 'info.circle',
|
|
17
|
-
lock: 'lock',
|
|
18
|
-
more: 'ellipsis',
|
|
19
|
-
notification: 'bell',
|
|
20
|
-
search: 'magnifyingglass',
|
|
21
|
-
settings: 'gearshape',
|
|
22
|
-
share: 'square.and.arrow.up',
|
|
23
|
-
star: 'star',
|
|
24
|
-
trash: 'trash',
|
|
25
|
-
user: 'person',
|
|
26
|
-
warning: 'exclamationmark.triangle'
|
|
27
|
-
};
|
|
28
|
-
export const MATERIAL_ICONS = {
|
|
29
|
-
add: 'add',
|
|
30
|
-
arrowLeft: 'arrow-back',
|
|
31
|
-
arrowRight: 'arrow-forward',
|
|
32
|
-
calendar: 'calendar-today',
|
|
33
|
-
check: 'check',
|
|
34
|
-
chevronDown: 'expand-more',
|
|
35
|
-
chevronRight: 'chevron-right',
|
|
36
|
-
close: 'close',
|
|
37
|
-
error: 'error',
|
|
38
|
-
grid: 'grid-view',
|
|
39
|
-
heart: 'favorite',
|
|
40
|
-
home: 'home',
|
|
41
|
-
info: 'info',
|
|
42
|
-
lock: 'lock',
|
|
43
|
-
more: 'more-horiz',
|
|
44
|
-
notification: 'notifications',
|
|
45
|
-
search: 'search',
|
|
46
|
-
settings: 'settings',
|
|
47
|
-
share: 'share',
|
|
48
|
-
star: 'star',
|
|
49
|
-
trash: 'delete',
|
|
50
|
-
user: 'person',
|
|
51
|
-
warning: 'warning'
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=icon-names.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SF_SYMBOLS","add","arrowLeft","arrowRight","calendar","check","chevronDown","chevronRight","close","error","grid","heart","home","info","lock","more","notification","search","settings","share","star","trash","user","warning","MATERIAL_ICONS"],"sourceRoot":"../../../../src","sources":["atoms/icon/icon-names.ts"],"mappings":";;AAEA,OAAO,MAAMA,UAAU,GAAG;EACxBC,GAAG,EAAE,MAAM;EACXC,SAAS,EAAE,YAAY;EACvBC,UAAU,EAAE,aAAa;EACzBC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,WAAW;EAClBC,WAAW,EAAE,cAAc;EAC3BC,YAAY,EAAE,eAAe;EAC7BC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,yBAAyB;EAChCC,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,OAAO;EACbC,IAAI,EAAE,aAAa;EACnBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,UAAU;EAChBC,YAAY,EAAE,MAAM;EACpBC,MAAM,EAAE,iBAAiB;EACzBC,QAAQ,EAAE,WAAW;EACrBC,KAAK,EAAE,qBAAqB;EAC5BC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,QAAQ;EACdC,OAAO,EAAE;AACX,CAA6C;AAE7C,OAAO,MAAMC,cAAc,GAAG;EAC5BvB,GAAG,EAAE,KAAK;EACVC,SAAS,EAAE,YAAY;EACvBC,UAAU,EAAE,eAAe;EAC3BC,QAAQ,EAAE,gBAAgB;EAC1BC,KAAK,EAAE,OAAO;EACdC,WAAW,EAAE,aAAa;EAC1BC,YAAY,EAAE,eAAe;EAC7BC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,UAAU;EACjBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,YAAY;EAClBC,YAAY,EAAE,eAAe;EAC7BC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,QAAQ;EACfC,IAAI,EAAE,QAAQ;EACdC,OAAO,EAAE;AACX,CAA6C","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Picker","NativePicker","useAppTheme","useCallback","jsx","_jsx","disabled","onValueChange","options","testID","value","theme","onChange","next","String","enabled","selectedValue","children","map","option","Item","color","colorString","label"],"sourceRoot":"../../../../src","sources":["atoms/picker/picker.tsx"],"mappings":";;AAAA,SAAQA,MAAM,IAAIC,YAAY,QAAO,2BAA2B;AAChE,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,QAAO,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIjC,OAAO,MAAML,MAAuB,GAAGA,CAAC;EAACM,QAAQ,GAAG,KAAK;EAAEC,aAAa;EAAEC,OAAO;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACjH,MAAMC,KAAK,GAAGT,WAAW,CAAC,CAAC;EAE3B,MAAMU,QAAQ,GAAGT,WAAW,CAAEU,IAA4B,IAAKN,aAAa,GAAGO,MAAM,CAACD,IAAI,CAAC,CAAC,EAAE,CAACN,aAAa,CAAC,CAAC;EAE9G,oBACEF,IAAA,CAACJ,YAAY;IAACc,OAAO,EAAE,CAACT,QAAS;IAACC,aAAa,EAAEK,QAAS;IAACI,aAAa,EAAEN,KAAM;IAACD,MAAM,EAAEA,MAAO;IAAAQ,QAAA,EAC7FT,OAAO,CAACU,GAAG,CAACC,MAAM,iBACjBd,IAAA,CAACJ,YAAY,CAACmB,IAAI;MAChBC,KAAK,EAAEV,KAAK,CAACW,WAAW,CAAC,iBAAiB,CAAE;MAE5CC,KAAK,EAAEJ,MAAM,CAACI,KAAM;MACpBb,KAAK,EAAES,MAAM,CAACT;IAAM,GAFfS,MAAM,CAACT,KAGb,CACF;EAAC,CACU,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["organisms/rn-context-menu/index.ts"],"mappings":";;AAAA,cAAc,mBAAmB;AACjC,cAAc,4BAAyB","ignoreList":[]}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Text as ComposeText, DropdownMenu, DropdownMenuItem, Host } from '@expo/ui/jetpack-compose';
|
|
4
|
-
import { useSx } from '@hzblj/kara-sx';
|
|
5
|
-
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
-
import { useCallback, useState } from 'react';
|
|
7
|
-
import { Pressable, StyleSheet, View } from 'react-native';
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
/**
|
|
10
|
-
* The menu's anchor: a point at the trigger's bottom start, so the dropdown opens just under it. The host lies outside
|
|
11
|
-
* the touch path — the dropdown is a popup window of its own, which takes its touches regardless.
|
|
12
|
-
*/
|
|
13
|
-
const styles = StyleSheet.create({
|
|
14
|
-
anchor: {
|
|
15
|
-
bottom: 0,
|
|
16
|
-
height: 1,
|
|
17
|
-
left: 0,
|
|
18
|
-
position: 'absolute',
|
|
19
|
-
width: 1
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
/** A row's `onClick` closes over its own action, so memoising it needs a component per row. */
|
|
23
|
-
const MenuRow = ({
|
|
24
|
-
action,
|
|
25
|
-
onDismiss
|
|
26
|
-
}) => {
|
|
27
|
-
const theme = useAppTheme();
|
|
28
|
-
const onClick = useCallback(() => {
|
|
29
|
-
onDismiss();
|
|
30
|
-
action.onPress();
|
|
31
|
-
}, [action, onDismiss]);
|
|
32
|
-
return /*#__PURE__*/_jsx(DropdownMenuItem, {
|
|
33
|
-
onClick: onClick,
|
|
34
|
-
children: /*#__PURE__*/_jsx(DropdownMenuItem.Text, {
|
|
35
|
-
children: /*#__PURE__*/_jsx(ComposeText, {
|
|
36
|
-
color: theme.colorString(action.destructive ? 'content.destructive' : 'content.primary'),
|
|
37
|
-
style: theme.typography.body,
|
|
38
|
-
children: action.label
|
|
39
|
-
})
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The trigger stays a plain React Native subtree; a long press on it expands a Compose `DropdownMenu` anchored under
|
|
46
|
-
* it. The host behind the menu mounts on the first long press and stays — a list of triggers that are only scrolled
|
|
47
|
-
* past never builds one. `preview` and `onPreviewPress` are iOS-only: Material has no lifted preview.
|
|
48
|
-
*/
|
|
49
|
-
const RnContextMenuRoot = ({
|
|
50
|
-
actions,
|
|
51
|
-
children,
|
|
52
|
-
testID,
|
|
53
|
-
...props
|
|
54
|
-
}) => {
|
|
55
|
-
const {
|
|
56
|
-
onPreviewPress: _onPreviewPress,
|
|
57
|
-
preview: _preview,
|
|
58
|
-
...sx
|
|
59
|
-
} = props;
|
|
60
|
-
const theme = useAppTheme();
|
|
61
|
-
const style = useSx(sx);
|
|
62
|
-
const [isHostMounted, setIsHostMounted] = useState(false);
|
|
63
|
-
const [expanded, setExpanded] = useState(false);
|
|
64
|
-
const open = useCallback(() => {
|
|
65
|
-
setIsHostMounted(true);
|
|
66
|
-
setExpanded(true);
|
|
67
|
-
}, []);
|
|
68
|
-
const dismiss = useCallback(() => setExpanded(false), []);
|
|
69
|
-
return /*#__PURE__*/_jsxs(Pressable, {
|
|
70
|
-
onLongPress: open,
|
|
71
|
-
style: style,
|
|
72
|
-
testID: testID,
|
|
73
|
-
children: [children, isHostMounted ? /*#__PURE__*/_jsx(Host, {
|
|
74
|
-
colorScheme: theme.dark ? 'dark' : 'light',
|
|
75
|
-
pointerEvents: "none",
|
|
76
|
-
seedColor: theme.materialSeed,
|
|
77
|
-
style: styles.anchor,
|
|
78
|
-
children: /*#__PURE__*/_jsx(DropdownMenu, {
|
|
79
|
-
expanded: expanded,
|
|
80
|
-
onDismissRequest: dismiss,
|
|
81
|
-
children: /*#__PURE__*/_jsx(DropdownMenu.Items, {
|
|
82
|
-
children: actions.map(action => /*#__PURE__*/_jsx(MenuRow, {
|
|
83
|
-
action: action,
|
|
84
|
-
onDismiss: dismiss
|
|
85
|
-
}, action.label))
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
}) : null]
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
/** A touchable inside the trigger already claims its own long press on Android, so this only has to group. */
|
|
93
|
-
const Exclusion = ({
|
|
94
|
-
children
|
|
95
|
-
}) => /*#__PURE__*/_jsx(View, {
|
|
96
|
-
children: children
|
|
97
|
-
});
|
|
98
|
-
export const RnContextMenu = Object.assign(RnContextMenuRoot, {
|
|
99
|
-
Exclusion
|
|
100
|
-
});
|
|
101
|
-
//# sourceMappingURL=rn-context-menu.android.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Text","ComposeText","DropdownMenu","DropdownMenuItem","Host","useSx","useAppTheme","useCallback","useState","Pressable","StyleSheet","View","jsx","_jsx","jsxs","_jsxs","styles","create","anchor","bottom","height","left","position","width","MenuRow","action","onDismiss","theme","onClick","onPress","children","color","colorString","destructive","style","typography","body","label","RnContextMenuRoot","actions","testID","props","onPreviewPress","_onPreviewPress","preview","_preview","sx","isHostMounted","setIsHostMounted","expanded","setExpanded","open","dismiss","onLongPress","colorScheme","dark","pointerEvents","seedColor","materialSeed","onDismissRequest","Items","map","Exclusion","RnContextMenu","Object","assign"],"sourceRoot":"../../../../src","sources":["organisms/rn-context-menu/rn-context-menu.android.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { ContextMenu as NativeContextMenu, ContextMenuExclusion as NativeContextMenuExclusion } from '@hzblj/kara-native/swift-ui';
|
|
4
|
-
import { useSx } from '@hzblj/kara-sx';
|
|
5
|
-
import { useCallback, useMemo } from 'react';
|
|
6
|
-
import { SF_SYMBOLS } from "../../atoms/icon/index.js";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const RnContextMenuRoot = ({
|
|
9
|
-
actions,
|
|
10
|
-
children,
|
|
11
|
-
onPreviewPress,
|
|
12
|
-
preview,
|
|
13
|
-
testID,
|
|
14
|
-
...sx
|
|
15
|
-
}) => {
|
|
16
|
-
const style = useSx(sx);
|
|
17
|
-
|
|
18
|
-
/** The native side hands back an id; the index is the one identity every action has. */
|
|
19
|
-
const items = useMemo(() => actions.map((action, index) => ({
|
|
20
|
-
destructive: action.destructive,
|
|
21
|
-
id: String(index),
|
|
22
|
-
systemImage: action.icon ? SF_SYMBOLS[action.icon] : undefined,
|
|
23
|
-
title: action.label
|
|
24
|
-
})), [actions]);
|
|
25
|
-
const onSelectItem = useCallback(id => actions[Number(id)]?.onPress(), [actions]);
|
|
26
|
-
return /*#__PURE__*/_jsx(NativeContextMenu, {
|
|
27
|
-
items: items,
|
|
28
|
-
onPreviewPress: onPreviewPress,
|
|
29
|
-
onSelectItem: onSelectItem,
|
|
30
|
-
preview: preview,
|
|
31
|
-
style: style,
|
|
32
|
-
testID: testID,
|
|
33
|
-
children: children
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const Exclusion = ({
|
|
37
|
-
children
|
|
38
|
-
}) => /*#__PURE__*/_jsx(NativeContextMenuExclusion, {
|
|
39
|
-
children: children
|
|
40
|
-
});
|
|
41
|
-
export const RnContextMenu = Object.assign(RnContextMenuRoot, {
|
|
42
|
-
Exclusion
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=rn-context-menu.ios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ContextMenu","NativeContextMenu","ContextMenuExclusion","NativeContextMenuExclusion","useSx","useCallback","useMemo","SF_SYMBOLS","jsx","_jsx","RnContextMenuRoot","actions","children","onPreviewPress","preview","testID","sx","style","items","map","action","index","destructive","id","String","systemImage","icon","undefined","title","label","onSelectItem","Number","onPress","Exclusion","RnContextMenu","Object","assign"],"sourceRoot":"../../../../src","sources":["organisms/rn-context-menu/rn-context-menu.ios.tsx"],"mappings":";;AAAA,SAEEA,WAAW,IAAIC,iBAAiB,EAChCC,oBAAoB,IAAIC,0BAA0B,QAC7C,6BAA6B;AACpC,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAE1C,SAAQC,UAAU,QAAO,2BAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG3C,MAAMC,iBAAiB,GAAGA,CAAC;EAACC,OAAO;EAAEC,QAAQ;EAAEC,cAAc;EAAEC,OAAO;EAAEC,MAAM;EAAE,GAAGC;AAAsB,CAAC,KAAK;EAC7G,MAAMC,KAAK,GAAGb,KAAK,CAACY,EAAE,CAAC;;EAEvB;EACA,MAAME,KAAK,GAAGZ,OAAO,CACnB,MACEK,OAAO,CAACQ,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,MAAM;IAC9BC,WAAW,EAAEF,MAAM,CAACE,WAAW;IAC/BC,EAAE,EAAEC,MAAM,CAACH,KAAK,CAAC;IACjBI,WAAW,EAAEL,MAAM,CAACM,IAAI,GAAInB,UAAU,CAACa,MAAM,CAACM,IAAI,CAAC,GAAgBC,SAAS;IAC5EC,KAAK,EAAER,MAAM,CAACS;EAChB,CAAC,CAAC,CAAC,EACL,CAAClB,OAAO,CACV,CAAC;EAED,MAAMmB,YAAY,GAAGzB,WAAW,CAAEkB,EAAU,IAAKZ,OAAO,CAACoB,MAAM,CAACR,EAAE,CAAC,CAAC,EAAES,OAAO,CAAC,CAAC,EAAE,CAACrB,OAAO,CAAC,CAAC;EAE3F,oBACEF,IAAA,CAACR,iBAAiB;IAChBiB,KAAK,EAAEA,KAAM;IACbL,cAAc,EAAEA,cAAe;IAC/BiB,YAAY,EAAEA,YAAa;IAC3BhB,OAAO,EAAEA,OAAQ;IACjBG,KAAK,EAAEA,KAAM;IACbF,MAAM,EAAEA,MAAO;IAAAH,QAAA,EAEdA;EAAQ,CACQ,CAAC;AAExB,CAAC;AAED,MAAMqB,SAAS,GAAGA,CAAC;EAACrB;AAAqC,CAAC,kBACxDH,IAAA,CAACN,0BAA0B;EAAAS,QAAA,EAAEA;AAAQ,CAA6B,CACnE;AAED,OAAO,MAAMsB,aAAqC,GAAGC,MAAM,CAACC,MAAM,CAAC1B,iBAAiB,EAAE;EAACuB;AAAS,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["organisms/rn-context-menu/rn-context-menu.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { CountdownUnits } from '@hzblj/kara-native';
|
|
2
|
-
import { type TextVariant } from '@hzblj/kara-theme';
|
|
3
|
-
import { type ReactNode } from 'react';
|
|
4
|
-
type CountdownFrameProps = {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
endsAt: number;
|
|
7
|
-
testID?: string;
|
|
8
|
-
units: CountdownUnits;
|
|
9
|
-
variant: TextVariant;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* What gives the native countdown its size: an invisible React Native text of exactly the shape it draws, set the way
|
|
13
|
-
* `RnText` sets the same variant, so the countdown takes the space any text of that variant would — and the native view
|
|
14
|
-
* laid over it has to match it to the point. Accessibility reads the native view, never this.
|
|
15
|
-
*/
|
|
16
|
-
export declare const CountdownFrame: ({ children, endsAt, testID, units, variant }: CountdownFrameProps) => import("react").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CountdownUnits } from '@hzblj/kara-native';
|
|
2
|
-
/** The caller's units, else the locale's initials, else English ones. */
|
|
3
|
-
export declare const useCountdownUnits: (locale: string | undefined, units: CountdownUnits | undefined) => CountdownUnits;
|
|
4
|
-
/** `endsAt` as the epoch milliseconds the native views take. */
|
|
5
|
-
export declare const toEpochMs: (endsAt: Date | number) => number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './countdown.ios';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { CountdownUnits } from '@hzblj/kara-native';
|
|
2
|
-
import type { ColorToken, TextVariant } from '@hzblj/kara-theme';
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
export type { CountdownUnits } from '@hzblj/kara-native';
|
|
5
|
-
/**
|
|
6
|
-
* A live countdown — `2d / 05h / 09m / 41s` — drawn natively, so it ticks and rolls its digits without a React render
|
|
7
|
-
* per second. The React Native tier: it sizes itself with an invisible React Native text of the same shape, and lays
|
|
8
|
-
* its own native host over that, so it needs no `Screen` or `Island` around it.
|
|
9
|
-
*/
|
|
10
|
-
export type CountdownProps = {
|
|
11
|
-
color?: ColorToken;
|
|
12
|
-
/** The moment it reaches zero, as a `Date` or epoch milliseconds. It stops there. */
|
|
13
|
-
endsAt: Date | number;
|
|
14
|
-
/** Picks the unit initials when `units` is not given. The device's locale by default. */
|
|
15
|
-
locale?: string;
|
|
16
|
-
testID?: string;
|
|
17
|
-
/** Overrides the locale's unit initials. */
|
|
18
|
-
units?: CountdownUnits;
|
|
19
|
-
variant?: TextVariant;
|
|
20
|
-
};
|
|
21
|
-
export type CountdownComponent = (props: CountdownProps) => ReactNode;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export declare const SF_SYMBOLS: {
|
|
2
|
-
readonly add: 'plus';
|
|
3
|
-
readonly arrowLeft: 'arrow.left';
|
|
4
|
-
readonly arrowRight: 'arrow.right';
|
|
5
|
-
readonly calendar: 'calendar';
|
|
6
|
-
readonly check: 'checkmark';
|
|
7
|
-
readonly chevronDown: 'chevron.down';
|
|
8
|
-
readonly chevronRight: 'chevron.right';
|
|
9
|
-
readonly close: 'xmark';
|
|
10
|
-
readonly error: 'exclamationmark.octagon';
|
|
11
|
-
readonly grid: 'square.grid.2x2';
|
|
12
|
-
readonly heart: 'heart';
|
|
13
|
-
readonly home: 'house';
|
|
14
|
-
readonly info: 'info.circle';
|
|
15
|
-
readonly lock: 'lock';
|
|
16
|
-
readonly more: 'ellipsis';
|
|
17
|
-
readonly notification: 'bell';
|
|
18
|
-
readonly search: 'magnifyingglass';
|
|
19
|
-
readonly settings: 'gearshape';
|
|
20
|
-
readonly share: 'square.and.arrow.up';
|
|
21
|
-
readonly star: 'star';
|
|
22
|
-
readonly trash: 'trash';
|
|
23
|
-
readonly user: 'person';
|
|
24
|
-
readonly warning: 'exclamationmark.triangle';
|
|
25
|
-
};
|
|
26
|
-
export declare const MATERIAL_ICONS: {
|
|
27
|
-
readonly add: 'add';
|
|
28
|
-
readonly arrowLeft: 'arrow-back';
|
|
29
|
-
readonly arrowRight: 'arrow-forward';
|
|
30
|
-
readonly calendar: 'calendar-today';
|
|
31
|
-
readonly check: 'check';
|
|
32
|
-
readonly chevronDown: 'expand-more';
|
|
33
|
-
readonly chevronRight: 'chevron-right';
|
|
34
|
-
readonly close: 'close';
|
|
35
|
-
readonly error: 'error';
|
|
36
|
-
readonly grid: 'grid-view';
|
|
37
|
-
readonly heart: 'favorite';
|
|
38
|
-
readonly home: 'home';
|
|
39
|
-
readonly info: 'info';
|
|
40
|
-
readonly lock: 'lock';
|
|
41
|
-
readonly more: 'more-horiz';
|
|
42
|
-
readonly notification: 'notifications';
|
|
43
|
-
readonly search: 'search';
|
|
44
|
-
readonly settings: 'settings';
|
|
45
|
-
readonly share: 'share';
|
|
46
|
-
readonly star: 'star';
|
|
47
|
-
readonly trash: 'delete';
|
|
48
|
-
readonly user: 'person';
|
|
49
|
-
readonly warning: 'warning';
|
|
50
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './rn-context-menu.ios';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import type { MenuAction } from '../menu';
|
|
4
|
-
/**
|
|
5
|
-
* A context menu on a React Native subtree — a card in a list, say — opened by a long press. iOS: a
|
|
6
|
-
* `UIContextMenuInteraction`, with an optional React Native `preview` lifted while the menu is open and a callback for
|
|
7
|
-
* a tap on it. Android: a Material dropdown under the subtree. The React Native tier, unlike `ContextMenu`, whose
|
|
8
|
-
* trigger is a native view inside a host.
|
|
9
|
-
*/
|
|
10
|
-
export type RnContextMenuProps = ResponsiveViewSx & {
|
|
11
|
-
actions: MenuAction[];
|
|
12
|
-
/** The trigger, laid out as usual. */
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
/** iOS: the user tapped the lifted preview, committing to it — open the detail the card stands for. */
|
|
15
|
-
onPreviewPress?: () => void;
|
|
16
|
-
/**
|
|
17
|
-
* iOS: lifted in place of the trigger while the menu is open — a larger version of the card, say. A snapshot of the
|
|
18
|
-
* trigger when unset. Mounted only once a finger has rested on the trigger, so a list of cards does not pay for
|
|
19
|
-
* every preview up front.
|
|
20
|
-
*/
|
|
21
|
-
preview?: ReactNode;
|
|
22
|
-
testID?: string;
|
|
23
|
-
};
|
|
24
|
-
export type RnContextMenuExclusionProps = {
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
};
|
|
27
|
-
export type RnContextMenuComponent = ((props: RnContextMenuProps) => ReactNode) & {
|
|
28
|
-
/**
|
|
29
|
-
* A region of the trigger that must not open the menu — a button inside the card. On iOS the interaction covers the
|
|
30
|
-
* whole trigger, so a long press on that button would otherwise open the card's menu.
|
|
31
|
-
*/
|
|
32
|
-
Exclusion: (props: RnContextMenuExclusionProps) => ReactNode;
|
|
33
|
-
};
|