@webority/mobile-ui 0.102.3 → 0.104.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/dist/canvas-kit/kit.js +7142 -6778
- package/dist/canvas-kit/manifest.json +151 -1
- package/dist/canvas-kit/release.json +6 -6
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.meta.js +1 -1
- package/lib/commonjs/components/SortableList/SortableList.js +1 -0
- package/lib/commonjs/components/SortableList/SortableList.meta.js +1 -0
- package/lib/commonjs/components/SortableList/index.js +1 -0
- package/lib/commonjs/components/index.js +1 -1
- package/lib/module/components/Checkbox/Checkbox.js +1 -1
- package/lib/module/components/Checkbox/Checkbox.meta.js +1 -1
- package/lib/module/components/SortableList/SortableList.js +1 -0
- package/lib/module/components/SortableList/SortableList.meta.js +1 -0
- package/lib/module/components/SortableList/index.js +1 -0
- package/lib/module/components/index.js +1 -1
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +3 -0
- package/lib/typescript/commonjs/components/SortableList/SortableList.d.ts +53 -0
- package/lib/typescript/commonjs/components/SortableList/SortableList.meta.d.ts +3 -0
- package/lib/typescript/commonjs/components/SortableList/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts +2 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +3 -0
- package/lib/typescript/module/components/SortableList/SortableList.d.ts +53 -0
- package/lib/typescript/module/components/SortableList/SortableList.meta.d.ts +3 -0
- package/lib/typescript/module/components/SortableList/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts +2 -0
- package/package.json +6 -6
|
@@ -160,6 +160,8 @@ export type { SliderFieldProps } from "./SliderField";
|
|
|
160
160
|
export { SliderField } from "./SliderField";
|
|
161
161
|
export type { SlideToConfirmProps, SlideToConfirmSize, SlideToConfirmTone } from "./SlideToConfirm";
|
|
162
162
|
export { SlideToConfirm } from "./SlideToConfirm";
|
|
163
|
+
export type { SortableListProps } from "./SortableList";
|
|
164
|
+
export { SortableList } from "./SortableList";
|
|
163
165
|
export type { SparklineProps, SparklineTone } from "./Sparkline";
|
|
164
166
|
export { Sparkline } from "./Sparkline";
|
|
165
167
|
export type { SpinnerProps, SpinnerSize, SpinnerVariant } from "./Spinner";
|
|
@@ -3,6 +3,7 @@ import type { PressableProps, View as RNView, StyleProp, TextStyle, ViewStyle }
|
|
|
3
3
|
import type { HapticType } from "../../utils/hapticUtils.js";
|
|
4
4
|
export type CheckboxSize = "sm" | "md" | "lg";
|
|
5
5
|
export type CheckboxTone = "primary" | "success" | "warning" | "danger";
|
|
6
|
+
export type CheckboxShape = "circle";
|
|
6
7
|
export interface CheckboxProps extends Omit<PressableProps, "style" | "children" | "onPress"> {
|
|
7
8
|
checked?: boolean;
|
|
8
9
|
defaultChecked?: boolean;
|
|
@@ -34,6 +35,8 @@ export interface CheckboxProps extends Omit<PressableProps, "style" | "children"
|
|
|
34
35
|
labelLines?: number;
|
|
35
36
|
size?: CheckboxSize;
|
|
36
37
|
tone?: CheckboxTone;
|
|
38
|
+
/** circle draws a round box with the tick inside. Omit it for the square box. */
|
|
39
|
+
shape?: CheckboxShape;
|
|
37
40
|
accessibilityLabel?: string;
|
|
38
41
|
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
39
42
|
haptic?: HapticType | false;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SortableList: rows the person reorders by dragging. A long press lifts a row (a drag handle does
|
|
3
|
+
* when `handle` is set); the other rows make room, the list scrolls near its edges, and a drop calls
|
|
4
|
+
* `onReorder` with the keys in their new order. The list is controlled: the parent reorders `data`.
|
|
5
|
+
* Every row also offers "Move up" and "Move down" as accessibility actions, so no drag is required.
|
|
6
|
+
*
|
|
7
|
+
* USAGE:
|
|
8
|
+
*
|
|
9
|
+
* <SortableList
|
|
10
|
+
* data={tasks}
|
|
11
|
+
* keyExtractor={(task) => task.id}
|
|
12
|
+
* renderItem={({ item }) => <ListItem title={item.title} />}
|
|
13
|
+
* onReorder={(keys) => setTasks(sortByKeys(tasks, keys))}
|
|
14
|
+
* />
|
|
15
|
+
*/
|
|
16
|
+
import type React from "react";
|
|
17
|
+
export interface SortableListProps<T> {
|
|
18
|
+
data: readonly T[];
|
|
19
|
+
keyExtractor: (item: T, index: number) => string;
|
|
20
|
+
renderItem: (info: {
|
|
21
|
+
item: T;
|
|
22
|
+
index: number;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
}) => React.ReactNode;
|
|
25
|
+
/** Called with the keys in their new order after a drop or a "Move up" or "Move down" action. */
|
|
26
|
+
onReorder: (keys: string[]) => void;
|
|
27
|
+
/** Only the drag handle lifts a row; by default a long press on the row does. */
|
|
28
|
+
handle?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
accessibilityLabel?: string;
|
|
31
|
+
testID?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
|
|
34
|
+
/** Top edge of row `index` when the rows stack at their own heights. */
|
|
35
|
+
export declare function topOf(heights: readonly number[], index: number): number;
|
|
36
|
+
/** Top edge of the slot `to` once row `from` has left its place and the rest keep their order. */
|
|
37
|
+
export declare function slotTop(heights: readonly number[], from: number, to: number): number;
|
|
38
|
+
/**
|
|
39
|
+
* The slot the lifted row would drop into. The row counts as passing another row once its
|
|
40
|
+
* centre is past that row's midpoint, so a drop lands on the nearest slot to the finger.
|
|
41
|
+
*/
|
|
42
|
+
export declare function dropIndex(heights: readonly number[], from: number, dragY: number): number;
|
|
43
|
+
/**
|
|
44
|
+
* How far each row moves while row `from` is lifted towards slot `to`, by row index. The lifted
|
|
45
|
+
* row's own entry is not used; it follows the finger instead.
|
|
46
|
+
*/
|
|
47
|
+
export declare function rowShifts(heights: readonly number[], from: number, to: number): number[];
|
|
48
|
+
export declare function SortableList<T>(props: SortableListProps<T>): React.ReactElement;
|
|
49
|
+
export declare namespace SortableList {
|
|
50
|
+
var displayName: string;
|
|
51
|
+
}
|
|
52
|
+
export default SortableList;
|
|
53
|
+
//# sourceMappingURL=SortableList.d.ts.map
|
|
@@ -160,6 +160,8 @@ export type { SliderFieldProps } from "./SliderField/index.js";
|
|
|
160
160
|
export { SliderField } from "./SliderField/index.js";
|
|
161
161
|
export type { SlideToConfirmProps, SlideToConfirmSize, SlideToConfirmTone } from "./SlideToConfirm/index.js";
|
|
162
162
|
export { SlideToConfirm } from "./SlideToConfirm/index.js";
|
|
163
|
+
export type { SortableListProps } from "./SortableList/index.js";
|
|
164
|
+
export { SortableList } from "./SortableList/index.js";
|
|
163
165
|
export type { SparklineProps, SparklineTone } from "./Sparkline/index.js";
|
|
164
166
|
export { Sparkline } from "./Sparkline/index.js";
|
|
165
167
|
export type { SpinnerProps, SpinnerSize, SpinnerVariant } from "./Spinner/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/mobile-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.104.0",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components, theme and form engine for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
"react-native-safe-area-context": ">=5.4.0",
|
|
87
87
|
"react-native-svg": ">=15.0.0",
|
|
88
88
|
"react-native-worklets": ">=0.10.0",
|
|
89
|
-
"@webority/
|
|
90
|
-
"@webority/
|
|
89
|
+
"@webority/mobile-core": "0.104.0",
|
|
90
|
+
"@webority/canvas-kit": "0.104.0"
|
|
91
91
|
},
|
|
92
92
|
"peerDependenciesMeta": {
|
|
93
93
|
"@webority/canvas-kit": {
|
|
@@ -148,10 +148,10 @@
|
|
|
148
148
|
"react-test-renderer": "19.2.8",
|
|
149
149
|
"rimraf": "6.1.3",
|
|
150
150
|
"typescript": "5.9.3",
|
|
151
|
-
"@webority/
|
|
151
|
+
"@webority/canvas-kit": "0.104.0",
|
|
152
|
+
"@webority/mobile-core": "0.104.0",
|
|
152
153
|
"@webority/mobile-dev": "0.0.0",
|
|
153
|
-
"@webority/
|
|
154
|
-
"@webority/tokens": "0.102.3"
|
|
154
|
+
"@webority/tokens": "0.104.0"
|
|
155
155
|
},
|
|
156
156
|
"scripts": {
|
|
157
157
|
"build": "bob build && node ../mobile-dev/scripts/minify-lib.mjs && node -e \"require('node:fs').rmSync('dist/canvas-kit',{recursive:true,force:true})\" && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit",
|