@kanso-labs/react-native-kanso-ui 0.8.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/badge/index.js +9 -70
- package/dist/badge/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 +45 -23
- package/dist/button/index.js.map +1 -1
- package/dist/button/palettes.d.ts +2 -0
- 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/badge/index.d.ts +48 -0
- package/dist/components/badge/index.js +122 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/{badge → components/badge}/styles.js +10 -6
- package/dist/components/badge/styles.js.map +1 -0
- package/dist/components/breadcrumbs/index.d.ts +66 -0
- package/dist/components/breadcrumbs/index.js +285 -0
- package/dist/components/breadcrumbs/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/index.d.ts +7 -1
- package/dist/components/checkbox/index.js +183 -138
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +92 -0
- package/dist/components/checkbox-group/index.js +306 -0
- package/dist/components/checkbox-group/index.js.map +1 -0
- package/dist/components/code/index.d.ts +25 -0
- package/dist/components/code/index.js +87 -0
- package/dist/components/code/index.js.map +1 -0
- 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/container/index.d.ts +47 -0
- package/dist/components/container/index.js +85 -0
- package/dist/components/container/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 +80 -0
- package/dist/components/fab/index.js +246 -0
- package/dist/components/fab/index.js.map +1 -0
- package/dist/components/fab-menu/index.d.ts +120 -0
- package/dist/components/fab-menu/index.js +640 -0
- package/dist/components/fab-menu/index.js.map +1 -0
- package/dist/components/feed/index.d.ts +57 -0
- package/dist/components/feed/index.js +167 -0
- package/dist/components/feed/index.js.map +1 -0
- 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/keycap/index.d.ts +27 -0
- package/dist/components/keycap/index.js +136 -0
- package/dist/components/keycap/index.js.map +1 -0
- 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/menu/index.js +1 -1
- 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/separator/index.d.ts +3 -2
- package/dist/components/separator/index.js +29 -26
- package/dist/components/separator/index.js.map +1 -1
- 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/supporting-pane/index.d.ts +44 -0
- package/dist/components/supporting-pane/index.js +109 -0
- package/dist/components/supporting-pane/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/text/index.d.ts +1 -1
- package/dist/components/text/index.js +49 -21
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +145 -0
- package/dist/components/text-area/index.js +231 -0
- package/dist/components/text-area/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/toolbar/index.d.ts +53 -0
- package/dist/components/toolbar/index.js +185 -0
- package/dist/components/toolbar/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/control/group.js +23 -0
- package/dist/control/group.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/fab/index.d.ts +19 -0
- package/dist/fab/index.js +147 -0
- package/dist/fab/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 +350 -153
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +27 -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 +6 -4
- 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 +51 -6
- package/dist/index.js +47 -4
- package/dist/indicator/paths.js +23 -1
- package/dist/indicator/paths.js.map +1 -1
- package/dist/modal/index.js +96 -68
- package/dist/modal/index.js.map +1 -1
- package/dist/navigation/index.js +8 -5
- package/dist/navigation/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 +16 -2
- 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/separator/index.js +7 -0
- package/dist/separator/index.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/dist/typography/size.js +14 -0
- package/dist/typography/size.js.map +1 -0
- package/package.json +11 -2
- package/dist/badge/styles.js.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { CollectionProps, CollectionRowProps, CollectionSectionProps, sectionNode } from "../../collection/index.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { Key } from "react-stately";
|
|
4
|
+
//#region src/components/navigation-tree/index.d.ts
|
|
5
|
+
type NavigationTreeItemProps = NavigationTreeItemText & Omit<CollectionRowProps, 'children' | 'onAction' | 'overline' | 'textValue'> & {
|
|
6
|
+
/**
|
|
7
|
+
* The rows nested under this one, as further `NavigationTree.Item`
|
|
8
|
+
* parts.
|
|
9
|
+
*/
|
|
10
|
+
readonly children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Where the row leads, which a press opens and `selectedRoute` is matched
|
|
13
|
+
* against.
|
|
14
|
+
*/
|
|
15
|
+
readonly href?: string;
|
|
16
|
+
};
|
|
17
|
+
type NavigationTreeItemText = {
|
|
18
|
+
/** The row's label, as something other than a plain string. */
|
|
19
|
+
readonly label?: ReactNode;
|
|
20
|
+
/** The row's text, which a label that is not a string cannot give. */
|
|
21
|
+
readonly textValue: string;
|
|
22
|
+
} | {
|
|
23
|
+
/** The row's label: where it goes. */
|
|
24
|
+
readonly label: string;
|
|
25
|
+
/** The row's text. Defaults to the label. */
|
|
26
|
+
readonly textValue?: string;
|
|
27
|
+
};
|
|
28
|
+
type NavigationTreeProps<T extends object = object> = Omit<CollectionProps<T>, 'defaultSelectedKeys' | 'disallowEmptySelection' | 'onAction' | 'onSelectionChange' | 'renderEmptyState' | 'selectedKeys' | 'selectionMode' | 'selectLabel'> & {
|
|
29
|
+
/** The keys of the rows open at first, when the tree keeps its own. */
|
|
30
|
+
readonly defaultExpandedKeys?: Iterable<Key>;
|
|
31
|
+
/**
|
|
32
|
+
* The keys of the open rows, for a call site holding them itself with
|
|
33
|
+
* `onExpandedChange`.
|
|
34
|
+
*/
|
|
35
|
+
readonly expandedKeys?: Iterable<Key>;
|
|
36
|
+
/** Called with the keys of the open rows whenever a row opens or closes. */
|
|
37
|
+
readonly onExpandedChange?: (keys: Set<Key>) => void;
|
|
38
|
+
/**
|
|
39
|
+
* The route the app is on, matched against each row's `href`: the row it
|
|
40
|
+
* matches is the current one, and the rows above it are its trail.
|
|
41
|
+
*/
|
|
42
|
+
readonly selectedRoute?: null | string;
|
|
43
|
+
};
|
|
44
|
+
type NavigationTreeSectionProps = CollectionSectionProps;
|
|
45
|
+
/**
|
|
46
|
+
* A nested set of links, with the current one marked. Give the tree a
|
|
47
|
+
* `selectedRoute` and each row an `href`, and the row whose `href` matches is
|
|
48
|
+
* the current one, drawn on the drawer's pill, while each row it sits under
|
|
49
|
+
* is drawn with a bold label, so a closed trail still shows where you are.
|
|
50
|
+
* Which rows are open is React Stately's, as web's is React Aria's: pass
|
|
51
|
+
* `expandedKeys` with `onExpandedChange` to control it, or
|
|
52
|
+
* `defaultExpandedKeys` to let it keep its own.
|
|
53
|
+
*
|
|
54
|
+
* ```tsx
|
|
55
|
+
* <NavigationTree aria-label="Label" selectedRoute="/second">
|
|
56
|
+
* <NavigationTree.Item href="/first" id="first" label="First item">
|
|
57
|
+
* <NavigationTree.Item href="/second" id="second" label="Second item" />
|
|
58
|
+
* </NavigationTree.Item>
|
|
59
|
+
* </NavigationTree>
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* There is no selection here, as there is none in React Aria's: what is
|
|
63
|
+
* current comes from the route rather than from anything the reader picked,
|
|
64
|
+
* and `Tree` is the one that selects. A press opens a row's `href` through
|
|
65
|
+
* the `RouterProvider` around it. Composed from parts, `NavigationTree.Item`
|
|
66
|
+
* and `NavigationTree.Section`, which the tree draws from their props, so
|
|
67
|
+
* neither renders anything on its own. Name the tree with `aria-label`. It
|
|
68
|
+
* scrolls by itself, so it wants a height to fill: a short tree on a page
|
|
69
|
+
* that scrolls takes `scrollEnabled={false}` and is laid out at its full
|
|
70
|
+
* length. It has no ground of its own, so it takes the drawer's, and `style`
|
|
71
|
+
* and `ref` land on the `FlatList`.
|
|
72
|
+
*/
|
|
73
|
+
declare function NavigationTree<T extends object = object>({ children, defaultExpandedKeys, disabledKeys, expandedKeys, items, onExpandedChange, selectedRoute, ...props }: NavigationTreeProps<T>): import("react").JSX.Element;
|
|
74
|
+
declare namespace NavigationTree {
|
|
75
|
+
var Item: typeof NavigationTreeItem;
|
|
76
|
+
var Section: typeof NavigationTreeSection;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* One row, and the rows under it. Its slots are ListItem's, with a `label`
|
|
80
|
+
* where ListItem has a headline and no overline, since the drawer page gives
|
|
81
|
+
* one line of label: `leading`, the `label`, `supporting` under it, and
|
|
82
|
+
* `trailing`, such as a count. Give it an `href`, which is what a press
|
|
83
|
+
* opens and what `selectedRoute` is matched against, and an `id`, which is
|
|
84
|
+
* the key opening is reported by.
|
|
85
|
+
*
|
|
86
|
+
* Rows nested as `children` are what make it open: a row with none draws no
|
|
87
|
+
* chevron. The tree draws it from its entry in the collection, so it renders
|
|
88
|
+
* nothing on its own. `style`, `ref` and `testID` land on the row.
|
|
89
|
+
*/
|
|
90
|
+
declare function NavigationTreeItem(_props: NavigationTreeItemProps): null;
|
|
91
|
+
declare namespace NavigationTreeItem {
|
|
92
|
+
var getCollectionNode: typeof navigationItemNode;
|
|
93
|
+
}
|
|
94
|
+
/** A named group of rows, with its heading above them. */
|
|
95
|
+
declare function NavigationTreeSection(_props: NavigationTreeSectionProps): null;
|
|
96
|
+
declare namespace NavigationTreeSection {
|
|
97
|
+
var getCollectionNode: typeof sectionNode;
|
|
98
|
+
}
|
|
99
|
+
declare function navigationItemNode(props: NavigationTreeItemProps): Generator<{
|
|
100
|
+
'aria-label': string | undefined;
|
|
101
|
+
childNodes(): Generator<{
|
|
102
|
+
element: ReactNode;
|
|
103
|
+
}, void, unknown>;
|
|
104
|
+
hasChildNodes: boolean;
|
|
105
|
+
key: Key | undefined;
|
|
106
|
+
props: {
|
|
107
|
+
readonly 'aria-label'?: string;
|
|
108
|
+
readonly children?: ReactNode;
|
|
109
|
+
readonly id?: Key;
|
|
110
|
+
};
|
|
111
|
+
rendered: ReactNode;
|
|
112
|
+
textValue: string;
|
|
113
|
+
type: string;
|
|
114
|
+
}, void, unknown>;
|
|
115
|
+
//#endregion
|
|
116
|
+
export { NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps };
|
|
117
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { CollectionView, nestedRowNode, sectionNode } from "../../collection/index.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useTreeState } from "react-stately/useTreeState";
|
|
5
|
+
//#region src/components/navigation-tree/index.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A nested set of links, with the current one marked. Give the tree a
|
|
8
|
+
* `selectedRoute` and each row an `href`, and the row whose `href` matches is
|
|
9
|
+
* the current one, drawn on the drawer's pill, while each row it sits under
|
|
10
|
+
* is drawn with a bold label, so a closed trail still shows where you are.
|
|
11
|
+
* Which rows are open is React Stately's, as web's is React Aria's: pass
|
|
12
|
+
* `expandedKeys` with `onExpandedChange` to control it, or
|
|
13
|
+
* `defaultExpandedKeys` to let it keep its own.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <NavigationTree aria-label="Label" selectedRoute="/second">
|
|
17
|
+
* <NavigationTree.Item href="/first" id="first" label="First item">
|
|
18
|
+
* <NavigationTree.Item href="/second" id="second" label="Second item" />
|
|
19
|
+
* </NavigationTree.Item>
|
|
20
|
+
* </NavigationTree>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* There is no selection here, as there is none in React Aria's: what is
|
|
24
|
+
* current comes from the route rather than from anything the reader picked,
|
|
25
|
+
* and `Tree` is the one that selects. A press opens a row's `href` through
|
|
26
|
+
* the `RouterProvider` around it. Composed from parts, `NavigationTree.Item`
|
|
27
|
+
* and `NavigationTree.Section`, which the tree draws from their props, so
|
|
28
|
+
* neither renders anything on its own. Name the tree with `aria-label`. It
|
|
29
|
+
* scrolls by itself, so it wants a height to fill: a short tree on a page
|
|
30
|
+
* that scrolls takes `scrollEnabled={false}` and is laid out at its full
|
|
31
|
+
* length. It has no ground of its own, so it takes the drawer's, and `style`
|
|
32
|
+
* and `ref` land on the `FlatList`.
|
|
33
|
+
*/
|
|
34
|
+
function NavigationTree(t0) {
|
|
35
|
+
const $ = c(20);
|
|
36
|
+
let children;
|
|
37
|
+
let defaultExpandedKeys;
|
|
38
|
+
let disabledKeys;
|
|
39
|
+
let expandedKeys;
|
|
40
|
+
let items;
|
|
41
|
+
let onExpandedChange;
|
|
42
|
+
let props;
|
|
43
|
+
let selectedRoute;
|
|
44
|
+
if ($[0] !== t0) {
|
|
45
|
+
({children, defaultExpandedKeys, disabledKeys, expandedKeys, items, onExpandedChange, selectedRoute, ...props} = t0);
|
|
46
|
+
$[0] = t0;
|
|
47
|
+
$[1] = children;
|
|
48
|
+
$[2] = defaultExpandedKeys;
|
|
49
|
+
$[3] = disabledKeys;
|
|
50
|
+
$[4] = expandedKeys;
|
|
51
|
+
$[5] = items;
|
|
52
|
+
$[6] = onExpandedChange;
|
|
53
|
+
$[7] = props;
|
|
54
|
+
$[8] = selectedRoute;
|
|
55
|
+
} else {
|
|
56
|
+
children = $[1];
|
|
57
|
+
defaultExpandedKeys = $[2];
|
|
58
|
+
disabledKeys = $[3];
|
|
59
|
+
expandedKeys = $[4];
|
|
60
|
+
items = $[5];
|
|
61
|
+
onExpandedChange = $[6];
|
|
62
|
+
props = $[7];
|
|
63
|
+
selectedRoute = $[8];
|
|
64
|
+
}
|
|
65
|
+
const t1 = children;
|
|
66
|
+
let t2;
|
|
67
|
+
if ($[9] !== defaultExpandedKeys || $[10] !== disabledKeys || $[11] !== expandedKeys || $[12] !== items || $[13] !== onExpandedChange || $[14] !== t1) {
|
|
68
|
+
t2 = {
|
|
69
|
+
children: t1,
|
|
70
|
+
defaultExpandedKeys,
|
|
71
|
+
disabledKeys,
|
|
72
|
+
expandedKeys,
|
|
73
|
+
items,
|
|
74
|
+
onExpandedChange,
|
|
75
|
+
selectionMode: "none"
|
|
76
|
+
};
|
|
77
|
+
$[9] = defaultExpandedKeys;
|
|
78
|
+
$[10] = disabledKeys;
|
|
79
|
+
$[11] = expandedKeys;
|
|
80
|
+
$[12] = items;
|
|
81
|
+
$[13] = onExpandedChange;
|
|
82
|
+
$[14] = t1;
|
|
83
|
+
$[15] = t2;
|
|
84
|
+
} else t2 = $[15];
|
|
85
|
+
const state = useTreeState(t2);
|
|
86
|
+
const t3 = selectedRoute ?? void 0;
|
|
87
|
+
let t4;
|
|
88
|
+
if ($[16] !== props || $[17] !== state || $[18] !== t3) {
|
|
89
|
+
t4 = /* @__PURE__ */ jsx(CollectionView, {
|
|
90
|
+
...props,
|
|
91
|
+
kind: "drawer",
|
|
92
|
+
renderEmptyState: nothing,
|
|
93
|
+
selectedRoute: t3,
|
|
94
|
+
state
|
|
95
|
+
});
|
|
96
|
+
$[16] = props;
|
|
97
|
+
$[17] = state;
|
|
98
|
+
$[18] = t3;
|
|
99
|
+
$[19] = t4;
|
|
100
|
+
} else t4 = $[19];
|
|
101
|
+
return t4;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* One row, and the rows under it. Its slots are ListItem's, with a `label`
|
|
105
|
+
* where ListItem has a headline and no overline, since the drawer page gives
|
|
106
|
+
* one line of label: `leading`, the `label`, `supporting` under it, and
|
|
107
|
+
* `trailing`, such as a count. Give it an `href`, which is what a press
|
|
108
|
+
* opens and what `selectedRoute` is matched against, and an `id`, which is
|
|
109
|
+
* the key opening is reported by.
|
|
110
|
+
*
|
|
111
|
+
* Rows nested as `children` are what make it open: a row with none draws no
|
|
112
|
+
* chevron. The tree draws it from its entry in the collection, so it renders
|
|
113
|
+
* nothing on its own. `style`, `ref` and `testID` land on the row.
|
|
114
|
+
*/
|
|
115
|
+
function NavigationTreeItem(_props) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
NavigationTreeItem.getCollectionNode = navigationItemNode;
|
|
119
|
+
/** A named group of rows, with its heading above them. */
|
|
120
|
+
function NavigationTreeSection(_props) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
NavigationTreeSection.getCollectionNode = sectionNode;
|
|
124
|
+
function navigationItemNode(props) {
|
|
125
|
+
return nestedRowNode(props, props.label, props.textValue ?? (typeof props.label === "string" ? props.label : ""));
|
|
126
|
+
}
|
|
127
|
+
function nothing() {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
NavigationTree.Item = NavigationTreeItem;
|
|
131
|
+
NavigationTree.Section = NavigationTreeSection;
|
|
132
|
+
//#endregion
|
|
133
|
+
export { NavigationTree, NavigationTreeItem, NavigationTreeSection };
|
|
134
|
+
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","Key","TreeProps","StatelyTreeProps","useTreeState","CollectionProps","CollectionRowProps","CollectionSectionProps","CollectionView","nestedRowNode","sectionNode","NavigationTreeItemProps","NavigationTreeItemText","Omit","children","href","label","textValue","NavigationTreeProps","T","defaultExpandedKeys","Iterable","expandedKeys","onExpandedChange","keys","Set","selectedRoute","NavigationTreeSectionProps","NavigationTree","t0","$","_c","disabledKeys","items","props","t1","t2","selectionMode","state","t3","undefined","t4","nothing","NavigationTreeItem","_props","getCollectionNode","navigationItemNode","NavigationTreeSection","Item","Section","_c"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Key } from 'react-stately'\nimport type { TreeProps as StatelyTreeProps } from 'react-stately/useTreeState'\n\nimport { useTreeState } from 'react-stately/useTreeState'\n\nimport type {\n CollectionProps,\n CollectionRowProps,\n CollectionSectionProps,\n} from '../../collection'\n\nimport { CollectionView, nestedRowNode, sectionNode } from '../../collection'\n\n// kanso-ui's NavigationTree: the navigation drawer page's contents, a nested\n// set of links with the current one marked. It is Tree's shape, drawn by\n// src/collection as a Tree is, so its chevron, its 24dp a level and its\n// opening and closing are Tree's, and the row is src/row's under that\n// module's `drawer` variant: the drawer page's 56dp row with a label-large\n// label, held 12dp off each edge, on a secondary-container pill while it is\n// the current one.\n//\n// A tree selects, and a navigation tree navigates, so this takes\n// `selectedRoute` where Tree takes `selectedKeys`, and has no selection at\n// all, as React Aria's has none. The row whose `href` is the route is the\n// current one, and each row it sits under is drawn with a bold label, found\n// through every row, open or not, so a current row closed out of sight\n// still shows where it is.\n//\n// Three things differ from web's, each because a screen reader or a touch on\n// a phone works differently from a keyboard in a browser.\n//\n// **A row is one element to a screen reader**, a link, as Tree's row is one\n// element. It reports whether it is open, and opening and closing it are\n// accessibility actions, named from src/i18n as Tree's are. The current row\n// says so through `aria-current` on the web, as web's does, and reports\n// itself selected on native, which has no counterpart to it, as\n// NavigationBar's current destination does.\n//\n// **A press goes where the row leads**, through src/router, so under a\n// `RouterProvider` it moves between the app's screens and without one it asks\n// the platform to open the `href`. The chevron is what opens and closes a row\n// that has rows under it, and a row with no `href` opens and closes on a press\n// instead, as React Aria's does.\n//\n// **The tree is one `FlatList`**, as Tree is, so a long drawer draws only the\n// rows in view. A section's heading scrolls with its rows, as web's does,\n// since a drawer's headings are no list's subheads.\n\ntype NavigationTreeItemProps = NavigationTreeItemText &\n Omit<\n CollectionRowProps,\n 'children' | 'onAction' | 'overline' | 'textValue'\n > & {\n /**\n * The rows nested under this one, as further `NavigationTree.Item`\n * parts.\n */\n readonly children?: ReactNode\n /**\n * Where the row leads, which a press opens and `selectedRoute` is matched\n * against.\n */\n readonly href?: string\n }\n\n// What the row is worth as text, which the collection keeps beside the row\n// as web's does: a string label is taken as the value, and anything else has\n// to say what it is worth, so the compiler asks for it where web's types do.\ntype NavigationTreeItemText =\n | {\n /** The row's label, as something other than a plain string. */\n readonly label?: ReactNode\n /** The row's text, which a label that is not a string cannot give. */\n readonly textValue: string\n }\n | {\n /** The row's label: where it goes. */\n readonly label: string\n /** The row's text. Defaults to the label. */\n readonly textValue?: string\n }\n\ntype NavigationTreeProps<T extends object = object> = Omit<\n CollectionProps<T>,\n | 'defaultSelectedKeys'\n | 'disallowEmptySelection'\n | 'onAction'\n | 'onSelectionChange'\n | 'renderEmptyState'\n | 'selectedKeys'\n | 'selectionMode'\n | 'selectLabel'\n> & {\n /** The keys of the rows open at first, when the tree keeps its own. */\n readonly defaultExpandedKeys?: Iterable<Key>\n /**\n * The keys of the open rows, for a call site holding them itself with\n * `onExpandedChange`.\n */\n readonly expandedKeys?: Iterable<Key>\n /** Called with the keys of the open rows whenever a row opens or closes. */\n readonly onExpandedChange?: (keys: Set<Key>) => void\n /**\n * The route the app is on, matched against each row's `href`: the row it\n * matches is the current one, and the rows above it are its trail.\n */\n readonly selectedRoute?: null | string\n}\n\ntype NavigationTreeSectionProps = CollectionSectionProps\n\n/**\n * A nested set of links, with the current one marked. Give the tree a\n * `selectedRoute` and each row an `href`, and the row whose `href` matches is\n * the current one, drawn on the drawer's pill, while each row it sits under\n * is drawn with a bold label, so a closed trail still shows where you are.\n * Which rows are open is React Stately's, as web's is React Aria's: pass\n * `expandedKeys` with `onExpandedChange` to control it, or\n * `defaultExpandedKeys` to let it keep its own.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"/second\">\n * <NavigationTree.Item href=\"/first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"/second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, as there is none in React Aria's: what is\n * current comes from the route rather than from anything the reader picked,\n * and `Tree` is the one that selects. A press opens a row's `href` through\n * the `RouterProvider` around it. Composed from parts, `NavigationTree.Item`\n * and `NavigationTree.Section`, which the tree draws from their props, so\n * neither renders anything on its own. Name the tree with `aria-label`. It\n * scrolls by itself, so it wants a height to fill: a short tree on a page\n * that scrolls takes `scrollEnabled={false}` and is laid out at its full\n * length. It has no ground of its own, so it takes the drawer's, and `style`\n * and `ref` land on the `FlatList`.\n */\nfunction NavigationTree<T extends object = object>({\n children,\n defaultExpandedKeys,\n disabledKeys,\n expandedKeys,\n items,\n onExpandedChange,\n selectedRoute,\n ...props\n}: NavigationTreeProps<T>) {\n const state = useTreeState<T>({\n // Each part builds its own entry in the collection; see\n // `navigationItemNode` and the one src/collection gives. The collection\n // skips what is not an element, as a ReactNode may be, and asks any\n // element for its entry.\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- see above\n children: children as StatelyTreeProps<T>['children'],\n defaultExpandedKeys,\n disabledKeys,\n expandedKeys,\n items,\n onExpandedChange,\n selectionMode: 'none',\n })\n\n return (\n <CollectionView<T>\n {...props}\n kind=\"drawer\"\n renderEmptyState={nothing}\n selectedRoute={selectedRoute ?? undefined}\n state={state}\n />\n )\n}\n\n/**\n * One row, and the rows under it. Its slots are ListItem's, with a `label`\n * where ListItem has a headline and no overline, since the drawer page gives\n * one line of label: `leading`, the `label`, `supporting` under it, and\n * `trailing`, such as a count. Give it an `href`, which is what a press\n * opens and what `selectedRoute` is matched against, and an `id`, which is\n * the key opening is reported by.\n *\n * Rows nested as `children` are what make it open: a row with none draws no\n * chevron. The tree draws it from its entry in the collection, so it renders\n * nothing on its own. `style`, `ref` and `testID` land on the row.\n */\nfunction NavigationTreeItem(_props: NavigationTreeItemProps): null {\n return null\n}\n\nNavigationTreeItem.getCollectionNode = navigationItemNode\n\n/** A named group of rows, with its heading above them. */\nfunction NavigationTreeSection(_props: NavigationTreeSectionProps): null {\n return null\n}\n\nNavigationTreeSection.getCollectionNode = sectionNode\n\n// The entry the collection holds for an `Item` part, whose first line is its\n// label.\nfunction navigationItemNode(props: NavigationTreeItemProps) {\n return nestedRowNode(\n props,\n props.label,\n props.textValue ?? (typeof props.label === 'string' ? props.label : ''),\n )\n}\n\n// What a drawer with no rows draws, which is nothing: React Aria's takes no\n// empty state, since a set of links has no search to have found none.\nfunction nothing() {\n return null\n}\n\nNavigationTree.Item = NavigationTreeItem\nNavigationTree.Section = NavigationTreeSection\n\nexport { NavigationTree, NavigationTreeItem, NavigationTreeSection }\nexport type {\n NavigationTreeItemProps,\n NavigationTreeProps,\n NavigationTreeSectionProps,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4IA,SAAA4B,eAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAjB;CAAA,IAAAM;CAAA,IAAAY;CAAA,IAAAV;CAAA,IAAAW;CAAA,IAAAV;CAAA,IAAAW;CAAA,IAAAR;CAAA,IAAAI,EAAA,OAAAD,IAAA;EAAmD,CAAA,CAAAf,UAAAM,qBAAAY,cAAAV,cAAAW,OAAAV,kBAAAG,eAAA,GAAAQ,SAAAL;EAS1BC,EAAA,KAAAD;EAAAC,EAAA,KAAAhB;EAAAgB,EAAA,KAAAV;EAAAU,EAAA,KAAAE;EAAAF,EAAA,KAAAR;EAAAQ,EAAA,KAAAG;EAAAH,EAAA,KAAAP;EAAAO,EAAA,KAAAI;EAAAJ,EAAA,KAAAJ;CAAA,OAAA;EAAAZ,WAAAgB,EAAA;EAAAV,sBAAAU,EAAA;EAAAE,eAAAF,EAAA;EAAAR,eAAAQ,EAAA;EAAAG,QAAAH,EAAA;EAAAP,mBAAAO,EAAA;EAAAI,QAAAJ,EAAA;EAAAJ,gBAAAI,EAAA;CAAA;CAOX,MAAAK,KAAArB;CAA2C,IAAAsB;CAAA,IAAAN,EAAA,OAAAV,uBAAAU,EAAA,QAAAE,gBAAAF,EAAA,QAAAR,gBAAAQ,EAAA,QAAAG,SAAAH,EAAA,QAAAP,oBAAAO,EAAA,QAAAK,IAAA;EANzBC,KAAA;GAAAtB,UAMlBqB;GAA2Cf;GAAAY;GAAAV;GAAAW;GAAAV;GAAAc,eAMtC;EACjB;EAACP,EAAA,KAAAV;EAAAU,EAAA,MAAAE;EAAAF,EAAA,MAAAR;EAAAQ,EAAA,MAAAG;EAAAH,EAAA,MAAAP;EAAAO,EAAA,MAAAK;EAAAL,EAAA,MAAAM;CAAA,OAAAA,KAAAN,EAAA;CAbD,MAAAQ,QAAclC,aAAgBgC,EAa7B;CAOkB,MAAAG,KAAAb,iBAAAc,KAAAA;CAA0B,IAAAC;CAAA,IAAAX,EAAA,QAAAI,SAAAJ,EAAA,QAAAQ,SAAAR,EAAA,QAAAS,IAAA;EAJ3CE,KAAA,oBAAC,gBAAD;GAAe,GACTP;GACC,MAAA;GACaQ,kBAAAA;GACH,eAAAH;GACRD;EAAK,CAAA;EACZR,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;EAAAT,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OANFW;AAME;;;;;;;;;;;;;AAgBN,SAASE,mBAAmBC,QAAuC;CACjE,OAAO;AACT;AAEAD,mBAAmBE,oBAAoBC;;AAGvC,SAASC,sBAAsBH,QAA0C;CACvE,OAAO;AACT;AAEAG,sBAAsBF,oBAAoBnC;AAI1C,SAASoC,mBAAmBZ,OAAgC;CAC1D,OAAOzB,cACLyB,OACAA,MAAMlB,OACNkB,MAAMjB,cAAc,OAAOiB,MAAMlB,UAAU,WAAWkB,MAAMlB,QAAQ,GACtE;AACF;AAIA,SAAS0B,UAAU;CACjB,OAAO;AACT;AAEAd,eAAeoB,OAAOL;AACtBf,eAAeqB,UAAUF"}
|
|
@@ -9,12 +9,12 @@ import { MinusGlyph, PlusGlyph } from "../../glyphs/index.js";
|
|
|
9
9
|
import { useFieldValidation } from "../../form/index.js";
|
|
10
10
|
import { IconButton } from "../icon-button/index.js";
|
|
11
11
|
import { FieldBox, FieldInput, FieldMessage, describedBy, useFieldFocus } from "../../field/index.js";
|
|
12
|
+
import { keyboardFor } from "../../number/keyboard.js";
|
|
12
13
|
import { useNumberFieldState } from "../../number/state.js";
|
|
13
14
|
import { c } from "react/compiler-runtime";
|
|
14
15
|
import { AccessibilityInfo, Platform, Pressable, StyleSheet, View, useWindowDimensions } from "react-native";
|
|
15
16
|
import { useEffect, useId, useImperativeHandle, useRef, useState } from "react";
|
|
16
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { NumberFormatter } from "@internationalized/number";
|
|
18
18
|
//#region src/components/number-field/index.tsx
|
|
19
19
|
const STEPPER_WIDTH = 32;
|
|
20
20
|
const GLYPH_SIZE = 20;
|
|
@@ -76,10 +76,6 @@ function glyphOf(color) {
|
|
|
76
76
|
function halfOf({ spacing, typography }, outlined, fontScale) {
|
|
77
77
|
return outlined ? spacing.lg + typography.bodyLargeLineHeight * fontScale / 2 : spacing.sm + (typography.bodySmallLineHeight + typography.bodyLargeLineHeight) * fontScale / 2;
|
|
78
78
|
}
|
|
79
|
-
function keyboardOf(minValue, hasDecimals) {
|
|
80
|
-
if (minValue === void 0 || Number.isNaN(minValue) || minValue < 0) return Platform.OS === "ios" ? "numbers-and-punctuation" : "numeric";
|
|
81
|
-
return hasDecimals ? "decimal-pad" : "number-pad";
|
|
82
|
-
}
|
|
83
79
|
function marginVerticalOf(margin) {
|
|
84
80
|
return { marginVertical: margin };
|
|
85
81
|
}
|
|
@@ -100,7 +96,7 @@ function marginVerticalOf(margin) {
|
|
|
100
96
|
* ```
|
|
101
97
|
*/
|
|
102
98
|
function NumberField(t0) {
|
|
103
|
-
const $ = c(
|
|
99
|
+
const $ = c(124);
|
|
104
100
|
let decrementLabel;
|
|
105
101
|
let defaultValue;
|
|
106
102
|
let description;
|
|
@@ -288,192 +284,185 @@ function NumberField(t0) {
|
|
|
288
284
|
$[60] = t14;
|
|
289
285
|
} else t14 = $[60];
|
|
290
286
|
const focus = useFieldFocus(t14);
|
|
291
|
-
let t15;
|
|
292
|
-
if ($[61] !== formatOptions || $[62] !== writtenIn) {
|
|
293
|
-
t15 = new NumberFormatter(writtenIn, formatOptions).resolvedOptions().maximumFractionDigits ?? 0;
|
|
294
|
-
$[61] = formatOptions;
|
|
295
|
-
$[62] = writtenIn;
|
|
296
|
-
$[63] = t15;
|
|
297
|
-
} else t15 = $[63];
|
|
298
|
-
const hasDecimals = t15 > 0;
|
|
299
287
|
const announced = useStepAnnouncement(state.inputValue);
|
|
300
288
|
const [stepperFocused, setStepperFocused] = useState(false);
|
|
289
|
+
let t15;
|
|
301
290
|
let t16;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
t16 =
|
|
305
|
-
|
|
306
|
-
$[
|
|
307
|
-
$[65] = t17;
|
|
291
|
+
if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
|
|
292
|
+
t15 = () => control.current;
|
|
293
|
+
t16 = [];
|
|
294
|
+
$[61] = t15;
|
|
295
|
+
$[62] = t16;
|
|
308
296
|
} else {
|
|
309
|
-
|
|
310
|
-
|
|
297
|
+
t15 = $[61];
|
|
298
|
+
t16 = $[62];
|
|
311
299
|
}
|
|
312
|
-
useImperativeHandle(inputRef,
|
|
313
|
-
let
|
|
314
|
-
if ($[
|
|
315
|
-
let
|
|
316
|
-
if ($[
|
|
317
|
-
|
|
300
|
+
useImperativeHandle(inputRef, t15, t16);
|
|
301
|
+
let t17;
|
|
302
|
+
if ($[63] !== announced || $[64] !== decrementLabel || $[65] !== incrementLabel || $[66] !== label || $[67] !== state.canDecrement || $[68] !== state.canIncrement || $[69] !== state.decrement || $[70] !== state.increment || $[71] !== steppers || $[72] !== validation.onEdit || $[73] !== variant || $[74] !== writtenIn) {
|
|
303
|
+
let t18;
|
|
304
|
+
if ($[76] === Symbol.for("react.memo_cache_sentinel")) {
|
|
305
|
+
t18 = () => {
|
|
318
306
|
setStepperFocused(false);
|
|
319
307
|
};
|
|
320
|
-
$[
|
|
321
|
-
} else
|
|
322
|
-
let
|
|
323
|
-
if ($[
|
|
324
|
-
|
|
308
|
+
$[76] = t18;
|
|
309
|
+
} else t18 = $[76];
|
|
310
|
+
let t19;
|
|
311
|
+
if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
|
|
312
|
+
t19 = () => {
|
|
325
313
|
setStepperFocused(true);
|
|
326
314
|
};
|
|
327
|
-
$[
|
|
328
|
-
} else
|
|
329
|
-
|
|
315
|
+
$[77] = t19;
|
|
316
|
+
} else t19 = $[77];
|
|
317
|
+
t17 = steppersOf({
|
|
330
318
|
canDecrement: state.canDecrement,
|
|
331
319
|
canIncrement: state.canIncrement,
|
|
332
320
|
decrementLabel: decrementLabel ?? messagesFor(writtenIn).decrease.replace("{label}", label),
|
|
333
321
|
incrementLabel: incrementLabel ?? messagesFor(writtenIn).increase.replace("{label}", label),
|
|
334
322
|
inline: steppers === "horizontal",
|
|
335
|
-
onBlur:
|
|
323
|
+
onBlur: t18,
|
|
336
324
|
onDecrement: announced(stepThen(state.decrement, validation.onEdit)),
|
|
337
|
-
onFocus:
|
|
325
|
+
onFocus: t19,
|
|
338
326
|
onIncrement: announced(stepThen(state.increment, validation.onEdit)),
|
|
339
327
|
outlined: variant === "outlined"
|
|
340
328
|
});
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
} else
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
const
|
|
358
|
-
const
|
|
359
|
-
let
|
|
360
|
-
if ($[
|
|
361
|
-
|
|
329
|
+
$[63] = announced;
|
|
330
|
+
$[64] = decrementLabel;
|
|
331
|
+
$[65] = incrementLabel;
|
|
332
|
+
$[66] = label;
|
|
333
|
+
$[67] = state.canDecrement;
|
|
334
|
+
$[68] = state.canIncrement;
|
|
335
|
+
$[69] = state.decrement;
|
|
336
|
+
$[70] = state.increment;
|
|
337
|
+
$[71] = steppers;
|
|
338
|
+
$[72] = validation.onEdit;
|
|
339
|
+
$[73] = variant;
|
|
340
|
+
$[74] = writtenIn;
|
|
341
|
+
$[75] = t17;
|
|
342
|
+
} else t17 = $[75];
|
|
343
|
+
const t18 = focus.focused || stepperFocused;
|
|
344
|
+
const t19 = shownError !== void 0;
|
|
345
|
+
const t20 = state.inputValue !== "";
|
|
346
|
+
const t21 = focus.handlers;
|
|
347
|
+
let t22;
|
|
348
|
+
if ($[78] !== description || $[79] !== id || $[80] !== shownError) {
|
|
349
|
+
t22 = describedBy(id, {
|
|
362
350
|
description,
|
|
363
351
|
error: shownError
|
|
364
352
|
});
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
} else
|
|
370
|
-
const
|
|
353
|
+
$[78] = description;
|
|
354
|
+
$[79] = id;
|
|
355
|
+
$[80] = shownError;
|
|
356
|
+
$[81] = t22;
|
|
357
|
+
} else t22 = $[81];
|
|
358
|
+
const t23 = !isDisabled && !isReadOnly;
|
|
359
|
+
let t24;
|
|
360
|
+
if ($[82] !== formatOptions || $[83] !== minValue || $[84] !== writtenIn) {
|
|
361
|
+
t24 = keyboardFor(writtenIn, formatOptions, minValue);
|
|
362
|
+
$[82] = formatOptions;
|
|
363
|
+
$[83] = minValue;
|
|
364
|
+
$[84] = writtenIn;
|
|
365
|
+
$[85] = t24;
|
|
366
|
+
} else t24 = $[85];
|
|
371
367
|
let t25;
|
|
372
|
-
if ($[
|
|
373
|
-
t25 =
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
} else t25 = $[
|
|
368
|
+
if ($[86] !== state || $[87] !== validation.onEdit) {
|
|
369
|
+
t25 = editInto(state, validation.onEdit);
|
|
370
|
+
$[86] = state;
|
|
371
|
+
$[87] = validation.onEdit;
|
|
372
|
+
$[88] = t25;
|
|
373
|
+
} else t25 = $[88];
|
|
378
374
|
let t26;
|
|
379
|
-
if ($[
|
|
380
|
-
t26 =
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
} else t26 = $[
|
|
375
|
+
if ($[89] !== onSubmitEditing || $[90] !== state) {
|
|
376
|
+
t26 = commitBefore(state, onSubmitEditing);
|
|
377
|
+
$[89] = onSubmitEditing;
|
|
378
|
+
$[90] = state;
|
|
379
|
+
$[91] = t26;
|
|
380
|
+
} else t26 = $[91];
|
|
385
381
|
let t27;
|
|
386
|
-
if ($[
|
|
387
|
-
t27 =
|
|
388
|
-
$[91] = onSubmitEditing;
|
|
389
|
-
$[92] = state;
|
|
390
|
-
$[93] = t27;
|
|
391
|
-
} else t27 = $[93];
|
|
392
|
-
let t28;
|
|
393
|
-
if ($[94] !== focus.handlers || $[95] !== label || $[96] !== numeric || $[97] !== props || $[98] !== returnKeyType || $[99] !== state.inputValue || $[100] !== t23 || $[101] !== t24 || $[102] !== t25 || $[103] !== t26 || $[104] !== t27) {
|
|
394
|
-
t28 = /* @__PURE__ */ jsx(FieldInput, {
|
|
382
|
+
if ($[92] !== focus.handlers || $[93] !== label || $[94] !== numeric || $[95] !== props || $[96] !== returnKeyType || $[97] !== state.inputValue || $[98] !== t22 || $[99] !== t23 || $[100] !== t24 || $[101] !== t25 || $[102] !== t26) {
|
|
383
|
+
t27 = /* @__PURE__ */ jsx(FieldInput, {
|
|
395
384
|
...props,
|
|
396
|
-
...
|
|
385
|
+
...t21,
|
|
397
386
|
"aria-label": label,
|
|
398
387
|
autoComplete: "off",
|
|
399
388
|
autoCorrect: false,
|
|
400
|
-
described:
|
|
401
|
-
editable:
|
|
402
|
-
keyboardType:
|
|
389
|
+
described: t22,
|
|
390
|
+
editable: t23,
|
|
391
|
+
keyboardType: t24,
|
|
403
392
|
numeric,
|
|
404
|
-
onChangeText:
|
|
405
|
-
onSubmitEditing:
|
|
393
|
+
onChangeText: t25,
|
|
394
|
+
onSubmitEditing: t26,
|
|
406
395
|
ref: control,
|
|
407
396
|
returnKeyType,
|
|
408
397
|
spellCheck: false,
|
|
409
398
|
value: state.inputValue
|
|
410
399
|
});
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
} else
|
|
424
|
-
let
|
|
425
|
-
if ($[
|
|
426
|
-
|
|
400
|
+
$[92] = focus.handlers;
|
|
401
|
+
$[93] = label;
|
|
402
|
+
$[94] = numeric;
|
|
403
|
+
$[95] = props;
|
|
404
|
+
$[96] = returnKeyType;
|
|
405
|
+
$[97] = state.inputValue;
|
|
406
|
+
$[98] = t22;
|
|
407
|
+
$[99] = t23;
|
|
408
|
+
$[100] = t24;
|
|
409
|
+
$[101] = t25;
|
|
410
|
+
$[102] = t26;
|
|
411
|
+
$[103] = t27;
|
|
412
|
+
} else t27 = $[103];
|
|
413
|
+
let t28;
|
|
414
|
+
if ($[104] !== floatingLabel || $[105] !== isDisabled || $[106] !== isRequired || $[107] !== label || $[108] !== t17 || $[109] !== t18 || $[110] !== t19 || $[111] !== t20 || $[112] !== t27 || $[113] !== variant) {
|
|
415
|
+
t28 = /* @__PURE__ */ jsx(FieldBox, {
|
|
427
416
|
control,
|
|
428
|
-
end:
|
|
417
|
+
end: t17,
|
|
429
418
|
floatingLabel,
|
|
430
419
|
isDisabled,
|
|
431
|
-
isFocused:
|
|
432
|
-
isInvalid:
|
|
433
|
-
isPopulated:
|
|
420
|
+
isFocused: t18,
|
|
421
|
+
isInvalid: t19,
|
|
422
|
+
isPopulated: t20,
|
|
434
423
|
isRequired,
|
|
435
424
|
label,
|
|
436
425
|
variant,
|
|
437
|
-
children:
|
|
426
|
+
children: t27
|
|
438
427
|
});
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
$[
|
|
445
|
-
$[
|
|
446
|
-
$[
|
|
428
|
+
$[104] = floatingLabel;
|
|
429
|
+
$[105] = isDisabled;
|
|
430
|
+
$[106] = isRequired;
|
|
431
|
+
$[107] = label;
|
|
432
|
+
$[108] = t17;
|
|
433
|
+
$[109] = t18;
|
|
434
|
+
$[110] = t19;
|
|
435
|
+
$[111] = t20;
|
|
436
|
+
$[112] = t27;
|
|
437
|
+
$[113] = variant;
|
|
447
438
|
$[114] = t28;
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
if ($[117] !== description || $[118] !== id || $[119] !== shownError) {
|
|
453
|
-
t30 = /* @__PURE__ */ jsx(FieldMessage, {
|
|
439
|
+
} else t28 = $[114];
|
|
440
|
+
let t29;
|
|
441
|
+
if ($[115] !== description || $[116] !== id || $[117] !== shownError) {
|
|
442
|
+
t29 = /* @__PURE__ */ jsx(FieldMessage, {
|
|
454
443
|
description,
|
|
455
444
|
error: shownError,
|
|
456
445
|
id
|
|
457
446
|
});
|
|
458
|
-
$[
|
|
459
|
-
$[
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
} else
|
|
463
|
-
let
|
|
464
|
-
if ($[
|
|
465
|
-
|
|
447
|
+
$[115] = description;
|
|
448
|
+
$[116] = id;
|
|
449
|
+
$[117] = shownError;
|
|
450
|
+
$[118] = t29;
|
|
451
|
+
} else t29 = $[118];
|
|
452
|
+
let t30;
|
|
453
|
+
if ($[119] !== ref || $[120] !== style || $[121] !== t28 || $[122] !== t29) {
|
|
454
|
+
t30 = /* @__PURE__ */ jsxs(View, {
|
|
466
455
|
ref,
|
|
467
456
|
style,
|
|
468
|
-
children: [
|
|
457
|
+
children: [t28, t29]
|
|
469
458
|
});
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
} else
|
|
476
|
-
return
|
|
459
|
+
$[119] = ref;
|
|
460
|
+
$[120] = style;
|
|
461
|
+
$[121] = t28;
|
|
462
|
+
$[122] = t29;
|
|
463
|
+
$[123] = t30;
|
|
464
|
+
} else t30 = $[123];
|
|
465
|
+
return t30;
|
|
477
466
|
}
|
|
478
467
|
function outwardSlop(half, place) {
|
|
479
468
|
const slop = hitSlop(half, STEPPER_WIDTH);
|