@cdx-ui/components 0.2.1 → 0.2.3
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/README.md +4 -2
- package/coverage.svg +1 -1
- package/lib/commonjs/components/Button/styles.js +7 -2
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +1 -1
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Heading/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js +170 -9
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +36 -1
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/RangeCalendar/index.js.map +1 -1
- package/lib/commonjs/components/ReorderableList/ReorderableListShared.js +91 -0
- package/lib/commonjs/components/ReorderableList/ReorderableListShared.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/index.js +135 -0
- package/lib/commonjs/components/ReorderableList/index.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/index.web.js +233 -0
- package/lib/commonjs/components/ReorderableList/index.web.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/labels.js +47 -0
- package/lib/commonjs/components/ReorderableList/labels.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/reorderItems.js +16 -0
- package/lib/commonjs/components/ReorderableList/reorderItems.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/rowContext.js +42 -0
- package/lib/commonjs/components/ReorderableList/rowContext.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/types.js +6 -0
- package/lib/commonjs/components/ReorderableList/types.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/useReorder.js +131 -0
- package/lib/commonjs/components/ReorderableList/useReorder.js.map +1 -0
- package/lib/commonjs/components/ReorderableList/webDnd.js +64 -0
- package/lib/commonjs/components/ReorderableList/webDnd.js.map +1 -0
- package/lib/commonjs/components/ScopedTheme/index.js.map +1 -1
- package/lib/commonjs/components/Skeleton/index.js.map +1 -1
- package/lib/commonjs/components/TablePagination/index.js.map +1 -1
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/Tile/styles.js +1 -1
- package/lib/commonjs/components/Tile/styles.js.map +1 -1
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/reorderable-list.js +17 -0
- package/lib/commonjs/reorderable-list.js.map +1 -0
- package/lib/commonjs/styles.css +18 -0
- package/lib/module/components/Button/styles.js +7 -2
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Field/index.js +1 -1
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Heading/index.js.map +1 -1
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/ListItem/index.js +163 -14
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +35 -0
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/RangeCalendar/index.js.map +1 -1
- package/lib/module/components/ReorderableList/ReorderableListShared.js +86 -0
- package/lib/module/components/ReorderableList/ReorderableListShared.js.map +1 -0
- package/lib/module/components/ReorderableList/index.js +130 -0
- package/lib/module/components/ReorderableList/index.js.map +1 -0
- package/lib/module/components/ReorderableList/index.web.js +229 -0
- package/lib/module/components/ReorderableList/index.web.js.map +1 -0
- package/lib/module/components/ReorderableList/labels.js +41 -0
- package/lib/module/components/ReorderableList/labels.js.map +1 -0
- package/lib/module/components/ReorderableList/reorderItems.js +12 -0
- package/lib/module/components/ReorderableList/reorderItems.js.map +1 -0
- package/lib/module/components/ReorderableList/rowContext.js +38 -0
- package/lib/module/components/ReorderableList/rowContext.js.map +1 -0
- package/lib/module/components/ReorderableList/types.js +4 -0
- package/lib/module/components/ReorderableList/types.js.map +1 -0
- package/lib/module/components/ReorderableList/useReorder.js +123 -0
- package/lib/module/components/ReorderableList/useReorder.js.map +1 -0
- package/lib/module/components/ReorderableList/webDnd.js +59 -0
- package/lib/module/components/ReorderableList/webDnd.js.map +1 -0
- package/lib/module/components/ScopedTheme/index.js.map +1 -1
- package/lib/module/components/Skeleton/index.js.map +1 -1
- package/lib/module/components/TablePagination/index.js.map +1 -1
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/Tile/styles.js +1 -1
- package/lib/module/components/Tile/styles.js.map +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/reorderable-list.js +4 -0
- package/lib/module/reorderable-list.js.map +1 -0
- package/lib/module/styles.css +18 -0
- package/lib/typescript/components/Button/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +22 -0
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Heading/index.d.ts +20 -2
- package/lib/typescript/components/Heading/index.d.ts.map +1 -1
- package/lib/typescript/components/Icon/index.d.ts +2 -0
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +23 -1
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts +5 -0
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts +116 -4
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/RangeCalendar/index.d.ts +2 -0
- package/lib/typescript/components/RangeCalendar/index.d.ts.map +1 -1
- package/lib/typescript/components/ReorderableList/ReorderableListShared.d.ts +31 -0
- package/lib/typescript/components/ReorderableList/ReorderableListShared.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/index.d.ts +8 -0
- package/lib/typescript/components/ReorderableList/index.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/index.web.d.ts +8 -0
- package/lib/typescript/components/ReorderableList/index.web.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/labels.d.ts +16 -0
- package/lib/typescript/components/ReorderableList/labels.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/reorderItems.d.ts +3 -0
- package/lib/typescript/components/ReorderableList/reorderItems.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/rowContext.d.ts +57 -0
- package/lib/typescript/components/ReorderableList/rowContext.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/types.d.ts +75 -0
- package/lib/typescript/components/ReorderableList/types.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/useReorder.d.ts +31 -0
- package/lib/typescript/components/ReorderableList/useReorder.d.ts.map +1 -0
- package/lib/typescript/components/ReorderableList/webDnd.d.ts +27 -0
- package/lib/typescript/components/ReorderableList/webDnd.d.ts.map +1 -0
- package/lib/typescript/components/ScopedTheme/index.d.ts +6 -1
- package/lib/typescript/components/ScopedTheme/index.d.ts.map +1 -1
- package/lib/typescript/components/Skeleton/index.d.ts +3 -0
- package/lib/typescript/components/Skeleton/index.d.ts.map +1 -1
- package/lib/typescript/components/TablePagination/index.d.ts +54 -0
- package/lib/typescript/components/TablePagination/index.d.ts.map +1 -1
- package/lib/typescript/components/Text/index.d.ts +12 -2
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/Tile/styles.d.ts.map +1 -1
- package/lib/typescript/components/ToggleButton/styles.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/reorderable-list.d.ts +2 -0
- package/lib/typescript/reorderable-list.d.ts.map +1 -0
- package/package.json +34 -7
- package/src/components/Button/styles.ts +7 -1
- package/src/components/Checkbox/index.tsx +22 -0
- package/src/components/Field/index.tsx +1 -1
- package/src/components/Heading/index.tsx +10 -1
- package/src/components/Icon/index.tsx +2 -0
- package/src/components/ListItem/index.tsx +227 -11
- package/src/components/ListItem/styles.ts +40 -0
- package/src/components/Menu/index.tsx +117 -4
- package/src/components/RangeCalendar/index.tsx +2 -0
- package/src/components/ReorderableList/ReorderableListShared.tsx +113 -0
- package/src/components/ReorderableList/index.tsx +162 -0
- package/src/components/ReorderableList/index.web.tsx +254 -0
- package/src/components/ReorderableList/labels.ts +52 -0
- package/src/components/ReorderableList/reorderItems.ts +16 -0
- package/src/components/ReorderableList/rowContext.tsx +72 -0
- package/src/components/ReorderableList/types.ts +80 -0
- package/src/components/ReorderableList/useReorder.ts +159 -0
- package/src/components/ReorderableList/webDnd.ts +60 -0
- package/src/components/ScopedTheme/index.tsx +6 -1
- package/src/components/Skeleton/index.tsx +3 -0
- package/src/components/TablePagination/index.tsx +54 -0
- package/src/components/Text/index.tsx +6 -1
- package/src/components/Tile/styles.ts +4 -1
- package/src/components/index.ts +5 -0
- package/src/reorderable-list.ts +1 -0
- package/src/styles.css +18 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ListItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ListItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAY,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpF,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAW5B,OAAO,EAYL,KAAK,iCAAiC,EACtC,KAAK,oBAAoB,EAC1B,MAAM,UAAU,CAAC;AA+ClB,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,EAAE,oBAAoB;IAC7F;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,GAAG,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oB,EAAE,CAAC;AAC5F,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,+BAA+B,EAC/B,oBAAoB,EACpB,kCAAkC,EAClC,6BAA6B,EAC7B,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,UAAU,CAAC"}
|
|
@@ -4,10 +4,15 @@ export declare const listItemRootVariants: (props?: ({
|
|
|
4
4
|
showSeparator?: boolean | null | undefined;
|
|
5
5
|
crossAlign?: "start" | "center" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const listItemPressableRegionVariants: (props?: ({
|
|
8
|
+
size?: "default" | "compact" | null | undefined;
|
|
9
|
+
handlePosition?: "end" | "start" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
11
|
export declare const listItemLeadingSlotVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
12
|
export declare const listItemTrailingSlotVariants: (props?: ({
|
|
9
13
|
crossAlign?: "start" | "center" | null | undefined;
|
|
10
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
export declare const listItemDragHandleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
11
16
|
export declare const listItemContentVariants: (props?: ({
|
|
12
17
|
crossAlign?: "start" | "center" | null | undefined;
|
|
13
18
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ListItem/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAcvD,eAAO,MAAM,oBAAoB;;;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ListItem/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAcvD,eAAO,MAAM,oBAAoB;;;;8EA+ChC,CAAC;AAUF,eAAO,MAAM,+BAA+B;;;8EAqB3C,CAAC;AAIF,eAAO,MAAM,2BAA2B,oFAEtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;8EAaxC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oFAGrC,CAAC;AAIH,eAAO,MAAM,uBAAuB;;8EAUlC,CAAC;AAIH,eAAO,MAAM,qBAAqB,oFAAkD,CAAC;AAErF,eAAO,MAAM,2BAA2B,oFAAwC,CAAC;AAEjF,eAAO,MAAM,oBAAoB,oFAAuC,CAAC;AAIzE,eAAO,MAAM,6BAA6B;;;8EAsBzC,CAAC;AAEF,8IAA8I;AAC9I,eAAO,MAAM,kCAAkC,oFAE9C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAC7E,MAAM,MAAM,iCAAiC,GAAG,YAAY,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -5,68 +5,145 @@ import { type IconProps } from '../Icon';
|
|
|
5
5
|
import { type IconSlotPosition } from '../../utils/positionToDataIcon';
|
|
6
6
|
import { type MenuItemVariantProps, type MenuRootVariantProps } from './styles';
|
|
7
7
|
export interface MenuProps extends ViewProps, IMenuOverlayRootProps {
|
|
8
|
+
/** Additional Uniwind/Tailwind classes, merged after the root's own styles. */
|
|
8
9
|
className?: string;
|
|
10
|
+
/** The `Menu.Trigger` and `Menu.Popup`. */
|
|
11
|
+
children?: ReactNode;
|
|
9
12
|
}
|
|
10
13
|
declare const MenuOverlayRoot: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<View>>;
|
|
11
14
|
export interface MenuTriggerProps extends IMenuTriggerProps {
|
|
15
|
+
/** Additional Uniwind/Tailwind classes, merged after the trigger's own styles. */
|
|
12
16
|
className?: string;
|
|
17
|
+
/** Trigger content (or the element to render when `asChild` is set). */
|
|
13
18
|
children?: ReactNode;
|
|
14
19
|
}
|
|
15
20
|
declare const MenuTrigger: import("react").ForwardRefExoticComponent<MenuTriggerProps & import("react").RefAttributes<View>>;
|
|
16
21
|
export interface MenuPopupProps extends IMenuPopupProps {
|
|
22
|
+
/** Additional Uniwind/Tailwind classes, merged after the popup's own styles. */
|
|
17
23
|
className?: string;
|
|
24
|
+
/** Popup content, typically a `Menu.Content`. */
|
|
18
25
|
children?: ReactNode;
|
|
19
26
|
}
|
|
20
27
|
declare const MenuPopup: import("react").ForwardRefExoticComponent<MenuPopupProps & import("react").RefAttributes<View>>;
|
|
21
|
-
export interface MenuContentProps extends ViewProps, Omit<IMenuProps, 'scrollable'>, MenuRootVariantProps {
|
|
28
|
+
export interface MenuContentProps extends ViewProps, Omit<IMenuProps, 'scrollable'>, Omit<MenuRootVariantProps, 'scrollable'> {
|
|
29
|
+
/** Additional Uniwind/Tailwind classes, merged after the menu surface's own styles. */
|
|
22
30
|
className?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Caps the surface height and scrolls its items. Content inside a `Menu.Popup` always scrolls.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
scrollable?: MenuRootVariantProps['scrollable'];
|
|
36
|
+
/** The menu's items, groups and separators. */
|
|
37
|
+
children?: ReactNode;
|
|
23
38
|
/** Visual-only surface without menu semantics (e.g. inside Select listbox). */
|
|
24
39
|
asSurface?: boolean;
|
|
25
40
|
}
|
|
26
41
|
declare const MenuContent: import("react").ForwardRefExoticComponent<MenuContentProps & import("react").RefAttributes<View>>;
|
|
27
|
-
export interface MenuItemProps extends Omit<MenuItemVariantProps, 'color'>, IMenuItemProps {
|
|
42
|
+
export interface MenuItemProps extends Omit<MenuItemVariantProps, 'color' | 'inset' | 'layout'>, IMenuItemProps {
|
|
43
|
+
/** Render the consumer's child element in place of the default `Pressable` host. */
|
|
28
44
|
asChild?: boolean;
|
|
29
45
|
/**
|
|
30
46
|
* Color theme applied to the item content and interaction states.
|
|
31
47
|
* @default 'neutral'
|
|
32
48
|
*/
|
|
33
49
|
color?: 'neutral' | 'danger';
|
|
50
|
+
/**
|
|
51
|
+
* Indents the item content so its label lines up with items that have a leading icon.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
inset?: MenuItemVariantProps['inset'];
|
|
55
|
+
/**
|
|
56
|
+
* Set automatically: `filter` when the item contains a `Menu.ItemControl` or `Menu.ItemAction`.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
layout?: MenuItemVariantProps['layout'];
|
|
60
|
+
/** Additional Uniwind/Tailwind classes, merged after the item's own styles. */
|
|
34
61
|
className?: string;
|
|
62
|
+
/** Item content, typically a `Menu.ItemLabel` with optional icon, shortcut and indicator slots. */
|
|
35
63
|
children?: ReactNode;
|
|
36
64
|
}
|
|
37
65
|
declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<View>>;
|
|
38
|
-
export interface MenuCheckboxItemProps extends Omit<MenuItemVariantProps, 'color'>, IMenuCheckboxItemProps {
|
|
66
|
+
export interface MenuCheckboxItemProps extends Omit<MenuItemVariantProps, 'color' | 'inset' | 'layout'>, IMenuCheckboxItemProps {
|
|
67
|
+
/** Render the consumer's child element in place of the default `Pressable` host. */
|
|
39
68
|
asChild?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Color theme applied to the item content and interaction states.
|
|
71
|
+
* @default 'neutral'
|
|
72
|
+
*/
|
|
40
73
|
color?: 'neutral' | 'danger';
|
|
74
|
+
/**
|
|
75
|
+
* Indents the item content so its label lines up with items that have a leading icon.
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
inset?: MenuItemVariantProps['inset'];
|
|
79
|
+
/**
|
|
80
|
+
* Set automatically: `filter` when the item contains a `Menu.ItemControl` or `Menu.ItemAction`.
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
layout?: MenuItemVariantProps['layout'];
|
|
84
|
+
/** Additional Uniwind/Tailwind classes, merged after the item's own styles. */
|
|
41
85
|
className?: string;
|
|
86
|
+
/** Item content, typically a `Menu.ItemLabel` with optional icon, shortcut and indicator slots. */
|
|
42
87
|
children?: ReactNode;
|
|
43
88
|
}
|
|
44
89
|
declare const MenuCheckboxItem: import("react").ForwardRefExoticComponent<MenuCheckboxItemProps & import("react").RefAttributes<View>>;
|
|
45
90
|
export interface MenuRadioGroupProps extends IMenuRadioGroupProps {
|
|
91
|
+
/** Render the consumer's child element in place of the default `View` host. */
|
|
46
92
|
asChild?: boolean;
|
|
93
|
+
/** Additional Uniwind/Tailwind classes, merged after the group's own styles. */
|
|
47
94
|
className?: string;
|
|
95
|
+
/** The `Menu.RadioItem` options in the group. */
|
|
48
96
|
children?: ReactNode;
|
|
49
97
|
}
|
|
50
98
|
declare const MenuRadioGroup: import("react").ForwardRefExoticComponent<MenuRadioGroupProps & import("react").RefAttributes<View>>;
|
|
51
|
-
export interface MenuRadioItemProps extends Omit<MenuItemVariantProps, 'color'>, IMenuRadioItemProps {
|
|
99
|
+
export interface MenuRadioItemProps extends Omit<MenuItemVariantProps, 'color' | 'inset' | 'layout'>, IMenuRadioItemProps {
|
|
100
|
+
/** Render the consumer's child element in place of the default `Pressable` host. */
|
|
52
101
|
asChild?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Color theme applied to the item content and interaction states.
|
|
104
|
+
* @default 'neutral'
|
|
105
|
+
*/
|
|
53
106
|
color?: 'neutral' | 'danger';
|
|
107
|
+
/**
|
|
108
|
+
* Indents the item content so its label lines up with items that have a leading icon.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
inset?: MenuItemVariantProps['inset'];
|
|
112
|
+
/**
|
|
113
|
+
* Set automatically: `filter` when the item contains a `Menu.ItemControl` or `Menu.ItemAction`.
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
layout?: MenuItemVariantProps['layout'];
|
|
117
|
+
/** Additional Uniwind/Tailwind classes, merged after the item's own styles. */
|
|
54
118
|
className?: string;
|
|
119
|
+
/** Item content, typically a `Menu.ItemLabel` with optional icon, shortcut and indicator slots. */
|
|
55
120
|
children?: ReactNode;
|
|
56
121
|
}
|
|
57
122
|
declare const MenuRadioItem: import("react").ForwardRefExoticComponent<MenuRadioItemProps & import("react").RefAttributes<View>>;
|
|
58
123
|
export interface MenuItemLabelProps extends TextProps {
|
|
124
|
+
/** Render the consumer's child element in place of the default `Text` host. */
|
|
59
125
|
asChild?: boolean;
|
|
126
|
+
/** Additional Uniwind/Tailwind classes, merged after the label's own styles. */
|
|
60
127
|
className?: string;
|
|
128
|
+
/** Label text. */
|
|
129
|
+
children?: ReactNode;
|
|
61
130
|
/** Checked state when used outside a selectable Menu item (e.g. `Select.ItemLabel`). */
|
|
62
131
|
isChecked?: boolean;
|
|
63
132
|
}
|
|
64
133
|
declare const MenuItemLabel: import("react").ForwardRefExoticComponent<MenuItemLabelProps & import("react").RefAttributes<Text>>;
|
|
65
134
|
export interface MenuItemIconProps extends Omit<IconProps, 'as' | 'children' | 'color'> {
|
|
135
|
+
/** Render the consumer's child element in place of the icon. */
|
|
66
136
|
asChild?: boolean;
|
|
137
|
+
/** The `@cdx-ui/icons` component to render. */
|
|
67
138
|
as?: IconProps['as'];
|
|
139
|
+
/**
|
|
140
|
+
* Side of the label the icon sits on; sets the spacing between them.
|
|
141
|
+
* @default 'leading'
|
|
142
|
+
*/
|
|
68
143
|
position?: IconSlotPosition;
|
|
144
|
+
/** Additional Uniwind/Tailwind classes, merged after the icon's own styles. */
|
|
69
145
|
className?: string;
|
|
146
|
+
/** The element to render when `asChild` is set. */
|
|
70
147
|
children?: ReactNode;
|
|
71
148
|
}
|
|
72
149
|
declare const MenuItemIcon: {
|
|
@@ -74,16 +151,32 @@ declare const MenuItemIcon: {
|
|
|
74
151
|
displayName: string;
|
|
75
152
|
};
|
|
76
153
|
export interface MenuItemShortcutProps extends TextProps {
|
|
154
|
+
/** Render the consumer's child element in place of the default `Text` host. */
|
|
77
155
|
asChild?: boolean;
|
|
156
|
+
/** Additional Uniwind/Tailwind classes, merged after the shortcut's own styles. */
|
|
78
157
|
className?: string;
|
|
158
|
+
/** Shortcut hint text, such as `⌘C`. */
|
|
159
|
+
children?: ReactNode;
|
|
79
160
|
}
|
|
80
161
|
declare const MenuItemShortcut: import("react").ForwardRefExoticComponent<MenuItemShortcutProps & import("react").RefAttributes<Text>>;
|
|
81
162
|
export interface MenuItemIndicatorProps extends Omit<IconProps, 'as' | 'children' | 'color'> {
|
|
163
|
+
/** Render the consumer's child element in place of the icon. */
|
|
82
164
|
asChild?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* The `@cdx-ui/icons` component to render.
|
|
167
|
+
* @default Check
|
|
168
|
+
*/
|
|
83
169
|
as?: IconProps['as'];
|
|
170
|
+
/** Shows the indicator. Defaults to the checked state of the enclosing item. */
|
|
84
171
|
isChecked?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Side of the label the indicator sits on; sets the spacing between them.
|
|
174
|
+
* @default 'trailing'
|
|
175
|
+
*/
|
|
85
176
|
position?: IconSlotPosition;
|
|
177
|
+
/** Additional Uniwind/Tailwind classes, merged after the indicator's own styles. */
|
|
86
178
|
className?: string;
|
|
179
|
+
/** The element to render when `asChild` is set. */
|
|
87
180
|
children?: ReactNode;
|
|
88
181
|
}
|
|
89
182
|
declare const MenuItemIndicator: {
|
|
@@ -91,35 +184,54 @@ declare const MenuItemIndicator: {
|
|
|
91
184
|
displayName: string;
|
|
92
185
|
};
|
|
93
186
|
export interface MenuSectionLabelProps extends TextProps {
|
|
187
|
+
/** Render the consumer's child element in place of the default `Text` host. */
|
|
94
188
|
asChild?: boolean;
|
|
189
|
+
/** Additional Uniwind/Tailwind classes, merged after the section label's own styles. */
|
|
95
190
|
className?: string;
|
|
191
|
+
/** Section heading text. */
|
|
192
|
+
children?: ReactNode;
|
|
96
193
|
}
|
|
97
194
|
declare const MenuSectionLabel: import("react").ForwardRefExoticComponent<MenuSectionLabelProps & import("react").RefAttributes<Text>>;
|
|
98
195
|
export interface MenuSeparatorProps extends ViewProps {
|
|
196
|
+
/** Additional Uniwind/Tailwind classes, merged after the separator's own styles. */
|
|
99
197
|
className?: string;
|
|
198
|
+
/** Not rendered; the separator draws its own line. */
|
|
199
|
+
children?: ReactNode;
|
|
100
200
|
}
|
|
101
201
|
declare const MenuSeparator: import("react").ForwardRefExoticComponent<MenuSeparatorProps & import("react").RefAttributes<View>>;
|
|
102
202
|
export interface MenuGroupHeaderProps extends ViewProps {
|
|
203
|
+
/** Render the consumer's child element in place of the default `View` host. */
|
|
103
204
|
asChild?: boolean;
|
|
205
|
+
/** Additional Uniwind/Tailwind classes, merged after the group header's own styles. */
|
|
104
206
|
className?: string;
|
|
207
|
+
/** Header content, typically a `Menu.ItemLabel` and an optional `Menu.ItemAction`. */
|
|
105
208
|
children?: ReactNode;
|
|
106
209
|
}
|
|
107
210
|
declare const MenuGroupHeader: import("react").ForwardRefExoticComponent<MenuGroupHeaderProps & import("react").RefAttributes<View>>;
|
|
108
211
|
export interface MenuItemActionProps extends IMenuItemActionProps {
|
|
212
|
+
/** Additional Uniwind/Tailwind classes, merged after the action's own styles. */
|
|
109
213
|
className?: string;
|
|
214
|
+
/** The trailing interactive control, such as a `Button`. */
|
|
110
215
|
children?: ReactNode;
|
|
111
216
|
}
|
|
112
217
|
declare const MenuItemAction: import("react").ForwardRefExoticComponent<MenuItemActionProps & import("react").RefAttributes<View>>;
|
|
113
218
|
export interface MenuItemControlProps extends ViewProps {
|
|
219
|
+
/** Additional Uniwind/Tailwind classes, merged after the control's own styles. */
|
|
114
220
|
className?: string;
|
|
221
|
+
/** Not rendered; the control draws a checkbox or radio that mirrors the enclosing item. */
|
|
222
|
+
children?: ReactNode;
|
|
115
223
|
}
|
|
116
224
|
declare const MenuItemControl: {
|
|
117
225
|
({ className, style, ...props }: MenuItemControlProps): import("react/jsx-runtime").JSX.Element | null;
|
|
118
226
|
displayName: string;
|
|
119
227
|
};
|
|
120
228
|
export interface MenuItemCountProps extends TextProps {
|
|
229
|
+
/** Render the consumer's child element in place of the default `Text` host. */
|
|
121
230
|
asChild?: boolean;
|
|
231
|
+
/** Additional Uniwind/Tailwind classes, merged after the count's own styles. */
|
|
122
232
|
className?: string;
|
|
233
|
+
/** The count to display. */
|
|
234
|
+
children?: ReactNode;
|
|
123
235
|
}
|
|
124
236
|
declare const MenuItemCount: import("react").ForwardRefExoticComponent<MenuItemCountProps & import("react").RefAttributes<Text>>;
|
|
125
237
|
type MenuCompoundComponent = typeof MenuOverlayRoot & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,EAGL,IAAI,EACJ,IAAI,EACJ,KAAK,SAAS,EACd,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAeL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAG/C,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAcL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,UAAU,CAAC;AA0ClB,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,qBAAqB;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Menu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,SAA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AO,WAAW,CAAC;IAC5B,IAAI,EAAE,OAAO,QAAQ,CAAC;IACtB,YAAY,EAAE,OAAO,gBAAgB,CAAC;IACtC,UAAU,EAAE,OAAO,cAAc,CAAC;IAClC,SAAS,EAAE,OAAO,aAAa,CAAC;IAChC,SAAS,EAAE,OAAO,aAAa,CAAC;IAChC,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,YAAY,EAAE,OAAO,gBAAgB,CAAC;IACtC,aAAa,EAAE,OAAO,iBAAiB,CAAC;IACxC,UAAU,EAAE,OAAO,cAAc,CAAC;IAClC,WAAW,EAAE,OAAO,eAAe,CAAC;IACpC,SAAS,EAAE,OAAO,aAAa,CAAC;IAChC,WAAW,EAAE,OAAO,eAAe,CAAC;IACpC,YAAY,EAAE,OAAO,gBAAgB,CAAC;IACtC,SAAS,EAAE,OAAO,aAAa,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,IAAI,EAkBX,qBAAqB,CAAC"}
|
|
@@ -2,7 +2,9 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { type RangeCalendarRootProps } from '@cdx-ui/primitives';
|
|
4
4
|
export interface RangeCalendarProps extends Omit<RangeCalendarRootProps, 'children'>, Omit<ViewProps, 'children'> {
|
|
5
|
+
/** Additional Uniwind/Tailwind classes, merged after the calendar's own styles. */
|
|
5
6
|
className?: string;
|
|
7
|
+
/** Custom calendar body. Omit to render the default header and month grid. */
|
|
6
8
|
children?: ReactNode;
|
|
7
9
|
}
|
|
8
10
|
declare const RangeCalendarRoot: import("react").ForwardRefExoticComponent<RangeCalendarProps & import("react").RefAttributes<View>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/RangeCalendar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,KAAK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,mBAAmB,4FAkBvB,CAAC;AAIH,QAAA,MAAM,uBAAuB,4FAiB5B,CAAC;AAIF,QAAA,MAAM,iBAAiB,4FAkDrB,CAAC;AAIH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,GAAG;IACtD,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,IAAI,EAAE,OAAO,iBAAiB,CAAC;IAC/B,UAAU,EAAE,OAAO,uBAAuB,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,aAAa,EAIpB,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ForwardedRef, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { ScrollView, type ScrollViewProps, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface ReorderableRowInfo<T> {
|
|
4
|
+
item: T;
|
|
5
|
+
/** Consumer key from `keyExtractor`. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Position of `item` in `data`. */
|
|
8
|
+
index: number;
|
|
9
|
+
count: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ReorderableListSharedProps<T> extends Omit<ScrollViewProps, 'children'> {
|
|
12
|
+
data: T[];
|
|
13
|
+
keyExtractor: (item: T, index: number) => string;
|
|
14
|
+
/** Renders each row. Ignored when `children` is set. */
|
|
15
|
+
renderRow?: (info: ReorderableRowInfo<T>) => ReactNode;
|
|
16
|
+
/** Replaces the per-row rendering (native renders the engine's own container here). */
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/** Scroll host. Defaults to `ScrollView`. */
|
|
19
|
+
ScrollComponent?: typeof ScrollView;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Longhands for a consumer `flex`, placed between the `flexGrow: 0` default and the consumer style.
|
|
24
|
+
* Yoga lets a longhand beat the shorthand, so `flex: 1` alone keeps grow 0 with basis 0 and the
|
|
25
|
+
* list collapses to zero height.
|
|
26
|
+
*/
|
|
27
|
+
export declare function flexLonghands(flex: number | undefined): ViewStyle | undefined;
|
|
28
|
+
export declare const ReorderableListShared: <T>(props: ReorderableListSharedProps<T> & {
|
|
29
|
+
ref?: ForwardedRef<ScrollView>;
|
|
30
|
+
}) => ReactElement | null;
|
|
31
|
+
//# sourceMappingURL=ReorderableListShared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReorderableListShared.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/ReorderableListShared.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAc,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI5F,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC;IACtF,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,wDAAwD;IACxD,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IACvD,uFAAuF;IACvF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,OAAO,UAAU,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAK7E;AA2DD,eAAO,MAAM,qBAAqB,EAA6C,CAAC,CAAC,EAC/E,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;CAAE,KACtE,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactElement, type Ref } from 'react';
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
import type { ReorderableListProps } from './types';
|
|
4
|
+
export type { ReorderableListLabels, ReorderableListProps, ReorderableListRenderItemInfo, } from './types';
|
|
5
|
+
export declare const ReorderableList: <T>(props: ReorderableListProps<T> & {
|
|
6
|
+
ref?: Ref<ScrollView>;
|
|
7
|
+
}) => ReactElement | null;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAqB,UAAU,EAAE,MAAM,cAAc,CAAC;AAW7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,SAAS,CAAC;AAiIjB,eAAO,MAAM,eAAe,EAAuC,CAAC,CAAC,EACnE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;CAAE,KACvD,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactElement, type Ref } from 'react';
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
import type { ReorderableListProps } from './types';
|
|
4
|
+
export type { ReorderableListLabels, ReorderableListProps, ReorderableListRenderItemInfo, } from './types';
|
|
5
|
+
export declare const ReorderableList: <T>(props: ReorderableListProps<T> & {
|
|
6
|
+
ref?: Ref<ScrollView>;
|
|
7
|
+
}) => ReactElement | null;
|
|
8
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,YAAY,EACjB,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAA8C,MAAM,cAAc,CAAC;AAsBtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAIpD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,SAAS,CAAC;AA+MjB,eAAO,MAAM,eAAe,EAAuC,CAAC,CAAC,EACnE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;CAAE,KACvD,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReorderableListLabels } from './types';
|
|
2
|
+
export declare const DEFAULT_REORDERABLE_LIST_LABELS: ReorderableListLabels;
|
|
3
|
+
export declare function resolveReorderableListLabels(partial?: Partial<ReorderableListLabels>): ReorderableListLabels;
|
|
4
|
+
export type ReorderMessageKey = 'pickedUp' | 'movedTo' | 'dropped' | 'cancelled';
|
|
5
|
+
export interface ReorderMessageInput<T> {
|
|
6
|
+
labels: ReorderableListLabels;
|
|
7
|
+
getItemLabel?: (item: T, index: number) => string;
|
|
8
|
+
item: T;
|
|
9
|
+
/** Zero-based position of the item before the move — names the item. */
|
|
10
|
+
fromIndex: number;
|
|
11
|
+
/** Zero-based position announced in the message. */
|
|
12
|
+
position: number;
|
|
13
|
+
count: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function formatReorderMessage<T>(key: ReorderMessageKey, { labels, getItemLabel, item, fromIndex, position, count }: ReorderMessageInput<T>): string;
|
|
16
|
+
//# sourceMappingURL=labels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,+BAA+B,EAAE,qBAY7C,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GACvC,qBAAqB,CAEvB;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAEjF,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,IAAI,EAAE,CAAC,CAAC;IACR,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,GAAG,EAAE,iBAAiB,EACtB,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACjF,MAAM,CASR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reorderItems.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/reorderItems.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,EAAE,CAclF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type ReactElement, type RefCallback } from 'react';
|
|
2
|
+
import type { AccessibilityActionEvent, AccessibilityActionInfo, StyleProp, View, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Props that make a host element the row's drag activator.
|
|
5
|
+
*
|
|
6
|
+
* - **Web:** dnd-kit `attributes` (`role`, `tabIndex`, `aria-*`), `listeners` (`onPointerDown`,
|
|
7
|
+
* `onKeyDown`), and `style: { touchAction: 'none' }`. Some keys (`aria-roledescription`,
|
|
8
|
+
* `aria-describedby`) are outside `ViewProps`, hence the index signature.
|
|
9
|
+
* - **Native:** empty — the gesture is attached by `wrap`.
|
|
10
|
+
*/
|
|
11
|
+
export type ReorderableHandleHostProps = ViewProps & Readonly<Record<string, unknown>>;
|
|
12
|
+
/**
|
|
13
|
+
* Binds a handle element to the row's drag gesture without adding a focusable wrapper.
|
|
14
|
+
*
|
|
15
|
+
* Render one host (a `View`, or the consumer child under `asChild` via `Slot`), then:
|
|
16
|
+
* 1. spread `props` onto it before consumer props (handlers compose through `Slot`),
|
|
17
|
+
* 2. compose `ref` with the host's own ref,
|
|
18
|
+
* 3. return `wrap(host)`.
|
|
19
|
+
*
|
|
20
|
+
* Web: `ref` is dnd-kit's `setActivatorNodeRef` and `wrap` returns the host unchanged.
|
|
21
|
+
* Native: `ref` is `undefined` and `wrap` places the host inside `Sortable.Handle`, which must
|
|
22
|
+
* wrap because react-native-sortables only attaches its handle gesture through that component. It
|
|
23
|
+
* renders a non-accessible `View`, so the host stays the single focusable element; pass layout
|
|
24
|
+
* styles that must sit on the outer box (flex, alignSelf, margin) as `wrap`'s second argument.
|
|
25
|
+
*/
|
|
26
|
+
export interface ReorderableRowHandle {
|
|
27
|
+
props: ReorderableHandleHostProps;
|
|
28
|
+
ref: RefCallback<View> | undefined;
|
|
29
|
+
wrap: (host: ReactElement, style?: StyleProp<ViewStyle>) => ReactElement;
|
|
30
|
+
}
|
|
31
|
+
/** Per-row reorder state and actions, provided to every row rendered by `ReorderableList`. */
|
|
32
|
+
export interface ReorderableRowContextValue {
|
|
33
|
+
/** `true` while this row is dragged. */
|
|
34
|
+
isDragging: boolean;
|
|
35
|
+
/** Zero-based position of the row in `data`. */
|
|
36
|
+
index: number;
|
|
37
|
+
/** Number of rows in the list. */
|
|
38
|
+
count: number;
|
|
39
|
+
/**
|
|
40
|
+
* Moves this row to `toIndex` (clamped to the list), calls `onReorder`/`onReorderIndices`, and
|
|
41
|
+
* announces the new position. No-op when the position does not change.
|
|
42
|
+
*/
|
|
43
|
+
move: (toIndex: number) => void;
|
|
44
|
+
/**
|
|
45
|
+
* `Move up` / `Move down` / `Move to top` / `Move to bottom`, omitting those that do not apply at
|
|
46
|
+
* the ends. Spread with `onAccessibilityAction` onto the handle host. Native screen readers
|
|
47
|
+
* expose them as custom actions; react-native-web drops both props, and web keyboard users
|
|
48
|
+
* reorder through dnd-kit's keyboard sensor on the handle instead.
|
|
49
|
+
*/
|
|
50
|
+
accessibilityActions: AccessibilityActionInfo[];
|
|
51
|
+
onAccessibilityAction: (event: AccessibilityActionEvent) => void;
|
|
52
|
+
handle: ReorderableRowHandle;
|
|
53
|
+
}
|
|
54
|
+
export declare const ReorderableRowProvider: import("react").Provider<ReorderableRowContextValue | null>;
|
|
55
|
+
/** Reorder state for the enclosing `ReorderableList` row, or `null` outside a list. */
|
|
56
|
+
export declare function useReorderableRow(): ReorderableRowContextValue | null;
|
|
57
|
+
//# sourceMappingURL=rowContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowContext.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/rowContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,SAAS,EACT,IAAI,EACJ,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB;;;;;;;GAOG;AACH,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,0BAA0B,CAAC;IAClC,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IACnC,IAAI,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,KAAK,YAAY,CAAC;CAC1E;AAED,8FAA8F;AAC9F,MAAM,WAAW,0BAA0B;IACzC,wCAAwC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC;;;;;OAKG;IACH,oBAAoB,EAAE,uBAAuB,EAAE,CAAC;IAChD,qBAAqB,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACjE,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAID,eAAO,MAAM,sBAAsB,6DAAiC,CAAC;AAErE,uFAAuF;AACvF,wBAAgB,iBAAiB,IAAI,0BAA0B,GAAG,IAAI,CAErE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ScrollViewProps } from 'react-native';
|
|
3
|
+
export interface ReorderableListRenderItemInfo<T> {
|
|
4
|
+
/** The item from `data` that this row renders. */
|
|
5
|
+
item: T;
|
|
6
|
+
/** Zero-based position of `item` in `data`. */
|
|
7
|
+
index: number;
|
|
8
|
+
/**
|
|
9
|
+
* `true` while this row is being dragged. Restyle the row with color or opacity only: on iOS,
|
|
10
|
+
* changing `zIndex` on the row (or anything wrapping its handle) mid-drag cancels the drag.
|
|
11
|
+
*/
|
|
12
|
+
isDragging: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Overridable copy for reorder announcements and accessibility actions.
|
|
16
|
+
*
|
|
17
|
+
* Placeholders: `{item}` is the row name (from `getItemLabel`, or the `item` template),
|
|
18
|
+
* `{position}` is a 1-based position, and `{count}` is the number of rows.
|
|
19
|
+
*/
|
|
20
|
+
export interface ReorderableListLabels {
|
|
21
|
+
/**
|
|
22
|
+
* Row name used when `getItemLabel` is not provided. `{position}` is the row's position
|
|
23
|
+
* before the move.
|
|
24
|
+
* @default 'item {position}'
|
|
25
|
+
*/
|
|
26
|
+
item: string;
|
|
27
|
+
/** @default 'Picked up {item}. Position {position} of {count}.' */
|
|
28
|
+
pickedUp: string;
|
|
29
|
+
/** @default 'Moved {item} to position {position} of {count}.' */
|
|
30
|
+
movedTo: string;
|
|
31
|
+
/** @default 'Dropped {item} at position {position} of {count}.' */
|
|
32
|
+
dropped: string;
|
|
33
|
+
/** @default 'Reorder cancelled. {item} returned to position {position} of {count}.' */
|
|
34
|
+
cancelled: string;
|
|
35
|
+
/**
|
|
36
|
+
* Read by screen readers when a drag handle receives focus on web.
|
|
37
|
+
* @default 'To pick up an item, press Space or Enter. Use the arrow keys to move it, then press Space or Enter to drop it, or Escape to cancel.'
|
|
38
|
+
*/
|
|
39
|
+
screenReaderInstructions: string;
|
|
40
|
+
/** @default 'Move up' */
|
|
41
|
+
moveUp: string;
|
|
42
|
+
/** @default 'Move down' */
|
|
43
|
+
moveDown: string;
|
|
44
|
+
/** @default 'Move to top' */
|
|
45
|
+
moveToTop: string;
|
|
46
|
+
/** @default 'Move to bottom' */
|
|
47
|
+
moveToBottom: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ReorderableListProps<T> extends Omit<ScrollViewProps, 'children' | 'horizontal' | 'role'> {
|
|
50
|
+
/** Items in their current order. The parent owns this array and updates it from `onReorder`. */
|
|
51
|
+
data: T[];
|
|
52
|
+
/**
|
|
53
|
+
* Returns a stable, unique key for an item. Keys identify rows while they move, so they must
|
|
54
|
+
* not be derived from `index`. Duplicate keys log a warning in development.
|
|
55
|
+
*/
|
|
56
|
+
keyExtractor: (item: T, index: number) => string;
|
|
57
|
+
/** Renders one row. Compose with `ListItem` and `ListItem.DragHandle`. */
|
|
58
|
+
renderItem: (info: ReorderableListRenderItemInfo<T>) => ReactNode;
|
|
59
|
+
/** Called with the reordered array after a drop or an accessibility move. */
|
|
60
|
+
onReorder: (data: T[]) => void;
|
|
61
|
+
/** Called after `onReorder` with the moved row's previous and new zero-based positions. */
|
|
62
|
+
onReorderIndices?: (from: number, to: number) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the name screen readers use for a row in reorder announcements. Without it,
|
|
65
|
+
* announcements use the `item` label (`item 2`). Keys are never announced.
|
|
66
|
+
*/
|
|
67
|
+
getItemLabel?: (item: T, index: number) => string;
|
|
68
|
+
/**
|
|
69
|
+
* Overrides for announcement and accessibility-action copy. Unset keys keep their defaults.
|
|
70
|
+
* @default {}
|
|
71
|
+
*/
|
|
72
|
+
labels?: Partial<ReorderableListLabels>;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,kDAAkD;IAClD,IAAI,EAAE,CAAC,CA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CAAC;IAClD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AccessibilityActionInfo } from 'react-native';
|
|
2
|
+
import type { ReorderableRowContextValue, ReorderableRowHandle } from './rowContext';
|
|
3
|
+
import type { ReorderableListLabels, ReorderableListProps } from './types';
|
|
4
|
+
export declare function buildReorderAccessibilityActions(index: number, count: number, labels: ReorderableListLabels): AccessibilityActionInfo[];
|
|
5
|
+
/** Target index for a reorder accessibility action, or `undefined` for other actions. */
|
|
6
|
+
export declare function getReorderActionTarget(actionName: string, index: number, count: number): number | undefined;
|
|
7
|
+
/** Duplicate keys in `data`, for the development warning. */
|
|
8
|
+
export declare function findDuplicateKeys<T>(data: readonly T[], keyExtractor: (item: T, index: number) => string): string[];
|
|
9
|
+
type ReorderControllerOptions<T> = Pick<ReorderableListProps<T>, 'data' | 'onReorder' | 'onReorderIndices' | 'getItemLabel' | 'labels'> & {
|
|
10
|
+
announce: (message: string) => void;
|
|
11
|
+
};
|
|
12
|
+
export interface ReorderController<T> {
|
|
13
|
+
labels: ReorderableListLabels;
|
|
14
|
+
/** Commits a move from one position to another and announces it. */
|
|
15
|
+
moveItem: (fromIndex: number, toIndex: number) => void;
|
|
16
|
+
/** Formats an announcement for the item currently at `fromIndex`. */
|
|
17
|
+
describe: (key: 'pickedUp' | 'movedTo' | 'dropped' | 'cancelled', fromIndex: number, position: number) => string | undefined;
|
|
18
|
+
data: T[];
|
|
19
|
+
}
|
|
20
|
+
export declare function useReorderController<T>({ data, onReorder, onReorderIndices, getItemLabel, labels: labelsProp, announce, }: ReorderControllerOptions<T>): ReorderController<T>;
|
|
21
|
+
interface RowValueOptions {
|
|
22
|
+
index: number;
|
|
23
|
+
count: number;
|
|
24
|
+
isDragging: boolean;
|
|
25
|
+
handle: ReorderableRowHandle;
|
|
26
|
+
labels: ReorderableListLabels;
|
|
27
|
+
moveItem: (fromIndex: number, toIndex: number) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function useReorderableRowValue({ index, count, isDragging, handle, labels, moveItem, }: RowValueOptions): ReorderableRowContextValue;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=useReorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReorder.d.ts","sourceRoot":"","sources":["../../../../src/components/ReorderableList/useReorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA4B,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGtF,OAAO,KAAK,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI3E,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,qBAAqB,GAC5B,uBAAuB,EAAE,CAW3B;AAED,yFAAyF;AACzF,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAapB;AAED,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,IAAI,EAAE,SAAS,CAAC,EAAE,EAClB,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAC/C,MAAM,EAAE,CASV;AAED,KAAK,wBAAwB,CAAC,CAAC,IAAI,IAAI,CACrC,oBAAoB,CAAC,CAAC,CAAC,EACvB,MAAM,GAAG,WAAW,GAAG,kBAAkB,GAAG,cAAc,GAAG,QAAQ,CACtE,GAAG;IACF,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,MAAM,WAAW,iBAAiB,CAA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