@boostdev/design-system-components 0.1.3 → 0.1.5
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/client.cjs +185 -104
- package/dist/client.css +444 -427
- package/dist/client.d.cts +15 -13
- package/dist/client.d.ts +15 -13
- package/dist/client.js +189 -107
- package/dist/index.cjs +185 -104
- package/dist/index.css +444 -427
- package/dist/index.d.cts +15 -13
- package/dist/index.d.ts +15 -13
- package/dist/index.js +189 -107
- package/package.json +3 -3
- package/src/components/interaction/Button/Button.tsx +35 -8
- package/src/components/interaction/Dialog/Dialog.spec.tsx +10 -10
- package/src/components/interaction/Dialog/Dialog.tsx +21 -7
- package/src/components/interaction/DropdownMenu/DropdownMenu.tsx +1 -1
- package/src/components/interaction/DropdownMenu/index.ts +1 -0
- package/src/components/interaction/Toast/Toast.module.css +28 -0
- package/src/components/interaction/Toast/Toast.tsx +10 -1
- package/src/components/interaction/form/Checkbox/Checkbox.module.css +1 -1
- package/src/components/interaction/form/Checkbox/Checkbox.tsx +2 -1
- package/src/components/interaction/form/Combobox/Combobox.tsx +11 -3
- package/src/components/interaction/form/Combobox/index.ts +1 -0
- package/src/components/interaction/form/FileInput/FileInput.tsx +15 -2
- package/src/components/interaction/form/FormInput/FormInput.tsx +4 -3
- package/src/components/interaction/form/NumberInput/NumberInput.tsx +21 -17
- package/src/components/interaction/form/Radio/Radio.module.css +1 -1
- package/src/components/interaction/form/Radio/Radio.tsx +2 -1
- package/src/components/interaction/form/Select/Select.spec.tsx +2 -1
- package/src/components/interaction/form/Select/Select.tsx +3 -3
- package/src/components/interaction/form/Select/index.ts +1 -0
- package/src/components/interaction/form/Slider/Slider.tsx +5 -4
- package/src/components/interaction/form/Switch/Switch.tsx +1 -1
- package/src/components/interaction/form/Textarea/Textarea.tsx +1 -1
- package/src/components/interaction/form/atoms/Message.tsx +2 -2
- package/src/components/layout/ButtonGroup/ButtonGroup.tsx +1 -1
- package/src/components/layout/Card/Card.module.css +1 -1
- package/src/components/layout/Card/Card.tsx +3 -0
- package/src/components/layout/IconWrapper/IconWrapper.module.css +3 -6
- package/src/components/layout/SectionHeader/SectionHeader.module.css +2 -5
- package/src/components/layout/SectionHeader/SectionHeader.tsx +2 -3
- package/src/components/ui/Accordion/Accordion.tsx +1 -1
- package/src/components/ui/Accordion/index.ts +1 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +2 -2
- package/src/components/ui/Breadcrumb/index.ts +1 -0
- package/src/components/ui/Calendar/Calendar.tsx +8 -3
- package/src/components/ui/DescriptionList/DescriptionList.tsx +1 -1
- package/src/components/ui/DescriptionList/index.ts +1 -0
- package/src/components/ui/Link/Link.tsx +3 -1
- package/src/components/ui/Separator/Separator.module.css +3 -6
- package/src/components/ui/Table/Table.tsx +1 -1
- package/src/components/ui/Table/index.ts +1 -0
- package/src/components/ui/Tabs/Tabs.tsx +1 -1
- package/src/components/ui/Tabs/index.ts +1 -0
- package/src/components/ui/Typography/Typography.module.css +1 -4
- package/src/index.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useId, useState } from "react";
|
|
3
3
|
|
|
4
4
|
// src/components/ui/Accordion/Accordion.module.css
|
|
5
|
-
var Accordion_default = {};
|
|
5
|
+
var Accordion_default = {"accordion":"bds015-accordion","item":"bds015-item","heading":"bds015-heading","trigger":"bds015-trigger","triggerLabel":"bds015-triggerLabel","chevron":"bds015-chevron","--open":"bds015---open","panel":"bds015-panel","panelContent":"bds015-panelContent"};
|
|
6
6
|
|
|
7
7
|
// src/components/ui/Accordion/Accordion.tsx
|
|
8
8
|
import { cn } from "@boostdev/design-system-foundation";
|
|
@@ -70,7 +70,7 @@ function Accordion({
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
// src/components/ui/Alert/Alert.module.css
|
|
73
|
-
var Alert_default = {};
|
|
73
|
+
var Alert_default = {"alert":"bds015-alert","--variant_info":"bds015---variant_info","--variant_success":"bds015---variant_success","--variant_warning":"bds015---variant_warning","--variant_error":"bds015---variant_error","icon":"bds015-icon","content":"bds015-content","title":"bds015-title","dismiss":"bds015-dismiss"};
|
|
74
74
|
|
|
75
75
|
// src/components/ui/Alert/Alert.tsx
|
|
76
76
|
import { cn as cn2 } from "@boostdev/design-system-foundation";
|
|
@@ -113,7 +113,7 @@ function Alert({
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
// src/components/ui/Avatar/Avatar.module.css
|
|
116
|
-
var Avatar_default = {};
|
|
116
|
+
var Avatar_default = {"avatar":"bds015-avatar","--fallback":"bds015---fallback","--size_small":"bds015---size_small","--size_medium":"bds015---size_medium","--size_large":"bds015---size_large","image":"bds015-image","initials":"bds015-initials"};
|
|
117
117
|
|
|
118
118
|
// src/components/ui/Avatar/Avatar.tsx
|
|
119
119
|
import { cn as cn3 } from "@boostdev/design-system-foundation";
|
|
@@ -139,7 +139,7 @@ function Avatar({ src, alt, name, size = "medium", className }) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// src/components/ui/Badge/Badge.module.css
|
|
142
|
-
var Badge_default = {};
|
|
142
|
+
var Badge_default = {"badge":"bds015-badge","--variant_primary":"bds015---variant_primary","--variant_secondary":"bds015---variant_secondary","--variant_success":"bds015---variant_success","--variant_error":"bds015---variant_error","--variant_warning":"bds015---variant_warning"};
|
|
143
143
|
|
|
144
144
|
// src/components/ui/Badge/Badge.tsx
|
|
145
145
|
import { cn as cn4 } from "@boostdev/design-system-foundation";
|
|
@@ -149,7 +149,7 @@ function Badge({ children, variant = "primary", className }) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// src/components/ui/Breadcrumb/Breadcrumb.module.css
|
|
152
|
-
var Breadcrumb_default = {};
|
|
152
|
+
var Breadcrumb_default = {"breadcrumb":"bds015-breadcrumb","list":"bds015-list","item":"bds015-item","link":"bds015-link","separator":"bds015-separator","current":"bds015-current"};
|
|
153
153
|
|
|
154
154
|
// src/components/ui/Breadcrumb/Breadcrumb.tsx
|
|
155
155
|
import { cn as cn5 } from "@boostdev/design-system-foundation";
|
|
@@ -160,7 +160,7 @@ function Breadcrumb({ items, className }) {
|
|
|
160
160
|
return /* @__PURE__ */ jsx5("li", { className: Breadcrumb_default.item, children: isLast ? /* @__PURE__ */ jsx5("span", { "aria-current": "page", className: Breadcrumb_default.current, children: item.label }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
161
161
|
/* @__PURE__ */ jsx5("a", { href: item.href, className: Breadcrumb_default.link, children: item.label }),
|
|
162
162
|
/* @__PURE__ */ jsx5("span", { className: Breadcrumb_default.separator, "aria-hidden": "true", children: "\u203A" })
|
|
163
|
-
] }) },
|
|
163
|
+
] }) }, index);
|
|
164
164
|
}) }) });
|
|
165
165
|
}
|
|
166
166
|
|
|
@@ -168,7 +168,7 @@ function Breadcrumb({ items, className }) {
|
|
|
168
168
|
import { useState as useState2, useId as useId2 } from "react";
|
|
169
169
|
|
|
170
170
|
// src/components/ui/Calendar/Calendar.module.css
|
|
171
|
-
var Calendar_default = {};
|
|
171
|
+
var Calendar_default = {"calendar":"bds015-calendar","header":"bds015-header","monthYear":"bds015-monthYear","navBtn":"bds015-navBtn","grid":"bds015-grid","weekday":"bds015-weekday","empty":"bds015-empty","day":"bds015-day","disabled":"bds015-disabled","selected":"bds015-selected","today":"bds015-today"};
|
|
172
172
|
|
|
173
173
|
// src/components/ui/Calendar/Calendar.tsx
|
|
174
174
|
import { cn as cn6 } from "@boostdev/design-system-foundation";
|
|
@@ -191,10 +191,13 @@ var MONTHS = [
|
|
|
191
191
|
function isSameDay(a, b) {
|
|
192
192
|
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
193
193
|
}
|
|
194
|
+
function toMidnight(date) {
|
|
195
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
196
|
+
}
|
|
194
197
|
function isOutOfRange(date, min, max) {
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
return
|
|
198
|
+
const d = toMidnight(date);
|
|
199
|
+
if (min && d < toMidnight(min)) return true;
|
|
200
|
+
return !!(max && d > toMidnight(max));
|
|
198
201
|
}
|
|
199
202
|
function getDaysInMonth(year, month) {
|
|
200
203
|
return new Date(year, month + 1, 0).getDate();
|
|
@@ -331,7 +334,7 @@ function Calendar({ value, defaultValue, min, max, onChange, className }) {
|
|
|
331
334
|
import { useRef, useId as useId3 } from "react";
|
|
332
335
|
|
|
333
336
|
// src/components/ui/Carousel/Carousel.module.css
|
|
334
|
-
var Carousel_default = {};
|
|
337
|
+
var Carousel_default = {"carousel":"bds015-carousel","track":"bds015-track","slide":"bds015-slide","navBtn":"bds015-navBtn"};
|
|
335
338
|
|
|
336
339
|
// src/components/ui/Carousel/Carousel.tsx
|
|
337
340
|
import { cn as cn7 } from "@boostdev/design-system-foundation";
|
|
@@ -384,7 +387,7 @@ function Carousel({ items, label, className }) {
|
|
|
384
387
|
}
|
|
385
388
|
|
|
386
389
|
// src/components/ui/DescriptionList/DescriptionList.module.css
|
|
387
|
-
var DescriptionList_default = {};
|
|
390
|
+
var DescriptionList_default = {"list":"bds015-list","group":"bds015-group","term":"bds015-term","details":"bds015-details","--layout_inline":"bds015---layout_inline"};
|
|
388
391
|
|
|
389
392
|
// src/components/ui/DescriptionList/DescriptionList.tsx
|
|
390
393
|
import { cn as cn8 } from "@boostdev/design-system-foundation";
|
|
@@ -397,7 +400,7 @@ function DescriptionList({ items, layout = "stacked", className }) {
|
|
|
397
400
|
}
|
|
398
401
|
|
|
399
402
|
// src/components/ui/Link/Link.module.css
|
|
400
|
-
var Link_default = {};
|
|
403
|
+
var Link_default = {"link":"bds015-link","--variant_default":"bds015---variant_default","--variant_subtle":"bds015---variant_subtle","--variant_standalone":"bds015---variant_standalone","externalLabel":"bds015-externalLabel"};
|
|
401
404
|
|
|
402
405
|
// src/components/ui/Link/Link.tsx
|
|
403
406
|
import { cn as cn9 } from "@boostdev/design-system-foundation";
|
|
@@ -407,6 +410,7 @@ function Link({
|
|
|
407
410
|
children,
|
|
408
411
|
variant = "default",
|
|
409
412
|
external = false,
|
|
413
|
+
externalLabel = "(opens in new tab)",
|
|
410
414
|
className,
|
|
411
415
|
...props
|
|
412
416
|
}) {
|
|
@@ -420,14 +424,14 @@ function Link({
|
|
|
420
424
|
...props,
|
|
421
425
|
children: [
|
|
422
426
|
children,
|
|
423
|
-
external && /* @__PURE__ */ jsx9("span", { className: Link_default.externalLabel, children:
|
|
427
|
+
external && /* @__PURE__ */ jsx9("span", { className: Link_default.externalLabel, children: externalLabel })
|
|
424
428
|
]
|
|
425
429
|
}
|
|
426
430
|
);
|
|
427
431
|
}
|
|
428
432
|
|
|
429
433
|
// src/components/ui/Loading/Loading.module.css
|
|
430
|
-
var Loading_default = {};
|
|
434
|
+
var Loading_default = {"loading":"bds015-loading","spinner":"bds015-spinner","--size_small":"bds015---size_small","--size_large":"bds015---size_large"};
|
|
431
435
|
|
|
432
436
|
// src/components/ui/Loading/Loading.tsx
|
|
433
437
|
import { cn as cn10 } from "@boostdev/design-system-foundation";
|
|
@@ -437,7 +441,7 @@ function Loading({ size = "medium", className }) {
|
|
|
437
441
|
}
|
|
438
442
|
|
|
439
443
|
// src/components/ui/NotificationBanner/NotificationBanner.module.css
|
|
440
|
-
var NotificationBanner_default = {};
|
|
444
|
+
var NotificationBanner_default = {"banner":"bds015-banner","--variant_info":"bds015---variant_info","--variant_success":"bds015---variant_success","--variant_warning":"bds015---variant_warning","--variant_error":"bds015---variant_error","content":"bds015-content","action":"bds015-action","dismiss":"bds015-dismiss"};
|
|
441
445
|
|
|
442
446
|
// src/components/ui/NotificationBanner/NotificationBanner.tsx
|
|
443
447
|
import { cn as cn11 } from "@boostdev/design-system-foundation";
|
|
@@ -476,7 +480,7 @@ function NotificationBanner({
|
|
|
476
480
|
}
|
|
477
481
|
|
|
478
482
|
// src/components/ui/Pagination/Pagination.module.css
|
|
479
|
-
var Pagination_default = {};
|
|
483
|
+
var Pagination_default = {"pagination":"bds015-pagination","list":"bds015-list","button":"bds015-button","--active":"bds015---active","--nav":"bds015---nav","ellipsis":"bds015-ellipsis"};
|
|
480
484
|
|
|
481
485
|
// src/components/ui/Pagination/Pagination.tsx
|
|
482
486
|
import { cn as cn12 } from "@boostdev/design-system-foundation";
|
|
@@ -540,7 +544,7 @@ function Pagination({
|
|
|
540
544
|
}
|
|
541
545
|
|
|
542
546
|
// src/components/ui/Progress/Progress.module.css
|
|
543
|
-
var Progress_default = {};
|
|
547
|
+
var Progress_default = {"container":"bds015-container","labelRow":"bds015-labelRow","label":"bds015-label","value":"bds015-value","track":"bds015-track","--size_small":"bds015---size_small","--size_medium":"bds015---size_medium","--size_large":"bds015---size_large","fill":"bds015-fill"};
|
|
544
548
|
|
|
545
549
|
// src/components/ui/Progress/Progress.tsx
|
|
546
550
|
import { cn as cn13 } from "@boostdev/design-system-foundation";
|
|
@@ -578,7 +582,7 @@ function Progress({
|
|
|
578
582
|
}
|
|
579
583
|
|
|
580
584
|
// src/components/ui/ProgressCircle/ProgressCircle.module.css
|
|
581
|
-
var ProgressCircle_default = {};
|
|
585
|
+
var ProgressCircle_default = {"wrapper":"bds015-wrapper","svg":"bds015-svg","track":"bds015-track","fill":"bds015-fill","value":"bds015-value","--size_small":"bds015---size_small","--size_medium":"bds015---size_medium","--size_large":"bds015---size_large"};
|
|
582
586
|
|
|
583
587
|
// src/components/ui/ProgressCircle/ProgressCircle.tsx
|
|
584
588
|
import { cn as cn14 } from "@boostdev/design-system-foundation";
|
|
@@ -657,7 +661,7 @@ function ProgressCircle({
|
|
|
657
661
|
}
|
|
658
662
|
|
|
659
663
|
// src/components/ui/Separator/Separator.module.css
|
|
660
|
-
var Separator_default = {};
|
|
664
|
+
var Separator_default = {"separator":"bds015-separator","--horizontal":"bds015---horizontal","--vertical":"bds015---vertical"};
|
|
661
665
|
|
|
662
666
|
// src/components/ui/Separator/Separator.tsx
|
|
663
667
|
import { cn as cn15 } from "@boostdev/design-system-foundation";
|
|
@@ -680,7 +684,7 @@ function Separator({ orientation = "horizontal", className }) {
|
|
|
680
684
|
import { cn as cn16 } from "@boostdev/design-system-foundation";
|
|
681
685
|
|
|
682
686
|
// src/components/ui/Skeleton/Skeleton.module.css
|
|
683
|
-
var Skeleton_default = {};
|
|
687
|
+
var Skeleton_default = {"skeleton":"bds015-skeleton"};
|
|
684
688
|
|
|
685
689
|
// src/components/ui/Skeleton/Skeleton.tsx
|
|
686
690
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
@@ -689,7 +693,7 @@ function Skeleton({ className }) {
|
|
|
689
693
|
}
|
|
690
694
|
|
|
691
695
|
// src/components/ui/SkipLink/SkipLink.module.css
|
|
692
|
-
var SkipLink_default = {};
|
|
696
|
+
var SkipLink_default = {"skipLink":"bds015-skipLink"};
|
|
693
697
|
|
|
694
698
|
// src/components/ui/SkipLink/SkipLink.tsx
|
|
695
699
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
@@ -698,7 +702,7 @@ function SkipLink({ href = "#main", children = "Skip to main content" }) {
|
|
|
698
702
|
}
|
|
699
703
|
|
|
700
704
|
// src/components/ui/Table/Table.module.css
|
|
701
|
-
var Table_default = {};
|
|
705
|
+
var Table_default = {"wrapper":"bds015-wrapper","table":"bds015-table","caption":"bds015-caption","thead":"bds015-thead","th":"bds015-th","--sortable":"bds015---sortable","sortButton":"bds015-sortButton","sortIcon":"bds015-sortIcon","--sort-active":"bds015---sort-active","--sort-desc":"bds015---sort-desc","tbody":"bds015-tbody","tr":"bds015-tr","td":"bds015-td"};
|
|
702
706
|
|
|
703
707
|
// src/components/ui/Table/Table.tsx
|
|
704
708
|
import { cn as cn17 } from "@boostdev/design-system-foundation";
|
|
@@ -767,7 +771,7 @@ function Table({
|
|
|
767
771
|
import { useId as useId4, useRef as useRef2, useState as useState3 } from "react";
|
|
768
772
|
|
|
769
773
|
// src/components/ui/Tabs/Tabs.module.css
|
|
770
|
-
var Tabs_default = {};
|
|
774
|
+
var Tabs_default = {"tabs":"bds015-tabs","tabList":"bds015-tabList","tab":"bds015-tab","--active":"bds015---active","panel":"bds015-panel"};
|
|
771
775
|
|
|
772
776
|
// src/components/ui/Tabs/Tabs.tsx
|
|
773
777
|
import { cn as cn18 } from "@boostdev/design-system-foundation";
|
|
@@ -848,7 +852,7 @@ function Tabs({ tabs, defaultTab, className }) {
|
|
|
848
852
|
import { cloneElement, isValidElement, useId as useId5 } from "react";
|
|
849
853
|
|
|
850
854
|
// src/components/ui/Tooltip/Tooltip.module.css
|
|
851
|
-
var Tooltip_default = {};
|
|
855
|
+
var Tooltip_default = {"wrapper":"bds015-wrapper","tooltip":"bds015-tooltip","--placement_top":"bds015---placement_top","--placement_bottom":"bds015---placement_bottom","--placement_left":"bds015---placement_left","--placement_right":"bds015---placement_right"};
|
|
852
856
|
|
|
853
857
|
// src/components/ui/Tooltip/Tooltip.tsx
|
|
854
858
|
import { cn as cn19 } from "@boostdev/design-system-foundation";
|
|
@@ -878,7 +882,7 @@ function Tooltip({
|
|
|
878
882
|
}
|
|
879
883
|
|
|
880
884
|
// src/components/ui/Typography/Typography.module.css
|
|
881
|
-
var Typography_default = {};
|
|
885
|
+
var Typography_default = {"typography":"bds015-typography","--h1":"bds015---h1","--h2":"bds015---h2","--h3":"bds015---h3","--body":"bds015---body","--body_s":"bds015---body_s"};
|
|
882
886
|
|
|
883
887
|
// src/components/ui/Typography/Typography.tsx
|
|
884
888
|
import { cn as cn20 } from "@boostdev/design-system-foundation";
|
|
@@ -896,14 +900,14 @@ function Typography({ variant = "body", component, children, className }) {
|
|
|
896
900
|
}
|
|
897
901
|
|
|
898
902
|
// src/components/interaction/Button/Button.module.css
|
|
899
|
-
var Button_default = {};
|
|
903
|
+
var Button_default = {"button":"bds015-button","--primary":"bds015---primary","--secondary":"bds015---secondary","--size_small":"bds015---size_small","--size_medium":"bds015---size_medium","--size_large":"bds015---size_large","--hasPulse":"bds015---hasPulse","prefix":"bds015-prefix","suffix":"bds015-suffix"};
|
|
900
904
|
|
|
901
905
|
// src/components/interaction/Button/Button.tsx
|
|
902
906
|
import { cn as cn21 } from "@boostdev/design-system-foundation";
|
|
903
907
|
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
904
908
|
function Button({
|
|
905
909
|
children,
|
|
906
|
-
className
|
|
910
|
+
className,
|
|
907
911
|
variant = "primary",
|
|
908
912
|
type = "button",
|
|
909
913
|
iconStart,
|
|
@@ -924,22 +928,55 @@ function Button({
|
|
|
924
928
|
hasPulse && Button_default["--hasPulse"],
|
|
925
929
|
className
|
|
926
930
|
);
|
|
927
|
-
const
|
|
928
|
-
|
|
931
|
+
const handleAnchorClick = (e) => {
|
|
932
|
+
if (disabled) {
|
|
933
|
+
e.preventDefault();
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
onClick?.(e);
|
|
937
|
+
};
|
|
938
|
+
const handleButtonClick = (e) => {
|
|
939
|
+
onClick?.(e);
|
|
940
|
+
};
|
|
941
|
+
const content = /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
942
|
+
Boolean(iconStart) && /* @__PURE__ */ jsx22("span", { className: Button_default.prefix, children: iconStart }),
|
|
929
943
|
children,
|
|
930
|
-
|
|
944
|
+
Boolean(iconEnd) && /* @__PURE__ */ jsx22("span", { className: Button_default.suffix, children: iconEnd })
|
|
931
945
|
] });
|
|
932
946
|
if (href) {
|
|
933
|
-
return /* @__PURE__ */ jsx22(
|
|
947
|
+
return /* @__PURE__ */ jsx22(
|
|
948
|
+
"a",
|
|
949
|
+
{
|
|
950
|
+
className: classNames,
|
|
951
|
+
href: disabled ? void 0 : href,
|
|
952
|
+
target,
|
|
953
|
+
rel,
|
|
954
|
+
"aria-disabled": disabled,
|
|
955
|
+
tabIndex: disabled ? -1 : void 0,
|
|
956
|
+
onClick: handleAnchorClick,
|
|
957
|
+
...rest,
|
|
958
|
+
children: content
|
|
959
|
+
}
|
|
960
|
+
);
|
|
934
961
|
}
|
|
935
|
-
return /* @__PURE__ */ jsx22(
|
|
962
|
+
return /* @__PURE__ */ jsx22(
|
|
963
|
+
"button",
|
|
964
|
+
{
|
|
965
|
+
type,
|
|
966
|
+
className: classNames,
|
|
967
|
+
disabled,
|
|
968
|
+
onClick: handleButtonClick,
|
|
969
|
+
...rest,
|
|
970
|
+
children: content
|
|
971
|
+
}
|
|
972
|
+
);
|
|
936
973
|
}
|
|
937
974
|
|
|
938
975
|
// src/components/interaction/Command/Command.tsx
|
|
939
976
|
import { useState as useState4, useEffect, useRef as useRef3, useId as useId6, useMemo } from "react";
|
|
940
977
|
|
|
941
978
|
// src/components/interaction/Command/Command.module.css
|
|
942
|
-
var Command_default = {};
|
|
979
|
+
var Command_default = {"dialog":"bds015-dialog","palette":"bds015-palette","searchRow":"bds015-searchRow","searchIcon":"bds015-searchIcon","search":"bds015-search","escHint":"bds015-escHint","list":"bds015-list","groupList":"bds015-groupList","group":"bds015-group","item":"bds015-item","itemActive":"bds015-itemActive","itemLabel":"bds015-itemLabel","itemDesc":"bds015-itemDesc","shortcut":"bds015-shortcut","empty":"bds015-empty"};
|
|
943
980
|
|
|
944
981
|
// src/components/interaction/Command/Command.tsx
|
|
945
982
|
import { cn as cn22 } from "@boostdev/design-system-foundation";
|
|
@@ -1078,42 +1115,58 @@ function Command({
|
|
|
1078
1115
|
import { useEffect as useEffect2, useRef as useRef4 } from "react";
|
|
1079
1116
|
|
|
1080
1117
|
// src/components/interaction/Dialog/Dialog.module.css
|
|
1081
|
-
var Dialog_default = {};
|
|
1118
|
+
var Dialog_default = {"dialog":"bds015-dialog","closeForm":"bds015-closeForm","closeButton":"bds015-closeButton"};
|
|
1082
1119
|
|
|
1083
1120
|
// src/components/interaction/Dialog/Dialog.tsx
|
|
1084
1121
|
import { cn as cn23 } from "@boostdev/design-system-foundation";
|
|
1085
1122
|
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1086
|
-
function Dialog({ children,
|
|
1123
|
+
function Dialog({ children, isOpen = false, className, onClose }) {
|
|
1087
1124
|
const dialogRef = useRef4(null);
|
|
1088
1125
|
useEffect2(() => {
|
|
1089
1126
|
const dialog = dialogRef.current;
|
|
1090
1127
|
if (!dialog) return;
|
|
1091
|
-
if (
|
|
1128
|
+
if (isOpen) {
|
|
1092
1129
|
dialog.showModal();
|
|
1093
1130
|
} else if (dialog.open) {
|
|
1094
1131
|
dialog.close();
|
|
1095
1132
|
}
|
|
1096
|
-
}, [
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1133
|
+
}, [isOpen]);
|
|
1134
|
+
const handleBackdropClick = (e) => {
|
|
1135
|
+
if (e.target === dialogRef.current) onClose?.();
|
|
1136
|
+
};
|
|
1137
|
+
const handleCancel = (e) => {
|
|
1138
|
+
e.preventDefault();
|
|
1139
|
+
onClose?.();
|
|
1140
|
+
};
|
|
1141
|
+
return /* @__PURE__ */ jsxs17(
|
|
1142
|
+
"dialog",
|
|
1143
|
+
{
|
|
1144
|
+
ref: dialogRef,
|
|
1145
|
+
className: cn23(className, Dialog_default.dialog),
|
|
1146
|
+
onClick: handleBackdropClick,
|
|
1147
|
+
onCancel: handleCancel,
|
|
1148
|
+
children: [
|
|
1149
|
+
/* @__PURE__ */ jsx24("form", { method: "dialog", className: Dialog_default.closeForm, children: /* @__PURE__ */ jsx24(
|
|
1150
|
+
"button",
|
|
1151
|
+
{
|
|
1152
|
+
type: "submit",
|
|
1153
|
+
className: Dialog_default.closeButton,
|
|
1154
|
+
onClick: onClose,
|
|
1155
|
+
"aria-label": "Close dialog",
|
|
1156
|
+
children: /* @__PURE__ */ jsx24("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 6L6 18M6 6l12 12" }) })
|
|
1157
|
+
}
|
|
1158
|
+
) }),
|
|
1159
|
+
children
|
|
1160
|
+
]
|
|
1161
|
+
}
|
|
1162
|
+
);
|
|
1110
1163
|
}
|
|
1111
1164
|
|
|
1112
1165
|
// src/components/interaction/Drawer/Drawer.tsx
|
|
1113
1166
|
import { useEffect as useEffect3, useRef as useRef5 } from "react";
|
|
1114
1167
|
|
|
1115
1168
|
// src/components/interaction/Drawer/Drawer.module.css
|
|
1116
|
-
var Drawer_default = {};
|
|
1169
|
+
var Drawer_default = {"drawer":"bds015-drawer","panel":"bds015-panel","--side_right":"bds015---side_right","--side_left":"bds015---side_left","header":"bds015-header","title":"bds015-title","closeButton":"bds015-closeButton","body":"bds015-body"};
|
|
1117
1170
|
|
|
1118
1171
|
// src/components/interaction/Drawer/Drawer.tsx
|
|
1119
1172
|
import { cn as cn24 } from "@boostdev/design-system-foundation";
|
|
@@ -1182,7 +1235,7 @@ import {
|
|
|
1182
1235
|
} from "react";
|
|
1183
1236
|
|
|
1184
1237
|
// src/components/interaction/DropdownMenu/DropdownMenu.module.css
|
|
1185
|
-
var DropdownMenu_default = {};
|
|
1238
|
+
var DropdownMenu_default = {"wrapper":"bds015-wrapper","menu":"bds015-menu","--placement_bottom-start":"bds015---placement_bottom-start","--placement_bottom-end":"bds015---placement_bottom-end","separator":"bds015-separator","item":"bds015-item","icon":"bds015-icon"};
|
|
1186
1239
|
|
|
1187
1240
|
// src/components/interaction/DropdownMenu/DropdownMenu.tsx
|
|
1188
1241
|
import { cn as cn25 } from "@boostdev/design-system-foundation";
|
|
@@ -1302,7 +1355,7 @@ import {
|
|
|
1302
1355
|
} from "react";
|
|
1303
1356
|
|
|
1304
1357
|
// src/components/interaction/Popover/Popover.module.css
|
|
1305
|
-
var Popover_default = {};
|
|
1358
|
+
var Popover_default = {"wrapper":"bds015-wrapper","panel":"bds015-panel","--placement_bottom":"bds015---placement_bottom","--placement_top":"bds015---placement_top","--placement_right":"bds015---placement_right","--placement_left":"bds015---placement_left"};
|
|
1306
1359
|
|
|
1307
1360
|
// src/components/interaction/Popover/Popover.tsx
|
|
1308
1361
|
import { cn as cn26 } from "@boostdev/design-system-foundation";
|
|
@@ -1358,7 +1411,7 @@ function Popover({
|
|
|
1358
1411
|
}
|
|
1359
1412
|
|
|
1360
1413
|
// src/components/interaction/Rating/Rating.module.css
|
|
1361
|
-
var Rating_default = {};
|
|
1414
|
+
var Rating_default = {"rating":"bds015-rating","star":"bds015-star","--filled":"bds015---filled"};
|
|
1362
1415
|
|
|
1363
1416
|
// src/components/interaction/Rating/Rating.tsx
|
|
1364
1417
|
import { cn as cn27 } from "@boostdev/design-system-foundation";
|
|
@@ -1389,7 +1442,7 @@ function Rating({ value, max = 5, className }) {
|
|
|
1389
1442
|
import { useState as useState7, useEffect as useEffect6, createContext, useContext, useCallback, useMemo as useMemo2 } from "react";
|
|
1390
1443
|
|
|
1391
1444
|
// src/components/interaction/Toast/Toast.module.css
|
|
1392
|
-
var Toast_default = {};
|
|
1445
|
+
var Toast_default = {"toastContainer":"bds015-toastContainer","toast":"bds015-toast","--variant_success":"bds015---variant_success","--variant_error":"bds015---variant_error","--variant_info":"bds015---variant_info","message":"bds015-message","closeButton":"bds015-closeButton"};
|
|
1393
1446
|
|
|
1394
1447
|
// src/components/interaction/Toast/Toast.tsx
|
|
1395
1448
|
import { cn as cn28 } from "@boostdev/design-system-foundation";
|
|
@@ -1422,7 +1475,10 @@ function ToastItem({ toast, onRemove }) {
|
|
|
1422
1475
|
const timer = setTimeout(onRemove, 5e3);
|
|
1423
1476
|
return () => clearTimeout(timer);
|
|
1424
1477
|
}, [onRemove]);
|
|
1425
|
-
return /* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn28(Toast_default.toast, Toast_default[`--variant_${toast.variant}`]), role: "status", children: [
|
|
1479
|
+
/* @__PURE__ */ jsx29("span", { className: Toast_default.message, children: toast.message }),
|
|
1480
|
+
/* @__PURE__ */ jsx29("button", { type: "button", className: Toast_default.closeButton, onClick: onRemove, "aria-label": "Dismiss", children: /* @__PURE__ */ jsx29("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx29("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 6L6 18M6 6l12 12" }) }) })
|
|
1481
|
+
] });
|
|
1426
1482
|
}
|
|
1427
1483
|
function useToast() {
|
|
1428
1484
|
const context = useContext(ToastContext);
|
|
@@ -1436,20 +1492,20 @@ function useToast() {
|
|
|
1436
1492
|
import { useId as useId9 } from "react";
|
|
1437
1493
|
|
|
1438
1494
|
// src/components/interaction/form/Checkbox/Checkbox.module.css
|
|
1439
|
-
var Checkbox_default = {};
|
|
1495
|
+
var Checkbox_default = {"checkboxGroup":"bds015-checkboxGroup","inputWrapper":"bds015-inputWrapper","checkbox":"bds015-checkbox","checkboxError":"bds015-checkboxError"};
|
|
1440
1496
|
|
|
1441
1497
|
// src/components/interaction/form/atoms/Message.module.css
|
|
1442
|
-
var Message_default = {};
|
|
1498
|
+
var Message_default = {"error":"bds015-error","hint":"bds015-hint"};
|
|
1443
1499
|
|
|
1444
1500
|
// src/components/interaction/form/atoms/Message.tsx
|
|
1445
1501
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1446
1502
|
var Message = ({ message, type, inputId }) => {
|
|
1447
1503
|
if (!message) return null;
|
|
1448
|
-
return /* @__PURE__ */ jsx30("
|
|
1504
|
+
return /* @__PURE__ */ jsx30("p", { id: inputId + type, className: Message_default[type], children: message });
|
|
1449
1505
|
};
|
|
1450
1506
|
|
|
1451
1507
|
// src/components/interaction/form/atoms/Label.module.css
|
|
1452
|
-
var Label_default = {};
|
|
1508
|
+
var Label_default = {"label":"bds015-label"};
|
|
1453
1509
|
|
|
1454
1510
|
// src/components/interaction/form/atoms/Label.tsx
|
|
1455
1511
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
@@ -1461,7 +1517,7 @@ var Label = ({ label, id }) => {
|
|
|
1461
1517
|
import { cn as cn30 } from "@boostdev/design-system-foundation";
|
|
1462
1518
|
|
|
1463
1519
|
// src/components/interaction/form/atoms/InputContainer.module.css
|
|
1464
|
-
var InputContainer_default = {};
|
|
1520
|
+
var InputContainer_default = {"container":"bds015-container"};
|
|
1465
1521
|
|
|
1466
1522
|
// src/components/interaction/form/atoms/InputContainer.tsx
|
|
1467
1523
|
import { cn as cn29 } from "@boostdev/design-system-foundation";
|
|
@@ -1476,13 +1532,14 @@ function Checkbox({ label, name, error, hint, className, ...props }) {
|
|
|
1476
1532
|
const id = name + useId9();
|
|
1477
1533
|
const hintId = id + "hint";
|
|
1478
1534
|
const errorId = id + "error";
|
|
1479
|
-
const describedBy =
|
|
1535
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1480
1536
|
return /* @__PURE__ */ jsxs22(InputContainer, { className: cn30(Checkbox_default.checkboxGroup, className), children: [
|
|
1481
1537
|
/* @__PURE__ */ jsxs22("div", { className: Checkbox_default.inputWrapper, children: [
|
|
1482
1538
|
/* @__PURE__ */ jsx33(
|
|
1483
1539
|
"input",
|
|
1484
1540
|
{
|
|
1485
1541
|
"aria-describedby": describedBy,
|
|
1542
|
+
"aria-invalid": !!error,
|
|
1486
1543
|
type: "checkbox",
|
|
1487
1544
|
id,
|
|
1488
1545
|
name,
|
|
@@ -1502,11 +1559,12 @@ import {
|
|
|
1502
1559
|
useEffect as useEffect7,
|
|
1503
1560
|
useId as useId10,
|
|
1504
1561
|
useRef as useRef8,
|
|
1505
|
-
useState as useState8
|
|
1562
|
+
useState as useState8,
|
|
1563
|
+
useMemo as useMemo3
|
|
1506
1564
|
} from "react";
|
|
1507
1565
|
|
|
1508
1566
|
// src/components/interaction/form/Combobox/Combobox.module.css
|
|
1509
|
-
var Combobox_default = {};
|
|
1567
|
+
var Combobox_default = {"formGroup":"bds015-formGroup","inputWrapper":"bds015-inputWrapper","input":"bds015-input","inputError":"bds015-inputError","chevron":"bds015-chevron","listbox":"bds015-listbox","option":"bds015-option","--highlighted":"bds015---highlighted","--selected":"bds015---selected","--disabled":"bds015---disabled"};
|
|
1510
1568
|
|
|
1511
1569
|
// src/components/interaction/form/Combobox/Combobox.tsx
|
|
1512
1570
|
import { cn as cn31 } from "@boostdev/design-system-foundation";
|
|
@@ -1518,6 +1576,7 @@ function Combobox({
|
|
|
1518
1576
|
placeholder,
|
|
1519
1577
|
value,
|
|
1520
1578
|
onChange,
|
|
1579
|
+
disabled = false,
|
|
1521
1580
|
error,
|
|
1522
1581
|
hint,
|
|
1523
1582
|
className
|
|
@@ -1526,9 +1585,12 @@ function Combobox({
|
|
|
1526
1585
|
const listboxId = id + "listbox";
|
|
1527
1586
|
const hintId = id + "hint";
|
|
1528
1587
|
const errorId = id + "error";
|
|
1529
|
-
const describedBy = error
|
|
1530
|
-
const selectedOption = options.find((o) => o.value === value);
|
|
1588
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1589
|
+
const selectedOption = useMemo3(() => options.find((o) => o.value === value), [options, value]);
|
|
1531
1590
|
const [inputValue, setInputValue] = useState8(selectedOption?.label ?? "");
|
|
1591
|
+
useEffect7(() => {
|
|
1592
|
+
setInputValue(selectedOption?.label ?? "");
|
|
1593
|
+
}, [selectedOption]);
|
|
1532
1594
|
const [isOpen, setIsOpen] = useState8(false);
|
|
1533
1595
|
const [highlightedIndex, setHighlightedIndex] = useState8(-1);
|
|
1534
1596
|
const containerRef = useRef8(null);
|
|
@@ -1605,6 +1667,7 @@ function Combobox({
|
|
|
1605
1667
|
autoComplete: "off",
|
|
1606
1668
|
placeholder,
|
|
1607
1669
|
value: inputValue,
|
|
1670
|
+
disabled,
|
|
1608
1671
|
className: cn31(Combobox_default.input, error ? Combobox_default.inputError : void 0),
|
|
1609
1672
|
onChange: handleInputChange,
|
|
1610
1673
|
onKeyDown: handleKeyDown,
|
|
@@ -1652,7 +1715,7 @@ function Combobox({
|
|
|
1652
1715
|
import { useId as useId11, useRef as useRef9, useState as useState9 } from "react";
|
|
1653
1716
|
|
|
1654
1717
|
// src/components/interaction/form/FileInput/FileInput.module.css
|
|
1655
|
-
var FileInput_default = {};
|
|
1718
|
+
var FileInput_default = {"formGroup":"bds015-formGroup","dropZone":"bds015-dropZone","isDragging":"bds015-isDragging","hasError":"bds015-hasError","isDisabled":"bds015-isDisabled","icon":"bds015-icon","prompt":"bds015-prompt","acceptHint":"bds015-acceptHint","hiddenInput":"bds015-hiddenInput"};
|
|
1656
1719
|
|
|
1657
1720
|
// src/components/interaction/form/FileInput/FileInput.tsx
|
|
1658
1721
|
import { cn as cn32 } from "@boostdev/design-system-foundation";
|
|
@@ -1671,10 +1734,19 @@ function FileInput({
|
|
|
1671
1734
|
const uid = name + useId11();
|
|
1672
1735
|
const hintId = uid + "hint";
|
|
1673
1736
|
const errorId = uid + "error";
|
|
1674
|
-
const describedBy = error
|
|
1737
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1675
1738
|
const inputRef = useRef9(null);
|
|
1676
1739
|
const [isDragging, setIsDragging] = useState9(false);
|
|
1677
1740
|
const [fileNames, setFileNames] = useState9([]);
|
|
1741
|
+
const isFileAccepted = (file) => {
|
|
1742
|
+
if (!accept) return true;
|
|
1743
|
+
return accept.split(",").some((token) => {
|
|
1744
|
+
const t = token.trim();
|
|
1745
|
+
if (t.startsWith(".")) return file.name.toLowerCase().endsWith(t.toLowerCase());
|
|
1746
|
+
if (t.endsWith("/*")) return file.type.startsWith(t.slice(0, -1));
|
|
1747
|
+
return file.type === t;
|
|
1748
|
+
});
|
|
1749
|
+
};
|
|
1678
1750
|
const handleFiles = (files) => {
|
|
1679
1751
|
if (!files) return;
|
|
1680
1752
|
setFileNames(Array.from(files).map((f) => f.name));
|
|
@@ -1685,7 +1757,10 @@ function FileInput({
|
|
|
1685
1757
|
e.preventDefault();
|
|
1686
1758
|
setIsDragging(false);
|
|
1687
1759
|
if (disabled) return;
|
|
1688
|
-
|
|
1760
|
+
const dt = new DataTransfer();
|
|
1761
|
+
Array.from(e.dataTransfer.files).filter(isFileAccepted).forEach((f) => dt.items.add(f));
|
|
1762
|
+
if (inputRef.current) inputRef.current.files = dt.files;
|
|
1763
|
+
handleFiles(dt.files.length > 0 ? dt.files : null);
|
|
1689
1764
|
};
|
|
1690
1765
|
const handleDragOver = (e) => {
|
|
1691
1766
|
e.preventDefault();
|
|
@@ -1737,7 +1812,7 @@ function FileInput({
|
|
|
1737
1812
|
import { useId as useId12 } from "react";
|
|
1738
1813
|
|
|
1739
1814
|
// src/components/interaction/form/FormInput/FormInput.module.css
|
|
1740
|
-
var FormInput_default = {};
|
|
1815
|
+
var FormInput_default = {"formGroup":"bds015-formGroup","input":"bds015-input","inputError":"bds015-inputError"};
|
|
1741
1816
|
|
|
1742
1817
|
// src/components/interaction/form/FormInput/FormInput.tsx
|
|
1743
1818
|
import { cn as cn33 } from "@boostdev/design-system-foundation";
|
|
@@ -1754,7 +1829,7 @@ function FormInput({
|
|
|
1754
1829
|
const id = name + useId12();
|
|
1755
1830
|
const hintId = id + "hint";
|
|
1756
1831
|
const errorId = id + "error";
|
|
1757
|
-
const describedBy =
|
|
1832
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1758
1833
|
return /* @__PURE__ */ jsxs25(InputContainer, { className: cn33(FormInput_default.formGroup, className), children: [
|
|
1759
1834
|
/* @__PURE__ */ jsx36(Label, { id, label }),
|
|
1760
1835
|
/* @__PURE__ */ jsx36(
|
|
@@ -1775,10 +1850,10 @@ function FormInput({
|
|
|
1775
1850
|
}
|
|
1776
1851
|
|
|
1777
1852
|
// src/components/interaction/form/NumberInput/NumberInput.tsx
|
|
1778
|
-
import { useId as useId13, useRef as useRef10 } from "react";
|
|
1853
|
+
import { useId as useId13, useRef as useRef10, useState as useState10 } from "react";
|
|
1779
1854
|
|
|
1780
1855
|
// src/components/interaction/form/NumberInput/NumberInput.module.css
|
|
1781
|
-
var NumberInput_default = {};
|
|
1856
|
+
var NumberInput_default = {"formGroup":"bds015-formGroup","inputRow":"bds015-inputRow","input":"bds015-input","inputError":"bds015-inputError","stepper":"bds015-stepper"};
|
|
1782
1857
|
|
|
1783
1858
|
// src/components/interaction/form/NumberInput/NumberInput.tsx
|
|
1784
1859
|
import { cn as cn34 } from "@boostdev/design-system-foundation";
|
|
@@ -1800,18 +1875,18 @@ function NumberInput({
|
|
|
1800
1875
|
const uid = name + useId13();
|
|
1801
1876
|
const hintId = uid + "hint";
|
|
1802
1877
|
const errorId = uid + "error";
|
|
1803
|
-
const describedBy = error
|
|
1878
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1804
1879
|
const inputRef = useRef10(null);
|
|
1880
|
+
const isControlled = value !== void 0;
|
|
1881
|
+
const [internalValue, setInternalValue] = useState10(defaultValue ?? 0);
|
|
1882
|
+
const currentValue = isControlled ? value : internalValue;
|
|
1805
1883
|
const clamp = (v) => {
|
|
1806
1884
|
const withMin = min !== void 0 ? Math.max(min, v) : v;
|
|
1807
|
-
|
|
1808
|
-
return withMax;
|
|
1885
|
+
return max !== void 0 ? Math.min(max, withMin) : withMin;
|
|
1809
1886
|
};
|
|
1810
1887
|
const adjust = (delta) => {
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
const next = clamp(current + delta);
|
|
1814
|
-
inputRef.current.value = String(next);
|
|
1888
|
+
const next = clamp(currentValue + delta);
|
|
1889
|
+
if (!isControlled) setInternalValue(next);
|
|
1815
1890
|
onChange?.(next);
|
|
1816
1891
|
};
|
|
1817
1892
|
return /* @__PURE__ */ jsxs26(InputContainer, { className: cn34(NumberInput_default.formGroup, className), children: [
|
|
@@ -1823,7 +1898,7 @@ function NumberInput({
|
|
|
1823
1898
|
type: "button",
|
|
1824
1899
|
className: NumberInput_default.stepper,
|
|
1825
1900
|
"aria-label": "Decrease",
|
|
1826
|
-
disabled: disabled || min !== void 0 &&
|
|
1901
|
+
disabled: disabled || min !== void 0 && currentValue <= min,
|
|
1827
1902
|
onClick: () => adjust(-step),
|
|
1828
1903
|
tabIndex: -1,
|
|
1829
1904
|
children: /* @__PURE__ */ jsx37("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx37("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14" }) })
|
|
@@ -1836,8 +1911,7 @@ function NumberInput({
|
|
|
1836
1911
|
id: uid,
|
|
1837
1912
|
type: "number",
|
|
1838
1913
|
name,
|
|
1839
|
-
defaultValue,
|
|
1840
|
-
value,
|
|
1914
|
+
...isControlled ? { value } : { defaultValue },
|
|
1841
1915
|
min,
|
|
1842
1916
|
max,
|
|
1843
1917
|
step,
|
|
@@ -1845,7 +1919,11 @@ function NumberInput({
|
|
|
1845
1919
|
"aria-invalid": !!error,
|
|
1846
1920
|
"aria-describedby": describedBy,
|
|
1847
1921
|
className: cn34(NumberInput_default.input, error ? NumberInput_default.inputError : void 0),
|
|
1848
|
-
onChange: (e) =>
|
|
1922
|
+
onChange: (e) => {
|
|
1923
|
+
const v = parseFloat(e.target.value);
|
|
1924
|
+
if (!isControlled) setInternalValue(isNaN(v) ? 0 : v);
|
|
1925
|
+
onChange?.(v);
|
|
1926
|
+
}
|
|
1849
1927
|
}
|
|
1850
1928
|
),
|
|
1851
1929
|
/* @__PURE__ */ jsx37(
|
|
@@ -1854,7 +1932,7 @@ function NumberInput({
|
|
|
1854
1932
|
type: "button",
|
|
1855
1933
|
className: NumberInput_default.stepper,
|
|
1856
1934
|
"aria-label": "Increase",
|
|
1857
|
-
disabled: disabled || max !== void 0 &&
|
|
1935
|
+
disabled: disabled || max !== void 0 && currentValue >= max,
|
|
1858
1936
|
onClick: () => adjust(step),
|
|
1859
1937
|
tabIndex: -1,
|
|
1860
1938
|
children: /* @__PURE__ */ jsx37("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx37("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 5v14M5 12h14" }) })
|
|
@@ -1870,7 +1948,7 @@ function NumberInput({
|
|
|
1870
1948
|
import { useId as useId14 } from "react";
|
|
1871
1949
|
|
|
1872
1950
|
// src/components/interaction/form/Radio/Radio.module.css
|
|
1873
|
-
var Radio_default = {};
|
|
1951
|
+
var Radio_default = {"radioGroup":"bds015-radioGroup","inputWrapper":"bds015-inputWrapper","radio":"bds015-radio","radioError":"bds015-radioError"};
|
|
1874
1952
|
|
|
1875
1953
|
// src/components/interaction/form/Radio/Radio.tsx
|
|
1876
1954
|
import { cn as cn35 } from "@boostdev/design-system-foundation";
|
|
@@ -1879,13 +1957,14 @@ function Radio({ label, name, error, hint, className, ...props }) {
|
|
|
1879
1957
|
const id = name + useId14();
|
|
1880
1958
|
const hintId = id + "hint";
|
|
1881
1959
|
const errorId = id + "error";
|
|
1882
|
-
const describedBy =
|
|
1960
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1883
1961
|
return /* @__PURE__ */ jsxs27(InputContainer, { className: cn35(Radio_default.radioGroup, className), children: [
|
|
1884
1962
|
/* @__PURE__ */ jsxs27("div", { className: Radio_default.inputWrapper, children: [
|
|
1885
1963
|
/* @__PURE__ */ jsx38(
|
|
1886
1964
|
"input",
|
|
1887
1965
|
{
|
|
1888
1966
|
"aria-describedby": describedBy,
|
|
1967
|
+
"aria-invalid": !!error,
|
|
1889
1968
|
type: "radio",
|
|
1890
1969
|
id,
|
|
1891
1970
|
name,
|
|
@@ -1904,7 +1983,7 @@ function Radio({ label, name, error, hint, className, ...props }) {
|
|
|
1904
1983
|
import { useId as useId15 } from "react";
|
|
1905
1984
|
|
|
1906
1985
|
// src/components/interaction/form/Select/Select.module.css
|
|
1907
|
-
var Select_default = {};
|
|
1986
|
+
var Select_default = {"formGroup":"bds015-formGroup","selectWrapper":"bds015-selectWrapper","select":"bds015-select","selectError":"bds015-selectError","chevron":"bds015-chevron"};
|
|
1908
1987
|
|
|
1909
1988
|
// src/components/interaction/form/Select/Select.tsx
|
|
1910
1989
|
import { cn as cn36 } from "@boostdev/design-system-foundation";
|
|
@@ -1922,7 +2001,7 @@ function Select({
|
|
|
1922
2001
|
const id = name + useId15();
|
|
1923
2002
|
const hintId = id + "hint";
|
|
1924
2003
|
const errorId = id + "error";
|
|
1925
|
-
const describedBy = error
|
|
2004
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
1926
2005
|
return /* @__PURE__ */ jsxs28(InputContainer, { className: cn36(Select_default.formGroup, className), children: [
|
|
1927
2006
|
/* @__PURE__ */ jsx39(Label, { id, label }),
|
|
1928
2007
|
/* @__PURE__ */ jsxs28("div", { className: Select_default.selectWrapper, children: [
|
|
@@ -1936,7 +2015,7 @@ function Select({
|
|
|
1936
2015
|
className: cn36(Select_default.select, error ? Select_default.selectError : void 0),
|
|
1937
2016
|
...props,
|
|
1938
2017
|
children: [
|
|
1939
|
-
placeholder && /* @__PURE__ */ jsx39("option", { value: "", disabled: true, children: placeholder }),
|
|
2018
|
+
placeholder && /* @__PURE__ */ jsx39("option", { value: "", disabled: true, hidden: true, children: placeholder }),
|
|
1940
2019
|
options.map(({ value, label: optLabel, disabled }) => /* @__PURE__ */ jsx39("option", { value, disabled, children: optLabel }, value))
|
|
1941
2020
|
]
|
|
1942
2021
|
}
|
|
@@ -1949,10 +2028,10 @@ function Select({
|
|
|
1949
2028
|
}
|
|
1950
2029
|
|
|
1951
2030
|
// src/components/interaction/form/Slider/Slider.tsx
|
|
1952
|
-
import { useId as useId16, useState as
|
|
2031
|
+
import { useId as useId16, useState as useState11 } from "react";
|
|
1953
2032
|
|
|
1954
2033
|
// src/components/interaction/form/Slider/Slider.module.css
|
|
1955
|
-
var Slider_default = {};
|
|
2034
|
+
var Slider_default = {"formGroup":"bds015-formGroup","labelRow":"bds015-labelRow","value":"bds015-value","slider":"bds015-slider","sliderError":"bds015-sliderError"};
|
|
1956
2035
|
|
|
1957
2036
|
// src/components/interaction/form/Slider/Slider.tsx
|
|
1958
2037
|
import { cn as cn37 } from "@boostdev/design-system-foundation";
|
|
@@ -1972,12 +2051,13 @@ function Slider({
|
|
|
1972
2051
|
const id = name + useId16();
|
|
1973
2052
|
const hintId = id + "hint";
|
|
1974
2053
|
const errorId = id + "error";
|
|
1975
|
-
const describedBy = error
|
|
1976
|
-
const
|
|
1977
|
-
const [
|
|
2054
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2055
|
+
const isControlled = props.value !== void 0;
|
|
2056
|
+
const [internalValue, setInternalValue] = useState11(Number(props.defaultValue ?? min));
|
|
2057
|
+
const currentValue = isControlled ? Number(props.value) : internalValue;
|
|
1978
2058
|
const fillPct = (currentValue - min) / (max - min) * 100;
|
|
1979
2059
|
const handleChange = (e) => {
|
|
1980
|
-
|
|
2060
|
+
if (!isControlled) setInternalValue(Number(e.target.value));
|
|
1981
2061
|
onChange?.(e);
|
|
1982
2062
|
};
|
|
1983
2063
|
return /* @__PURE__ */ jsxs29(InputContainer, { className: cn37(Slider_default.formGroup, className), children: [
|
|
@@ -2012,7 +2092,7 @@ function Slider({
|
|
|
2012
2092
|
import { useId as useId17 } from "react";
|
|
2013
2093
|
|
|
2014
2094
|
// src/components/interaction/form/Switch/Switch.module.css
|
|
2015
|
-
var Switch_default = {};
|
|
2095
|
+
var Switch_default = {"switchGroup":"bds015-switchGroup","--size_small":"bds015---size_small","--size_medium":"bds015---size_medium","--size_large":"bds015---size_large","inputWrapper":"bds015-inputWrapper","trackWrapper":"bds015-trackWrapper","switch":"bds015-switch","track":"bds015-track","thumb":"bds015-thumb","switchError":"bds015-switchError"};
|
|
2016
2096
|
|
|
2017
2097
|
// src/components/interaction/form/Switch/Switch.tsx
|
|
2018
2098
|
import { cn as cn38 } from "@boostdev/design-system-foundation";
|
|
@@ -2029,7 +2109,7 @@ function Switch({
|
|
|
2029
2109
|
const id = name + useId17();
|
|
2030
2110
|
const hintId = id + "hint";
|
|
2031
2111
|
const errorId = id + "error";
|
|
2032
|
-
const describedBy = error
|
|
2112
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2033
2113
|
return /* @__PURE__ */ jsxs30(InputContainer, { className: cn38(Switch_default.switchGroup, Switch_default[`--size_${size}`], className), children: [
|
|
2034
2114
|
/* @__PURE__ */ jsxs30("div", { className: Switch_default.inputWrapper, children: [
|
|
2035
2115
|
/* @__PURE__ */ jsxs30("div", { className: Switch_default.trackWrapper, children: [
|
|
@@ -2058,7 +2138,7 @@ function Switch({
|
|
|
2058
2138
|
import { useId as useId18 } from "react";
|
|
2059
2139
|
|
|
2060
2140
|
// src/components/interaction/form/Textarea/Textarea.module.css
|
|
2061
|
-
var Textarea_default = {};
|
|
2141
|
+
var Textarea_default = {"formGroup":"bds015-formGroup","textarea":"bds015-textarea","textareaError":"bds015-textareaError"};
|
|
2062
2142
|
|
|
2063
2143
|
// src/components/interaction/form/Textarea/Textarea.tsx
|
|
2064
2144
|
import { cn as cn39 } from "@boostdev/design-system-foundation";
|
|
@@ -2074,7 +2154,7 @@ function Textarea({
|
|
|
2074
2154
|
const id = name + useId18();
|
|
2075
2155
|
const hintId = id + "hint";
|
|
2076
2156
|
const errorId = id + "error";
|
|
2077
|
-
const describedBy = error
|
|
2157
|
+
const describedBy = [error && errorId, hint && hintId].filter(Boolean).join(" ") || void 0;
|
|
2078
2158
|
return /* @__PURE__ */ jsxs31(InputContainer, { className: cn39(Textarea_default.formGroup, className), children: [
|
|
2079
2159
|
/* @__PURE__ */ jsx42(Label, { id, label }),
|
|
2080
2160
|
/* @__PURE__ */ jsx42(
|
|
@@ -2094,17 +2174,17 @@ function Textarea({
|
|
|
2094
2174
|
}
|
|
2095
2175
|
|
|
2096
2176
|
// src/components/layout/ButtonGroup/ButtonGroup.module.css
|
|
2097
|
-
var ButtonGroup_default = {};
|
|
2177
|
+
var ButtonGroup_default = {"buttonGroup":"bds015-buttonGroup","container":"bds015-container","--variant__card":"bds015---variant__card","--variant__flow":"bds015---variant__flow","--variant__modal":"bds015---variant__modal","--variant__content":"bds015---variant__content","--variant__grid":"bds015---variant__grid"};
|
|
2098
2178
|
|
|
2099
2179
|
// src/components/layout/ButtonGroup/ButtonGroup.tsx
|
|
2100
2180
|
import { cn as cn40 } from "@boostdev/design-system-foundation";
|
|
2101
2181
|
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2102
2182
|
function ButtonGroup({ children, className, variant }) {
|
|
2103
|
-
return /* @__PURE__ */ jsx43("div", { className: cn40(ButtonGroup_default.buttonGroup, className, variant && ButtonGroup_default[`--
|
|
2183
|
+
return /* @__PURE__ */ jsx43("div", { className: cn40(ButtonGroup_default.buttonGroup, className, variant && ButtonGroup_default[`--variant_${variant}`]), children: /* @__PURE__ */ jsx43("div", { className: ButtonGroup_default.container, children }) });
|
|
2104
2184
|
}
|
|
2105
2185
|
|
|
2106
2186
|
// src/components/layout/Card/Card.module.css
|
|
2107
|
-
var Card_default = {};
|
|
2187
|
+
var Card_default = {"card":"bds015-card","--default":"bds015---default","--elevated":"bds015---elevated","--outlined":"bds015---outlined","--clickable":"bds015---clickable","--padding-none":"bds015---padding-none","--padding-small":"bds015---padding-small","--padding-medium":"bds015---padding-medium","--padding-large":"bds015---padding-large","--text-start":"bds015---text-start","--text-center":"bds015---text-center","--text-end":"bds015---text-end"};
|
|
2108
2188
|
|
|
2109
2189
|
// src/components/layout/Card/Card.tsx
|
|
2110
2190
|
import { cn as cn41 } from "@boostdev/design-system-foundation";
|
|
@@ -2116,7 +2196,8 @@ function Card({
|
|
|
2116
2196
|
padding = "medium",
|
|
2117
2197
|
textAlign = "start",
|
|
2118
2198
|
style,
|
|
2119
|
-
onClick
|
|
2199
|
+
onClick,
|
|
2200
|
+
"aria-label": ariaLabel
|
|
2120
2201
|
}) {
|
|
2121
2202
|
const classNames = cn41(
|
|
2122
2203
|
Card_default.card,
|
|
@@ -2133,6 +2214,7 @@ function Card({
|
|
|
2133
2214
|
className: classNames,
|
|
2134
2215
|
onClick,
|
|
2135
2216
|
style,
|
|
2217
|
+
"aria-label": ariaLabel,
|
|
2136
2218
|
...onClick && { type: "button" },
|
|
2137
2219
|
children
|
|
2138
2220
|
}
|
|
@@ -2140,7 +2222,7 @@ function Card({
|
|
|
2140
2222
|
}
|
|
2141
2223
|
|
|
2142
2224
|
// src/components/layout/SectionHeader/SectionHeader.module.css
|
|
2143
|
-
var SectionHeader_default = {};
|
|
2225
|
+
var SectionHeader_default = {"sectionHeader":"bds015-sectionHeader","title":"bds015-title","subtitle":"bds015-subtitle","--start":"bds015---start","--center":"bds015---center","--end":"bds015---end","--small":"bds015---small","--medium":"bds015---medium","--large":"bds015---large"};
|
|
2144
2226
|
|
|
2145
2227
|
// src/components/layout/SectionHeader/SectionHeader.tsx
|
|
2146
2228
|
import { cn as cn42 } from "@boostdev/design-system-foundation";
|
|
@@ -2161,7 +2243,7 @@ function SectionHeader({
|
|
|
2161
2243
|
}
|
|
2162
2244
|
|
|
2163
2245
|
// src/components/layout/IconWrapper/IconWrapper.module.css
|
|
2164
|
-
var IconWrapper_default = {};
|
|
2246
|
+
var IconWrapper_default = {"wrapper":"bds015-wrapper"};
|
|
2165
2247
|
|
|
2166
2248
|
// src/components/layout/IconWrapper/IconWrapper.tsx
|
|
2167
2249
|
import { cn as cn43 } from "@boostdev/design-system-foundation";
|