@glyphui/ui 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +137 -2
- package/dist/data-table.d.ts +110 -0
- package/dist/data-table.js +225 -0
- package/dist/field-DXZD0l8w.js +107 -0
- package/dist/field-context-B8cYheXz.js +321 -0
- package/dist/form.d.ts +79 -0
- package/dist/form.js +84 -0
- package/dist/index-BWK4czIG.d.ts +233 -0
- package/dist/index.d.ts +2155 -0
- package/dist/index.js +1529 -0
- package/dist/registry-BGSJoiLq.d.ts +9 -0
- package/dist/states-BxPjCUxz.js +287 -0
- package/dist/tv-DuMh7UH2.d.ts +6 -0
- package/package.json +113 -3
- package/src/components/avatar/avatar.styles.ts +22 -0
- package/src/components/avatar/avatar.tsx +62 -0
- package/src/components/avatar/index.ts +2 -0
- package/src/components/badge/badge.styles.ts +69 -0
- package/src/components/badge/badge.tsx +30 -0
- package/src/components/badge/index.ts +2 -0
- package/src/components/button/button.styles.ts +43 -0
- package/src/components/button/button.tsx +77 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/card/card.styles.ts +32 -0
- package/src/components/card/card.tsx +91 -0
- package/src/components/card/index.ts +11 -0
- package/src/components/checkbox/checkbox.tsx +39 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/container/container.tsx +35 -0
- package/src/components/container/index.ts +1 -0
- package/src/components/eyebrow/eyebrow.styles.ts +14 -0
- package/src/components/eyebrow/eyebrow.tsx +19 -0
- package/src/components/eyebrow/index.ts +2 -0
- package/src/components/field/field-context.ts +40 -0
- package/src/components/field/field.styles.ts +23 -0
- package/src/components/field/field.tsx +109 -0
- package/src/components/field/index.ts +3 -0
- package/src/components/heading/heading.styles.ts +16 -0
- package/src/components/heading/heading.tsx +26 -0
- package/src/components/heading/index.ts +2 -0
- package/src/components/input/index.ts +2 -0
- package/src/components/input/input.styles.ts +36 -0
- package/src/components/input/input.tsx +33 -0
- package/src/components/kbd/index.ts +1 -0
- package/src/components/kbd/kbd.tsx +21 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/label/label.tsx +21 -0
- package/src/components/section/index.ts +1 -0
- package/src/components/section/section.tsx +39 -0
- package/src/components/segmented-control/index.ts +6 -0
- package/src/components/segmented-control/segmented-control.tsx +79 -0
- package/src/components/select/index.ts +1 -0
- package/src/components/select/select.tsx +133 -0
- package/src/components/separator/index.ts +1 -0
- package/src/components/separator/separator.tsx +29 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skeleton/skeleton.tsx +20 -0
- package/src/components/spinner/index.ts +2 -0
- package/src/components/spinner/spinner.styles.ts +19 -0
- package/src/components/spinner/spinner.tsx +42 -0
- package/src/components/stack/index.ts +1 -0
- package/src/components/stack/stack.tsx +62 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/switch/switch.tsx +48 -0
- package/src/components/table/index.ts +10 -0
- package/src/components/table/table.tsx +90 -0
- package/src/components/tabs/index.ts +1 -0
- package/src/components/tabs/tabs.tsx +92 -0
- package/src/components/text/index.ts +2 -0
- package/src/components/text/text.styles.ts +32 -0
- package/src/components/text/text.tsx +17 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.tsx +27 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/tooltip/tooltip.tsx +42 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use-component-config.ts +42 -0
- package/src/hooks/use-controllable-state.ts +27 -0
- package/src/hooks/use-media-query.ts +14 -0
- package/src/hooks/use-scrolled.ts +14 -0
- package/src/index.ts +52 -0
- package/src/internal/icons.tsx +99 -0
- package/src/patterns/app-shell/app-shell-context.ts +27 -0
- package/src/patterns/app-shell/app-shell.styles.ts +127 -0
- package/src/patterns/app-shell/app-shell.tsx +81 -0
- package/src/patterns/app-shell/index.ts +16 -0
- package/src/patterns/app-shell/navbar.tsx +119 -0
- package/src/patterns/app-shell/page-header.tsx +30 -0
- package/src/patterns/app-shell/sidebar.tsx +163 -0
- package/src/patterns/async/async.tsx +83 -0
- package/src/patterns/async/index.ts +10 -0
- package/src/patterns/async/states.tsx +128 -0
- package/src/patterns/data-table/data-table.tsx +367 -0
- package/src/patterns/data-table/index.ts +2 -0
- package/src/patterns/form/form.tsx +150 -0
- package/src/patterns/form/index.ts +13 -0
- package/src/provider/color-mode.tsx +133 -0
- package/src/provider/glyph-context.ts +42 -0
- package/src/provider/glyph-provider.tsx +41 -0
- package/src/provider/index.ts +18 -0
- package/src/provider/theme-scope.tsx +36 -0
- package/src/provider/theme-style.tsx +19 -0
- package/src/register.ts +69 -0
- package/src/themes.ts +56 -0
- package/src/utils/cn.ts +12 -0
- package/src/utils/compose-refs.ts +11 -0
- package/src/utils/registry.ts +9 -0
- package/src/utils/styles.ts +13 -0
- package/src/utils/tv.ts +7 -0
- package/src/utils/tw-merge-config.ts +14 -0
- package/styles.css +178 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { t as VariantProps } from "./tv-DuMh7UH2.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/components/button/button.styles.d.ts
|
|
4
|
+
declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
5
|
+
variant: {
|
|
6
|
+
primary: {
|
|
7
|
+
base: string;
|
|
8
|
+
};
|
|
9
|
+
secondary: {
|
|
10
|
+
base: string;
|
|
11
|
+
};
|
|
12
|
+
outline: {
|
|
13
|
+
base: string;
|
|
14
|
+
};
|
|
15
|
+
ghost: {
|
|
16
|
+
base: string;
|
|
17
|
+
};
|
|
18
|
+
danger: {
|
|
19
|
+
base: string;
|
|
20
|
+
};
|
|
21
|
+
link: {
|
|
22
|
+
base: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
sm: {
|
|
27
|
+
base: string;
|
|
28
|
+
icon: string;
|
|
29
|
+
};
|
|
30
|
+
md: {
|
|
31
|
+
base: string;
|
|
32
|
+
};
|
|
33
|
+
lg: {
|
|
34
|
+
base: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
iconOnly: {
|
|
39
|
+
true: {
|
|
40
|
+
base: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
fullWidth: {
|
|
44
|
+
true: {
|
|
45
|
+
base: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
base: string[];
|
|
50
|
+
icon: string;
|
|
51
|
+
}, undefined, {
|
|
52
|
+
variant: {
|
|
53
|
+
primary: {
|
|
54
|
+
base: string;
|
|
55
|
+
};
|
|
56
|
+
secondary: {
|
|
57
|
+
base: string;
|
|
58
|
+
};
|
|
59
|
+
outline: {
|
|
60
|
+
base: string;
|
|
61
|
+
};
|
|
62
|
+
ghost: {
|
|
63
|
+
base: string;
|
|
64
|
+
};
|
|
65
|
+
danger: {
|
|
66
|
+
base: string;
|
|
67
|
+
};
|
|
68
|
+
link: {
|
|
69
|
+
base: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
size: {
|
|
73
|
+
sm: {
|
|
74
|
+
base: string;
|
|
75
|
+
icon: string;
|
|
76
|
+
};
|
|
77
|
+
md: {
|
|
78
|
+
base: string;
|
|
79
|
+
};
|
|
80
|
+
lg: {
|
|
81
|
+
base: string;
|
|
82
|
+
icon: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
iconOnly: {
|
|
86
|
+
true: {
|
|
87
|
+
base: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
fullWidth: {
|
|
91
|
+
true: {
|
|
92
|
+
base: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}, {
|
|
96
|
+
base: string[];
|
|
97
|
+
icon: string;
|
|
98
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
99
|
+
variant: {
|
|
100
|
+
primary: {
|
|
101
|
+
base: string;
|
|
102
|
+
};
|
|
103
|
+
secondary: {
|
|
104
|
+
base: string;
|
|
105
|
+
};
|
|
106
|
+
outline: {
|
|
107
|
+
base: string;
|
|
108
|
+
};
|
|
109
|
+
ghost: {
|
|
110
|
+
base: string;
|
|
111
|
+
};
|
|
112
|
+
danger: {
|
|
113
|
+
base: string;
|
|
114
|
+
};
|
|
115
|
+
link: {
|
|
116
|
+
base: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
size: {
|
|
120
|
+
sm: {
|
|
121
|
+
base: string;
|
|
122
|
+
icon: string;
|
|
123
|
+
};
|
|
124
|
+
md: {
|
|
125
|
+
base: string;
|
|
126
|
+
};
|
|
127
|
+
lg: {
|
|
128
|
+
base: string;
|
|
129
|
+
icon: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
iconOnly: {
|
|
133
|
+
true: {
|
|
134
|
+
base: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
fullWidth: {
|
|
138
|
+
true: {
|
|
139
|
+
base: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
}, {
|
|
143
|
+
base: string[];
|
|
144
|
+
icon: string;
|
|
145
|
+
}>>;
|
|
146
|
+
type ButtonVariants = VariantProps<typeof buttonStyles>;
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/components/field/field.styles.d.ts
|
|
149
|
+
declare const fieldStyles: import("tailwind-variants").TVReturnType<{
|
|
150
|
+
orientation: {
|
|
151
|
+
vertical: {};
|
|
152
|
+
horizontal: {
|
|
153
|
+
root: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
}, {
|
|
157
|
+
root: string;
|
|
158
|
+
label: string;
|
|
159
|
+
required: string;
|
|
160
|
+
text: string;
|
|
161
|
+
description: string;
|
|
162
|
+
error: string;
|
|
163
|
+
}, undefined, {
|
|
164
|
+
orientation: {
|
|
165
|
+
vertical: {};
|
|
166
|
+
horizontal: {
|
|
167
|
+
root: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
}, {
|
|
171
|
+
root: string;
|
|
172
|
+
label: string;
|
|
173
|
+
required: string;
|
|
174
|
+
text: string;
|
|
175
|
+
description: string;
|
|
176
|
+
error: string;
|
|
177
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
178
|
+
orientation: {
|
|
179
|
+
vertical: {};
|
|
180
|
+
horizontal: {
|
|
181
|
+
root: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}, {
|
|
185
|
+
root: string;
|
|
186
|
+
label: string;
|
|
187
|
+
required: string;
|
|
188
|
+
text: string;
|
|
189
|
+
description: string;
|
|
190
|
+
error: string;
|
|
191
|
+
}>>;
|
|
192
|
+
type FieldVariants = VariantProps<typeof fieldStyles>;
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/components/button/button.d.ts
|
|
195
|
+
interface ButtonProps extends ComponentProps<'button'>, ButtonVariants {
|
|
196
|
+
/** Render the child element (e.g. a router link) with button styles instead of a `<button>`. */
|
|
197
|
+
asChild?: boolean;
|
|
198
|
+
/** Shows a spinner, disables the button and sets `aria-busy`. */
|
|
199
|
+
loading?: boolean;
|
|
200
|
+
leftIcon?: ReactNode;
|
|
201
|
+
rightIcon?: ReactNode;
|
|
202
|
+
}
|
|
203
|
+
declare function Button(inProps: ButtonProps): import("react").JSX.Element;
|
|
204
|
+
interface IconButtonProps extends Omit<ButtonProps, 'leftIcon' | 'rightIcon' | 'iconOnly' | 'fullWidth' | 'children'> {
|
|
205
|
+
icon: ReactNode;
|
|
206
|
+
/** Required: an icon-only button has no visible text. */
|
|
207
|
+
'aria-label': string;
|
|
208
|
+
}
|
|
209
|
+
/** A square button holding one icon. Shares Button's variants and theme overrides. */
|
|
210
|
+
declare function IconButton({ icon, variant, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/components/field/field.d.ts
|
|
213
|
+
interface FieldProps extends Omit<ComponentProps<'div'>, 'children'>, FieldVariants {
|
|
214
|
+
label?: ReactNode;
|
|
215
|
+
description?: ReactNode;
|
|
216
|
+
/** Error message. Marks the control invalid and is announced to screen readers. */
|
|
217
|
+
error?: ReactNode;
|
|
218
|
+
required?: boolean;
|
|
219
|
+
disabled?: boolean;
|
|
220
|
+
/** Id for the control. Generated when omitted. */
|
|
221
|
+
controlId?: string;
|
|
222
|
+
children: ReactNode;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Wraps one form control with its label, description and error, and wires the ARIA
|
|
226
|
+
* attributes between them. Controls inside (Input, Select, Checkbox, ...) pick this up.
|
|
227
|
+
*
|
|
228
|
+
* `orientation="horizontal"` puts the control first with text beside it, for checkboxes
|
|
229
|
+
* and switches.
|
|
230
|
+
*/
|
|
231
|
+
declare function Field(inProps: FieldProps): import("react").JSX.Element;
|
|
232
|
+
//#endregion
|
|
233
|
+
export { IconButton as a, fieldStyles as c, ButtonProps as i, ButtonVariants as l, FieldProps as n, IconButtonProps as o, Button as r, FieldVariants as s, Field as t, buttonStyles as u };
|