@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.
Files changed (196) hide show
  1. package/README.md +4 -3
  2. package/dist/autocomplete/index.js +15 -1
  3. package/dist/autocomplete/index.js.map +1 -1
  4. package/dist/button/group.d.ts +5 -0
  5. package/dist/button/group.js +115 -0
  6. package/dist/button/group.js.map +1 -0
  7. package/dist/button/index.d.ts +4 -1
  8. package/dist/button/index.js +44 -22
  9. package/dist/button/index.js.map +1 -1
  10. package/dist/button/slots.js +2 -1
  11. package/dist/button/slots.js.map +1 -1
  12. package/dist/calendar/index.js +351 -182
  13. package/dist/calendar/index.js.map +1 -1
  14. package/dist/calendar/styles.js +33 -2
  15. package/dist/calendar/styles.js.map +1 -1
  16. package/dist/carousel/arrangement.d.ts +5 -0
  17. package/dist/carousel/arrangement.js +123 -0
  18. package/dist/carousel/arrangement.js.map +1 -0
  19. package/dist/chequer/index.js +95 -0
  20. package/dist/chequer/index.js.map +1 -0
  21. package/dist/collection/index.d.ts +157 -0
  22. package/dist/collection/index.js +1331 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/color-thumb/index.js +56 -0
  25. package/dist/color-thumb/index.js.map +1 -0
  26. package/dist/components/button/index.d.ts +4 -2
  27. package/dist/components/button/index.js +227 -188
  28. package/dist/components/button/index.js.map +1 -1
  29. package/dist/components/button-group/index.d.ts +87 -0
  30. package/dist/components/button-group/index.js +275 -0
  31. package/dist/components/button-group/index.js.map +1 -0
  32. package/dist/components/calendar/index.d.ts +11 -3
  33. package/dist/components/calendar/index.js +60 -45
  34. package/dist/components/calendar/index.js.map +1 -1
  35. package/dist/components/carousel/index.d.ts +72 -0
  36. package/dist/components/carousel/index.js +496 -0
  37. package/dist/components/carousel/index.js.map +1 -0
  38. package/dist/components/checkbox-group/index.d.ts +3 -4
  39. package/dist/components/checkbox-group/index.js +1 -1
  40. package/dist/components/checkbox-group/index.js.map +1 -1
  41. package/dist/components/color-area/index.d.ts +85 -0
  42. package/dist/components/color-area/index.js +630 -0
  43. package/dist/components/color-area/index.js.map +1 -0
  44. package/dist/components/color-field/index.d.ts +144 -0
  45. package/dist/components/color-field/index.js +516 -0
  46. package/dist/components/color-field/index.js.map +1 -0
  47. package/dist/components/color-picker/index.d.ts +74 -0
  48. package/dist/components/color-picker/index.js +317 -0
  49. package/dist/components/color-picker/index.js.map +1 -0
  50. package/dist/components/color-slider/index.d.ts +82 -0
  51. package/dist/components/color-slider/index.js +456 -0
  52. package/dist/components/color-slider/index.js.map +1 -0
  53. package/dist/components/color-swatch/index.d.ts +46 -0
  54. package/dist/components/color-swatch/index.js +127 -0
  55. package/dist/components/color-swatch/index.js.map +1 -0
  56. package/dist/components/color-swatch-picker/index.d.ts +81 -0
  57. package/dist/components/color-swatch-picker/index.js +287 -0
  58. package/dist/components/color-swatch-picker/index.js.map +1 -0
  59. package/dist/components/color-wheel/index.d.ts +71 -0
  60. package/dist/components/color-wheel/index.js +407 -0
  61. package/dist/components/color-wheel/index.js.map +1 -0
  62. package/dist/components/combo-box/index.d.ts +193 -0
  63. package/dist/components/combo-box/index.js +616 -0
  64. package/dist/components/combo-box/index.js.map +1 -0
  65. package/dist/components/date-field/index.d.ts +120 -0
  66. package/dist/components/date-field/index.js +111 -0
  67. package/dist/components/date-field/index.js.map +1 -0
  68. package/dist/components/date-picker/index.d.ts +130 -0
  69. package/dist/components/date-picker/index.js +310 -0
  70. package/dist/components/date-picker/index.js.map +1 -0
  71. package/dist/components/date-range-picker/index.d.ts +139 -0
  72. package/dist/components/date-range-picker/index.js +421 -0
  73. package/dist/components/date-range-picker/index.js.map +1 -0
  74. package/dist/components/disclosure/index.d.ts +94 -0
  75. package/dist/components/disclosure/index.js +365 -0
  76. package/dist/components/disclosure/index.js.map +1 -0
  77. package/dist/components/disclosure-group/index.d.ts +61 -0
  78. package/dist/components/disclosure-group/index.js +100 -0
  79. package/dist/components/disclosure-group/index.js.map +1 -0
  80. package/dist/components/drop-zone/index.d.ts +113 -0
  81. package/dist/components/drop-zone/index.js +304 -0
  82. package/dist/components/drop-zone/index.js.map +1 -0
  83. package/dist/components/fab/index.d.ts +1 -1
  84. package/dist/components/fab/index.js +91 -76
  85. package/dist/components/fab/index.js.map +1 -1
  86. package/dist/components/form/index.d.ts +3 -2
  87. package/dist/components/form/index.js.map +1 -1
  88. package/dist/components/icon-button/index.d.ts +4 -2
  89. package/dist/components/icon-button/index.js +204 -171
  90. package/dist/components/icon-button/index.js.map +1 -1
  91. package/dist/components/list/index.d.ts +15 -158
  92. package/dist/components/list/index.js +21 -1047
  93. package/dist/components/list/index.js.map +1 -1
  94. package/dist/components/list-box/index.d.ts +73 -0
  95. package/dist/components/list-box/index.js +82 -0
  96. package/dist/components/list-box/index.js.map +1 -0
  97. package/dist/components/loading-indicator/index.d.ts +32 -0
  98. package/dist/components/loading-indicator/index.js +174 -0
  99. package/dist/components/loading-indicator/index.js.map +1 -0
  100. package/dist/components/navigation-tree/index.d.ts +117 -0
  101. package/dist/components/navigation-tree/index.js +135 -0
  102. package/dist/components/navigation-tree/index.js.map +1 -0
  103. package/dist/components/number-field/index.js +132 -143
  104. package/dist/components/number-field/index.js.map +1 -1
  105. package/dist/components/range-calendar/index.d.ts +69 -0
  106. package/dist/components/range-calendar/index.js +144 -0
  107. package/dist/components/range-calendar/index.js.map +1 -0
  108. package/dist/components/search-view/index.d.ts +78 -0
  109. package/dist/components/search-view/index.js +570 -0
  110. package/dist/components/search-view/index.js.map +1 -0
  111. package/dist/components/select/index.d.ts +152 -0
  112. package/dist/components/select/index.js +419 -0
  113. package/dist/components/select/index.js.map +1 -0
  114. package/dist/components/slider/index.d.ts +111 -0
  115. package/dist/components/slider/index.js +673 -0
  116. package/dist/components/slider/index.js.map +1 -0
  117. package/dist/components/split-button/index.d.ts +77 -0
  118. package/dist/components/split-button/index.js +354 -0
  119. package/dist/components/split-button/index.js.map +1 -0
  120. package/dist/components/tabs/index.d.ts +196 -0
  121. package/dist/components/tabs/index.js +1137 -0
  122. package/dist/components/tabs/index.js.map +1 -0
  123. package/dist/components/time-field/index.d.ts +43 -0
  124. package/dist/components/time-field/index.js +107 -0
  125. package/dist/components/time-field/index.js.map +1 -0
  126. package/dist/components/time-picker/index.d.ts +65 -0
  127. package/dist/components/time-picker/index.js +1168 -0
  128. package/dist/components/time-picker/index.js.map +1 -0
  129. package/dist/components/tooltip/index.d.ts +101 -0
  130. package/dist/components/tooltip/index.js +223 -0
  131. package/dist/components/tooltip/index.js.map +1 -0
  132. package/dist/components/tree/index.d.ts +112 -0
  133. package/dist/components/tree/index.js +157 -0
  134. package/dist/components/tree/index.js.map +1 -0
  135. package/dist/disclosure/chevron.js +75 -0
  136. package/dist/disclosure/chevron.js.map +1 -0
  137. package/dist/disclosure/index.js +7 -0
  138. package/dist/disclosure/index.js.map +1 -0
  139. package/dist/drop/index.d.ts +54 -0
  140. package/dist/drop/index.js +161 -0
  141. package/dist/drop/index.js.map +1 -0
  142. package/dist/field/chevron.js +74 -0
  143. package/dist/field/chevron.js.map +1 -0
  144. package/dist/field/index.d.ts +2 -1
  145. package/dist/field/index.js +310 -154
  146. package/dist/field/index.js.map +1 -1
  147. package/dist/field/styles.js +9 -0
  148. package/dist/field/styles.js.map +1 -1
  149. package/dist/files/index.d.ts +18 -0
  150. package/dist/files/index.js +107 -0
  151. package/dist/files/index.js.map +1 -0
  152. package/dist/form/index.d.ts +5 -2
  153. package/dist/form/index.js +64 -85
  154. package/dist/form/index.js.map +1 -1
  155. package/dist/glyphs/index.js +92 -1
  156. package/dist/glyphs/index.js.map +1 -1
  157. package/dist/i18n/index.js +20 -1
  158. package/dist/i18n/index.js.map +1 -1
  159. package/dist/i18n/messages.js +1394 -34
  160. package/dist/i18n/messages.js.map +1 -1
  161. package/dist/index.d.ts +35 -3
  162. package/dist/index.js +34 -3
  163. package/dist/indicator/paths.js +23 -1
  164. package/dist/indicator/paths.js.map +1 -1
  165. package/dist/modal/index.js +92 -77
  166. package/dist/modal/index.js.map +1 -1
  167. package/dist/number/keyboard.js +16 -0
  168. package/dist/number/keyboard.js.map +1 -0
  169. package/dist/overlay/anchored.js +68 -38
  170. package/dist/overlay/anchored.js.map +1 -1
  171. package/dist/overlay/keyboard.js +57 -0
  172. package/dist/overlay/keyboard.js.map +1 -0
  173. package/dist/overlay/panel.js +173 -19
  174. package/dist/overlay/panel.js.map +1 -1
  175. package/dist/overlay/placement.js +13 -1
  176. package/dist/overlay/placement.js.map +1 -1
  177. package/dist/picker/index.js +322 -0
  178. package/dist/picker/index.js.map +1 -0
  179. package/dist/press/index.d.ts +2 -0
  180. package/dist/press/index.js +102 -100
  181. package/dist/press/index.js.map +1 -1
  182. package/dist/row/index.js +77 -69
  183. package/dist/row/index.js.map +1 -1
  184. package/dist/row/styles.js +13 -2
  185. package/dist/row/styles.js.map +1 -1
  186. package/dist/segments/field.js +277 -0
  187. package/dist/segments/field.js.map +1 -0
  188. package/dist/segments/index.js +574 -0
  189. package/dist/segments/index.js.map +1 -0
  190. package/dist/segments/styles.js +24 -0
  191. package/dist/segments/styles.js.map +1 -0
  192. package/dist/slider/index.js +145 -0
  193. package/dist/slider/index.js.map +1 -0
  194. package/dist/swatch/index.js +56 -0
  195. package/dist/swatch/index.js.map +1 -0
  196. 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