@hzblj/kara-components 0.4.0 → 0.5.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 +28 -0
- package/lib/module/organisms/context-menu/context-menu.android.js +2 -1
- package/lib/module/organisms/context-menu/context-menu.android.js.map +1 -1
- package/lib/module/organisms/context-menu/context-menu.ios.js +2 -0
- package/lib/module/organisms/context-menu/context-menu.ios.js.map +1 -1
- package/lib/typescript/organisms/context-menu/context-menu.types.d.ts +8 -0
- package/package.json +4 -4
- package/src/organisms/context-menu/context-menu.android.tsx +2 -2
- package/src/organisms/context-menu/context-menu.ios.tsx +10 -1
- package/src/organisms/context-menu/context-menu.types.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @hzblj/kara-components
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8](https://github.com/hzblj/kara-ui/pull/8) [`3b0a6fb`](https://github.com/hzblj/kara-ui/commit/3b0a6fbc49559720023fece2b5c6189ad4d88bc8) Thanks [@hzblj](https://github.com/hzblj)! - `ZoomTransition`: a push that grows out of the photo it was opened from and shrinks back into it.
|
|
8
|
+
|
|
9
|
+
- iOS 18: UIKit's zoom transition, with the interactive dismissal (swipe down, edge swipe, pinch) gated on the scroll views under the finger. Below iOS 18 the push stays a slide. Android: Material's container transform, both ways.
|
|
10
|
+
- Three pieces from `@hzblj/kara-ui/router`, tied by one identifier: `ZoomTransition.Source` on the list, `ZoomTransition.Enabler` and `ZoomTransition.Target` on the pushed screen; `useZoomTransitionSourceId`, `ZOOM_TRANSITION_PARAM`, `useZoomTransitionParam` and `withZoomTransition` (an Android fade under the transform) around them.
|
|
11
|
+
- Settings both platforms honour sit at the top (`scrim`); the rest is typed apart under `ios` (`dismissGesture`, `blur`, the target's `fit`) and `android` (`duration`, `easing`, `fade`, `path`, corner radii, the target's `fit` and `flex`).
|
|
12
|
+
- `ContextMenu`: with a `ZoomTransition.Source` in the trigger, a tap on the iOS preview zooms the preview's photo straight into the pushed screen. `previewTransition` (`zoom`, `pop`, `dismiss`) picks how the preview leaves.
|
|
13
|
+
- `DurationSize`, the keys of `duration`.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`3b0a6fb`](https://github.com/hzblj/kara-ui/commit/3b0a6fbc49559720023fece2b5c6189ad4d88bc8)]:
|
|
18
|
+
- @hzblj/kara-native@0.5.0
|
|
19
|
+
- @hzblj/kara-theme@0.5.0
|
|
20
|
+
- @hzblj/kara-sx@0.5.0
|
|
21
|
+
|
|
22
|
+
## 0.4.1
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [[`d14bdd3`](https://github.com/hzblj/kara-ui/commit/d14bdd37bede9fef80f4d3af4621ea5d60b2b16b)]:
|
|
27
|
+
- @hzblj/kara-native@0.4.1
|
|
28
|
+
- @hzblj/kara-theme@0.4.1
|
|
29
|
+
- @hzblj/kara-sx@0.4.1
|
|
30
|
+
|
|
3
31
|
## 0.4.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
|
@@ -51,7 +51,7 @@ const MenuRow = ({
|
|
|
51
51
|
* Android's own take on a context menu, since Material has no lifted preview: a long press ripples the trigger, ticks
|
|
52
52
|
* the long-press haptic, and opens a Material dropdown where the finger is — the trigger stays highlighted while the
|
|
53
53
|
* menu is up. The host behind the menu mounts on the first long press and stays, so a list of triggers that are only
|
|
54
|
-
* scrolled past never builds one. `preview` and `
|
|
54
|
+
* scrolled past never builds one. `preview`, `onPreviewPress` and `previewTransition` are iOS-only.
|
|
55
55
|
*/
|
|
56
56
|
const ContextMenuRoot = ({
|
|
57
57
|
actions,
|
|
@@ -62,6 +62,7 @@ const ContextMenuRoot = ({
|
|
|
62
62
|
const {
|
|
63
63
|
onPreviewPress: _onPreviewPress,
|
|
64
64
|
preview: _preview,
|
|
65
|
+
previewTransition: _previewTransition,
|
|
65
66
|
...sx
|
|
66
67
|
} = props;
|
|
67
68
|
const theme = useAppTheme();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","ComposeText","DropdownMenu","DropdownMenuItem","Host","useSx","useAppTheme","Haptics","useCallback","useMemo","useRef","useState","Pressable","StyleSheet","View","Icon","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","sx","resolved","trigger","setAnchor","expanded","setExpanded","inner","outer","ripple","highlight","backgroundColor","open","event","pageX","pageY","nativeEvent","performAndroidHapticsAsync","AndroidHaptics","Long_Press","catch","undefined","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,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,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,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,cAAc,QAAO,sBAAmB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,I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AAQ;EAAEY,MAAM;EAAE,GAAGC;AAAuB,CAAC,KAAK;EACnF,MAAM;IAACC,cAAc,EAAEC,eAAe;IAAEC,OAAO,EAAEC,QAAQ;IAAE,GAAGC;EAAE,CAAC,
|
|
1
|
+
{"version":3,"names":["Text","ComposeText","DropdownMenu","DropdownMenuItem","Host","useSx","useAppTheme","Haptics","useCallback","useMemo","useRef","useState","Pressable","StyleSheet","View","Icon","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","performAndroidHapticsAsync","AndroidHaptics","Long_Press","catch","undefined","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,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,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,YAAY,QAAO,uBAAoB;AAC/C,SAAQC,cAAc,QAAO,sBAAmB;AAAA,SAAAC,GAAA,IAAAC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ED,KAAK,CAACC,KAAK,CAAC,iBAAiB,CAAE;YAAC4B,QAAQ,EAAEA,QAAS;YAACqC,gBAAgB,EAAEV,OAAQ;YAAAnD,QAAA,eACjGjB,IAAA,CAACjB,YAAY,CAACgG,KAAK;cAAA9D,QAAA,EAChBW,OAAO,CAACoD,GAAG,CAACtE,MAAM,iBACjBV,IAAA,CAACS,OAAO;gBAACC,MAAM,EAAEA,MAAO;gBAAoBC,SAAS,EAAEyD;cAAQ,GAAjC1D,MAAM,CAACY,KAA4B,CAClE;YAAC,CACgB;UAAC,CACT;QAAC,CACH;MAAC,CACX,CAAC,GACL,IAAI;IAAA,CACC;EAAC,CACR,CAAC;AAEX,CAAC;;AAED;AACA,MAAM2D,SAAS,GAAGA,CAAC;EAAChE;AAAmC,CAAC,kBAAKjB,IAAA,CAACL,IAAI;EAAAsB,QAAA,EAAEA;AAAQ,CAAO,CAAC;AAEpF,OAAO,MAAMiE,WAAiC,GAAGC,MAAM,CAACC,MAAM,CAACzD,eAAe,EAAE;EAACsD;AAAS,CAAC,CAAC","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ const ContextMenuRoot = ({
|
|
|
10
10
|
children,
|
|
11
11
|
onPreviewPress,
|
|
12
12
|
preview,
|
|
13
|
+
previewTransition,
|
|
13
14
|
testID,
|
|
14
15
|
...sx
|
|
15
16
|
}) => {
|
|
@@ -28,6 +29,7 @@ const ContextMenuRoot = ({
|
|
|
28
29
|
onPreviewPress: onPreviewPress,
|
|
29
30
|
onSelectItem: onSelectItem,
|
|
30
31
|
preview: preview,
|
|
32
|
+
previewTransition: previewTransition,
|
|
31
33
|
style: style,
|
|
32
34
|
testID: testID,
|
|
33
35
|
children: children
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"names":["iconResourceName","ContextMenu","NativeContextMenu","ContextMenuExclusion","NativeContextMenuExclusion","useSx","useCallback","useMemo","jsx","_jsx","ContextMenuRoot","actions","children","onPreviewPress","preview","previewTransition","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;EACvBC,OAAO;EACPC,QAAQ;EACRC,cAAc;EACdC,OAAO;EACPC,iBAAiB;EACjBC,MAAM;EACN,GAAGC;AACa,CAAC,KAAK;EACtB,MAAMC,KAAK,GAAGb,KAAK,CAACY,EAAE,CAAC;;EAEvB;EACA,MAAME,KAAK,GAAGZ,OAAO,CACnB,MACEI,OAAO,CAACS,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,GAAG3B,gBAAgB,CAACqB,MAAM,CAACM,IAAI,CAAC,GAAGC,SAAS;IAC9DC,KAAK,EAAER,MAAM,CAACS;EAChB,CAAC,CAAC,CAAC,EACL,CAACnB,OAAO,CACV,CAAC;EAED,MAAMoB,YAAY,GAAGzB,WAAW,CAAEkB,EAAU,IAAKb,OAAO,CAACqB,MAAM,CAACR,EAAE,CAAC,CAAC,EAAES,OAAO,CAAC,CAAC,EAAE,CAACtB,OAAO,CAAC,CAAC;EAE3F,oBACEF,IAAA,CAACP,iBAAiB;IAChBiB,KAAK,EAAEA,KAAM;IACbN,cAAc,EAAEA,cAAe;IAC/BkB,YAAY,EAAEA,YAAa;IAC3BjB,OAAO,EAAEA,OAAQ;IACjBC,iBAAiB,EAAEA,iBAAkB;IACrCG,KAAK,EAAEA,KAAM;IACbF,MAAM,EAAEA,MAAO;IAAAJ,QAAA,EAEdA;EAAQ,CACQ,CAAC;AAExB,CAAC;AAED,MAAMsB,SAAS,GAAGA,CAAC;EAACtB;AAAmC,CAAC,kBACtDH,IAAA,CAACL,0BAA0B;EAAAQ,QAAA,EAAEA;AAAQ,CAA6B,CACnE;AAED,OAAO,MAAMX,WAAiC,GAAGkC,MAAM,CAACC,MAAM,CAAC1B,eAAe,EAAE;EAACwB;AAAS,CAAC,CAAC","ignoreList":[]}
|
|
@@ -20,6 +20,14 @@ export type ContextMenuProps = ResponsiveViewSx & {
|
|
|
20
20
|
* every preview up front.
|
|
21
21
|
*/
|
|
22
22
|
preview?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* iOS: how the preview leaves once tapped, before `onPreviewPress`. `zoom`: its photo grows straight into the pushed
|
|
25
|
+
* screen, the way the App Store expands a preview — needs a `ZoomTransition.Source` (`@hzblj/kara-ui/router`) in the
|
|
26
|
+
* trigger, a `preview` and iOS 18, and shrinks back like `dismiss` otherwise. `pop`: UIKit's default, the preview
|
|
27
|
+
* flies out. `dismiss`: it shrinks back onto the trigger first. Default: `zoom` when the trigger holds a
|
|
28
|
+
* `ZoomTransition.Source`, `pop` otherwise.
|
|
29
|
+
*/
|
|
30
|
+
previewTransition?: 'dismiss' | 'pop' | 'zoom';
|
|
23
31
|
testID?: string;
|
|
24
32
|
};
|
|
25
33
|
export type ContextMenuExclusionProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hzblj/kara-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The atoms, molecules, organisms and templates of @hzblj/kara-ui — real SwiftUI and Jetpack Compose views through @expo/ui.",
|
|
5
5
|
"author": "Jan Blazej",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@hzblj/kara-native": "^0.
|
|
63
|
-
"@hzblj/kara-sx": "^0.
|
|
64
|
-
"@hzblj/kara-theme": "^0.
|
|
62
|
+
"@hzblj/kara-native": "^0.5.0",
|
|
63
|
+
"@hzblj/kara-sx": "^0.5.0",
|
|
64
|
+
"@hzblj/kara-theme": "^0.5.0",
|
|
65
65
|
"sf-symbols-typescript": "^2.2.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
@@ -52,10 +52,10 @@ const MenuRow = ({action, onDismiss}: MenuRowProps) => {
|
|
|
52
52
|
* Android's own take on a context menu, since Material has no lifted preview: a long press ripples the trigger, ticks
|
|
53
53
|
* the long-press haptic, and opens a Material dropdown where the finger is — the trigger stays highlighted while the
|
|
54
54
|
* menu is up. The host behind the menu mounts on the first long press and stays, so a list of triggers that are only
|
|
55
|
-
* scrolled past never builds one. `preview` and `
|
|
55
|
+
* scrolled past never builds one. `preview`, `onPreviewPress` and `previewTransition` are iOS-only.
|
|
56
56
|
*/
|
|
57
57
|
const ContextMenuRoot = ({actions, children, testID, ...props}: ContextMenuProps) => {
|
|
58
|
-
const {onPreviewPress: _onPreviewPress, preview: _preview, ...sx} = props
|
|
58
|
+
const {onPreviewPress: _onPreviewPress, preview: _preview, previewTransition: _previewTransition, ...sx} = props
|
|
59
59
|
const theme = useAppTheme()
|
|
60
60
|
const resolved = useSx(sx)
|
|
61
61
|
const trigger = useRef<View>(null)
|
|
@@ -8,7 +8,15 @@ import {useSx} from '@hzblj/kara-sx'
|
|
|
8
8
|
import {useCallback, useMemo} from 'react'
|
|
9
9
|
import type {ContextMenuComponent, ContextMenuExclusionProps, ContextMenuProps} from './context-menu.types'
|
|
10
10
|
|
|
11
|
-
const ContextMenuRoot = ({
|
|
11
|
+
const ContextMenuRoot = ({
|
|
12
|
+
actions,
|
|
13
|
+
children,
|
|
14
|
+
onPreviewPress,
|
|
15
|
+
preview,
|
|
16
|
+
previewTransition,
|
|
17
|
+
testID,
|
|
18
|
+
...sx
|
|
19
|
+
}: ContextMenuProps) => {
|
|
12
20
|
const style = useSx(sx)
|
|
13
21
|
|
|
14
22
|
/** The native side hands back an id; the index is the one identity every action has. */
|
|
@@ -31,6 +39,7 @@ const ContextMenuRoot = ({actions, children, onPreviewPress, preview, testID, ..
|
|
|
31
39
|
onPreviewPress={onPreviewPress}
|
|
32
40
|
onSelectItem={onSelectItem}
|
|
33
41
|
preview={preview}
|
|
42
|
+
previewTransition={previewTransition}
|
|
34
43
|
style={style}
|
|
35
44
|
testID={testID}
|
|
36
45
|
>
|
|
@@ -21,6 +21,14 @@ export type ContextMenuProps = ResponsiveViewSx & {
|
|
|
21
21
|
* every preview up front.
|
|
22
22
|
*/
|
|
23
23
|
preview?: ReactNode
|
|
24
|
+
/**
|
|
25
|
+
* iOS: how the preview leaves once tapped, before `onPreviewPress`. `zoom`: its photo grows straight into the pushed
|
|
26
|
+
* screen, the way the App Store expands a preview — needs a `ZoomTransition.Source` (`@hzblj/kara-ui/router`) in the
|
|
27
|
+
* trigger, a `preview` and iOS 18, and shrinks back like `dismiss` otherwise. `pop`: UIKit's default, the preview
|
|
28
|
+
* flies out. `dismiss`: it shrinks back onto the trigger first. Default: `zoom` when the trigger holds a
|
|
29
|
+
* `ZoomTransition.Source`, `pop` otherwise.
|
|
30
|
+
*/
|
|
31
|
+
previewTransition?: 'dismiss' | 'pop' | 'zoom'
|
|
24
32
|
testID?: string
|
|
25
33
|
}
|
|
26
34
|
|