@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
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { PressableProps, StyleProp, View, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactElement, ReactNode, Ref } from "react";
|
|
3
|
+
import { Key, Orientation } from "react-stately";
|
|
4
|
+
//#region src/components/tabs/index.d.ts
|
|
5
|
+
/** How the bar shares its room among the tabs. */
|
|
6
|
+
type TabsLayout = 'fixed' | 'scrollable';
|
|
7
|
+
type TabsListProps<T extends object = object> = {
|
|
8
|
+
/** Names the bar, for a screen reader. */
|
|
9
|
+
readonly 'aria-label'?: string;
|
|
10
|
+
/** Names the bar after the element with this id. */
|
|
11
|
+
readonly 'aria-labelledby'?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The tabs, as `Tabs.Tab` elements each given an `id`, or with `items` a
|
|
14
|
+
* function from an item to its tab.
|
|
15
|
+
*/
|
|
16
|
+
readonly children?: ((item: T) => ReactElement) | ReactNode;
|
|
17
|
+
/** The items to draw a tab for, through the function `children` is. */
|
|
18
|
+
readonly items?: Iterable<T>;
|
|
19
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
20
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
21
|
+
readonly testID?: string;
|
|
22
|
+
};
|
|
23
|
+
type TabsPanelProps = {
|
|
24
|
+
readonly children?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* The key of the tab the panel belongs to, which is drawn while that tab
|
|
27
|
+
* is selected. A panel given none is drawn under whichever tab is.
|
|
28
|
+
*/
|
|
29
|
+
readonly id?: Key;
|
|
30
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
31
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
32
|
+
readonly testID?: string;
|
|
33
|
+
};
|
|
34
|
+
type TabsPanelsProps = {
|
|
35
|
+
/** The `Tabs.Panel` elements, whose box moves between their heights. */
|
|
36
|
+
readonly children?: ReactNode;
|
|
37
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
38
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
39
|
+
readonly testID?: string;
|
|
40
|
+
};
|
|
41
|
+
type TabsProps = {
|
|
42
|
+
/** The bar, as a `Tabs.List`, and the `Tabs.Panel` elements it switches. */
|
|
43
|
+
readonly children?: ReactNode;
|
|
44
|
+
/** The tab selected at first, when the bar keeps its own selection. */
|
|
45
|
+
readonly defaultSelectedKey?: Key;
|
|
46
|
+
/** The keys of the tabs that take no press, and draw disabled. */
|
|
47
|
+
readonly disabledKeys?: Iterable<Key>;
|
|
48
|
+
/**
|
|
49
|
+
* Disables every tab.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
readonly isDisabled?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* How the bar shares its room: `fixed` divides it into equal sections, and
|
|
55
|
+
* `scrollable` gives each tab its label's width in a bar that scrolls,
|
|
56
|
+
* which is the page's choice for more tabs than the room has sections for.
|
|
57
|
+
* @default 'fixed'
|
|
58
|
+
*/
|
|
59
|
+
readonly layout?: TabsLayout;
|
|
60
|
+
/** Called with the key of the tab that has just been selected. */
|
|
61
|
+
readonly onSelectionChange?: (key: Key) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Whether the bar runs across, above its panels, or down, beside them.
|
|
64
|
+
* @default 'horizontal'
|
|
65
|
+
*/
|
|
66
|
+
readonly orientation?: Orientation;
|
|
67
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
68
|
+
/** The key of the selected tab, when the call site holds it. */
|
|
69
|
+
readonly selectedKey?: Key | null;
|
|
70
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
71
|
+
readonly testID?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Which of the page's two tab bars this is: `primary` for the main one,
|
|
74
|
+
* `secondary` for a strip under a primary one.
|
|
75
|
+
* @default 'primary'
|
|
76
|
+
*/
|
|
77
|
+
readonly variant?: TabsVariant;
|
|
78
|
+
};
|
|
79
|
+
type TabsTabProps = Omit<PressableProps, 'children' | 'disabled' | 'id' | 'role' | 'style'> & {
|
|
80
|
+
/**
|
|
81
|
+
* A badge on the tab: `true` for the badges page's small dot, a number for
|
|
82
|
+
* the large badge holding it. It sits on a primary tab's icon, and after
|
|
83
|
+
* the label anywhere else. The badge is hidden from a screen reader, so say
|
|
84
|
+
* what it says in the tab's `aria-label` too: "Second item, 3 new".
|
|
85
|
+
*/
|
|
86
|
+
readonly badge?: boolean | number;
|
|
87
|
+
/** The tab's label. */
|
|
88
|
+
readonly children?: ReactNode;
|
|
89
|
+
/** Where the tab goes when pressed, through the app's router. */
|
|
90
|
+
readonly href?: string;
|
|
91
|
+
/**
|
|
92
|
+
* An icon with the label, at the page's 24dp: over it on a primary tab,
|
|
93
|
+
* whose bar grows to 64dp, and before it on a secondary one. The slot hands
|
|
94
|
+
* it its colour and size through `useIconStyle()`.
|
|
95
|
+
*/
|
|
96
|
+
readonly icon?: ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* The tab's key, which selection reports and its `Tabs.Panel` shares.
|
|
99
|
+
* Without one, a tab drawn from `items` takes its item's `id` or `key`.
|
|
100
|
+
*/
|
|
101
|
+
readonly id?: Key;
|
|
102
|
+
/**
|
|
103
|
+
* Draws the tab disabled, and it takes no press, as a key in the bar's
|
|
104
|
+
* `disabledKeys` does.
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
readonly isDisabled?: boolean;
|
|
108
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
109
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
110
|
+
/**
|
|
111
|
+
* The tab's text, for a label that is not a plain string. Read off
|
|
112
|
+
* `children` when it is one.
|
|
113
|
+
*/
|
|
114
|
+
readonly textValue?: string;
|
|
115
|
+
};
|
|
116
|
+
/** The tabs page's two styles of tab bar. */
|
|
117
|
+
type TabsVariant = 'primary' | 'secondary';
|
|
118
|
+
/**
|
|
119
|
+
* A tab bar and the panels it switches between. Pass `selectedKey` with
|
|
120
|
+
* `onSelectionChange` to hold the selection, or `defaultSelectedKey` to let
|
|
121
|
+
* the bar keep its own. Each `Tabs.Tab` names the `Tabs.Panel` it shows
|
|
122
|
+
* through a shared `id`, and a bar may stand alone without panels.
|
|
123
|
+
*
|
|
124
|
+
* ```tsx
|
|
125
|
+
* <Tabs defaultSelectedKey="first">
|
|
126
|
+
* <Tabs.List aria-label="Sections">
|
|
127
|
+
* <Tabs.Tab id="first">First item</Tabs.Tab>
|
|
128
|
+
* <Tabs.Tab id="second">Second item</Tabs.Tab>
|
|
129
|
+
* </Tabs.List>
|
|
130
|
+
* <Tabs.Panel id="first">
|
|
131
|
+
* <Text>Supporting line</Text>
|
|
132
|
+
* </Tabs.Panel>
|
|
133
|
+
* <Tabs.Panel id="second">
|
|
134
|
+
* <Text>Supporting line</Text>
|
|
135
|
+
* </Tabs.Panel>
|
|
136
|
+
* </Tabs>
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* Write the `Tabs.List` among the children of `Tabs`, inside any view or
|
|
140
|
+
* fragment, rather than in a component of the call site's own: the bar is
|
|
141
|
+
* found there, and its tabs are what the selection is built from.
|
|
142
|
+
*
|
|
143
|
+
* `style`, `ref` and `testID` land on the root view, the one a layout
|
|
144
|
+
* positions.
|
|
145
|
+
*/
|
|
146
|
+
declare function Tabs({ children, defaultSelectedKey, disabledKeys, isDisabled, layout, onSelectionChange, orientation, ref, selectedKey, style, testID, variant }: TabsProps): import("react").JSX.Element;
|
|
147
|
+
declare namespace Tabs {
|
|
148
|
+
var List: typeof TabsList;
|
|
149
|
+
var Panel: typeof TabsPanel;
|
|
150
|
+
var Panels: typeof TabsPanels;
|
|
151
|
+
var Tab: typeof TabsTab;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The bar: every tab, drawn from the entries its `Tabs.Tab` children gave
|
|
155
|
+
* the root, with the divider and the indicator. Name it with `aria-label` or
|
|
156
|
+
* `aria-labelledby`.
|
|
157
|
+
*
|
|
158
|
+
* `style`, `ref` and `testID` land on the bar's own view.
|
|
159
|
+
*/
|
|
160
|
+
declare function TabsList<T extends object = object>({ 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, ref, style, testID }: TabsListProps<T>): import("react").JSX.Element;
|
|
161
|
+
/**
|
|
162
|
+
* One tab of a `Tabs.List`, which draws it: the root builds its selection
|
|
163
|
+
* from these, so one renders nothing on its own. Give every tab an `id`,
|
|
164
|
+
* which is the key selection reports and its `Tabs.Panel` shares.
|
|
165
|
+
*/
|
|
166
|
+
declare function TabsTab(_props: TabsTabProps): null;
|
|
167
|
+
declare namespace TabsTab {
|
|
168
|
+
var getCollectionNode: (props: TabsTabProps) => Generator<{
|
|
169
|
+
'aria-label': string | undefined;
|
|
170
|
+
hasChildNodes: boolean;
|
|
171
|
+
key: Key | undefined;
|
|
172
|
+
props: TabsTabProps;
|
|
173
|
+
rendered: ReactNode;
|
|
174
|
+
textValue: string;
|
|
175
|
+
type: string;
|
|
176
|
+
}, void, unknown>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The content of one tab, drawn while its tab is selected. Its `id` is the
|
|
180
|
+
* tab's.
|
|
181
|
+
*
|
|
182
|
+
* `style`, `ref` and `testID` land on the panel's own view.
|
|
183
|
+
*/
|
|
184
|
+
declare function TabsPanel({ children, id, ref, style, testID }: TabsPanelProps): import("react").JSX.Element | null;
|
|
185
|
+
/**
|
|
186
|
+
* An optional box around the panels, which moves its height as one panel
|
|
187
|
+
* gives way to the next, over medium1 on the emphasized curve and at once
|
|
188
|
+
* under reduced motion. Without it the panels still work; the box around
|
|
189
|
+
* them simply jumps from one height to the other.
|
|
190
|
+
*
|
|
191
|
+
* `style`, `ref` and `testID` land on the box.
|
|
192
|
+
*/
|
|
193
|
+
declare function TabsPanels({ children, ref, style, testID }: TabsPanelsProps): import("react").JSX.Element;
|
|
194
|
+
//#endregion
|
|
195
|
+
export { Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant };
|
|
196
|
+
//# sourceMappingURL=index.d.ts.map
|