@dev-dga/react 0.8.0 → 0.8.1
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +855 -486
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +106 -12
- package/dist/index.d.ts +106 -12
- package/dist/index.js +815 -429
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@ __export(src_exports, {
|
|
|
27
27
|
Alert: () => Alert,
|
|
28
28
|
AlertDescription: () => AlertDescription,
|
|
29
29
|
AlertTitle: () => AlertTitle,
|
|
30
|
+
AspectRatio: () => AspectRatio,
|
|
30
31
|
Avatar: () => Avatar,
|
|
31
32
|
AvatarFallback: () => AvatarFallback,
|
|
32
33
|
AvatarGroup: () => AvatarGroup,
|
|
@@ -65,6 +66,7 @@ __export(src_exports, {
|
|
|
65
66
|
CommandList: () => CommandList,
|
|
66
67
|
CommandSeparator: () => CommandSeparator,
|
|
67
68
|
DatePicker: () => DatePicker,
|
|
69
|
+
DateRangePicker: () => DateRangePicker,
|
|
68
70
|
DescriptionDetails: () => DescriptionDetails,
|
|
69
71
|
DescriptionItem: () => DescriptionItem,
|
|
70
72
|
DescriptionList: () => DescriptionList,
|
|
@@ -237,6 +239,8 @@ __export(src_exports, {
|
|
|
237
239
|
createToast: () => createToast,
|
|
238
240
|
createToastStore: () => createToastStore,
|
|
239
241
|
datePickerVariants: () => datePickerVariants,
|
|
242
|
+
dateRangePickerTriggerVariants: () => dateRangePickerTriggerVariants,
|
|
243
|
+
dateRangePickerVariants: () => dateRangePickerVariants,
|
|
240
244
|
descriptionListVariants: () => descriptionListVariants,
|
|
241
245
|
dividerVariants: () => dividerVariants,
|
|
242
246
|
drawerVariants: () => drawerVariants,
|
|
@@ -1340,6 +1344,8 @@ function Select({
|
|
|
1340
1344
|
placeholder,
|
|
1341
1345
|
className,
|
|
1342
1346
|
children,
|
|
1347
|
+
"aria-label": ariaLabel,
|
|
1348
|
+
"aria-labelledby": ariaLabelledby,
|
|
1343
1349
|
...rootProps
|
|
1344
1350
|
}) {
|
|
1345
1351
|
const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
|
|
@@ -1349,8 +1355,8 @@ function Select({
|
|
|
1349
1355
|
error,
|
|
1350
1356
|
errorMessage,
|
|
1351
1357
|
helperText,
|
|
1352
|
-
"aria-label":
|
|
1353
|
-
"aria-labelledby":
|
|
1358
|
+
"aria-label": ariaLabel,
|
|
1359
|
+
"aria-labelledby": ariaLabelledby
|
|
1354
1360
|
});
|
|
1355
1361
|
const ctx = (0, import_react5.useContext)(DgaContext);
|
|
1356
1362
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
@@ -1364,6 +1370,8 @@ function Select({
|
|
|
1364
1370
|
import_radix_ui5.Select.Trigger,
|
|
1365
1371
|
{
|
|
1366
1372
|
...controlProps,
|
|
1373
|
+
"aria-label": ariaLabel,
|
|
1374
|
+
"aria-labelledby": ariaLabelledby,
|
|
1367
1375
|
"data-slot": "select-trigger",
|
|
1368
1376
|
className: cn(selectTriggerVariants({ size, error: hasError }), className),
|
|
1369
1377
|
children: [
|
|
@@ -1692,7 +1700,7 @@ function Avatar({ size, shape, status, statusLabel, className, children, ...prop
|
|
|
1692
1700
|
"span",
|
|
1693
1701
|
{
|
|
1694
1702
|
className: cn("ddga-avatar__status", `ddga-avatar__status--${status}`),
|
|
1695
|
-
role: "
|
|
1703
|
+
role: "img",
|
|
1696
1704
|
"aria-label": statusLabel ?? status
|
|
1697
1705
|
}
|
|
1698
1706
|
) : null
|
|
@@ -2753,6 +2761,11 @@ function CircularProgress({
|
|
|
2753
2761
|
className,
|
|
2754
2762
|
...props
|
|
2755
2763
|
}) {
|
|
2764
|
+
if (process.env.NODE_ENV === "development" && !props["aria-label"] && !props["aria-labelledby"]) {
|
|
2765
|
+
console.warn(
|
|
2766
|
+
"[dga/Progress] <CircularProgress> has no accessible name. Pass `aria-label` or `aria-labelledby` so screen-reader users know what the progress represents."
|
|
2767
|
+
);
|
|
2768
|
+
}
|
|
2756
2769
|
const isIndeterminate = value === null;
|
|
2757
2770
|
const isSegmented = typeof segments === "number" && segments >= 2;
|
|
2758
2771
|
const sizeKey = size ?? "md";
|
|
@@ -3351,26 +3364,18 @@ function ComboboxSeparator({ className, ...props }) {
|
|
|
3351
3364
|
}
|
|
3352
3365
|
|
|
3353
3366
|
// src/components/DatePicker/DatePicker.tsx
|
|
3367
|
+
var import_react18 = require("react");
|
|
3368
|
+
var import_react_aria_components2 = require("react-aria-components");
|
|
3369
|
+
var import_date2 = require("@internationalized/date");
|
|
3370
|
+
var import_class_variance_authority27 = require("class-variance-authority");
|
|
3371
|
+
|
|
3372
|
+
// src/internal/calendar/calendar-core.tsx
|
|
3354
3373
|
var import_react17 = require("react");
|
|
3355
3374
|
var import_react_aria_components = require("react-aria-components");
|
|
3356
3375
|
var import_date = require("@internationalized/date");
|
|
3357
|
-
var import_class_variance_authority27 = require("class-variance-authority");
|
|
3358
3376
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3359
|
-
var
|
|
3360
|
-
|
|
3361
|
-
size: {
|
|
3362
|
-
sm: "ddga-date-picker-trigger--sm",
|
|
3363
|
-
md: "ddga-date-picker-trigger--md"
|
|
3364
|
-
},
|
|
3365
|
-
error: {
|
|
3366
|
-
true: "ddga-date-picker-trigger--error"
|
|
3367
|
-
}
|
|
3368
|
-
},
|
|
3369
|
-
defaultVariants: {
|
|
3370
|
-
size: "md"
|
|
3371
|
-
}
|
|
3372
|
-
});
|
|
3373
|
-
var datePickerVariants = datePickerTriggerVariants;
|
|
3377
|
+
var GREGORIAN = new import_date.GregorianCalendar();
|
|
3378
|
+
var ISLAMIC_UMALQURA = new import_date.IslamicUmalquraCalendar();
|
|
3374
3379
|
function dateToCalendarDate(date) {
|
|
3375
3380
|
if (!date) return null;
|
|
3376
3381
|
return new import_date.CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
@@ -3388,14 +3393,91 @@ function composeLocale(dgaLocale, calendar) {
|
|
|
3388
3393
|
}
|
|
3389
3394
|
return isArabic ? `${base}-u-nu-latn` : base;
|
|
3390
3395
|
}
|
|
3391
|
-
var GREGORIAN = new import_date.GregorianCalendar();
|
|
3392
|
-
var ISLAMIC_UMALQURA = new import_date.IslamicUmalquraCalendar();
|
|
3393
3396
|
function secondaryDayNumber(date, mainCalendar) {
|
|
3394
3397
|
const other = mainCalendar === "hijri" ? GREGORIAN : ISLAMIC_UMALQURA;
|
|
3395
3398
|
return (0, import_date.toCalendar)(date, other).day;
|
|
3396
3399
|
}
|
|
3400
|
+
function useCalendarChrome(calendarSystem, calendarLabels) {
|
|
3401
|
+
const dgaCtx = (0, import_react17.useContext)(DgaContext);
|
|
3402
|
+
const dgaLocale = dgaCtx?.locale ?? "en";
|
|
3403
|
+
const dir = dgaCtx?.dir ?? "ltr";
|
|
3404
|
+
const locale = (0, import_react17.useMemo)(
|
|
3405
|
+
() => composeLocale(dgaLocale, calendarSystem),
|
|
3406
|
+
[dgaLocale, calendarSystem]
|
|
3407
|
+
);
|
|
3408
|
+
const portalContainer = dgaCtx?.portalEl ?? dgaCtx?.rootEl ?? void 0;
|
|
3409
|
+
const PrevChevron = dir === "rtl" ? ChevronRight : ChevronLeft;
|
|
3410
|
+
const NextChevron = dir === "rtl" ? ChevronLeft : ChevronRight;
|
|
3411
|
+
const resolvedLabels = (0, import_react17.useMemo)(() => {
|
|
3412
|
+
if (calendarLabels) return calendarLabels;
|
|
3413
|
+
return dgaLocale.startsWith("ar") ? { gregorian: "\u0645\u064A\u0644\u0627\u062F\u064A", hijri: "\u0647\u062C\u0631\u064A" } : { gregorian: "Gregorian", hijri: "Hijri" };
|
|
3414
|
+
}, [calendarLabels, dgaLocale]);
|
|
3415
|
+
const navLabels = (0, import_react17.useMemo)(
|
|
3416
|
+
() => dgaLocale.startsWith("ar") ? { month: "\u0627\u0644\u0634\u0647\u0631", year: "\u0627\u0644\u0633\u0646\u0629" } : { month: "Month", year: "Year" },
|
|
3417
|
+
[dgaLocale]
|
|
3418
|
+
);
|
|
3419
|
+
const a11yLabels = (0, import_react17.useMemo)(
|
|
3420
|
+
() => dgaLocale.startsWith("ar") ? { openCalendar: "\u0641\u062A\u062D \u0627\u0644\u062A\u0642\u0648\u064A\u0645", calendarSystem: "\u0646\u0638\u0627\u0645 \u0627\u0644\u062A\u0642\u0648\u064A\u0645" } : { openCalendar: "Open calendar", calendarSystem: "Calendar system" },
|
|
3421
|
+
[dgaLocale]
|
|
3422
|
+
);
|
|
3423
|
+
return {
|
|
3424
|
+
dgaLocale,
|
|
3425
|
+
dir,
|
|
3426
|
+
locale,
|
|
3427
|
+
portalContainer,
|
|
3428
|
+
PrevChevron,
|
|
3429
|
+
NextChevron,
|
|
3430
|
+
resolvedLabels,
|
|
3431
|
+
navLabels,
|
|
3432
|
+
a11yLabels
|
|
3433
|
+
};
|
|
3434
|
+
}
|
|
3435
|
+
function CalendarSystemToggle({
|
|
3436
|
+
value,
|
|
3437
|
+
onChange,
|
|
3438
|
+
labels,
|
|
3439
|
+
groupLabel
|
|
3440
|
+
}) {
|
|
3441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3442
|
+
"div",
|
|
3443
|
+
{
|
|
3444
|
+
role: "tablist",
|
|
3445
|
+
"aria-label": groupLabel,
|
|
3446
|
+
className: "ddga-calendar-toggle",
|
|
3447
|
+
"data-slot": "calendar-toggle",
|
|
3448
|
+
children: [
|
|
3449
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3450
|
+
"button",
|
|
3451
|
+
{
|
|
3452
|
+
type: "button",
|
|
3453
|
+
role: "tab",
|
|
3454
|
+
"aria-selected": value === "gregorian",
|
|
3455
|
+
className: "ddga-calendar-toggle__button",
|
|
3456
|
+
"data-active": value === "gregorian" ? "" : void 0,
|
|
3457
|
+
onClick: () => onChange("gregorian"),
|
|
3458
|
+
children: labels.gregorian
|
|
3459
|
+
}
|
|
3460
|
+
),
|
|
3461
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3462
|
+
"button",
|
|
3463
|
+
{
|
|
3464
|
+
type: "button",
|
|
3465
|
+
role: "tab",
|
|
3466
|
+
"aria-selected": value === "hijri",
|
|
3467
|
+
className: "ddga-calendar-toggle__button",
|
|
3468
|
+
"data-active": value === "hijri" ? "" : void 0,
|
|
3469
|
+
onClick: () => onChange("hijri"),
|
|
3470
|
+
children: labels.hijri
|
|
3471
|
+
}
|
|
3472
|
+
)
|
|
3473
|
+
]
|
|
3474
|
+
}
|
|
3475
|
+
);
|
|
3476
|
+
}
|
|
3397
3477
|
function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
3398
|
-
const
|
|
3478
|
+
const rangeState = (0, import_react17.useContext)(import_react_aria_components.RangeCalendarStateContext);
|
|
3479
|
+
const singleState = (0, import_react17.useContext)(import_react_aria_components.CalendarStateContext);
|
|
3480
|
+
const state = rangeState ?? singleState;
|
|
3399
3481
|
const focusedDate = state?.focusedDate ?? null;
|
|
3400
3482
|
const focusedYear = focusedDate?.year ?? 0;
|
|
3401
3483
|
const focusedCalendar = focusedDate?.calendar ?? GREGORIAN;
|
|
@@ -3420,13 +3502,13 @@ function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
|
3420
3502
|
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
3421
3503
|
}, [focusedDate, focusedCalendar, focusedYear, minValue, maxValue]);
|
|
3422
3504
|
if (!state || !focusedDate) return null;
|
|
3423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ddga-
|
|
3505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "ddga-calendar__nav-selects", "data-slot": "calendar-nav", children: [
|
|
3424
3506
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3425
3507
|
"select",
|
|
3426
3508
|
{
|
|
3427
3509
|
"aria-label": monthLabel,
|
|
3428
|
-
className: "ddga-
|
|
3429
|
-
"data-slot": "
|
|
3510
|
+
className: "ddga-calendar__select ddga-calendar__month-select",
|
|
3511
|
+
"data-slot": "calendar-month-select",
|
|
3430
3512
|
value: focusedDate.month,
|
|
3431
3513
|
onChange: (e) => state.setFocusedDate(focusedDate.set({ month: Number(e.target.value) })),
|
|
3432
3514
|
children: monthNames.map((name, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: i + 1, children: name }, i + 1))
|
|
@@ -3436,8 +3518,8 @@ function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
|
3436
3518
|
"select",
|
|
3437
3519
|
{
|
|
3438
3520
|
"aria-label": yearLabel,
|
|
3439
|
-
className: "ddga-
|
|
3440
|
-
"data-slot": "
|
|
3521
|
+
className: "ddga-calendar__select ddga-calendar__year-select",
|
|
3522
|
+
"data-slot": "calendar-year-select",
|
|
3441
3523
|
value: focusedDate.year,
|
|
3442
3524
|
onChange: (e) => state.setFocusedDate(focusedDate.set({ year: Number(e.target.value) })),
|
|
3443
3525
|
children: yearOptions.map((y) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: y, children: y }, y))
|
|
@@ -3445,8 +3527,33 @@ function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
|
3445
3527
|
)
|
|
3446
3528
|
] });
|
|
3447
3529
|
}
|
|
3530
|
+
function renderDayContent(primary, opts) {
|
|
3531
|
+
if (!opts.showSecondary) return primary;
|
|
3532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
3533
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ddga-calendar__cell-primary", children: primary }),
|
|
3534
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { "aria-hidden": "true", className: "ddga-calendar__cell-secondary", children: secondaryDayNumber(opts.date, opts.calendarSystem) })
|
|
3535
|
+
] });
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
// src/components/DatePicker/DatePicker.tsx
|
|
3539
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3540
|
+
var datePickerTriggerVariants = (0, import_class_variance_authority27.cva)("ddga-date-picker-trigger", {
|
|
3541
|
+
variants: {
|
|
3542
|
+
size: {
|
|
3543
|
+
sm: "ddga-date-picker-trigger--sm",
|
|
3544
|
+
md: "ddga-date-picker-trigger--md"
|
|
3545
|
+
},
|
|
3546
|
+
error: {
|
|
3547
|
+
true: "ddga-date-picker-trigger--error"
|
|
3548
|
+
}
|
|
3549
|
+
},
|
|
3550
|
+
defaultVariants: {
|
|
3551
|
+
size: "md"
|
|
3552
|
+
}
|
|
3553
|
+
});
|
|
3554
|
+
var datePickerVariants = datePickerTriggerVariants;
|
|
3448
3555
|
function CalendarDayCell({ date, showSecondary, calendarSystem }) {
|
|
3449
|
-
const state = (0,
|
|
3556
|
+
const state = (0, import_react18.useContext)(import_react_aria_components2.CalendarStateContext);
|
|
3450
3557
|
const start = state?.visibleRange.start;
|
|
3451
3558
|
const isOutside = !!start && (date.year !== start.year || date.month !== start.month);
|
|
3452
3559
|
const isOutOfBounds = state ? state.isInvalid(date) : false;
|
|
@@ -3457,27 +3564,21 @@ function CalendarDayCell({ date, showSecondary, calendarSystem }) {
|
|
|
3457
3564
|
state.setFocusedDate(date);
|
|
3458
3565
|
state.selectDate(date);
|
|
3459
3566
|
};
|
|
3460
|
-
return /* @__PURE__ */ (0,
|
|
3567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("td", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3461
3568
|
"button",
|
|
3462
3569
|
{
|
|
3463
3570
|
type: "button",
|
|
3464
3571
|
tabIndex: -1,
|
|
3465
|
-
className: "ddga-
|
|
3572
|
+
className: "ddga-calendar__cell",
|
|
3466
3573
|
"data-outside-month": "",
|
|
3467
3574
|
"data-selected": isSelected ? "" : void 0,
|
|
3468
3575
|
"data-slot": "date-picker-day-cell",
|
|
3469
3576
|
onClick: handleSelect,
|
|
3470
|
-
children:
|
|
3471
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ddga-date-picker-calendar__cell-primary", children: date.day }),
|
|
3472
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { "aria-hidden": "true", className: "ddga-date-picker-calendar__cell-secondary", children: secondaryDayNumber(date, calendarSystem) })
|
|
3473
|
-
] }) : String(date.day)
|
|
3577
|
+
children: renderDayContent(date.day, { showSecondary, date, calendarSystem })
|
|
3474
3578
|
}
|
|
3475
3579
|
) });
|
|
3476
3580
|
}
|
|
3477
|
-
return /* @__PURE__ */ (0,
|
|
3478
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "ddga-date-picker-calendar__cell-primary", children: formattedDate }),
|
|
3479
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { "aria-hidden": "true", className: "ddga-date-picker-calendar__cell-secondary", children: secondaryDayNumber(date, calendarSystem) })
|
|
3480
|
-
] }) : formattedDate });
|
|
3581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components2.CalendarCell, { date, className: "ddga-calendar__cell", children: ({ formattedDate }) => renderDayContent(formattedDate, { showSecondary, date, calendarSystem }) });
|
|
3481
3582
|
}
|
|
3482
3583
|
function DatePicker({
|
|
3483
3584
|
value: controlledValue,
|
|
@@ -3504,56 +3605,47 @@ function DatePicker({
|
|
|
3504
3605
|
showSecondaryCalendar = false
|
|
3505
3606
|
}) {
|
|
3506
3607
|
const isValueControlled = controlledValue !== void 0;
|
|
3507
|
-
const [internalValue, setInternalValue] = (0,
|
|
3608
|
+
const [internalValue, setInternalValue] = (0, import_react18.useState)(
|
|
3508
3609
|
() => dateToCalendarDate(defaultValue)
|
|
3509
3610
|
);
|
|
3510
3611
|
const value = isValueControlled ? dateToCalendarDate(controlledValue) : internalValue;
|
|
3511
|
-
const handleAriaChange = (0,
|
|
3612
|
+
const handleAriaChange = (0, import_react18.useCallback)(
|
|
3512
3613
|
(next) => {
|
|
3513
|
-
const nextCD = next ? new
|
|
3614
|
+
const nextCD = next ? new import_date2.CalendarDate(next.year, next.month, next.day) : null;
|
|
3514
3615
|
if (!isValueControlled) setInternalValue(nextCD);
|
|
3515
3616
|
onChange?.(calendarDateToDate(nextCD));
|
|
3516
3617
|
},
|
|
3517
3618
|
[isValueControlled, onChange]
|
|
3518
3619
|
);
|
|
3519
3620
|
const isCalendarControlled = controlledCalendar !== void 0;
|
|
3520
|
-
const [internalCalendar, setInternalCalendar] = (0,
|
|
3621
|
+
const [internalCalendar, setInternalCalendar] = (0, import_react18.useState)(defaultCalendar);
|
|
3521
3622
|
const calendarSystem = isCalendarControlled ? controlledCalendar : internalCalendar;
|
|
3522
|
-
const setCalendar = (0,
|
|
3623
|
+
const setCalendar = (0, import_react18.useCallback)(
|
|
3523
3624
|
(next) => {
|
|
3524
3625
|
if (!isCalendarControlled) setInternalCalendar(next);
|
|
3525
3626
|
onCalendarChange?.(next);
|
|
3526
3627
|
},
|
|
3527
3628
|
[isCalendarControlled, onCalendarChange]
|
|
3528
3629
|
);
|
|
3529
|
-
const
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
const
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
return isArabic ? { gregorian: "\u0645\u064A\u0644\u0627\u062F\u064A", hijri: "\u0647\u062C\u0631\u064A" } : { gregorian: "Gregorian", hijri: "Hijri" };
|
|
3543
|
-
}, [calendarLabels, dgaLocale]);
|
|
3544
|
-
const navLabels = (0, import_react17.useMemo)(
|
|
3545
|
-
() => dgaLocale.startsWith("ar") ? { month: "\u0627\u0644\u0634\u0647\u0631", year: "\u0627\u0644\u0633\u0646\u0629" } : { month: "Month", year: "Year" },
|
|
3546
|
-
[dgaLocale]
|
|
3547
|
-
);
|
|
3548
|
-
const ariaMinValue = (0, import_react17.useMemo)(() => dateToCalendarDate(minValue) ?? void 0, [minValue]);
|
|
3549
|
-
const ariaMaxValue = (0, import_react17.useMemo)(() => dateToCalendarDate(maxValue) ?? void 0, [maxValue]);
|
|
3550
|
-
const dialogAriaLabel = ariaLabel ?? (typeof label === "string" ? label : ariaLabelledBy ? void 0 : "Date");
|
|
3630
|
+
const {
|
|
3631
|
+
dgaLocale,
|
|
3632
|
+
locale: ariaLocale,
|
|
3633
|
+
portalContainer,
|
|
3634
|
+
PrevChevron,
|
|
3635
|
+
NextChevron,
|
|
3636
|
+
resolvedLabels,
|
|
3637
|
+
navLabels,
|
|
3638
|
+
a11yLabels
|
|
3639
|
+
} = useCalendarChrome(calendarSystem, calendarLabels);
|
|
3640
|
+
const ariaMinValue = (0, import_react18.useMemo)(() => dateToCalendarDate(minValue) ?? void 0, [minValue]);
|
|
3641
|
+
const ariaMaxValue = (0, import_react18.useMemo)(() => dateToCalendarDate(maxValue) ?? void 0, [maxValue]);
|
|
3642
|
+
const dialogAriaLabel = ariaLabel ?? (typeof label === "string" ? label : ariaLabelledBy ? void 0 : dgaLocale.startsWith("ar") ? "\u0627\u0644\u062A\u0627\u0631\u064A\u062E" : "Date");
|
|
3551
3643
|
const showToggle = showCalendarToggle && !isCalendarControlled;
|
|
3552
3644
|
const hasError = !!error;
|
|
3553
3645
|
const hasErrorMessage = hasError && errorMessage != null && errorMessage !== "";
|
|
3554
3646
|
const hasHelper = !hasErrorMessage && helperText != null && helperText !== "";
|
|
3555
|
-
return /* @__PURE__ */ (0,
|
|
3556
|
-
|
|
3647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components2.I18nProvider, { locale: ariaLocale, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3648
|
+
import_react_aria_components2.DatePicker,
|
|
3557
3649
|
{
|
|
3558
3650
|
value,
|
|
3559
3651
|
onChange: handleAriaChange,
|
|
@@ -3569,38 +3661,38 @@ function DatePicker({
|
|
|
3569
3661
|
className: "ddga-field",
|
|
3570
3662
|
"data-slot": "date-picker-field",
|
|
3571
3663
|
children: [
|
|
3572
|
-
label && /* @__PURE__ */ (0,
|
|
3664
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_aria_components2.Label, { className: "ddga-date-picker__label", children: [
|
|
3573
3665
|
label,
|
|
3574
|
-
required && /* @__PURE__ */ (0,
|
|
3666
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { "aria-hidden": "true", className: "ddga-date-picker__required", children: "*" })
|
|
3575
3667
|
] }),
|
|
3576
|
-
/* @__PURE__ */ (0,
|
|
3577
|
-
|
|
3668
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3669
|
+
import_react_aria_components2.Group,
|
|
3578
3670
|
{
|
|
3579
3671
|
"data-slot": "date-picker-trigger",
|
|
3580
3672
|
className: cn(datePickerTriggerVariants({ size, error: hasError }), className),
|
|
3581
3673
|
children: [
|
|
3582
|
-
/* @__PURE__ */ (0,
|
|
3583
|
-
|
|
3674
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components2.DateInput, { className: "ddga-date-picker__input", "data-slot": "date-picker-input", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3675
|
+
import_react_aria_components2.DateSegment,
|
|
3584
3676
|
{
|
|
3585
3677
|
segment,
|
|
3586
3678
|
className: "ddga-date-picker__segment",
|
|
3587
3679
|
"data-slot": "date-picker-segment"
|
|
3588
3680
|
}
|
|
3589
3681
|
) }),
|
|
3590
|
-
/* @__PURE__ */ (0,
|
|
3591
|
-
|
|
3682
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3683
|
+
import_react_aria_components2.Button,
|
|
3592
3684
|
{
|
|
3593
3685
|
className: "ddga-date-picker__icon-button",
|
|
3594
|
-
"aria-label":
|
|
3686
|
+
"aria-label": a11yLabels.openCalendar,
|
|
3595
3687
|
"data-slot": "date-picker-trigger-button",
|
|
3596
|
-
children: /* @__PURE__ */ (0,
|
|
3688
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CalendarIcon, { "aria-hidden": "true", className: "ddga-date-picker__icon" })
|
|
3597
3689
|
}
|
|
3598
3690
|
)
|
|
3599
3691
|
]
|
|
3600
3692
|
}
|
|
3601
3693
|
),
|
|
3602
|
-
hasHelper && /* @__PURE__ */ (0,
|
|
3603
|
-
|
|
3694
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3695
|
+
import_react_aria_components2.Text,
|
|
3604
3696
|
{
|
|
3605
3697
|
slot: "description",
|
|
3606
3698
|
className: "ddga-field__message ddga-field__message--helper",
|
|
@@ -3608,77 +3700,51 @@ function DatePicker({
|
|
|
3608
3700
|
children: helperText
|
|
3609
3701
|
}
|
|
3610
3702
|
),
|
|
3611
|
-
hasErrorMessage && /* @__PURE__ */ (0,
|
|
3612
|
-
|
|
3703
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3704
|
+
import_react_aria_components2.FieldError,
|
|
3613
3705
|
{
|
|
3614
3706
|
className: "ddga-field__message ddga-field__message--error",
|
|
3615
3707
|
"data-slot": "field-error",
|
|
3616
3708
|
children: errorMessage
|
|
3617
3709
|
}
|
|
3618
3710
|
),
|
|
3619
|
-
/* @__PURE__ */ (0,
|
|
3620
|
-
|
|
3711
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3712
|
+
import_react_aria_components2.Popover,
|
|
3621
3713
|
{
|
|
3622
3714
|
UNSTABLE_portalContainer: portalContainer,
|
|
3623
|
-
className: "ddga-
|
|
3715
|
+
className: "ddga-calendar-popover",
|
|
3624
3716
|
"data-slot": "date-picker-popover",
|
|
3625
3717
|
offset: 6,
|
|
3626
3718
|
containerPadding: 12,
|
|
3627
|
-
children: /* @__PURE__ */ (0,
|
|
3628
|
-
|
|
3719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3720
|
+
import_react_aria_components2.Dialog,
|
|
3629
3721
|
{
|
|
3630
|
-
className: "ddga-
|
|
3722
|
+
className: "ddga-calendar-dialog",
|
|
3631
3723
|
"data-slot": "date-picker-dialog",
|
|
3632
3724
|
"aria-label": dialogAriaLabel,
|
|
3633
3725
|
"aria-labelledby": ariaLabelledBy,
|
|
3634
3726
|
children: [
|
|
3635
|
-
showToggle && /* @__PURE__ */ (0,
|
|
3636
|
-
|
|
3727
|
+
showToggle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3728
|
+
CalendarSystemToggle,
|
|
3637
3729
|
{
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
children: [
|
|
3643
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3644
|
-
"button",
|
|
3645
|
-
{
|
|
3646
|
-
type: "button",
|
|
3647
|
-
role: "tab",
|
|
3648
|
-
"aria-selected": calendarSystem === "gregorian",
|
|
3649
|
-
className: "ddga-date-picker-toggle__button",
|
|
3650
|
-
"data-active": calendarSystem === "gregorian" ? "" : void 0,
|
|
3651
|
-
onClick: () => setCalendar("gregorian"),
|
|
3652
|
-
children: resolvedLabels.gregorian
|
|
3653
|
-
}
|
|
3654
|
-
),
|
|
3655
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3656
|
-
"button",
|
|
3657
|
-
{
|
|
3658
|
-
type: "button",
|
|
3659
|
-
role: "tab",
|
|
3660
|
-
"aria-selected": calendarSystem === "hijri",
|
|
3661
|
-
className: "ddga-date-picker-toggle__button",
|
|
3662
|
-
"data-active": calendarSystem === "hijri" ? "" : void 0,
|
|
3663
|
-
onClick: () => setCalendar("hijri"),
|
|
3664
|
-
children: resolvedLabels.hijri
|
|
3665
|
-
}
|
|
3666
|
-
)
|
|
3667
|
-
]
|
|
3730
|
+
value: calendarSystem,
|
|
3731
|
+
onChange: setCalendar,
|
|
3732
|
+
labels: resolvedLabels,
|
|
3733
|
+
groupLabel: a11yLabels.calendarSystem
|
|
3668
3734
|
}
|
|
3669
3735
|
),
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
3671
|
-
/* @__PURE__ */ (0,
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
3673
|
-
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_aria_components2.Calendar, { className: "ddga-calendar", "data-slot": "date-picker-calendar", children: [
|
|
3737
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("header", { className: "ddga-calendar__header", children: [
|
|
3738
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3739
|
+
import_react_aria_components2.Button,
|
|
3674
3740
|
{
|
|
3675
3741
|
slot: "previous",
|
|
3676
|
-
className: "ddga-
|
|
3742
|
+
className: "ddga-calendar__nav",
|
|
3677
3743
|
"data-slot": "date-picker-calendar-prev",
|
|
3678
|
-
children: /* @__PURE__ */ (0,
|
|
3744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PrevChevron, { "aria-hidden": "true" })
|
|
3679
3745
|
}
|
|
3680
3746
|
),
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3747
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3682
3748
|
CalendarNavHeader,
|
|
3683
3749
|
{
|
|
3684
3750
|
locale: ariaLocale,
|
|
@@ -3686,19 +3752,19 @@ function DatePicker({
|
|
|
3686
3752
|
yearLabel: navLabels.year
|
|
3687
3753
|
}
|
|
3688
3754
|
),
|
|
3689
|
-
/* @__PURE__ */ (0,
|
|
3690
|
-
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3756
|
+
import_react_aria_components2.Button,
|
|
3691
3757
|
{
|
|
3692
3758
|
slot: "next",
|
|
3693
|
-
className: "ddga-
|
|
3759
|
+
className: "ddga-calendar__nav",
|
|
3694
3760
|
"data-slot": "date-picker-calendar-next",
|
|
3695
|
-
children: /* @__PURE__ */ (0,
|
|
3761
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(NextChevron, { "aria-hidden": "true" })
|
|
3696
3762
|
}
|
|
3697
3763
|
)
|
|
3698
3764
|
] }),
|
|
3699
|
-
/* @__PURE__ */ (0,
|
|
3700
|
-
/* @__PURE__ */ (0,
|
|
3701
|
-
/* @__PURE__ */ (0,
|
|
3765
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_aria_components2.CalendarGrid, { className: "ddga-calendar__grid", children: [
|
|
3766
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components2.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components2.CalendarHeaderCell, { className: "ddga-calendar__weekday", children: day }) }),
|
|
3767
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components2.CalendarGridBody, { children: (date) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3702
3768
|
CalendarDayCell,
|
|
3703
3769
|
{
|
|
3704
3770
|
date,
|
|
@@ -3719,8 +3785,8 @@ function DatePicker({
|
|
|
3719
3785
|
}
|
|
3720
3786
|
|
|
3721
3787
|
// src/components/FileUpload/FileUpload.tsx
|
|
3722
|
-
var
|
|
3723
|
-
var
|
|
3788
|
+
var import_react19 = require("react");
|
|
3789
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3724
3790
|
function matchesAccept(file, accept) {
|
|
3725
3791
|
if (!accept) return true;
|
|
3726
3792
|
const tokens = accept.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
|
|
@@ -3781,8 +3847,8 @@ function FileUpload({
|
|
|
3781
3847
|
className,
|
|
3782
3848
|
...props
|
|
3783
3849
|
}) {
|
|
3784
|
-
const inputRef = (0,
|
|
3785
|
-
const [isDragging, setIsDragging] = (0,
|
|
3850
|
+
const inputRef = (0, import_react19.useRef)(null);
|
|
3851
|
+
const [isDragging, setIsDragging] = (0, import_react19.useState)(false);
|
|
3786
3852
|
const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
|
|
3787
3853
|
name: "FileUpload",
|
|
3788
3854
|
id: externalId,
|
|
@@ -3824,12 +3890,12 @@ function FileUpload({
|
|
|
3824
3890
|
setIsDragging(false);
|
|
3825
3891
|
}
|
|
3826
3892
|
}
|
|
3827
|
-
return /* @__PURE__ */ (0,
|
|
3828
|
-
label && /* @__PURE__ */ (0,
|
|
3893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "data-slot": "file-upload-field", className: cn("ddga-field", "ddga-file-upload", className), children: [
|
|
3894
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { htmlFor: fieldId, className: "ddga-file-upload__label", children: [
|
|
3829
3895
|
label,
|
|
3830
|
-
required && /* @__PURE__ */ (0,
|
|
3896
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "aria-hidden": "true", className: "ddga-file-upload__required", children: "*" })
|
|
3831
3897
|
] }),
|
|
3832
|
-
/* @__PURE__ */ (0,
|
|
3898
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3833
3899
|
"div",
|
|
3834
3900
|
{
|
|
3835
3901
|
"data-slot": "file-upload-dropzone",
|
|
@@ -3847,9 +3913,9 @@ function FileUpload({
|
|
|
3847
3913
|
onDragLeave: handleDragLeave,
|
|
3848
3914
|
onDrop: handleDrop,
|
|
3849
3915
|
children: [
|
|
3850
|
-
/* @__PURE__ */ (0,
|
|
3851
|
-
/* @__PURE__ */ (0,
|
|
3852
|
-
/* @__PURE__ */ (0,
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Upload, { className: "ddga-file-upload__icon", "aria-hidden": "true" }),
|
|
3917
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ddga-file-upload__hint", children: hint }),
|
|
3918
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3853
3919
|
"input",
|
|
3854
3920
|
{
|
|
3855
3921
|
...controlProps,
|
|
@@ -3868,24 +3934,24 @@ function FileUpload({
|
|
|
3868
3934
|
]
|
|
3869
3935
|
}
|
|
3870
3936
|
),
|
|
3871
|
-
hasErrorMessage && /* @__PURE__ */ (0,
|
|
3872
|
-
hasHelper && /* @__PURE__ */ (0,
|
|
3873
|
-
files.length > 0 && /* @__PURE__ */ (0,
|
|
3937
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
3938
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FieldMessage, { id: helperId, variant: "helper", children: helperText }),
|
|
3939
|
+
files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { "data-slot": "file-upload-list", className: "ddga-file-upload__list", children: files.map((item) => {
|
|
3874
3940
|
const status = item.status ?? "pending";
|
|
3875
|
-
return /* @__PURE__ */ (0,
|
|
3941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3876
3942
|
"li",
|
|
3877
3943
|
{
|
|
3878
3944
|
"data-slot": "file-upload-item",
|
|
3879
3945
|
"data-status": status,
|
|
3880
3946
|
className: "ddga-file-upload__item",
|
|
3881
3947
|
children: [
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
3883
|
-
/* @__PURE__ */ (0,
|
|
3884
|
-
/* @__PURE__ */ (0,
|
|
3885
|
-
/* @__PURE__ */ (0,
|
|
3886
|
-
/* @__PURE__ */ (0,
|
|
3948
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ddga-file-upload__item-icon", "aria-hidden": "true", children: status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Check, {}) : status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AlertCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Upload, {}) }),
|
|
3949
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ddga-file-upload__item-main", children: [
|
|
3950
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "ddga-file-upload__item-head", children: [
|
|
3951
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ddga-file-upload__item-name", title: item.file.name, children: item.file.name }),
|
|
3952
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ddga-file-upload__item-meta", children: formatBytes(item.file.size) })
|
|
3887
3953
|
] }),
|
|
3888
|
-
status === "uploading" && /* @__PURE__ */ (0,
|
|
3954
|
+
status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3889
3955
|
Progress,
|
|
3890
3956
|
{
|
|
3891
3957
|
size: "sm",
|
|
@@ -3894,9 +3960,9 @@ function FileUpload({
|
|
|
3894
3960
|
className: "ddga-file-upload__item-progress"
|
|
3895
3961
|
}
|
|
3896
3962
|
),
|
|
3897
|
-
status === "error" && item.error && /* @__PURE__ */ (0,
|
|
3963
|
+
status === "error" && item.error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { role: "alert", className: "ddga-file-upload__item-error", children: item.error })
|
|
3898
3964
|
] }),
|
|
3899
|
-
onRemove && /* @__PURE__ */ (0,
|
|
3965
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3900
3966
|
Button,
|
|
3901
3967
|
{
|
|
3902
3968
|
type: "button",
|
|
@@ -3905,7 +3971,7 @@ function FileUpload({
|
|
|
3905
3971
|
"aria-label": `${removeLabel}: ${item.file.name}`,
|
|
3906
3972
|
onClick: () => onRemove(item.id),
|
|
3907
3973
|
className: "ddga-file-upload__item-remove",
|
|
3908
|
-
children: /* @__PURE__ */ (0,
|
|
3974
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Close, { "aria-hidden": "true" })
|
|
3909
3975
|
}
|
|
3910
3976
|
)
|
|
3911
3977
|
]
|
|
@@ -3917,10 +3983,10 @@ function FileUpload({
|
|
|
3917
3983
|
}
|
|
3918
3984
|
|
|
3919
3985
|
// src/components/Slider/Slider.tsx
|
|
3920
|
-
var
|
|
3986
|
+
var import_react20 = require("react");
|
|
3921
3987
|
var import_radix_ui21 = require("radix-ui");
|
|
3922
3988
|
var import_class_variance_authority28 = require("class-variance-authority");
|
|
3923
|
-
var
|
|
3989
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3924
3990
|
var sliderVariants = (0, import_class_variance_authority28.cva)("ddga-slider", {
|
|
3925
3991
|
variants: {
|
|
3926
3992
|
size: {
|
|
@@ -3959,7 +4025,7 @@ function Slider({
|
|
|
3959
4025
|
className,
|
|
3960
4026
|
...props
|
|
3961
4027
|
}) {
|
|
3962
|
-
const labelId = (0,
|
|
4028
|
+
const labelId = (0, import_react20.useId)();
|
|
3963
4029
|
const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
|
|
3964
4030
|
name: "Slider",
|
|
3965
4031
|
id: externalId,
|
|
@@ -3976,12 +4042,12 @@ function Slider({
|
|
|
3976
4042
|
const wrap = (next) => isRange ? next : next[0];
|
|
3977
4043
|
const currentForRender = valueArray ?? defaultArray;
|
|
3978
4044
|
const fmt = (n) => formatValue ? formatValue(n) : String(n);
|
|
3979
|
-
return /* @__PURE__ */ (0,
|
|
3980
|
-
(label || showValue) && /* @__PURE__ */ (0,
|
|
3981
|
-
label && /* @__PURE__ */ (0,
|
|
3982
|
-
showValue && /* @__PURE__ */ (0,
|
|
4045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { "data-slot": "slider-field", className: "ddga-field", children: [
|
|
4046
|
+
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "ddga-slider__header", children: [
|
|
4047
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { id: labelId, className: "ddga-slider__label", children: label }),
|
|
4048
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "ddga-slider__value", "aria-hidden": "true", children: currentForRender.map(fmt).join(" \u2013 ") })
|
|
3983
4049
|
] }),
|
|
3984
|
-
/* @__PURE__ */ (0,
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3985
4051
|
import_radix_ui21.Slider.Root,
|
|
3986
4052
|
{
|
|
3987
4053
|
...props,
|
|
@@ -3996,8 +4062,8 @@ function Slider({
|
|
|
3996
4062
|
"data-slot": "slider",
|
|
3997
4063
|
className: cn(sliderVariants({ size, error: hasError }), className),
|
|
3998
4064
|
children: [
|
|
3999
|
-
/* @__PURE__ */ (0,
|
|
4000
|
-
currentForRender.map((thumbValue, index) => /* @__PURE__ */ (0,
|
|
4065
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui21.Slider.Track, { "data-slot": "slider-track", className: "ddga-slider__track", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_radix_ui21.Slider.Range, { "data-slot": "slider-range", className: "ddga-slider__range" }) }),
|
|
4066
|
+
currentForRender.map((thumbValue, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4001
4067
|
import_radix_ui21.Slider.Thumb,
|
|
4002
4068
|
{
|
|
4003
4069
|
"data-slot": "slider-thumb",
|
|
@@ -4012,15 +4078,15 @@ function Slider({
|
|
|
4012
4078
|
]
|
|
4013
4079
|
}
|
|
4014
4080
|
),
|
|
4015
|
-
hasErrorMessage && /* @__PURE__ */ (0,
|
|
4016
|
-
hasHelper && /* @__PURE__ */ (0,
|
|
4081
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
4082
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
4017
4083
|
] });
|
|
4018
4084
|
}
|
|
4019
4085
|
|
|
4020
4086
|
// src/components/NumberInput/NumberInput.tsx
|
|
4021
|
-
var
|
|
4087
|
+
var import_react21 = require("react");
|
|
4022
4088
|
var import_class_variance_authority29 = require("class-variance-authority");
|
|
4023
|
-
var
|
|
4089
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4024
4090
|
var numberInputVariants = (0, import_class_variance_authority29.cva)("ddga-number-input", {
|
|
4025
4091
|
variants: {
|
|
4026
4092
|
size: {
|
|
@@ -4070,9 +4136,9 @@ function NumberInput({
|
|
|
4070
4136
|
...props
|
|
4071
4137
|
}) {
|
|
4072
4138
|
const isControlled = value !== void 0;
|
|
4073
|
-
const [internal, setInternal] = (0,
|
|
4139
|
+
const [internal, setInternal] = (0, import_react21.useState)(defaultValue ?? null);
|
|
4074
4140
|
const numericValue = isControlled ? value : internal;
|
|
4075
|
-
const [draft, setDraft] = (0,
|
|
4141
|
+
const [draft, setDraft] = (0, import_react21.useState)(null);
|
|
4076
4142
|
const allowDecimal = !Number.isInteger(step);
|
|
4077
4143
|
const allowNegative = min == null || min < 0;
|
|
4078
4144
|
const displayValue = draft ?? (numericValue == null ? "" : formatNumber(numericValue));
|
|
@@ -4130,18 +4196,18 @@ function NumberInput({
|
|
|
4130
4196
|
}
|
|
4131
4197
|
const atMin = min != null && numericValue != null && numericValue <= min;
|
|
4132
4198
|
const atMax = max != null && numericValue != null && numericValue >= max;
|
|
4133
|
-
return /* @__PURE__ */ (0,
|
|
4134
|
-
label && /* @__PURE__ */ (0,
|
|
4199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { "data-slot": "number-input-field", className: "ddga-field", children: [
|
|
4200
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { htmlFor: fieldId, className: "ddga-number-input__label", children: [
|
|
4135
4201
|
label,
|
|
4136
|
-
required && /* @__PURE__ */ (0,
|
|
4202
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", className: "ddga-number-input__required", children: "*" })
|
|
4137
4203
|
] }),
|
|
4138
|
-
/* @__PURE__ */ (0,
|
|
4204
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
4139
4205
|
"div",
|
|
4140
4206
|
{
|
|
4141
4207
|
"data-slot": "number-input-control",
|
|
4142
4208
|
className: cn(numberInputVariants({ size, error: hasError }), className),
|
|
4143
4209
|
children: [
|
|
4144
|
-
!hideControls && /* @__PURE__ */ (0,
|
|
4210
|
+
!hideControls && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4145
4211
|
"button",
|
|
4146
4212
|
{
|
|
4147
4213
|
type: "button",
|
|
@@ -4151,10 +4217,10 @@ function NumberInput({
|
|
|
4151
4217
|
onClick: () => stepBy(-1),
|
|
4152
4218
|
disabled: disabled || atMin,
|
|
4153
4219
|
tabIndex: -1,
|
|
4154
|
-
children: /* @__PURE__ */ (0,
|
|
4220
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Minus, { "aria-hidden": "true" })
|
|
4155
4221
|
}
|
|
4156
4222
|
),
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4223
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4158
4224
|
"input",
|
|
4159
4225
|
{
|
|
4160
4226
|
...props,
|
|
@@ -4171,7 +4237,7 @@ function NumberInput({
|
|
|
4171
4237
|
className: "ddga-number-input__field"
|
|
4172
4238
|
}
|
|
4173
4239
|
),
|
|
4174
|
-
!hideControls && /* @__PURE__ */ (0,
|
|
4240
|
+
!hideControls && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4175
4241
|
"button",
|
|
4176
4242
|
{
|
|
4177
4243
|
type: "button",
|
|
@@ -4181,21 +4247,21 @@ function NumberInput({
|
|
|
4181
4247
|
onClick: () => stepBy(1),
|
|
4182
4248
|
disabled: disabled || atMax,
|
|
4183
4249
|
tabIndex: -1,
|
|
4184
|
-
children: /* @__PURE__ */ (0,
|
|
4250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Plus, { "aria-hidden": "true" })
|
|
4185
4251
|
}
|
|
4186
4252
|
)
|
|
4187
4253
|
]
|
|
4188
4254
|
}
|
|
4189
4255
|
),
|
|
4190
|
-
hasErrorMessage && /* @__PURE__ */ (0,
|
|
4191
|
-
hasHelper && /* @__PURE__ */ (0,
|
|
4256
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
4257
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
4192
4258
|
] });
|
|
4193
4259
|
}
|
|
4194
4260
|
|
|
4195
4261
|
// src/components/Rating/Rating.tsx
|
|
4196
|
-
var
|
|
4262
|
+
var import_react22 = require("react");
|
|
4197
4263
|
var import_class_variance_authority30 = require("class-variance-authority");
|
|
4198
|
-
var
|
|
4264
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4199
4265
|
var ratingVariants = (0, import_class_variance_authority30.cva)("ddga-rating", {
|
|
4200
4266
|
variants: {
|
|
4201
4267
|
size: {
|
|
@@ -4237,11 +4303,11 @@ function Rating({
|
|
|
4237
4303
|
className,
|
|
4238
4304
|
...props
|
|
4239
4305
|
}) {
|
|
4240
|
-
const rootRef = (0,
|
|
4306
|
+
const rootRef = (0, import_react22.useRef)(null);
|
|
4241
4307
|
const isControlled = value !== void 0;
|
|
4242
|
-
const [internal, setInternal] = (0,
|
|
4308
|
+
const [internal, setInternal] = (0, import_react22.useState)(defaultValue ?? 0);
|
|
4243
4309
|
const currentValue = isControlled ? value : internal;
|
|
4244
|
-
const [hover, setHover] = (0,
|
|
4310
|
+
const [hover, setHover] = (0, import_react22.useState)(null);
|
|
4245
4311
|
const interactive = !readOnly && !disabled;
|
|
4246
4312
|
const stepSize = allowHalf ? 0.5 : 1;
|
|
4247
4313
|
const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
|
|
@@ -4304,7 +4370,7 @@ function Rating({
|
|
|
4304
4370
|
}
|
|
4305
4371
|
const stars = Array.from({ length: max }, (_, index) => {
|
|
4306
4372
|
const level = fillFor(index, displayValue, allowHalf);
|
|
4307
|
-
return /* @__PURE__ */ (0,
|
|
4373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4308
4374
|
"span",
|
|
4309
4375
|
{
|
|
4310
4376
|
"data-slot": "rating-star",
|
|
@@ -4313,8 +4379,8 @@ function Rating({
|
|
|
4313
4379
|
onPointerMove: interactive ? (event) => setHover(pointerValue(event, index)) : void 0,
|
|
4314
4380
|
onClick: interactive ? (event) => commit(pointerValue(event, index)) : void 0,
|
|
4315
4381
|
children: [
|
|
4316
|
-
/* @__PURE__ */ (0,
|
|
4317
|
-
/* @__PURE__ */ (0,
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Star, { className: "ddga-rating__star-bg", "aria-hidden": "true" }),
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "ddga-rating__star-fill", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Star, { className: "ddga-rating__star-fg", "aria-hidden": "true" }) })
|
|
4318
4384
|
]
|
|
4319
4385
|
},
|
|
4320
4386
|
index
|
|
@@ -4329,9 +4395,9 @@ function Rating({
|
|
|
4329
4395
|
};
|
|
4330
4396
|
const labelledBy = label ? `${fieldId}-label` : props["aria-labelledby"];
|
|
4331
4397
|
const ariaLabel = labelledBy ? void 0 : props["aria-label"] ?? "Rating";
|
|
4332
|
-
return /* @__PURE__ */ (0,
|
|
4333
|
-
label && /* @__PURE__ */ (0,
|
|
4334
|
-
readOnly ? /* @__PURE__ */ (0,
|
|
4398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { "data-slot": "rating-field", className: "ddga-field", children: [
|
|
4399
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { id: `${fieldId}-label`, className: "ddga-rating__label", children: label }),
|
|
4400
|
+
readOnly ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ...sharedProps, role: "img", "aria-label": formatValueText(currentValue, max), children: stars }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4335
4401
|
"div",
|
|
4336
4402
|
{
|
|
4337
4403
|
...sharedProps,
|
|
@@ -4351,15 +4417,15 @@ function Rating({
|
|
|
4351
4417
|
children: stars
|
|
4352
4418
|
}
|
|
4353
4419
|
),
|
|
4354
|
-
hasErrorMessage && /* @__PURE__ */ (0,
|
|
4355
|
-
hasHelper && /* @__PURE__ */ (0,
|
|
4420
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
4421
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
4356
4422
|
] });
|
|
4357
4423
|
}
|
|
4358
4424
|
|
|
4359
4425
|
// src/components/Toggle/Toggle.tsx
|
|
4360
4426
|
var import_radix_ui22 = require("radix-ui");
|
|
4361
4427
|
var import_class_variance_authority31 = require("class-variance-authority");
|
|
4362
|
-
var
|
|
4428
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4363
4429
|
var toggleVariants = (0, import_class_variance_authority31.cva)("ddga-toggle", {
|
|
4364
4430
|
variants: {
|
|
4365
4431
|
variant: {
|
|
@@ -4395,7 +4461,7 @@ var toggleGroupVariants = (0, import_class_variance_authority31.cva)("ddga-toggl
|
|
|
4395
4461
|
}
|
|
4396
4462
|
});
|
|
4397
4463
|
function Toggle({ variant, size, className, ...props }) {
|
|
4398
|
-
return /* @__PURE__ */ (0,
|
|
4464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4399
4465
|
import_radix_ui22.Toggle.Root,
|
|
4400
4466
|
{
|
|
4401
4467
|
"data-slot": "toggle",
|
|
@@ -4410,7 +4476,7 @@ function ToggleGroup({ variant, size, className, ...props }) {
|
|
|
4410
4476
|
"[@dev-dga/react] ToggleGroup should have an `aria-label` or `aria-labelledby` so the button group has an accessible name."
|
|
4411
4477
|
);
|
|
4412
4478
|
}
|
|
4413
|
-
return /* @__PURE__ */ (0,
|
|
4479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4414
4480
|
import_radix_ui22.ToggleGroup.Root,
|
|
4415
4481
|
{
|
|
4416
4482
|
"data-slot": "toggle-group",
|
|
@@ -4420,7 +4486,7 @@ function ToggleGroup({ variant, size, className, ...props }) {
|
|
|
4420
4486
|
);
|
|
4421
4487
|
}
|
|
4422
4488
|
function ToggleGroupItem({ className, ...props }) {
|
|
4423
|
-
return /* @__PURE__ */ (0,
|
|
4489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4424
4490
|
import_radix_ui22.ToggleGroup.Item,
|
|
4425
4491
|
{
|
|
4426
4492
|
"data-slot": "toggle-group-item",
|
|
@@ -4432,7 +4498,7 @@ function ToggleGroupItem({ className, ...props }) {
|
|
|
4432
4498
|
|
|
4433
4499
|
// src/components/DescriptionList/DescriptionList.tsx
|
|
4434
4500
|
var import_class_variance_authority32 = require("class-variance-authority");
|
|
4435
|
-
var
|
|
4501
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4436
4502
|
var descriptionListVariants = (0, import_class_variance_authority32.cva)("ddga-description-list", {
|
|
4437
4503
|
variants: {
|
|
4438
4504
|
orientation: {
|
|
@@ -4448,7 +4514,7 @@ var descriptionListVariants = (0, import_class_variance_authority32.cva)("ddga-d
|
|
|
4448
4514
|
}
|
|
4449
4515
|
});
|
|
4450
4516
|
function DescriptionList({ orientation, divided, className, ...props }) {
|
|
4451
|
-
return /* @__PURE__ */ (0,
|
|
4517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4452
4518
|
"dl",
|
|
4453
4519
|
{
|
|
4454
4520
|
"data-slot": "description-list",
|
|
@@ -4458,7 +4524,7 @@ function DescriptionList({ orientation, divided, className, ...props }) {
|
|
|
4458
4524
|
);
|
|
4459
4525
|
}
|
|
4460
4526
|
function DescriptionItem({ className, ...props }) {
|
|
4461
|
-
return /* @__PURE__ */ (0,
|
|
4527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4462
4528
|
"div",
|
|
4463
4529
|
{
|
|
4464
4530
|
"data-slot": "description-item",
|
|
@@ -4468,7 +4534,7 @@ function DescriptionItem({ className, ...props }) {
|
|
|
4468
4534
|
);
|
|
4469
4535
|
}
|
|
4470
4536
|
function DescriptionTerm({ className, ...props }) {
|
|
4471
|
-
return /* @__PURE__ */ (0,
|
|
4537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4472
4538
|
"dt",
|
|
4473
4539
|
{
|
|
4474
4540
|
"data-slot": "description-term",
|
|
@@ -4478,7 +4544,7 @@ function DescriptionTerm({ className, ...props }) {
|
|
|
4478
4544
|
);
|
|
4479
4545
|
}
|
|
4480
4546
|
function DescriptionDetails({ className, ...props }) {
|
|
4481
|
-
return /* @__PURE__ */ (0,
|
|
4547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4482
4548
|
"dd",
|
|
4483
4549
|
{
|
|
4484
4550
|
"data-slot": "description-details",
|
|
@@ -4489,10 +4555,10 @@ function DescriptionDetails({ className, ...props }) {
|
|
|
4489
4555
|
}
|
|
4490
4556
|
|
|
4491
4557
|
// src/components/EmptyState/EmptyState.tsx
|
|
4492
|
-
var
|
|
4558
|
+
var import_react23 = require("react");
|
|
4493
4559
|
var import_radix_ui23 = require("radix-ui");
|
|
4494
4560
|
var import_class_variance_authority33 = require("class-variance-authority");
|
|
4495
|
-
var
|
|
4561
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4496
4562
|
var emptyStateVariants = (0, import_class_variance_authority33.cva)("ddga-empty-state", {
|
|
4497
4563
|
variants: {
|
|
4498
4564
|
variant: {
|
|
@@ -4513,10 +4579,10 @@ var emptyStateVariants = (0, import_class_variance_authority33.cva)("ddga-empty-
|
|
|
4513
4579
|
}
|
|
4514
4580
|
});
|
|
4515
4581
|
var DEFAULT_ICONS3 = {
|
|
4516
|
-
default: /* @__PURE__ */ (0,
|
|
4517
|
-
search: /* @__PURE__ */ (0,
|
|
4518
|
-
error: /* @__PURE__ */ (0,
|
|
4519
|
-
success: /* @__PURE__ */ (0,
|
|
4582
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Inbox, { "aria-hidden": "true" }),
|
|
4583
|
+
search: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Search, { "aria-hidden": "true" }),
|
|
4584
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertCircle, { "aria-hidden": "true" }),
|
|
4585
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Check, { "aria-hidden": "true" })
|
|
4520
4586
|
};
|
|
4521
4587
|
function EmptyState({
|
|
4522
4588
|
variant,
|
|
@@ -4526,24 +4592,26 @@ function EmptyState({
|
|
|
4526
4592
|
description,
|
|
4527
4593
|
action,
|
|
4528
4594
|
secondaryAction,
|
|
4595
|
+
asChild,
|
|
4529
4596
|
className,
|
|
4530
4597
|
children,
|
|
4531
4598
|
...props
|
|
4532
4599
|
}) {
|
|
4533
4600
|
const resolvedIcon = icon === false ? null : icon !== void 0 ? icon : DEFAULT_ICONS3[variant ?? "default"];
|
|
4534
|
-
|
|
4535
|
-
|
|
4601
|
+
const Comp = asChild ? import_radix_ui23.Slot.Slot : "div";
|
|
4602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4603
|
+
Comp,
|
|
4536
4604
|
{
|
|
4537
4605
|
"data-slot": "empty-state",
|
|
4538
4606
|
"data-variant": variant ?? "default",
|
|
4539
4607
|
"data-size": size ?? "md",
|
|
4540
4608
|
className: cn(emptyStateVariants({ variant, size }), className),
|
|
4541
4609
|
...props,
|
|
4542
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
4543
|
-
resolvedIcon ? /* @__PURE__ */ (0,
|
|
4544
|
-
title ? /* @__PURE__ */ (0,
|
|
4545
|
-
description ? /* @__PURE__ */ (0,
|
|
4546
|
-
action || secondaryAction ? /* @__PURE__ */ (0,
|
|
4610
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
4611
|
+
resolvedIcon ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateMedia, { children: resolvedIcon }) : null,
|
|
4612
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateTitle, { children: title }) : null,
|
|
4613
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(EmptyStateDescription, { children: description }) : null,
|
|
4614
|
+
action || secondaryAction ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(EmptyStateActions, { children: [
|
|
4547
4615
|
action,
|
|
4548
4616
|
secondaryAction
|
|
4549
4617
|
] }) : null
|
|
@@ -4552,7 +4620,7 @@ function EmptyState({
|
|
|
4552
4620
|
);
|
|
4553
4621
|
}
|
|
4554
4622
|
function EmptyStateMedia({ className, ...props }) {
|
|
4555
|
-
return /* @__PURE__ */ (0,
|
|
4623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4556
4624
|
"div",
|
|
4557
4625
|
{
|
|
4558
4626
|
"data-slot": "empty-state-media",
|
|
@@ -4564,7 +4632,7 @@ function EmptyStateMedia({ className, ...props }) {
|
|
|
4564
4632
|
}
|
|
4565
4633
|
function EmptyStateTitle({ asChild, className, ...props }) {
|
|
4566
4634
|
const Comp = asChild ? import_radix_ui23.Slot.Slot : "h3";
|
|
4567
|
-
return /* @__PURE__ */ (0,
|
|
4635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4568
4636
|
Comp,
|
|
4569
4637
|
{
|
|
4570
4638
|
"data-slot": "empty-state-title",
|
|
@@ -4575,7 +4643,7 @@ function EmptyStateTitle({ asChild, className, ...props }) {
|
|
|
4575
4643
|
}
|
|
4576
4644
|
function EmptyStateDescription({ asChild, className, ...props }) {
|
|
4577
4645
|
const Comp = asChild ? import_radix_ui23.Slot.Slot : "p";
|
|
4578
|
-
return /* @__PURE__ */ (0,
|
|
4646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4579
4647
|
Comp,
|
|
4580
4648
|
{
|
|
4581
4649
|
"data-slot": "empty-state-description",
|
|
@@ -4586,7 +4654,7 @@ function EmptyStateDescription({ asChild, className, ...props }) {
|
|
|
4586
4654
|
}
|
|
4587
4655
|
function EmptyStateActions({ asChild, className, ...props }) {
|
|
4588
4656
|
const Comp = asChild ? import_radix_ui23.Slot.Slot : "div";
|
|
4589
|
-
return /* @__PURE__ */ (0,
|
|
4657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4590
4658
|
Comp,
|
|
4591
4659
|
{
|
|
4592
4660
|
"data-slot": "empty-state-actions",
|
|
@@ -4597,9 +4665,9 @@ function EmptyStateActions({ asChild, className, ...props }) {
|
|
|
4597
4665
|
}
|
|
4598
4666
|
|
|
4599
4667
|
// src/components/Stat/Stat.tsx
|
|
4600
|
-
var
|
|
4668
|
+
var import_react24 = require("react");
|
|
4601
4669
|
var import_class_variance_authority34 = require("class-variance-authority");
|
|
4602
|
-
var
|
|
4670
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4603
4671
|
var statVariants = (0, import_class_variance_authority34.cva)("ddga-stat", {
|
|
4604
4672
|
variants: {
|
|
4605
4673
|
variant: {
|
|
@@ -4623,9 +4691,9 @@ var statVariants = (0, import_class_variance_authority34.cva)("ddga-stat", {
|
|
|
4623
4691
|
}
|
|
4624
4692
|
});
|
|
4625
4693
|
var TREND_ICONS = {
|
|
4626
|
-
up: /* @__PURE__ */ (0,
|
|
4627
|
-
down: /* @__PURE__ */ (0,
|
|
4628
|
-
flat: /* @__PURE__ */ (0,
|
|
4694
|
+
up: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CaretUp, { "aria-hidden": "true" }),
|
|
4695
|
+
down: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CaretDown, { "aria-hidden": "true" }),
|
|
4696
|
+
flat: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Minus, { "aria-hidden": "true" })
|
|
4629
4697
|
};
|
|
4630
4698
|
var TREND_SENTIMENT = {
|
|
4631
4699
|
up: "positive",
|
|
@@ -4653,7 +4721,7 @@ function Stat({
|
|
|
4653
4721
|
...props
|
|
4654
4722
|
}) {
|
|
4655
4723
|
const resolvedSentiment = resolveSentiment(trend, sentiment);
|
|
4656
|
-
return /* @__PURE__ */ (0,
|
|
4724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4657
4725
|
"div",
|
|
4658
4726
|
{
|
|
4659
4727
|
"data-slot": "stat",
|
|
@@ -4663,14 +4731,14 @@ function Stat({
|
|
|
4663
4731
|
className: cn(statVariants({ variant, size }), className),
|
|
4664
4732
|
...props,
|
|
4665
4733
|
children: [
|
|
4666
|
-
label || icon ? /* @__PURE__ */ (0,
|
|
4667
|
-
label ? /* @__PURE__ */ (0,
|
|
4668
|
-
icon ? /* @__PURE__ */ (0,
|
|
4734
|
+
label || icon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ddga-stat__label-row", children: [
|
|
4735
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StatLabel, { children: label }) : null,
|
|
4736
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ddga-stat__icon", "aria-hidden": "true", children: icon }) : null
|
|
4669
4737
|
] }) : null,
|
|
4670
|
-
value ? /* @__PURE__ */ (0,
|
|
4671
|
-
change || changeLabel ? /* @__PURE__ */ (0,
|
|
4672
|
-
change ? /* @__PURE__ */ (0,
|
|
4673
|
-
changeLabel ? /* @__PURE__ */ (0,
|
|
4738
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StatValue, { children: value }) : null,
|
|
4739
|
+
change || changeLabel ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "ddga-stat__change-row", children: [
|
|
4740
|
+
change ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StatChange, { trend, sentiment, variant: changeVariant, children: change }) : null,
|
|
4741
|
+
changeLabel ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ddga-stat__change-label", children: changeLabel }) : null
|
|
4674
4742
|
] }) : null,
|
|
4675
4743
|
children
|
|
4676
4744
|
]
|
|
@@ -4678,17 +4746,17 @@ function Stat({
|
|
|
4678
4746
|
);
|
|
4679
4747
|
}
|
|
4680
4748
|
function StatLabel({ className, ...props }) {
|
|
4681
|
-
return /* @__PURE__ */ (0,
|
|
4749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { "data-slot": "stat-label", className: cn("ddga-stat__label", className), ...props });
|
|
4682
4750
|
}
|
|
4683
4751
|
function StatValue({ className, ...props }) {
|
|
4684
|
-
return /* @__PURE__ */ (0,
|
|
4752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { "data-slot": "stat-value", className: cn("ddga-stat__value", className), ...props });
|
|
4685
4753
|
}
|
|
4686
4754
|
function StatChart({ className, ...props }) {
|
|
4687
|
-
return /* @__PURE__ */ (0,
|
|
4755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { "data-slot": "stat-chart", className: cn("ddga-stat__chart", className), ...props });
|
|
4688
4756
|
}
|
|
4689
4757
|
function StatChange({ trend, sentiment, variant, className, children, ...props }) {
|
|
4690
4758
|
const resolvedSentiment = resolveSentiment(trend, sentiment);
|
|
4691
|
-
return /* @__PURE__ */ (0,
|
|
4759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
4692
4760
|
"div",
|
|
4693
4761
|
{
|
|
4694
4762
|
"data-slot": "stat-change",
|
|
@@ -4702,7 +4770,7 @@ function StatChange({ trend, sentiment, variant, className, children, ...props }
|
|
|
4702
4770
|
),
|
|
4703
4771
|
...props,
|
|
4704
4772
|
children: [
|
|
4705
|
-
trend ? /* @__PURE__ */ (0,
|
|
4773
|
+
trend ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ddga-stat__change-icon", children: TREND_ICONS[trend] }) : null,
|
|
4706
4774
|
children
|
|
4707
4775
|
]
|
|
4708
4776
|
}
|
|
@@ -4711,7 +4779,7 @@ function StatChange({ trend, sentiment, variant, className, children, ...props }
|
|
|
4711
4779
|
|
|
4712
4780
|
// src/components/Stat/StatGroup.tsx
|
|
4713
4781
|
var import_class_variance_authority35 = require("class-variance-authority");
|
|
4714
|
-
var
|
|
4782
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4715
4783
|
var statGroupVariants = (0, import_class_variance_authority35.cva)("ddga-stat-group", {
|
|
4716
4784
|
variants: {
|
|
4717
4785
|
orientation: {
|
|
@@ -4730,7 +4798,7 @@ var statGroupVariants = (0, import_class_variance_authority35.cva)("ddga-stat-gr
|
|
|
4730
4798
|
}
|
|
4731
4799
|
});
|
|
4732
4800
|
function StatGroup({ orientation, gap, columns, className, style, ...props }) {
|
|
4733
|
-
return /* @__PURE__ */ (0,
|
|
4801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4734
4802
|
"div",
|
|
4735
4803
|
{
|
|
4736
4804
|
"data-slot": "stat-group",
|
|
@@ -4746,10 +4814,10 @@ function StatGroup({ orientation, gap, columns, className, style, ...props }) {
|
|
|
4746
4814
|
}
|
|
4747
4815
|
|
|
4748
4816
|
// src/components/Popover/Popover.tsx
|
|
4749
|
-
var
|
|
4817
|
+
var import_react25 = require("react");
|
|
4750
4818
|
var import_radix_ui24 = require("radix-ui");
|
|
4751
4819
|
var import_class_variance_authority36 = require("class-variance-authority");
|
|
4752
|
-
var
|
|
4820
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4753
4821
|
var popoverContentVariants = (0, import_class_variance_authority36.cva)("ddga-popover", {
|
|
4754
4822
|
variants: {
|
|
4755
4823
|
size: {
|
|
@@ -4762,13 +4830,13 @@ var popoverContentVariants = (0, import_class_variance_authority36.cva)("ddga-po
|
|
|
4762
4830
|
}
|
|
4763
4831
|
});
|
|
4764
4832
|
function Popover(props) {
|
|
4765
|
-
return /* @__PURE__ */ (0,
|
|
4833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_radix_ui24.Popover.Root, { ...props });
|
|
4766
4834
|
}
|
|
4767
4835
|
function PopoverTrigger({ className, ...props }) {
|
|
4768
|
-
return /* @__PURE__ */ (0,
|
|
4836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_radix_ui24.Popover.Trigger, { "data-slot": "popover-trigger", className, ...props });
|
|
4769
4837
|
}
|
|
4770
4838
|
function PopoverAnchor(props) {
|
|
4771
|
-
return /* @__PURE__ */ (0,
|
|
4839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_radix_ui24.Popover.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
4772
4840
|
}
|
|
4773
4841
|
function PopoverContent({
|
|
4774
4842
|
size,
|
|
@@ -4783,9 +4851,9 @@ function PopoverContent({
|
|
|
4783
4851
|
'[@dev-dga/react] PopoverContent renders role="dialog" and should have an `aria-label` or `aria-labelledby` so the panel has an accessible name.'
|
|
4784
4852
|
);
|
|
4785
4853
|
}
|
|
4786
|
-
const ctx = (0,
|
|
4854
|
+
const ctx = (0, import_react25.useContext)(DgaContext);
|
|
4787
4855
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
4788
|
-
return /* @__PURE__ */ (0,
|
|
4856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_radix_ui24.Popover.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4789
4857
|
import_radix_ui24.Popover.Content,
|
|
4790
4858
|
{
|
|
4791
4859
|
"data-slot": "popover-content",
|
|
@@ -4794,7 +4862,7 @@ function PopoverContent({
|
|
|
4794
4862
|
...props,
|
|
4795
4863
|
children: [
|
|
4796
4864
|
children,
|
|
4797
|
-
arrow ? /* @__PURE__ */ (0,
|
|
4865
|
+
arrow ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_radix_ui24.Popover.Arrow, { className: "ddga-popover__arrow", width: 16, height: 8 }) : null
|
|
4798
4866
|
]
|
|
4799
4867
|
}
|
|
4800
4868
|
) });
|
|
@@ -4808,7 +4876,7 @@ function PopoverClose({
|
|
|
4808
4876
|
}) {
|
|
4809
4877
|
const hasRenderableChildren = children != null && children !== false;
|
|
4810
4878
|
if (asChild || hasRenderableChildren) {
|
|
4811
|
-
return /* @__PURE__ */ (0,
|
|
4879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4812
4880
|
import_radix_ui24.Popover.Close,
|
|
4813
4881
|
{
|
|
4814
4882
|
"data-slot": "popover-close",
|
|
@@ -4819,27 +4887,27 @@ function PopoverClose({
|
|
|
4819
4887
|
}
|
|
4820
4888
|
);
|
|
4821
4889
|
}
|
|
4822
|
-
return /* @__PURE__ */ (0,
|
|
4890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4823
4891
|
import_radix_ui24.Popover.Close,
|
|
4824
4892
|
{
|
|
4825
4893
|
"data-slot": "popover-close",
|
|
4826
4894
|
"aria-label": closeLabel,
|
|
4827
4895
|
className: cn("ddga-popover__close", className),
|
|
4828
4896
|
...props,
|
|
4829
|
-
children: /* @__PURE__ */ (0,
|
|
4897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Close, { "aria-hidden": "true" })
|
|
4830
4898
|
}
|
|
4831
4899
|
);
|
|
4832
4900
|
}
|
|
4833
4901
|
|
|
4834
4902
|
// src/components/Sidebar/Sidebar.tsx
|
|
4835
|
-
var
|
|
4903
|
+
var import_react28 = require("react");
|
|
4836
4904
|
var import_radix_ui25 = require("radix-ui");
|
|
4837
4905
|
|
|
4838
4906
|
// src/components/Sidebar/SidebarContext.ts
|
|
4839
|
-
var
|
|
4840
|
-
var SidebarContext = (0,
|
|
4907
|
+
var import_react26 = require("react");
|
|
4908
|
+
var SidebarContext = (0, import_react26.createContext)(null);
|
|
4841
4909
|
function useSidebar() {
|
|
4842
|
-
const ctx = (0,
|
|
4910
|
+
const ctx = (0, import_react26.useContext)(SidebarContext);
|
|
4843
4911
|
if (!ctx) {
|
|
4844
4912
|
throw new Error("useSidebar must be used within a <SidebarProvider>");
|
|
4845
4913
|
}
|
|
@@ -4847,10 +4915,10 @@ function useSidebar() {
|
|
|
4847
4915
|
}
|
|
4848
4916
|
|
|
4849
4917
|
// src/components/Sidebar/useIsMobile.ts
|
|
4850
|
-
var
|
|
4918
|
+
var import_react27 = require("react");
|
|
4851
4919
|
function useIsMobile(breakpoint = 768) {
|
|
4852
|
-
const [isMobile, setIsMobile] = (0,
|
|
4853
|
-
(0,
|
|
4920
|
+
const [isMobile, setIsMobile] = (0, import_react27.useState)(false);
|
|
4921
|
+
(0, import_react27.useEffect)(() => {
|
|
4854
4922
|
const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
4855
4923
|
const onChange = () => setIsMobile(mql.matches);
|
|
4856
4924
|
onChange();
|
|
@@ -4861,7 +4929,7 @@ function useIsMobile(breakpoint = 768) {
|
|
|
4861
4929
|
}
|
|
4862
4930
|
|
|
4863
4931
|
// src/components/Sidebar/Sidebar.tsx
|
|
4864
|
-
var
|
|
4932
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4865
4933
|
function SidebarProvider({
|
|
4866
4934
|
defaultOpen = true,
|
|
4867
4935
|
open: openProp,
|
|
@@ -4874,18 +4942,18 @@ function SidebarProvider({
|
|
|
4874
4942
|
...props
|
|
4875
4943
|
}) {
|
|
4876
4944
|
const isMobile = useIsMobile(mobileBreakpoint);
|
|
4877
|
-
const [openMobile, setOpenMobile] = (0,
|
|
4945
|
+
const [openMobile, setOpenMobile] = (0, import_react28.useState)(false);
|
|
4878
4946
|
const isControlled = openProp !== void 0;
|
|
4879
|
-
const [openInternal, setOpenInternal] = (0,
|
|
4947
|
+
const [openInternal, setOpenInternal] = (0, import_react28.useState)(defaultOpen);
|
|
4880
4948
|
const open = isControlled ? openProp : openInternal;
|
|
4881
|
-
const setOpen = (0,
|
|
4949
|
+
const setOpen = (0, import_react28.useCallback)(
|
|
4882
4950
|
(value2) => {
|
|
4883
4951
|
if (!isControlled) setOpenInternal(value2);
|
|
4884
4952
|
onOpenChange?.(value2);
|
|
4885
4953
|
},
|
|
4886
4954
|
[isControlled, onOpenChange]
|
|
4887
4955
|
);
|
|
4888
|
-
const toggleSidebar = (0,
|
|
4956
|
+
const toggleSidebar = (0, import_react28.useCallback)(() => {
|
|
4889
4957
|
if (isMobile) {
|
|
4890
4958
|
setOpenMobile((v) => !v);
|
|
4891
4959
|
return;
|
|
@@ -4896,7 +4964,7 @@ function SidebarProvider({
|
|
|
4896
4964
|
setOpenInternal((v) => !v);
|
|
4897
4965
|
}
|
|
4898
4966
|
}, [isMobile, isControlled, onOpenChange, open]);
|
|
4899
|
-
(0,
|
|
4967
|
+
(0, import_react28.useEffect)(() => {
|
|
4900
4968
|
if (!keyboardShortcut) return;
|
|
4901
4969
|
const onKeyDown = (e) => {
|
|
4902
4970
|
if (e.key.toLowerCase() === "b" && (e.metaKey || e.ctrlKey)) {
|
|
@@ -4908,11 +4976,11 @@ function SidebarProvider({
|
|
|
4908
4976
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
4909
4977
|
}, [keyboardShortcut, toggleSidebar]);
|
|
4910
4978
|
const state = open ? "expanded" : "collapsed";
|
|
4911
|
-
const value = (0,
|
|
4979
|
+
const value = (0, import_react28.useMemo)(
|
|
4912
4980
|
() => ({ state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }),
|
|
4913
4981
|
[state, open, setOpen, openMobile, isMobile, toggleSidebar]
|
|
4914
4982
|
);
|
|
4915
|
-
return /* @__PURE__ */ (0,
|
|
4983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SidebarContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4916
4984
|
"div",
|
|
4917
4985
|
{
|
|
4918
4986
|
"data-slot": "sidebar-wrapper",
|
|
@@ -4934,7 +5002,7 @@ function Sidebar({
|
|
|
4934
5002
|
}) {
|
|
4935
5003
|
const { isMobile, openMobile, setOpenMobile, state } = useSidebar();
|
|
4936
5004
|
if (isMobile) {
|
|
4937
|
-
return /* @__PURE__ */ (0,
|
|
5005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Drawer, { open: openMobile, onOpenChange: setOpenMobile, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4938
5006
|
DrawerContent,
|
|
4939
5007
|
{
|
|
4940
5008
|
side,
|
|
@@ -4944,11 +5012,12 @@ function Sidebar({
|
|
|
4944
5012
|
"data-variant": variant,
|
|
4945
5013
|
"data-side": side,
|
|
4946
5014
|
className: cn("ddga-sidebar", "ddga-sidebar--mobile", className),
|
|
5015
|
+
...props,
|
|
4947
5016
|
children
|
|
4948
5017
|
}
|
|
4949
5018
|
) });
|
|
4950
5019
|
}
|
|
4951
|
-
return /* @__PURE__ */ (0,
|
|
5020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4952
5021
|
"aside",
|
|
4953
5022
|
{
|
|
4954
5023
|
"data-slot": "sidebar",
|
|
@@ -4973,7 +5042,7 @@ function SidebarTrigger({
|
|
|
4973
5042
|
}) {
|
|
4974
5043
|
const { toggleSidebar, open, openMobile, isMobile } = useSidebar();
|
|
4975
5044
|
const Comp = asChild ? import_radix_ui25.Slot.Slot : "button";
|
|
4976
|
-
return /* @__PURE__ */ (0,
|
|
5045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4977
5046
|
Comp,
|
|
4978
5047
|
{
|
|
4979
5048
|
type: asChild ? void 0 : "button",
|
|
@@ -4987,7 +5056,7 @@ function SidebarTrigger({
|
|
|
4987
5056
|
toggleSidebar();
|
|
4988
5057
|
},
|
|
4989
5058
|
...props,
|
|
4990
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
5059
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PanelLeft, { "aria-hidden": "true" })
|
|
4991
5060
|
}
|
|
4992
5061
|
);
|
|
4993
5062
|
}
|
|
@@ -4997,7 +5066,7 @@ function SidebarRail({
|
|
|
4997
5066
|
...props
|
|
4998
5067
|
}) {
|
|
4999
5068
|
const { toggleSidebar } = useSidebar();
|
|
5000
|
-
return /* @__PURE__ */ (0,
|
|
5069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5001
5070
|
"button",
|
|
5002
5071
|
{
|
|
5003
5072
|
type: "button",
|
|
@@ -5013,15 +5082,15 @@ function SidebarRail({
|
|
|
5013
5082
|
}
|
|
5014
5083
|
function SidebarInset({ asChild, className, ...props }) {
|
|
5015
5084
|
const Comp = asChild ? import_radix_ui25.Slot.Slot : "main";
|
|
5016
|
-
return /* @__PURE__ */ (0,
|
|
5085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Comp, { "data-slot": "sidebar-inset", className: cn("ddga-sidebar-inset", className), ...props });
|
|
5017
5086
|
}
|
|
5018
5087
|
function SidebarHeader({ asChild, className, ...props }) {
|
|
5019
5088
|
const Comp = asChild ? import_radix_ui25.Slot.Slot : "div";
|
|
5020
|
-
return /* @__PURE__ */ (0,
|
|
5089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Comp, { "data-slot": "sidebar-header", className: cn("ddga-sidebar__header", className), ...props });
|
|
5021
5090
|
}
|
|
5022
5091
|
function SidebarContent({ asChild, className, ...props }) {
|
|
5023
5092
|
const Comp = asChild ? import_radix_ui25.Slot.Slot : "div";
|
|
5024
|
-
return /* @__PURE__ */ (0,
|
|
5093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5025
5094
|
Comp,
|
|
5026
5095
|
{
|
|
5027
5096
|
"data-slot": "sidebar-content",
|
|
@@ -5032,10 +5101,10 @@ function SidebarContent({ asChild, className, ...props }) {
|
|
|
5032
5101
|
}
|
|
5033
5102
|
function SidebarFooter({ asChild, className, ...props }) {
|
|
5034
5103
|
const Comp = asChild ? import_radix_ui25.Slot.Slot : "div";
|
|
5035
|
-
return /* @__PURE__ */ (0,
|
|
5104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Comp, { "data-slot": "sidebar-footer", className: cn("ddga-sidebar__footer", className), ...props });
|
|
5036
5105
|
}
|
|
5037
5106
|
function SidebarSeparator({ className, ...props }) {
|
|
5038
|
-
return /* @__PURE__ */ (0,
|
|
5107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5039
5108
|
"hr",
|
|
5040
5109
|
{
|
|
5041
5110
|
"data-slot": "sidebar-separator",
|
|
@@ -5047,10 +5116,10 @@ function SidebarSeparator({ className, ...props }) {
|
|
|
5047
5116
|
|
|
5048
5117
|
// src/components/Sidebar/SidebarGroup.tsx
|
|
5049
5118
|
var import_radix_ui26 = require("radix-ui");
|
|
5050
|
-
var
|
|
5119
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5051
5120
|
function SidebarGroup({ asChild, className, ...props }) {
|
|
5052
5121
|
const Comp = asChild ? import_radix_ui26.Slot.Slot : "div";
|
|
5053
|
-
return /* @__PURE__ */ (0,
|
|
5122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5054
5123
|
Comp,
|
|
5055
5124
|
{
|
|
5056
5125
|
"data-slot": "sidebar-group",
|
|
@@ -5062,7 +5131,7 @@ function SidebarGroup({ asChild, className, ...props }) {
|
|
|
5062
5131
|
}
|
|
5063
5132
|
function SidebarGroupLabel({ asChild, className, ...props }) {
|
|
5064
5133
|
const Comp = asChild ? import_radix_ui26.Slot.Slot : "div";
|
|
5065
|
-
return /* @__PURE__ */ (0,
|
|
5134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5066
5135
|
Comp,
|
|
5067
5136
|
{
|
|
5068
5137
|
"data-slot": "sidebar-group-label",
|
|
@@ -5073,7 +5142,7 @@ function SidebarGroupLabel({ asChild, className, ...props }) {
|
|
|
5073
5142
|
}
|
|
5074
5143
|
function SidebarGroupAction({ asChild, className, ...props }) {
|
|
5075
5144
|
const Comp = asChild ? import_radix_ui26.Slot.Slot : "button";
|
|
5076
|
-
return /* @__PURE__ */ (0,
|
|
5145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5077
5146
|
Comp,
|
|
5078
5147
|
{
|
|
5079
5148
|
type: asChild ? void 0 : "button",
|
|
@@ -5085,7 +5154,7 @@ function SidebarGroupAction({ asChild, className, ...props }) {
|
|
|
5085
5154
|
}
|
|
5086
5155
|
function SidebarGroupContent({ asChild, className, ...props }) {
|
|
5087
5156
|
const Comp = asChild ? import_radix_ui26.Slot.Slot : "div";
|
|
5088
|
-
return /* @__PURE__ */ (0,
|
|
5157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5089
5158
|
Comp,
|
|
5090
5159
|
{
|
|
5091
5160
|
"data-slot": "sidebar-group-content",
|
|
@@ -5105,12 +5174,12 @@ function useDir() {
|
|
|
5105
5174
|
}
|
|
5106
5175
|
|
|
5107
5176
|
// src/components/Sidebar/SidebarMenu.tsx
|
|
5108
|
-
var
|
|
5177
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5109
5178
|
function SidebarMenu({ className, ...props }) {
|
|
5110
|
-
return /* @__PURE__ */ (0,
|
|
5179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("ul", { "data-slot": "sidebar-menu", className: cn("ddga-sidebar__menu", className), ...props });
|
|
5111
5180
|
}
|
|
5112
5181
|
function SidebarMenuItem({ className, ...props }) {
|
|
5113
|
-
return /* @__PURE__ */ (0,
|
|
5182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5114
5183
|
"li",
|
|
5115
5184
|
{
|
|
5116
5185
|
"data-slot": "sidebar-menu-item",
|
|
@@ -5140,7 +5209,7 @@ function SidebarMenuButton({
|
|
|
5140
5209
|
const { state, isMobile } = useSidebar();
|
|
5141
5210
|
const dir = useDir();
|
|
5142
5211
|
const Comp = asChild ? import_radix_ui27.Slot.Slot : "button";
|
|
5143
|
-
const button = /* @__PURE__ */ (0,
|
|
5212
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5144
5213
|
Comp,
|
|
5145
5214
|
{
|
|
5146
5215
|
type: asChild ? void 0 : "button",
|
|
@@ -5155,14 +5224,14 @@ function SidebarMenuButton({
|
|
|
5155
5224
|
if (!tooltip || state !== "collapsed" || isMobile) {
|
|
5156
5225
|
return button;
|
|
5157
5226
|
}
|
|
5158
|
-
return /* @__PURE__ */ (0,
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5160
|
-
/* @__PURE__ */ (0,
|
|
5227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Tooltip, { children: [
|
|
5228
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { "data-slot": "tooltip-trigger", style: { display: "contents" }, children: button }) }),
|
|
5229
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(TooltipContent, { side: dir === "rtl" ? "left" : "right", children: tooltip })
|
|
5161
5230
|
] });
|
|
5162
5231
|
}
|
|
5163
5232
|
function SidebarMenuAction({ asChild, showOnHover, className, ...props }) {
|
|
5164
5233
|
const Comp = asChild ? import_radix_ui27.Slot.Slot : "button";
|
|
5165
|
-
return /* @__PURE__ */ (0,
|
|
5234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5166
5235
|
Comp,
|
|
5167
5236
|
{
|
|
5168
5237
|
type: asChild ? void 0 : "button",
|
|
@@ -5174,7 +5243,7 @@ function SidebarMenuAction({ asChild, showOnHover, className, ...props }) {
|
|
|
5174
5243
|
);
|
|
5175
5244
|
}
|
|
5176
5245
|
function SidebarMenuBadge({ className, ...props }) {
|
|
5177
|
-
return /* @__PURE__ */ (0,
|
|
5246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5178
5247
|
"span",
|
|
5179
5248
|
{
|
|
5180
5249
|
"data-slot": "sidebar-menu-badge",
|
|
@@ -5184,21 +5253,21 @@ function SidebarMenuBadge({ className, ...props }) {
|
|
|
5184
5253
|
);
|
|
5185
5254
|
}
|
|
5186
5255
|
function SidebarMenuSkeleton({ showIcon, className, ...props }) {
|
|
5187
|
-
return /* @__PURE__ */ (0,
|
|
5256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5188
5257
|
"div",
|
|
5189
5258
|
{
|
|
5190
5259
|
"data-slot": "sidebar-menu-skeleton",
|
|
5191
5260
|
className: cn("ddga-sidebar__menu-skeleton", className),
|
|
5192
5261
|
...props,
|
|
5193
5262
|
children: [
|
|
5194
|
-
showIcon ? /* @__PURE__ */ (0,
|
|
5195
|
-
/* @__PURE__ */ (0,
|
|
5263
|
+
showIcon ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Skeleton, { shape: "circle", width: "1rem", height: "1rem" }) : null,
|
|
5264
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Skeleton, { shape: "text", className: "ddga-sidebar__menu-skeleton-text" })
|
|
5196
5265
|
]
|
|
5197
5266
|
}
|
|
5198
5267
|
);
|
|
5199
5268
|
}
|
|
5200
5269
|
function SidebarMenuSub({ className, ...props }) {
|
|
5201
|
-
return /* @__PURE__ */ (0,
|
|
5270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5202
5271
|
"ul",
|
|
5203
5272
|
{
|
|
5204
5273
|
"data-slot": "sidebar-menu-sub",
|
|
@@ -5208,7 +5277,7 @@ function SidebarMenuSub({ className, ...props }) {
|
|
|
5208
5277
|
);
|
|
5209
5278
|
}
|
|
5210
5279
|
function SidebarMenuSubItem({ className, ...props }) {
|
|
5211
|
-
return /* @__PURE__ */ (0,
|
|
5280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5212
5281
|
"li",
|
|
5213
5282
|
{
|
|
5214
5283
|
"data-slot": "sidebar-menu-sub-item",
|
|
@@ -5234,7 +5303,7 @@ function SidebarMenuSubButton({
|
|
|
5234
5303
|
...props
|
|
5235
5304
|
}) {
|
|
5236
5305
|
const Comp = asChild ? import_radix_ui27.Slot.Slot : "a";
|
|
5237
|
-
return /* @__PURE__ */ (0,
|
|
5306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5238
5307
|
Comp,
|
|
5239
5308
|
{
|
|
5240
5309
|
"data-slot": "sidebar-menu-sub-button",
|
|
@@ -5250,7 +5319,7 @@ function SidebarMenuSubButton({
|
|
|
5250
5319
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
5251
5320
|
var import_radix_ui28 = require("radix-ui");
|
|
5252
5321
|
var import_class_variance_authority38 = require("class-variance-authority");
|
|
5253
|
-
var
|
|
5322
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5254
5323
|
var scrollAreaVariants = (0, import_class_variance_authority38.cva)("ddga-scroll-area", {
|
|
5255
5324
|
variants: {
|
|
5256
5325
|
orientation: {
|
|
@@ -5287,7 +5356,7 @@ function ScrollArea({
|
|
|
5287
5356
|
const showVertical = orientation === "vertical" || orientation === "both";
|
|
5288
5357
|
const showHorizontal = orientation === "horizontal" || orientation === "both";
|
|
5289
5358
|
const { className: viewportClassName, ...restViewportProps } = viewportProps ?? {};
|
|
5290
|
-
return /* @__PURE__ */ (0,
|
|
5359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
5291
5360
|
import_radix_ui28.ScrollArea.Root,
|
|
5292
5361
|
{
|
|
5293
5362
|
"data-slot": "scroll-area",
|
|
@@ -5296,7 +5365,7 @@ function ScrollArea({
|
|
|
5296
5365
|
className: cn(scrollAreaVariants({ orientation }), className),
|
|
5297
5366
|
...props,
|
|
5298
5367
|
children: [
|
|
5299
|
-
/* @__PURE__ */ (0,
|
|
5368
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5300
5369
|
import_radix_ui28.ScrollArea.Viewport,
|
|
5301
5370
|
{
|
|
5302
5371
|
"data-slot": "scroll-area-viewport",
|
|
@@ -5310,35 +5379,35 @@ function ScrollArea({
|
|
|
5310
5379
|
children
|
|
5311
5380
|
}
|
|
5312
5381
|
),
|
|
5313
|
-
showVertical ? /* @__PURE__ */ (0,
|
|
5382
|
+
showVertical ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5314
5383
|
import_radix_ui28.ScrollArea.Scrollbar,
|
|
5315
5384
|
{
|
|
5316
5385
|
"data-slot": "scroll-area-scrollbar",
|
|
5317
5386
|
orientation: "vertical",
|
|
5318
5387
|
className: "ddga-scroll-area__scrollbar",
|
|
5319
|
-
children: /* @__PURE__ */ (0,
|
|
5388
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui28.ScrollArea.Thumb, { className: "ddga-scroll-area__thumb" })
|
|
5320
5389
|
}
|
|
5321
5390
|
) : null,
|
|
5322
|
-
showHorizontal ? /* @__PURE__ */ (0,
|
|
5391
|
+
showHorizontal ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5323
5392
|
import_radix_ui28.ScrollArea.Scrollbar,
|
|
5324
5393
|
{
|
|
5325
5394
|
"data-slot": "scroll-area-scrollbar",
|
|
5326
5395
|
orientation: "horizontal",
|
|
5327
5396
|
className: "ddga-scroll-area__scrollbar",
|
|
5328
|
-
children: /* @__PURE__ */ (0,
|
|
5397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui28.ScrollArea.Thumb, { className: "ddga-scroll-area__thumb" })
|
|
5329
5398
|
}
|
|
5330
5399
|
) : null,
|
|
5331
|
-
orientation === "both" ? /* @__PURE__ */ (0,
|
|
5400
|
+
orientation === "both" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui28.ScrollArea.Corner, { className: "ddga-scroll-area__corner" }) : null
|
|
5332
5401
|
]
|
|
5333
5402
|
}
|
|
5334
5403
|
);
|
|
5335
5404
|
}
|
|
5336
5405
|
|
|
5337
5406
|
// src/components/Menubar/Menubar.tsx
|
|
5338
|
-
var
|
|
5407
|
+
var import_react29 = require("react");
|
|
5339
5408
|
var import_radix_ui29 = require("radix-ui");
|
|
5340
5409
|
var import_class_variance_authority39 = require("class-variance-authority");
|
|
5341
|
-
var
|
|
5410
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5342
5411
|
var menubarContentVariants = (0, import_class_variance_authority39.cva)("ddga-menubar-menu", {
|
|
5343
5412
|
variants: {
|
|
5344
5413
|
size: {
|
|
@@ -5362,7 +5431,7 @@ var menubarTriggerVariants = (0, import_class_variance_authority39.cva)("ddga-me
|
|
|
5362
5431
|
}
|
|
5363
5432
|
});
|
|
5364
5433
|
function Menubar({ className, ...props }) {
|
|
5365
|
-
return /* @__PURE__ */ (0,
|
|
5434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5366
5435
|
import_radix_ui29.Menubar.Root,
|
|
5367
5436
|
{
|
|
5368
5437
|
"data-slot": "menubar",
|
|
@@ -5372,10 +5441,10 @@ function Menubar({ className, ...props }) {
|
|
|
5372
5441
|
);
|
|
5373
5442
|
}
|
|
5374
5443
|
function MenubarMenu(props) {
|
|
5375
|
-
return /* @__PURE__ */ (0,
|
|
5444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.Menu, { ...props });
|
|
5376
5445
|
}
|
|
5377
5446
|
function MenubarTrigger({ variant, className, ...props }) {
|
|
5378
|
-
return /* @__PURE__ */ (0,
|
|
5447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5379
5448
|
import_radix_ui29.Menubar.Trigger,
|
|
5380
5449
|
{
|
|
5381
5450
|
"data-slot": "menubar-trigger",
|
|
@@ -5386,9 +5455,9 @@ function MenubarTrigger({ variant, className, ...props }) {
|
|
|
5386
5455
|
);
|
|
5387
5456
|
}
|
|
5388
5457
|
function MenubarContent({ size, className, sideOffset = 6, ...props }) {
|
|
5389
|
-
const ctx = (0,
|
|
5458
|
+
const ctx = (0, import_react29.useContext)(DgaContext);
|
|
5390
5459
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
5391
|
-
return /* @__PURE__ */ (0,
|
|
5460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5392
5461
|
import_radix_ui29.Menubar.Content,
|
|
5393
5462
|
{
|
|
5394
5463
|
"data-slot": "menubar-content",
|
|
@@ -5406,7 +5475,7 @@ function MenubarItem({
|
|
|
5406
5475
|
children,
|
|
5407
5476
|
...props
|
|
5408
5477
|
}) {
|
|
5409
|
-
return /* @__PURE__ */ (0,
|
|
5478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5410
5479
|
import_radix_ui29.Menubar.Item,
|
|
5411
5480
|
{
|
|
5412
5481
|
"data-slot": "menubar-item",
|
|
@@ -5414,9 +5483,9 @@ function MenubarItem({
|
|
|
5414
5483
|
className: cn("ddga-menubar-menu__item", className),
|
|
5415
5484
|
...props,
|
|
5416
5485
|
children: [
|
|
5417
|
-
startIcon ? /* @__PURE__ */ (0,
|
|
5418
|
-
/* @__PURE__ */ (0,
|
|
5419
|
-
shortcut ? /* @__PURE__ */ (0,
|
|
5486
|
+
startIcon ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__icon", "aria-hidden": "true", children: startIcon }) : null,
|
|
5487
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__label", children }),
|
|
5488
|
+
shortcut ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__shortcut", "aria-hidden": "true", children: shortcut }) : null
|
|
5420
5489
|
]
|
|
5421
5490
|
}
|
|
5422
5491
|
);
|
|
@@ -5430,7 +5499,7 @@ function MenubarCheckboxItem({
|
|
|
5430
5499
|
const handleSelect = onSelect ?? ((event) => {
|
|
5431
5500
|
event.preventDefault();
|
|
5432
5501
|
});
|
|
5433
|
-
return /* @__PURE__ */ (0,
|
|
5502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5434
5503
|
import_radix_ui29.Menubar.CheckboxItem,
|
|
5435
5504
|
{
|
|
5436
5505
|
"data-slot": "menubar-checkbox-item",
|
|
@@ -5438,20 +5507,20 @@ function MenubarCheckboxItem({
|
|
|
5438
5507
|
onSelect: handleSelect,
|
|
5439
5508
|
...props,
|
|
5440
5509
|
children: [
|
|
5441
|
-
/* @__PURE__ */ (0,
|
|
5442
|
-
/* @__PURE__ */ (0,
|
|
5510
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__indicator", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Check, { className: "ddga-menubar-menu__indicator-icon" }) }) }),
|
|
5511
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__label", children })
|
|
5443
5512
|
]
|
|
5444
5513
|
}
|
|
5445
5514
|
);
|
|
5446
5515
|
}
|
|
5447
5516
|
function MenubarRadioGroup(props) {
|
|
5448
|
-
return /* @__PURE__ */ (0,
|
|
5517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.RadioGroup, { "data-slot": "menubar-radio-group", ...props });
|
|
5449
5518
|
}
|
|
5450
5519
|
function MenubarRadioItem({ className, children, onSelect, ...props }) {
|
|
5451
5520
|
const handleSelect = onSelect ?? ((event) => {
|
|
5452
5521
|
event.preventDefault();
|
|
5453
5522
|
});
|
|
5454
|
-
return /* @__PURE__ */ (0,
|
|
5523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5455
5524
|
import_radix_ui29.Menubar.RadioItem,
|
|
5456
5525
|
{
|
|
5457
5526
|
"data-slot": "menubar-radio-item",
|
|
@@ -5459,14 +5528,14 @@ function MenubarRadioItem({ className, children, onSelect, ...props }) {
|
|
|
5459
5528
|
onSelect: handleSelect,
|
|
5460
5529
|
...props,
|
|
5461
5530
|
children: [
|
|
5462
|
-
/* @__PURE__ */ (0,
|
|
5463
|
-
/* @__PURE__ */ (0,
|
|
5531
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__indicator", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__radio-dot" }) }) }),
|
|
5532
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__label", children })
|
|
5464
5533
|
]
|
|
5465
5534
|
}
|
|
5466
5535
|
);
|
|
5467
5536
|
}
|
|
5468
5537
|
function MenubarLabel({ className, ...props }) {
|
|
5469
|
-
return /* @__PURE__ */ (0,
|
|
5538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5470
5539
|
import_radix_ui29.Menubar.Label,
|
|
5471
5540
|
{
|
|
5472
5541
|
"data-slot": "menubar-label",
|
|
@@ -5476,7 +5545,7 @@ function MenubarLabel({ className, ...props }) {
|
|
|
5476
5545
|
);
|
|
5477
5546
|
}
|
|
5478
5547
|
function MenubarSeparator({ className, ...props }) {
|
|
5479
|
-
return /* @__PURE__ */ (0,
|
|
5548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5480
5549
|
import_radix_ui29.Menubar.Separator,
|
|
5481
5550
|
{
|
|
5482
5551
|
"data-slot": "menubar-separator",
|
|
@@ -5486,30 +5555,30 @@ function MenubarSeparator({ className, ...props }) {
|
|
|
5486
5555
|
);
|
|
5487
5556
|
}
|
|
5488
5557
|
function MenubarGroup(props) {
|
|
5489
|
-
return /* @__PURE__ */ (0,
|
|
5558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.Group, { "data-slot": "menubar-group", ...props });
|
|
5490
5559
|
}
|
|
5491
5560
|
function MenubarSub(props) {
|
|
5492
|
-
return /* @__PURE__ */ (0,
|
|
5561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.Sub, { ...props });
|
|
5493
5562
|
}
|
|
5494
5563
|
function MenubarSubTrigger({ className, startIcon, children, ...props }) {
|
|
5495
|
-
return /* @__PURE__ */ (0,
|
|
5564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5496
5565
|
import_radix_ui29.Menubar.SubTrigger,
|
|
5497
5566
|
{
|
|
5498
5567
|
"data-slot": "menubar-sub-trigger",
|
|
5499
5568
|
className: cn("ddga-menubar-menu__item", "ddga-menubar-menu__item--sub", className),
|
|
5500
5569
|
...props,
|
|
5501
5570
|
children: [
|
|
5502
|
-
startIcon ? /* @__PURE__ */ (0,
|
|
5503
|
-
/* @__PURE__ */ (0,
|
|
5504
|
-
/* @__PURE__ */ (0,
|
|
5571
|
+
startIcon ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__icon", "aria-hidden": "true", children: startIcon }) : null,
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ddga-menubar-menu__label", children }),
|
|
5573
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ChevronRight, { className: "ddga-menubar-menu__sub-chevron", "aria-hidden": "true" })
|
|
5505
5574
|
]
|
|
5506
5575
|
}
|
|
5507
5576
|
);
|
|
5508
5577
|
}
|
|
5509
5578
|
function MenubarSubContent({ size, className, ...props }) {
|
|
5510
|
-
const ctx = (0,
|
|
5579
|
+
const ctx = (0, import_react29.useContext)(DgaContext);
|
|
5511
5580
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
5512
|
-
return /* @__PURE__ */ (0,
|
|
5581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_radix_ui29.Menubar.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5513
5582
|
import_radix_ui29.Menubar.SubContent,
|
|
5514
5583
|
{
|
|
5515
5584
|
"data-slot": "menubar-sub-content",
|
|
@@ -5521,7 +5590,7 @@ function MenubarSubContent({ size, className, ...props }) {
|
|
|
5521
5590
|
|
|
5522
5591
|
// src/components/Timeline/Timeline.tsx
|
|
5523
5592
|
var import_class_variance_authority40 = require("class-variance-authority");
|
|
5524
|
-
var
|
|
5593
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5525
5594
|
var timelineVariants = (0, import_class_variance_authority40.cva)("ddga-timeline", {
|
|
5526
5595
|
variants: {
|
|
5527
5596
|
size: {
|
|
@@ -5553,7 +5622,7 @@ var timelineMarkerVariants = (0, import_class_variance_authority40.cva)("ddga-ti
|
|
|
5553
5622
|
}
|
|
5554
5623
|
});
|
|
5555
5624
|
function Timeline({ size, orientation, className, ...props }) {
|
|
5556
|
-
return /* @__PURE__ */ (0,
|
|
5625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5557
5626
|
"ol",
|
|
5558
5627
|
{
|
|
5559
5628
|
"data-slot": "timeline",
|
|
@@ -5564,12 +5633,12 @@ function Timeline({ size, orientation, className, ...props }) {
|
|
|
5564
5633
|
);
|
|
5565
5634
|
}
|
|
5566
5635
|
function TimelineItem({ className, ...props }) {
|
|
5567
|
-
return /* @__PURE__ */ (0,
|
|
5636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { "data-slot": "timeline-item", className: cn("ddga-timeline__item", className), ...props });
|
|
5568
5637
|
}
|
|
5569
5638
|
function TimelineMarker({ status, className, children, ...props }) {
|
|
5570
5639
|
const resolved = status ?? "default";
|
|
5571
5640
|
const reached = resolved !== "default";
|
|
5572
|
-
return /* @__PURE__ */ (0,
|
|
5641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5573
5642
|
"span",
|
|
5574
5643
|
{
|
|
5575
5644
|
"aria-hidden": "true",
|
|
@@ -5578,12 +5647,12 @@ function TimelineMarker({ status, className, children, ...props }) {
|
|
|
5578
5647
|
"data-reached": reached ? "" : void 0,
|
|
5579
5648
|
className: cn(timelineMarkerVariants({ status }), className),
|
|
5580
5649
|
...props,
|
|
5581
|
-
children: children ?? /* @__PURE__ */ (0,
|
|
5650
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "ddga-timeline__dot" })
|
|
5582
5651
|
}
|
|
5583
5652
|
);
|
|
5584
5653
|
}
|
|
5585
5654
|
function TimelineContent({ className, ...props }) {
|
|
5586
|
-
return /* @__PURE__ */ (0,
|
|
5655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5587
5656
|
"div",
|
|
5588
5657
|
{
|
|
5589
5658
|
"data-slot": "timeline-content",
|
|
@@ -5593,10 +5662,10 @@ function TimelineContent({ className, ...props }) {
|
|
|
5593
5662
|
);
|
|
5594
5663
|
}
|
|
5595
5664
|
function TimelineTitle({ className, ...props }) {
|
|
5596
|
-
return /* @__PURE__ */ (0,
|
|
5665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { "data-slot": "timeline-title", className: cn("ddga-timeline__title", className), ...props });
|
|
5597
5666
|
}
|
|
5598
5667
|
function TimelineDescription({ className, ...props }) {
|
|
5599
|
-
return /* @__PURE__ */ (0,
|
|
5668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5600
5669
|
"span",
|
|
5601
5670
|
{
|
|
5602
5671
|
"data-slot": "timeline-description",
|
|
@@ -5606,18 +5675,18 @@ function TimelineDescription({ className, ...props }) {
|
|
|
5606
5675
|
);
|
|
5607
5676
|
}
|
|
5608
5677
|
function TimelineTime({ className, ...props }) {
|
|
5609
|
-
return /* @__PURE__ */ (0,
|
|
5678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("time", { "data-slot": "timeline-time", className: cn("ddga-timeline__time", className), ...props });
|
|
5610
5679
|
}
|
|
5611
5680
|
|
|
5612
5681
|
// src/components/Command/Command.tsx
|
|
5613
|
-
var
|
|
5682
|
+
var import_react30 = require("react");
|
|
5614
5683
|
var import_cmdk2 = require("cmdk");
|
|
5615
5684
|
var import_radix_ui30 = require("radix-ui");
|
|
5616
5685
|
var import_class_variance_authority41 = require("class-variance-authority");
|
|
5617
|
-
var
|
|
5686
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5618
5687
|
var commandVariants = (0, import_class_variance_authority41.cva)("ddga-command");
|
|
5619
5688
|
function Command2({ className, ...props }) {
|
|
5620
|
-
return /* @__PURE__ */ (0,
|
|
5689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_cmdk2.Command, { "data-slot": "command", className: cn(commandVariants(), className), ...props });
|
|
5621
5690
|
}
|
|
5622
5691
|
function CommandInput({
|
|
5623
5692
|
className,
|
|
@@ -5625,9 +5694,9 @@ function CommandInput({
|
|
|
5625
5694
|
"aria-label": ariaLabel,
|
|
5626
5695
|
...props
|
|
5627
5696
|
}) {
|
|
5628
|
-
return /* @__PURE__ */ (0,
|
|
5629
|
-
/* @__PURE__ */ (0,
|
|
5630
|
-
/* @__PURE__ */ (0,
|
|
5697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "ddga-command__input-wrapper", "data-slot": "command-input-wrapper", children: [
|
|
5698
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Search, { className: "ddga-command__search-icon", "aria-hidden": "true" }),
|
|
5699
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5631
5700
|
import_cmdk2.Command.Input,
|
|
5632
5701
|
{
|
|
5633
5702
|
"data-slot": "command-input",
|
|
@@ -5640,7 +5709,7 @@ function CommandInput({
|
|
|
5640
5709
|
] });
|
|
5641
5710
|
}
|
|
5642
5711
|
function CommandList({ className, ...props }) {
|
|
5643
|
-
return /* @__PURE__ */ (0,
|
|
5712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5644
5713
|
import_cmdk2.Command.List,
|
|
5645
5714
|
{
|
|
5646
5715
|
"data-slot": "command-list",
|
|
@@ -5650,7 +5719,7 @@ function CommandList({ className, ...props }) {
|
|
|
5650
5719
|
);
|
|
5651
5720
|
}
|
|
5652
5721
|
function CommandEmpty({ className, ...props }) {
|
|
5653
|
-
return /* @__PURE__ */ (0,
|
|
5722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5654
5723
|
import_cmdk2.Command.Empty,
|
|
5655
5724
|
{
|
|
5656
5725
|
"data-slot": "command-empty",
|
|
@@ -5660,7 +5729,7 @@ function CommandEmpty({ className, ...props }) {
|
|
|
5660
5729
|
);
|
|
5661
5730
|
}
|
|
5662
5731
|
function CommandGroup({ className, ...props }) {
|
|
5663
|
-
return /* @__PURE__ */ (0,
|
|
5732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5664
5733
|
import_cmdk2.Command.Group,
|
|
5665
5734
|
{
|
|
5666
5735
|
"data-slot": "command-group",
|
|
@@ -5674,7 +5743,7 @@ function CommandSeparator({
|
|
|
5674
5743
|
"aria-hidden": ariaHidden = true,
|
|
5675
5744
|
...props
|
|
5676
5745
|
}) {
|
|
5677
|
-
return /* @__PURE__ */ (0,
|
|
5746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5678
5747
|
import_cmdk2.Command.Separator,
|
|
5679
5748
|
{
|
|
5680
5749
|
"aria-hidden": ariaHidden,
|
|
@@ -5694,7 +5763,7 @@ function CommandItem({
|
|
|
5694
5763
|
}) {
|
|
5695
5764
|
const labelText = typeof children === "string" ? children : void 0;
|
|
5696
5765
|
const mergedKeywords = labelText && !keywords?.includes(labelText) ? [...keywords ?? [], labelText] : keywords;
|
|
5697
|
-
return /* @__PURE__ */ (0,
|
|
5766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
5698
5767
|
import_cmdk2.Command.Item,
|
|
5699
5768
|
{
|
|
5700
5769
|
"data-slot": "command-item",
|
|
@@ -5702,9 +5771,9 @@ function CommandItem({
|
|
|
5702
5771
|
keywords: mergedKeywords,
|
|
5703
5772
|
...props,
|
|
5704
5773
|
children: [
|
|
5705
|
-
startIcon != null && /* @__PURE__ */ (0,
|
|
5706
|
-
/* @__PURE__ */ (0,
|
|
5707
|
-
shortcut != null && /* @__PURE__ */ (0,
|
|
5774
|
+
startIcon != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "ddga-command__item-icon", "aria-hidden": "true", children: startIcon }),
|
|
5775
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "ddga-command__item-label", children }),
|
|
5776
|
+
shortcut != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "ddga-command__item-shortcut", children: shortcut })
|
|
5708
5777
|
]
|
|
5709
5778
|
}
|
|
5710
5779
|
);
|
|
@@ -5722,21 +5791,21 @@ function CommandDialog({
|
|
|
5722
5791
|
loop,
|
|
5723
5792
|
children
|
|
5724
5793
|
}) {
|
|
5725
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
5794
|
+
const [internalOpen, setInternalOpen] = (0, import_react30.useState)(defaultOpen ?? false);
|
|
5726
5795
|
const isControlled = controlledOpen !== void 0;
|
|
5727
5796
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
5728
|
-
const setOpen = (0,
|
|
5797
|
+
const setOpen = (0, import_react30.useCallback)(
|
|
5729
5798
|
(next) => {
|
|
5730
5799
|
if (!isControlled) setInternalOpen(next);
|
|
5731
5800
|
onOpenChange?.(next);
|
|
5732
5801
|
},
|
|
5733
5802
|
[isControlled, onOpenChange]
|
|
5734
5803
|
);
|
|
5735
|
-
const openRef = (0,
|
|
5736
|
-
(0,
|
|
5804
|
+
const openRef = (0, import_react30.useRef)(open);
|
|
5805
|
+
(0, import_react30.useEffect)(() => {
|
|
5737
5806
|
openRef.current = open;
|
|
5738
5807
|
});
|
|
5739
|
-
(0,
|
|
5808
|
+
(0, import_react30.useEffect)(() => {
|
|
5740
5809
|
if (typeof shortcut !== "string") return;
|
|
5741
5810
|
const key = shortcut.toLowerCase();
|
|
5742
5811
|
const onKeyDown = (event) => {
|
|
@@ -5748,20 +5817,20 @@ function CommandDialog({
|
|
|
5748
5817
|
document.addEventListener("keydown", onKeyDown);
|
|
5749
5818
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
5750
5819
|
}, [shortcut, setOpen]);
|
|
5751
|
-
const ctx = (0,
|
|
5820
|
+
const ctx = (0, import_react30.useContext)(DgaContext);
|
|
5752
5821
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
5753
|
-
return /* @__PURE__ */ (0,
|
|
5754
|
-
/* @__PURE__ */ (0,
|
|
5755
|
-
/* @__PURE__ */ (0,
|
|
5822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_radix_ui30.Dialog.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_radix_ui30.Dialog.Portal, { container: portalContainer, children: [
|
|
5823
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_radix_ui30.Dialog.Overlay, { className: "ddga-command__overlay", "data-slot": "command-overlay" }),
|
|
5824
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
5756
5825
|
import_radix_ui30.Dialog.Content,
|
|
5757
5826
|
{
|
|
5758
5827
|
"data-slot": "command-dialog",
|
|
5759
5828
|
className: cn("ddga-command-dialog", className),
|
|
5760
5829
|
...description == null ? { "aria-describedby": void 0 } : {},
|
|
5761
5830
|
children: [
|
|
5762
|
-
/* @__PURE__ */ (0,
|
|
5763
|
-
description != null && /* @__PURE__ */ (0,
|
|
5764
|
-
/* @__PURE__ */ (0,
|
|
5831
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_radix_ui30.Dialog.Title, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_radix_ui30.VisuallyHidden.Root, { children: label }) }),
|
|
5832
|
+
description != null && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_radix_ui30.Dialog.Description, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_radix_ui30.VisuallyHidden.Root, { children: description }) }),
|
|
5833
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5765
5834
|
Command2,
|
|
5766
5835
|
{
|
|
5767
5836
|
"data-slot": "command-dialog-command",
|
|
@@ -5781,7 +5850,7 @@ function CommandDialog({
|
|
|
5781
5850
|
|
|
5782
5851
|
// src/components/Table/Table.tsx
|
|
5783
5852
|
var import_class_variance_authority42 = require("class-variance-authority");
|
|
5784
|
-
var
|
|
5853
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5785
5854
|
var tableVariants = (0, import_class_variance_authority42.cva)("ddga-table", {
|
|
5786
5855
|
variants: {
|
|
5787
5856
|
size: {
|
|
@@ -5821,7 +5890,7 @@ function Table({
|
|
|
5821
5890
|
"[ddga] <Table> received both `aria-label` and `aria-labelledby`. `aria-labelledby` takes precedence; `aria-label` will be ignored by assistive technology."
|
|
5822
5891
|
);
|
|
5823
5892
|
}
|
|
5824
|
-
return /* @__PURE__ */ (0,
|
|
5893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5825
5894
|
"div",
|
|
5826
5895
|
{
|
|
5827
5896
|
"data-slot": "table-region",
|
|
@@ -5833,7 +5902,7 @@ function Table({
|
|
|
5833
5902
|
"aria-label": ariaLabel,
|
|
5834
5903
|
"aria-labelledby": ariaLabelledby
|
|
5835
5904
|
} : {},
|
|
5836
|
-
children: /* @__PURE__ */ (0,
|
|
5905
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5837
5906
|
"table",
|
|
5838
5907
|
{
|
|
5839
5908
|
"data-slot": "table",
|
|
@@ -5845,16 +5914,16 @@ function Table({
|
|
|
5845
5914
|
);
|
|
5846
5915
|
}
|
|
5847
5916
|
function TableHeader({ className, ...props }) {
|
|
5848
|
-
return /* @__PURE__ */ (0,
|
|
5917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { "data-slot": "table-header", className: cn("ddga-table__header", className), ...props });
|
|
5849
5918
|
}
|
|
5850
5919
|
function TableBody({ className, ...props }) {
|
|
5851
|
-
return /* @__PURE__ */ (0,
|
|
5920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tbody", { "data-slot": "table-body", className: cn("ddga-table__body", className), ...props });
|
|
5852
5921
|
}
|
|
5853
5922
|
function TableFooter({ className, ...props }) {
|
|
5854
|
-
return /* @__PURE__ */ (0,
|
|
5923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tfoot", { "data-slot": "table-footer", className: cn("ddga-table__footer", className), ...props });
|
|
5855
5924
|
}
|
|
5856
5925
|
function TableRow({ className, selected, ...props }) {
|
|
5857
|
-
return /* @__PURE__ */ (0,
|
|
5926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5858
5927
|
"tr",
|
|
5859
5928
|
{
|
|
5860
5929
|
"data-slot": "table-row",
|
|
@@ -5881,10 +5950,10 @@ function TableHead({
|
|
|
5881
5950
|
);
|
|
5882
5951
|
}
|
|
5883
5952
|
if (!sortable) {
|
|
5884
|
-
return /* @__PURE__ */ (0,
|
|
5953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { scope: "col", "data-slot": "table-head", className: headClass, ...props, children });
|
|
5885
5954
|
}
|
|
5886
5955
|
const ariaSort = sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : "none";
|
|
5887
|
-
return /* @__PURE__ */ (0,
|
|
5956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { scope: "col", "data-slot": "table-head", "aria-sort": ariaSort, className: headClass, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5888
5957
|
"button",
|
|
5889
5958
|
{
|
|
5890
5959
|
type: "button",
|
|
@@ -5893,12 +5962,12 @@ function TableHead({
|
|
|
5893
5962
|
onClick,
|
|
5894
5963
|
children: [
|
|
5895
5964
|
children,
|
|
5896
|
-
sortLabel ? /* @__PURE__ */ (0,
|
|
5897
|
-
/* @__PURE__ */ (0,
|
|
5965
|
+
sortLabel ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "ddga-sr-only", children: sortLabel }) : null,
|
|
5966
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "ddga-table__sort-icon", "data-slot": "table-sort-icon", "aria-hidden": "true", children: sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CaretUp, {}) : sortDirection === "desc" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CaretDown, {}) : (
|
|
5898
5967
|
// Neutral affordance: stacked carets, dimmed via CSS.
|
|
5899
|
-
/* @__PURE__ */ (0,
|
|
5900
|
-
/* @__PURE__ */ (0,
|
|
5901
|
-
/* @__PURE__ */ (0,
|
|
5968
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
5969
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CaretUp, {}),
|
|
5970
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CaretDown, {})
|
|
5902
5971
|
] })
|
|
5903
5972
|
) })
|
|
5904
5973
|
]
|
|
@@ -5906,7 +5975,7 @@ function TableHead({
|
|
|
5906
5975
|
) });
|
|
5907
5976
|
}
|
|
5908
5977
|
function TableCell({ className, align, ...props }) {
|
|
5909
|
-
return /* @__PURE__ */ (0,
|
|
5978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5910
5979
|
"td",
|
|
5911
5980
|
{
|
|
5912
5981
|
"data-slot": "table-cell",
|
|
@@ -5916,7 +5985,7 @@ function TableCell({ className, align, ...props }) {
|
|
|
5916
5985
|
);
|
|
5917
5986
|
}
|
|
5918
5987
|
function TableCaption({ className, ...props }) {
|
|
5919
|
-
return /* @__PURE__ */ (0,
|
|
5988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5920
5989
|
"caption",
|
|
5921
5990
|
{
|
|
5922
5991
|
"data-slot": "table-caption",
|
|
@@ -5927,9 +5996,9 @@ function TableCaption({ className, ...props }) {
|
|
|
5927
5996
|
}
|
|
5928
5997
|
|
|
5929
5998
|
// src/components/InputOTP/InputOTP.tsx
|
|
5930
|
-
var
|
|
5999
|
+
var import_react31 = require("react");
|
|
5931
6000
|
var import_class_variance_authority43 = require("class-variance-authority");
|
|
5932
|
-
var
|
|
6001
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5933
6002
|
var DEFAULT_PATTERN = "^[0-9]*$";
|
|
5934
6003
|
var inputOTPVariants = (0, import_class_variance_authority43.cva)("ddga-input-otp", {
|
|
5935
6004
|
variants: {
|
|
@@ -5965,7 +6034,7 @@ function Slot({
|
|
|
5965
6034
|
caret,
|
|
5966
6035
|
mask
|
|
5967
6036
|
}) {
|
|
5968
|
-
return /* @__PURE__ */ (0,
|
|
6037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5969
6038
|
"div",
|
|
5970
6039
|
{
|
|
5971
6040
|
"data-slot": "input-otp-slot",
|
|
@@ -5974,7 +6043,7 @@ function Slot({
|
|
|
5974
6043
|
className: "ddga-input-otp__slot",
|
|
5975
6044
|
children: [
|
|
5976
6045
|
char != null ? mask ? "\u2022" : char : null,
|
|
5977
|
-
caret && /* @__PURE__ */ (0,
|
|
6046
|
+
caret && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { "aria-hidden": "true", "data-slot": "input-otp-caret", className: "ddga-input-otp__caret" })
|
|
5978
6047
|
]
|
|
5979
6048
|
}
|
|
5980
6049
|
);
|
|
@@ -6004,12 +6073,12 @@ function InputOTP({
|
|
|
6004
6073
|
"aria-labelledby": ariaLabelledby,
|
|
6005
6074
|
...props
|
|
6006
6075
|
}) {
|
|
6007
|
-
const inputRef = (0,
|
|
6008
|
-
const [focused, setFocused] = (0,
|
|
6076
|
+
const inputRef = (0, import_react31.useRef)(null);
|
|
6077
|
+
const [focused, setFocused] = (0, import_react31.useState)(false);
|
|
6009
6078
|
const isControlled = value !== void 0;
|
|
6010
|
-
const [internal, setInternal] = (0,
|
|
6079
|
+
const [internal, setInternal] = (0, import_react31.useState)(defaultValue ?? "");
|
|
6011
6080
|
const current = isControlled ? value : internal;
|
|
6012
|
-
const compiledPattern = (0,
|
|
6081
|
+
const compiledPattern = (0, import_react31.useMemo)(() => {
|
|
6013
6082
|
try {
|
|
6014
6083
|
return new RegExp(pattern);
|
|
6015
6084
|
} catch {
|
|
@@ -6021,7 +6090,7 @@ function InputOTP({
|
|
|
6021
6090
|
return new RegExp(DEFAULT_PATTERN);
|
|
6022
6091
|
}
|
|
6023
6092
|
}, [pattern]);
|
|
6024
|
-
const completedRef = (0,
|
|
6093
|
+
const completedRef = (0, import_react31.useRef)(null);
|
|
6025
6094
|
const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
|
|
6026
6095
|
name: "InputOTP",
|
|
6027
6096
|
id: externalId,
|
|
@@ -6054,18 +6123,18 @@ function InputOTP({
|
|
|
6054
6123
|
const lastGroup = groups.length - 1;
|
|
6055
6124
|
const activeIndex = focused ? Math.min(current.length, length - 1) : -1;
|
|
6056
6125
|
const inputMode = pattern === DEFAULT_PATTERN ? "numeric" : "text";
|
|
6057
|
-
return /* @__PURE__ */ (0,
|
|
6058
|
-
label && /* @__PURE__ */ (0,
|
|
6126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { "data-slot": "input-otp-field", className: "ddga-field", ...props, children: [
|
|
6127
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { htmlFor: fieldId, className: "ddga-input-otp__label", children: [
|
|
6059
6128
|
label,
|
|
6060
|
-
required && /* @__PURE__ */ (0,
|
|
6129
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { "aria-hidden": "true", className: "ddga-input-otp__required", children: "*" })
|
|
6061
6130
|
] }),
|
|
6062
|
-
/* @__PURE__ */ (0,
|
|
6131
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6063
6132
|
"div",
|
|
6064
6133
|
{
|
|
6065
6134
|
className: cn(inputOTPVariants({ size, error: hasError }), className),
|
|
6066
6135
|
"data-slot": "input-otp",
|
|
6067
6136
|
children: [
|
|
6068
|
-
/* @__PURE__ */ (0,
|
|
6137
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6069
6138
|
"input",
|
|
6070
6139
|
{
|
|
6071
6140
|
...controlProps,
|
|
@@ -6092,12 +6161,12 @@ function InputOTP({
|
|
|
6092
6161
|
"data-slot": "input-otp-input"
|
|
6093
6162
|
}
|
|
6094
6163
|
),
|
|
6095
|
-
/* @__PURE__ */ (0,
|
|
6164
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { dir: "ltr", "aria-hidden": "true", "data-slot": "input-otp-row", className: "ddga-input-otp__row", children: groups.map((count, groupIndex) => {
|
|
6096
6165
|
const start = groups.slice(0, groupIndex).reduce((total, n) => total + n, 0);
|
|
6097
|
-
return /* @__PURE__ */ (0,
|
|
6098
|
-
/* @__PURE__ */ (0,
|
|
6166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_react31.Fragment, { children: [
|
|
6167
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { "data-slot": "input-otp-group", className: "ddga-input-otp__group", children: Array.from({ length: count }, (_, offset) => {
|
|
6099
6168
|
const index = start + offset;
|
|
6100
|
-
return /* @__PURE__ */ (0,
|
|
6169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6101
6170
|
Slot,
|
|
6102
6171
|
{
|
|
6103
6172
|
char: current[index],
|
|
@@ -6108,13 +6177,13 @@ function InputOTP({
|
|
|
6108
6177
|
index
|
|
6109
6178
|
);
|
|
6110
6179
|
}) }),
|
|
6111
|
-
groupIndex < lastGroup && /* @__PURE__ */ (0,
|
|
6180
|
+
groupIndex < lastGroup && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6112
6181
|
"span",
|
|
6113
6182
|
{
|
|
6114
6183
|
"aria-hidden": "true",
|
|
6115
6184
|
"data-slot": "input-otp-separator",
|
|
6116
6185
|
className: "ddga-input-otp__separator",
|
|
6117
|
-
children: separator ?? /* @__PURE__ */ (0,
|
|
6186
|
+
children: separator ?? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "ddga-input-otp__separator-dash" })
|
|
6118
6187
|
}
|
|
6119
6188
|
)
|
|
6120
6189
|
] }, groupIndex);
|
|
@@ -6122,16 +6191,16 @@ function InputOTP({
|
|
|
6122
6191
|
]
|
|
6123
6192
|
}
|
|
6124
6193
|
),
|
|
6125
|
-
hasErrorMessage && /* @__PURE__ */ (0,
|
|
6126
|
-
hasHelper && /* @__PURE__ */ (0,
|
|
6194
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
6195
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
6127
6196
|
] });
|
|
6128
6197
|
}
|
|
6129
6198
|
|
|
6130
6199
|
// src/components/Link/Link.tsx
|
|
6131
|
-
var
|
|
6200
|
+
var import_react32 = require("react");
|
|
6132
6201
|
var import_radix_ui31 = require("radix-ui");
|
|
6133
6202
|
var import_class_variance_authority44 = require("class-variance-authority");
|
|
6134
|
-
var
|
|
6203
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6135
6204
|
var linkVariants = (0, import_class_variance_authority44.cva)("ddga-link", {
|
|
6136
6205
|
variants: {
|
|
6137
6206
|
variant: {
|
|
@@ -6172,7 +6241,7 @@ function Link({
|
|
|
6172
6241
|
/* @__PURE__ */ new Set([...rel ? rel.split(/\s+/).filter(Boolean) : [], "noopener", "noreferrer"])
|
|
6173
6242
|
).join(" ") : rel;
|
|
6174
6243
|
const showExternalIcon = external && !endIcon;
|
|
6175
|
-
return /* @__PURE__ */ (0,
|
|
6244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6176
6245
|
Comp,
|
|
6177
6246
|
{
|
|
6178
6247
|
"data-slot": "link",
|
|
@@ -6180,7 +6249,7 @@ function Link({
|
|
|
6180
6249
|
rel: relValue,
|
|
6181
6250
|
...props,
|
|
6182
6251
|
children: [
|
|
6183
|
-
startIcon && /* @__PURE__ */ (0,
|
|
6252
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6184
6253
|
"span",
|
|
6185
6254
|
{
|
|
6186
6255
|
className: cn("ddga-link__icon", iconFlip && "ddga-icon-flip"),
|
|
@@ -6189,8 +6258,8 @@ function Link({
|
|
|
6189
6258
|
children: startIcon
|
|
6190
6259
|
}
|
|
6191
6260
|
),
|
|
6192
|
-
asChild ? /* @__PURE__ */ (0,
|
|
6193
|
-
endIcon && /* @__PURE__ */ (0,
|
|
6261
|
+
asChild ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui31.Slot.Slottable, { children }) : children,
|
|
6262
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6194
6263
|
"span",
|
|
6195
6264
|
{
|
|
6196
6265
|
className: cn("ddga-link__icon", iconFlip && "ddga-icon-flip"),
|
|
@@ -6199,13 +6268,13 @@ function Link({
|
|
|
6199
6268
|
children: endIcon
|
|
6200
6269
|
}
|
|
6201
6270
|
),
|
|
6202
|
-
showExternalIcon && /* @__PURE__ */ (0,
|
|
6271
|
+
showExternalIcon && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6203
6272
|
"span",
|
|
6204
6273
|
{
|
|
6205
6274
|
className: "ddga-link__icon ddga-link__icon--external",
|
|
6206
6275
|
"data-slot": "link-external-icon",
|
|
6207
6276
|
"aria-hidden": "true",
|
|
6208
|
-
children: /* @__PURE__ */ (0,
|
|
6277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ExternalLink, {})
|
|
6209
6278
|
}
|
|
6210
6279
|
)
|
|
6211
6280
|
]
|
|
@@ -6214,8 +6283,8 @@ function Link({
|
|
|
6214
6283
|
}
|
|
6215
6284
|
|
|
6216
6285
|
// src/components/SearchBox/SearchBox.tsx
|
|
6217
|
-
var
|
|
6218
|
-
var
|
|
6286
|
+
var import_react33 = require("react");
|
|
6287
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6219
6288
|
function setNativeInputValue(el, value) {
|
|
6220
6289
|
const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
6221
6290
|
setter?.call(el, value);
|
|
@@ -6231,11 +6300,20 @@ function SearchBox({
|
|
|
6231
6300
|
clearable = true,
|
|
6232
6301
|
clearLabel = "Clear search",
|
|
6233
6302
|
className,
|
|
6303
|
+
ref,
|
|
6234
6304
|
...rest
|
|
6235
6305
|
}) {
|
|
6236
|
-
const inputRef = (0,
|
|
6306
|
+
const inputRef = (0, import_react33.useRef)(null);
|
|
6307
|
+
const setRefs = (0, import_react33.useCallback)(
|
|
6308
|
+
(node) => {
|
|
6309
|
+
inputRef.current = node;
|
|
6310
|
+
if (typeof ref === "function") ref(node);
|
|
6311
|
+
else if (ref) ref.current = node;
|
|
6312
|
+
},
|
|
6313
|
+
[ref]
|
|
6314
|
+
);
|
|
6237
6315
|
const isControlled = value !== void 0;
|
|
6238
|
-
const [internal, setInternal] = (0,
|
|
6316
|
+
const [internal, setInternal] = (0, import_react33.useState)(
|
|
6239
6317
|
defaultValue != null ? String(defaultValue) : ""
|
|
6240
6318
|
);
|
|
6241
6319
|
const currentValue = isControlled ? String(value ?? "") : internal;
|
|
@@ -6262,18 +6340,18 @@ function SearchBox({
|
|
|
6262
6340
|
}
|
|
6263
6341
|
};
|
|
6264
6342
|
const showClear = clearable && currentValue.length > 0;
|
|
6265
|
-
return /* @__PURE__ */ (0,
|
|
6343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6266
6344
|
Input,
|
|
6267
6345
|
{
|
|
6268
6346
|
...rest,
|
|
6269
|
-
ref:
|
|
6347
|
+
ref: setRefs,
|
|
6270
6348
|
type: "search",
|
|
6271
6349
|
value: currentValue,
|
|
6272
6350
|
onChange: handleChange,
|
|
6273
6351
|
onKeyDown: handleKeyDown,
|
|
6274
6352
|
className: cn("ddga-search-box", className),
|
|
6275
|
-
startAdornment: /* @__PURE__ */ (0,
|
|
6276
|
-
endAdornment: showClear ? /* @__PURE__ */ (0,
|
|
6353
|
+
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Search, { "data-slot": "search-box-icon", "aria-hidden": "true" }),
|
|
6354
|
+
endAdornment: showClear ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6277
6355
|
Button,
|
|
6278
6356
|
{
|
|
6279
6357
|
type: "button",
|
|
@@ -6282,7 +6360,7 @@ function SearchBox({
|
|
|
6282
6360
|
"aria-label": clearLabel,
|
|
6283
6361
|
"data-slot": "search-box-clear",
|
|
6284
6362
|
onClick: clear,
|
|
6285
|
-
children: /* @__PURE__ */ (0,
|
|
6363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Close, { "aria-hidden": "true" })
|
|
6286
6364
|
}
|
|
6287
6365
|
) : void 0
|
|
6288
6366
|
}
|
|
@@ -6291,7 +6369,7 @@ function SearchBox({
|
|
|
6291
6369
|
|
|
6292
6370
|
// src/components/List/List.tsx
|
|
6293
6371
|
var import_class_variance_authority45 = require("class-variance-authority");
|
|
6294
|
-
var
|
|
6372
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6295
6373
|
var listVariants = (0, import_class_variance_authority45.cva)("ddga-list", {
|
|
6296
6374
|
variants: {
|
|
6297
6375
|
variant: {
|
|
@@ -6312,7 +6390,7 @@ function List({ variant, divided, className, start, reversed, ...props }) {
|
|
|
6312
6390
|
const classes = cn(listVariants({ variant, divided }), className);
|
|
6313
6391
|
const ordered = variant === "numbered" || variant === "lettered";
|
|
6314
6392
|
if (ordered) {
|
|
6315
|
-
return /* @__PURE__ */ (0,
|
|
6393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6316
6394
|
"ol",
|
|
6317
6395
|
{
|
|
6318
6396
|
"data-slot": "list",
|
|
@@ -6324,13 +6402,13 @@ function List({ variant, divided, className, start, reversed, ...props }) {
|
|
|
6324
6402
|
}
|
|
6325
6403
|
);
|
|
6326
6404
|
}
|
|
6327
|
-
return /* @__PURE__ */ (0,
|
|
6405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("ul", { "data-slot": "list", "data-variant": variant ?? "plain", className: classes, ...props });
|
|
6328
6406
|
}
|
|
6329
6407
|
function ListItem({ className, ...props }) {
|
|
6330
|
-
return /* @__PURE__ */ (0,
|
|
6408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { "data-slot": "list-item", className: cn("ddga-list__item", className), ...props });
|
|
6331
6409
|
}
|
|
6332
6410
|
function ListItemIcon({ className, ...props }) {
|
|
6333
|
-
return /* @__PURE__ */ (0,
|
|
6411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "data-slot": "list-item-icon", className: cn("ddga-list__icon", className), ...props });
|
|
6334
6412
|
}
|
|
6335
6413
|
function ListItemContent({
|
|
6336
6414
|
primary,
|
|
@@ -6344,20 +6422,20 @@ function ListItemContent({
|
|
|
6344
6422
|
"[@dev-dga/react] ListItemContent: `children` overrides `primary`/`secondary`. Pass one or the other, not both."
|
|
6345
6423
|
);
|
|
6346
6424
|
}
|
|
6347
|
-
return /* @__PURE__ */ (0,
|
|
6348
|
-
primary != null && primary !== "" && /* @__PURE__ */ (0,
|
|
6349
|
-
secondary != null && secondary !== "" && /* @__PURE__ */ (0,
|
|
6425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { "data-slot": "list-item-content", className: cn("ddga-list__content", className), ...props, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
6426
|
+
primary != null && primary !== "" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "data-slot": "list-item-primary", className: "ddga-list__primary", children: primary }),
|
|
6427
|
+
secondary != null && secondary !== "" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "data-slot": "list-item-secondary", className: "ddga-list__secondary", children: secondary })
|
|
6350
6428
|
] }) });
|
|
6351
6429
|
}
|
|
6352
6430
|
function ListItemAction({ className, ...props }) {
|
|
6353
|
-
return /* @__PURE__ */ (0,
|
|
6431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { "data-slot": "list-item-action", className: cn("ddga-list__action", className), ...props });
|
|
6354
6432
|
}
|
|
6355
6433
|
|
|
6356
6434
|
// src/components/Quote/Quote.tsx
|
|
6357
|
-
var
|
|
6435
|
+
var import_react34 = require("react");
|
|
6358
6436
|
var import_radix_ui32 = require("radix-ui");
|
|
6359
6437
|
var import_class_variance_authority46 = require("class-variance-authority");
|
|
6360
|
-
var
|
|
6438
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6361
6439
|
var quoteVariants = (0, import_class_variance_authority46.cva)("ddga-quote", {
|
|
6362
6440
|
variants: {
|
|
6363
6441
|
variant: {
|
|
@@ -6388,9 +6466,9 @@ function Quote({
|
|
|
6388
6466
|
...props
|
|
6389
6467
|
}) {
|
|
6390
6468
|
const hasAttribution = author != null || byline != null || source != null;
|
|
6391
|
-
const mark = quoteMark ? /* @__PURE__ */ (0,
|
|
6469
|
+
const mark = quoteMark ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(QuoteMark, { "aria-hidden": "true", className: "ddga-quote__mark" }) : null;
|
|
6392
6470
|
if (!hasAttribution) {
|
|
6393
|
-
return /* @__PURE__ */ (0,
|
|
6471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6394
6472
|
"blockquote",
|
|
6395
6473
|
{
|
|
6396
6474
|
"data-slot": "quote",
|
|
@@ -6400,12 +6478,12 @@ function Quote({
|
|
|
6400
6478
|
...props,
|
|
6401
6479
|
children: [
|
|
6402
6480
|
mark,
|
|
6403
|
-
/* @__PURE__ */ (0,
|
|
6481
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(QuoteContent, { children })
|
|
6404
6482
|
]
|
|
6405
6483
|
}
|
|
6406
6484
|
);
|
|
6407
6485
|
}
|
|
6408
|
-
return /* @__PURE__ */ (0,
|
|
6486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6409
6487
|
"figure",
|
|
6410
6488
|
{
|
|
6411
6489
|
"data-slot": "quote",
|
|
@@ -6413,16 +6491,16 @@ function Quote({
|
|
|
6413
6491
|
className: cn(quoteVariants({ variant }), className),
|
|
6414
6492
|
...props,
|
|
6415
6493
|
children: [
|
|
6416
|
-
/* @__PURE__ */ (0,
|
|
6494
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("blockquote", { "data-slot": "quote-blockquote", className: "ddga-quote__blockquote", cite, children: [
|
|
6417
6495
|
mark,
|
|
6418
|
-
/* @__PURE__ */ (0,
|
|
6496
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(QuoteContent, { children })
|
|
6419
6497
|
] }),
|
|
6420
|
-
/* @__PURE__ */ (0,
|
|
6421
|
-
avatar != null ? /* @__PURE__ */ (0,
|
|
6422
|
-
/* @__PURE__ */ (0,
|
|
6423
|
-
author != null ? /* @__PURE__ */ (0,
|
|
6424
|
-
byline != null ? /* @__PURE__ */ (0,
|
|
6425
|
-
source != null ? /* @__PURE__ */ (0,
|
|
6498
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(QuoteCaption, { children: [
|
|
6499
|
+
avatar != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "data-slot": "quote-avatar", "aria-hidden": "true", className: "ddga-quote__avatar", children: avatar }) : null,
|
|
6500
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "ddga-quote__attribution", children: [
|
|
6501
|
+
author != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(QuoteAuthor, { children: author }) : null,
|
|
6502
|
+
byline != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "ddga-quote__byline", children: byline }) : null,
|
|
6503
|
+
source != null ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(QuoteSource, { children: source }) : null
|
|
6426
6504
|
] })
|
|
6427
6505
|
] })
|
|
6428
6506
|
]
|
|
@@ -6431,26 +6509,26 @@ function Quote({
|
|
|
6431
6509
|
}
|
|
6432
6510
|
function QuoteContent({ asChild, className, ...props }) {
|
|
6433
6511
|
const Comp = asChild ? import_radix_ui32.Slot.Slot : "div";
|
|
6434
|
-
return /* @__PURE__ */ (0,
|
|
6512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Comp, { "data-slot": "quote-content", className: cn("ddga-quote__content", className), ...props });
|
|
6435
6513
|
}
|
|
6436
6514
|
function QuoteCaption({ asChild, className, ...props }) {
|
|
6437
6515
|
const Comp = asChild ? import_radix_ui32.Slot.Slot : "figcaption";
|
|
6438
|
-
return /* @__PURE__ */ (0,
|
|
6516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Comp, { "data-slot": "quote-caption", className: cn("ddga-quote__caption", className), ...props });
|
|
6439
6517
|
}
|
|
6440
6518
|
function QuoteAuthor({ asChild, className, ...props }) {
|
|
6441
6519
|
const Comp = asChild ? import_radix_ui32.Slot.Slot : "span";
|
|
6442
|
-
return /* @__PURE__ */ (0,
|
|
6520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Comp, { "data-slot": "quote-author", className: cn("ddga-quote__author", className), ...props });
|
|
6443
6521
|
}
|
|
6444
6522
|
function QuoteSource({ asChild, className, ...props }) {
|
|
6445
6523
|
const Comp = asChild ? import_radix_ui32.Slot.Slot : "cite";
|
|
6446
|
-
return /* @__PURE__ */ (0,
|
|
6524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Comp, { "data-slot": "quote-source", className: cn("ddga-quote__source", className), ...props });
|
|
6447
6525
|
}
|
|
6448
6526
|
|
|
6449
6527
|
// src/components/Collapsible/Collapsible.tsx
|
|
6450
6528
|
var import_radix_ui33 = require("radix-ui");
|
|
6451
|
-
var
|
|
6529
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6452
6530
|
function Collapsible({ className, ...props }) {
|
|
6453
|
-
return /* @__PURE__ */ (0,
|
|
6531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6454
6532
|
import_radix_ui33.Collapsible.Root,
|
|
6455
6533
|
{
|
|
6456
6534
|
"data-slot": "collapsible",
|
|
@@ -6460,7 +6538,7 @@ function Collapsible({ className, ...props }) {
|
|
|
6460
6538
|
);
|
|
6461
6539
|
}
|
|
6462
6540
|
function CollapsibleTrigger({ className, ...props }) {
|
|
6463
|
-
return /* @__PURE__ */ (0,
|
|
6541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6464
6542
|
import_radix_ui33.Collapsible.Trigger,
|
|
6465
6543
|
{
|
|
6466
6544
|
"data-slot": "collapsible-trigger",
|
|
@@ -6470,21 +6548,21 @@ function CollapsibleTrigger({ className, ...props }) {
|
|
|
6470
6548
|
);
|
|
6471
6549
|
}
|
|
6472
6550
|
function CollapsibleContent({ className, children, ...props }) {
|
|
6473
|
-
return /* @__PURE__ */ (0,
|
|
6551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6474
6552
|
import_radix_ui33.Collapsible.Content,
|
|
6475
6553
|
{
|
|
6476
6554
|
"data-slot": "collapsible-content",
|
|
6477
6555
|
className: cn("ddga-collapsible__content", className),
|
|
6478
6556
|
...props,
|
|
6479
|
-
children: /* @__PURE__ */ (0,
|
|
6557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "ddga-collapsible__content-inner", children })
|
|
6480
6558
|
}
|
|
6481
6559
|
);
|
|
6482
6560
|
}
|
|
6483
6561
|
|
|
6484
6562
|
// src/components/TagInput/TagInput.tsx
|
|
6485
|
-
var
|
|
6563
|
+
var import_react35 = require("react");
|
|
6486
6564
|
var import_class_variance_authority47 = require("class-variance-authority");
|
|
6487
|
-
var
|
|
6565
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6488
6566
|
var tagInputVariants = (0, import_class_variance_authority47.cva)("ddga-tag-input", {
|
|
6489
6567
|
variants: {
|
|
6490
6568
|
size: {
|
|
@@ -6524,11 +6602,11 @@ function TagInput({
|
|
|
6524
6602
|
...props
|
|
6525
6603
|
}) {
|
|
6526
6604
|
const isControlled = value !== void 0;
|
|
6527
|
-
const [uncontrolledTags, setUncontrolledTags] = (0,
|
|
6605
|
+
const [uncontrolledTags, setUncontrolledTags] = (0, import_react35.useState)(defaultValue ?? []);
|
|
6528
6606
|
const tags = isControlled ? value : uncontrolledTags;
|
|
6529
|
-
const [draft, setDraft] = (0,
|
|
6530
|
-
const [announcement, setAnnouncement] = (0,
|
|
6531
|
-
const inputRef = (0,
|
|
6607
|
+
const [draft, setDraft] = (0, import_react35.useState)("");
|
|
6608
|
+
const [announcement, setAnnouncement] = (0, import_react35.useState)("");
|
|
6609
|
+
const inputRef = (0, import_react35.useRef)(null);
|
|
6532
6610
|
const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
|
|
6533
6611
|
name: "TagInput",
|
|
6534
6612
|
id: externalId,
|
|
@@ -6613,9 +6691,9 @@ function TagInput({
|
|
|
6613
6691
|
inputRef.current?.focus();
|
|
6614
6692
|
};
|
|
6615
6693
|
const chipSize = size === "lg" ? "md" : "sm";
|
|
6616
|
-
return /* @__PURE__ */ (0,
|
|
6617
|
-
label && /* @__PURE__ */ (0,
|
|
6618
|
-
/* @__PURE__ */ (0,
|
|
6694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { "data-slot": "tag-input-field", className: "ddga-field", children: [
|
|
6695
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("label", { htmlFor: fieldId, className: "ddga-tag-input__label", children: label }),
|
|
6696
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
6619
6697
|
"div",
|
|
6620
6698
|
{
|
|
6621
6699
|
"data-slot": "tag-input-control",
|
|
@@ -6623,13 +6701,13 @@ function TagInput({
|
|
|
6623
6701
|
"data-disabled": disabled || void 0,
|
|
6624
6702
|
onMouseDown: disabled ? void 0 : handleBoxMouseDown,
|
|
6625
6703
|
children: [
|
|
6626
|
-
tags.length > 0 && /* @__PURE__ */ (0,
|
|
6704
|
+
tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("ul", { "data-slot": "tag-input-list", className: "ddga-tag-input__list", role: "list", children: tags.map((tag, index) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6627
6705
|
"li",
|
|
6628
6706
|
{
|
|
6629
6707
|
"data-slot": "tag-input-item",
|
|
6630
6708
|
className: "ddga-tag-input__item",
|
|
6631
6709
|
role: "listitem",
|
|
6632
|
-
children: /* @__PURE__ */ (0,
|
|
6710
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6633
6711
|
Badge,
|
|
6634
6712
|
{
|
|
6635
6713
|
variant: chipVariant,
|
|
@@ -6644,7 +6722,7 @@ function TagInput({
|
|
|
6644
6722
|
},
|
|
6645
6723
|
`${tag}-${index}`
|
|
6646
6724
|
)) }),
|
|
6647
|
-
/* @__PURE__ */ (0,
|
|
6725
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6648
6726
|
"input",
|
|
6649
6727
|
{
|
|
6650
6728
|
...props,
|
|
@@ -6664,17 +6742,304 @@ function TagInput({
|
|
|
6664
6742
|
]
|
|
6665
6743
|
}
|
|
6666
6744
|
),
|
|
6667
|
-
/* @__PURE__ */ (0,
|
|
6668
|
-
hasErrorMessage && /* @__PURE__ */ (0,
|
|
6669
|
-
hasHelper && /* @__PURE__ */ (0,
|
|
6745
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { "data-slot": "tag-input-live", className: "ddga-sr-only", role: "status", "aria-live": "polite", children: announcement }),
|
|
6746
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
6747
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
6670
6748
|
] });
|
|
6671
6749
|
}
|
|
6672
6750
|
|
|
6673
|
-
// src/
|
|
6674
|
-
var
|
|
6751
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
6752
|
+
var import_react36 = require("react");
|
|
6753
|
+
var import_react_aria_components3 = require("react-aria-components");
|
|
6754
|
+
var import_date3 = require("@internationalized/date");
|
|
6755
|
+
var import_class_variance_authority48 = require("class-variance-authority");
|
|
6756
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6757
|
+
var dateRangePickerTriggerVariants = (0, import_class_variance_authority48.cva)("ddga-date-range-picker-trigger", {
|
|
6758
|
+
variants: {
|
|
6759
|
+
size: {
|
|
6760
|
+
sm: "ddga-date-range-picker-trigger--sm",
|
|
6761
|
+
md: "ddga-date-range-picker-trigger--md"
|
|
6762
|
+
},
|
|
6763
|
+
error: {
|
|
6764
|
+
true: "ddga-date-range-picker-trigger--error"
|
|
6765
|
+
}
|
|
6766
|
+
},
|
|
6767
|
+
defaultVariants: {
|
|
6768
|
+
size: "md"
|
|
6769
|
+
}
|
|
6770
|
+
});
|
|
6771
|
+
var dateRangePickerVariants = dateRangePickerTriggerVariants;
|
|
6772
|
+
function toAriaRange(range) {
|
|
6773
|
+
if (!range) return null;
|
|
6774
|
+
const start = dateToCalendarDate(range.start);
|
|
6775
|
+
const end = dateToCalendarDate(range.end);
|
|
6776
|
+
if (!start || !end) return null;
|
|
6777
|
+
return { start, end };
|
|
6778
|
+
}
|
|
6779
|
+
function fromAriaRange(value) {
|
|
6780
|
+
if (!value) return null;
|
|
6781
|
+
const start = calendarDateToDate(value.start);
|
|
6782
|
+
const end = calendarDateToDate(value.end);
|
|
6783
|
+
if (!start || !end) return null;
|
|
6784
|
+
return { start, end };
|
|
6785
|
+
}
|
|
6786
|
+
function DateRangePicker({
|
|
6787
|
+
value: controlledValue,
|
|
6788
|
+
defaultValue,
|
|
6789
|
+
onChange,
|
|
6790
|
+
minValue,
|
|
6791
|
+
maxValue,
|
|
6792
|
+
label,
|
|
6793
|
+
helperText,
|
|
6794
|
+
errorMessage,
|
|
6795
|
+
error,
|
|
6796
|
+
required,
|
|
6797
|
+
disabled,
|
|
6798
|
+
size,
|
|
6799
|
+
id,
|
|
6800
|
+
className,
|
|
6801
|
+
"aria-label": ariaLabel,
|
|
6802
|
+
"aria-labelledby": ariaLabelledBy,
|
|
6803
|
+
calendar: controlledCalendar,
|
|
6804
|
+
defaultCalendar = "gregorian",
|
|
6805
|
+
onCalendarChange,
|
|
6806
|
+
showCalendarToggle = true,
|
|
6807
|
+
calendarLabels,
|
|
6808
|
+
showSecondaryCalendar = false
|
|
6809
|
+
}) {
|
|
6810
|
+
const isValueControlled = controlledValue !== void 0;
|
|
6811
|
+
const [internalValue, setInternalValue] = (0, import_react36.useState)(
|
|
6812
|
+
() => toAriaRange(defaultValue)
|
|
6813
|
+
);
|
|
6814
|
+
const value = isValueControlled ? toAriaRange(controlledValue) : internalValue;
|
|
6815
|
+
const handleAriaChange = (0, import_react36.useCallback)(
|
|
6816
|
+
(next) => {
|
|
6817
|
+
const nextRange = next ? {
|
|
6818
|
+
start: new import_date3.CalendarDate(next.start.year, next.start.month, next.start.day),
|
|
6819
|
+
end: new import_date3.CalendarDate(next.end.year, next.end.month, next.end.day)
|
|
6820
|
+
} : null;
|
|
6821
|
+
if (!isValueControlled) setInternalValue(nextRange);
|
|
6822
|
+
onChange?.(fromAriaRange(nextRange));
|
|
6823
|
+
},
|
|
6824
|
+
[isValueControlled, onChange]
|
|
6825
|
+
);
|
|
6826
|
+
const isCalendarControlled = controlledCalendar !== void 0;
|
|
6827
|
+
const [internalCalendar, setInternalCalendar] = (0, import_react36.useState)(defaultCalendar);
|
|
6828
|
+
const calendarSystem = isCalendarControlled ? controlledCalendar : internalCalendar;
|
|
6829
|
+
const setCalendar = (0, import_react36.useCallback)(
|
|
6830
|
+
(next) => {
|
|
6831
|
+
if (!isCalendarControlled) setInternalCalendar(next);
|
|
6832
|
+
onCalendarChange?.(next);
|
|
6833
|
+
},
|
|
6834
|
+
[isCalendarControlled, onCalendarChange]
|
|
6835
|
+
);
|
|
6836
|
+
const {
|
|
6837
|
+
dgaLocale,
|
|
6838
|
+
locale: ariaLocale,
|
|
6839
|
+
portalContainer,
|
|
6840
|
+
PrevChevron,
|
|
6841
|
+
NextChevron,
|
|
6842
|
+
resolvedLabels,
|
|
6843
|
+
navLabels,
|
|
6844
|
+
a11yLabels
|
|
6845
|
+
} = useCalendarChrome(calendarSystem, calendarLabels);
|
|
6846
|
+
const ariaMinValue = (0, import_react36.useMemo)(() => dateToCalendarDate(minValue) ?? void 0, [minValue]);
|
|
6847
|
+
const ariaMaxValue = (0, import_react36.useMemo)(() => dateToCalendarDate(maxValue) ?? void 0, [maxValue]);
|
|
6848
|
+
const dialogAriaLabel = ariaLabel ?? (typeof label === "string" ? label : ariaLabelledBy ? void 0 : dgaLocale.startsWith("ar") ? "\u0646\u0637\u0627\u0642 \u0627\u0644\u062A\u0627\u0631\u064A\u062E" : "Date range");
|
|
6849
|
+
const showToggle = showCalendarToggle && !isCalendarControlled;
|
|
6850
|
+
const hasError = !!error;
|
|
6851
|
+
const hasErrorMessage = hasError && errorMessage != null && errorMessage !== "";
|
|
6852
|
+
const hasHelper = !hasErrorMessage && helperText != null && helperText !== "";
|
|
6853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_aria_components3.I18nProvider, { locale: ariaLocale, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
6854
|
+
import_react_aria_components3.DateRangePicker,
|
|
6855
|
+
{
|
|
6856
|
+
value,
|
|
6857
|
+
onChange: handleAriaChange,
|
|
6858
|
+
minValue: ariaMinValue,
|
|
6859
|
+
maxValue: ariaMaxValue,
|
|
6860
|
+
isRequired: required,
|
|
6861
|
+
isDisabled: disabled,
|
|
6862
|
+
isInvalid: hasError,
|
|
6863
|
+
shouldCloseOnSelect: true,
|
|
6864
|
+
id,
|
|
6865
|
+
"aria-label": ariaLabel,
|
|
6866
|
+
"aria-labelledby": ariaLabelledBy,
|
|
6867
|
+
className: "ddga-field",
|
|
6868
|
+
"data-slot": "date-range-picker-field",
|
|
6869
|
+
children: [
|
|
6870
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_react_aria_components3.Label, { className: "ddga-date-range-picker__label", children: [
|
|
6871
|
+
label,
|
|
6872
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { "aria-hidden": "true", className: "ddga-date-range-picker__required", children: "*" })
|
|
6873
|
+
] }),
|
|
6874
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
6875
|
+
import_react_aria_components3.Group,
|
|
6876
|
+
{
|
|
6877
|
+
"data-slot": "date-range-picker-trigger",
|
|
6878
|
+
className: cn(dateRangePickerTriggerVariants({ size, error: hasError }), className),
|
|
6879
|
+
children: [
|
|
6880
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6881
|
+
import_react_aria_components3.DateInput,
|
|
6882
|
+
{
|
|
6883
|
+
slot: "start",
|
|
6884
|
+
className: "ddga-date-range-picker__input",
|
|
6885
|
+
"data-slot": "date-range-picker-input-start",
|
|
6886
|
+
children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6887
|
+
import_react_aria_components3.DateSegment,
|
|
6888
|
+
{
|
|
6889
|
+
segment,
|
|
6890
|
+
className: "ddga-date-range-picker__segment",
|
|
6891
|
+
"data-slot": "date-range-picker-segment"
|
|
6892
|
+
}
|
|
6893
|
+
)
|
|
6894
|
+
}
|
|
6895
|
+
),
|
|
6896
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { "aria-hidden": "true", className: "ddga-date-range-picker__separator", children: "\u2013" }),
|
|
6897
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6898
|
+
import_react_aria_components3.DateInput,
|
|
6899
|
+
{
|
|
6900
|
+
slot: "end",
|
|
6901
|
+
className: "ddga-date-range-picker__input",
|
|
6902
|
+
"data-slot": "date-range-picker-input-end",
|
|
6903
|
+
children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6904
|
+
import_react_aria_components3.DateSegment,
|
|
6905
|
+
{
|
|
6906
|
+
segment,
|
|
6907
|
+
className: "ddga-date-range-picker__segment",
|
|
6908
|
+
"data-slot": "date-range-picker-segment"
|
|
6909
|
+
}
|
|
6910
|
+
)
|
|
6911
|
+
}
|
|
6912
|
+
),
|
|
6913
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6914
|
+
import_react_aria_components3.Button,
|
|
6915
|
+
{
|
|
6916
|
+
className: "ddga-date-range-picker__icon-button",
|
|
6917
|
+
"aria-label": a11yLabels.openCalendar,
|
|
6918
|
+
"data-slot": "date-range-picker-trigger-button",
|
|
6919
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CalendarIcon, { "aria-hidden": "true", className: "ddga-date-range-picker__icon" })
|
|
6920
|
+
}
|
|
6921
|
+
)
|
|
6922
|
+
]
|
|
6923
|
+
}
|
|
6924
|
+
),
|
|
6925
|
+
hasHelper && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6926
|
+
import_react_aria_components3.Text,
|
|
6927
|
+
{
|
|
6928
|
+
slot: "description",
|
|
6929
|
+
className: "ddga-field__message ddga-field__message--helper",
|
|
6930
|
+
"data-slot": "field-helper",
|
|
6931
|
+
children: helperText
|
|
6932
|
+
}
|
|
6933
|
+
),
|
|
6934
|
+
hasErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6935
|
+
import_react_aria_components3.FieldError,
|
|
6936
|
+
{
|
|
6937
|
+
className: "ddga-field__message ddga-field__message--error",
|
|
6938
|
+
"data-slot": "field-error",
|
|
6939
|
+
children: errorMessage
|
|
6940
|
+
}
|
|
6941
|
+
),
|
|
6942
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6943
|
+
import_react_aria_components3.Popover,
|
|
6944
|
+
{
|
|
6945
|
+
UNSTABLE_portalContainer: portalContainer,
|
|
6946
|
+
className: "ddga-calendar-popover",
|
|
6947
|
+
"data-slot": "date-range-picker-popover",
|
|
6948
|
+
offset: 6,
|
|
6949
|
+
containerPadding: 12,
|
|
6950
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
6951
|
+
import_react_aria_components3.Dialog,
|
|
6952
|
+
{
|
|
6953
|
+
className: "ddga-calendar-dialog",
|
|
6954
|
+
"data-slot": "date-range-picker-dialog",
|
|
6955
|
+
"aria-label": dialogAriaLabel,
|
|
6956
|
+
"aria-labelledby": ariaLabelledBy,
|
|
6957
|
+
children: [
|
|
6958
|
+
showToggle && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6959
|
+
CalendarSystemToggle,
|
|
6960
|
+
{
|
|
6961
|
+
value: calendarSystem,
|
|
6962
|
+
onChange: setCalendar,
|
|
6963
|
+
labels: resolvedLabels,
|
|
6964
|
+
groupLabel: a11yLabels.calendarSystem
|
|
6965
|
+
}
|
|
6966
|
+
),
|
|
6967
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
6968
|
+
import_react_aria_components3.RangeCalendar,
|
|
6969
|
+
{
|
|
6970
|
+
className: "ddga-calendar ddga-calendar--range",
|
|
6971
|
+
"data-slot": "date-range-picker-calendar",
|
|
6972
|
+
children: [
|
|
6973
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("header", { className: "ddga-calendar__header", children: [
|
|
6974
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6975
|
+
import_react_aria_components3.Button,
|
|
6976
|
+
{
|
|
6977
|
+
slot: "previous",
|
|
6978
|
+
className: "ddga-calendar__nav",
|
|
6979
|
+
"data-slot": "date-range-picker-calendar-prev",
|
|
6980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PrevChevron, { "aria-hidden": "true" })
|
|
6981
|
+
}
|
|
6982
|
+
),
|
|
6983
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6984
|
+
CalendarNavHeader,
|
|
6985
|
+
{
|
|
6986
|
+
locale: ariaLocale,
|
|
6987
|
+
monthLabel: navLabels.month,
|
|
6988
|
+
yearLabel: navLabels.year
|
|
6989
|
+
}
|
|
6990
|
+
),
|
|
6991
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6992
|
+
import_react_aria_components3.Button,
|
|
6993
|
+
{
|
|
6994
|
+
slot: "next",
|
|
6995
|
+
className: "ddga-calendar__nav",
|
|
6996
|
+
"data-slot": "date-range-picker-calendar-next",
|
|
6997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(NextChevron, { "aria-hidden": "true" })
|
|
6998
|
+
}
|
|
6999
|
+
)
|
|
7000
|
+
] }),
|
|
7001
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_react_aria_components3.CalendarGrid, { className: "ddga-calendar__grid", children: [
|
|
7002
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_aria_components3.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_aria_components3.CalendarHeaderCell, { className: "ddga-calendar__weekday", children: day }) }),
|
|
7003
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_aria_components3.CalendarGridBody, { children: (date) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react_aria_components3.CalendarCell, { date, className: "ddga-calendar__cell", children: ({ formattedDate }) => renderDayContent(formattedDate, {
|
|
7004
|
+
showSecondary: showSecondaryCalendar,
|
|
7005
|
+
date,
|
|
7006
|
+
calendarSystem
|
|
7007
|
+
}) }) })
|
|
7008
|
+
] })
|
|
7009
|
+
]
|
|
7010
|
+
}
|
|
7011
|
+
)
|
|
7012
|
+
]
|
|
7013
|
+
}
|
|
7014
|
+
)
|
|
7015
|
+
}
|
|
7016
|
+
)
|
|
7017
|
+
]
|
|
7018
|
+
}
|
|
7019
|
+
) });
|
|
7020
|
+
}
|
|
7021
|
+
|
|
7022
|
+
// src/components/AspectRatio/AspectRatio.tsx
|
|
6675
7023
|
var import_radix_ui34 = require("radix-ui");
|
|
7024
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7025
|
+
function AspectRatio({ ratio = 1, asChild, className, style, ...props }) {
|
|
7026
|
+
const Comp = asChild ? import_radix_ui34.Slot.Slot : "div";
|
|
7027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7028
|
+
Comp,
|
|
7029
|
+
{
|
|
7030
|
+
"data-slot": "aspect-ratio",
|
|
7031
|
+
className: cn("ddga-aspect-ratio", className),
|
|
7032
|
+
style: { "--ddga-aspect-ratio": ratio, ...style },
|
|
7033
|
+
...props
|
|
7034
|
+
}
|
|
7035
|
+
);
|
|
7036
|
+
}
|
|
7037
|
+
|
|
7038
|
+
// src/providers/DgaProvider.tsx
|
|
7039
|
+
var import_react37 = require("react");
|
|
7040
|
+
var import_radix_ui35 = require("radix-ui");
|
|
6676
7041
|
var import_tokens = require("@dev-dga/tokens");
|
|
6677
|
-
var
|
|
7042
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6678
7043
|
function DgaProvider({
|
|
6679
7044
|
dir = "ltr",
|
|
6680
7045
|
locale,
|
|
@@ -6685,14 +7050,14 @@ function DgaProvider({
|
|
|
6685
7050
|
style: consumerStyle,
|
|
6686
7051
|
children
|
|
6687
7052
|
}) {
|
|
6688
|
-
const parentCtx = (0,
|
|
7053
|
+
const parentCtx = (0, import_react37.useContext)(DgaContext);
|
|
6689
7054
|
const isNested = parentCtx !== null;
|
|
6690
|
-
const [rootEl, setRootEl] = (0,
|
|
6691
|
-
const portalRef = (0,
|
|
6692
|
-
const [portalEl, setPortalEl] = (0,
|
|
7055
|
+
const [rootEl, setRootEl] = (0, import_react37.useState)(null);
|
|
7056
|
+
const portalRef = (0, import_react37.useRef)(null);
|
|
7057
|
+
const [portalEl, setPortalEl] = (0, import_react37.useState)(null);
|
|
6693
7058
|
const resolvedLocale = locale ?? (dir === "rtl" ? "ar" : "en");
|
|
6694
|
-
const themeVars = (0,
|
|
6695
|
-
(0,
|
|
7059
|
+
const themeVars = (0, import_react37.useMemo)(() => theme ? (0, import_tokens.buildTheme)(theme) : null, [theme]);
|
|
7060
|
+
(0, import_react37.useEffect)(() => {
|
|
6696
7061
|
if (typeof document === "undefined") return;
|
|
6697
7062
|
const el = document.createElement("div");
|
|
6698
7063
|
el.setAttribute("data-slot", "dga-portal");
|
|
@@ -6707,7 +7072,7 @@ function DgaProvider({
|
|
|
6707
7072
|
setPortalEl(null);
|
|
6708
7073
|
};
|
|
6709
7074
|
}, []);
|
|
6710
|
-
(0,
|
|
7075
|
+
(0, import_react37.useEffect)(() => {
|
|
6711
7076
|
const el = portalRef.current;
|
|
6712
7077
|
if (!el) return;
|
|
6713
7078
|
el.setAttribute("data-theme", mode);
|
|
@@ -6719,12 +7084,12 @@ function DgaProvider({
|
|
|
6719
7084
|
}
|
|
6720
7085
|
}
|
|
6721
7086
|
}, [mode, dir, themeVars, portalEl]);
|
|
6722
|
-
const ctxValue = (0,
|
|
7087
|
+
const ctxValue = (0, import_react37.useMemo)(
|
|
6723
7088
|
() => ({ dir, locale: resolvedLocale, mode, rootEl, portalEl }),
|
|
6724
7089
|
[dir, resolvedLocale, mode, rootEl, portalEl]
|
|
6725
7090
|
);
|
|
6726
|
-
const inner = /* @__PURE__ */ (0,
|
|
6727
|
-
return /* @__PURE__ */ (0,
|
|
7091
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_radix_ui35.Direction.Provider, { dir, children });
|
|
7092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(DgaContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6728
7093
|
Component,
|
|
6729
7094
|
{
|
|
6730
7095
|
ref: setRootEl,
|
|
@@ -6734,7 +7099,7 @@ function DgaProvider({
|
|
|
6734
7099
|
"data-theme": mode,
|
|
6735
7100
|
className,
|
|
6736
7101
|
style: { colorScheme: mode, ...themeVars ?? {}, ...consumerStyle },
|
|
6737
|
-
children: isNested ? inner : /* @__PURE__ */ (0,
|
|
7102
|
+
children: isNested ? inner : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_radix_ui35.Tooltip.Provider, { delayDuration: 300, skipDelayDuration: 100, children: inner })
|
|
6738
7103
|
}
|
|
6739
7104
|
) });
|
|
6740
7105
|
}
|
|
@@ -6747,6 +7112,7 @@ function DgaProvider({
|
|
|
6747
7112
|
Alert,
|
|
6748
7113
|
AlertDescription,
|
|
6749
7114
|
AlertTitle,
|
|
7115
|
+
AspectRatio,
|
|
6750
7116
|
Avatar,
|
|
6751
7117
|
AvatarFallback,
|
|
6752
7118
|
AvatarGroup,
|
|
@@ -6785,6 +7151,7 @@ function DgaProvider({
|
|
|
6785
7151
|
CommandList,
|
|
6786
7152
|
CommandSeparator,
|
|
6787
7153
|
DatePicker,
|
|
7154
|
+
DateRangePicker,
|
|
6788
7155
|
DescriptionDetails,
|
|
6789
7156
|
DescriptionItem,
|
|
6790
7157
|
DescriptionList,
|
|
@@ -6957,6 +7324,8 @@ function DgaProvider({
|
|
|
6957
7324
|
createToast,
|
|
6958
7325
|
createToastStore,
|
|
6959
7326
|
datePickerVariants,
|
|
7327
|
+
dateRangePickerTriggerVariants,
|
|
7328
|
+
dateRangePickerVariants,
|
|
6960
7329
|
descriptionListVariants,
|
|
6961
7330
|
dividerVariants,
|
|
6962
7331
|
drawerVariants,
|