@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.
package/dist/index.js ADDED
@@ -0,0 +1,951 @@
1
+ import { clsx } from 'clsx';
2
+ import { forwardRef, createContext, useContext, useMemo } from 'react';
3
+ import { Button as Button$1 } from '@base-ui/react/button';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
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 { Dialog } from '@base-ui/react/dialog';
14
+ import { Toast as Toast$1 } from '@base-ui/react/toast';
15
+ import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
16
+ import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
17
+ import { Menu } from '@base-ui/react/menu';
18
+ import { Toggle } from '@base-ui/react/toggle';
19
+ import { ToggleGroup } from '@base-ui/react/toggle-group';
20
+
21
+ // src/utils/cn.ts
22
+ function cn(...inputs) {
23
+ return clsx(inputs);
24
+ }
25
+ var Button = forwardRef(
26
+ ({ variant = "primary", size = "md", className, ...props }, ref) => {
27
+ return /* @__PURE__ */ jsx(
28
+ Button$1,
29
+ {
30
+ ref,
31
+ className: cn(
32
+ "pds-btn",
33
+ `pds-btn--${variant}`,
34
+ `pds-btn--${size}`,
35
+ className
36
+ ),
37
+ ...props
38
+ }
39
+ );
40
+ }
41
+ );
42
+ Button.displayName = "Button";
43
+ var Input = forwardRef(
44
+ ({ size = "md", invalid, className, ...props }, ref) => {
45
+ return /* @__PURE__ */ jsx(
46
+ Input$1,
47
+ {
48
+ ref,
49
+ "aria-invalid": invalid || void 0,
50
+ className: cn("pds-input", `pds-input--${size}`, className),
51
+ ...props
52
+ }
53
+ );
54
+ }
55
+ );
56
+ Input.displayName = "Input";
57
+ var Checkbox = forwardRef(
58
+ ({ size = "md", className, ...props }, ref) => {
59
+ return /* @__PURE__ */ jsx(
60
+ Checkbox$1.Root,
61
+ {
62
+ ref,
63
+ className: cn("pds-checkbox", `pds-checkbox--${size}`, className),
64
+ ...props,
65
+ children: /* @__PURE__ */ jsxs(Checkbox$1.Indicator, { className: "pds-checkbox__indicator", children: [
66
+ /* @__PURE__ */ jsx(
67
+ "svg",
68
+ {
69
+ viewBox: "0 0 16 16",
70
+ fill: "none",
71
+ className: "pds-checkbox__icon pds-checkbox__icon--check",
72
+ "aria-hidden": "true",
73
+ children: /* @__PURE__ */ jsx(
74
+ "path",
75
+ {
76
+ d: "M3.5 8.5l3 3 6-6.5",
77
+ stroke: "currentColor",
78
+ strokeWidth: "2",
79
+ strokeLinecap: "round",
80
+ strokeLinejoin: "round"
81
+ }
82
+ )
83
+ }
84
+ ),
85
+ /* @__PURE__ */ jsx(
86
+ "svg",
87
+ {
88
+ viewBox: "0 0 16 16",
89
+ fill: "none",
90
+ className: "pds-checkbox__icon pds-checkbox__icon--indeterminate",
91
+ "aria-hidden": "true",
92
+ children: /* @__PURE__ */ jsx(
93
+ "path",
94
+ {
95
+ d: "M3.5 8h9",
96
+ stroke: "currentColor",
97
+ strokeWidth: "2",
98
+ strokeLinecap: "round"
99
+ }
100
+ )
101
+ }
102
+ )
103
+ ] })
104
+ }
105
+ );
106
+ }
107
+ );
108
+ Checkbox.displayName = "Checkbox";
109
+ var Radio = forwardRef(
110
+ ({ size = "md", className, ...props }, ref) => {
111
+ return /* @__PURE__ */ jsx(
112
+ Radio$1.Root,
113
+ {
114
+ ref,
115
+ className: cn("pds-radio", `pds-radio--${size}`, className),
116
+ ...props,
117
+ children: /* @__PURE__ */ jsx(Radio$1.Indicator, { className: "pds-radio__indicator" })
118
+ }
119
+ );
120
+ }
121
+ );
122
+ Radio.displayName = "Radio";
123
+ var RadioGroup = forwardRef(
124
+ ({ className, ...props }, ref) => {
125
+ return /* @__PURE__ */ jsx(
126
+ RadioGroup$1,
127
+ {
128
+ ref,
129
+ className: cn("pds-radio-group", className),
130
+ ...props
131
+ }
132
+ );
133
+ }
134
+ );
135
+ RadioGroup.displayName = "RadioGroup";
136
+ var Switch = forwardRef(
137
+ ({ size = "md", className, ...props }, ref) => {
138
+ return /* @__PURE__ */ jsx(
139
+ Switch$1.Root,
140
+ {
141
+ ref,
142
+ className: cn("pds-switch", `pds-switch--${size}`, className),
143
+ ...props,
144
+ children: /* @__PURE__ */ jsx(Switch$1.Thumb, { className: "pds-switch__thumb" })
145
+ }
146
+ );
147
+ }
148
+ );
149
+ Switch.displayName = "Switch";
150
+ var SelectTrigger = forwardRef(
151
+ ({ size = "md", className, children, ...props }, ref) => {
152
+ return /* @__PURE__ */ jsxs(
153
+ Select$1.Trigger,
154
+ {
155
+ ref,
156
+ className: cn(
157
+ "pds-select-trigger",
158
+ `pds-select-trigger--${size}`,
159
+ className
160
+ ),
161
+ ...props,
162
+ children: [
163
+ children,
164
+ /* @__PURE__ */ jsx(Select$1.Icon, { className: "pds-select-icon", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
165
+ "path",
166
+ {
167
+ d: "M4 6l4 4 4-4",
168
+ stroke: "currentColor",
169
+ strokeWidth: "1.5",
170
+ strokeLinecap: "round",
171
+ strokeLinejoin: "round"
172
+ }
173
+ ) }) })
174
+ ]
175
+ }
176
+ );
177
+ }
178
+ );
179
+ SelectTrigger.displayName = "Select.Trigger";
180
+ var SelectValue = forwardRef(
181
+ ({ placeholder, className, children, ...props }, ref) => {
182
+ return /* @__PURE__ */ jsx(
183
+ Select$1.Value,
184
+ {
185
+ ref,
186
+ className: cn("pds-select-value", className),
187
+ ...props,
188
+ children: children ?? ((value) => value === null || value === void 0 || value === "" ? /* @__PURE__ */ jsx("span", { className: "pds-select-value-placeholder", children: placeholder }) : String(value))
189
+ }
190
+ );
191
+ }
192
+ );
193
+ SelectValue.displayName = "Select.Value";
194
+ var SelectContent = forwardRef(
195
+ ({ className, sideOffset = 6, children, ...props }, ref) => {
196
+ return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, { sideOffset, className: "pds-select-positioner", children: /* @__PURE__ */ jsx(
197
+ Select$1.Popup,
198
+ {
199
+ ref,
200
+ className: cn("pds-select-popup", className),
201
+ ...props,
202
+ children
203
+ }
204
+ ) }) });
205
+ }
206
+ );
207
+ SelectContent.displayName = "Select.Content";
208
+ var SelectItem = forwardRef(
209
+ ({ className, children, ...props }, ref) => {
210
+ return /* @__PURE__ */ jsxs(
211
+ Select$1.Item,
212
+ {
213
+ ref,
214
+ className: cn("pds-select-item", className),
215
+ ...props,
216
+ children: [
217
+ /* @__PURE__ */ jsx(Select$1.ItemIndicator, { className: "pds-select-item__indicator", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
218
+ "path",
219
+ {
220
+ d: "M3.5 8.5l3 3 6-6.5",
221
+ stroke: "currentColor",
222
+ strokeWidth: "2",
223
+ strokeLinecap: "round",
224
+ strokeLinejoin: "round"
225
+ }
226
+ ) }) }),
227
+ /* @__PURE__ */ jsx(Select$1.ItemText, { children })
228
+ ]
229
+ }
230
+ );
231
+ }
232
+ );
233
+ SelectItem.displayName = "Select.Item";
234
+ var Select = {
235
+ Root: Select$1.Root,
236
+ Trigger: SelectTrigger,
237
+ Value: SelectValue,
238
+ Content: SelectContent,
239
+ Item: SelectItem
240
+ };
241
+ var Badge = forwardRef(
242
+ ({ variant = "neutral", size = "md", className, ...props }, ref) => {
243
+ return /* @__PURE__ */ jsx(
244
+ "span",
245
+ {
246
+ ref,
247
+ className: cn(
248
+ "pds-badge",
249
+ `pds-badge--${variant}`,
250
+ `pds-badge--${size}`,
251
+ className
252
+ ),
253
+ ...props
254
+ }
255
+ );
256
+ }
257
+ );
258
+ Badge.displayName = "Badge";
259
+ var AvatarRoot = forwardRef(
260
+ ({ size = "md", className, ...props }, ref) => {
261
+ return /* @__PURE__ */ jsx(
262
+ Avatar$1.Root,
263
+ {
264
+ ref,
265
+ className: cn("pds-avatar", `pds-avatar--${size}`, className),
266
+ ...props
267
+ }
268
+ );
269
+ }
270
+ );
271
+ AvatarRoot.displayName = "Avatar";
272
+ var AvatarImage = forwardRef(
273
+ ({ className, ...props }, ref) => {
274
+ return /* @__PURE__ */ jsx(
275
+ Avatar$1.Image,
276
+ {
277
+ ref,
278
+ className: cn("pds-avatar__image", className),
279
+ ...props
280
+ }
281
+ );
282
+ }
283
+ );
284
+ AvatarImage.displayName = "Avatar.Image";
285
+ var AvatarFallback = forwardRef(
286
+ ({ className, ...props }, ref) => {
287
+ return /* @__PURE__ */ jsx(
288
+ Avatar$1.Fallback,
289
+ {
290
+ ref,
291
+ className: cn("pds-avatar__fallback", className),
292
+ ...props
293
+ }
294
+ );
295
+ }
296
+ );
297
+ AvatarFallback.displayName = "Avatar.Fallback";
298
+ var Avatar = Object.assign(AvatarRoot, {
299
+ Image: AvatarImage,
300
+ Fallback: AvatarFallback
301
+ });
302
+ var Divider = forwardRef(
303
+ ({ orientation = "horizontal", className, ...props }, ref) => {
304
+ return /* @__PURE__ */ jsx(
305
+ Separator,
306
+ {
307
+ ref,
308
+ orientation,
309
+ className: cn(
310
+ "pds-divider",
311
+ orientation === "horizontal" ? "pds-divider--horizontal" : "pds-divider--vertical",
312
+ className
313
+ ),
314
+ ...props
315
+ }
316
+ );
317
+ }
318
+ );
319
+ Divider.displayName = "Divider";
320
+ var ModalContent = forwardRef(
321
+ ({ className, backdropClassName, children, ...props }, ref) => {
322
+ return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
323
+ /* @__PURE__ */ jsx(Dialog.Backdrop, { className: cn("pds-modal-backdrop", backdropClassName) }),
324
+ /* @__PURE__ */ jsx(
325
+ Dialog.Popup,
326
+ {
327
+ ref,
328
+ className: cn("pds-modal-popup", className),
329
+ ...props,
330
+ children
331
+ }
332
+ )
333
+ ] });
334
+ }
335
+ );
336
+ ModalContent.displayName = "Modal.Content";
337
+ var ModalTitle = forwardRef(
338
+ ({ className, ...props }, ref) => {
339
+ return /* @__PURE__ */ jsx(
340
+ Dialog.Title,
341
+ {
342
+ ref,
343
+ className: cn("pds-modal-title", className),
344
+ ...props
345
+ }
346
+ );
347
+ }
348
+ );
349
+ ModalTitle.displayName = "Modal.Title";
350
+ var ModalDescription = forwardRef(
351
+ ({ className, ...props }, ref) => {
352
+ return /* @__PURE__ */ jsx(
353
+ Dialog.Description,
354
+ {
355
+ ref,
356
+ className: cn("pds-modal-description", className),
357
+ ...props
358
+ }
359
+ );
360
+ }
361
+ );
362
+ ModalDescription.displayName = "Modal.Description";
363
+ var Modal = {
364
+ Root: Dialog.Root,
365
+ Trigger: Dialog.Trigger,
366
+ Close: Dialog.Close,
367
+ Content: ModalContent,
368
+ Title: ModalTitle,
369
+ Description: ModalDescription
370
+ };
371
+ var { useToastManager } = Toast$1;
372
+ var ToastProvider = ({ children, ...props }) => {
373
+ return /* @__PURE__ */ jsx(Toast$1.Provider, { ...props, children });
374
+ };
375
+ ToastProvider.displayName = "Toast.Provider";
376
+ var ToastViewport = forwardRef(
377
+ ({ className, ...props }, ref) => {
378
+ return /* @__PURE__ */ jsx(
379
+ Toast$1.Viewport,
380
+ {
381
+ ref,
382
+ className: cn("pds-toast-viewport", className),
383
+ style: { ["--gap"]: "12px" },
384
+ ...props
385
+ }
386
+ );
387
+ }
388
+ );
389
+ ToastViewport.displayName = "Toast.Viewport";
390
+ var Toaster = () => {
391
+ const { toasts } = useToastManager();
392
+ return /* @__PURE__ */ jsx(ToastViewport, { children: toasts.map((toast) => /* @__PURE__ */ jsxs(
393
+ Toast$1.Root,
394
+ {
395
+ toast,
396
+ className: "pds-toast-item",
397
+ children: [
398
+ toast.title ? /* @__PURE__ */ jsx(Toast$1.Title, { className: "pds-toast-title" }) : null,
399
+ toast.description ? /* @__PURE__ */ jsx(Toast$1.Description, { className: "pds-toast-description" }) : null,
400
+ /* @__PURE__ */ jsx(
401
+ Toast$1.Close,
402
+ {
403
+ "aria-label": "Close",
404
+ className: "pds-toast-close",
405
+ children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
406
+ "path",
407
+ {
408
+ d: "M4 4l8 8M12 4l-8 8",
409
+ stroke: "currentColor",
410
+ strokeWidth: "1.5",
411
+ strokeLinecap: "round"
412
+ }
413
+ ) })
414
+ }
415
+ )
416
+ ]
417
+ },
418
+ toast.id
419
+ )) });
420
+ };
421
+ Toaster.displayName = "Toaster";
422
+ var Toast = {
423
+ Provider: ToastProvider,
424
+ Viewport: ToastViewport,
425
+ Toaster
426
+ };
427
+ var TooltipContent = forwardRef(
428
+ ({ className, sideOffset = 6, side = "top", align = "center", children, ...props }, ref) => {
429
+ return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(
430
+ Tooltip$1.Positioner,
431
+ {
432
+ sideOffset,
433
+ side,
434
+ align,
435
+ className: "pds-tooltip-positioner",
436
+ children: /* @__PURE__ */ jsx(
437
+ Tooltip$1.Popup,
438
+ {
439
+ ref,
440
+ className: cn("pds-tooltip-popup", className),
441
+ ...props,
442
+ children
443
+ }
444
+ )
445
+ }
446
+ ) });
447
+ }
448
+ );
449
+ TooltipContent.displayName = "Tooltip.Content";
450
+ var Tooltip = {
451
+ Provider: Tooltip$1.Provider,
452
+ Root: Tooltip$1.Root,
453
+ Trigger: Tooltip$1.Trigger,
454
+ Content: TooltipContent
455
+ };
456
+ var TabsRoot = forwardRef(
457
+ ({ className, ...props }, ref) => {
458
+ return /* @__PURE__ */ jsx(
459
+ Tabs$1.Root,
460
+ {
461
+ ref,
462
+ className: cn("pds-tabs", className),
463
+ ...props
464
+ }
465
+ );
466
+ }
467
+ );
468
+ TabsRoot.displayName = "Tabs";
469
+ var TabsList = forwardRef(
470
+ ({ className, children, ...props }, ref) => {
471
+ return /* @__PURE__ */ jsxs(
472
+ Tabs$1.List,
473
+ {
474
+ ref,
475
+ className: cn("pds-tabs__list", className),
476
+ ...props,
477
+ children: [
478
+ children,
479
+ /* @__PURE__ */ jsx(Tabs$1.Indicator, { className: "pds-tabs__indicator" })
480
+ ]
481
+ }
482
+ );
483
+ }
484
+ );
485
+ TabsList.displayName = "Tabs.List";
486
+ var TabsTab = forwardRef(
487
+ ({ className, ...props }, ref) => {
488
+ return /* @__PURE__ */ jsx(
489
+ Tabs$1.Tab,
490
+ {
491
+ ref,
492
+ className: cn("pds-tabs__tab", className),
493
+ ...props
494
+ }
495
+ );
496
+ }
497
+ );
498
+ TabsTab.displayName = "Tabs.Tab";
499
+ var TabsPanel = forwardRef(
500
+ ({ className, ...props }, ref) => {
501
+ return /* @__PURE__ */ jsx(
502
+ Tabs$1.Panel,
503
+ {
504
+ ref,
505
+ className: cn("pds-tabs__panel", className),
506
+ ...props
507
+ }
508
+ );
509
+ }
510
+ );
511
+ TabsPanel.displayName = "Tabs.Panel";
512
+ var Tabs = Object.assign(TabsRoot, {
513
+ List: TabsList,
514
+ Tab: TabsTab,
515
+ Panel: TabsPanel
516
+ });
517
+ var icons = {
518
+ info: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
519
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
520
+ /* @__PURE__ */ jsx("path", { d: "M8 7.5v4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
521
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "5", r: "0.75", fill: "currentColor" })
522
+ ] }),
523
+ success: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
524
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
525
+ /* @__PURE__ */ jsx("path", { d: "M5 8.5l2 2 4-4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
526
+ ] }),
527
+ warning: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
528
+ /* @__PURE__ */ jsx("path", { d: "M8 1.75L14.5 13.5h-13L8 1.75z", stroke: "currentColor", strokeWidth: "1.5", strokeLinejoin: "round" }),
529
+ /* @__PURE__ */ jsx("path", { d: "M8 6.5v3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }),
530
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "11.75", r: "0.75", fill: "currentColor" })
531
+ ] }),
532
+ danger: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
533
+ /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "1.5" }),
534
+ /* @__PURE__ */ jsx("path", { d: "M5.5 5.5l5 5M10.5 5.5l-5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
535
+ ] })
536
+ };
537
+ var Alert = forwardRef(
538
+ ({ variant = "info", icon, title, className, children, ...props }, ref) => {
539
+ const renderedIcon = icon === false ? null : icon ?? icons[variant];
540
+ return /* @__PURE__ */ jsxs(
541
+ "div",
542
+ {
543
+ ref,
544
+ role: "alert",
545
+ className: cn("pds-alert", `pds-alert--${variant}`, className),
546
+ ...props,
547
+ children: [
548
+ renderedIcon ? /* @__PURE__ */ jsx("span", { className: "pds-alert__icon", children: renderedIcon }) : null,
549
+ /* @__PURE__ */ jsxs("div", { className: "pds-alert__body", children: [
550
+ title ? /* @__PURE__ */ jsx("div", { className: "pds-alert__title", children: title }) : null,
551
+ children ? /* @__PURE__ */ jsx("div", { className: "pds-alert__description", children }) : null
552
+ ] })
553
+ ]
554
+ }
555
+ );
556
+ }
557
+ );
558
+ Alert.displayName = "Alert";
559
+ var DropdownMenuContent = forwardRef(
560
+ ({ className, sideOffset = 6, align = "start", children, ...props }, ref) => {
561
+ return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(
562
+ Menu.Positioner,
563
+ {
564
+ sideOffset,
565
+ align,
566
+ className: "pds-menu-positioner",
567
+ children: /* @__PURE__ */ jsx(
568
+ Menu.Popup,
569
+ {
570
+ ref,
571
+ className: cn("pds-menu-popup", className),
572
+ ...props,
573
+ children
574
+ }
575
+ )
576
+ }
577
+ ) });
578
+ }
579
+ );
580
+ DropdownMenuContent.displayName = "DropdownMenu.Content";
581
+ var DropdownMenuItem = forwardRef(
582
+ ({ className, ...props }, ref) => {
583
+ return /* @__PURE__ */ jsx(
584
+ Menu.Item,
585
+ {
586
+ ref,
587
+ className: cn("pds-menu-item", className),
588
+ ...props
589
+ }
590
+ );
591
+ }
592
+ );
593
+ DropdownMenuItem.displayName = "DropdownMenu.Item";
594
+ var DropdownMenuCheckboxItem = forwardRef(
595
+ ({ className, children, ...props }, ref) => {
596
+ return /* @__PURE__ */ jsxs(
597
+ Menu.CheckboxItem,
598
+ {
599
+ ref,
600
+ className: cn("pds-menu-item", "pds-menu-item--indented", className),
601
+ ...props,
602
+ children: [
603
+ /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { className: "pds-menu-item__indicator", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
604
+ "path",
605
+ {
606
+ d: "M3.5 8.5l3 3 6-6.5",
607
+ stroke: "currentColor",
608
+ strokeWidth: "2",
609
+ strokeLinecap: "round",
610
+ strokeLinejoin: "round"
611
+ }
612
+ ) }) }),
613
+ children
614
+ ]
615
+ }
616
+ );
617
+ }
618
+ );
619
+ DropdownMenuCheckboxItem.displayName = "DropdownMenu.CheckboxItem";
620
+ var DropdownMenuRadioItem = forwardRef(
621
+ ({ className, children, ...props }, ref) => {
622
+ return /* @__PURE__ */ jsxs(
623
+ Menu.RadioItem,
624
+ {
625
+ ref,
626
+ className: cn("pds-menu-item", "pds-menu-item--indented", className),
627
+ ...props,
628
+ children: [
629
+ /* @__PURE__ */ jsx(Menu.RadioItemIndicator, { className: "pds-menu-item__indicator pds-menu-item__indicator--radio", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "8" }) }) }),
630
+ children
631
+ ]
632
+ }
633
+ );
634
+ }
635
+ );
636
+ DropdownMenuRadioItem.displayName = "DropdownMenu.RadioItem";
637
+ var DropdownMenuLabel = forwardRef(
638
+ ({ className, ...props }, ref) => {
639
+ return /* @__PURE__ */ jsx(
640
+ Menu.GroupLabel,
641
+ {
642
+ ref,
643
+ className: cn("pds-menu-label", className),
644
+ ...props
645
+ }
646
+ );
647
+ }
648
+ );
649
+ DropdownMenuLabel.displayName = "DropdownMenu.Label";
650
+ var DropdownMenuSeparator = forwardRef(
651
+ ({ className, ...props }, ref) => {
652
+ return /* @__PURE__ */ jsx(
653
+ Menu.Separator,
654
+ {
655
+ ref,
656
+ className: cn("pds-menu-separator", className),
657
+ ...props
658
+ }
659
+ );
660
+ }
661
+ );
662
+ DropdownMenuSeparator.displayName = "DropdownMenu.Separator";
663
+ var DropdownMenu = {
664
+ Root: Menu.Root,
665
+ Trigger: Menu.Trigger,
666
+ Content: DropdownMenuContent,
667
+ Item: DropdownMenuItem,
668
+ CheckboxItem: DropdownMenuCheckboxItem,
669
+ RadioGroup: Menu.RadioGroup,
670
+ RadioItem: DropdownMenuRadioItem,
671
+ Group: Menu.Group,
672
+ Label: DropdownMenuLabel,
673
+ Separator: DropdownMenuSeparator
674
+ };
675
+ var Skeleton = forwardRef(
676
+ ({ shape = "line", className, ...props }, ref) => {
677
+ return /* @__PURE__ */ jsx(
678
+ "div",
679
+ {
680
+ ref,
681
+ "aria-hidden": "true",
682
+ className: cn("pds-skeleton", `pds-skeleton--${shape}`, className),
683
+ ...props
684
+ }
685
+ );
686
+ }
687
+ );
688
+ Skeleton.displayName = "Skeleton";
689
+ var CardRoot = forwardRef(
690
+ ({ variant = "elevated", className, ...props }, ref) => {
691
+ return /* @__PURE__ */ jsx(
692
+ "div",
693
+ {
694
+ ref,
695
+ className: cn("pds-card", `pds-card--${variant}`, className),
696
+ ...props
697
+ }
698
+ );
699
+ }
700
+ );
701
+ CardRoot.displayName = "Card";
702
+ var CardHeader = forwardRef(
703
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
704
+ "div",
705
+ {
706
+ ref,
707
+ className: cn("pds-card__header", className),
708
+ ...props
709
+ }
710
+ )
711
+ );
712
+ CardHeader.displayName = "Card.Header";
713
+ var CardTitle = forwardRef(
714
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
715
+ "h3",
716
+ {
717
+ ref,
718
+ className: cn("pds-card__title", className),
719
+ ...props
720
+ }
721
+ )
722
+ );
723
+ CardTitle.displayName = "Card.Title";
724
+ var CardDescription = forwardRef(
725
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
726
+ "p",
727
+ {
728
+ ref,
729
+ className: cn("pds-card__description", className),
730
+ ...props
731
+ }
732
+ )
733
+ );
734
+ CardDescription.displayName = "Card.Description";
735
+ var CardAction = forwardRef(
736
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
737
+ "div",
738
+ {
739
+ ref,
740
+ className: cn("pds-card__action", className),
741
+ ...props
742
+ }
743
+ )
744
+ );
745
+ CardAction.displayName = "Card.Action";
746
+ var CardBody = forwardRef(
747
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
748
+ "div",
749
+ {
750
+ ref,
751
+ className: cn("pds-card__body", className),
752
+ ...props
753
+ }
754
+ )
755
+ );
756
+ CardBody.displayName = "Card.Body";
757
+ var CardFooter = forwardRef(
758
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
759
+ "div",
760
+ {
761
+ ref,
762
+ className: cn("pds-card__footer", className),
763
+ ...props
764
+ }
765
+ )
766
+ );
767
+ CardFooter.displayName = "Card.Footer";
768
+ var Card = Object.assign(CardRoot, {
769
+ Header: CardHeader,
770
+ Title: CardTitle,
771
+ Description: CardDescription,
772
+ Action: CardAction,
773
+ Body: CardBody,
774
+ Footer: CardFooter
775
+ });
776
+ var Textarea = forwardRef(
777
+ ({ size = "md", invalid, className, ...props }, ref) => {
778
+ return /* @__PURE__ */ jsx(
779
+ "textarea",
780
+ {
781
+ ref,
782
+ "aria-invalid": invalid || void 0,
783
+ className: cn("pds-textarea", `pds-textarea--${size}`, className),
784
+ ...props
785
+ }
786
+ );
787
+ }
788
+ );
789
+ Textarea.displayName = "Textarea";
790
+ var intentVars = {
791
+ neutral: {
792
+ ["--pill-chip"]: "var(--gray-400)",
793
+ ["--pill-text"]: "var(--color-text-tertiary)"
794
+ },
795
+ success: {
796
+ ["--pill-chip"]: "var(--green-500)",
797
+ ["--pill-text"]: "var(--color-text-success)"
798
+ },
799
+ warning: {
800
+ ["--pill-chip"]: "var(--amber-500)",
801
+ ["--pill-text"]: "var(--color-text-warning)"
802
+ },
803
+ danger: {
804
+ ["--pill-chip"]: "var(--red-500)",
805
+ ["--pill-text"]: "var(--color-text-danger)"
806
+ },
807
+ info: {
808
+ ["--pill-chip"]: "var(--brand-500)",
809
+ ["--pill-text"]: "var(--color-text-brand)"
810
+ }
811
+ };
812
+ var StatusPillContext = createContext("neutral");
813
+ var StatusPillRoot = forwardRef(
814
+ ({ intent = "neutral", className, style, ...props }, ref) => {
815
+ return /* @__PURE__ */ jsx(StatusPillContext.Provider, { value: intent, children: /* @__PURE__ */ jsx(
816
+ "span",
817
+ {
818
+ ref,
819
+ className: cn("pds-status-pill", className),
820
+ style: { ...intentVars[intent], ...style },
821
+ ...props
822
+ }
823
+ ) });
824
+ }
825
+ );
826
+ StatusPillRoot.displayName = "StatusPill";
827
+ var StatusPillIndicator = forwardRef(
828
+ ({ className, children, ...props }, ref) => {
829
+ return /* @__PURE__ */ jsx(
830
+ "span",
831
+ {
832
+ ref,
833
+ "aria-hidden": "true",
834
+ className: cn("pds-status-pill__indicator", className),
835
+ ...props,
836
+ children
837
+ }
838
+ );
839
+ }
840
+ );
841
+ StatusPillIndicator.displayName = "StatusPill.Indicator";
842
+ var StatusPillLabel = forwardRef(
843
+ ({ className, ...props }, ref) => {
844
+ useContext(StatusPillContext);
845
+ return /* @__PURE__ */ jsx(
846
+ "span",
847
+ {
848
+ ref,
849
+ className: cn("pds-status-pill__label", className),
850
+ ...props
851
+ }
852
+ );
853
+ }
854
+ );
855
+ StatusPillLabel.displayName = "StatusPill.Label";
856
+ var StatusPill = Object.assign(StatusPillRoot, {
857
+ Indicator: StatusPillIndicator,
858
+ Label: StatusPillLabel
859
+ });
860
+ var SegmentedSizeContext = createContext("md");
861
+ var SegmentedRoot = forwardRef(
862
+ ({ value, defaultValue, onValueChange, size = "md", className, ...props }, ref) => {
863
+ const handleChange = useMemo(
864
+ () => onValueChange ? (groupValue) => {
865
+ const next = groupValue[0];
866
+ if (next !== void 0) onValueChange(next);
867
+ } : void 0,
868
+ [onValueChange]
869
+ );
870
+ return /* @__PURE__ */ jsx(SegmentedSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(
871
+ ToggleGroup,
872
+ {
873
+ ref,
874
+ value: value !== void 0 ? [value] : void 0,
875
+ defaultValue: defaultValue !== void 0 ? [defaultValue] : void 0,
876
+ onValueChange: handleChange,
877
+ className: cn("pds-segmented", `pds-segmented--${size}`, className),
878
+ ...props
879
+ }
880
+ ) });
881
+ }
882
+ );
883
+ SegmentedRoot.displayName = "Segmented";
884
+ var SegmentedItem = forwardRef(
885
+ ({ className, value, ...props }, ref) => {
886
+ const size = useContext(SegmentedSizeContext);
887
+ return /* @__PURE__ */ jsx(
888
+ Toggle,
889
+ {
890
+ ref,
891
+ value,
892
+ className: cn(
893
+ "pds-segmented__item",
894
+ `pds-segmented__item--${size}`,
895
+ className
896
+ ),
897
+ ...props
898
+ }
899
+ );
900
+ }
901
+ );
902
+ SegmentedItem.displayName = "Segmented.Item";
903
+ var Segmented = Object.assign(SegmentedRoot, {
904
+ Item: SegmentedItem
905
+ });
906
+ var Container = forwardRef(
907
+ ({ size = "xl", className, ...props }, ref) => /* @__PURE__ */ jsx(
908
+ "div",
909
+ {
910
+ ref,
911
+ className: cn("pds-container", `pds-container--${size}`, className),
912
+ ...props
913
+ }
914
+ )
915
+ );
916
+ Container.displayName = "Container";
917
+ var GridRoot = forwardRef(
918
+ ({ gutter = "default", className, ...props }, ref) => /* @__PURE__ */ jsx(
919
+ "div",
920
+ {
921
+ ref,
922
+ className: cn("pds-grid", `pds-grid--${gutter}`, className),
923
+ ...props
924
+ }
925
+ )
926
+ );
927
+ GridRoot.displayName = "Grid";
928
+ var GridCol = forwardRef(
929
+ ({ span = 12, smSpan, mdSpan, lgSpan, className, ...props }, ref) => /* @__PURE__ */ jsx(
930
+ "div",
931
+ {
932
+ ref,
933
+ className: cn(
934
+ `pds-grid__col--span-${span}`,
935
+ smSpan !== void 0 && `pds-grid__col--sm-span-${smSpan}`,
936
+ mdSpan !== void 0 && `pds-grid__col--md-span-${mdSpan}`,
937
+ lgSpan !== void 0 && `pds-grid__col--lg-span-${lgSpan}`,
938
+ className
939
+ ),
940
+ ...props
941
+ }
942
+ )
943
+ );
944
+ GridCol.displayName = "Grid.Col";
945
+ var Grid = Object.assign(GridRoot, {
946
+ Col: GridCol
947
+ });
948
+
949
+ export { Alert, Avatar, Badge, Button, Card, Checkbox, Container, Divider, DropdownMenu, Grid, Input, Modal, Radio, RadioGroup, Segmented, Select, Skeleton, StatusPill, Switch, Tabs, Textarea, Toast, Tooltip, cn, useToastManager as useToast };
950
+ //# sourceMappingURL=index.js.map
951
+ //# sourceMappingURL=index.js.map