@bubble-design-system/ui 0.2.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.
@@ -0,0 +1,355 @@
1
+ import { ClassValue } from 'clsx';
2
+ import * as react from 'react';
3
+ import { ComponentPropsWithoutRef, ReactNode, HTMLAttributes, TextareaHTMLAttributes } from 'react';
4
+ import { Button as Button$1 } from '@base-ui/react/button';
5
+ import { Input as Input$1 } from '@base-ui/react/input';
6
+ import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
7
+ import { Radio as Radio$1 } from '@base-ui/react/radio';
8
+ import { RadioGroup as RadioGroup$1 } from '@base-ui/react/radio-group';
9
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
10
+ import { Select as Select$1 } from '@base-ui/react/select';
11
+ import { Avatar as Avatar$1 } from '@base-ui/react/avatar';
12
+ import { Separator } from '@base-ui/react/separator';
13
+ import * as _base_ui_react from '@base-ui/react';
14
+ import { Dialog } from '@base-ui/react/dialog';
15
+ import * as react_jsx_runtime from 'react/jsx-runtime';
16
+ import { Toast as Toast$1 } from '@base-ui/react/toast';
17
+ import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
18
+ import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
19
+ import { Menu } from '@base-ui/react/menu';
20
+ import { Toggle } from '@base-ui/react/toggle';
21
+ import { ToggleGroup } from '@base-ui/react/toggle-group';
22
+
23
+ /**
24
+ * Conditionally joins CSS class names.
25
+ *
26
+ * Example:
27
+ * cn("pds-btn", "pds-btn--primary", isActive && "pds-btn--active", className)
28
+ */
29
+ declare function cn(...inputs: ClassValue[]): string;
30
+
31
+ type ButtonVariant = "primary" | "secondary" | "destructive" | "ghost";
32
+ type ButtonSize = "sm" | "md" | "lg";
33
+ type BaseButtonProps = ComponentPropsWithoutRef<typeof Button$1>;
34
+ interface ButtonProps extends Omit<BaseButtonProps, "className"> {
35
+ variant?: ButtonVariant;
36
+ size?: ButtonSize;
37
+ className?: string;
38
+ }
39
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLElement>>;
40
+
41
+ type InputSize = "sm" | "md" | "lg";
42
+ type BaseInputProps = ComponentPropsWithoutRef<typeof Input$1>;
43
+ interface InputProps extends Omit<BaseInputProps, "className" | "size"> {
44
+ size?: InputSize;
45
+ invalid?: boolean;
46
+ className?: string;
47
+ }
48
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
49
+
50
+ type CheckboxSize = "sm" | "md" | "lg";
51
+ type BaseCheckboxRootProps = ComponentPropsWithoutRef<typeof Checkbox$1.Root>;
52
+ interface CheckboxProps extends Omit<BaseCheckboxRootProps, "className" | "render"> {
53
+ size?: CheckboxSize;
54
+ className?: string;
55
+ }
56
+ declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLButtonElement>>;
57
+
58
+ type RadioSize = "sm" | "md" | "lg";
59
+ type BaseRadioRootProps = ComponentPropsWithoutRef<typeof Radio$1.Root>;
60
+ type BaseRadioGroupProps = ComponentPropsWithoutRef<typeof RadioGroup$1>;
61
+ interface RadioProps extends Omit<BaseRadioRootProps, "className" | "render"> {
62
+ size?: RadioSize;
63
+ className?: string;
64
+ }
65
+ declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLButtonElement>>;
66
+ interface RadioGroupProps extends Omit<BaseRadioGroupProps, "className"> {
67
+ className?: string;
68
+ }
69
+ declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>>;
70
+
71
+ type SwitchSize = "sm" | "md" | "lg";
72
+ type BaseSwitchRootProps = ComponentPropsWithoutRef<typeof Switch$1.Root>;
73
+ interface SwitchProps extends Omit<BaseSwitchRootProps, "className" | "render"> {
74
+ size?: SwitchSize;
75
+ className?: string;
76
+ }
77
+ declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
78
+
79
+ type SelectSize = "sm" | "md" | "lg";
80
+ type BaseTriggerProps = ComponentPropsWithoutRef<typeof Select$1.Trigger>;
81
+ type BasePopupProps$2 = ComponentPropsWithoutRef<typeof Select$1.Popup>;
82
+ type BaseItemProps = ComponentPropsWithoutRef<typeof Select$1.Item>;
83
+ type BaseValueProps = ComponentPropsWithoutRef<typeof Select$1.Value>;
84
+ interface SelectTriggerProps extends Omit<BaseTriggerProps, "className" | "render"> {
85
+ size?: SelectSize;
86
+ className?: string;
87
+ }
88
+ interface SelectValueProps extends Omit<BaseValueProps, "className"> {
89
+ placeholder?: ReactNode;
90
+ className?: string;
91
+ }
92
+ interface SelectContentProps extends Omit<BasePopupProps$2, "className" | "render"> {
93
+ className?: string;
94
+ sideOffset?: number;
95
+ }
96
+ interface SelectItemProps extends Omit<BaseItemProps, "className" | "render"> {
97
+ className?: string;
98
+ }
99
+ declare const Select: {
100
+ Root: typeof Select$1.Root;
101
+ Trigger: react.ForwardRefExoticComponent<SelectTriggerProps & react.RefAttributes<HTMLButtonElement>>;
102
+ Value: react.ForwardRefExoticComponent<SelectValueProps & react.RefAttributes<HTMLSpanElement>>;
103
+ Content: react.ForwardRefExoticComponent<SelectContentProps & react.RefAttributes<HTMLDivElement>>;
104
+ Item: react.ForwardRefExoticComponent<SelectItemProps & react.RefAttributes<HTMLDivElement>>;
105
+ };
106
+
107
+ type BadgeVariant = "neutral" | "brand" | "success" | "warning" | "danger";
108
+ type BadgeSize = "sm" | "md" | "lg";
109
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
110
+ variant?: BadgeVariant;
111
+ size?: BadgeSize;
112
+ }
113
+ declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
114
+
115
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
116
+ type BaseRootProps = ComponentPropsWithoutRef<typeof Avatar$1.Root>;
117
+ type BaseImageProps = ComponentPropsWithoutRef<typeof Avatar$1.Image>;
118
+ type BaseFallbackProps = ComponentPropsWithoutRef<typeof Avatar$1.Fallback>;
119
+ interface AvatarProps extends Omit<BaseRootProps, "className" | "render"> {
120
+ size?: AvatarSize;
121
+ className?: string;
122
+ }
123
+ interface AvatarImageProps extends Omit<BaseImageProps, "className" | "render"> {
124
+ className?: string;
125
+ }
126
+ interface AvatarFallbackProps extends Omit<BaseFallbackProps, "className" | "render"> {
127
+ className?: string;
128
+ }
129
+ declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLSpanElement>> & {
130
+ Image: react.ForwardRefExoticComponent<AvatarImageProps & react.RefAttributes<HTMLImageElement>>;
131
+ Fallback: react.ForwardRefExoticComponent<AvatarFallbackProps & react.RefAttributes<HTMLSpanElement>>;
132
+ };
133
+
134
+ type BaseSeparatorProps = ComponentPropsWithoutRef<typeof Separator>;
135
+ interface DividerProps extends Omit<BaseSeparatorProps, "className" | "render"> {
136
+ className?: string;
137
+ }
138
+ declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
139
+
140
+ type BasePopupProps$1 = ComponentPropsWithoutRef<typeof Dialog.Popup>;
141
+ type BaseTitleProps = ComponentPropsWithoutRef<typeof Dialog.Title>;
142
+ type BaseDescProps = ComponentPropsWithoutRef<typeof Dialog.Description>;
143
+ interface ModalContentProps extends Omit<BasePopupProps$1, "className" | "render"> {
144
+ className?: string;
145
+ backdropClassName?: string;
146
+ }
147
+ interface ModalTitleProps extends Omit<BaseTitleProps, "className" | "render"> {
148
+ className?: string;
149
+ }
150
+ interface ModalDescriptionProps extends Omit<BaseDescProps, "className" | "render"> {
151
+ className?: string;
152
+ }
153
+ declare const Modal: {
154
+ Root: typeof Dialog.Root;
155
+ Trigger: Dialog.Trigger;
156
+ Close: react.ForwardRefExoticComponent<Omit<_base_ui_react.AlertDialogCloseProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
157
+ Content: react.ForwardRefExoticComponent<ModalContentProps & react.RefAttributes<HTMLDivElement>>;
158
+ Title: react.ForwardRefExoticComponent<ModalTitleProps & react.RefAttributes<HTMLHeadingElement>>;
159
+ Description: react.ForwardRefExoticComponent<ModalDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
160
+ };
161
+
162
+ declare const useToastManager: typeof Toast$1.useToastManager;
163
+ type ProviderProps = ComponentPropsWithoutRef<typeof Toast$1.Provider>;
164
+ declare const Toast: {
165
+ Provider: {
166
+ ({ children, ...props }: ProviderProps): react_jsx_runtime.JSX.Element;
167
+ displayName: string;
168
+ };
169
+ Viewport: react.ForwardRefExoticComponent<Omit<Omit<Omit<_base_ui_react.ToastViewportProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
170
+ className?: string;
171
+ } & react.RefAttributes<HTMLDivElement>>;
172
+ Toaster: {
173
+ (): react_jsx_runtime.JSX.Element;
174
+ displayName: string;
175
+ };
176
+ };
177
+
178
+ type BasePopupProps = ComponentPropsWithoutRef<typeof Tooltip$1.Popup>;
179
+ interface TooltipContentProps extends Omit<BasePopupProps, "className" | "render"> {
180
+ className?: string;
181
+ sideOffset?: number;
182
+ side?: "top" | "bottom" | "left" | "right";
183
+ align?: "start" | "center" | "end";
184
+ }
185
+ declare const Tooltip: {
186
+ Provider: react.FC<_base_ui_react.TooltipProviderProps>;
187
+ Root: <Payload>(props: Tooltip$1.Root.Props<Payload>) => react_jsx_runtime.JSX.Element;
188
+ Trigger: Tooltip$1.Trigger;
189
+ Content: react.ForwardRefExoticComponent<TooltipContentProps & react.RefAttributes<HTMLDivElement>>;
190
+ };
191
+
192
+ type RootProps = ComponentPropsWithoutRef<typeof Tabs$1.Root>;
193
+ type ListProps = ComponentPropsWithoutRef<typeof Tabs$1.List>;
194
+ type TabProps = ComponentPropsWithoutRef<typeof Tabs$1.Tab>;
195
+ type PanelProps = ComponentPropsWithoutRef<typeof Tabs$1.Panel>;
196
+ interface TabsRootProps extends Omit<RootProps, "className" | "render"> {
197
+ className?: string;
198
+ }
199
+ interface TabsListProps extends Omit<ListProps, "className" | "render"> {
200
+ className?: string;
201
+ }
202
+ interface TabsTabProps extends Omit<TabProps, "className" | "render"> {
203
+ className?: string;
204
+ }
205
+ interface TabsPanelProps extends Omit<PanelProps, "className" | "render"> {
206
+ className?: string;
207
+ }
208
+ declare const Tabs: react.ForwardRefExoticComponent<TabsRootProps & react.RefAttributes<HTMLDivElement>> & {
209
+ List: react.ForwardRefExoticComponent<TabsListProps & react.RefAttributes<HTMLDivElement>>;
210
+ Tab: react.ForwardRefExoticComponent<TabsTabProps & react.RefAttributes<HTMLButtonElement>>;
211
+ Panel: react.ForwardRefExoticComponent<TabsPanelProps & react.RefAttributes<HTMLDivElement>>;
212
+ };
213
+
214
+ type AlertVariant = "info" | "success" | "warning" | "danger";
215
+ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
216
+ variant?: AlertVariant;
217
+ icon?: ReactNode | false;
218
+ title?: ReactNode;
219
+ }
220
+ declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
221
+
222
+ type PopupProps = ComponentPropsWithoutRef<typeof Menu.Popup>;
223
+ type ItemProps = ComponentPropsWithoutRef<typeof Menu.Item>;
224
+ type CheckboxItemProps = ComponentPropsWithoutRef<typeof Menu.CheckboxItem>;
225
+ type RadioItemProps = ComponentPropsWithoutRef<typeof Menu.RadioItem>;
226
+ type GroupLabelProps = ComponentPropsWithoutRef<typeof Menu.GroupLabel>;
227
+ type SeparatorProps = ComponentPropsWithoutRef<typeof Menu.Separator>;
228
+ interface DropdownMenuContentProps extends Omit<PopupProps, "className" | "render"> {
229
+ className?: string;
230
+ sideOffset?: number;
231
+ align?: "start" | "center" | "end";
232
+ }
233
+ interface DropdownMenuItemProps extends Omit<ItemProps, "className" | "render"> {
234
+ className?: string;
235
+ }
236
+ interface DropdownMenuCheckboxItemProps extends Omit<CheckboxItemProps, "className" | "render"> {
237
+ className?: string;
238
+ }
239
+ interface DropdownMenuRadioItemProps extends Omit<RadioItemProps, "className" | "render"> {
240
+ className?: string;
241
+ }
242
+ interface DropdownMenuLabelProps extends Omit<GroupLabelProps, "className" | "render"> {
243
+ className?: string;
244
+ }
245
+ interface DropdownMenuSeparatorProps extends Omit<SeparatorProps, "className" | "render"> {
246
+ className?: string;
247
+ }
248
+ declare const DropdownMenu: {
249
+ Root: <Payload>(props: Menu.Root.Props<Payload>) => react_jsx_runtime.JSX.Element;
250
+ Trigger: Menu.Trigger;
251
+ Content: react.ForwardRefExoticComponent<DropdownMenuContentProps & react.RefAttributes<HTMLDivElement>>;
252
+ Item: react.ForwardRefExoticComponent<DropdownMenuItemProps & react.RefAttributes<HTMLDivElement>>;
253
+ CheckboxItem: react.ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & react.RefAttributes<HTMLDivElement>>;
254
+ RadioGroup: react.NamedExoticComponent<Omit<_base_ui_react.ContextMenuRadioGroupProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
255
+ RadioItem: react.ForwardRefExoticComponent<DropdownMenuRadioItemProps & react.RefAttributes<HTMLDivElement>>;
256
+ Group: react.ForwardRefExoticComponent<Omit<_base_ui_react.ContextMenuGroupProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
257
+ Label: react.ForwardRefExoticComponent<DropdownMenuLabelProps & react.RefAttributes<HTMLDivElement>>;
258
+ Separator: react.ForwardRefExoticComponent<DropdownMenuSeparatorProps & react.RefAttributes<HTMLDivElement>>;
259
+ };
260
+
261
+ type SkeletonShape = "line" | "circle" | "block";
262
+ interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
263
+ shape?: SkeletonShape;
264
+ }
265
+ declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLDivElement>>;
266
+
267
+ type CardVariant = "elevated" | "muted";
268
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
269
+ variant?: CardVariant;
270
+ }
271
+ interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
272
+ }
273
+ interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
274
+ }
275
+ interface CardDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
276
+ }
277
+ interface CardActionProps extends HTMLAttributes<HTMLDivElement> {
278
+ }
279
+ interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
280
+ }
281
+ interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
282
+ }
283
+ declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>> & {
284
+ Header: react.ForwardRefExoticComponent<CardHeaderProps & react.RefAttributes<HTMLDivElement>>;
285
+ Title: react.ForwardRefExoticComponent<CardTitleProps & react.RefAttributes<HTMLHeadingElement>>;
286
+ Description: react.ForwardRefExoticComponent<CardDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
287
+ Action: react.ForwardRefExoticComponent<CardActionProps & react.RefAttributes<HTMLDivElement>>;
288
+ Body: react.ForwardRefExoticComponent<CardBodyProps & react.RefAttributes<HTMLDivElement>>;
289
+ Footer: react.ForwardRefExoticComponent<CardFooterProps & react.RefAttributes<HTMLDivElement>>;
290
+ };
291
+
292
+ type TextareaSize = "sm" | "md" | "lg";
293
+ interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> {
294
+ size?: TextareaSize;
295
+ invalid?: boolean;
296
+ }
297
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
298
+
299
+ type StatusPillIntent = "neutral" | "success" | "warning" | "danger" | "info";
300
+ interface StatusPillProps extends HTMLAttributes<HTMLSpanElement> {
301
+ intent?: StatusPillIntent;
302
+ }
303
+ interface StatusPillIndicatorProps extends HTMLAttributes<HTMLSpanElement> {
304
+ }
305
+ interface StatusPillLabelProps extends HTMLAttributes<HTMLSpanElement> {
306
+ }
307
+ declare const StatusPill: react.ForwardRefExoticComponent<StatusPillProps & react.RefAttributes<HTMLSpanElement>> & {
308
+ Indicator: react.ForwardRefExoticComponent<StatusPillIndicatorProps & react.RefAttributes<HTMLSpanElement>>;
309
+ Label: react.ForwardRefExoticComponent<StatusPillLabelProps & react.RefAttributes<HTMLSpanElement>>;
310
+ };
311
+
312
+ type SegmentedSize = "sm" | "md" | "lg";
313
+ type ToggleGroupProps = ComponentPropsWithoutRef<typeof ToggleGroup>;
314
+ interface SegmentedProps extends Omit<ToggleGroupProps, "className" | "value" | "defaultValue" | "onValueChange" | "multiple"> {
315
+ /** Selected item value. */
316
+ value?: string;
317
+ /** Uncontrolled initial selected item. */
318
+ defaultValue?: string;
319
+ /** Fired with the newly selected value. */
320
+ onValueChange?: (value: string) => void;
321
+ /** Controls item heights — sm 24px / md 28px / lg 32px. */
322
+ size?: SegmentedSize;
323
+ className?: string;
324
+ children?: ReactNode;
325
+ }
326
+ type ToggleItemProps = ComponentPropsWithoutRef<typeof Toggle>;
327
+ interface SegmentedItemProps extends Omit<ToggleItemProps, "className" | "value"> {
328
+ value: string;
329
+ className?: string;
330
+ }
331
+ declare const Segmented: react.ForwardRefExoticComponent<SegmentedProps & react.RefAttributes<HTMLDivElement>> & {
332
+ Item: react.ForwardRefExoticComponent<SegmentedItemProps & react.RefAttributes<HTMLButtonElement>>;
333
+ };
334
+
335
+ type ContainerSize = "sm" | "md" | "lg" | "xl" | "prose" | "fluid";
336
+ interface ContainerProps extends HTMLAttributes<HTMLDivElement> {
337
+ size?: ContainerSize;
338
+ }
339
+ declare const Container: react.ForwardRefExoticComponent<ContainerProps & react.RefAttributes<HTMLDivElement>>;
340
+ type GridGutter = "default" | "tight" | "flush";
341
+ interface GridRootProps extends HTMLAttributes<HTMLDivElement> {
342
+ gutter?: GridGutter;
343
+ }
344
+ type Span = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "full";
345
+ interface GridColProps extends HTMLAttributes<HTMLDivElement> {
346
+ span?: Span;
347
+ smSpan?: Span;
348
+ mdSpan?: Span;
349
+ lgSpan?: Span;
350
+ }
351
+ declare const Grid: react.ForwardRefExoticComponent<GridRootProps & react.RefAttributes<HTMLDivElement>> & {
352
+ Col: react.ForwardRefExoticComponent<GridColProps & react.RefAttributes<HTMLDivElement>>;
353
+ };
354
+
355
+ export { Alert, type AlertProps, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardActionProps, type CardBodyProps, type CardDescriptionProps, type CardFooterProps, type CardHeaderProps, type CardProps, type CardTitleProps, Checkbox, type CheckboxProps, Container, type ContainerProps, Divider, type DividerProps, DropdownMenu, type DropdownMenuCheckboxItemProps, type DropdownMenuContentProps, type DropdownMenuItemProps, type DropdownMenuLabelProps, type DropdownMenuRadioItemProps, type DropdownMenuSeparatorProps, Grid, type GridColProps, type GridRootProps, Input, type InputProps, Modal, type ModalContentProps, type ModalDescriptionProps, type ModalTitleProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Segmented, type SegmentedItemProps, type SegmentedProps, Select, type SelectContentProps, type SelectItemProps, type SelectTriggerProps, type SelectValueProps, Skeleton, type SkeletonProps, StatusPill, type StatusPillIndicatorProps, type StatusPillLabelProps, type StatusPillProps, Switch, type SwitchProps, Tabs, type TabsListProps, type TabsPanelProps, type TabsRootProps, type TabsTabProps, Textarea, type TextareaProps, Toast, Tooltip, type TooltipContentProps, cn, useToastManager as useToast };