@turystack/ui 0.0.17 → 0.0.19

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/index.d.ts CHANGED
@@ -1,23 +1,152 @@
1
- import { default as default_2 } from 'react';
1
+ import { Context } from 'react';
2
2
  import { JSX } from 'react/jsx-runtime';
3
3
  import { PropsWithChildren } from 'react';
4
+ import { TVReturnType } from 'tailwind-variants';
4
5
 
5
- declare type ComponentClassNameSlots<T extends string> = Partial<Record<T, string>>;
6
+ export declare const Accordion: typeof Root & {
7
+ Content: typeof Content;
8
+ Item: typeof Item;
9
+ Trigger: typeof Trigger;
10
+ };
6
11
 
7
- export declare type ComponentConfig<T extends object, S extends string> = {
8
- classNames?: ComponentClassNameSlots<S>;
9
- defaultProps?: ComponentDefaultProps<T>;
12
+ export declare type AccordionContent = {};
13
+
14
+ export declare type AccordionContentSlots = 'root' | 'inner';
15
+
16
+ export declare type AccordionItem = {
17
+ value: string;
18
+ disabled?: boolean;
10
19
  };
11
20
 
12
- declare type ComponentDefaultProps<T extends object> = Partial<T>;
21
+ export declare type AccordionItemSlots = 'root';
22
+
23
+ export declare type AccordionProps = (BaseAccordionProps & SingleAccordionProps) | (BaseAccordionProps & MultipleAccordionProps);
24
+
25
+ export declare type AccordionSlots = 'root';
26
+
27
+ export declare type AccordionTrigger = {};
28
+
29
+ export declare type AccordionTriggerSlots = 'header' | 'root' | 'icon';
30
+
31
+ export declare type AccordionType = 'single' | 'multiple';
32
+
33
+ declare function Action({ children }: PropsWithChildren<AlertActionProps>): JSX.Element;
34
+
35
+ export declare const Alert: typeof Root_2 & {
36
+ Action: typeof Action;
37
+ Description: typeof Description;
38
+ Icon: typeof Icon;
39
+ Title: typeof Title;
40
+ };
41
+
42
+ export declare type AlertActionProps = {};
43
+
44
+ export declare type AlertActionSlots = 'root';
45
+
46
+ export declare type AlertDescriptionProps = {};
47
+
48
+ export declare type AlertDescriptionSlots = 'root';
49
+
50
+ export declare type AlertIconProps = {};
51
+
52
+ export declare type AlertIconSlots = 'root';
53
+
54
+ export declare type AlertProps = {
55
+ variant?: AlertVariant;
56
+ };
57
+
58
+ export declare type AlertSlots = 'root';
59
+
60
+ export declare type AlertTitleProps = {};
61
+
62
+ export declare type AlertTitleSlots = 'root';
63
+
64
+ export declare type AlertVariant = 'default' | 'destructive';
65
+
66
+ export declare function Avatar({ src, alt, size, variant, children, }: PropsWithChildren<AvatarProps>): JSX.Element;
67
+
68
+ export declare type AvatarProps = {
69
+ src?: string | null;
70
+ alt?: string;
71
+ size?: AvatarSize;
72
+ variant?: AvatarVariant;
73
+ };
74
+
75
+ export declare type AvatarSize = 'sm' | 'md' | 'lg';
76
+
77
+ export declare type AvatarSlots = 'root' | 'image' | 'fallback';
78
+
79
+ export declare type AvatarVariant = 'circle' | 'square';
80
+
81
+ export declare function Badge({ variant, align, block, loading, asChild, onClick, children, }: PropsWithChildren<BadgeProps>): JSX.Element;
82
+
83
+ export declare type BadgeAlign = 'start' | 'center' | 'end';
84
+
85
+ export declare type BadgeProps = {
86
+ variant?: BadgeVariant;
87
+ align?: BadgeAlign;
88
+ block?: boolean;
89
+ loading?: boolean;
90
+ asChild?: boolean;
91
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
92
+ };
93
+
94
+ export declare type BadgeSlots = 'root';
95
+
96
+ export declare type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
97
+
98
+ declare type BaseAccordionProps = {
99
+ type: AccordionType;
100
+ bordered?: boolean;
101
+ };
102
+
103
+ export declare const Breadcrumb: typeof Root_3 & {
104
+ Ellipsis: typeof Ellipsis;
105
+ Item: typeof Item_2;
106
+ Link: typeof Link;
107
+ List: typeof List;
108
+ Page: typeof Page;
109
+ Separator: typeof Separator;
110
+ };
111
+
112
+ export declare type BreadcrumbEllipsisProps = {};
113
+
114
+ export declare type BreadcrumbEllipsisSlots = 'root' | 'icon';
115
+
116
+ export declare type BreadcrumbItemProps = {};
117
+
118
+ export declare type BreadcrumbItemSlots = 'root';
119
+
120
+ export declare type BreadcrumbLinkProps = {
121
+ asChild?: boolean;
122
+ href?: string;
123
+ };
13
124
 
14
- export declare function TButton(props: PropsWithChildren<TButtonProps>): JSX.Element;
125
+ export declare type BreadcrumbLinkSlots = 'root';
15
126
 
16
- export declare type TButtonProps = {
127
+ export declare type BreadcrumbListProps = {};
128
+
129
+ export declare type BreadcrumbListSlots = 'root';
130
+
131
+ export declare type BreadcrumbPageProps = {};
132
+
133
+ export declare type BreadcrumbPageSlots = 'root';
134
+
135
+ export declare type BreadcrumbProps = {};
136
+
137
+ export declare type BreadcrumbSeparatorProps = {};
138
+
139
+ export declare type BreadcrumbSeparatorSlots = 'root';
140
+
141
+ export declare type BreadcrumbSlots = 'root';
142
+
143
+ export declare function Button(props: PropsWithChildren<ButtonProps>): JSX.Element;
144
+
145
+ export declare type ButtonProps = {
17
146
  form?: string;
18
- type?: TButtonType;
19
- size?: TButtonSize;
20
- variant?: TButtonVariant;
147
+ type?: ButtonType;
148
+ size?: ButtonSize;
149
+ variant?: ButtonVariant;
21
150
  leftSection?: React.ReactNode;
22
151
  rightSection?: React.ReactNode;
23
152
  block?: boolean;
@@ -27,33 +156,192 @@ export declare type TButtonProps = {
27
156
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
28
157
  };
29
158
 
30
- export declare type TButtonSize = 'sm' | 'md' | 'lg' | 'icon-sm' | 'icon-md' | 'icon-lg';
159
+ export declare type ButtonSize = 'sm' | 'md' | 'lg' | 'icon-sm' | 'icon-md' | 'icon-lg';
160
+
161
+ export declare type ButtonSlots = 'root' | 'loading' | 'leftSection' | 'rightSection';
162
+
163
+ export declare type ButtonType = 'button' | 'submit' | 'reset';
164
+
165
+ export declare type ButtonVariant = 'default' | 'destructive' | 'outline' | 'dashed' | 'secondary' | 'ghost' | 'link';
166
+
167
+ export declare type ColorScheme = 'light' | 'dark' | 'system';
168
+
169
+ export declare const ColorSchemeContext: Context<ColorSchemeContextValue | null>;
31
170
 
32
- export declare type TButtonSlots = 'root' | 'loading' | 'leftSection' | 'rightSection';
171
+ export declare type ColorSchemeContextValue = {
172
+ colorScheme: ColorScheme;
173
+ changeColorScheme: (colorScheme: ColorScheme) => void;
174
+ };
33
175
 
34
- export declare type TButtonType = 'button' | 'submit' | 'reset';
176
+ export declare function ColorSchemeProvider({ defaultColorScheme, children }: PropsWithChildren<ColorSchemeProviderProps>): JSX.Element;
35
177
 
36
- export declare type TButtonVariant = 'default' | 'destructive' | 'outline' | 'dashed' | 'secondary' | 'ghost' | 'link';
178
+ declare type ColorSchemeProviderProps = {
179
+ defaultColorScheme?: ColorScheme;
180
+ };
37
181
 
38
- export declare function TLoader({ size }: TLoaderProps): JSX.Element;
182
+ declare type ComponentClassNameSlots<T extends string> = Partial<Record<T, string>>;
39
183
 
40
- export declare type TLoaderProps = {
41
- size?: TLoaderSize;
184
+ export declare type ComponentConfig<T extends object, S extends string> = {
185
+ classNames?: ComponentClassNameSlots<S>;
186
+ defaultProps?: ComponentDefaultProps<T>;
42
187
  };
43
188
 
44
- export declare type TLoaderSize = 'sm' | 'md' | 'lg';
189
+ declare type ComponentDefaultProps<T extends object> = Partial<T>;
190
+
191
+ declare function Content({ children }: PropsWithChildren<AccordionContent>): JSX.Element;
192
+
193
+ declare function Description({ children }: PropsWithChildren<AlertDescriptionProps>): JSX.Element;
194
+
195
+ declare function Ellipsis(_props: BreadcrumbEllipsisProps): JSX.Element;
196
+
197
+ declare function Icon({ children }: PropsWithChildren<AlertIconProps>): JSX.Element;
198
+
199
+ declare function Item({ value, disabled, children }: PropsWithChildren<AccordionItem>): JSX.Element;
200
+
201
+ declare function Item_2({ children }: PropsWithChildren<BreadcrumbItemProps>): JSX.Element;
202
+
203
+ declare function Link({ asChild, href, children, }: PropsWithChildren<BreadcrumbLinkProps>): JSX.Element;
45
204
 
46
- export declare type TLoaderSlots = 'root';
205
+ declare function List({ children }: PropsWithChildren<BreadcrumbListProps>): JSX.Element;
47
206
 
48
- export declare function TuryStackProvider({ children, ...props }: TuryStackProviderProps & {
49
- children: default_2.ReactNode;
50
- }): JSX.Element;
207
+ export declare function Loader({ size }: LoaderProps): JSX.Element;
208
+
209
+ export declare type LoaderProps = {
210
+ size?: LoaderSize;
211
+ };
212
+
213
+ export declare type LoaderSize = 'sm' | 'md' | 'lg';
214
+
215
+ export declare type LoaderSlots = 'root';
216
+
217
+ declare type MultipleAccordionProps = {
218
+ type: 'multiple';
219
+ value?: string[];
220
+ defaultValue?: string[];
221
+ onChange?: (value: string[]) => void;
222
+ };
223
+
224
+ declare function Page({ children }: PropsWithChildren<BreadcrumbPageProps>): JSX.Element;
225
+
226
+ declare function Root({ children, onChange, ...props }: PropsWithChildren<AccordionProps>): JSX.Element;
227
+
228
+ declare function Root_2({ variant, children }: PropsWithChildren<AlertProps>): JSX.Element;
229
+
230
+ declare function Root_3({ children }: PropsWithChildren<BreadcrumbProps>): JSX.Element;
231
+
232
+ declare function Separator({ children }: PropsWithChildren<BreadcrumbSeparatorProps>): JSX.Element;
233
+
234
+ declare type SingleAccordionProps = {
235
+ type: 'single';
236
+ value?: string;
237
+ defaultValue?: string;
238
+ collapsible?: boolean;
239
+ onChange?: (value: string) => void;
240
+ };
241
+
242
+ export declare const styles: TVReturnType< {
243
+ block: {
244
+ true: string;
245
+ };
246
+ size: {
247
+ 'icon-lg': string;
248
+ 'icon-md': string;
249
+ 'icon-sm': string;
250
+ lg: string;
251
+ md: string;
252
+ sm: string;
253
+ };
254
+ variant: {
255
+ dashed: string;
256
+ default: string;
257
+ destructive: string;
258
+ ghost: string;
259
+ link: string;
260
+ outline: string;
261
+ secondary: string;
262
+ };
263
+ }, undefined, "t:inline-flex t:items-center t:justify-center t:gap-2 t:whitespace-nowrap t:rounded-md t:font-medium t:text-sm t:ring-offset-background t:transition-colors t:focus-visible:outline-none t:focus-visible:ring-2 t:focus-visible:ring-ring t:focus-visible:ring-offset-2 t:disabled:pointer-events-none t:disabled:opacity-50 t:[&_svg]:pointer-events-none t:[&_svg]:size-4 t:[&_svg]:shrink-0", {
264
+ block: {
265
+ true: string;
266
+ };
267
+ size: {
268
+ 'icon-lg': string;
269
+ 'icon-md': string;
270
+ 'icon-sm': string;
271
+ lg: string;
272
+ md: string;
273
+ sm: string;
274
+ };
275
+ variant: {
276
+ dashed: string;
277
+ default: string;
278
+ destructive: string;
279
+ ghost: string;
280
+ link: string;
281
+ outline: string;
282
+ secondary: string;
283
+ };
284
+ }, undefined, TVReturnType< {
285
+ block: {
286
+ true: string;
287
+ };
288
+ size: {
289
+ 'icon-lg': string;
290
+ 'icon-md': string;
291
+ 'icon-sm': string;
292
+ lg: string;
293
+ md: string;
294
+ sm: string;
295
+ };
296
+ variant: {
297
+ dashed: string;
298
+ default: string;
299
+ destructive: string;
300
+ ghost: string;
301
+ link: string;
302
+ outline: string;
303
+ secondary: string;
304
+ };
305
+ }, undefined, "t:inline-flex t:items-center t:justify-center t:gap-2 t:whitespace-nowrap t:rounded-md t:font-medium t:text-sm t:ring-offset-background t:transition-colors t:focus-visible:outline-none t:focus-visible:ring-2 t:focus-visible:ring-ring t:focus-visible:ring-offset-2 t:disabled:pointer-events-none t:disabled:opacity-50 t:[&_svg]:pointer-events-none t:[&_svg]:size-4 t:[&_svg]:shrink-0", unknown, unknown, undefined>>;
306
+
307
+ declare function Title({ children }: PropsWithChildren<AlertTitleProps>): JSX.Element;
308
+
309
+ declare function Trigger({ children }: PropsWithChildren<AccordionTrigger>): JSX.Element;
310
+
311
+ export declare function TuryStackProvider({ children, defaultColorScheme, ...props }: PropsWithChildren<TuryStackProviderProps>): JSX.Element;
51
312
 
52
313
  export declare type TuryStackProviderProps = {
314
+ defaultColorScheme?: ColorScheme;
53
315
  components?: {
54
- button?: ComponentConfig<TButtonProps, TButtonSlots>;
55
- loader?: ComponentConfig<TLoaderProps, TLoaderSlots>;
316
+ accordion?: {
317
+ default?: ComponentConfig<AccordionProps, AccordionSlots>;
318
+ item?: ComponentConfig<AccordionItem, AccordionItemSlots>;
319
+ trigger?: ComponentConfig<AccordionTrigger, AccordionTriggerSlots>;
320
+ content?: ComponentConfig<AccordionContent, AccordionContentSlots>;
321
+ };
322
+ alert?: {
323
+ default?: ComponentConfig<AlertProps, AlertSlots>;
324
+ icon?: ComponentConfig<AlertIconProps, AlertIconSlots>;
325
+ title?: ComponentConfig<AlertTitleProps, AlertTitleSlots>;
326
+ description?: ComponentConfig<AlertDescriptionProps, AlertDescriptionSlots>;
327
+ action?: ComponentConfig<AlertActionProps, AlertActionSlots>;
328
+ };
329
+ avatar?: ComponentConfig<AvatarProps, AvatarSlots>;
330
+ badge?: ComponentConfig<BadgeProps, BadgeSlots>;
331
+ breadcrumb?: {
332
+ default?: ComponentConfig<BreadcrumbProps, BreadcrumbSlots>;
333
+ list?: ComponentConfig<BreadcrumbListProps, BreadcrumbListSlots>;
334
+ item?: ComponentConfig<BreadcrumbItemProps, BreadcrumbItemSlots>;
335
+ link?: ComponentConfig<BreadcrumbLinkProps, BreadcrumbLinkSlots>;
336
+ page?: ComponentConfig<BreadcrumbPageProps, BreadcrumbPageSlots>;
337
+ separator?: ComponentConfig<BreadcrumbSeparatorProps, BreadcrumbSeparatorSlots>;
338
+ ellipsis?: ComponentConfig<BreadcrumbEllipsisProps, BreadcrumbEllipsisSlots>;
339
+ };
340
+ button?: ComponentConfig<ButtonProps, ButtonSlots>;
341
+ loader?: ComponentConfig<LoaderProps, LoaderSlots>;
56
342
  };
57
343
  };
58
344
 
345
+ export declare const useColorScheme: () => ColorSchemeContextValue;
346
+
59
347
  export { }