@kanso-labs/react-native-kanso-ui 0.9.0 → 0.10.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/README.md +4 -3
- package/dist/autocomplete/index.js +15 -1
- package/dist/autocomplete/index.js.map +1 -1
- package/dist/button/group.d.ts +5 -0
- package/dist/button/group.js +115 -0
- package/dist/button/group.js.map +1 -0
- package/dist/button/index.d.ts +4 -1
- package/dist/button/index.js +44 -22
- package/dist/button/index.js.map +1 -1
- package/dist/button/slots.js +2 -1
- package/dist/button/slots.js.map +1 -1
- package/dist/calendar/index.js +351 -182
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +33 -2
- package/dist/calendar/styles.js.map +1 -1
- package/dist/carousel/arrangement.d.ts +5 -0
- package/dist/carousel/arrangement.js +123 -0
- package/dist/carousel/arrangement.js.map +1 -0
- package/dist/chequer/index.js +95 -0
- package/dist/chequer/index.js.map +1 -0
- package/dist/collection/index.d.ts +157 -0
- package/dist/collection/index.js +1331 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/color-thumb/index.js +56 -0
- package/dist/color-thumb/index.js.map +1 -0
- package/dist/components/button/index.d.ts +4 -2
- package/dist/components/button/index.js +227 -188
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +87 -0
- package/dist/components/button-group/index.js +275 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +11 -3
- package/dist/components/calendar/index.js +60 -45
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/carousel/index.d.ts +72 -0
- package/dist/components/carousel/index.js +496 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/checkbox-group/index.d.ts +3 -4
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/color-area/index.d.ts +85 -0
- package/dist/components/color-area/index.js +630 -0
- package/dist/components/color-area/index.js.map +1 -0
- package/dist/components/color-field/index.d.ts +144 -0
- package/dist/components/color-field/index.js +516 -0
- package/dist/components/color-field/index.js.map +1 -0
- package/dist/components/color-picker/index.d.ts +74 -0
- package/dist/components/color-picker/index.js +317 -0
- package/dist/components/color-picker/index.js.map +1 -0
- package/dist/components/color-slider/index.d.ts +82 -0
- package/dist/components/color-slider/index.js +456 -0
- package/dist/components/color-slider/index.js.map +1 -0
- package/dist/components/color-swatch/index.d.ts +46 -0
- package/dist/components/color-swatch/index.js +127 -0
- package/dist/components/color-swatch/index.js.map +1 -0
- package/dist/components/color-swatch-picker/index.d.ts +81 -0
- package/dist/components/color-swatch-picker/index.js +287 -0
- package/dist/components/color-swatch-picker/index.js.map +1 -0
- package/dist/components/color-wheel/index.d.ts +71 -0
- package/dist/components/color-wheel/index.js +407 -0
- package/dist/components/color-wheel/index.js.map +1 -0
- package/dist/components/combo-box/index.d.ts +193 -0
- package/dist/components/combo-box/index.js +616 -0
- package/dist/components/combo-box/index.js.map +1 -0
- package/dist/components/date-field/index.d.ts +120 -0
- package/dist/components/date-field/index.js +111 -0
- package/dist/components/date-field/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +130 -0
- package/dist/components/date-picker/index.js +310 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/date-range-picker/index.d.ts +139 -0
- package/dist/components/date-range-picker/index.js +421 -0
- package/dist/components/date-range-picker/index.js.map +1 -0
- package/dist/components/disclosure/index.d.ts +94 -0
- package/dist/components/disclosure/index.js +365 -0
- package/dist/components/disclosure/index.js.map +1 -0
- package/dist/components/disclosure-group/index.d.ts +61 -0
- package/dist/components/disclosure-group/index.js +100 -0
- package/dist/components/disclosure-group/index.js.map +1 -0
- package/dist/components/drop-zone/index.d.ts +113 -0
- package/dist/components/drop-zone/index.js +304 -0
- package/dist/components/drop-zone/index.js.map +1 -0
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js +91 -76
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/form/index.d.ts +3 -2
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +4 -2
- package/dist/components/icon-button/index.js +204 -171
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/list/index.d.ts +15 -158
- package/dist/components/list/index.js +21 -1047
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +73 -0
- package/dist/components/list-box/index.js +82 -0
- package/dist/components/list-box/index.js.map +1 -0
- package/dist/components/loading-indicator/index.d.ts +32 -0
- package/dist/components/loading-indicator/index.js +174 -0
- package/dist/components/loading-indicator/index.js.map +1 -0
- package/dist/components/navigation-tree/index.d.ts +117 -0
- package/dist/components/navigation-tree/index.js +135 -0
- package/dist/components/navigation-tree/index.js.map +1 -0
- package/dist/components/number-field/index.js +132 -143
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +69 -0
- package/dist/components/range-calendar/index.js +144 -0
- package/dist/components/range-calendar/index.js.map +1 -0
- package/dist/components/search-view/index.d.ts +78 -0
- package/dist/components/search-view/index.js +570 -0
- package/dist/components/search-view/index.js.map +1 -0
- package/dist/components/select/index.d.ts +152 -0
- package/dist/components/select/index.js +419 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/slider/index.d.ts +111 -0
- package/dist/components/slider/index.js +673 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/split-button/index.d.ts +77 -0
- package/dist/components/split-button/index.js +354 -0
- package/dist/components/split-button/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +196 -0
- package/dist/components/tabs/index.js +1137 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/time-field/index.d.ts +43 -0
- package/dist/components/time-field/index.js +107 -0
- package/dist/components/time-field/index.js.map +1 -0
- package/dist/components/time-picker/index.d.ts +65 -0
- package/dist/components/time-picker/index.js +1168 -0
- package/dist/components/time-picker/index.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +101 -0
- package/dist/components/tooltip/index.js +223 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tree/index.d.ts +112 -0
- package/dist/components/tree/index.js +157 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/disclosure/chevron.js +75 -0
- package/dist/disclosure/chevron.js.map +1 -0
- package/dist/disclosure/index.js +7 -0
- package/dist/disclosure/index.js.map +1 -0
- package/dist/drop/index.d.ts +54 -0
- package/dist/drop/index.js +161 -0
- package/dist/drop/index.js.map +1 -0
- package/dist/field/chevron.js +74 -0
- package/dist/field/chevron.js.map +1 -0
- package/dist/field/index.d.ts +2 -1
- package/dist/field/index.js +310 -154
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +9 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/files/index.d.ts +18 -0
- package/dist/files/index.js +107 -0
- package/dist/files/index.js.map +1 -0
- package/dist/form/index.d.ts +5 -2
- package/dist/form/index.js +64 -85
- package/dist/form/index.js.map +1 -1
- package/dist/glyphs/index.js +92 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +20 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +1394 -34
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +35 -3
- package/dist/index.js +34 -3
- package/dist/indicator/paths.js +23 -1
- package/dist/indicator/paths.js.map +1 -1
- package/dist/modal/index.js +92 -77
- package/dist/modal/index.js.map +1 -1
- package/dist/number/keyboard.js +16 -0
- package/dist/number/keyboard.js.map +1 -0
- package/dist/overlay/anchored.js +68 -38
- package/dist/overlay/anchored.js.map +1 -1
- package/dist/overlay/keyboard.js +57 -0
- package/dist/overlay/keyboard.js.map +1 -0
- package/dist/overlay/panel.js +173 -19
- package/dist/overlay/panel.js.map +1 -1
- package/dist/overlay/placement.js +13 -1
- package/dist/overlay/placement.js.map +1 -1
- package/dist/picker/index.js +322 -0
- package/dist/picker/index.js.map +1 -0
- package/dist/press/index.d.ts +2 -0
- package/dist/press/index.js +102 -100
- package/dist/press/index.js.map +1 -1
- package/dist/row/index.js +77 -69
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +13 -2
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/field.js +277 -0
- package/dist/segments/field.js.map +1 -0
- package/dist/segments/index.js +574 -0
- package/dist/segments/index.js.map +1 -0
- package/dist/segments/styles.js +24 -0
- package/dist/segments/styles.js.map +1 -0
- package/dist/slider/index.js +145 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/swatch/index.js +56 -0
- package/dist/swatch/index.js.map +1 -0
- package/package.json +11 -2
|
@@ -1,138 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReactElement, ReactNode, Ref } from "react";
|
|
3
|
-
import { Key, Selection, SelectionMode } from "react-stately";
|
|
1
|
+
import { CollectionLoadMoreProps, CollectionProps, CollectionRowProps, CollectionSectionProps, loaderNode, rowNode, sectionNode } from "../../collection/index.js";
|
|
4
2
|
//#region src/components/list/index.d.ts
|
|
5
|
-
type ListLoadMoreProps =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
readonly isLoading?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* What a screen reader calls the ring, and hears as it appears. Left out,
|
|
13
|
-
* it is the word for it in the `I18nProvider`'s language, or the device's
|
|
14
|
-
* outside one, "Loading more" in English.
|
|
15
|
-
*/
|
|
16
|
-
readonly label?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Called when the end of the list comes within `scrollOffset` of its
|
|
19
|
-
* visible end, while nothing is loading. Called once for each length the
|
|
20
|
-
* list reaches, so a load that adds nothing does not start another.
|
|
21
|
-
*/
|
|
22
|
-
readonly onLoadMore?: () => void;
|
|
23
|
-
/**
|
|
24
|
-
* How far past the visible end of the list the next items are asked for,
|
|
25
|
-
* as a share of the list's visible height.
|
|
26
|
-
* @default 1
|
|
27
|
-
*/
|
|
28
|
-
readonly scrollOffset?: number;
|
|
29
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
30
|
-
readonly testID?: string;
|
|
31
|
-
};
|
|
32
|
-
type ListProps<T extends object = object> = Omit<ScrollViewProps, 'children' | 'role' | 'stickyHeaderIndices' | 'style'> & {
|
|
33
|
-
/**
|
|
34
|
-
* The rows, each a `List.Item`, `List.Section` or `List.LoadMore`. With
|
|
35
|
-
* `items`, a function from an item to its part, called for each item in
|
|
36
|
-
* turn.
|
|
37
|
-
*/
|
|
38
|
-
readonly children?: ((item: T) => ReactElement) | ReactNode;
|
|
39
|
-
/** The keys selected at first, when the list keeps its own selection. */
|
|
40
|
-
readonly defaultSelectedKeys?: 'all' | Iterable<Key>;
|
|
41
|
-
/** The keys of the rows drawn disabled, which take no presses. */
|
|
42
|
-
readonly disabledKeys?: Iterable<Key>;
|
|
43
|
-
/**
|
|
44
|
-
* Keeps the last selected row selected, so a press on it changes nothing.
|
|
45
|
-
* @default false
|
|
46
|
-
*/
|
|
47
|
-
readonly disallowEmptySelection?: boolean;
|
|
48
|
-
/** The entries `children` draws a part for, when it is a function. */
|
|
49
|
-
readonly items?: Iterable<T>;
|
|
50
|
-
/**
|
|
51
|
-
* Called with a row's key when a press runs its action. A row's own
|
|
52
|
-
* `onAction` takes its place for that row.
|
|
53
|
-
*/
|
|
54
|
-
readonly onAction?: (key: Key) => void;
|
|
55
|
-
/** Called with the selected keys whenever a press changes them. */
|
|
56
|
-
readonly onSelectionChange?: (keys: Selection) => void;
|
|
57
|
-
readonly ref?: Ref<FlatList>;
|
|
58
|
-
/**
|
|
59
|
-
* What the list shows when it has no rows and nothing is loading. Left
|
|
60
|
-
* out, it is a muted row saying "No results" in the `I18nProvider`'s
|
|
61
|
-
* language, or the device's outside one, so the list keeps a row's height.
|
|
62
|
-
*/
|
|
63
|
-
readonly renderEmptyState?: () => ReactNode;
|
|
64
|
-
/**
|
|
65
|
-
* The selected keys, for a call site holding the selection itself with
|
|
66
|
-
* `onSelectionChange`.
|
|
67
|
-
*/
|
|
68
|
-
readonly selectedKeys?: 'all' | Iterable<Key>;
|
|
69
|
-
/**
|
|
70
|
-
* Whether rows can be selected: one at a time, several, or none. A list
|
|
71
|
-
* that selects draws a checkbox on every row.
|
|
72
|
-
* @default 'none'
|
|
73
|
-
*/
|
|
74
|
-
readonly selectionMode?: SelectionMode;
|
|
75
|
-
/**
|
|
76
|
-
* What selecting a row is called, for a screen reader: the accessibility
|
|
77
|
-
* action each selectable row offers, which is what its checkbox does. The
|
|
78
|
-
* row's own text is what names the row. Left out, it is the word for it in
|
|
79
|
-
* the `I18nProvider`'s language, or the device's outside one, "Select" in
|
|
80
|
-
* English.
|
|
81
|
-
*/
|
|
82
|
-
readonly selectLabel?: string;
|
|
83
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
84
|
-
};
|
|
85
|
-
type ListRowProps = Omit<PressableProps, 'children' | 'disabled' | 'id' | 'role' | 'style'> & {
|
|
86
|
-
/** The row's headline, the one thing it is mostly about. */
|
|
87
|
-
readonly children?: ReactNode;
|
|
88
|
-
/** The key the row is selected and reported by. Give one to every row. */
|
|
89
|
-
readonly id?: Key;
|
|
90
|
-
/**
|
|
91
|
-
* Draws the row disabled, and takes no presses on it, as a key in the
|
|
92
|
-
* list's `disabledKeys` does.
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
readonly isDisabled?: boolean;
|
|
96
|
-
/** Content before the headline: an avatar, an icon. */
|
|
97
|
-
readonly leading?: ReactNode;
|
|
98
|
-
/**
|
|
99
|
-
* Called when a press runs the row's action, in place of the list's
|
|
100
|
-
* `onAction` for this row.
|
|
101
|
-
*/
|
|
102
|
-
readonly onAction?: () => void;
|
|
103
|
-
/**
|
|
104
|
-
* A line above the headline, in label small and the muted role. Given
|
|
105
|
-
* beside `supporting`, it makes the row the three-line item.
|
|
106
|
-
*/
|
|
107
|
-
readonly overline?: ReactNode;
|
|
108
|
-
readonly ref?: Ref<HostInstance>;
|
|
109
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
110
|
-
/** A second line under the headline, in body medium and the muted role. */
|
|
111
|
-
readonly supporting?: ReactNode;
|
|
112
|
-
/**
|
|
113
|
-
* The row's text, read off `children` when they are a plain string, so a
|
|
114
|
-
* row whose headline is an element passes it.
|
|
115
|
-
*/
|
|
116
|
-
readonly textValue?: string;
|
|
117
|
-
/** Content after the headline, such as an amount or a control. */
|
|
118
|
-
readonly trailing?: ReactNode;
|
|
119
|
-
};
|
|
120
|
-
type ListSectionProps = {
|
|
121
|
-
/** The rows in the section. */
|
|
122
|
-
readonly children?: ReactNode;
|
|
123
|
-
/**
|
|
124
|
-
* The section's heading, which stays at the top of the list while the
|
|
125
|
-
* section's rows scroll under it. A section without one is its rows alone.
|
|
126
|
-
*/
|
|
127
|
-
readonly header?: ReactNode;
|
|
128
|
-
readonly id?: Key;
|
|
129
|
-
};
|
|
3
|
+
type ListLoadMoreProps = CollectionLoadMoreProps;
|
|
4
|
+
type ListProps<T extends object = object> = CollectionProps<T>;
|
|
5
|
+
type ListRowProps = CollectionRowProps;
|
|
6
|
+
type ListSectionProps = CollectionSectionProps;
|
|
130
7
|
/**
|
|
131
8
|
* A list of rows, one or more of which can be selected. Selection is React
|
|
132
9
|
* Stately's, as web's is React Aria's: set `selectionMode` to `single` or
|
|
133
10
|
* `multiple`, and pass `selectedKeys` with `onSelectionChange` to control
|
|
134
|
-
* it or `defaultSelectedKeys` to let it keep its own. A list
|
|
135
|
-
*
|
|
11
|
+
* it or `defaultSelectedKeys` to let it keep its own. A list that selects
|
|
12
|
+
* draws a checkbox on every row. A list whose rows do something takes
|
|
13
|
+
* `onAction`, or an `onAction` on each row.
|
|
136
14
|
*
|
|
137
15
|
* ```tsx
|
|
138
16
|
* <List aria-label="Label" selectionMode="multiple">
|
|
@@ -146,14 +24,15 @@ type ListSectionProps = {
|
|
|
146
24
|
* list draws from their props, so none of them renders anything on its
|
|
147
25
|
* own. Name the list with `aria-label`. It scrolls by itself, so it wants a
|
|
148
26
|
* height to fill: a short list on a page that scrolls takes
|
|
149
|
-
* `scrollEnabled={false}` and is laid out at its full length.
|
|
150
|
-
*
|
|
27
|
+
* `scrollEnabled={false}` and is laid out at its full length. It is drawn
|
|
28
|
+
* on surface, and a section's header stays at the top while its rows scroll
|
|
29
|
+
* under it. `style` and `ref` land on the `FlatList`.
|
|
151
30
|
*
|
|
152
31
|
* Inside an `Autocomplete`, the list shows the rows the search keeps and
|
|
153
32
|
* says how many there are to a screen reader, and a tap on a row reaches it
|
|
154
33
|
* while the keyboard is up.
|
|
155
34
|
*/
|
|
156
|
-
declare function List<T extends object = object>(
|
|
35
|
+
declare function List<T extends object = object>(props: ListProps<T>): import("react").JSX.Element;
|
|
157
36
|
declare namespace List {
|
|
158
37
|
var Item: typeof ListRow;
|
|
159
38
|
var LoadMore: typeof ListLoadMore;
|
|
@@ -167,12 +46,7 @@ declare namespace List {
|
|
|
167
46
|
*/
|
|
168
47
|
declare function ListLoadMore(_props: ListLoadMoreProps): null;
|
|
169
48
|
declare namespace ListLoadMore {
|
|
170
|
-
var getCollectionNode:
|
|
171
|
-
hasChildNodes: boolean;
|
|
172
|
-
props: ListLoadMoreProps;
|
|
173
|
-
rendered: null;
|
|
174
|
-
type: string;
|
|
175
|
-
}, void, unknown>;
|
|
49
|
+
var getCollectionNode: typeof loaderNode;
|
|
176
50
|
}
|
|
177
51
|
/**
|
|
178
52
|
* One row. Its slots are ListItem's: `leading`, the headline as children,
|
|
@@ -185,15 +59,7 @@ declare namespace ListLoadMore {
|
|
|
185
59
|
*/
|
|
186
60
|
declare function ListRow(_props: ListRowProps): null;
|
|
187
61
|
declare namespace ListRow {
|
|
188
|
-
var getCollectionNode:
|
|
189
|
-
'aria-label': string | undefined;
|
|
190
|
-
hasChildNodes: boolean;
|
|
191
|
-
key: Key | undefined;
|
|
192
|
-
props: ListRowProps;
|
|
193
|
-
rendered: ReactNode;
|
|
194
|
-
textValue: string;
|
|
195
|
-
type: string;
|
|
196
|
-
}, void, unknown>;
|
|
62
|
+
var getCollectionNode: typeof rowNode;
|
|
197
63
|
}
|
|
198
64
|
/**
|
|
199
65
|
* A group of rows under a heading, which stays at the top of the list while
|
|
@@ -201,16 +67,7 @@ declare namespace ListRow {
|
|
|
201
67
|
*/
|
|
202
68
|
declare function ListSection(_props: ListSectionProps): null;
|
|
203
69
|
declare namespace ListSection {
|
|
204
|
-
var getCollectionNode:
|
|
205
|
-
childNodes(): Generator<{
|
|
206
|
-
element: ReactNode;
|
|
207
|
-
}, void, unknown>;
|
|
208
|
-
hasChildNodes: boolean;
|
|
209
|
-
key: Key | undefined;
|
|
210
|
-
props: ListSectionProps;
|
|
211
|
-
rendered: ReactNode;
|
|
212
|
-
type: string;
|
|
213
|
-
}, void, unknown>;
|
|
70
|
+
var getCollectionNode: typeof sectionNode;
|
|
214
71
|
}
|
|
215
72
|
//#endregion
|
|
216
73
|
export { List, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps };
|