@kanso-labs/kanso-ui 0.44.1 → 0.45.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 +59 -7
- package/dist/chip/index.js +24 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +13 -5
- package/dist/chip/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +14 -2
- package/dist/components/app-bar/index.js +36 -7
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +44 -0
- package/dist/components/autocomplete/index.js +44 -0
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/index.js +53 -59
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +11 -3
- package/dist/components/card/index.js +23 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js +65 -58
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +46 -30
- package/dist/components/chip/index.js +38 -17
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +5 -2
- package/dist/components/chip-group/index.js +8 -2
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +27 -0
- package/dist/components/dialog/index.js +81 -37
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/form/index.d.ts +14 -4
- package/dist/components/form/index.js +6 -3
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +15 -1
- package/dist/components/icon-button/index.js +15 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.d.ts +4 -0
- package/dist/components/link/index.js +4 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.d.ts +34 -0
- package/dist/components/list/index.js +47 -13
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +34 -1
- package/dist/components/list-detail/index.js +34 -1
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +21 -2
- package/dist/components/list-item/index.js +6 -0
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +6 -3
- package/dist/components/menu/index.js +3 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +4 -0
- package/dist/components/meter/index.js +4 -0
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +14 -2
- package/dist/components/navigation-bar/index.js +14 -2
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +2 -9
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +7 -1
- package/dist/components/number-field/index.js +7 -1
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +15 -1
- package/dist/components/popover/index.js +15 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +8 -1
- package/dist/components/product-icon/index.js +8 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +12 -6
- package/dist/components/progress-indicator/index.js +57 -46
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +7 -0
- package/dist/components/radio-group/index.js +23 -14
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +13 -4
- package/dist/components/search-field/index.js +10 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +2 -0
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +31 -6
- package/dist/components/separator/index.js +30 -6
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +96 -37
- package/dist/components/sheet/index.js +420 -136
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +8 -1
- package/dist/components/snackbar/index.js +7 -0
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/stack/index.d.ts +21 -5
- package/dist/components/stack/index.js +10 -0
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/switch/index.js +12 -0
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +39 -9
- package/dist/components/text-field/index.js +29 -7
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/tree/index.js +11 -15
- package/dist/components/tree/index.js.map +1 -1
- package/dist/hooks/useBottomEdge.js +6 -3
- package/dist/hooks/useBottomEdge.js.map +1 -1
- package/dist/hooks/useRipple.js +216 -192
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +34 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/indicator/styles.js +7 -4
- package/dist/indicator/styles.js.map +1 -1
- package/dist/mark/styles.js +11 -5
- package/dist/mark/styles.js.map +1 -1
- package/dist/react-aria.d.ts +2 -2
- package/dist/row/index.js +90 -62
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +6 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +8 -0
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles.css +135 -114
- package/dist/theme-scope.d.ts +14 -2
- package/dist/theme-scope.js +12 -0
- package/dist/theme-scope.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode, RefAttributes } from "react";
|
|
2
|
-
import { ClassNameOrFunction, DialogProps, DialogTriggerProps, HeadingProps, ModalOverlayProps,
|
|
2
|
+
import { ClassNameOrFunction, DialogProps, DialogTriggerProps, HeadingProps, ModalOverlayProps, SheetRenderProps, StyleOrFunction } from "react-aria-components";
|
|
3
3
|
//#region src/components/sheet/index.d.ts
|
|
4
|
-
type SheetProps = Omit<DialogTriggerProps, 'children'> & {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
};
|
|
7
4
|
/**
|
|
8
5
|
* A modal panel that arrives from the edge of the screen — a side sheet on a
|
|
9
6
|
* wide viewport, a bottom sheet on a narrow one. Open state is React Aria's:
|
|
@@ -17,16 +14,42 @@ type SheetProps = Omit<DialogTriggerProps, 'children'> & {
|
|
|
17
14
|
* given `slot="close"` anywhere inside the content closes it; neither needs
|
|
18
15
|
* a part of its own.
|
|
19
16
|
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Sheet>
|
|
19
|
+
* <Button>Open</Button>
|
|
20
|
+
* <Sheet.Content>
|
|
21
|
+
* <Sheet.Handle />
|
|
22
|
+
* <Sheet.Header>
|
|
23
|
+
* <Sheet.Title>Headline</Sheet.Title>
|
|
24
|
+
* </Sheet.Header>
|
|
25
|
+
* <Sheet.Body>Supporting line</Sheet.Body>
|
|
26
|
+
* <Sheet.Footer>
|
|
27
|
+
* <Button slot="close">Close</Button>
|
|
28
|
+
* </Sheet.Footer>
|
|
29
|
+
* </Sheet.Content>
|
|
30
|
+
* </Sheet>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
20
33
|
* `Sheet` is the trigger's half, so a sheet nothing on the page opens — one
|
|
21
34
|
* a route shows, or a menu item raises — leaves it out and passes `isOpen`
|
|
22
35
|
* and `onOpenChange` to `Sheet.Content` instead. Wrapped in `Sheet` with no
|
|
23
36
|
* button inside it, React Aria warns that its press responder found nothing
|
|
24
37
|
* to press.
|
|
38
|
+
*
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <Sheet.Content isOpen={isOpen} onOpenChange={setOpen}>
|
|
41
|
+
* …
|
|
42
|
+
* </Sheet.Content>
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* Tab stays inside an open sheet, so a `Snackbar` shown meanwhile is reached
|
|
46
|
+
* with F6, which React Aria uses to move between landmarks. Tabbing on past
|
|
47
|
+
* the snackbar's last control leads back into the sheet.
|
|
25
48
|
*/
|
|
26
|
-
declare function Sheet({ children, ...props }: SheetProps): import("react").JSX.Element;
|
|
27
|
-
declare namespace Sheet {
|
|
49
|
+
declare function Sheet$1({ children, ...props }: SheetProps): import("react").JSX.Element;
|
|
50
|
+
declare namespace Sheet$1 {
|
|
28
51
|
var Body: typeof SheetBody;
|
|
29
|
-
var Content: typeof SheetContent;
|
|
52
|
+
var Content: typeof SheetContent$1;
|
|
30
53
|
var Footer: typeof SheetFooter;
|
|
31
54
|
var Handle: typeof SheetHandle;
|
|
32
55
|
var Header: typeof SheetHeader;
|
|
@@ -38,43 +61,56 @@ declare function SheetBody({ ref: callerRef, ...props }: HTMLAttributes<HTMLDivE
|
|
|
38
61
|
* in here; the trigger stays outside it, since the trigger lives in the page
|
|
39
62
|
* while this is portalled out to the end of the body.
|
|
40
63
|
*
|
|
41
|
-
* A
|
|
42
|
-
*
|
|
43
|
-
*
|
|
64
|
+
* A swipe toward the edge the panel rests on closes it — down on a bottom
|
|
65
|
+
* sheet, toward the screen's edge on a side sheet — as do a press on the
|
|
66
|
+
* scrim, Escape and a `slot="close"` button. `isDismissable` holds the first
|
|
67
|
+
* two, and `isKeyboardDismissDisabled` holds Escape. React Aria's default for
|
|
68
|
+
* the scrim is the reverse of this one: a sheet that ignores a tap outside it
|
|
69
|
+
* reads as stuck.
|
|
44
70
|
*
|
|
45
71
|
* Inside `Sheet`, the open state is the trigger's. On its own, with no
|
|
46
72
|
* trigger, it is this part's: `isOpen` with `onOpenChange` controls it, and
|
|
47
|
-
* a `slot="close"` button, Escape and the scrim all report through
|
|
73
|
+
* a swipe, a `slot="close"` button, Escape and the scrim all report through
|
|
48
74
|
* `onOpenChange`, as they would to `Sheet`.
|
|
49
75
|
*
|
|
50
|
-
* The
|
|
51
|
-
* that, such as a sticky header
|
|
76
|
+
* The sheet draws at `z-index: 900`, the scrim and the panel over it, over
|
|
77
|
+
* any page content layered below that, such as a sticky header. A
|
|
52
78
|
* `Snackbar` draws at 1000, so a toast raised from inside the sheet is read
|
|
53
79
|
* over it, and React Aria's popovers and menus draw above both.
|
|
80
|
+
*
|
|
81
|
+
* React Aria lays the sheet over the page from the page's own top-left
|
|
82
|
+
* corner rather than fixing it to the window, so a `container` inside a
|
|
83
|
+
* positioned element holds the sheet to that element instead.
|
|
54
84
|
*/
|
|
55
|
-
declare function SheetContent({ children, className, container, defaultOpen, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, ref, style, ...props }: RefAttributes<HTMLDivElement> & SheetContentProps): import("react").JSX.Element;
|
|
85
|
+
declare function SheetContent$1({ children, className, container, defaultOpen, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, ref, snapPoints, style, ...props }: RefAttributes<HTMLDivElement> & SheetContentProps): import("react").JSX.Element;
|
|
56
86
|
/**
|
|
57
|
-
* The sheet's actions. The panel
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
87
|
+
* The sheet's actions. The panel rests on the window's bottom edge in both
|
|
88
|
+
* presentations, so they sit on that edge, and a toast rises clear of them
|
|
89
|
+
* while the sheet is open rather than lying over its buttons. A side sheet's
|
|
90
|
+
* are included: the toast is centred in the window, and on any window
|
|
91
|
+
* narrower than about 1376px its 576 reach into the sheet's 400.
|
|
62
92
|
*/
|
|
63
93
|
declare function SheetFooter({ ref: callerRef, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
64
94
|
/**
|
|
65
95
|
* The bottom sheets page's drag handle: a short bar above the sheet's
|
|
66
|
-
* content, saying the panel is a bottom sheet. Place it
|
|
67
|
-
* `Sheet.Content`; above the medium breakpoint the panel is a
|
|
68
|
-
* this draws nothing.
|
|
96
|
+
* content, saying the panel is a bottom sheet that a swipe moves. Place it
|
|
97
|
+
* first inside `Sheet.Content`; above the medium breakpoint the panel is a
|
|
98
|
+
* side sheet and this draws nothing.
|
|
99
|
+
*
|
|
100
|
+
* On a sheet given `snapPoints` it is a button, as the bottom sheets page
|
|
101
|
+
* asks of a handle that moves the sheet between heights: a press, from a
|
|
102
|
+
* pointer, a keyboard or assistive technology, moves the sheet to its next
|
|
103
|
+
* snap point, from the last back to the first, and `aria-expanded` says
|
|
104
|
+
* whether it rests at the last. It is called "Drag handle" in the locale's
|
|
105
|
+
* own words, and a call site's `aria-label` names it instead. Its 48 square
|
|
106
|
+
* is the page's target, centred over the bar.
|
|
69
107
|
*
|
|
70
|
-
*
|
|
71
|
-
* technology
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* would promise what it cannot do. Closing is already the scrim, Escape, and
|
|
75
|
-
* any button given `slot="close"`.
|
|
108
|
+
* On a sheet without them it is decoration, hidden from assistive
|
|
109
|
+
* technology: the panel has one height, and the swipe the bar points at
|
|
110
|
+
* takes it from anywhere on the panel, so a control here would offer
|
|
111
|
+
* nothing a swipe, the scrim, Escape or a `slot="close"` button does not.
|
|
76
112
|
*/
|
|
77
|
-
declare function SheetHandle(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
113
|
+
declare function SheetHandle({ 'aria-label': label, ...props }: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
78
114
|
declare function SheetHeader(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
79
115
|
/**
|
|
80
116
|
* Names the sheet. Rendered through React Aria's title slot, which is what
|
|
@@ -82,9 +118,9 @@ declare function SheetHeader(props: HTMLAttributes<HTMLDivElement> & RefAttribut
|
|
|
82
118
|
* itself as an unnamed dialog.
|
|
83
119
|
*/
|
|
84
120
|
declare function SheetTitle(props: RefAttributes<HTMLHeadingElement> & SheetTitleProps): import("react").JSX.Element;
|
|
85
|
-
type SheetContentProps = Omit<DialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | '
|
|
121
|
+
type SheetContentProps = Omit<DialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | 'isOpen' | 'onOpenChange'> & {
|
|
86
122
|
/** A function may compute the class from the panel's render state. */
|
|
87
|
-
className?: ClassNameOrFunction<
|
|
123
|
+
className?: ClassNameOrFunction<SheetRenderProps>;
|
|
88
124
|
/**
|
|
89
125
|
* Where to portal the panel and scrim. Defaults to the container of the
|
|
90
126
|
* `ThemeScope` around it, which keeps the sheet on that scope's tokens, or
|
|
@@ -94,17 +130,40 @@ type SheetContentProps = Omit<DialogProps, 'className' | 'style'> & Pick<ModalOv
|
|
|
94
130
|
*/
|
|
95
131
|
container?: Element;
|
|
96
132
|
/**
|
|
97
|
-
* Whether a press on the scrim, outside the panel,
|
|
98
|
-
* `true` here where React Aria's own
|
|
99
|
-
*
|
|
100
|
-
* `isKeyboardDismissDisabled`'s, and
|
|
133
|
+
* Whether a press on the scrim, outside the panel, or a swipe toward the
|
|
134
|
+
* edge it rests on closes the sheet. `true` here where React Aria's own
|
|
135
|
+
* default for the scrim is `false`, since a sheet that ignores a tap
|
|
136
|
+
* outside it reads as stuck. Escape is `isKeyboardDismissDisabled`'s, and
|
|
137
|
+
* this says nothing about it.
|
|
101
138
|
* @default true
|
|
102
139
|
*/
|
|
103
140
|
isDismissable?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Whether Escape is kept from closing the sheet. The scrim and the swipe
|
|
143
|
+
* are `isDismissable`'s, and this says nothing about them.
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
146
|
+
isKeyboardDismissDisabled?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* The heights a bottom sheet rests at, each the amount of the panel
|
|
149
|
+
* showing: a number of pixels, or a percentage of the panel's own
|
|
150
|
+
* height. The sheet opens at the first, a swipe moves it between them,
|
|
151
|
+
* and a press on `Sheet.Handle` moves it to the next, from the last
|
|
152
|
+
* back to the first. React Aria's own prop, under its own name.
|
|
153
|
+
*
|
|
154
|
+
* End on `'100%'` for a sheet that can show all of itself: its body
|
|
155
|
+
* scrolls only while the whole panel is showing, and short of that a
|
|
156
|
+
* swipe on the body moves the sheet instead. The side sheet has one
|
|
157
|
+
* width and ignores them.
|
|
158
|
+
*/
|
|
159
|
+
snapPoints?: Array<number | string>;
|
|
104
160
|
/** A function may compute the style from the panel's render state. */
|
|
105
|
-
style?: StyleOrFunction<
|
|
161
|
+
style?: StyleOrFunction<SheetRenderProps>;
|
|
162
|
+
};
|
|
163
|
+
type SheetProps = Omit<DialogTriggerProps, 'children'> & {
|
|
164
|
+
children?: ReactNode;
|
|
106
165
|
};
|
|
107
166
|
type SheetTitleProps = HeadingProps;
|
|
108
167
|
//#endregion
|
|
109
|
-
export { SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Sheet as default };
|
|
168
|
+
export { SheetBody, SheetContent$1 as SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Sheet$1 as default };
|
|
110
169
|
//# sourceMappingURL=index.d.ts.map
|