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