@hzblj/kara-components 0.1.0 → 0.2.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/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 +5 -7
- 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/CHANGELOG.md +0 -14
- 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,23 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { iconResourceName } from '@hzblj/kara-native';
|
|
4
|
+
import { ContextMenu as NativeContextMenu, ContextMenuExclusion as NativeContextMenuExclusion } from '@hzblj/kara-native/swift-ui';
|
|
5
|
+
import { useSx } from '@hzblj/kara-sx';
|
|
6
|
+
import { useCallback, useMemo } from 'react';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const ContextMenuRoot = ({
|
|
7
9
|
actions,
|
|
8
|
-
children
|
|
10
|
+
children,
|
|
11
|
+
onPreviewPress,
|
|
12
|
+
preview,
|
|
13
|
+
testID,
|
|
14
|
+
...sx
|
|
9
15
|
}) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
+
image: action.icon ? iconResourceName(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
|
|
21
34
|
});
|
|
22
35
|
};
|
|
36
|
+
const Exclusion = ({
|
|
37
|
+
children
|
|
38
|
+
}) => /*#__PURE__*/_jsx(NativeContextMenuExclusion, {
|
|
39
|
+
children: children
|
|
40
|
+
});
|
|
41
|
+
export const ContextMenu = Object.assign(ContextMenuRoot, {
|
|
42
|
+
Exclusion
|
|
43
|
+
});
|
|
23
44
|
//# sourceMappingURL=context-menu.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["iconResourceName","ContextMenu","NativeContextMenu","ContextMenuExclusion","NativeContextMenuExclusion","useSx","useCallback","useMemo","jsx","_jsx","ContextMenuRoot","actions","children","onPreviewPress","preview","testID","sx","style","items","map","action","index","destructive","id","String","image","icon","undefined","title","label","onSelectItem","Number","onPress","Exclusion","Object","assign"],"sourceRoot":"../../../../src","sources":["organisms/context-menu/context-menu.ios.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,QAAO,oBAAoB;AACnD,SAEEC,WAAW,IAAIC,iBAAiB,EAChCC,oBAAoB,IAAIC,0BAA0B,QAC7C,6BAA6B;AACpC,SAAQC,KAAK,QAAO,gBAAgB;AACpC,SAAQC,WAAW,EAAEC,OAAO,QAAO,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG1C,MAAMC,eAAe,GAAGA,CAAC;EAACC,OAAO;EAAEC,QAAQ;EAAEC,cAAc;EAAEC,OAAO;EAAEC,MAAM;EAAE,GAAGC;AAAoB,CAAC,KAAK;EACzG,MAAMC,KAAK,GAAGZ,KAAK,CAACW,EAAE,CAAC;;EAEvB;EACA,MAAME,KAAK,GAAGX,OAAO,CACnB,MACEI,OAAO,CAACQ,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,MAAM;IAC9BC,WAAW,EAAEF,MAAM,CAACE,WAAW;IAC/BC,EAAE,EAAEC,MAAM,CAACH,KAAK,CAAC;IACjBI,KAAK,EAAEL,MAAM,CAACM,IAAI,GAAG1B,gBAAgB,CAACoB,MAAM,CAACM,IAAI,CAAC,GAAGC,SAAS;IAC9DC,KAAK,EAAER,MAAM,CAACS;EAChB,CAAC,CAAC,CAAC,EACL,CAAClB,OAAO,CACV,CAAC;EAED,MAAMmB,YAAY,GAAGxB,WAAW,CAAEiB,EAAU,IAAKZ,OAAO,CAACoB,MAAM,CAACR,EAAE,CAAC,CAAC,EAAES,OAAO,CAAC,CAAC,EAAE,CAACrB,OAAO,CAAC,CAAC;EAE3F,oBACEF,IAAA,CAACP,iBAAiB;IAChBgB,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;AAAmC,CAAC,kBACtDH,IAAA,CAACL,0BAA0B;EAAAQ,QAAA,EAAEA;AAAQ,CAA6B,CACnE;AAED,OAAO,MAAMX,WAAiC,GAAGiC,MAAM,CAACC,MAAM,CAACzB,eAAe,EAAE;EAACuB;AAAS,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ import { FloatingActionButtonMenu, FloatingActionButtonMenuItem, ToggleFloatingA
|
|
|
5
5
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
6
|
import { useCallback, useState } from 'react';
|
|
7
7
|
import { Icon } from "../../atoms/icon/index.js";
|
|
8
|
+
import { Glyph } from "../../glyph/index.js";
|
|
8
9
|
import { useHostGuard } from "../../host-context.js";
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
/** A row's `onClick` closes over its own action, so memoising it needs a component per row. */
|
|
@@ -40,7 +41,7 @@ const FabMenuRow = ({
|
|
|
40
41
|
*/
|
|
41
42
|
export const FabMenu = ({
|
|
42
43
|
actions,
|
|
43
|
-
icon
|
|
44
|
+
icon
|
|
44
45
|
}) => {
|
|
45
46
|
useHostGuard('FabMenu');
|
|
46
47
|
const theme = useAppTheme();
|
|
@@ -58,9 +59,12 @@ export const FabMenu = ({
|
|
|
58
59
|
containerColor: theme.color('fill.accent.primary'),
|
|
59
60
|
onCheckedChange: setExpanded,
|
|
60
61
|
children: /*#__PURE__*/_jsx(ToggleFloatingActionButton.Icon, {
|
|
61
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
62
|
+
children: icon ? /*#__PURE__*/_jsx(Icon, {
|
|
62
63
|
color: "content.on.bg",
|
|
63
64
|
name: icon
|
|
65
|
+
}) : /*#__PURE__*/_jsx(Glyph, {
|
|
66
|
+
color: "content.on.bg",
|
|
67
|
+
name: "plus"
|
|
64
68
|
})
|
|
65
69
|
})
|
|
66
70
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","ComposeText","FloatingActionButtonMenu","FloatingActionButtonMenuItem","ToggleFloatingActionButton","useAppTheme","useCallback","useState","Icon","useHostGuard","jsx","_jsx","jsxs","_jsxs","FabMenuRow","action","onSelect","theme","onClick","containerColor","color","contentColor","children","icon","name","colorString","style","typography","labelMedium","label","FabMenu","actions","expanded","setExpanded","onPress","horizontalAlignment","Button","checked","onCheckedChange","map"],"sourceRoot":"../../../../src","sources":["organisms/fab-menu/fab-menu.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,IAAIC,WAAW,QAAO,0BAA0B;AAC5D,SACEC,wBAAwB,EACxBC,4BAA4B,EAC5BC,0BAA0B,QACrB,oCAAoC;AAC3C,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,QAAQ,QAAO,OAAO;AAC3C,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAS/C;AACA,MAAMC,UAAU,GAAGA,CAAC;EAACC,MAAM;EAAEC;AAAyB,CAAC,KAAK;EAC1D,MAAMC,KAAK,
|
|
1
|
+
{"version":3,"names":["Text","ComposeText","FloatingActionButtonMenu","FloatingActionButtonMenuItem","ToggleFloatingActionButton","useAppTheme","useCallback","useState","Icon","Glyph","useHostGuard","jsx","_jsx","jsxs","_jsxs","FabMenuRow","action","onSelect","theme","onClick","containerColor","color","contentColor","children","icon","name","colorString","style","typography","labelMedium","label","FabMenu","actions","expanded","setExpanded","onPress","horizontalAlignment","Button","checked","onCheckedChange","map"],"sourceRoot":"../../../../src","sources":["organisms/fab-menu/fab-menu.android.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Button, Menu } from '@expo/ui/swift-ui';
|
|
4
|
-
import {
|
|
3
|
+
import { Button, Image, Label, Menu } from '@expo/ui/swift-ui';
|
|
4
|
+
import { iconResourceName } from '@hzblj/kara-native';
|
|
5
|
+
import { Icon } from "../../atoms/icon/index.js";
|
|
5
6
|
import { VStack } from "../../atoms/v-stack/index.js";
|
|
7
|
+
import { Glyph } from "../../glyph/index.js";
|
|
6
8
|
import { useHostGuard } from "../../host-context.js";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
/** Matches `Fab`, so a screen can switch between the two without the button changing shape. */
|
|
9
11
|
const FAB_SIZE = 56;
|
|
10
12
|
export const FabMenu = ({
|
|
11
13
|
actions,
|
|
12
|
-
icon
|
|
14
|
+
icon,
|
|
13
15
|
testID
|
|
14
16
|
}) => {
|
|
15
17
|
useHostGuard('FabMenu');
|
|
@@ -22,17 +24,24 @@ export const FabMenu = ({
|
|
|
22
24
|
p: "s16",
|
|
23
25
|
shadow: "btn.accent",
|
|
24
26
|
w: FAB_SIZE,
|
|
25
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
27
|
+
children: icon ? /*#__PURE__*/_jsx(Icon, {
|
|
26
28
|
color: "content.on.bg",
|
|
27
29
|
name: icon
|
|
30
|
+
}) : /*#__PURE__*/_jsx(Glyph, {
|
|
31
|
+
color: "content.on.bg",
|
|
32
|
+
name: "plus"
|
|
28
33
|
})
|
|
29
34
|
}),
|
|
30
35
|
testID: testID,
|
|
31
36
|
children: actions.map(action => /*#__PURE__*/_jsx(Button, {
|
|
32
|
-
label: action.label,
|
|
33
37
|
onPress: action.onPress,
|
|
34
38
|
role: action.destructive ? 'destructive' : 'default',
|
|
35
|
-
|
|
39
|
+
children: /*#__PURE__*/_jsx(Label, {
|
|
40
|
+
icon: action.icon ? /*#__PURE__*/_jsx(Image, {
|
|
41
|
+
assetName: iconResourceName(action.icon)
|
|
42
|
+
}) : undefined,
|
|
43
|
+
title: action.label
|
|
44
|
+
})
|
|
36
45
|
}, action.label))
|
|
37
46
|
});
|
|
38
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","Menu","
|
|
1
|
+
{"version":3,"names":["Button","Image","Label","Menu","iconResourceName","Icon","VStack","Glyph","useHostGuard","jsx","_jsx","FAB_SIZE","FabMenu","actions","icon","testID","label","align","bg","borderRadius","h","p","shadow","w","children","color","name","map","action","onPress","role","destructive","assetName","undefined","title"],"sourceRoot":"../../../../src","sources":["organisms/fab-menu/fab-menu.ios.tsx"],"mappings":";;AAAA,SAAQA,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,QAAO,mBAAmB;AAC5D,SAAQC,gBAAgB,QAAO,oBAAoB;AAEnD,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,MAAM,QAAO,8BAAqB;AAC1C,SAAQC,KAAK,QAAO,sBAAa;AACjC,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG/C;AACA,MAAMC,QAAQ,GAAG,EAAE;AAEnB,OAAO,MAAMC,OAAyB,GAAGA,CAAC;EAACC,OAAO;EAAEC,IAAI;EAAEC;AAAoB,CAAC,KAAK;EAClFP,YAAY,CAAC,SAAS,CAAC;EAEvB,oBACEE,IAAA,CAACP,IAAI;IACHa,KAAK,eACHN,IAAA,CAACJ,MAAM;MACLW,KAAK,EAAC,QAAQ;MACdC,EAAE,EAAC,qBAAqB;MACxBC,YAAY,EAAC,MAAM;MACnBC,CAAC,EAAET,QAAS;MACZU,CAAC,EAAC,KAAK;MACPC,MAAM,EAAC,YAAY;MACnBC,CAAC,EAAEZ,QAAS;MAAAa,QAAA,EAEXV,IAAI,gBAAGJ,IAAA,CAACL,IAAI;QAACoB,KAAK,EAAC,eAAe;QAACC,IAAI,EAAEZ;MAAK,CAAE,CAAC,gBAAGJ,IAAA,CAACH,KAAK;QAACkB,KAAK,EAAC,eAAe;QAACC,IAAI,EAAC;MAAM,CAAE;IAAC,CAC1F,CACT;IACDX,MAAM,EAAEA,MAAO;IAAAS,QAAA,EAEdX,OAAO,CAACc,GAAG,CAACC,MAAM,iBACjBlB,IAAA,CAACV,MAAM;MAAoB6B,OAAO,EAAED,MAAM,CAACC,OAAQ;MAACC,IAAI,EAAEF,MAAM,CAACG,WAAW,GAAG,aAAa,GAAG,SAAU;MAAAP,QAAA,eAEvGd,IAAA,CAACR,KAAK;QACJY,IAAI,EAAEc,MAAM,CAACd,IAAI,gBAAGJ,IAAA,CAACT,KAAK;UAAC+B,SAAS,EAAE5B,gBAAgB,CAACwB,MAAM,CAACd,IAAI;QAAE,CAAE,CAAC,GAAGmB,SAAU;QACpFC,KAAK,EAAEN,MAAM,CAACZ;MAAM,CACrB;IAAC,GALSY,MAAM,CAACZ,KAMZ,CACT;EAAC,CACE,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Card","Text","VStack","useHostGuard","jsx","_jsx","jsxs","_jsxs","FormRoot","children","testID","spacing","wide","FormSection","footer","title","color","transform","variant","Form","Object","assign","Section"],"sourceRoot":"../../../../src","sources":["organisms/form/form.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,2BAAkB;AACrC,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,MAAM,QAAO,8BAAqB;AAC1C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C,MAAMC,QAAQ,GAAGA,CAAC;EAACC,QAAQ;EAAEC;AAAiB,CAAC,KAAK;EAClDP,YAAY,CAAC,MAAM,CAAC;EAEpB,oBACEE,IAAA,CAACH,MAAM;IAACS,OAAO,EAAC,KAAK;IAACD,MAAM,EAAEA,MAAO;IAACE,IAAI;IAAAH,QAAA,EACvCA;EAAQ,CACH,CAAC;AAEb,CAAC;AAED,MAAMI,WAAW,GAAGA,CAAC;EAACJ,QAAQ;EAAEK,MAAM;EAAEC;AAAuB,CAAC,kBAC9DR,KAAA,CAACL,MAAM;EAACS,OAAO,EAAC,IAAI;EAACC,IAAI;EAAAH,QAAA,GACtBM,KAAK,gBACJV,IAAA,CAACJ,IAAI;IAACe,KAAK,EAAC,mBAAmB;IAACC,SAAS,EAAC,WAAW;IAACC,OAAO,EAAC,aAAa;IAAAT,QAAA,EACxEM;EAAK,CACF,CAAC,GACL,IAAI,eACRV,IAAA,CAACL,IAAI;
|
|
1
|
+
{"version":3,"names":["Card","Text","VStack","useHostGuard","jsx","_jsx","jsxs","_jsxs","FormRoot","children","testID","spacing","wide","FormSection","footer","title","color","transform","variant","Form","Object","assign","Section"],"sourceRoot":"../../../../src","sources":["organisms/form/form.android.tsx"],"mappings":";;AAAA,SAAQA,IAAI,QAAO,2BAAkB;AACrC,SAAQC,IAAI,QAAO,2BAAkB;AACrC,SAAQC,MAAM,QAAO,8BAAqB;AAC1C,SAAQC,YAAY,QAAO,uBAAoB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C,MAAMC,QAAQ,GAAGA,CAAC;EAACC,QAAQ;EAAEC;AAAiB,CAAC,KAAK;EAClDP,YAAY,CAAC,MAAM,CAAC;EAEpB,oBACEE,IAAA,CAACH,MAAM;IAACS,OAAO,EAAC,KAAK;IAACD,MAAM,EAAEA,MAAO;IAACE,IAAI;IAAAH,QAAA,EACvCA;EAAQ,CACH,CAAC;AAEb,CAAC;AAED,MAAMI,WAAW,GAAGA,CAAC;EAACJ,QAAQ;EAAEK,MAAM;EAAEC;AAAuB,CAAC,kBAC9DR,KAAA,CAACL,MAAM;EAACS,OAAO,EAAC,IAAI;EAACC,IAAI;EAAAH,QAAA,GACtBM,KAAK,gBACJV,IAAA,CAACJ,IAAI;IAACe,KAAK,EAAC,mBAAmB;IAACC,SAAS,EAAC,WAAW;IAACC,OAAO,EAAC,aAAa;IAAAT,QAAA,EACxEM;EAAK,CACF,CAAC,GACL,IAAI,eACRV,IAAA,CAACL,IAAI;IAACY,IAAI;IAAAH,QAAA,EAAEA;EAAQ,CAAO,CAAC,EAC3BK,MAAM,gBACLT,IAAA,CAACJ,IAAI;IAACe,KAAK,EAAC,kBAAkB;IAACE,OAAO,EAAC,UAAU;IAAAT,QAAA,EAC9CK;EAAM,CACH,CAAC,GACL,IAAI;AAAA,CACF,CACT;AAED,OAAO,MAAMK,IAAmB,GAAGC,MAAM,CAACC,MAAM,CAACb,QAAQ,EAAE;EAACc,OAAO,EAAET;AAAW,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,6 @@ export * from "./context-menu/index.js";
|
|
|
6
6
|
export * from "./fab-menu/index.js";
|
|
7
7
|
export * from "./form/index.js";
|
|
8
8
|
export * from "./menu/index.js";
|
|
9
|
-
export * from "./rn-context-menu/index.js";
|
|
10
9
|
export * from "./sheet/index.js";
|
|
11
10
|
export * from "./snackbar/index.js";
|
|
12
11
|
export * from "./swipe-actions/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["organisms/index.ts"],"mappings":";;AAAA,cAAc,yBAAgB;AAC9B,cAAc,kBAAS;AACvB,cAAc,yBAAgB;AAC9B,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,iBAAQ;AACtB,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["organisms/index.ts"],"mappings":";;AAAA,cAAc,yBAAgB;AAC9B,cAAc,kBAAS;AACvB,cAAc,yBAAgB;AAC9B,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,iBAAQ;AACtB,cAAc,kBAAS;AACvB,cAAc,qBAAY;AAC1B,cAAc,0BAAiB","ignoreList":[]}
|
|
@@ -1,62 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Text as ComposeText, DropdownMenu } from '@expo/ui/jetpack-compose';
|
|
4
|
-
import { clickable } from '@expo/ui/jetpack-compose/modifiers';
|
|
3
|
+
import { Text as ComposeText, DropdownMenu, DropdownMenuItem } from '@expo/ui/jetpack-compose';
|
|
5
4
|
import { useAppTheme } from '@hzblj/kara-theme';
|
|
6
|
-
import { useCallback,
|
|
5
|
+
import { useCallback, useState } from 'react';
|
|
7
6
|
import { HStack } from "../../atoms/h-stack/index.js";
|
|
8
7
|
import { Icon } from "../../atoms/icon/index.js";
|
|
9
|
-
import { Spacer } from "../../atoms/spacer/index.js";
|
|
10
8
|
import { Text } from "../../atoms/text/index.js";
|
|
11
|
-
import {
|
|
9
|
+
import { Glyph } from "../../glyph/index.js";
|
|
12
10
|
import { useHostGuard } from "../../host-context.js";
|
|
13
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
/** A row's `clickable` closes over its own action, so memoising it needs a component per row. */
|
|
15
12
|
const MenuItem = ({
|
|
16
13
|
action,
|
|
17
14
|
onDismiss
|
|
18
15
|
}) => {
|
|
19
16
|
const theme = useAppTheme();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
const color = action.destructive ? 'content.destructive' : 'content.primary';
|
|
18
|
+
return /*#__PURE__*/_jsxs(DropdownMenuItem, {
|
|
19
|
+
elementColors: {
|
|
20
|
+
leadingIconColor: theme.color(color),
|
|
21
|
+
textColor: theme.color(color)
|
|
22
|
+
},
|
|
23
|
+
onClick: () => {
|
|
24
|
+
onDismiss();
|
|
25
|
+
action.onPress();
|
|
26
|
+
},
|
|
27
|
+
children: [/*#__PURE__*/_jsx(DropdownMenuItem.Text, {
|
|
28
|
+
children: /*#__PURE__*/_jsx(ComposeText, {
|
|
29
|
+
color: theme.colorString(color),
|
|
30
|
+
style: theme.typography.body,
|
|
31
|
+
children: action.label
|
|
32
|
+
})
|
|
33
|
+
}), action.icon ? /*#__PURE__*/_jsx(DropdownMenuItem.LeadingIcon, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
35
|
+
color: color,
|
|
36
|
+
name: action.icon,
|
|
37
|
+
size: "s20"
|
|
38
|
+
})
|
|
39
|
+
}) : null]
|
|
29
40
|
});
|
|
30
41
|
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Material's dropdown menu, anchored to its trigger. The items live in the `Items` slot, which Compose presents in
|
|
45
|
+
* its own popup — anywhere else they would be laid out in place, on top of the trigger.
|
|
46
|
+
*/
|
|
31
47
|
export const Menu = ({
|
|
32
48
|
actions,
|
|
33
49
|
label
|
|
34
50
|
}) => {
|
|
35
51
|
useHostGuard('Menu');
|
|
52
|
+
const theme = useAppTheme();
|
|
36
53
|
const [expanded, setExpanded] = useState(false);
|
|
37
54
|
const dismiss = useCallback(() => setExpanded(false), []);
|
|
38
|
-
return /*#__PURE__*/_jsxs(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
return /*#__PURE__*/_jsxs(DropdownMenu, {
|
|
56
|
+
color: theme.color('surface.primary'),
|
|
57
|
+
expanded: expanded,
|
|
58
|
+
onDismissRequest: dismiss,
|
|
59
|
+
children: [/*#__PURE__*/_jsx(DropdownMenu.Trigger, {
|
|
60
|
+
children: /*#__PURE__*/_jsxs(HStack, {
|
|
61
|
+
align: "center",
|
|
62
|
+
onPress: () => setExpanded(true),
|
|
63
|
+
spacing: "s4",
|
|
64
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
65
|
+
color: "content.accent",
|
|
66
|
+
children: label
|
|
67
|
+
}), /*#__PURE__*/_jsx(Glyph, {
|
|
68
|
+
color: "content.accent",
|
|
69
|
+
name: "chevronDown",
|
|
70
|
+
size: "s16"
|
|
71
|
+
})]
|
|
72
|
+
})
|
|
73
|
+
}), /*#__PURE__*/_jsx(DropdownMenu.Items, {
|
|
54
74
|
children: actions.map(action => /*#__PURE__*/_jsx(MenuItem, {
|
|
55
75
|
action: action,
|
|
56
76
|
onDismiss: dismiss
|
|
57
77
|
}, action.label))
|
|
58
|
-
}), /*#__PURE__*/_jsx(Spacer, {
|
|
59
|
-
min: "s0"
|
|
60
78
|
})]
|
|
61
79
|
});
|
|
62
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","ComposeText","DropdownMenu","
|
|
1
|
+
{"version":3,"names":["Text","ComposeText","DropdownMenu","DropdownMenuItem","useAppTheme","useCallback","useState","HStack","Icon","Glyph","useHostGuard","jsx","_jsx","jsxs","_jsxs","MenuItem","action","onDismiss","theme","color","destructive","elementColors","leadingIconColor","textColor","onClick","onPress","children","colorString","style","typography","body","label","icon","LeadingIcon","name","size","Menu","actions","expanded","setExpanded","dismiss","onDismissRequest","Trigger","align","spacing","Items","map"],"sourceRoot":"../../../../src","sources":["organisms/menu/menu.android.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Theme } from '@hzblj/kara-theme';
|
|
1
|
+
import type { ColorToken, Theme } from '@hzblj/kara-theme';
|
|
2
2
|
import type { ButtonVariant } from './button.types';
|
|
3
3
|
export declare const buttonTokens: (variant: ButtonVariant, disabled: boolean, theme: Theme) => {
|
|
4
4
|
readonly content: 'content.on.bg';
|
|
@@ -21,3 +21,8 @@ export declare const buttonTokens: (variant: ButtonVariant, disabled: boolean, t
|
|
|
21
21
|
readonly fill: "btn.bg.glass.disabled" | "btn.bg.secondary.disabled" | "fill.accent.disabled" | "fill.destructive.disabled";
|
|
22
22
|
readonly shadow: "btn.accent" | "btn.destructive" | "btn.glass" | "btn.secondary";
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* The label for a button filled with an arbitrary `tint`: the on-accent white over a strong colour, the primary
|
|
26
|
+
* content colour over a pale one (`fill.accent.base`) — the light container tokens pair with it in both appearances.
|
|
27
|
+
*/
|
|
28
|
+
export declare const contentOnTint: (tint: ColorToken, theme: Theme) => ColorToken;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const DatePicker: DatePickerComponent;
|
|
1
|
+
export * from './date-picker.ios';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { GlassViewProps } from './glass-view.types';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The capsule drawn where there is no Liquid Glass to draw: the glass buttons' own translucent fill, so whatever sits
|
|
4
|
+
* on the glass — usually content meant for a colourful backdrop — stays readable, the way it would on real glass.
|
|
5
|
+
*/
|
|
3
6
|
export declare const GlassFallback: ({ children, interactive: _interactive, tint, ...props }: GlassViewProps) => import("react").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import type { ReactNode } from 'react';
|
|
|
4
4
|
/**
|
|
5
5
|
* iOS 26 Liquid Glass around a React Native subtree, shaped as a capsule — the React Native tier, so it needs no host
|
|
6
6
|
* and costs next to nothing in a list cell. Where there is no Liquid Glass (Android, and iOS before 26) it draws a
|
|
7
|
-
* capsule of `tint` instead, or of `
|
|
7
|
+
* capsule of `tint` instead, or of the glass buttons' translucent fill (`btn.bg.glass.base`) when there is none.
|
|
8
8
|
*/
|
|
9
9
|
export type GlassViewProps = ResponsiveViewSx & {
|
|
10
10
|
/** React Native views. Give them `pointerEvents="none"` when `interactive`, so the press reaches the `Pressable`. */
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import type { IconComponent } from './icon.types';
|
|
2
|
+
/**
|
|
3
|
+
* The app's icon from its asset catalog — the template image set the config plugin generated from the SVG, vector data
|
|
4
|
+
* kept, so `resizable()` scales it crisply to the token size and the platform tints it.
|
|
5
|
+
*/
|
|
2
6
|
export declare const Icon: IconComponent;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import type { ColorToken, SpaceSize } from '@hzblj/kara-theme';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
|
|
3
|
+
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* The app's icon names, one key per SVG in its icon folder. Written by the config plugin
|
|
6
|
+
* (`plugins: [['@hzblj/kara-ui', {icons: {source: './assets/icons'}}]]`) into `kara-icons.d.ts`, or by
|
|
7
|
+
* `npx kara-icons`. Empty until then. Global, so the declaration reaches it without resolving any kara package.
|
|
8
|
+
*/
|
|
9
|
+
interface KaraIcons {
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
type DeclaredIconName = keyof KaraIcons & string;
|
|
13
|
+
/**
|
|
14
|
+
* One of the app's icons. Once the plugin has written `kara-icons.d.ts` only those names type-check — an icon removed
|
|
15
|
+
* from the folder fails at every call site. Before that, any string, so a project can adopt icons gradually.
|
|
16
|
+
*/
|
|
17
|
+
export type IconName = [DeclaredIconName] extends [never] ? string : DeclaredIconName;
|
|
4
18
|
export type IconProps = {
|
|
19
|
+
/** What a screen reader says. Unset, the icon is decorative and hidden from it. */
|
|
20
|
+
accessibilityLabel?: string;
|
|
5
21
|
color?: ColorToken;
|
|
6
22
|
name: IconName;
|
|
7
23
|
size?: SpaceSize;
|
|
8
24
|
testID?: string;
|
|
9
25
|
};
|
|
10
26
|
export type IconComponent = (props: IconProps) => ReactNode;
|
|
27
|
+
export {};
|
|
@@ -7,7 +7,6 @@ export * from './card';
|
|
|
7
7
|
export * from './checkbox';
|
|
8
8
|
export * from './chip';
|
|
9
9
|
export * from './color-picker';
|
|
10
|
-
export * from './countdown';
|
|
11
10
|
export * from './date-picker';
|
|
12
11
|
export * from './divider';
|
|
13
12
|
export * from './fab';
|
|
@@ -23,6 +22,7 @@ export * from './picker';
|
|
|
23
22
|
export * from './pressable';
|
|
24
23
|
export * from './progress';
|
|
25
24
|
export * from './rn-flat-list';
|
|
25
|
+
export * from './rn-icon';
|
|
26
26
|
export * from './rn-scroll-view';
|
|
27
27
|
export * from './rn-section-list';
|
|
28
28
|
export * from './rn-text';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A scrolling list — SwiftUI `List`, Compose `LazyColumn`. It has no height of its own, so it needs one from outside:
|
|
4
|
+
* a `Screen`, or an `Island` with `matchContents={false}` and a height. In an island that sizes itself to its content
|
|
5
|
+
* Compose measures it against an infinite height and throws ("Vertically scrollable component was measured with an
|
|
6
|
+
* infinity maximum height"); SwiftUI shows nothing. For a handful of rows that should not scroll, use a `VStack`.
|
|
7
|
+
*
|
|
8
|
+
* Rows are separated for you — SwiftUI's own separators, a `Divider` between rows on Android — so a `Divider` among
|
|
9
|
+
* the children is one too many: on iOS it becomes an empty row of its own.
|
|
10
|
+
*/
|
|
2
11
|
export type ListProps = {
|
|
3
12
|
children: ReactNode;
|
|
4
13
|
/**
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Picker: PickerComponent;
|
|
1
|
+
export * from './picker.ios';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './rn-icon.ios';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { IconProps } from '../icon';
|
|
3
|
+
/** The same contract as `Icon`, for the React Native tier — anywhere, no `Screen` or `Island` needed. */
|
|
4
|
+
export type RnIconProps = IconProps;
|
|
5
|
+
export type RnIconComponent = (props: RnIconProps) => ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './glyph-button.ios';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GlyphName } from '@hzblj/kara-native';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/** An icon button over one of kara's glyphs — for the controls its own components build (a stepper, a bar). */
|
|
4
|
+
export type GlyphButtonProps = {
|
|
5
|
+
accessibilityLabel?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
name: GlyphName;
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export type GlyphButtonComponent = (props: GlyphButtonProps) => ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './glyph.ios';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GlyphName } from '@hzblj/kara-native';
|
|
2
|
+
import type { ColorToken, SpaceSize } from '@hzblj/kara-theme';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* One of the few glyphs kara's own components draw — a search field's magnifier, a row's chevron. Internal: apps draw
|
|
6
|
+
* their own icons with `Icon` / `RnIcon`.
|
|
7
|
+
*/
|
|
8
|
+
export type GlyphProps = {
|
|
9
|
+
color?: ColorToken;
|
|
10
|
+
name: GlyphName;
|
|
11
|
+
size?: SpaceSize;
|
|
12
|
+
};
|
|
13
|
+
export type GlyphComponent = (props: GlyphProps) => ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './rn-glyph.ios';
|
|
@@ -5,6 +5,9 @@ export type { ScrollEdgeEffect, ScrollEdgeScrollableProps } from '@hzblj/kara-na
|
|
|
5
5
|
/**
|
|
6
6
|
* Bars over one React Native scroll view, with the iOS 26 scroll edge effect under them — the system's progressive
|
|
7
7
|
* blur where content scrolls past a bar. The React Native tier: it needs no host.
|
|
8
|
+
*
|
|
9
|
+
* A screen-level container: wrap the screen's scroll view with it. Mounted inside a cell of a virtualized list on iOS
|
|
10
|
+
* it draws only its bottom bar — the hosted scroll view and the top bar stay blank.
|
|
8
11
|
*/
|
|
9
12
|
export type ScrollEdgeContainerProps = ResponsiveViewSx & {
|
|
10
13
|
/**
|
|
@@ -1,7 +1,33 @@
|
|
|
1
|
+
import type { ResponsiveViewSx } from '@hzblj/kara-sx';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { MenuAction } from '../menu';
|
|
3
|
-
|
|
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 trigger is ordinary React Native layout, so it
|
|
8
|
+
* needs no `Screen` or `Island`.
|
|
9
|
+
*/
|
|
10
|
+
export type ContextMenuProps = ResponsiveViewSx & {
|
|
4
11
|
actions: MenuAction[];
|
|
12
|
+
/** The trigger, laid out as usual. */
|
|
5
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 ContextMenuExclusionProps = {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
export type ContextMenuComponent = ((props: ContextMenuProps) => 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: ContextMenuExclusionProps) => ReactNode;
|
|
6
33
|
};
|
|
7
|
-
export type ContextMenuComponent = (props: ContextMenuProps) => ReactNode;
|