@kanso-labs/react-native-kanso-ui 0.1.1 → 0.3.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/dist/button/index.d.ts +32 -2
- package/dist/button/index.js +38 -26
- package/dist/button/index.js.map +1 -1
- package/dist/button/pending.js +144 -0
- package/dist/button/pending.js.map +1 -0
- package/dist/button/slots.js +7 -0
- package/dist/button/slots.js.map +1 -0
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -3
- package/dist/components/button/index.js +159 -111
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +3 -3
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/copy-field/index.d.ts +2 -2
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +131 -0
- package/dist/components/dialog/index.js +861 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/icon-button/index.d.ts +3 -3
- package/dist/components/icon-button/index.js +165 -109
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +73 -0
- package/dist/components/meter/index.js +179 -0
- package/dist/components/meter/index.js.map +1 -0
- package/dist/components/number-field/index.d.ts +3 -3
- package/dist/components/number-field/index.js +1 -9
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +2 -2
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +113 -0
- package/dist/components/progress-indicator/index.js +1024 -0
- package/dist/components/progress-indicator/index.js.map +1 -0
- package/dist/components/radio-group/index.d.ts +3 -3
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +3 -3
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +3 -3
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +120 -0
- package/dist/components/snackbar/index.js +540 -0
- package/dist/components/snackbar/index.js.map +1 -0
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +3 -3
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/field/index.d.ts +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/glyphs/hidden.js +13 -0
- package/dist/glyphs/hidden.js.map +1 -0
- package/dist/glyphs/index.js +2 -8
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +23 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/messages.js +41 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -3
- package/dist/indicator/index.d.ts +15 -0
- package/dist/indicator/index.js +256 -0
- package/dist/indicator/index.js.map +1 -0
- package/dist/indicator/motion.js +86 -0
- package/dist/indicator/motion.js.map +1 -0
- package/dist/indicator/paths.js +72 -0
- package/dist/indicator/paths.js.map +1 -0
- package/dist/indicator/styles.js +62 -0
- package/dist/indicator/styles.js.map +1 -0
- package/dist/mark/index.d.ts +1 -1
- package/dist/mark/index.js.map +1 -1
- package/dist/number/locale.js +14 -0
- package/dist/number/locale.js.map +1 -0
- package/dist/overlay/host.js +65 -2
- package/dist/overlay/host.js.map +1 -1
- package/dist/press/index.js +63 -63
- package/dist/press/index.js.map +1 -1
- package/dist/theme/resolve.js +1 -1
- package/dist/theme/resolve.js.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { HostInstance, ScrollView, ScrollViewProps, StyleProp, TextProps, View, ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
import { ComponentRef, ReactNode, Ref } from "react";
|
|
3
|
+
//#region src/components/dialog/index.d.ts
|
|
4
|
+
type DialogBodyProps = ScrollViewProps & {
|
|
5
|
+
readonly ref?: Ref<ComponentRef<typeof ScrollView>>;
|
|
6
|
+
};
|
|
7
|
+
type DialogContentProps = DialogOpenProps & Omit<ViewProps, 'children' | 'role' | 'style'> & {
|
|
8
|
+
readonly children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Whether a press on the scrim, outside the container, closes the
|
|
11
|
+
* dialog. Android's back gesture is `isKeyboardDismissDisabled`'s, and
|
|
12
|
+
* this says nothing about it, so a dialog that has to be answered from
|
|
13
|
+
* one of its actions turns off both.
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
readonly isDismissable?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Keeps Android's back gesture, VoiceOver's escape gesture, and Escape on
|
|
19
|
+
* web, from closing the dialog.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
readonly isKeyboardDismissDisabled?: boolean;
|
|
23
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
24
|
+
/**
|
|
25
|
+
* `alertdialog` for a dialog interrupting with something that has to be
|
|
26
|
+
* answered before the app carries on. It also keeps the dialog the basic
|
|
27
|
+
* one in a compact window, centred and sized to its content, where a
|
|
28
|
+
* dialog of the default role fills the window.
|
|
29
|
+
* @default 'dialog'
|
|
30
|
+
*/
|
|
31
|
+
readonly role?: 'alertdialog' | 'dialog';
|
|
32
|
+
readonly style?: StyleProp<ViewStyle>;
|
|
33
|
+
};
|
|
34
|
+
type DialogOpenProps = {
|
|
35
|
+
/** Whether the dialog starts open, when it keeps its own state. */
|
|
36
|
+
readonly defaultOpen?: boolean;
|
|
37
|
+
/** Whether the dialog is open, when the call site holds the state. */
|
|
38
|
+
readonly isOpen?: boolean;
|
|
39
|
+
/** Called with the new state as the dialog opens or closes. */
|
|
40
|
+
readonly onOpenChange?: (isOpen: boolean) => void;
|
|
41
|
+
};
|
|
42
|
+
type DialogPartProps = ViewProps & {
|
|
43
|
+
readonly ref?: Ref<ComponentRef<typeof View>>;
|
|
44
|
+
};
|
|
45
|
+
type DialogProps = DialogOpenProps & {
|
|
46
|
+
/** The button that opens the dialog, and `Dialog.Content`. */
|
|
47
|
+
readonly children?: ReactNode;
|
|
48
|
+
};
|
|
49
|
+
type DialogTitleProps = Omit<TextProps, 'role'> & {
|
|
50
|
+
readonly ref?: Ref<HostInstance>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A modal dialog centred over the screen, and the same dialog filling the
|
|
54
|
+
* window in a compact window, the dialogs spec page's basic and full-screen
|
|
55
|
+
* dialogs, paired by window size as the page pairs them. An alert dialog
|
|
56
|
+
* stays the basic one at every width. Pass `isOpen` with `onOpenChange` to
|
|
57
|
+
* hold the open state, or `defaultOpen` to let it keep its own.
|
|
58
|
+
*
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <Dialog>
|
|
61
|
+
* <Button>Open</Button>
|
|
62
|
+
* <Dialog.Content>
|
|
63
|
+
* <Dialog.Header>
|
|
64
|
+
* <Dialog.Title>Headline</Dialog.Title>
|
|
65
|
+
* </Dialog.Header>
|
|
66
|
+
* <Dialog.Body>Supporting text</Dialog.Body>
|
|
67
|
+
* <Dialog.Footer>
|
|
68
|
+
* <Button slot="close" variant="text">Cancel</Button>
|
|
69
|
+
* </Dialog.Footer>
|
|
70
|
+
* </Dialog.Content>
|
|
71
|
+
* </Dialog>
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* Composed rather than configured by props, as web's is, since a dialog's
|
|
75
|
+
* header, body and actions all take arbitrary content. A `Button` or
|
|
76
|
+
* `IconButton` inside `Dialog` and outside its content opens it, and one
|
|
77
|
+
* given `slot="close"` anywhere inside the content closes it. A dialog nothing on
|
|
78
|
+
* the screen opens leaves `Dialog` out and passes `isOpen` and
|
|
79
|
+
* `onOpenChange` to `Dialog.Content` instead.
|
|
80
|
+
*/
|
|
81
|
+
declare function Dialog({ children, defaultOpen, isOpen, onOpenChange }: DialogProps): import("react").JSX.Element;
|
|
82
|
+
declare namespace Dialog {
|
|
83
|
+
var Body: typeof DialogBody;
|
|
84
|
+
var Content: typeof DialogContent;
|
|
85
|
+
var Footer: typeof DialogFooter;
|
|
86
|
+
var Header: typeof DialogHeader;
|
|
87
|
+
var Title: typeof DialogTitle;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* What the dialog shows, as a body that scrolls when its content runs past
|
|
91
|
+
* the room it has. A string is drawn in the page's body medium on on-surface
|
|
92
|
+
* variant; anything else draws itself. `style`, `ref` and `testID` land on
|
|
93
|
+
* the `ScrollView`.
|
|
94
|
+
*
|
|
95
|
+
* A body its content runs past takes focus, as web's is a tab stop, so a
|
|
96
|
+
* keyboard can scroll it when nothing inside it takes focus; a call site's
|
|
97
|
+
* own `focusable` still wins.
|
|
98
|
+
*/
|
|
99
|
+
declare function DialogBody({ children, contentContainerStyle, onContentSizeChange, onLayout, ...props }: DialogBodyProps): import("react").JSX.Element;
|
|
100
|
+
/**
|
|
101
|
+
* The dialog itself, and the scrim behind it. Everything the dialog shows
|
|
102
|
+
* goes in here; the button that opens it stays outside it.
|
|
103
|
+
*
|
|
104
|
+
* Inside `Dialog`, the open state is the trigger's. On its own it is this
|
|
105
|
+
* part's: `isOpen` with `onOpenChange` holds it, and a `slot="close"`
|
|
106
|
+
* button, the scrim and the back gesture all report through `onOpenChange`.
|
|
107
|
+
* `style`, `ref` and `testID` land on the container.
|
|
108
|
+
*/
|
|
109
|
+
declare function DialogContent({ children, defaultOpen, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, role, style, ...props }: DialogContentProps): import("react").JSX.Element | null;
|
|
110
|
+
/**
|
|
111
|
+
* The dialog's actions, at the trailing edge and wrapping onto another row
|
|
112
|
+
* when they do not fit on one. Full screen they are the page's bottom action
|
|
113
|
+
* bar. `style`, `ref` and `testID` land on its view.
|
|
114
|
+
*/
|
|
115
|
+
declare function DialogFooter({ style, ...props }: DialogPartProps): import("react").JSX.Element;
|
|
116
|
+
/**
|
|
117
|
+
* The dialog's header: its `Dialog.Title`, and anything beside it, such as a
|
|
118
|
+
* close button. Full screen it is the page's header bar. `style`, `ref` and
|
|
119
|
+
* `testID` land on its view.
|
|
120
|
+
*/
|
|
121
|
+
declare function DialogHeader({ style, ...props }: DialogPartProps): import("react").JSX.Element;
|
|
122
|
+
/**
|
|
123
|
+
* Names the dialog: the container is labelled by it, and a screen reader is
|
|
124
|
+
* sent to it once the dialog shows. In headline small as the basic dialog,
|
|
125
|
+
* and title large as the full-screen one, where it shares a 56dp bar.
|
|
126
|
+
* `style`, `ref` and `testID` land on React Native's own Text.
|
|
127
|
+
*/
|
|
128
|
+
declare function DialogTitle({ ref, style, ...props }: DialogTitleProps): import("react").JSX.Element;
|
|
129
|
+
//#endregion
|
|
130
|
+
export { Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps };
|
|
131
|
+
//# sourceMappingURL=index.d.ts.map
|