@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.js
CHANGED
|
@@ -1046,6 +1046,8 @@ function Select({
|
|
|
1046
1046
|
placeholder,
|
|
1047
1047
|
className,
|
|
1048
1048
|
children,
|
|
1049
|
+
"aria-label": ariaLabel,
|
|
1050
|
+
"aria-labelledby": ariaLabelledby,
|
|
1049
1051
|
...rootProps
|
|
1050
1052
|
}) {
|
|
1051
1053
|
const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } = useFieldA11y({
|
|
@@ -1055,8 +1057,8 @@ function Select({
|
|
|
1055
1057
|
error,
|
|
1056
1058
|
errorMessage,
|
|
1057
1059
|
helperText,
|
|
1058
|
-
"aria-label":
|
|
1059
|
-
"aria-labelledby":
|
|
1060
|
+
"aria-label": ariaLabel,
|
|
1061
|
+
"aria-labelledby": ariaLabelledby
|
|
1060
1062
|
});
|
|
1061
1063
|
const ctx = useContext2(DgaContext);
|
|
1062
1064
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
@@ -1070,6 +1072,8 @@ function Select({
|
|
|
1070
1072
|
SelectPrimitive.Trigger,
|
|
1071
1073
|
{
|
|
1072
1074
|
...controlProps,
|
|
1075
|
+
"aria-label": ariaLabel,
|
|
1076
|
+
"aria-labelledby": ariaLabelledby,
|
|
1073
1077
|
"data-slot": "select-trigger",
|
|
1074
1078
|
className: cn(selectTriggerVariants({ size, error: hasError }), className),
|
|
1075
1079
|
children: [
|
|
@@ -1398,7 +1402,7 @@ function Avatar({ size, shape, status, statusLabel, className, children, ...prop
|
|
|
1398
1402
|
"span",
|
|
1399
1403
|
{
|
|
1400
1404
|
className: cn("ddga-avatar__status", `ddga-avatar__status--${status}`),
|
|
1401
|
-
role: "
|
|
1405
|
+
role: "img",
|
|
1402
1406
|
"aria-label": statusLabel ?? status
|
|
1403
1407
|
}
|
|
1404
1408
|
) : null
|
|
@@ -2459,6 +2463,11 @@ function CircularProgress({
|
|
|
2459
2463
|
className,
|
|
2460
2464
|
...props
|
|
2461
2465
|
}) {
|
|
2466
|
+
if (process.env.NODE_ENV === "development" && !props["aria-label"] && !props["aria-labelledby"]) {
|
|
2467
|
+
console.warn(
|
|
2468
|
+
"[dga/Progress] <CircularProgress> has no accessible name. Pass `aria-label` or `aria-labelledby` so screen-reader users know what the progress represents."
|
|
2469
|
+
);
|
|
2470
|
+
}
|
|
2462
2471
|
const isIndeterminate = value === null;
|
|
2463
2472
|
const isSegmented = typeof segments === "number" && segments >= 2;
|
|
2464
2473
|
const sizeKey = size ?? "md";
|
|
@@ -3066,7 +3075,7 @@ function ComboboxSeparator({ className, ...props }) {
|
|
|
3066
3075
|
}
|
|
3067
3076
|
|
|
3068
3077
|
// src/components/DatePicker/DatePicker.tsx
|
|
3069
|
-
import { useCallback as useCallback2, useContext as
|
|
3078
|
+
import { useCallback as useCallback2, useContext as useContext9, useMemo as useMemo3, useState as useState4 } from "react";
|
|
3070
3079
|
import {
|
|
3071
3080
|
Button as AriaButton,
|
|
3072
3081
|
Calendar as AriaCalendar,
|
|
@@ -3075,7 +3084,7 @@ import {
|
|
|
3075
3084
|
CalendarGridBody as AriaCalendarGridBody,
|
|
3076
3085
|
CalendarGridHeader as AriaCalendarGridHeader,
|
|
3077
3086
|
CalendarHeaderCell as AriaCalendarHeaderCell,
|
|
3078
|
-
CalendarStateContext as
|
|
3087
|
+
CalendarStateContext as AriaCalendarStateContext2,
|
|
3079
3088
|
DateInput as AriaDateInput,
|
|
3080
3089
|
DatePicker as AriaDatePicker,
|
|
3081
3090
|
DateSegment as AriaDateSegment,
|
|
@@ -3087,29 +3096,24 @@ import {
|
|
|
3087
3096
|
Popover as AriaPopover,
|
|
3088
3097
|
Text as AriaText
|
|
3089
3098
|
} from "react-aria-components";
|
|
3099
|
+
import { CalendarDate as CalendarDate2 } from "@internationalized/date";
|
|
3100
|
+
import { cva as cva27 } from "class-variance-authority";
|
|
3101
|
+
|
|
3102
|
+
// src/internal/calendar/calendar-core.tsx
|
|
3103
|
+
import { useContext as useContext8, useMemo as useMemo2 } from "react";
|
|
3104
|
+
import {
|
|
3105
|
+
CalendarStateContext as AriaCalendarStateContext,
|
|
3106
|
+
RangeCalendarStateContext as AriaRangeCalendarStateContext
|
|
3107
|
+
} from "react-aria-components";
|
|
3090
3108
|
import {
|
|
3091
3109
|
CalendarDate,
|
|
3092
3110
|
GregorianCalendar,
|
|
3093
3111
|
IslamicUmalquraCalendar,
|
|
3094
3112
|
toCalendar
|
|
3095
3113
|
} from "@internationalized/date";
|
|
3096
|
-
import { cva as cva27 } from "class-variance-authority";
|
|
3097
3114
|
import { Fragment as Fragment4, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3098
|
-
var
|
|
3099
|
-
|
|
3100
|
-
size: {
|
|
3101
|
-
sm: "ddga-date-picker-trigger--sm",
|
|
3102
|
-
md: "ddga-date-picker-trigger--md"
|
|
3103
|
-
},
|
|
3104
|
-
error: {
|
|
3105
|
-
true: "ddga-date-picker-trigger--error"
|
|
3106
|
-
}
|
|
3107
|
-
},
|
|
3108
|
-
defaultVariants: {
|
|
3109
|
-
size: "md"
|
|
3110
|
-
}
|
|
3111
|
-
});
|
|
3112
|
-
var datePickerVariants = datePickerTriggerVariants;
|
|
3115
|
+
var GREGORIAN = new GregorianCalendar();
|
|
3116
|
+
var ISLAMIC_UMALQURA = new IslamicUmalquraCalendar();
|
|
3113
3117
|
function dateToCalendarDate(date) {
|
|
3114
3118
|
if (!date) return null;
|
|
3115
3119
|
return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
@@ -3127,14 +3131,91 @@ function composeLocale(dgaLocale, calendar) {
|
|
|
3127
3131
|
}
|
|
3128
3132
|
return isArabic ? `${base}-u-nu-latn` : base;
|
|
3129
3133
|
}
|
|
3130
|
-
var GREGORIAN = new GregorianCalendar();
|
|
3131
|
-
var ISLAMIC_UMALQURA = new IslamicUmalquraCalendar();
|
|
3132
3134
|
function secondaryDayNumber(date, mainCalendar) {
|
|
3133
3135
|
const other = mainCalendar === "hijri" ? GREGORIAN : ISLAMIC_UMALQURA;
|
|
3134
3136
|
return toCalendar(date, other).day;
|
|
3135
3137
|
}
|
|
3138
|
+
function useCalendarChrome(calendarSystem, calendarLabels) {
|
|
3139
|
+
const dgaCtx = useContext8(DgaContext);
|
|
3140
|
+
const dgaLocale = dgaCtx?.locale ?? "en";
|
|
3141
|
+
const dir = dgaCtx?.dir ?? "ltr";
|
|
3142
|
+
const locale = useMemo2(
|
|
3143
|
+
() => composeLocale(dgaLocale, calendarSystem),
|
|
3144
|
+
[dgaLocale, calendarSystem]
|
|
3145
|
+
);
|
|
3146
|
+
const portalContainer = dgaCtx?.portalEl ?? dgaCtx?.rootEl ?? void 0;
|
|
3147
|
+
const PrevChevron = dir === "rtl" ? ChevronRight : ChevronLeft;
|
|
3148
|
+
const NextChevron = dir === "rtl" ? ChevronLeft : ChevronRight;
|
|
3149
|
+
const resolvedLabels = useMemo2(() => {
|
|
3150
|
+
if (calendarLabels) return calendarLabels;
|
|
3151
|
+
return dgaLocale.startsWith("ar") ? { gregorian: "\u0645\u064A\u0644\u0627\u062F\u064A", hijri: "\u0647\u062C\u0631\u064A" } : { gregorian: "Gregorian", hijri: "Hijri" };
|
|
3152
|
+
}, [calendarLabels, dgaLocale]);
|
|
3153
|
+
const navLabels = useMemo2(
|
|
3154
|
+
() => dgaLocale.startsWith("ar") ? { month: "\u0627\u0644\u0634\u0647\u0631", year: "\u0627\u0644\u0633\u0646\u0629" } : { month: "Month", year: "Year" },
|
|
3155
|
+
[dgaLocale]
|
|
3156
|
+
);
|
|
3157
|
+
const a11yLabels = useMemo2(
|
|
3158
|
+
() => 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" },
|
|
3159
|
+
[dgaLocale]
|
|
3160
|
+
);
|
|
3161
|
+
return {
|
|
3162
|
+
dgaLocale,
|
|
3163
|
+
dir,
|
|
3164
|
+
locale,
|
|
3165
|
+
portalContainer,
|
|
3166
|
+
PrevChevron,
|
|
3167
|
+
NextChevron,
|
|
3168
|
+
resolvedLabels,
|
|
3169
|
+
navLabels,
|
|
3170
|
+
a11yLabels
|
|
3171
|
+
};
|
|
3172
|
+
}
|
|
3173
|
+
function CalendarSystemToggle({
|
|
3174
|
+
value,
|
|
3175
|
+
onChange,
|
|
3176
|
+
labels,
|
|
3177
|
+
groupLabel
|
|
3178
|
+
}) {
|
|
3179
|
+
return /* @__PURE__ */ jsxs23(
|
|
3180
|
+
"div",
|
|
3181
|
+
{
|
|
3182
|
+
role: "tablist",
|
|
3183
|
+
"aria-label": groupLabel,
|
|
3184
|
+
className: "ddga-calendar-toggle",
|
|
3185
|
+
"data-slot": "calendar-toggle",
|
|
3186
|
+
children: [
|
|
3187
|
+
/* @__PURE__ */ jsx29(
|
|
3188
|
+
"button",
|
|
3189
|
+
{
|
|
3190
|
+
type: "button",
|
|
3191
|
+
role: "tab",
|
|
3192
|
+
"aria-selected": value === "gregorian",
|
|
3193
|
+
className: "ddga-calendar-toggle__button",
|
|
3194
|
+
"data-active": value === "gregorian" ? "" : void 0,
|
|
3195
|
+
onClick: () => onChange("gregorian"),
|
|
3196
|
+
children: labels.gregorian
|
|
3197
|
+
}
|
|
3198
|
+
),
|
|
3199
|
+
/* @__PURE__ */ jsx29(
|
|
3200
|
+
"button",
|
|
3201
|
+
{
|
|
3202
|
+
type: "button",
|
|
3203
|
+
role: "tab",
|
|
3204
|
+
"aria-selected": value === "hijri",
|
|
3205
|
+
className: "ddga-calendar-toggle__button",
|
|
3206
|
+
"data-active": value === "hijri" ? "" : void 0,
|
|
3207
|
+
onClick: () => onChange("hijri"),
|
|
3208
|
+
children: labels.hijri
|
|
3209
|
+
}
|
|
3210
|
+
)
|
|
3211
|
+
]
|
|
3212
|
+
}
|
|
3213
|
+
);
|
|
3214
|
+
}
|
|
3136
3215
|
function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
3137
|
-
const
|
|
3216
|
+
const rangeState = useContext8(AriaRangeCalendarStateContext);
|
|
3217
|
+
const singleState = useContext8(AriaCalendarStateContext);
|
|
3218
|
+
const state = rangeState ?? singleState;
|
|
3138
3219
|
const focusedDate = state?.focusedDate ?? null;
|
|
3139
3220
|
const focusedYear = focusedDate?.year ?? 0;
|
|
3140
3221
|
const focusedCalendar = focusedDate?.calendar ?? GREGORIAN;
|
|
@@ -3159,13 +3240,13 @@ function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
|
3159
3240
|
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
3160
3241
|
}, [focusedDate, focusedCalendar, focusedYear, minValue, maxValue]);
|
|
3161
3242
|
if (!state || !focusedDate) return null;
|
|
3162
|
-
return /* @__PURE__ */ jsxs23("div", { className: "ddga-
|
|
3243
|
+
return /* @__PURE__ */ jsxs23("div", { className: "ddga-calendar__nav-selects", "data-slot": "calendar-nav", children: [
|
|
3163
3244
|
/* @__PURE__ */ jsx29(
|
|
3164
3245
|
"select",
|
|
3165
3246
|
{
|
|
3166
3247
|
"aria-label": monthLabel,
|
|
3167
|
-
className: "ddga-
|
|
3168
|
-
"data-slot": "
|
|
3248
|
+
className: "ddga-calendar__select ddga-calendar__month-select",
|
|
3249
|
+
"data-slot": "calendar-month-select",
|
|
3169
3250
|
value: focusedDate.month,
|
|
3170
3251
|
onChange: (e) => state.setFocusedDate(focusedDate.set({ month: Number(e.target.value) })),
|
|
3171
3252
|
children: monthNames.map((name, i) => /* @__PURE__ */ jsx29("option", { value: i + 1, children: name }, i + 1))
|
|
@@ -3175,8 +3256,8 @@ function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
|
3175
3256
|
"select",
|
|
3176
3257
|
{
|
|
3177
3258
|
"aria-label": yearLabel,
|
|
3178
|
-
className: "ddga-
|
|
3179
|
-
"data-slot": "
|
|
3259
|
+
className: "ddga-calendar__select ddga-calendar__year-select",
|
|
3260
|
+
"data-slot": "calendar-year-select",
|
|
3180
3261
|
value: focusedDate.year,
|
|
3181
3262
|
onChange: (e) => state.setFocusedDate(focusedDate.set({ year: Number(e.target.value) })),
|
|
3182
3263
|
children: yearOptions.map((y) => /* @__PURE__ */ jsx29("option", { value: y, children: y }, y))
|
|
@@ -3184,8 +3265,33 @@ function CalendarNavHeader({ locale, monthLabel, yearLabel }) {
|
|
|
3184
3265
|
)
|
|
3185
3266
|
] });
|
|
3186
3267
|
}
|
|
3268
|
+
function renderDayContent(primary, opts) {
|
|
3269
|
+
if (!opts.showSecondary) return primary;
|
|
3270
|
+
return /* @__PURE__ */ jsxs23(Fragment4, { children: [
|
|
3271
|
+
/* @__PURE__ */ jsx29("span", { className: "ddga-calendar__cell-primary", children: primary }),
|
|
3272
|
+
/* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "ddga-calendar__cell-secondary", children: secondaryDayNumber(opts.date, opts.calendarSystem) })
|
|
3273
|
+
] });
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3276
|
+
// src/components/DatePicker/DatePicker.tsx
|
|
3277
|
+
import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3278
|
+
var datePickerTriggerVariants = cva27("ddga-date-picker-trigger", {
|
|
3279
|
+
variants: {
|
|
3280
|
+
size: {
|
|
3281
|
+
sm: "ddga-date-picker-trigger--sm",
|
|
3282
|
+
md: "ddga-date-picker-trigger--md"
|
|
3283
|
+
},
|
|
3284
|
+
error: {
|
|
3285
|
+
true: "ddga-date-picker-trigger--error"
|
|
3286
|
+
}
|
|
3287
|
+
},
|
|
3288
|
+
defaultVariants: {
|
|
3289
|
+
size: "md"
|
|
3290
|
+
}
|
|
3291
|
+
});
|
|
3292
|
+
var datePickerVariants = datePickerTriggerVariants;
|
|
3187
3293
|
function CalendarDayCell({ date, showSecondary, calendarSystem }) {
|
|
3188
|
-
const state =
|
|
3294
|
+
const state = useContext9(AriaCalendarStateContext2);
|
|
3189
3295
|
const start = state?.visibleRange.start;
|
|
3190
3296
|
const isOutside = !!start && (date.year !== start.year || date.month !== start.month);
|
|
3191
3297
|
const isOutOfBounds = state ? state.isInvalid(date) : false;
|
|
@@ -3196,27 +3302,21 @@ function CalendarDayCell({ date, showSecondary, calendarSystem }) {
|
|
|
3196
3302
|
state.setFocusedDate(date);
|
|
3197
3303
|
state.selectDate(date);
|
|
3198
3304
|
};
|
|
3199
|
-
return /* @__PURE__ */
|
|
3305
|
+
return /* @__PURE__ */ jsx30("td", { role: "gridcell", children: /* @__PURE__ */ jsx30(
|
|
3200
3306
|
"button",
|
|
3201
3307
|
{
|
|
3202
3308
|
type: "button",
|
|
3203
3309
|
tabIndex: -1,
|
|
3204
|
-
className: "ddga-
|
|
3310
|
+
className: "ddga-calendar__cell",
|
|
3205
3311
|
"data-outside-month": "",
|
|
3206
3312
|
"data-selected": isSelected ? "" : void 0,
|
|
3207
3313
|
"data-slot": "date-picker-day-cell",
|
|
3208
3314
|
onClick: handleSelect,
|
|
3209
|
-
children:
|
|
3210
|
-
/* @__PURE__ */ jsx29("span", { className: "ddga-date-picker-calendar__cell-primary", children: date.day }),
|
|
3211
|
-
/* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "ddga-date-picker-calendar__cell-secondary", children: secondaryDayNumber(date, calendarSystem) })
|
|
3212
|
-
] }) : String(date.day)
|
|
3315
|
+
children: renderDayContent(date.day, { showSecondary, date, calendarSystem })
|
|
3213
3316
|
}
|
|
3214
3317
|
) });
|
|
3215
3318
|
}
|
|
3216
|
-
return /* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */ jsx29("span", { className: "ddga-date-picker-calendar__cell-primary", children: formattedDate }),
|
|
3218
|
-
/* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "ddga-date-picker-calendar__cell-secondary", children: secondaryDayNumber(date, calendarSystem) })
|
|
3219
|
-
] }) : formattedDate });
|
|
3319
|
+
return /* @__PURE__ */ jsx30(AriaCalendarCell, { date, className: "ddga-calendar__cell", children: ({ formattedDate }) => renderDayContent(formattedDate, { showSecondary, date, calendarSystem }) });
|
|
3220
3320
|
}
|
|
3221
3321
|
function DatePicker({
|
|
3222
3322
|
value: controlledValue,
|
|
@@ -3249,7 +3349,7 @@ function DatePicker({
|
|
|
3249
3349
|
const value = isValueControlled ? dateToCalendarDate(controlledValue) : internalValue;
|
|
3250
3350
|
const handleAriaChange = useCallback2(
|
|
3251
3351
|
(next) => {
|
|
3252
|
-
const nextCD = next ? new
|
|
3352
|
+
const nextCD = next ? new CalendarDate2(next.year, next.month, next.day) : null;
|
|
3253
3353
|
if (!isValueControlled) setInternalValue(nextCD);
|
|
3254
3354
|
onChange?.(calendarDateToDate(nextCD));
|
|
3255
3355
|
},
|
|
@@ -3265,33 +3365,24 @@ function DatePicker({
|
|
|
3265
3365
|
},
|
|
3266
3366
|
[isCalendarControlled, onCalendarChange]
|
|
3267
3367
|
);
|
|
3268
|
-
const
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
return isArabic ? { gregorian: "\u0645\u064A\u0644\u0627\u062F\u064A", hijri: "\u0647\u062C\u0631\u064A" } : { gregorian: "Gregorian", hijri: "Hijri" };
|
|
3282
|
-
}, [calendarLabels, dgaLocale]);
|
|
3283
|
-
const navLabels = useMemo2(
|
|
3284
|
-
() => dgaLocale.startsWith("ar") ? { month: "\u0627\u0644\u0634\u0647\u0631", year: "\u0627\u0644\u0633\u0646\u0629" } : { month: "Month", year: "Year" },
|
|
3285
|
-
[dgaLocale]
|
|
3286
|
-
);
|
|
3287
|
-
const ariaMinValue = useMemo2(() => dateToCalendarDate(minValue) ?? void 0, [minValue]);
|
|
3288
|
-
const ariaMaxValue = useMemo2(() => dateToCalendarDate(maxValue) ?? void 0, [maxValue]);
|
|
3289
|
-
const dialogAriaLabel = ariaLabel ?? (typeof label === "string" ? label : ariaLabelledBy ? void 0 : "Date");
|
|
3368
|
+
const {
|
|
3369
|
+
dgaLocale,
|
|
3370
|
+
locale: ariaLocale,
|
|
3371
|
+
portalContainer,
|
|
3372
|
+
PrevChevron,
|
|
3373
|
+
NextChevron,
|
|
3374
|
+
resolvedLabels,
|
|
3375
|
+
navLabels,
|
|
3376
|
+
a11yLabels
|
|
3377
|
+
} = useCalendarChrome(calendarSystem, calendarLabels);
|
|
3378
|
+
const ariaMinValue = useMemo3(() => dateToCalendarDate(minValue) ?? void 0, [minValue]);
|
|
3379
|
+
const ariaMaxValue = useMemo3(() => dateToCalendarDate(maxValue) ?? void 0, [maxValue]);
|
|
3380
|
+
const dialogAriaLabel = ariaLabel ?? (typeof label === "string" ? label : ariaLabelledBy ? void 0 : dgaLocale.startsWith("ar") ? "\u0627\u0644\u062A\u0627\u0631\u064A\u062E" : "Date");
|
|
3290
3381
|
const showToggle = showCalendarToggle && !isCalendarControlled;
|
|
3291
3382
|
const hasError = !!error;
|
|
3292
3383
|
const hasErrorMessage = hasError && errorMessage != null && errorMessage !== "";
|
|
3293
3384
|
const hasHelper = !hasErrorMessage && helperText != null && helperText !== "";
|
|
3294
|
-
return /* @__PURE__ */
|
|
3385
|
+
return /* @__PURE__ */ jsx30(I18nProvider, { locale: ariaLocale, children: /* @__PURE__ */ jsxs24(
|
|
3295
3386
|
AriaDatePicker,
|
|
3296
3387
|
{
|
|
3297
3388
|
value,
|
|
@@ -3308,17 +3399,17 @@ function DatePicker({
|
|
|
3308
3399
|
className: "ddga-field",
|
|
3309
3400
|
"data-slot": "date-picker-field",
|
|
3310
3401
|
children: [
|
|
3311
|
-
label && /* @__PURE__ */
|
|
3402
|
+
label && /* @__PURE__ */ jsxs24(AriaLabel, { className: "ddga-date-picker__label", children: [
|
|
3312
3403
|
label,
|
|
3313
|
-
required && /* @__PURE__ */
|
|
3404
|
+
required && /* @__PURE__ */ jsx30("span", { "aria-hidden": "true", className: "ddga-date-picker__required", children: "*" })
|
|
3314
3405
|
] }),
|
|
3315
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsxs24(
|
|
3316
3407
|
AriaGroup,
|
|
3317
3408
|
{
|
|
3318
3409
|
"data-slot": "date-picker-trigger",
|
|
3319
3410
|
className: cn(datePickerTriggerVariants({ size, error: hasError }), className),
|
|
3320
3411
|
children: [
|
|
3321
|
-
/* @__PURE__ */
|
|
3412
|
+
/* @__PURE__ */ jsx30(AriaDateInput, { className: "ddga-date-picker__input", "data-slot": "date-picker-input", children: (segment) => /* @__PURE__ */ jsx30(
|
|
3322
3413
|
AriaDateSegment,
|
|
3323
3414
|
{
|
|
3324
3415
|
segment,
|
|
@@ -3326,19 +3417,19 @@ function DatePicker({
|
|
|
3326
3417
|
"data-slot": "date-picker-segment"
|
|
3327
3418
|
}
|
|
3328
3419
|
) }),
|
|
3329
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ jsx30(
|
|
3330
3421
|
AriaButton,
|
|
3331
3422
|
{
|
|
3332
3423
|
className: "ddga-date-picker__icon-button",
|
|
3333
|
-
"aria-label":
|
|
3424
|
+
"aria-label": a11yLabels.openCalendar,
|
|
3334
3425
|
"data-slot": "date-picker-trigger-button",
|
|
3335
|
-
children: /* @__PURE__ */
|
|
3426
|
+
children: /* @__PURE__ */ jsx30(CalendarIcon, { "aria-hidden": "true", className: "ddga-date-picker__icon" })
|
|
3336
3427
|
}
|
|
3337
3428
|
)
|
|
3338
3429
|
]
|
|
3339
3430
|
}
|
|
3340
3431
|
),
|
|
3341
|
-
hasHelper && /* @__PURE__ */
|
|
3432
|
+
hasHelper && /* @__PURE__ */ jsx30(
|
|
3342
3433
|
AriaText,
|
|
3343
3434
|
{
|
|
3344
3435
|
slot: "description",
|
|
@@ -3347,7 +3438,7 @@ function DatePicker({
|
|
|
3347
3438
|
children: helperText
|
|
3348
3439
|
}
|
|
3349
3440
|
),
|
|
3350
|
-
hasErrorMessage && /* @__PURE__ */
|
|
3441
|
+
hasErrorMessage && /* @__PURE__ */ jsx30(
|
|
3351
3442
|
AriaFieldError,
|
|
3352
3443
|
{
|
|
3353
3444
|
className: "ddga-field__message ddga-field__message--error",
|
|
@@ -3355,69 +3446,43 @@ function DatePicker({
|
|
|
3355
3446
|
children: errorMessage
|
|
3356
3447
|
}
|
|
3357
3448
|
),
|
|
3358
|
-
/* @__PURE__ */
|
|
3449
|
+
/* @__PURE__ */ jsx30(
|
|
3359
3450
|
AriaPopover,
|
|
3360
3451
|
{
|
|
3361
3452
|
UNSTABLE_portalContainer: portalContainer,
|
|
3362
|
-
className: "ddga-
|
|
3453
|
+
className: "ddga-calendar-popover",
|
|
3363
3454
|
"data-slot": "date-picker-popover",
|
|
3364
3455
|
offset: 6,
|
|
3365
3456
|
containerPadding: 12,
|
|
3366
|
-
children: /* @__PURE__ */
|
|
3457
|
+
children: /* @__PURE__ */ jsxs24(
|
|
3367
3458
|
AriaDialog,
|
|
3368
3459
|
{
|
|
3369
|
-
className: "ddga-
|
|
3460
|
+
className: "ddga-calendar-dialog",
|
|
3370
3461
|
"data-slot": "date-picker-dialog",
|
|
3371
3462
|
"aria-label": dialogAriaLabel,
|
|
3372
3463
|
"aria-labelledby": ariaLabelledBy,
|
|
3373
3464
|
children: [
|
|
3374
|
-
showToggle && /* @__PURE__ */
|
|
3375
|
-
|
|
3465
|
+
showToggle && /* @__PURE__ */ jsx30(
|
|
3466
|
+
CalendarSystemToggle,
|
|
3376
3467
|
{
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
children: [
|
|
3382
|
-
/* @__PURE__ */ jsx29(
|
|
3383
|
-
"button",
|
|
3384
|
-
{
|
|
3385
|
-
type: "button",
|
|
3386
|
-
role: "tab",
|
|
3387
|
-
"aria-selected": calendarSystem === "gregorian",
|
|
3388
|
-
className: "ddga-date-picker-toggle__button",
|
|
3389
|
-
"data-active": calendarSystem === "gregorian" ? "" : void 0,
|
|
3390
|
-
onClick: () => setCalendar("gregorian"),
|
|
3391
|
-
children: resolvedLabels.gregorian
|
|
3392
|
-
}
|
|
3393
|
-
),
|
|
3394
|
-
/* @__PURE__ */ jsx29(
|
|
3395
|
-
"button",
|
|
3396
|
-
{
|
|
3397
|
-
type: "button",
|
|
3398
|
-
role: "tab",
|
|
3399
|
-
"aria-selected": calendarSystem === "hijri",
|
|
3400
|
-
className: "ddga-date-picker-toggle__button",
|
|
3401
|
-
"data-active": calendarSystem === "hijri" ? "" : void 0,
|
|
3402
|
-
onClick: () => setCalendar("hijri"),
|
|
3403
|
-
children: resolvedLabels.hijri
|
|
3404
|
-
}
|
|
3405
|
-
)
|
|
3406
|
-
]
|
|
3468
|
+
value: calendarSystem,
|
|
3469
|
+
onChange: setCalendar,
|
|
3470
|
+
labels: resolvedLabels,
|
|
3471
|
+
groupLabel: a11yLabels.calendarSystem
|
|
3407
3472
|
}
|
|
3408
3473
|
),
|
|
3409
|
-
/* @__PURE__ */
|
|
3410
|
-
/* @__PURE__ */
|
|
3411
|
-
/* @__PURE__ */
|
|
3474
|
+
/* @__PURE__ */ jsxs24(AriaCalendar, { className: "ddga-calendar", "data-slot": "date-picker-calendar", children: [
|
|
3475
|
+
/* @__PURE__ */ jsxs24("header", { className: "ddga-calendar__header", children: [
|
|
3476
|
+
/* @__PURE__ */ jsx30(
|
|
3412
3477
|
AriaButton,
|
|
3413
3478
|
{
|
|
3414
3479
|
slot: "previous",
|
|
3415
|
-
className: "ddga-
|
|
3480
|
+
className: "ddga-calendar__nav",
|
|
3416
3481
|
"data-slot": "date-picker-calendar-prev",
|
|
3417
|
-
children: /* @__PURE__ */
|
|
3482
|
+
children: /* @__PURE__ */ jsx30(PrevChevron, { "aria-hidden": "true" })
|
|
3418
3483
|
}
|
|
3419
3484
|
),
|
|
3420
|
-
/* @__PURE__ */
|
|
3485
|
+
/* @__PURE__ */ jsx30(
|
|
3421
3486
|
CalendarNavHeader,
|
|
3422
3487
|
{
|
|
3423
3488
|
locale: ariaLocale,
|
|
@@ -3425,19 +3490,19 @@ function DatePicker({
|
|
|
3425
3490
|
yearLabel: navLabels.year
|
|
3426
3491
|
}
|
|
3427
3492
|
),
|
|
3428
|
-
/* @__PURE__ */
|
|
3493
|
+
/* @__PURE__ */ jsx30(
|
|
3429
3494
|
AriaButton,
|
|
3430
3495
|
{
|
|
3431
3496
|
slot: "next",
|
|
3432
|
-
className: "ddga-
|
|
3497
|
+
className: "ddga-calendar__nav",
|
|
3433
3498
|
"data-slot": "date-picker-calendar-next",
|
|
3434
|
-
children: /* @__PURE__ */
|
|
3499
|
+
children: /* @__PURE__ */ jsx30(NextChevron, { "aria-hidden": "true" })
|
|
3435
3500
|
}
|
|
3436
3501
|
)
|
|
3437
3502
|
] }),
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ jsxs24(AriaCalendarGrid, { className: "ddga-calendar__grid", children: [
|
|
3504
|
+
/* @__PURE__ */ jsx30(AriaCalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx30(AriaCalendarHeaderCell, { className: "ddga-calendar__weekday", children: day }) }),
|
|
3505
|
+
/* @__PURE__ */ jsx30(AriaCalendarGridBody, { children: (date) => /* @__PURE__ */ jsx30(
|
|
3441
3506
|
CalendarDayCell,
|
|
3442
3507
|
{
|
|
3443
3508
|
date,
|
|
@@ -3459,7 +3524,7 @@ function DatePicker({
|
|
|
3459
3524
|
|
|
3460
3525
|
// src/components/FileUpload/FileUpload.tsx
|
|
3461
3526
|
import { useRef, useState as useState5 } from "react";
|
|
3462
|
-
import { jsx as
|
|
3527
|
+
import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3463
3528
|
function matchesAccept(file, accept) {
|
|
3464
3529
|
if (!accept) return true;
|
|
3465
3530
|
const tokens = accept.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
|
|
@@ -3563,12 +3628,12 @@ function FileUpload({
|
|
|
3563
3628
|
setIsDragging(false);
|
|
3564
3629
|
}
|
|
3565
3630
|
}
|
|
3566
|
-
return /* @__PURE__ */
|
|
3567
|
-
label && /* @__PURE__ */
|
|
3631
|
+
return /* @__PURE__ */ jsxs25("div", { "data-slot": "file-upload-field", className: cn("ddga-field", "ddga-file-upload", className), children: [
|
|
3632
|
+
label && /* @__PURE__ */ jsxs25("label", { htmlFor: fieldId, className: "ddga-file-upload__label", children: [
|
|
3568
3633
|
label,
|
|
3569
|
-
required && /* @__PURE__ */
|
|
3634
|
+
required && /* @__PURE__ */ jsx31("span", { "aria-hidden": "true", className: "ddga-file-upload__required", children: "*" })
|
|
3570
3635
|
] }),
|
|
3571
|
-
/* @__PURE__ */
|
|
3636
|
+
/* @__PURE__ */ jsxs25(
|
|
3572
3637
|
"div",
|
|
3573
3638
|
{
|
|
3574
3639
|
"data-slot": "file-upload-dropzone",
|
|
@@ -3586,9 +3651,9 @@ function FileUpload({
|
|
|
3586
3651
|
onDragLeave: handleDragLeave,
|
|
3587
3652
|
onDrop: handleDrop,
|
|
3588
3653
|
children: [
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
/* @__PURE__ */
|
|
3591
|
-
/* @__PURE__ */
|
|
3654
|
+
/* @__PURE__ */ jsx31(Upload, { className: "ddga-file-upload__icon", "aria-hidden": "true" }),
|
|
3655
|
+
/* @__PURE__ */ jsx31("span", { className: "ddga-file-upload__hint", children: hint }),
|
|
3656
|
+
/* @__PURE__ */ jsx31(
|
|
3592
3657
|
"input",
|
|
3593
3658
|
{
|
|
3594
3659
|
...controlProps,
|
|
@@ -3607,24 +3672,24 @@ function FileUpload({
|
|
|
3607
3672
|
]
|
|
3608
3673
|
}
|
|
3609
3674
|
),
|
|
3610
|
-
hasErrorMessage && /* @__PURE__ */
|
|
3611
|
-
hasHelper && /* @__PURE__ */
|
|
3612
|
-
files.length > 0 && /* @__PURE__ */
|
|
3675
|
+
hasErrorMessage && /* @__PURE__ */ jsx31(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
3676
|
+
hasHelper && /* @__PURE__ */ jsx31(FieldMessage, { id: helperId, variant: "helper", children: helperText }),
|
|
3677
|
+
files.length > 0 && /* @__PURE__ */ jsx31("ul", { "data-slot": "file-upload-list", className: "ddga-file-upload__list", children: files.map((item) => {
|
|
3613
3678
|
const status = item.status ?? "pending";
|
|
3614
|
-
return /* @__PURE__ */
|
|
3679
|
+
return /* @__PURE__ */ jsxs25(
|
|
3615
3680
|
"li",
|
|
3616
3681
|
{
|
|
3617
3682
|
"data-slot": "file-upload-item",
|
|
3618
3683
|
"data-status": status,
|
|
3619
3684
|
className: "ddga-file-upload__item",
|
|
3620
3685
|
children: [
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
/* @__PURE__ */
|
|
3623
|
-
/* @__PURE__ */
|
|
3624
|
-
/* @__PURE__ */
|
|
3625
|
-
/* @__PURE__ */
|
|
3686
|
+
/* @__PURE__ */ jsx31("span", { className: "ddga-file-upload__item-icon", "aria-hidden": "true", children: status === "success" ? /* @__PURE__ */ jsx31(Check, {}) : status === "error" ? /* @__PURE__ */ jsx31(AlertCircle, {}) : /* @__PURE__ */ jsx31(Upload, {}) }),
|
|
3687
|
+
/* @__PURE__ */ jsxs25("div", { className: "ddga-file-upload__item-main", children: [
|
|
3688
|
+
/* @__PURE__ */ jsxs25("div", { className: "ddga-file-upload__item-head", children: [
|
|
3689
|
+
/* @__PURE__ */ jsx31("span", { className: "ddga-file-upload__item-name", title: item.file.name, children: item.file.name }),
|
|
3690
|
+
/* @__PURE__ */ jsx31("span", { className: "ddga-file-upload__item-meta", children: formatBytes(item.file.size) })
|
|
3626
3691
|
] }),
|
|
3627
|
-
status === "uploading" && /* @__PURE__ */
|
|
3692
|
+
status === "uploading" && /* @__PURE__ */ jsx31(
|
|
3628
3693
|
Progress,
|
|
3629
3694
|
{
|
|
3630
3695
|
size: "sm",
|
|
@@ -3633,9 +3698,9 @@ function FileUpload({
|
|
|
3633
3698
|
className: "ddga-file-upload__item-progress"
|
|
3634
3699
|
}
|
|
3635
3700
|
),
|
|
3636
|
-
status === "error" && item.error && /* @__PURE__ */
|
|
3701
|
+
status === "error" && item.error && /* @__PURE__ */ jsx31("span", { role: "alert", className: "ddga-file-upload__item-error", children: item.error })
|
|
3637
3702
|
] }),
|
|
3638
|
-
onRemove && /* @__PURE__ */
|
|
3703
|
+
onRemove && /* @__PURE__ */ jsx31(
|
|
3639
3704
|
Button,
|
|
3640
3705
|
{
|
|
3641
3706
|
type: "button",
|
|
@@ -3644,7 +3709,7 @@ function FileUpload({
|
|
|
3644
3709
|
"aria-label": `${removeLabel}: ${item.file.name}`,
|
|
3645
3710
|
onClick: () => onRemove(item.id),
|
|
3646
3711
|
className: "ddga-file-upload__item-remove",
|
|
3647
|
-
children: /* @__PURE__ */
|
|
3712
|
+
children: /* @__PURE__ */ jsx31(Close, { "aria-hidden": "true" })
|
|
3648
3713
|
}
|
|
3649
3714
|
)
|
|
3650
3715
|
]
|
|
@@ -3659,7 +3724,7 @@ function FileUpload({
|
|
|
3659
3724
|
import { useId as useId4 } from "react";
|
|
3660
3725
|
import { Slider as SliderPrimitive } from "radix-ui";
|
|
3661
3726
|
import { cva as cva28 } from "class-variance-authority";
|
|
3662
|
-
import { jsx as
|
|
3727
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3663
3728
|
var sliderVariants = cva28("ddga-slider", {
|
|
3664
3729
|
variants: {
|
|
3665
3730
|
size: {
|
|
@@ -3715,12 +3780,12 @@ function Slider({
|
|
|
3715
3780
|
const wrap = (next) => isRange ? next : next[0];
|
|
3716
3781
|
const currentForRender = valueArray ?? defaultArray;
|
|
3717
3782
|
const fmt = (n) => formatValue ? formatValue(n) : String(n);
|
|
3718
|
-
return /* @__PURE__ */
|
|
3719
|
-
(label || showValue) && /* @__PURE__ */
|
|
3720
|
-
label && /* @__PURE__ */
|
|
3721
|
-
showValue && /* @__PURE__ */
|
|
3783
|
+
return /* @__PURE__ */ jsxs26("div", { "data-slot": "slider-field", className: "ddga-field", children: [
|
|
3784
|
+
(label || showValue) && /* @__PURE__ */ jsxs26("div", { className: "ddga-slider__header", children: [
|
|
3785
|
+
label && /* @__PURE__ */ jsx32("span", { id: labelId, className: "ddga-slider__label", children: label }),
|
|
3786
|
+
showValue && /* @__PURE__ */ jsx32("span", { className: "ddga-slider__value", "aria-hidden": "true", children: currentForRender.map(fmt).join(" \u2013 ") })
|
|
3722
3787
|
] }),
|
|
3723
|
-
/* @__PURE__ */
|
|
3788
|
+
/* @__PURE__ */ jsxs26(
|
|
3724
3789
|
SliderPrimitive.Root,
|
|
3725
3790
|
{
|
|
3726
3791
|
...props,
|
|
@@ -3735,8 +3800,8 @@ function Slider({
|
|
|
3735
3800
|
"data-slot": "slider",
|
|
3736
3801
|
className: cn(sliderVariants({ size, error: hasError }), className),
|
|
3737
3802
|
children: [
|
|
3738
|
-
/* @__PURE__ */
|
|
3739
|
-
currentForRender.map((thumbValue, index) => /* @__PURE__ */
|
|
3803
|
+
/* @__PURE__ */ jsx32(SliderPrimitive.Track, { "data-slot": "slider-track", className: "ddga-slider__track", children: /* @__PURE__ */ jsx32(SliderPrimitive.Range, { "data-slot": "slider-range", className: "ddga-slider__range" }) }),
|
|
3804
|
+
currentForRender.map((thumbValue, index) => /* @__PURE__ */ jsx32(
|
|
3740
3805
|
SliderPrimitive.Thumb,
|
|
3741
3806
|
{
|
|
3742
3807
|
"data-slot": "slider-thumb",
|
|
@@ -3751,15 +3816,15 @@ function Slider({
|
|
|
3751
3816
|
]
|
|
3752
3817
|
}
|
|
3753
3818
|
),
|
|
3754
|
-
hasErrorMessage && /* @__PURE__ */
|
|
3755
|
-
hasHelper && /* @__PURE__ */
|
|
3819
|
+
hasErrorMessage && /* @__PURE__ */ jsx32(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
3820
|
+
hasHelper && /* @__PURE__ */ jsx32(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
3756
3821
|
] });
|
|
3757
3822
|
}
|
|
3758
3823
|
|
|
3759
3824
|
// src/components/NumberInput/NumberInput.tsx
|
|
3760
3825
|
import { useState as useState6 } from "react";
|
|
3761
3826
|
import { cva as cva29 } from "class-variance-authority";
|
|
3762
|
-
import { jsx as
|
|
3827
|
+
import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3763
3828
|
var numberInputVariants = cva29("ddga-number-input", {
|
|
3764
3829
|
variants: {
|
|
3765
3830
|
size: {
|
|
@@ -3869,18 +3934,18 @@ function NumberInput({
|
|
|
3869
3934
|
}
|
|
3870
3935
|
const atMin = min != null && numericValue != null && numericValue <= min;
|
|
3871
3936
|
const atMax = max != null && numericValue != null && numericValue >= max;
|
|
3872
|
-
return /* @__PURE__ */
|
|
3873
|
-
label && /* @__PURE__ */
|
|
3937
|
+
return /* @__PURE__ */ jsxs27("div", { "data-slot": "number-input-field", className: "ddga-field", children: [
|
|
3938
|
+
label && /* @__PURE__ */ jsxs27("label", { htmlFor: fieldId, className: "ddga-number-input__label", children: [
|
|
3874
3939
|
label,
|
|
3875
|
-
required && /* @__PURE__ */
|
|
3940
|
+
required && /* @__PURE__ */ jsx33("span", { "aria-hidden": "true", className: "ddga-number-input__required", children: "*" })
|
|
3876
3941
|
] }),
|
|
3877
|
-
/* @__PURE__ */
|
|
3942
|
+
/* @__PURE__ */ jsxs27(
|
|
3878
3943
|
"div",
|
|
3879
3944
|
{
|
|
3880
3945
|
"data-slot": "number-input-control",
|
|
3881
3946
|
className: cn(numberInputVariants({ size, error: hasError }), className),
|
|
3882
3947
|
children: [
|
|
3883
|
-
!hideControls && /* @__PURE__ */
|
|
3948
|
+
!hideControls && /* @__PURE__ */ jsx33(
|
|
3884
3949
|
"button",
|
|
3885
3950
|
{
|
|
3886
3951
|
type: "button",
|
|
@@ -3890,10 +3955,10 @@ function NumberInput({
|
|
|
3890
3955
|
onClick: () => stepBy(-1),
|
|
3891
3956
|
disabled: disabled || atMin,
|
|
3892
3957
|
tabIndex: -1,
|
|
3893
|
-
children: /* @__PURE__ */
|
|
3958
|
+
children: /* @__PURE__ */ jsx33(Minus, { "aria-hidden": "true" })
|
|
3894
3959
|
}
|
|
3895
3960
|
),
|
|
3896
|
-
/* @__PURE__ */
|
|
3961
|
+
/* @__PURE__ */ jsx33(
|
|
3897
3962
|
"input",
|
|
3898
3963
|
{
|
|
3899
3964
|
...props,
|
|
@@ -3910,7 +3975,7 @@ function NumberInput({
|
|
|
3910
3975
|
className: "ddga-number-input__field"
|
|
3911
3976
|
}
|
|
3912
3977
|
),
|
|
3913
|
-
!hideControls && /* @__PURE__ */
|
|
3978
|
+
!hideControls && /* @__PURE__ */ jsx33(
|
|
3914
3979
|
"button",
|
|
3915
3980
|
{
|
|
3916
3981
|
type: "button",
|
|
@@ -3920,21 +3985,21 @@ function NumberInput({
|
|
|
3920
3985
|
onClick: () => stepBy(1),
|
|
3921
3986
|
disabled: disabled || atMax,
|
|
3922
3987
|
tabIndex: -1,
|
|
3923
|
-
children: /* @__PURE__ */
|
|
3988
|
+
children: /* @__PURE__ */ jsx33(Plus, { "aria-hidden": "true" })
|
|
3924
3989
|
}
|
|
3925
3990
|
)
|
|
3926
3991
|
]
|
|
3927
3992
|
}
|
|
3928
3993
|
),
|
|
3929
|
-
hasErrorMessage && /* @__PURE__ */
|
|
3930
|
-
hasHelper && /* @__PURE__ */
|
|
3994
|
+
hasErrorMessage && /* @__PURE__ */ jsx33(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
3995
|
+
hasHelper && /* @__PURE__ */ jsx33(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
3931
3996
|
] });
|
|
3932
3997
|
}
|
|
3933
3998
|
|
|
3934
3999
|
// src/components/Rating/Rating.tsx
|
|
3935
4000
|
import { useRef as useRef2, useState as useState7 } from "react";
|
|
3936
4001
|
import { cva as cva30 } from "class-variance-authority";
|
|
3937
|
-
import { jsx as
|
|
4002
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3938
4003
|
var ratingVariants = cva30("ddga-rating", {
|
|
3939
4004
|
variants: {
|
|
3940
4005
|
size: {
|
|
@@ -4043,7 +4108,7 @@ function Rating({
|
|
|
4043
4108
|
}
|
|
4044
4109
|
const stars = Array.from({ length: max }, (_, index) => {
|
|
4045
4110
|
const level = fillFor(index, displayValue, allowHalf);
|
|
4046
|
-
return /* @__PURE__ */
|
|
4111
|
+
return /* @__PURE__ */ jsxs28(
|
|
4047
4112
|
"span",
|
|
4048
4113
|
{
|
|
4049
4114
|
"data-slot": "rating-star",
|
|
@@ -4052,8 +4117,8 @@ function Rating({
|
|
|
4052
4117
|
onPointerMove: interactive ? (event) => setHover(pointerValue(event, index)) : void 0,
|
|
4053
4118
|
onClick: interactive ? (event) => commit(pointerValue(event, index)) : void 0,
|
|
4054
4119
|
children: [
|
|
4055
|
-
/* @__PURE__ */
|
|
4056
|
-
/* @__PURE__ */
|
|
4120
|
+
/* @__PURE__ */ jsx34(Star, { className: "ddga-rating__star-bg", "aria-hidden": "true" }),
|
|
4121
|
+
/* @__PURE__ */ jsx34("span", { className: "ddga-rating__star-fill", "aria-hidden": "true", children: /* @__PURE__ */ jsx34(Star, { className: "ddga-rating__star-fg", "aria-hidden": "true" }) })
|
|
4057
4122
|
]
|
|
4058
4123
|
},
|
|
4059
4124
|
index
|
|
@@ -4068,9 +4133,9 @@ function Rating({
|
|
|
4068
4133
|
};
|
|
4069
4134
|
const labelledBy = label ? `${fieldId}-label` : props["aria-labelledby"];
|
|
4070
4135
|
const ariaLabel = labelledBy ? void 0 : props["aria-label"] ?? "Rating";
|
|
4071
|
-
return /* @__PURE__ */
|
|
4072
|
-
label && /* @__PURE__ */
|
|
4073
|
-
readOnly ? /* @__PURE__ */
|
|
4136
|
+
return /* @__PURE__ */ jsxs28("div", { "data-slot": "rating-field", className: "ddga-field", children: [
|
|
4137
|
+
label && /* @__PURE__ */ jsx34("span", { id: `${fieldId}-label`, className: "ddga-rating__label", children: label }),
|
|
4138
|
+
readOnly ? /* @__PURE__ */ jsx34("div", { ...sharedProps, role: "img", "aria-label": formatValueText(currentValue, max), children: stars }) : /* @__PURE__ */ jsx34(
|
|
4074
4139
|
"div",
|
|
4075
4140
|
{
|
|
4076
4141
|
...sharedProps,
|
|
@@ -4090,15 +4155,15 @@ function Rating({
|
|
|
4090
4155
|
children: stars
|
|
4091
4156
|
}
|
|
4092
4157
|
),
|
|
4093
|
-
hasErrorMessage && /* @__PURE__ */
|
|
4094
|
-
hasHelper && /* @__PURE__ */
|
|
4158
|
+
hasErrorMessage && /* @__PURE__ */ jsx34(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
4159
|
+
hasHelper && /* @__PURE__ */ jsx34(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
4095
4160
|
] });
|
|
4096
4161
|
}
|
|
4097
4162
|
|
|
4098
4163
|
// src/components/Toggle/Toggle.tsx
|
|
4099
4164
|
import { Toggle as TogglePrimitive, ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
4100
4165
|
import { cva as cva31 } from "class-variance-authority";
|
|
4101
|
-
import { jsx as
|
|
4166
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4102
4167
|
var toggleVariants = cva31("ddga-toggle", {
|
|
4103
4168
|
variants: {
|
|
4104
4169
|
variant: {
|
|
@@ -4134,7 +4199,7 @@ var toggleGroupVariants = cva31("ddga-toggle-group", {
|
|
|
4134
4199
|
}
|
|
4135
4200
|
});
|
|
4136
4201
|
function Toggle({ variant, size, className, ...props }) {
|
|
4137
|
-
return /* @__PURE__ */
|
|
4202
|
+
return /* @__PURE__ */ jsx35(
|
|
4138
4203
|
TogglePrimitive.Root,
|
|
4139
4204
|
{
|
|
4140
4205
|
"data-slot": "toggle",
|
|
@@ -4149,7 +4214,7 @@ function ToggleGroup({ variant, size, className, ...props }) {
|
|
|
4149
4214
|
"[@dev-dga/react] ToggleGroup should have an `aria-label` or `aria-labelledby` so the button group has an accessible name."
|
|
4150
4215
|
);
|
|
4151
4216
|
}
|
|
4152
|
-
return /* @__PURE__ */
|
|
4217
|
+
return /* @__PURE__ */ jsx35(
|
|
4153
4218
|
ToggleGroupPrimitive.Root,
|
|
4154
4219
|
{
|
|
4155
4220
|
"data-slot": "toggle-group",
|
|
@@ -4159,7 +4224,7 @@ function ToggleGroup({ variant, size, className, ...props }) {
|
|
|
4159
4224
|
);
|
|
4160
4225
|
}
|
|
4161
4226
|
function ToggleGroupItem({ className, ...props }) {
|
|
4162
|
-
return /* @__PURE__ */
|
|
4227
|
+
return /* @__PURE__ */ jsx35(
|
|
4163
4228
|
ToggleGroupPrimitive.Item,
|
|
4164
4229
|
{
|
|
4165
4230
|
"data-slot": "toggle-group-item",
|
|
@@ -4171,7 +4236,7 @@ function ToggleGroupItem({ className, ...props }) {
|
|
|
4171
4236
|
|
|
4172
4237
|
// src/components/DescriptionList/DescriptionList.tsx
|
|
4173
4238
|
import { cva as cva32 } from "class-variance-authority";
|
|
4174
|
-
import { jsx as
|
|
4239
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4175
4240
|
var descriptionListVariants = cva32("ddga-description-list", {
|
|
4176
4241
|
variants: {
|
|
4177
4242
|
orientation: {
|
|
@@ -4187,7 +4252,7 @@ var descriptionListVariants = cva32("ddga-description-list", {
|
|
|
4187
4252
|
}
|
|
4188
4253
|
});
|
|
4189
4254
|
function DescriptionList({ orientation, divided, className, ...props }) {
|
|
4190
|
-
return /* @__PURE__ */
|
|
4255
|
+
return /* @__PURE__ */ jsx36(
|
|
4191
4256
|
"dl",
|
|
4192
4257
|
{
|
|
4193
4258
|
"data-slot": "description-list",
|
|
@@ -4197,7 +4262,7 @@ function DescriptionList({ orientation, divided, className, ...props }) {
|
|
|
4197
4262
|
);
|
|
4198
4263
|
}
|
|
4199
4264
|
function DescriptionItem({ className, ...props }) {
|
|
4200
|
-
return /* @__PURE__ */
|
|
4265
|
+
return /* @__PURE__ */ jsx36(
|
|
4201
4266
|
"div",
|
|
4202
4267
|
{
|
|
4203
4268
|
"data-slot": "description-item",
|
|
@@ -4207,7 +4272,7 @@ function DescriptionItem({ className, ...props }) {
|
|
|
4207
4272
|
);
|
|
4208
4273
|
}
|
|
4209
4274
|
function DescriptionTerm({ className, ...props }) {
|
|
4210
|
-
return /* @__PURE__ */
|
|
4275
|
+
return /* @__PURE__ */ jsx36(
|
|
4211
4276
|
"dt",
|
|
4212
4277
|
{
|
|
4213
4278
|
"data-slot": "description-term",
|
|
@@ -4217,7 +4282,7 @@ function DescriptionTerm({ className, ...props }) {
|
|
|
4217
4282
|
);
|
|
4218
4283
|
}
|
|
4219
4284
|
function DescriptionDetails({ className, ...props }) {
|
|
4220
|
-
return /* @__PURE__ */
|
|
4285
|
+
return /* @__PURE__ */ jsx36(
|
|
4221
4286
|
"dd",
|
|
4222
4287
|
{
|
|
4223
4288
|
"data-slot": "description-details",
|
|
@@ -4231,7 +4296,7 @@ function DescriptionDetails({ className, ...props }) {
|
|
|
4231
4296
|
import "react";
|
|
4232
4297
|
import { Slot as SlotPrimitive9 } from "radix-ui";
|
|
4233
4298
|
import { cva as cva33 } from "class-variance-authority";
|
|
4234
|
-
import { Fragment as Fragment5, jsx as
|
|
4299
|
+
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4235
4300
|
var emptyStateVariants = cva33("ddga-empty-state", {
|
|
4236
4301
|
variants: {
|
|
4237
4302
|
variant: {
|
|
@@ -4252,10 +4317,10 @@ var emptyStateVariants = cva33("ddga-empty-state", {
|
|
|
4252
4317
|
}
|
|
4253
4318
|
});
|
|
4254
4319
|
var DEFAULT_ICONS3 = {
|
|
4255
|
-
default: /* @__PURE__ */
|
|
4256
|
-
search: /* @__PURE__ */
|
|
4257
|
-
error: /* @__PURE__ */
|
|
4258
|
-
success: /* @__PURE__ */
|
|
4320
|
+
default: /* @__PURE__ */ jsx37(Inbox, { "aria-hidden": "true" }),
|
|
4321
|
+
search: /* @__PURE__ */ jsx37(Search, { "aria-hidden": "true" }),
|
|
4322
|
+
error: /* @__PURE__ */ jsx37(AlertCircle, { "aria-hidden": "true" }),
|
|
4323
|
+
success: /* @__PURE__ */ jsx37(Check, { "aria-hidden": "true" })
|
|
4259
4324
|
};
|
|
4260
4325
|
function EmptyState({
|
|
4261
4326
|
variant,
|
|
@@ -4265,24 +4330,26 @@ function EmptyState({
|
|
|
4265
4330
|
description,
|
|
4266
4331
|
action,
|
|
4267
4332
|
secondaryAction,
|
|
4333
|
+
asChild,
|
|
4268
4334
|
className,
|
|
4269
4335
|
children,
|
|
4270
4336
|
...props
|
|
4271
4337
|
}) {
|
|
4272
4338
|
const resolvedIcon = icon === false ? null : icon !== void 0 ? icon : DEFAULT_ICONS3[variant ?? "default"];
|
|
4273
|
-
|
|
4274
|
-
|
|
4339
|
+
const Comp = asChild ? SlotPrimitive9.Slot : "div";
|
|
4340
|
+
return /* @__PURE__ */ jsx37(
|
|
4341
|
+
Comp,
|
|
4275
4342
|
{
|
|
4276
4343
|
"data-slot": "empty-state",
|
|
4277
4344
|
"data-variant": variant ?? "default",
|
|
4278
4345
|
"data-size": size ?? "md",
|
|
4279
4346
|
className: cn(emptyStateVariants({ variant, size }), className),
|
|
4280
4347
|
...props,
|
|
4281
|
-
children: children ?? /* @__PURE__ */
|
|
4282
|
-
resolvedIcon ? /* @__PURE__ */
|
|
4283
|
-
title ? /* @__PURE__ */
|
|
4284
|
-
description ? /* @__PURE__ */
|
|
4285
|
-
action || secondaryAction ? /* @__PURE__ */
|
|
4348
|
+
children: children ?? /* @__PURE__ */ jsxs29(Fragment5, { children: [
|
|
4349
|
+
resolvedIcon ? /* @__PURE__ */ jsx37(EmptyStateMedia, { children: resolvedIcon }) : null,
|
|
4350
|
+
title ? /* @__PURE__ */ jsx37(EmptyStateTitle, { children: title }) : null,
|
|
4351
|
+
description ? /* @__PURE__ */ jsx37(EmptyStateDescription, { children: description }) : null,
|
|
4352
|
+
action || secondaryAction ? /* @__PURE__ */ jsxs29(EmptyStateActions, { children: [
|
|
4286
4353
|
action,
|
|
4287
4354
|
secondaryAction
|
|
4288
4355
|
] }) : null
|
|
@@ -4291,7 +4358,7 @@ function EmptyState({
|
|
|
4291
4358
|
);
|
|
4292
4359
|
}
|
|
4293
4360
|
function EmptyStateMedia({ className, ...props }) {
|
|
4294
|
-
return /* @__PURE__ */
|
|
4361
|
+
return /* @__PURE__ */ jsx37(
|
|
4295
4362
|
"div",
|
|
4296
4363
|
{
|
|
4297
4364
|
"data-slot": "empty-state-media",
|
|
@@ -4303,7 +4370,7 @@ function EmptyStateMedia({ className, ...props }) {
|
|
|
4303
4370
|
}
|
|
4304
4371
|
function EmptyStateTitle({ asChild, className, ...props }) {
|
|
4305
4372
|
const Comp = asChild ? SlotPrimitive9.Slot : "h3";
|
|
4306
|
-
return /* @__PURE__ */
|
|
4373
|
+
return /* @__PURE__ */ jsx37(
|
|
4307
4374
|
Comp,
|
|
4308
4375
|
{
|
|
4309
4376
|
"data-slot": "empty-state-title",
|
|
@@ -4314,7 +4381,7 @@ function EmptyStateTitle({ asChild, className, ...props }) {
|
|
|
4314
4381
|
}
|
|
4315
4382
|
function EmptyStateDescription({ asChild, className, ...props }) {
|
|
4316
4383
|
const Comp = asChild ? SlotPrimitive9.Slot : "p";
|
|
4317
|
-
return /* @__PURE__ */
|
|
4384
|
+
return /* @__PURE__ */ jsx37(
|
|
4318
4385
|
Comp,
|
|
4319
4386
|
{
|
|
4320
4387
|
"data-slot": "empty-state-description",
|
|
@@ -4325,7 +4392,7 @@ function EmptyStateDescription({ asChild, className, ...props }) {
|
|
|
4325
4392
|
}
|
|
4326
4393
|
function EmptyStateActions({ asChild, className, ...props }) {
|
|
4327
4394
|
const Comp = asChild ? SlotPrimitive9.Slot : "div";
|
|
4328
|
-
return /* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ jsx37(
|
|
4329
4396
|
Comp,
|
|
4330
4397
|
{
|
|
4331
4398
|
"data-slot": "empty-state-actions",
|
|
@@ -4338,7 +4405,7 @@ function EmptyStateActions({ asChild, className, ...props }) {
|
|
|
4338
4405
|
// src/components/Stat/Stat.tsx
|
|
4339
4406
|
import "react";
|
|
4340
4407
|
import { cva as cva34 } from "class-variance-authority";
|
|
4341
|
-
import { jsx as
|
|
4408
|
+
import { jsx as jsx38, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4342
4409
|
var statVariants = cva34("ddga-stat", {
|
|
4343
4410
|
variants: {
|
|
4344
4411
|
variant: {
|
|
@@ -4362,9 +4429,9 @@ var statVariants = cva34("ddga-stat", {
|
|
|
4362
4429
|
}
|
|
4363
4430
|
});
|
|
4364
4431
|
var TREND_ICONS = {
|
|
4365
|
-
up: /* @__PURE__ */
|
|
4366
|
-
down: /* @__PURE__ */
|
|
4367
|
-
flat: /* @__PURE__ */
|
|
4432
|
+
up: /* @__PURE__ */ jsx38(CaretUp, { "aria-hidden": "true" }),
|
|
4433
|
+
down: /* @__PURE__ */ jsx38(CaretDown, { "aria-hidden": "true" }),
|
|
4434
|
+
flat: /* @__PURE__ */ jsx38(Minus, { "aria-hidden": "true" })
|
|
4368
4435
|
};
|
|
4369
4436
|
var TREND_SENTIMENT = {
|
|
4370
4437
|
up: "positive",
|
|
@@ -4392,7 +4459,7 @@ function Stat({
|
|
|
4392
4459
|
...props
|
|
4393
4460
|
}) {
|
|
4394
4461
|
const resolvedSentiment = resolveSentiment(trend, sentiment);
|
|
4395
|
-
return /* @__PURE__ */
|
|
4462
|
+
return /* @__PURE__ */ jsxs30(
|
|
4396
4463
|
"div",
|
|
4397
4464
|
{
|
|
4398
4465
|
"data-slot": "stat",
|
|
@@ -4402,14 +4469,14 @@ function Stat({
|
|
|
4402
4469
|
className: cn(statVariants({ variant, size }), className),
|
|
4403
4470
|
...props,
|
|
4404
4471
|
children: [
|
|
4405
|
-
label || icon ? /* @__PURE__ */
|
|
4406
|
-
label ? /* @__PURE__ */
|
|
4407
|
-
icon ? /* @__PURE__ */
|
|
4472
|
+
label || icon ? /* @__PURE__ */ jsxs30("div", { className: "ddga-stat__label-row", children: [
|
|
4473
|
+
label ? /* @__PURE__ */ jsx38(StatLabel, { children: label }) : null,
|
|
4474
|
+
icon ? /* @__PURE__ */ jsx38("span", { className: "ddga-stat__icon", "aria-hidden": "true", children: icon }) : null
|
|
4408
4475
|
] }) : null,
|
|
4409
|
-
value ? /* @__PURE__ */
|
|
4410
|
-
change || changeLabel ? /* @__PURE__ */
|
|
4411
|
-
change ? /* @__PURE__ */
|
|
4412
|
-
changeLabel ? /* @__PURE__ */
|
|
4476
|
+
value ? /* @__PURE__ */ jsx38(StatValue, { children: value }) : null,
|
|
4477
|
+
change || changeLabel ? /* @__PURE__ */ jsxs30("div", { className: "ddga-stat__change-row", children: [
|
|
4478
|
+
change ? /* @__PURE__ */ jsx38(StatChange, { trend, sentiment, variant: changeVariant, children: change }) : null,
|
|
4479
|
+
changeLabel ? /* @__PURE__ */ jsx38("span", { className: "ddga-stat__change-label", children: changeLabel }) : null
|
|
4413
4480
|
] }) : null,
|
|
4414
4481
|
children
|
|
4415
4482
|
]
|
|
@@ -4417,17 +4484,17 @@ function Stat({
|
|
|
4417
4484
|
);
|
|
4418
4485
|
}
|
|
4419
4486
|
function StatLabel({ className, ...props }) {
|
|
4420
|
-
return /* @__PURE__ */
|
|
4487
|
+
return /* @__PURE__ */ jsx38("div", { "data-slot": "stat-label", className: cn("ddga-stat__label", className), ...props });
|
|
4421
4488
|
}
|
|
4422
4489
|
function StatValue({ className, ...props }) {
|
|
4423
|
-
return /* @__PURE__ */
|
|
4490
|
+
return /* @__PURE__ */ jsx38("div", { "data-slot": "stat-value", className: cn("ddga-stat__value", className), ...props });
|
|
4424
4491
|
}
|
|
4425
4492
|
function StatChart({ className, ...props }) {
|
|
4426
|
-
return /* @__PURE__ */
|
|
4493
|
+
return /* @__PURE__ */ jsx38("div", { "data-slot": "stat-chart", className: cn("ddga-stat__chart", className), ...props });
|
|
4427
4494
|
}
|
|
4428
4495
|
function StatChange({ trend, sentiment, variant, className, children, ...props }) {
|
|
4429
4496
|
const resolvedSentiment = resolveSentiment(trend, sentiment);
|
|
4430
|
-
return /* @__PURE__ */
|
|
4497
|
+
return /* @__PURE__ */ jsxs30(
|
|
4431
4498
|
"div",
|
|
4432
4499
|
{
|
|
4433
4500
|
"data-slot": "stat-change",
|
|
@@ -4441,7 +4508,7 @@ function StatChange({ trend, sentiment, variant, className, children, ...props }
|
|
|
4441
4508
|
),
|
|
4442
4509
|
...props,
|
|
4443
4510
|
children: [
|
|
4444
|
-
trend ? /* @__PURE__ */
|
|
4511
|
+
trend ? /* @__PURE__ */ jsx38("span", { className: "ddga-stat__change-icon", children: TREND_ICONS[trend] }) : null,
|
|
4445
4512
|
children
|
|
4446
4513
|
]
|
|
4447
4514
|
}
|
|
@@ -4450,7 +4517,7 @@ function StatChange({ trend, sentiment, variant, className, children, ...props }
|
|
|
4450
4517
|
|
|
4451
4518
|
// src/components/Stat/StatGroup.tsx
|
|
4452
4519
|
import { cva as cva35 } from "class-variance-authority";
|
|
4453
|
-
import { jsx as
|
|
4520
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4454
4521
|
var statGroupVariants = cva35("ddga-stat-group", {
|
|
4455
4522
|
variants: {
|
|
4456
4523
|
orientation: {
|
|
@@ -4469,7 +4536,7 @@ var statGroupVariants = cva35("ddga-stat-group", {
|
|
|
4469
4536
|
}
|
|
4470
4537
|
});
|
|
4471
4538
|
function StatGroup({ orientation, gap, columns, className, style, ...props }) {
|
|
4472
|
-
return /* @__PURE__ */
|
|
4539
|
+
return /* @__PURE__ */ jsx39(
|
|
4473
4540
|
"div",
|
|
4474
4541
|
{
|
|
4475
4542
|
"data-slot": "stat-group",
|
|
@@ -4485,10 +4552,10 @@ function StatGroup({ orientation, gap, columns, className, style, ...props }) {
|
|
|
4485
4552
|
}
|
|
4486
4553
|
|
|
4487
4554
|
// src/components/Popover/Popover.tsx
|
|
4488
|
-
import { useContext as
|
|
4555
|
+
import { useContext as useContext10 } from "react";
|
|
4489
4556
|
import { Popover as PopoverPrimitive2 } from "radix-ui";
|
|
4490
4557
|
import { cva as cva36 } from "class-variance-authority";
|
|
4491
|
-
import { jsx as
|
|
4558
|
+
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4492
4559
|
var popoverContentVariants = cva36("ddga-popover", {
|
|
4493
4560
|
variants: {
|
|
4494
4561
|
size: {
|
|
@@ -4501,13 +4568,13 @@ var popoverContentVariants = cva36("ddga-popover", {
|
|
|
4501
4568
|
}
|
|
4502
4569
|
});
|
|
4503
4570
|
function Popover(props) {
|
|
4504
|
-
return /* @__PURE__ */
|
|
4571
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive2.Root, { ...props });
|
|
4505
4572
|
}
|
|
4506
4573
|
function PopoverTrigger({ className, ...props }) {
|
|
4507
|
-
return /* @__PURE__ */
|
|
4574
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", className, ...props });
|
|
4508
4575
|
}
|
|
4509
4576
|
function PopoverAnchor(props) {
|
|
4510
|
-
return /* @__PURE__ */
|
|
4577
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive2.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
4511
4578
|
}
|
|
4512
4579
|
function PopoverContent({
|
|
4513
4580
|
size,
|
|
@@ -4522,9 +4589,9 @@ function PopoverContent({
|
|
|
4522
4589
|
'[@dev-dga/react] PopoverContent renders role="dialog" and should have an `aria-label` or `aria-labelledby` so the panel has an accessible name.'
|
|
4523
4590
|
);
|
|
4524
4591
|
}
|
|
4525
|
-
const ctx =
|
|
4592
|
+
const ctx = useContext10(DgaContext);
|
|
4526
4593
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
4527
|
-
return /* @__PURE__ */
|
|
4594
|
+
return /* @__PURE__ */ jsx40(PopoverPrimitive2.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxs31(
|
|
4528
4595
|
PopoverPrimitive2.Content,
|
|
4529
4596
|
{
|
|
4530
4597
|
"data-slot": "popover-content",
|
|
@@ -4533,7 +4600,7 @@ function PopoverContent({
|
|
|
4533
4600
|
...props,
|
|
4534
4601
|
children: [
|
|
4535
4602
|
children,
|
|
4536
|
-
arrow ? /* @__PURE__ */
|
|
4603
|
+
arrow ? /* @__PURE__ */ jsx40(PopoverPrimitive2.Arrow, { className: "ddga-popover__arrow", width: 16, height: 8 }) : null
|
|
4537
4604
|
]
|
|
4538
4605
|
}
|
|
4539
4606
|
) });
|
|
@@ -4547,7 +4614,7 @@ function PopoverClose({
|
|
|
4547
4614
|
}) {
|
|
4548
4615
|
const hasRenderableChildren = children != null && children !== false;
|
|
4549
4616
|
if (asChild || hasRenderableChildren) {
|
|
4550
|
-
return /* @__PURE__ */
|
|
4617
|
+
return /* @__PURE__ */ jsx40(
|
|
4551
4618
|
PopoverPrimitive2.Close,
|
|
4552
4619
|
{
|
|
4553
4620
|
"data-slot": "popover-close",
|
|
@@ -4558,27 +4625,27 @@ function PopoverClose({
|
|
|
4558
4625
|
}
|
|
4559
4626
|
);
|
|
4560
4627
|
}
|
|
4561
|
-
return /* @__PURE__ */
|
|
4628
|
+
return /* @__PURE__ */ jsx40(
|
|
4562
4629
|
PopoverPrimitive2.Close,
|
|
4563
4630
|
{
|
|
4564
4631
|
"data-slot": "popover-close",
|
|
4565
4632
|
"aria-label": closeLabel,
|
|
4566
4633
|
className: cn("ddga-popover__close", className),
|
|
4567
4634
|
...props,
|
|
4568
|
-
children: /* @__PURE__ */
|
|
4635
|
+
children: /* @__PURE__ */ jsx40(Close, { "aria-hidden": "true" })
|
|
4569
4636
|
}
|
|
4570
4637
|
);
|
|
4571
4638
|
}
|
|
4572
4639
|
|
|
4573
4640
|
// src/components/Sidebar/Sidebar.tsx
|
|
4574
|
-
import { useCallback as useCallback3, useEffect as useEffect2, useMemo as
|
|
4641
|
+
import { useCallback as useCallback3, useEffect as useEffect2, useMemo as useMemo4, useState as useState9 } from "react";
|
|
4575
4642
|
import { Slot as SlotPrimitive10 } from "radix-ui";
|
|
4576
4643
|
|
|
4577
4644
|
// src/components/Sidebar/SidebarContext.ts
|
|
4578
|
-
import { createContext as createContext3, useContext as
|
|
4645
|
+
import { createContext as createContext3, useContext as useContext11 } from "react";
|
|
4579
4646
|
var SidebarContext = createContext3(null);
|
|
4580
4647
|
function useSidebar() {
|
|
4581
|
-
const ctx =
|
|
4648
|
+
const ctx = useContext11(SidebarContext);
|
|
4582
4649
|
if (!ctx) {
|
|
4583
4650
|
throw new Error("useSidebar must be used within a <SidebarProvider>");
|
|
4584
4651
|
}
|
|
@@ -4600,7 +4667,7 @@ function useIsMobile(breakpoint = 768) {
|
|
|
4600
4667
|
}
|
|
4601
4668
|
|
|
4602
4669
|
// src/components/Sidebar/Sidebar.tsx
|
|
4603
|
-
import { jsx as
|
|
4670
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
4604
4671
|
function SidebarProvider({
|
|
4605
4672
|
defaultOpen = true,
|
|
4606
4673
|
open: openProp,
|
|
@@ -4647,11 +4714,11 @@ function SidebarProvider({
|
|
|
4647
4714
|
return () => window.removeEventListener("keydown", onKeyDown);
|
|
4648
4715
|
}, [keyboardShortcut, toggleSidebar]);
|
|
4649
4716
|
const state = open ? "expanded" : "collapsed";
|
|
4650
|
-
const value =
|
|
4717
|
+
const value = useMemo4(
|
|
4651
4718
|
() => ({ state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }),
|
|
4652
4719
|
[state, open, setOpen, openMobile, isMobile, toggleSidebar]
|
|
4653
4720
|
);
|
|
4654
|
-
return /* @__PURE__ */
|
|
4721
|
+
return /* @__PURE__ */ jsx41(SidebarContext.Provider, { value, children: /* @__PURE__ */ jsx41(
|
|
4655
4722
|
"div",
|
|
4656
4723
|
{
|
|
4657
4724
|
"data-slot": "sidebar-wrapper",
|
|
@@ -4673,7 +4740,7 @@ function Sidebar({
|
|
|
4673
4740
|
}) {
|
|
4674
4741
|
const { isMobile, openMobile, setOpenMobile, state } = useSidebar();
|
|
4675
4742
|
if (isMobile) {
|
|
4676
|
-
return /* @__PURE__ */
|
|
4743
|
+
return /* @__PURE__ */ jsx41(Drawer, { open: openMobile, onOpenChange: setOpenMobile, children: /* @__PURE__ */ jsx41(
|
|
4677
4744
|
DrawerContent,
|
|
4678
4745
|
{
|
|
4679
4746
|
side,
|
|
@@ -4683,11 +4750,12 @@ function Sidebar({
|
|
|
4683
4750
|
"data-variant": variant,
|
|
4684
4751
|
"data-side": side,
|
|
4685
4752
|
className: cn("ddga-sidebar", "ddga-sidebar--mobile", className),
|
|
4753
|
+
...props,
|
|
4686
4754
|
children
|
|
4687
4755
|
}
|
|
4688
4756
|
) });
|
|
4689
4757
|
}
|
|
4690
|
-
return /* @__PURE__ */
|
|
4758
|
+
return /* @__PURE__ */ jsx41(
|
|
4691
4759
|
"aside",
|
|
4692
4760
|
{
|
|
4693
4761
|
"data-slot": "sidebar",
|
|
@@ -4712,7 +4780,7 @@ function SidebarTrigger({
|
|
|
4712
4780
|
}) {
|
|
4713
4781
|
const { toggleSidebar, open, openMobile, isMobile } = useSidebar();
|
|
4714
4782
|
const Comp = asChild ? SlotPrimitive10.Slot : "button";
|
|
4715
|
-
return /* @__PURE__ */
|
|
4783
|
+
return /* @__PURE__ */ jsx41(
|
|
4716
4784
|
Comp,
|
|
4717
4785
|
{
|
|
4718
4786
|
type: asChild ? void 0 : "button",
|
|
@@ -4726,7 +4794,7 @@ function SidebarTrigger({
|
|
|
4726
4794
|
toggleSidebar();
|
|
4727
4795
|
},
|
|
4728
4796
|
...props,
|
|
4729
|
-
children: children ?? /* @__PURE__ */
|
|
4797
|
+
children: children ?? /* @__PURE__ */ jsx41(PanelLeft, { "aria-hidden": "true" })
|
|
4730
4798
|
}
|
|
4731
4799
|
);
|
|
4732
4800
|
}
|
|
@@ -4736,7 +4804,7 @@ function SidebarRail({
|
|
|
4736
4804
|
...props
|
|
4737
4805
|
}) {
|
|
4738
4806
|
const { toggleSidebar } = useSidebar();
|
|
4739
|
-
return /* @__PURE__ */
|
|
4807
|
+
return /* @__PURE__ */ jsx41(
|
|
4740
4808
|
"button",
|
|
4741
4809
|
{
|
|
4742
4810
|
type: "button",
|
|
@@ -4752,15 +4820,15 @@ function SidebarRail({
|
|
|
4752
4820
|
}
|
|
4753
4821
|
function SidebarInset({ asChild, className, ...props }) {
|
|
4754
4822
|
const Comp = asChild ? SlotPrimitive10.Slot : "main";
|
|
4755
|
-
return /* @__PURE__ */
|
|
4823
|
+
return /* @__PURE__ */ jsx41(Comp, { "data-slot": "sidebar-inset", className: cn("ddga-sidebar-inset", className), ...props });
|
|
4756
4824
|
}
|
|
4757
4825
|
function SidebarHeader({ asChild, className, ...props }) {
|
|
4758
4826
|
const Comp = asChild ? SlotPrimitive10.Slot : "div";
|
|
4759
|
-
return /* @__PURE__ */
|
|
4827
|
+
return /* @__PURE__ */ jsx41(Comp, { "data-slot": "sidebar-header", className: cn("ddga-sidebar__header", className), ...props });
|
|
4760
4828
|
}
|
|
4761
4829
|
function SidebarContent({ asChild, className, ...props }) {
|
|
4762
4830
|
const Comp = asChild ? SlotPrimitive10.Slot : "div";
|
|
4763
|
-
return /* @__PURE__ */
|
|
4831
|
+
return /* @__PURE__ */ jsx41(
|
|
4764
4832
|
Comp,
|
|
4765
4833
|
{
|
|
4766
4834
|
"data-slot": "sidebar-content",
|
|
@@ -4771,10 +4839,10 @@ function SidebarContent({ asChild, className, ...props }) {
|
|
|
4771
4839
|
}
|
|
4772
4840
|
function SidebarFooter({ asChild, className, ...props }) {
|
|
4773
4841
|
const Comp = asChild ? SlotPrimitive10.Slot : "div";
|
|
4774
|
-
return /* @__PURE__ */
|
|
4842
|
+
return /* @__PURE__ */ jsx41(Comp, { "data-slot": "sidebar-footer", className: cn("ddga-sidebar__footer", className), ...props });
|
|
4775
4843
|
}
|
|
4776
4844
|
function SidebarSeparator({ className, ...props }) {
|
|
4777
|
-
return /* @__PURE__ */
|
|
4845
|
+
return /* @__PURE__ */ jsx41(
|
|
4778
4846
|
"hr",
|
|
4779
4847
|
{
|
|
4780
4848
|
"data-slot": "sidebar-separator",
|
|
@@ -4786,10 +4854,10 @@ function SidebarSeparator({ className, ...props }) {
|
|
|
4786
4854
|
|
|
4787
4855
|
// src/components/Sidebar/SidebarGroup.tsx
|
|
4788
4856
|
import { Slot as SlotPrimitive11 } from "radix-ui";
|
|
4789
|
-
import { jsx as
|
|
4857
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4790
4858
|
function SidebarGroup({ asChild, className, ...props }) {
|
|
4791
4859
|
const Comp = asChild ? SlotPrimitive11.Slot : "div";
|
|
4792
|
-
return /* @__PURE__ */
|
|
4860
|
+
return /* @__PURE__ */ jsx42(
|
|
4793
4861
|
Comp,
|
|
4794
4862
|
{
|
|
4795
4863
|
"data-slot": "sidebar-group",
|
|
@@ -4801,7 +4869,7 @@ function SidebarGroup({ asChild, className, ...props }) {
|
|
|
4801
4869
|
}
|
|
4802
4870
|
function SidebarGroupLabel({ asChild, className, ...props }) {
|
|
4803
4871
|
const Comp = asChild ? SlotPrimitive11.Slot : "div";
|
|
4804
|
-
return /* @__PURE__ */
|
|
4872
|
+
return /* @__PURE__ */ jsx42(
|
|
4805
4873
|
Comp,
|
|
4806
4874
|
{
|
|
4807
4875
|
"data-slot": "sidebar-group-label",
|
|
@@ -4812,7 +4880,7 @@ function SidebarGroupLabel({ asChild, className, ...props }) {
|
|
|
4812
4880
|
}
|
|
4813
4881
|
function SidebarGroupAction({ asChild, className, ...props }) {
|
|
4814
4882
|
const Comp = asChild ? SlotPrimitive11.Slot : "button";
|
|
4815
|
-
return /* @__PURE__ */
|
|
4883
|
+
return /* @__PURE__ */ jsx42(
|
|
4816
4884
|
Comp,
|
|
4817
4885
|
{
|
|
4818
4886
|
type: asChild ? void 0 : "button",
|
|
@@ -4824,7 +4892,7 @@ function SidebarGroupAction({ asChild, className, ...props }) {
|
|
|
4824
4892
|
}
|
|
4825
4893
|
function SidebarGroupContent({ asChild, className, ...props }) {
|
|
4826
4894
|
const Comp = asChild ? SlotPrimitive11.Slot : "div";
|
|
4827
|
-
return /* @__PURE__ */
|
|
4895
|
+
return /* @__PURE__ */ jsx42(
|
|
4828
4896
|
Comp,
|
|
4829
4897
|
{
|
|
4830
4898
|
"data-slot": "sidebar-group-content",
|
|
@@ -4844,12 +4912,12 @@ function useDir() {
|
|
|
4844
4912
|
}
|
|
4845
4913
|
|
|
4846
4914
|
// src/components/Sidebar/SidebarMenu.tsx
|
|
4847
|
-
import { jsx as
|
|
4915
|
+
import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4848
4916
|
function SidebarMenu({ className, ...props }) {
|
|
4849
|
-
return /* @__PURE__ */
|
|
4917
|
+
return /* @__PURE__ */ jsx43("ul", { "data-slot": "sidebar-menu", className: cn("ddga-sidebar__menu", className), ...props });
|
|
4850
4918
|
}
|
|
4851
4919
|
function SidebarMenuItem({ className, ...props }) {
|
|
4852
|
-
return /* @__PURE__ */
|
|
4920
|
+
return /* @__PURE__ */ jsx43(
|
|
4853
4921
|
"li",
|
|
4854
4922
|
{
|
|
4855
4923
|
"data-slot": "sidebar-menu-item",
|
|
@@ -4879,7 +4947,7 @@ function SidebarMenuButton({
|
|
|
4879
4947
|
const { state, isMobile } = useSidebar();
|
|
4880
4948
|
const dir = useDir();
|
|
4881
4949
|
const Comp = asChild ? SlotPrimitive12.Slot : "button";
|
|
4882
|
-
const button = /* @__PURE__ */
|
|
4950
|
+
const button = /* @__PURE__ */ jsx43(
|
|
4883
4951
|
Comp,
|
|
4884
4952
|
{
|
|
4885
4953
|
type: asChild ? void 0 : "button",
|
|
@@ -4894,14 +4962,14 @@ function SidebarMenuButton({
|
|
|
4894
4962
|
if (!tooltip || state !== "collapsed" || isMobile) {
|
|
4895
4963
|
return button;
|
|
4896
4964
|
}
|
|
4897
|
-
return /* @__PURE__ */
|
|
4898
|
-
/* @__PURE__ */
|
|
4899
|
-
/* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ jsxs32(Tooltip, { children: [
|
|
4966
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx43("span", { "data-slot": "tooltip-trigger", style: { display: "contents" }, children: button }) }),
|
|
4967
|
+
/* @__PURE__ */ jsx43(TooltipContent, { side: dir === "rtl" ? "left" : "right", children: tooltip })
|
|
4900
4968
|
] });
|
|
4901
4969
|
}
|
|
4902
4970
|
function SidebarMenuAction({ asChild, showOnHover, className, ...props }) {
|
|
4903
4971
|
const Comp = asChild ? SlotPrimitive12.Slot : "button";
|
|
4904
|
-
return /* @__PURE__ */
|
|
4972
|
+
return /* @__PURE__ */ jsx43(
|
|
4905
4973
|
Comp,
|
|
4906
4974
|
{
|
|
4907
4975
|
type: asChild ? void 0 : "button",
|
|
@@ -4913,7 +4981,7 @@ function SidebarMenuAction({ asChild, showOnHover, className, ...props }) {
|
|
|
4913
4981
|
);
|
|
4914
4982
|
}
|
|
4915
4983
|
function SidebarMenuBadge({ className, ...props }) {
|
|
4916
|
-
return /* @__PURE__ */
|
|
4984
|
+
return /* @__PURE__ */ jsx43(
|
|
4917
4985
|
"span",
|
|
4918
4986
|
{
|
|
4919
4987
|
"data-slot": "sidebar-menu-badge",
|
|
@@ -4923,21 +4991,21 @@ function SidebarMenuBadge({ className, ...props }) {
|
|
|
4923
4991
|
);
|
|
4924
4992
|
}
|
|
4925
4993
|
function SidebarMenuSkeleton({ showIcon, className, ...props }) {
|
|
4926
|
-
return /* @__PURE__ */
|
|
4994
|
+
return /* @__PURE__ */ jsxs32(
|
|
4927
4995
|
"div",
|
|
4928
4996
|
{
|
|
4929
4997
|
"data-slot": "sidebar-menu-skeleton",
|
|
4930
4998
|
className: cn("ddga-sidebar__menu-skeleton", className),
|
|
4931
4999
|
...props,
|
|
4932
5000
|
children: [
|
|
4933
|
-
showIcon ? /* @__PURE__ */
|
|
4934
|
-
/* @__PURE__ */
|
|
5001
|
+
showIcon ? /* @__PURE__ */ jsx43(Skeleton, { shape: "circle", width: "1rem", height: "1rem" }) : null,
|
|
5002
|
+
/* @__PURE__ */ jsx43(Skeleton, { shape: "text", className: "ddga-sidebar__menu-skeleton-text" })
|
|
4935
5003
|
]
|
|
4936
5004
|
}
|
|
4937
5005
|
);
|
|
4938
5006
|
}
|
|
4939
5007
|
function SidebarMenuSub({ className, ...props }) {
|
|
4940
|
-
return /* @__PURE__ */
|
|
5008
|
+
return /* @__PURE__ */ jsx43(
|
|
4941
5009
|
"ul",
|
|
4942
5010
|
{
|
|
4943
5011
|
"data-slot": "sidebar-menu-sub",
|
|
@@ -4947,7 +5015,7 @@ function SidebarMenuSub({ className, ...props }) {
|
|
|
4947
5015
|
);
|
|
4948
5016
|
}
|
|
4949
5017
|
function SidebarMenuSubItem({ className, ...props }) {
|
|
4950
|
-
return /* @__PURE__ */
|
|
5018
|
+
return /* @__PURE__ */ jsx43(
|
|
4951
5019
|
"li",
|
|
4952
5020
|
{
|
|
4953
5021
|
"data-slot": "sidebar-menu-sub-item",
|
|
@@ -4973,7 +5041,7 @@ function SidebarMenuSubButton({
|
|
|
4973
5041
|
...props
|
|
4974
5042
|
}) {
|
|
4975
5043
|
const Comp = asChild ? SlotPrimitive12.Slot : "a";
|
|
4976
|
-
return /* @__PURE__ */
|
|
5044
|
+
return /* @__PURE__ */ jsx43(
|
|
4977
5045
|
Comp,
|
|
4978
5046
|
{
|
|
4979
5047
|
"data-slot": "sidebar-menu-sub-button",
|
|
@@ -4989,7 +5057,7 @@ function SidebarMenuSubButton({
|
|
|
4989
5057
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
4990
5058
|
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
4991
5059
|
import { cva as cva38 } from "class-variance-authority";
|
|
4992
|
-
import { jsx as
|
|
5060
|
+
import { jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4993
5061
|
var scrollAreaVariants = cva38("ddga-scroll-area", {
|
|
4994
5062
|
variants: {
|
|
4995
5063
|
orientation: {
|
|
@@ -5026,7 +5094,7 @@ function ScrollArea({
|
|
|
5026
5094
|
const showVertical = orientation === "vertical" || orientation === "both";
|
|
5027
5095
|
const showHorizontal = orientation === "horizontal" || orientation === "both";
|
|
5028
5096
|
const { className: viewportClassName, ...restViewportProps } = viewportProps ?? {};
|
|
5029
|
-
return /* @__PURE__ */
|
|
5097
|
+
return /* @__PURE__ */ jsxs33(
|
|
5030
5098
|
ScrollAreaPrimitive.Root,
|
|
5031
5099
|
{
|
|
5032
5100
|
"data-slot": "scroll-area",
|
|
@@ -5035,7 +5103,7 @@ function ScrollArea({
|
|
|
5035
5103
|
className: cn(scrollAreaVariants({ orientation }), className),
|
|
5036
5104
|
...props,
|
|
5037
5105
|
children: [
|
|
5038
|
-
/* @__PURE__ */
|
|
5106
|
+
/* @__PURE__ */ jsx44(
|
|
5039
5107
|
ScrollAreaPrimitive.Viewport,
|
|
5040
5108
|
{
|
|
5041
5109
|
"data-slot": "scroll-area-viewport",
|
|
@@ -5049,35 +5117,35 @@ function ScrollArea({
|
|
|
5049
5117
|
children
|
|
5050
5118
|
}
|
|
5051
5119
|
),
|
|
5052
|
-
showVertical ? /* @__PURE__ */
|
|
5120
|
+
showVertical ? /* @__PURE__ */ jsx44(
|
|
5053
5121
|
ScrollAreaPrimitive.Scrollbar,
|
|
5054
5122
|
{
|
|
5055
5123
|
"data-slot": "scroll-area-scrollbar",
|
|
5056
5124
|
orientation: "vertical",
|
|
5057
5125
|
className: "ddga-scroll-area__scrollbar",
|
|
5058
|
-
children: /* @__PURE__ */
|
|
5126
|
+
children: /* @__PURE__ */ jsx44(ScrollAreaPrimitive.Thumb, { className: "ddga-scroll-area__thumb" })
|
|
5059
5127
|
}
|
|
5060
5128
|
) : null,
|
|
5061
|
-
showHorizontal ? /* @__PURE__ */
|
|
5129
|
+
showHorizontal ? /* @__PURE__ */ jsx44(
|
|
5062
5130
|
ScrollAreaPrimitive.Scrollbar,
|
|
5063
5131
|
{
|
|
5064
5132
|
"data-slot": "scroll-area-scrollbar",
|
|
5065
5133
|
orientation: "horizontal",
|
|
5066
5134
|
className: "ddga-scroll-area__scrollbar",
|
|
5067
|
-
children: /* @__PURE__ */
|
|
5135
|
+
children: /* @__PURE__ */ jsx44(ScrollAreaPrimitive.Thumb, { className: "ddga-scroll-area__thumb" })
|
|
5068
5136
|
}
|
|
5069
5137
|
) : null,
|
|
5070
|
-
orientation === "both" ? /* @__PURE__ */
|
|
5138
|
+
orientation === "both" ? /* @__PURE__ */ jsx44(ScrollAreaPrimitive.Corner, { className: "ddga-scroll-area__corner" }) : null
|
|
5071
5139
|
]
|
|
5072
5140
|
}
|
|
5073
5141
|
);
|
|
5074
5142
|
}
|
|
5075
5143
|
|
|
5076
5144
|
// src/components/Menubar/Menubar.tsx
|
|
5077
|
-
import { useContext as
|
|
5145
|
+
import { useContext as useContext12 } from "react";
|
|
5078
5146
|
import { Menubar as MenubarPrimitive } from "radix-ui";
|
|
5079
5147
|
import { cva as cva39 } from "class-variance-authority";
|
|
5080
|
-
import { jsx as
|
|
5148
|
+
import { jsx as jsx45, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5081
5149
|
var menubarContentVariants = cva39("ddga-menubar-menu", {
|
|
5082
5150
|
variants: {
|
|
5083
5151
|
size: {
|
|
@@ -5101,7 +5169,7 @@ var menubarTriggerVariants = cva39("ddga-menubar__trigger", {
|
|
|
5101
5169
|
}
|
|
5102
5170
|
});
|
|
5103
5171
|
function Menubar({ className, ...props }) {
|
|
5104
|
-
return /* @__PURE__ */
|
|
5172
|
+
return /* @__PURE__ */ jsx45(
|
|
5105
5173
|
MenubarPrimitive.Root,
|
|
5106
5174
|
{
|
|
5107
5175
|
"data-slot": "menubar",
|
|
@@ -5111,10 +5179,10 @@ function Menubar({ className, ...props }) {
|
|
|
5111
5179
|
);
|
|
5112
5180
|
}
|
|
5113
5181
|
function MenubarMenu(props) {
|
|
5114
|
-
return /* @__PURE__ */
|
|
5182
|
+
return /* @__PURE__ */ jsx45(MenubarPrimitive.Menu, { ...props });
|
|
5115
5183
|
}
|
|
5116
5184
|
function MenubarTrigger({ variant, className, ...props }) {
|
|
5117
|
-
return /* @__PURE__ */
|
|
5185
|
+
return /* @__PURE__ */ jsx45(
|
|
5118
5186
|
MenubarPrimitive.Trigger,
|
|
5119
5187
|
{
|
|
5120
5188
|
"data-slot": "menubar-trigger",
|
|
@@ -5125,9 +5193,9 @@ function MenubarTrigger({ variant, className, ...props }) {
|
|
|
5125
5193
|
);
|
|
5126
5194
|
}
|
|
5127
5195
|
function MenubarContent({ size, className, sideOffset = 6, ...props }) {
|
|
5128
|
-
const ctx =
|
|
5196
|
+
const ctx = useContext12(DgaContext);
|
|
5129
5197
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
5130
|
-
return /* @__PURE__ */
|
|
5198
|
+
return /* @__PURE__ */ jsx45(MenubarPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx45(
|
|
5131
5199
|
MenubarPrimitive.Content,
|
|
5132
5200
|
{
|
|
5133
5201
|
"data-slot": "menubar-content",
|
|
@@ -5145,7 +5213,7 @@ function MenubarItem({
|
|
|
5145
5213
|
children,
|
|
5146
5214
|
...props
|
|
5147
5215
|
}) {
|
|
5148
|
-
return /* @__PURE__ */
|
|
5216
|
+
return /* @__PURE__ */ jsxs34(
|
|
5149
5217
|
MenubarPrimitive.Item,
|
|
5150
5218
|
{
|
|
5151
5219
|
"data-slot": "menubar-item",
|
|
@@ -5153,9 +5221,9 @@ function MenubarItem({
|
|
|
5153
5221
|
className: cn("ddga-menubar-menu__item", className),
|
|
5154
5222
|
...props,
|
|
5155
5223
|
children: [
|
|
5156
|
-
startIcon ? /* @__PURE__ */
|
|
5157
|
-
/* @__PURE__ */
|
|
5158
|
-
shortcut ? /* @__PURE__ */
|
|
5224
|
+
startIcon ? /* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__icon", "aria-hidden": "true", children: startIcon }) : null,
|
|
5225
|
+
/* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__label", children }),
|
|
5226
|
+
shortcut ? /* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__shortcut", "aria-hidden": "true", children: shortcut }) : null
|
|
5159
5227
|
]
|
|
5160
5228
|
}
|
|
5161
5229
|
);
|
|
@@ -5169,7 +5237,7 @@ function MenubarCheckboxItem({
|
|
|
5169
5237
|
const handleSelect = onSelect ?? ((event) => {
|
|
5170
5238
|
event.preventDefault();
|
|
5171
5239
|
});
|
|
5172
|
-
return /* @__PURE__ */
|
|
5240
|
+
return /* @__PURE__ */ jsxs34(
|
|
5173
5241
|
MenubarPrimitive.CheckboxItem,
|
|
5174
5242
|
{
|
|
5175
5243
|
"data-slot": "menubar-checkbox-item",
|
|
@@ -5177,20 +5245,20 @@ function MenubarCheckboxItem({
|
|
|
5177
5245
|
onSelect: handleSelect,
|
|
5178
5246
|
...props,
|
|
5179
5247
|
children: [
|
|
5180
|
-
/* @__PURE__ */
|
|
5181
|
-
/* @__PURE__ */
|
|
5248
|
+
/* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx45(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx45(Check, { className: "ddga-menubar-menu__indicator-icon" }) }) }),
|
|
5249
|
+
/* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__label", children })
|
|
5182
5250
|
]
|
|
5183
5251
|
}
|
|
5184
5252
|
);
|
|
5185
5253
|
}
|
|
5186
5254
|
function MenubarRadioGroup(props) {
|
|
5187
|
-
return /* @__PURE__ */
|
|
5255
|
+
return /* @__PURE__ */ jsx45(MenubarPrimitive.RadioGroup, { "data-slot": "menubar-radio-group", ...props });
|
|
5188
5256
|
}
|
|
5189
5257
|
function MenubarRadioItem({ className, children, onSelect, ...props }) {
|
|
5190
5258
|
const handleSelect = onSelect ?? ((event) => {
|
|
5191
5259
|
event.preventDefault();
|
|
5192
5260
|
});
|
|
5193
|
-
return /* @__PURE__ */
|
|
5261
|
+
return /* @__PURE__ */ jsxs34(
|
|
5194
5262
|
MenubarPrimitive.RadioItem,
|
|
5195
5263
|
{
|
|
5196
5264
|
"data-slot": "menubar-radio-item",
|
|
@@ -5198,14 +5266,14 @@ function MenubarRadioItem({ className, children, onSelect, ...props }) {
|
|
|
5198
5266
|
onSelect: handleSelect,
|
|
5199
5267
|
...props,
|
|
5200
5268
|
children: [
|
|
5201
|
-
/* @__PURE__ */
|
|
5202
|
-
/* @__PURE__ */
|
|
5269
|
+
/* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx45(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__radio-dot" }) }) }),
|
|
5270
|
+
/* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__label", children })
|
|
5203
5271
|
]
|
|
5204
5272
|
}
|
|
5205
5273
|
);
|
|
5206
5274
|
}
|
|
5207
5275
|
function MenubarLabel({ className, ...props }) {
|
|
5208
|
-
return /* @__PURE__ */
|
|
5276
|
+
return /* @__PURE__ */ jsx45(
|
|
5209
5277
|
MenubarPrimitive.Label,
|
|
5210
5278
|
{
|
|
5211
5279
|
"data-slot": "menubar-label",
|
|
@@ -5215,7 +5283,7 @@ function MenubarLabel({ className, ...props }) {
|
|
|
5215
5283
|
);
|
|
5216
5284
|
}
|
|
5217
5285
|
function MenubarSeparator({ className, ...props }) {
|
|
5218
|
-
return /* @__PURE__ */
|
|
5286
|
+
return /* @__PURE__ */ jsx45(
|
|
5219
5287
|
MenubarPrimitive.Separator,
|
|
5220
5288
|
{
|
|
5221
5289
|
"data-slot": "menubar-separator",
|
|
@@ -5225,30 +5293,30 @@ function MenubarSeparator({ className, ...props }) {
|
|
|
5225
5293
|
);
|
|
5226
5294
|
}
|
|
5227
5295
|
function MenubarGroup(props) {
|
|
5228
|
-
return /* @__PURE__ */
|
|
5296
|
+
return /* @__PURE__ */ jsx45(MenubarPrimitive.Group, { "data-slot": "menubar-group", ...props });
|
|
5229
5297
|
}
|
|
5230
5298
|
function MenubarSub(props) {
|
|
5231
|
-
return /* @__PURE__ */
|
|
5299
|
+
return /* @__PURE__ */ jsx45(MenubarPrimitive.Sub, { ...props });
|
|
5232
5300
|
}
|
|
5233
5301
|
function MenubarSubTrigger({ className, startIcon, children, ...props }) {
|
|
5234
|
-
return /* @__PURE__ */
|
|
5302
|
+
return /* @__PURE__ */ jsxs34(
|
|
5235
5303
|
MenubarPrimitive.SubTrigger,
|
|
5236
5304
|
{
|
|
5237
5305
|
"data-slot": "menubar-sub-trigger",
|
|
5238
5306
|
className: cn("ddga-menubar-menu__item", "ddga-menubar-menu__item--sub", className),
|
|
5239
5307
|
...props,
|
|
5240
5308
|
children: [
|
|
5241
|
-
startIcon ? /* @__PURE__ */
|
|
5242
|
-
/* @__PURE__ */
|
|
5243
|
-
/* @__PURE__ */
|
|
5309
|
+
startIcon ? /* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__icon", "aria-hidden": "true", children: startIcon }) : null,
|
|
5310
|
+
/* @__PURE__ */ jsx45("span", { className: "ddga-menubar-menu__label", children }),
|
|
5311
|
+
/* @__PURE__ */ jsx45(ChevronRight, { className: "ddga-menubar-menu__sub-chevron", "aria-hidden": "true" })
|
|
5244
5312
|
]
|
|
5245
5313
|
}
|
|
5246
5314
|
);
|
|
5247
5315
|
}
|
|
5248
5316
|
function MenubarSubContent({ size, className, ...props }) {
|
|
5249
|
-
const ctx =
|
|
5317
|
+
const ctx = useContext12(DgaContext);
|
|
5250
5318
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
5251
|
-
return /* @__PURE__ */
|
|
5319
|
+
return /* @__PURE__ */ jsx45(MenubarPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx45(
|
|
5252
5320
|
MenubarPrimitive.SubContent,
|
|
5253
5321
|
{
|
|
5254
5322
|
"data-slot": "menubar-sub-content",
|
|
@@ -5260,7 +5328,7 @@ function MenubarSubContent({ size, className, ...props }) {
|
|
|
5260
5328
|
|
|
5261
5329
|
// src/components/Timeline/Timeline.tsx
|
|
5262
5330
|
import { cva as cva40 } from "class-variance-authority";
|
|
5263
|
-
import { jsx as
|
|
5331
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
5264
5332
|
var timelineVariants = cva40("ddga-timeline", {
|
|
5265
5333
|
variants: {
|
|
5266
5334
|
size: {
|
|
@@ -5292,7 +5360,7 @@ var timelineMarkerVariants = cva40("ddga-timeline__marker", {
|
|
|
5292
5360
|
}
|
|
5293
5361
|
});
|
|
5294
5362
|
function Timeline({ size, orientation, className, ...props }) {
|
|
5295
|
-
return /* @__PURE__ */
|
|
5363
|
+
return /* @__PURE__ */ jsx46(
|
|
5296
5364
|
"ol",
|
|
5297
5365
|
{
|
|
5298
5366
|
"data-slot": "timeline",
|
|
@@ -5303,12 +5371,12 @@ function Timeline({ size, orientation, className, ...props }) {
|
|
|
5303
5371
|
);
|
|
5304
5372
|
}
|
|
5305
5373
|
function TimelineItem({ className, ...props }) {
|
|
5306
|
-
return /* @__PURE__ */
|
|
5374
|
+
return /* @__PURE__ */ jsx46("li", { "data-slot": "timeline-item", className: cn("ddga-timeline__item", className), ...props });
|
|
5307
5375
|
}
|
|
5308
5376
|
function TimelineMarker({ status, className, children, ...props }) {
|
|
5309
5377
|
const resolved = status ?? "default";
|
|
5310
5378
|
const reached = resolved !== "default";
|
|
5311
|
-
return /* @__PURE__ */
|
|
5379
|
+
return /* @__PURE__ */ jsx46(
|
|
5312
5380
|
"span",
|
|
5313
5381
|
{
|
|
5314
5382
|
"aria-hidden": "true",
|
|
@@ -5317,12 +5385,12 @@ function TimelineMarker({ status, className, children, ...props }) {
|
|
|
5317
5385
|
"data-reached": reached ? "" : void 0,
|
|
5318
5386
|
className: cn(timelineMarkerVariants({ status }), className),
|
|
5319
5387
|
...props,
|
|
5320
|
-
children: children ?? /* @__PURE__ */
|
|
5388
|
+
children: children ?? /* @__PURE__ */ jsx46("span", { className: "ddga-timeline__dot" })
|
|
5321
5389
|
}
|
|
5322
5390
|
);
|
|
5323
5391
|
}
|
|
5324
5392
|
function TimelineContent({ className, ...props }) {
|
|
5325
|
-
return /* @__PURE__ */
|
|
5393
|
+
return /* @__PURE__ */ jsx46(
|
|
5326
5394
|
"div",
|
|
5327
5395
|
{
|
|
5328
5396
|
"data-slot": "timeline-content",
|
|
@@ -5332,10 +5400,10 @@ function TimelineContent({ className, ...props }) {
|
|
|
5332
5400
|
);
|
|
5333
5401
|
}
|
|
5334
5402
|
function TimelineTitle({ className, ...props }) {
|
|
5335
|
-
return /* @__PURE__ */
|
|
5403
|
+
return /* @__PURE__ */ jsx46("span", { "data-slot": "timeline-title", className: cn("ddga-timeline__title", className), ...props });
|
|
5336
5404
|
}
|
|
5337
5405
|
function TimelineDescription({ className, ...props }) {
|
|
5338
|
-
return /* @__PURE__ */
|
|
5406
|
+
return /* @__PURE__ */ jsx46(
|
|
5339
5407
|
"span",
|
|
5340
5408
|
{
|
|
5341
5409
|
"data-slot": "timeline-description",
|
|
@@ -5345,18 +5413,18 @@ function TimelineDescription({ className, ...props }) {
|
|
|
5345
5413
|
);
|
|
5346
5414
|
}
|
|
5347
5415
|
function TimelineTime({ className, ...props }) {
|
|
5348
|
-
return /* @__PURE__ */
|
|
5416
|
+
return /* @__PURE__ */ jsx46("time", { "data-slot": "timeline-time", className: cn("ddga-timeline__time", className), ...props });
|
|
5349
5417
|
}
|
|
5350
5418
|
|
|
5351
5419
|
// src/components/Command/Command.tsx
|
|
5352
|
-
import { useCallback as useCallback4, useContext as
|
|
5420
|
+
import { useCallback as useCallback4, useContext as useContext13, useEffect as useEffect3, useRef as useRef3, useState as useState10 } from "react";
|
|
5353
5421
|
import { Command as CommandPrimitive } from "cmdk";
|
|
5354
5422
|
import { Dialog as DialogPrimitive3, VisuallyHidden } from "radix-ui";
|
|
5355
5423
|
import { cva as cva41 } from "class-variance-authority";
|
|
5356
|
-
import { jsx as
|
|
5424
|
+
import { jsx as jsx47, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5357
5425
|
var commandVariants = cva41("ddga-command");
|
|
5358
5426
|
function Command2({ className, ...props }) {
|
|
5359
|
-
return /* @__PURE__ */
|
|
5427
|
+
return /* @__PURE__ */ jsx47(CommandPrimitive, { "data-slot": "command", className: cn(commandVariants(), className), ...props });
|
|
5360
5428
|
}
|
|
5361
5429
|
function CommandInput({
|
|
5362
5430
|
className,
|
|
@@ -5364,9 +5432,9 @@ function CommandInput({
|
|
|
5364
5432
|
"aria-label": ariaLabel,
|
|
5365
5433
|
...props
|
|
5366
5434
|
}) {
|
|
5367
|
-
return /* @__PURE__ */
|
|
5368
|
-
/* @__PURE__ */
|
|
5369
|
-
/* @__PURE__ */
|
|
5435
|
+
return /* @__PURE__ */ jsxs35("div", { className: "ddga-command__input-wrapper", "data-slot": "command-input-wrapper", children: [
|
|
5436
|
+
/* @__PURE__ */ jsx47(Search, { className: "ddga-command__search-icon", "aria-hidden": "true" }),
|
|
5437
|
+
/* @__PURE__ */ jsx47(
|
|
5370
5438
|
CommandPrimitive.Input,
|
|
5371
5439
|
{
|
|
5372
5440
|
"data-slot": "command-input",
|
|
@@ -5379,7 +5447,7 @@ function CommandInput({
|
|
|
5379
5447
|
] });
|
|
5380
5448
|
}
|
|
5381
5449
|
function CommandList({ className, ...props }) {
|
|
5382
|
-
return /* @__PURE__ */
|
|
5450
|
+
return /* @__PURE__ */ jsx47(
|
|
5383
5451
|
CommandPrimitive.List,
|
|
5384
5452
|
{
|
|
5385
5453
|
"data-slot": "command-list",
|
|
@@ -5389,7 +5457,7 @@ function CommandList({ className, ...props }) {
|
|
|
5389
5457
|
);
|
|
5390
5458
|
}
|
|
5391
5459
|
function CommandEmpty({ className, ...props }) {
|
|
5392
|
-
return /* @__PURE__ */
|
|
5460
|
+
return /* @__PURE__ */ jsx47(
|
|
5393
5461
|
CommandPrimitive.Empty,
|
|
5394
5462
|
{
|
|
5395
5463
|
"data-slot": "command-empty",
|
|
@@ -5399,7 +5467,7 @@ function CommandEmpty({ className, ...props }) {
|
|
|
5399
5467
|
);
|
|
5400
5468
|
}
|
|
5401
5469
|
function CommandGroup({ className, ...props }) {
|
|
5402
|
-
return /* @__PURE__ */
|
|
5470
|
+
return /* @__PURE__ */ jsx47(
|
|
5403
5471
|
CommandPrimitive.Group,
|
|
5404
5472
|
{
|
|
5405
5473
|
"data-slot": "command-group",
|
|
@@ -5413,7 +5481,7 @@ function CommandSeparator({
|
|
|
5413
5481
|
"aria-hidden": ariaHidden = true,
|
|
5414
5482
|
...props
|
|
5415
5483
|
}) {
|
|
5416
|
-
return /* @__PURE__ */
|
|
5484
|
+
return /* @__PURE__ */ jsx47(
|
|
5417
5485
|
CommandPrimitive.Separator,
|
|
5418
5486
|
{
|
|
5419
5487
|
"aria-hidden": ariaHidden,
|
|
@@ -5433,7 +5501,7 @@ function CommandItem({
|
|
|
5433
5501
|
}) {
|
|
5434
5502
|
const labelText = typeof children === "string" ? children : void 0;
|
|
5435
5503
|
const mergedKeywords = labelText && !keywords?.includes(labelText) ? [...keywords ?? [], labelText] : keywords;
|
|
5436
|
-
return /* @__PURE__ */
|
|
5504
|
+
return /* @__PURE__ */ jsxs35(
|
|
5437
5505
|
CommandPrimitive.Item,
|
|
5438
5506
|
{
|
|
5439
5507
|
"data-slot": "command-item",
|
|
@@ -5441,9 +5509,9 @@ function CommandItem({
|
|
|
5441
5509
|
keywords: mergedKeywords,
|
|
5442
5510
|
...props,
|
|
5443
5511
|
children: [
|
|
5444
|
-
startIcon != null && /* @__PURE__ */
|
|
5445
|
-
/* @__PURE__ */
|
|
5446
|
-
shortcut != null && /* @__PURE__ */
|
|
5512
|
+
startIcon != null && /* @__PURE__ */ jsx47("span", { className: "ddga-command__item-icon", "aria-hidden": "true", children: startIcon }),
|
|
5513
|
+
/* @__PURE__ */ jsx47("span", { className: "ddga-command__item-label", children }),
|
|
5514
|
+
shortcut != null && /* @__PURE__ */ jsx47("span", { className: "ddga-command__item-shortcut", children: shortcut })
|
|
5447
5515
|
]
|
|
5448
5516
|
}
|
|
5449
5517
|
);
|
|
@@ -5487,20 +5555,20 @@ function CommandDialog({
|
|
|
5487
5555
|
document.addEventListener("keydown", onKeyDown);
|
|
5488
5556
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
5489
5557
|
}, [shortcut, setOpen]);
|
|
5490
|
-
const ctx =
|
|
5558
|
+
const ctx = useContext13(DgaContext);
|
|
5491
5559
|
const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? void 0;
|
|
5492
|
-
return /* @__PURE__ */
|
|
5493
|
-
/* @__PURE__ */
|
|
5494
|
-
/* @__PURE__ */
|
|
5560
|
+
return /* @__PURE__ */ jsx47(DialogPrimitive3.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs35(DialogPrimitive3.Portal, { container: portalContainer, children: [
|
|
5561
|
+
/* @__PURE__ */ jsx47(DialogPrimitive3.Overlay, { className: "ddga-command__overlay", "data-slot": "command-overlay" }),
|
|
5562
|
+
/* @__PURE__ */ jsxs35(
|
|
5495
5563
|
DialogPrimitive3.Content,
|
|
5496
5564
|
{
|
|
5497
5565
|
"data-slot": "command-dialog",
|
|
5498
5566
|
className: cn("ddga-command-dialog", className),
|
|
5499
5567
|
...description == null ? { "aria-describedby": void 0 } : {},
|
|
5500
5568
|
children: [
|
|
5501
|
-
/* @__PURE__ */
|
|
5502
|
-
description != null && /* @__PURE__ */
|
|
5503
|
-
/* @__PURE__ */
|
|
5569
|
+
/* @__PURE__ */ jsx47(DialogPrimitive3.Title, { asChild: true, children: /* @__PURE__ */ jsx47(VisuallyHidden.Root, { children: label }) }),
|
|
5570
|
+
description != null && /* @__PURE__ */ jsx47(DialogPrimitive3.Description, { asChild: true, children: /* @__PURE__ */ jsx47(VisuallyHidden.Root, { children: description }) }),
|
|
5571
|
+
/* @__PURE__ */ jsx47(
|
|
5504
5572
|
Command2,
|
|
5505
5573
|
{
|
|
5506
5574
|
"data-slot": "command-dialog-command",
|
|
@@ -5520,7 +5588,7 @@ function CommandDialog({
|
|
|
5520
5588
|
|
|
5521
5589
|
// src/components/Table/Table.tsx
|
|
5522
5590
|
import { cva as cva42 } from "class-variance-authority";
|
|
5523
|
-
import { Fragment as Fragment6, jsx as
|
|
5591
|
+
import { Fragment as Fragment6, jsx as jsx48, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5524
5592
|
var tableVariants = cva42("ddga-table", {
|
|
5525
5593
|
variants: {
|
|
5526
5594
|
size: {
|
|
@@ -5560,7 +5628,7 @@ function Table({
|
|
|
5560
5628
|
"[ddga] <Table> received both `aria-label` and `aria-labelledby`. `aria-labelledby` takes precedence; `aria-label` will be ignored by assistive technology."
|
|
5561
5629
|
);
|
|
5562
5630
|
}
|
|
5563
|
-
return /* @__PURE__ */
|
|
5631
|
+
return /* @__PURE__ */ jsx48(
|
|
5564
5632
|
"div",
|
|
5565
5633
|
{
|
|
5566
5634
|
"data-slot": "table-region",
|
|
@@ -5572,7 +5640,7 @@ function Table({
|
|
|
5572
5640
|
"aria-label": ariaLabel,
|
|
5573
5641
|
"aria-labelledby": ariaLabelledby
|
|
5574
5642
|
} : {},
|
|
5575
|
-
children: /* @__PURE__ */
|
|
5643
|
+
children: /* @__PURE__ */ jsx48(
|
|
5576
5644
|
"table",
|
|
5577
5645
|
{
|
|
5578
5646
|
"data-slot": "table",
|
|
@@ -5584,16 +5652,16 @@ function Table({
|
|
|
5584
5652
|
);
|
|
5585
5653
|
}
|
|
5586
5654
|
function TableHeader({ className, ...props }) {
|
|
5587
|
-
return /* @__PURE__ */
|
|
5655
|
+
return /* @__PURE__ */ jsx48("thead", { "data-slot": "table-header", className: cn("ddga-table__header", className), ...props });
|
|
5588
5656
|
}
|
|
5589
5657
|
function TableBody({ className, ...props }) {
|
|
5590
|
-
return /* @__PURE__ */
|
|
5658
|
+
return /* @__PURE__ */ jsx48("tbody", { "data-slot": "table-body", className: cn("ddga-table__body", className), ...props });
|
|
5591
5659
|
}
|
|
5592
5660
|
function TableFooter({ className, ...props }) {
|
|
5593
|
-
return /* @__PURE__ */
|
|
5661
|
+
return /* @__PURE__ */ jsx48("tfoot", { "data-slot": "table-footer", className: cn("ddga-table__footer", className), ...props });
|
|
5594
5662
|
}
|
|
5595
5663
|
function TableRow({ className, selected, ...props }) {
|
|
5596
|
-
return /* @__PURE__ */
|
|
5664
|
+
return /* @__PURE__ */ jsx48(
|
|
5597
5665
|
"tr",
|
|
5598
5666
|
{
|
|
5599
5667
|
"data-slot": "table-row",
|
|
@@ -5620,10 +5688,10 @@ function TableHead({
|
|
|
5620
5688
|
);
|
|
5621
5689
|
}
|
|
5622
5690
|
if (!sortable) {
|
|
5623
|
-
return /* @__PURE__ */
|
|
5691
|
+
return /* @__PURE__ */ jsx48("th", { scope: "col", "data-slot": "table-head", className: headClass, ...props, children });
|
|
5624
5692
|
}
|
|
5625
5693
|
const ariaSort = sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : "none";
|
|
5626
|
-
return /* @__PURE__ */
|
|
5694
|
+
return /* @__PURE__ */ jsx48("th", { scope: "col", "data-slot": "table-head", "aria-sort": ariaSort, className: headClass, ...props, children: /* @__PURE__ */ jsxs36(
|
|
5627
5695
|
"button",
|
|
5628
5696
|
{
|
|
5629
5697
|
type: "button",
|
|
@@ -5632,12 +5700,12 @@ function TableHead({
|
|
|
5632
5700
|
onClick,
|
|
5633
5701
|
children: [
|
|
5634
5702
|
children,
|
|
5635
|
-
sortLabel ? /* @__PURE__ */
|
|
5636
|
-
/* @__PURE__ */
|
|
5703
|
+
sortLabel ? /* @__PURE__ */ jsx48("span", { className: "ddga-sr-only", children: sortLabel }) : null,
|
|
5704
|
+
/* @__PURE__ */ jsx48("span", { className: "ddga-table__sort-icon", "data-slot": "table-sort-icon", "aria-hidden": "true", children: sortDirection === "asc" ? /* @__PURE__ */ jsx48(CaretUp, {}) : sortDirection === "desc" ? /* @__PURE__ */ jsx48(CaretDown, {}) : (
|
|
5637
5705
|
// Neutral affordance: stacked carets, dimmed via CSS.
|
|
5638
|
-
/* @__PURE__ */
|
|
5639
|
-
/* @__PURE__ */
|
|
5640
|
-
/* @__PURE__ */
|
|
5706
|
+
/* @__PURE__ */ jsxs36(Fragment6, { children: [
|
|
5707
|
+
/* @__PURE__ */ jsx48(CaretUp, {}),
|
|
5708
|
+
/* @__PURE__ */ jsx48(CaretDown, {})
|
|
5641
5709
|
] })
|
|
5642
5710
|
) })
|
|
5643
5711
|
]
|
|
@@ -5645,7 +5713,7 @@ function TableHead({
|
|
|
5645
5713
|
) });
|
|
5646
5714
|
}
|
|
5647
5715
|
function TableCell({ className, align, ...props }) {
|
|
5648
|
-
return /* @__PURE__ */
|
|
5716
|
+
return /* @__PURE__ */ jsx48(
|
|
5649
5717
|
"td",
|
|
5650
5718
|
{
|
|
5651
5719
|
"data-slot": "table-cell",
|
|
@@ -5655,7 +5723,7 @@ function TableCell({ className, align, ...props }) {
|
|
|
5655
5723
|
);
|
|
5656
5724
|
}
|
|
5657
5725
|
function TableCaption({ className, ...props }) {
|
|
5658
|
-
return /* @__PURE__ */
|
|
5726
|
+
return /* @__PURE__ */ jsx48(
|
|
5659
5727
|
"caption",
|
|
5660
5728
|
{
|
|
5661
5729
|
"data-slot": "table-caption",
|
|
@@ -5666,9 +5734,9 @@ function TableCaption({ className, ...props }) {
|
|
|
5666
5734
|
}
|
|
5667
5735
|
|
|
5668
5736
|
// src/components/InputOTP/InputOTP.tsx
|
|
5669
|
-
import { useMemo as
|
|
5737
|
+
import { useMemo as useMemo5, useRef as useRef4, useState as useState11, Fragment as Fragment7 } from "react";
|
|
5670
5738
|
import { cva as cva43 } from "class-variance-authority";
|
|
5671
|
-
import { jsx as
|
|
5739
|
+
import { jsx as jsx49, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5672
5740
|
var DEFAULT_PATTERN = "^[0-9]*$";
|
|
5673
5741
|
var inputOTPVariants = cva43("ddga-input-otp", {
|
|
5674
5742
|
variants: {
|
|
@@ -5704,7 +5772,7 @@ function Slot({
|
|
|
5704
5772
|
caret,
|
|
5705
5773
|
mask
|
|
5706
5774
|
}) {
|
|
5707
|
-
return /* @__PURE__ */
|
|
5775
|
+
return /* @__PURE__ */ jsxs37(
|
|
5708
5776
|
"div",
|
|
5709
5777
|
{
|
|
5710
5778
|
"data-slot": "input-otp-slot",
|
|
@@ -5713,7 +5781,7 @@ function Slot({
|
|
|
5713
5781
|
className: "ddga-input-otp__slot",
|
|
5714
5782
|
children: [
|
|
5715
5783
|
char != null ? mask ? "\u2022" : char : null,
|
|
5716
|
-
caret && /* @__PURE__ */
|
|
5784
|
+
caret && /* @__PURE__ */ jsx49("div", { "aria-hidden": "true", "data-slot": "input-otp-caret", className: "ddga-input-otp__caret" })
|
|
5717
5785
|
]
|
|
5718
5786
|
}
|
|
5719
5787
|
);
|
|
@@ -5748,7 +5816,7 @@ function InputOTP({
|
|
|
5748
5816
|
const isControlled = value !== void 0;
|
|
5749
5817
|
const [internal, setInternal] = useState11(defaultValue ?? "");
|
|
5750
5818
|
const current = isControlled ? value : internal;
|
|
5751
|
-
const compiledPattern =
|
|
5819
|
+
const compiledPattern = useMemo5(() => {
|
|
5752
5820
|
try {
|
|
5753
5821
|
return new RegExp(pattern);
|
|
5754
5822
|
} catch {
|
|
@@ -5793,18 +5861,18 @@ function InputOTP({
|
|
|
5793
5861
|
const lastGroup = groups.length - 1;
|
|
5794
5862
|
const activeIndex = focused ? Math.min(current.length, length - 1) : -1;
|
|
5795
5863
|
const inputMode = pattern === DEFAULT_PATTERN ? "numeric" : "text";
|
|
5796
|
-
return /* @__PURE__ */
|
|
5797
|
-
label && /* @__PURE__ */
|
|
5864
|
+
return /* @__PURE__ */ jsxs37("div", { "data-slot": "input-otp-field", className: "ddga-field", ...props, children: [
|
|
5865
|
+
label && /* @__PURE__ */ jsxs37("label", { htmlFor: fieldId, className: "ddga-input-otp__label", children: [
|
|
5798
5866
|
label,
|
|
5799
|
-
required && /* @__PURE__ */
|
|
5867
|
+
required && /* @__PURE__ */ jsx49("span", { "aria-hidden": "true", className: "ddga-input-otp__required", children: "*" })
|
|
5800
5868
|
] }),
|
|
5801
|
-
/* @__PURE__ */
|
|
5869
|
+
/* @__PURE__ */ jsxs37(
|
|
5802
5870
|
"div",
|
|
5803
5871
|
{
|
|
5804
5872
|
className: cn(inputOTPVariants({ size, error: hasError }), className),
|
|
5805
5873
|
"data-slot": "input-otp",
|
|
5806
5874
|
children: [
|
|
5807
|
-
/* @__PURE__ */
|
|
5875
|
+
/* @__PURE__ */ jsx49(
|
|
5808
5876
|
"input",
|
|
5809
5877
|
{
|
|
5810
5878
|
...controlProps,
|
|
@@ -5831,12 +5899,12 @@ function InputOTP({
|
|
|
5831
5899
|
"data-slot": "input-otp-input"
|
|
5832
5900
|
}
|
|
5833
5901
|
),
|
|
5834
|
-
/* @__PURE__ */
|
|
5902
|
+
/* @__PURE__ */ jsx49("div", { dir: "ltr", "aria-hidden": "true", "data-slot": "input-otp-row", className: "ddga-input-otp__row", children: groups.map((count, groupIndex) => {
|
|
5835
5903
|
const start = groups.slice(0, groupIndex).reduce((total, n) => total + n, 0);
|
|
5836
|
-
return /* @__PURE__ */
|
|
5837
|
-
/* @__PURE__ */
|
|
5904
|
+
return /* @__PURE__ */ jsxs37(Fragment7, { children: [
|
|
5905
|
+
/* @__PURE__ */ jsx49("div", { "data-slot": "input-otp-group", className: "ddga-input-otp__group", children: Array.from({ length: count }, (_, offset) => {
|
|
5838
5906
|
const index = start + offset;
|
|
5839
|
-
return /* @__PURE__ */
|
|
5907
|
+
return /* @__PURE__ */ jsx49(
|
|
5840
5908
|
Slot,
|
|
5841
5909
|
{
|
|
5842
5910
|
char: current[index],
|
|
@@ -5847,13 +5915,13 @@ function InputOTP({
|
|
|
5847
5915
|
index
|
|
5848
5916
|
);
|
|
5849
5917
|
}) }),
|
|
5850
|
-
groupIndex < lastGroup && /* @__PURE__ */
|
|
5918
|
+
groupIndex < lastGroup && /* @__PURE__ */ jsx49(
|
|
5851
5919
|
"span",
|
|
5852
5920
|
{
|
|
5853
5921
|
"aria-hidden": "true",
|
|
5854
5922
|
"data-slot": "input-otp-separator",
|
|
5855
5923
|
className: "ddga-input-otp__separator",
|
|
5856
|
-
children: separator ?? /* @__PURE__ */
|
|
5924
|
+
children: separator ?? /* @__PURE__ */ jsx49("span", { className: "ddga-input-otp__separator-dash" })
|
|
5857
5925
|
}
|
|
5858
5926
|
)
|
|
5859
5927
|
] }, groupIndex);
|
|
@@ -5861,8 +5929,8 @@ function InputOTP({
|
|
|
5861
5929
|
]
|
|
5862
5930
|
}
|
|
5863
5931
|
),
|
|
5864
|
-
hasErrorMessage && /* @__PURE__ */
|
|
5865
|
-
hasHelper && /* @__PURE__ */
|
|
5932
|
+
hasErrorMessage && /* @__PURE__ */ jsx49(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
5933
|
+
hasHelper && /* @__PURE__ */ jsx49(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
5866
5934
|
] });
|
|
5867
5935
|
}
|
|
5868
5936
|
|
|
@@ -5870,7 +5938,7 @@ function InputOTP({
|
|
|
5870
5938
|
import "react";
|
|
5871
5939
|
import { Slot as SlotPrimitive13 } from "radix-ui";
|
|
5872
5940
|
import { cva as cva44 } from "class-variance-authority";
|
|
5873
|
-
import { jsx as
|
|
5941
|
+
import { jsx as jsx50, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5874
5942
|
var linkVariants = cva44("ddga-link", {
|
|
5875
5943
|
variants: {
|
|
5876
5944
|
variant: {
|
|
@@ -5911,7 +5979,7 @@ function Link({
|
|
|
5911
5979
|
/* @__PURE__ */ new Set([...rel ? rel.split(/\s+/).filter(Boolean) : [], "noopener", "noreferrer"])
|
|
5912
5980
|
).join(" ") : rel;
|
|
5913
5981
|
const showExternalIcon = external && !endIcon;
|
|
5914
|
-
return /* @__PURE__ */
|
|
5982
|
+
return /* @__PURE__ */ jsxs38(
|
|
5915
5983
|
Comp,
|
|
5916
5984
|
{
|
|
5917
5985
|
"data-slot": "link",
|
|
@@ -5919,7 +5987,7 @@ function Link({
|
|
|
5919
5987
|
rel: relValue,
|
|
5920
5988
|
...props,
|
|
5921
5989
|
children: [
|
|
5922
|
-
startIcon && /* @__PURE__ */
|
|
5990
|
+
startIcon && /* @__PURE__ */ jsx50(
|
|
5923
5991
|
"span",
|
|
5924
5992
|
{
|
|
5925
5993
|
className: cn("ddga-link__icon", iconFlip && "ddga-icon-flip"),
|
|
@@ -5928,8 +5996,8 @@ function Link({
|
|
|
5928
5996
|
children: startIcon
|
|
5929
5997
|
}
|
|
5930
5998
|
),
|
|
5931
|
-
asChild ? /* @__PURE__ */
|
|
5932
|
-
endIcon && /* @__PURE__ */
|
|
5999
|
+
asChild ? /* @__PURE__ */ jsx50(SlotPrimitive13.Slottable, { children }) : children,
|
|
6000
|
+
endIcon && /* @__PURE__ */ jsx50(
|
|
5933
6001
|
"span",
|
|
5934
6002
|
{
|
|
5935
6003
|
className: cn("ddga-link__icon", iconFlip && "ddga-icon-flip"),
|
|
@@ -5938,13 +6006,13 @@ function Link({
|
|
|
5938
6006
|
children: endIcon
|
|
5939
6007
|
}
|
|
5940
6008
|
),
|
|
5941
|
-
showExternalIcon && /* @__PURE__ */
|
|
6009
|
+
showExternalIcon && /* @__PURE__ */ jsx50(
|
|
5942
6010
|
"span",
|
|
5943
6011
|
{
|
|
5944
6012
|
className: "ddga-link__icon ddga-link__icon--external",
|
|
5945
6013
|
"data-slot": "link-external-icon",
|
|
5946
6014
|
"aria-hidden": "true",
|
|
5947
|
-
children: /* @__PURE__ */
|
|
6015
|
+
children: /* @__PURE__ */ jsx50(ExternalLink, {})
|
|
5948
6016
|
}
|
|
5949
6017
|
)
|
|
5950
6018
|
]
|
|
@@ -5953,8 +6021,8 @@ function Link({
|
|
|
5953
6021
|
}
|
|
5954
6022
|
|
|
5955
6023
|
// src/components/SearchBox/SearchBox.tsx
|
|
5956
|
-
import { useRef as useRef5, useState as useState12 } from "react";
|
|
5957
|
-
import { jsx as
|
|
6024
|
+
import { useCallback as useCallback5, useRef as useRef5, useState as useState12 } from "react";
|
|
6025
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
5958
6026
|
function setNativeInputValue(el, value) {
|
|
5959
6027
|
const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set;
|
|
5960
6028
|
setter?.call(el, value);
|
|
@@ -5970,9 +6038,18 @@ function SearchBox({
|
|
|
5970
6038
|
clearable = true,
|
|
5971
6039
|
clearLabel = "Clear search",
|
|
5972
6040
|
className,
|
|
6041
|
+
ref,
|
|
5973
6042
|
...rest
|
|
5974
6043
|
}) {
|
|
5975
6044
|
const inputRef = useRef5(null);
|
|
6045
|
+
const setRefs = useCallback5(
|
|
6046
|
+
(node) => {
|
|
6047
|
+
inputRef.current = node;
|
|
6048
|
+
if (typeof ref === "function") ref(node);
|
|
6049
|
+
else if (ref) ref.current = node;
|
|
6050
|
+
},
|
|
6051
|
+
[ref]
|
|
6052
|
+
);
|
|
5976
6053
|
const isControlled = value !== void 0;
|
|
5977
6054
|
const [internal, setInternal] = useState12(
|
|
5978
6055
|
defaultValue != null ? String(defaultValue) : ""
|
|
@@ -6001,18 +6078,18 @@ function SearchBox({
|
|
|
6001
6078
|
}
|
|
6002
6079
|
};
|
|
6003
6080
|
const showClear = clearable && currentValue.length > 0;
|
|
6004
|
-
return /* @__PURE__ */
|
|
6081
|
+
return /* @__PURE__ */ jsx51(
|
|
6005
6082
|
Input,
|
|
6006
6083
|
{
|
|
6007
6084
|
...rest,
|
|
6008
|
-
ref:
|
|
6085
|
+
ref: setRefs,
|
|
6009
6086
|
type: "search",
|
|
6010
6087
|
value: currentValue,
|
|
6011
6088
|
onChange: handleChange,
|
|
6012
6089
|
onKeyDown: handleKeyDown,
|
|
6013
6090
|
className: cn("ddga-search-box", className),
|
|
6014
|
-
startAdornment: /* @__PURE__ */
|
|
6015
|
-
endAdornment: showClear ? /* @__PURE__ */
|
|
6091
|
+
startAdornment: /* @__PURE__ */ jsx51(Search, { "data-slot": "search-box-icon", "aria-hidden": "true" }),
|
|
6092
|
+
endAdornment: showClear ? /* @__PURE__ */ jsx51(
|
|
6016
6093
|
Button,
|
|
6017
6094
|
{
|
|
6018
6095
|
type: "button",
|
|
@@ -6021,7 +6098,7 @@ function SearchBox({
|
|
|
6021
6098
|
"aria-label": clearLabel,
|
|
6022
6099
|
"data-slot": "search-box-clear",
|
|
6023
6100
|
onClick: clear,
|
|
6024
|
-
children: /* @__PURE__ */
|
|
6101
|
+
children: /* @__PURE__ */ jsx51(Close, { "aria-hidden": "true" })
|
|
6025
6102
|
}
|
|
6026
6103
|
) : void 0
|
|
6027
6104
|
}
|
|
@@ -6030,7 +6107,7 @@ function SearchBox({
|
|
|
6030
6107
|
|
|
6031
6108
|
// src/components/List/List.tsx
|
|
6032
6109
|
import { cva as cva45 } from "class-variance-authority";
|
|
6033
|
-
import { Fragment as Fragment8, jsx as
|
|
6110
|
+
import { Fragment as Fragment8, jsx as jsx52, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6034
6111
|
var listVariants = cva45("ddga-list", {
|
|
6035
6112
|
variants: {
|
|
6036
6113
|
variant: {
|
|
@@ -6051,7 +6128,7 @@ function List({ variant, divided, className, start, reversed, ...props }) {
|
|
|
6051
6128
|
const classes = cn(listVariants({ variant, divided }), className);
|
|
6052
6129
|
const ordered = variant === "numbered" || variant === "lettered";
|
|
6053
6130
|
if (ordered) {
|
|
6054
|
-
return /* @__PURE__ */
|
|
6131
|
+
return /* @__PURE__ */ jsx52(
|
|
6055
6132
|
"ol",
|
|
6056
6133
|
{
|
|
6057
6134
|
"data-slot": "list",
|
|
@@ -6063,13 +6140,13 @@ function List({ variant, divided, className, start, reversed, ...props }) {
|
|
|
6063
6140
|
}
|
|
6064
6141
|
);
|
|
6065
6142
|
}
|
|
6066
|
-
return /* @__PURE__ */
|
|
6143
|
+
return /* @__PURE__ */ jsx52("ul", { "data-slot": "list", "data-variant": variant ?? "plain", className: classes, ...props });
|
|
6067
6144
|
}
|
|
6068
6145
|
function ListItem({ className, ...props }) {
|
|
6069
|
-
return /* @__PURE__ */
|
|
6146
|
+
return /* @__PURE__ */ jsx52("li", { "data-slot": "list-item", className: cn("ddga-list__item", className), ...props });
|
|
6070
6147
|
}
|
|
6071
6148
|
function ListItemIcon({ className, ...props }) {
|
|
6072
|
-
return /* @__PURE__ */
|
|
6149
|
+
return /* @__PURE__ */ jsx52("span", { "data-slot": "list-item-icon", className: cn("ddga-list__icon", className), ...props });
|
|
6073
6150
|
}
|
|
6074
6151
|
function ListItemContent({
|
|
6075
6152
|
primary,
|
|
@@ -6083,20 +6160,20 @@ function ListItemContent({
|
|
|
6083
6160
|
"[@dev-dga/react] ListItemContent: `children` overrides `primary`/`secondary`. Pass one or the other, not both."
|
|
6084
6161
|
);
|
|
6085
6162
|
}
|
|
6086
|
-
return /* @__PURE__ */
|
|
6087
|
-
primary != null && primary !== "" && /* @__PURE__ */
|
|
6088
|
-
secondary != null && secondary !== "" && /* @__PURE__ */
|
|
6163
|
+
return /* @__PURE__ */ jsx52("div", { "data-slot": "list-item-content", className: cn("ddga-list__content", className), ...props, children: children ?? /* @__PURE__ */ jsxs39(Fragment8, { children: [
|
|
6164
|
+
primary != null && primary !== "" && /* @__PURE__ */ jsx52("span", { "data-slot": "list-item-primary", className: "ddga-list__primary", children: primary }),
|
|
6165
|
+
secondary != null && secondary !== "" && /* @__PURE__ */ jsx52("span", { "data-slot": "list-item-secondary", className: "ddga-list__secondary", children: secondary })
|
|
6089
6166
|
] }) });
|
|
6090
6167
|
}
|
|
6091
6168
|
function ListItemAction({ className, ...props }) {
|
|
6092
|
-
return /* @__PURE__ */
|
|
6169
|
+
return /* @__PURE__ */ jsx52("div", { "data-slot": "list-item-action", className: cn("ddga-list__action", className), ...props });
|
|
6093
6170
|
}
|
|
6094
6171
|
|
|
6095
6172
|
// src/components/Quote/Quote.tsx
|
|
6096
6173
|
import "react";
|
|
6097
6174
|
import { Slot as SlotPrimitive14 } from "radix-ui";
|
|
6098
6175
|
import { cva as cva46 } from "class-variance-authority";
|
|
6099
|
-
import { jsx as
|
|
6176
|
+
import { jsx as jsx53, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6100
6177
|
var quoteVariants = cva46("ddga-quote", {
|
|
6101
6178
|
variants: {
|
|
6102
6179
|
variant: {
|
|
@@ -6127,9 +6204,9 @@ function Quote({
|
|
|
6127
6204
|
...props
|
|
6128
6205
|
}) {
|
|
6129
6206
|
const hasAttribution = author != null || byline != null || source != null;
|
|
6130
|
-
const mark = quoteMark ? /* @__PURE__ */
|
|
6207
|
+
const mark = quoteMark ? /* @__PURE__ */ jsx53(QuoteMark, { "aria-hidden": "true", className: "ddga-quote__mark" }) : null;
|
|
6131
6208
|
if (!hasAttribution) {
|
|
6132
|
-
return /* @__PURE__ */
|
|
6209
|
+
return /* @__PURE__ */ jsxs40(
|
|
6133
6210
|
"blockquote",
|
|
6134
6211
|
{
|
|
6135
6212
|
"data-slot": "quote",
|
|
@@ -6139,12 +6216,12 @@ function Quote({
|
|
|
6139
6216
|
...props,
|
|
6140
6217
|
children: [
|
|
6141
6218
|
mark,
|
|
6142
|
-
/* @__PURE__ */
|
|
6219
|
+
/* @__PURE__ */ jsx53(QuoteContent, { children })
|
|
6143
6220
|
]
|
|
6144
6221
|
}
|
|
6145
6222
|
);
|
|
6146
6223
|
}
|
|
6147
|
-
return /* @__PURE__ */
|
|
6224
|
+
return /* @__PURE__ */ jsxs40(
|
|
6148
6225
|
"figure",
|
|
6149
6226
|
{
|
|
6150
6227
|
"data-slot": "quote",
|
|
@@ -6152,16 +6229,16 @@ function Quote({
|
|
|
6152
6229
|
className: cn(quoteVariants({ variant }), className),
|
|
6153
6230
|
...props,
|
|
6154
6231
|
children: [
|
|
6155
|
-
/* @__PURE__ */
|
|
6232
|
+
/* @__PURE__ */ jsxs40("blockquote", { "data-slot": "quote-blockquote", className: "ddga-quote__blockquote", cite, children: [
|
|
6156
6233
|
mark,
|
|
6157
|
-
/* @__PURE__ */
|
|
6234
|
+
/* @__PURE__ */ jsx53(QuoteContent, { children })
|
|
6158
6235
|
] }),
|
|
6159
|
-
/* @__PURE__ */
|
|
6160
|
-
avatar != null ? /* @__PURE__ */
|
|
6161
|
-
/* @__PURE__ */
|
|
6162
|
-
author != null ? /* @__PURE__ */
|
|
6163
|
-
byline != null ? /* @__PURE__ */
|
|
6164
|
-
source != null ? /* @__PURE__ */
|
|
6236
|
+
/* @__PURE__ */ jsxs40(QuoteCaption, { children: [
|
|
6237
|
+
avatar != null ? /* @__PURE__ */ jsx53("span", { "data-slot": "quote-avatar", "aria-hidden": "true", className: "ddga-quote__avatar", children: avatar }) : null,
|
|
6238
|
+
/* @__PURE__ */ jsxs40("span", { className: "ddga-quote__attribution", children: [
|
|
6239
|
+
author != null ? /* @__PURE__ */ jsx53(QuoteAuthor, { children: author }) : null,
|
|
6240
|
+
byline != null ? /* @__PURE__ */ jsx53("span", { className: "ddga-quote__byline", children: byline }) : null,
|
|
6241
|
+
source != null ? /* @__PURE__ */ jsx53(QuoteSource, { children: source }) : null
|
|
6165
6242
|
] })
|
|
6166
6243
|
] })
|
|
6167
6244
|
]
|
|
@@ -6170,26 +6247,26 @@ function Quote({
|
|
|
6170
6247
|
}
|
|
6171
6248
|
function QuoteContent({ asChild, className, ...props }) {
|
|
6172
6249
|
const Comp = asChild ? SlotPrimitive14.Slot : "div";
|
|
6173
|
-
return /* @__PURE__ */
|
|
6250
|
+
return /* @__PURE__ */ jsx53(Comp, { "data-slot": "quote-content", className: cn("ddga-quote__content", className), ...props });
|
|
6174
6251
|
}
|
|
6175
6252
|
function QuoteCaption({ asChild, className, ...props }) {
|
|
6176
6253
|
const Comp = asChild ? SlotPrimitive14.Slot : "figcaption";
|
|
6177
|
-
return /* @__PURE__ */
|
|
6254
|
+
return /* @__PURE__ */ jsx53(Comp, { "data-slot": "quote-caption", className: cn("ddga-quote__caption", className), ...props });
|
|
6178
6255
|
}
|
|
6179
6256
|
function QuoteAuthor({ asChild, className, ...props }) {
|
|
6180
6257
|
const Comp = asChild ? SlotPrimitive14.Slot : "span";
|
|
6181
|
-
return /* @__PURE__ */
|
|
6258
|
+
return /* @__PURE__ */ jsx53(Comp, { "data-slot": "quote-author", className: cn("ddga-quote__author", className), ...props });
|
|
6182
6259
|
}
|
|
6183
6260
|
function QuoteSource({ asChild, className, ...props }) {
|
|
6184
6261
|
const Comp = asChild ? SlotPrimitive14.Slot : "cite";
|
|
6185
|
-
return /* @__PURE__ */
|
|
6262
|
+
return /* @__PURE__ */ jsx53(Comp, { "data-slot": "quote-source", className: cn("ddga-quote__source", className), ...props });
|
|
6186
6263
|
}
|
|
6187
6264
|
|
|
6188
6265
|
// src/components/Collapsible/Collapsible.tsx
|
|
6189
6266
|
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
6190
|
-
import { jsx as
|
|
6267
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
6191
6268
|
function Collapsible({ className, ...props }) {
|
|
6192
|
-
return /* @__PURE__ */
|
|
6269
|
+
return /* @__PURE__ */ jsx54(
|
|
6193
6270
|
CollapsiblePrimitive.Root,
|
|
6194
6271
|
{
|
|
6195
6272
|
"data-slot": "collapsible",
|
|
@@ -6199,7 +6276,7 @@ function Collapsible({ className, ...props }) {
|
|
|
6199
6276
|
);
|
|
6200
6277
|
}
|
|
6201
6278
|
function CollapsibleTrigger({ className, ...props }) {
|
|
6202
|
-
return /* @__PURE__ */
|
|
6279
|
+
return /* @__PURE__ */ jsx54(
|
|
6203
6280
|
CollapsiblePrimitive.Trigger,
|
|
6204
6281
|
{
|
|
6205
6282
|
"data-slot": "collapsible-trigger",
|
|
@@ -6209,13 +6286,13 @@ function CollapsibleTrigger({ className, ...props }) {
|
|
|
6209
6286
|
);
|
|
6210
6287
|
}
|
|
6211
6288
|
function CollapsibleContent({ className, children, ...props }) {
|
|
6212
|
-
return /* @__PURE__ */
|
|
6289
|
+
return /* @__PURE__ */ jsx54(
|
|
6213
6290
|
CollapsiblePrimitive.Content,
|
|
6214
6291
|
{
|
|
6215
6292
|
"data-slot": "collapsible-content",
|
|
6216
6293
|
className: cn("ddga-collapsible__content", className),
|
|
6217
6294
|
...props,
|
|
6218
|
-
children: /* @__PURE__ */
|
|
6295
|
+
children: /* @__PURE__ */ jsx54("div", { className: "ddga-collapsible__content-inner", children })
|
|
6219
6296
|
}
|
|
6220
6297
|
);
|
|
6221
6298
|
}
|
|
@@ -6223,7 +6300,7 @@ function CollapsibleContent({ className, children, ...props }) {
|
|
|
6223
6300
|
// src/components/TagInput/TagInput.tsx
|
|
6224
6301
|
import { useRef as useRef6, useState as useState13 } from "react";
|
|
6225
6302
|
import { cva as cva47 } from "class-variance-authority";
|
|
6226
|
-
import { jsx as
|
|
6303
|
+
import { jsx as jsx55, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6227
6304
|
var tagInputVariants = cva47("ddga-tag-input", {
|
|
6228
6305
|
variants: {
|
|
6229
6306
|
size: {
|
|
@@ -6352,9 +6429,9 @@ function TagInput({
|
|
|
6352
6429
|
inputRef.current?.focus();
|
|
6353
6430
|
};
|
|
6354
6431
|
const chipSize = size === "lg" ? "md" : "sm";
|
|
6355
|
-
return /* @__PURE__ */
|
|
6356
|
-
label && /* @__PURE__ */
|
|
6357
|
-
/* @__PURE__ */
|
|
6432
|
+
return /* @__PURE__ */ jsxs41("div", { "data-slot": "tag-input-field", className: "ddga-field", children: [
|
|
6433
|
+
label && /* @__PURE__ */ jsx55("label", { htmlFor: fieldId, className: "ddga-tag-input__label", children: label }),
|
|
6434
|
+
/* @__PURE__ */ jsxs41(
|
|
6358
6435
|
"div",
|
|
6359
6436
|
{
|
|
6360
6437
|
"data-slot": "tag-input-control",
|
|
@@ -6362,13 +6439,13 @@ function TagInput({
|
|
|
6362
6439
|
"data-disabled": disabled || void 0,
|
|
6363
6440
|
onMouseDown: disabled ? void 0 : handleBoxMouseDown,
|
|
6364
6441
|
children: [
|
|
6365
|
-
tags.length > 0 && /* @__PURE__ */
|
|
6442
|
+
tags.length > 0 && /* @__PURE__ */ jsx55("ul", { "data-slot": "tag-input-list", className: "ddga-tag-input__list", role: "list", children: tags.map((tag, index) => /* @__PURE__ */ jsx55(
|
|
6366
6443
|
"li",
|
|
6367
6444
|
{
|
|
6368
6445
|
"data-slot": "tag-input-item",
|
|
6369
6446
|
className: "ddga-tag-input__item",
|
|
6370
6447
|
role: "listitem",
|
|
6371
|
-
children: /* @__PURE__ */
|
|
6448
|
+
children: /* @__PURE__ */ jsx55(
|
|
6372
6449
|
Badge,
|
|
6373
6450
|
{
|
|
6374
6451
|
variant: chipVariant,
|
|
@@ -6383,7 +6460,7 @@ function TagInput({
|
|
|
6383
6460
|
},
|
|
6384
6461
|
`${tag}-${index}`
|
|
6385
6462
|
)) }),
|
|
6386
|
-
/* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ jsx55(
|
|
6387
6464
|
"input",
|
|
6388
6465
|
{
|
|
6389
6466
|
...props,
|
|
@@ -6403,17 +6480,322 @@ function TagInput({
|
|
|
6403
6480
|
]
|
|
6404
6481
|
}
|
|
6405
6482
|
),
|
|
6406
|
-
/* @__PURE__ */
|
|
6407
|
-
hasErrorMessage && /* @__PURE__ */
|
|
6408
|
-
hasHelper && /* @__PURE__ */
|
|
6483
|
+
/* @__PURE__ */ jsx55("div", { "data-slot": "tag-input-live", className: "ddga-sr-only", role: "status", "aria-live": "polite", children: announcement }),
|
|
6484
|
+
hasErrorMessage && /* @__PURE__ */ jsx55(FieldMessage, { id: errorId, variant: "error", children: errorMessage }),
|
|
6485
|
+
hasHelper && /* @__PURE__ */ jsx55(FieldMessage, { id: helperId, variant: "helper", children: helperText })
|
|
6409
6486
|
] });
|
|
6410
6487
|
}
|
|
6411
6488
|
|
|
6489
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
6490
|
+
import { useCallback as useCallback6, useMemo as useMemo6, useState as useState14 } from "react";
|
|
6491
|
+
import {
|
|
6492
|
+
Button as AriaButton2,
|
|
6493
|
+
CalendarCell as AriaCalendarCell2,
|
|
6494
|
+
CalendarGrid as AriaCalendarGrid2,
|
|
6495
|
+
CalendarGridBody as AriaCalendarGridBody2,
|
|
6496
|
+
CalendarGridHeader as AriaCalendarGridHeader2,
|
|
6497
|
+
CalendarHeaderCell as AriaCalendarHeaderCell2,
|
|
6498
|
+
DateInput as AriaDateInput2,
|
|
6499
|
+
DateRangePicker as AriaDateRangePicker,
|
|
6500
|
+
DateSegment as AriaDateSegment2,
|
|
6501
|
+
Dialog as AriaDialog2,
|
|
6502
|
+
FieldError as AriaFieldError2,
|
|
6503
|
+
Group as AriaGroup2,
|
|
6504
|
+
I18nProvider as I18nProvider2,
|
|
6505
|
+
Label as AriaLabel2,
|
|
6506
|
+
Popover as AriaPopover2,
|
|
6507
|
+
RangeCalendar as AriaRangeCalendar,
|
|
6508
|
+
Text as AriaText2
|
|
6509
|
+
} from "react-aria-components";
|
|
6510
|
+
import { CalendarDate as CalendarDate3 } from "@internationalized/date";
|
|
6511
|
+
import { cva as cva48 } from "class-variance-authority";
|
|
6512
|
+
import { jsx as jsx56, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6513
|
+
var dateRangePickerTriggerVariants = cva48("ddga-date-range-picker-trigger", {
|
|
6514
|
+
variants: {
|
|
6515
|
+
size: {
|
|
6516
|
+
sm: "ddga-date-range-picker-trigger--sm",
|
|
6517
|
+
md: "ddga-date-range-picker-trigger--md"
|
|
6518
|
+
},
|
|
6519
|
+
error: {
|
|
6520
|
+
true: "ddga-date-range-picker-trigger--error"
|
|
6521
|
+
}
|
|
6522
|
+
},
|
|
6523
|
+
defaultVariants: {
|
|
6524
|
+
size: "md"
|
|
6525
|
+
}
|
|
6526
|
+
});
|
|
6527
|
+
var dateRangePickerVariants = dateRangePickerTriggerVariants;
|
|
6528
|
+
function toAriaRange(range) {
|
|
6529
|
+
if (!range) return null;
|
|
6530
|
+
const start = dateToCalendarDate(range.start);
|
|
6531
|
+
const end = dateToCalendarDate(range.end);
|
|
6532
|
+
if (!start || !end) return null;
|
|
6533
|
+
return { start, end };
|
|
6534
|
+
}
|
|
6535
|
+
function fromAriaRange(value) {
|
|
6536
|
+
if (!value) return null;
|
|
6537
|
+
const start = calendarDateToDate(value.start);
|
|
6538
|
+
const end = calendarDateToDate(value.end);
|
|
6539
|
+
if (!start || !end) return null;
|
|
6540
|
+
return { start, end };
|
|
6541
|
+
}
|
|
6542
|
+
function DateRangePicker({
|
|
6543
|
+
value: controlledValue,
|
|
6544
|
+
defaultValue,
|
|
6545
|
+
onChange,
|
|
6546
|
+
minValue,
|
|
6547
|
+
maxValue,
|
|
6548
|
+
label,
|
|
6549
|
+
helperText,
|
|
6550
|
+
errorMessage,
|
|
6551
|
+
error,
|
|
6552
|
+
required,
|
|
6553
|
+
disabled,
|
|
6554
|
+
size,
|
|
6555
|
+
id,
|
|
6556
|
+
className,
|
|
6557
|
+
"aria-label": ariaLabel,
|
|
6558
|
+
"aria-labelledby": ariaLabelledBy,
|
|
6559
|
+
calendar: controlledCalendar,
|
|
6560
|
+
defaultCalendar = "gregorian",
|
|
6561
|
+
onCalendarChange,
|
|
6562
|
+
showCalendarToggle = true,
|
|
6563
|
+
calendarLabels,
|
|
6564
|
+
showSecondaryCalendar = false
|
|
6565
|
+
}) {
|
|
6566
|
+
const isValueControlled = controlledValue !== void 0;
|
|
6567
|
+
const [internalValue, setInternalValue] = useState14(
|
|
6568
|
+
() => toAriaRange(defaultValue)
|
|
6569
|
+
);
|
|
6570
|
+
const value = isValueControlled ? toAriaRange(controlledValue) : internalValue;
|
|
6571
|
+
const handleAriaChange = useCallback6(
|
|
6572
|
+
(next) => {
|
|
6573
|
+
const nextRange = next ? {
|
|
6574
|
+
start: new CalendarDate3(next.start.year, next.start.month, next.start.day),
|
|
6575
|
+
end: new CalendarDate3(next.end.year, next.end.month, next.end.day)
|
|
6576
|
+
} : null;
|
|
6577
|
+
if (!isValueControlled) setInternalValue(nextRange);
|
|
6578
|
+
onChange?.(fromAriaRange(nextRange));
|
|
6579
|
+
},
|
|
6580
|
+
[isValueControlled, onChange]
|
|
6581
|
+
);
|
|
6582
|
+
const isCalendarControlled = controlledCalendar !== void 0;
|
|
6583
|
+
const [internalCalendar, setInternalCalendar] = useState14(defaultCalendar);
|
|
6584
|
+
const calendarSystem = isCalendarControlled ? controlledCalendar : internalCalendar;
|
|
6585
|
+
const setCalendar = useCallback6(
|
|
6586
|
+
(next) => {
|
|
6587
|
+
if (!isCalendarControlled) setInternalCalendar(next);
|
|
6588
|
+
onCalendarChange?.(next);
|
|
6589
|
+
},
|
|
6590
|
+
[isCalendarControlled, onCalendarChange]
|
|
6591
|
+
);
|
|
6592
|
+
const {
|
|
6593
|
+
dgaLocale,
|
|
6594
|
+
locale: ariaLocale,
|
|
6595
|
+
portalContainer,
|
|
6596
|
+
PrevChevron,
|
|
6597
|
+
NextChevron,
|
|
6598
|
+
resolvedLabels,
|
|
6599
|
+
navLabels,
|
|
6600
|
+
a11yLabels
|
|
6601
|
+
} = useCalendarChrome(calendarSystem, calendarLabels);
|
|
6602
|
+
const ariaMinValue = useMemo6(() => dateToCalendarDate(minValue) ?? void 0, [minValue]);
|
|
6603
|
+
const ariaMaxValue = useMemo6(() => dateToCalendarDate(maxValue) ?? void 0, [maxValue]);
|
|
6604
|
+
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");
|
|
6605
|
+
const showToggle = showCalendarToggle && !isCalendarControlled;
|
|
6606
|
+
const hasError = !!error;
|
|
6607
|
+
const hasErrorMessage = hasError && errorMessage != null && errorMessage !== "";
|
|
6608
|
+
const hasHelper = !hasErrorMessage && helperText != null && helperText !== "";
|
|
6609
|
+
return /* @__PURE__ */ jsx56(I18nProvider2, { locale: ariaLocale, children: /* @__PURE__ */ jsxs42(
|
|
6610
|
+
AriaDateRangePicker,
|
|
6611
|
+
{
|
|
6612
|
+
value,
|
|
6613
|
+
onChange: handleAriaChange,
|
|
6614
|
+
minValue: ariaMinValue,
|
|
6615
|
+
maxValue: ariaMaxValue,
|
|
6616
|
+
isRequired: required,
|
|
6617
|
+
isDisabled: disabled,
|
|
6618
|
+
isInvalid: hasError,
|
|
6619
|
+
shouldCloseOnSelect: true,
|
|
6620
|
+
id,
|
|
6621
|
+
"aria-label": ariaLabel,
|
|
6622
|
+
"aria-labelledby": ariaLabelledBy,
|
|
6623
|
+
className: "ddga-field",
|
|
6624
|
+
"data-slot": "date-range-picker-field",
|
|
6625
|
+
children: [
|
|
6626
|
+
label && /* @__PURE__ */ jsxs42(AriaLabel2, { className: "ddga-date-range-picker__label", children: [
|
|
6627
|
+
label,
|
|
6628
|
+
required && /* @__PURE__ */ jsx56("span", { "aria-hidden": "true", className: "ddga-date-range-picker__required", children: "*" })
|
|
6629
|
+
] }),
|
|
6630
|
+
/* @__PURE__ */ jsxs42(
|
|
6631
|
+
AriaGroup2,
|
|
6632
|
+
{
|
|
6633
|
+
"data-slot": "date-range-picker-trigger",
|
|
6634
|
+
className: cn(dateRangePickerTriggerVariants({ size, error: hasError }), className),
|
|
6635
|
+
children: [
|
|
6636
|
+
/* @__PURE__ */ jsx56(
|
|
6637
|
+
AriaDateInput2,
|
|
6638
|
+
{
|
|
6639
|
+
slot: "start",
|
|
6640
|
+
className: "ddga-date-range-picker__input",
|
|
6641
|
+
"data-slot": "date-range-picker-input-start",
|
|
6642
|
+
children: (segment) => /* @__PURE__ */ jsx56(
|
|
6643
|
+
AriaDateSegment2,
|
|
6644
|
+
{
|
|
6645
|
+
segment,
|
|
6646
|
+
className: "ddga-date-range-picker__segment",
|
|
6647
|
+
"data-slot": "date-range-picker-segment"
|
|
6648
|
+
}
|
|
6649
|
+
)
|
|
6650
|
+
}
|
|
6651
|
+
),
|
|
6652
|
+
/* @__PURE__ */ jsx56("span", { "aria-hidden": "true", className: "ddga-date-range-picker__separator", children: "\u2013" }),
|
|
6653
|
+
/* @__PURE__ */ jsx56(
|
|
6654
|
+
AriaDateInput2,
|
|
6655
|
+
{
|
|
6656
|
+
slot: "end",
|
|
6657
|
+
className: "ddga-date-range-picker__input",
|
|
6658
|
+
"data-slot": "date-range-picker-input-end",
|
|
6659
|
+
children: (segment) => /* @__PURE__ */ jsx56(
|
|
6660
|
+
AriaDateSegment2,
|
|
6661
|
+
{
|
|
6662
|
+
segment,
|
|
6663
|
+
className: "ddga-date-range-picker__segment",
|
|
6664
|
+
"data-slot": "date-range-picker-segment"
|
|
6665
|
+
}
|
|
6666
|
+
)
|
|
6667
|
+
}
|
|
6668
|
+
),
|
|
6669
|
+
/* @__PURE__ */ jsx56(
|
|
6670
|
+
AriaButton2,
|
|
6671
|
+
{
|
|
6672
|
+
className: "ddga-date-range-picker__icon-button",
|
|
6673
|
+
"aria-label": a11yLabels.openCalendar,
|
|
6674
|
+
"data-slot": "date-range-picker-trigger-button",
|
|
6675
|
+
children: /* @__PURE__ */ jsx56(CalendarIcon, { "aria-hidden": "true", className: "ddga-date-range-picker__icon" })
|
|
6676
|
+
}
|
|
6677
|
+
)
|
|
6678
|
+
]
|
|
6679
|
+
}
|
|
6680
|
+
),
|
|
6681
|
+
hasHelper && /* @__PURE__ */ jsx56(
|
|
6682
|
+
AriaText2,
|
|
6683
|
+
{
|
|
6684
|
+
slot: "description",
|
|
6685
|
+
className: "ddga-field__message ddga-field__message--helper",
|
|
6686
|
+
"data-slot": "field-helper",
|
|
6687
|
+
children: helperText
|
|
6688
|
+
}
|
|
6689
|
+
),
|
|
6690
|
+
hasErrorMessage && /* @__PURE__ */ jsx56(
|
|
6691
|
+
AriaFieldError2,
|
|
6692
|
+
{
|
|
6693
|
+
className: "ddga-field__message ddga-field__message--error",
|
|
6694
|
+
"data-slot": "field-error",
|
|
6695
|
+
children: errorMessage
|
|
6696
|
+
}
|
|
6697
|
+
),
|
|
6698
|
+
/* @__PURE__ */ jsx56(
|
|
6699
|
+
AriaPopover2,
|
|
6700
|
+
{
|
|
6701
|
+
UNSTABLE_portalContainer: portalContainer,
|
|
6702
|
+
className: "ddga-calendar-popover",
|
|
6703
|
+
"data-slot": "date-range-picker-popover",
|
|
6704
|
+
offset: 6,
|
|
6705
|
+
containerPadding: 12,
|
|
6706
|
+
children: /* @__PURE__ */ jsxs42(
|
|
6707
|
+
AriaDialog2,
|
|
6708
|
+
{
|
|
6709
|
+
className: "ddga-calendar-dialog",
|
|
6710
|
+
"data-slot": "date-range-picker-dialog",
|
|
6711
|
+
"aria-label": dialogAriaLabel,
|
|
6712
|
+
"aria-labelledby": ariaLabelledBy,
|
|
6713
|
+
children: [
|
|
6714
|
+
showToggle && /* @__PURE__ */ jsx56(
|
|
6715
|
+
CalendarSystemToggle,
|
|
6716
|
+
{
|
|
6717
|
+
value: calendarSystem,
|
|
6718
|
+
onChange: setCalendar,
|
|
6719
|
+
labels: resolvedLabels,
|
|
6720
|
+
groupLabel: a11yLabels.calendarSystem
|
|
6721
|
+
}
|
|
6722
|
+
),
|
|
6723
|
+
/* @__PURE__ */ jsxs42(
|
|
6724
|
+
AriaRangeCalendar,
|
|
6725
|
+
{
|
|
6726
|
+
className: "ddga-calendar ddga-calendar--range",
|
|
6727
|
+
"data-slot": "date-range-picker-calendar",
|
|
6728
|
+
children: [
|
|
6729
|
+
/* @__PURE__ */ jsxs42("header", { className: "ddga-calendar__header", children: [
|
|
6730
|
+
/* @__PURE__ */ jsx56(
|
|
6731
|
+
AriaButton2,
|
|
6732
|
+
{
|
|
6733
|
+
slot: "previous",
|
|
6734
|
+
className: "ddga-calendar__nav",
|
|
6735
|
+
"data-slot": "date-range-picker-calendar-prev",
|
|
6736
|
+
children: /* @__PURE__ */ jsx56(PrevChevron, { "aria-hidden": "true" })
|
|
6737
|
+
}
|
|
6738
|
+
),
|
|
6739
|
+
/* @__PURE__ */ jsx56(
|
|
6740
|
+
CalendarNavHeader,
|
|
6741
|
+
{
|
|
6742
|
+
locale: ariaLocale,
|
|
6743
|
+
monthLabel: navLabels.month,
|
|
6744
|
+
yearLabel: navLabels.year
|
|
6745
|
+
}
|
|
6746
|
+
),
|
|
6747
|
+
/* @__PURE__ */ jsx56(
|
|
6748
|
+
AriaButton2,
|
|
6749
|
+
{
|
|
6750
|
+
slot: "next",
|
|
6751
|
+
className: "ddga-calendar__nav",
|
|
6752
|
+
"data-slot": "date-range-picker-calendar-next",
|
|
6753
|
+
children: /* @__PURE__ */ jsx56(NextChevron, { "aria-hidden": "true" })
|
|
6754
|
+
}
|
|
6755
|
+
)
|
|
6756
|
+
] }),
|
|
6757
|
+
/* @__PURE__ */ jsxs42(AriaCalendarGrid2, { className: "ddga-calendar__grid", children: [
|
|
6758
|
+
/* @__PURE__ */ jsx56(AriaCalendarGridHeader2, { children: (day) => /* @__PURE__ */ jsx56(AriaCalendarHeaderCell2, { className: "ddga-calendar__weekday", children: day }) }),
|
|
6759
|
+
/* @__PURE__ */ jsx56(AriaCalendarGridBody2, { children: (date) => /* @__PURE__ */ jsx56(AriaCalendarCell2, { date, className: "ddga-calendar__cell", children: ({ formattedDate }) => renderDayContent(formattedDate, {
|
|
6760
|
+
showSecondary: showSecondaryCalendar,
|
|
6761
|
+
date,
|
|
6762
|
+
calendarSystem
|
|
6763
|
+
}) }) })
|
|
6764
|
+
] })
|
|
6765
|
+
]
|
|
6766
|
+
}
|
|
6767
|
+
)
|
|
6768
|
+
]
|
|
6769
|
+
}
|
|
6770
|
+
)
|
|
6771
|
+
}
|
|
6772
|
+
)
|
|
6773
|
+
]
|
|
6774
|
+
}
|
|
6775
|
+
) });
|
|
6776
|
+
}
|
|
6777
|
+
|
|
6778
|
+
// src/components/AspectRatio/AspectRatio.tsx
|
|
6779
|
+
import { Slot as SlotPrimitive15 } from "radix-ui";
|
|
6780
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
6781
|
+
function AspectRatio({ ratio = 1, asChild, className, style, ...props }) {
|
|
6782
|
+
const Comp = asChild ? SlotPrimitive15.Slot : "div";
|
|
6783
|
+
return /* @__PURE__ */ jsx57(
|
|
6784
|
+
Comp,
|
|
6785
|
+
{
|
|
6786
|
+
"data-slot": "aspect-ratio",
|
|
6787
|
+
className: cn("ddga-aspect-ratio", className),
|
|
6788
|
+
style: { "--ddga-aspect-ratio": ratio, ...style },
|
|
6789
|
+
...props
|
|
6790
|
+
}
|
|
6791
|
+
);
|
|
6792
|
+
}
|
|
6793
|
+
|
|
6412
6794
|
// src/providers/DgaProvider.tsx
|
|
6413
|
-
import { useState as
|
|
6795
|
+
import { useState as useState15, useMemo as useMemo7, useContext as useContext14, useEffect as useEffect4, useRef as useRef7 } from "react";
|
|
6414
6796
|
import { Direction as DirectionPrimitive, Tooltip as TooltipPrimitive2 } from "radix-ui";
|
|
6415
6797
|
import { buildTheme } from "@dev-dga/tokens";
|
|
6416
|
-
import { jsx as
|
|
6798
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
6417
6799
|
function DgaProvider({
|
|
6418
6800
|
dir = "ltr",
|
|
6419
6801
|
locale,
|
|
@@ -6424,13 +6806,13 @@ function DgaProvider({
|
|
|
6424
6806
|
style: consumerStyle,
|
|
6425
6807
|
children
|
|
6426
6808
|
}) {
|
|
6427
|
-
const parentCtx =
|
|
6809
|
+
const parentCtx = useContext14(DgaContext);
|
|
6428
6810
|
const isNested = parentCtx !== null;
|
|
6429
|
-
const [rootEl, setRootEl] =
|
|
6811
|
+
const [rootEl, setRootEl] = useState15(null);
|
|
6430
6812
|
const portalRef = useRef7(null);
|
|
6431
|
-
const [portalEl, setPortalEl] =
|
|
6813
|
+
const [portalEl, setPortalEl] = useState15(null);
|
|
6432
6814
|
const resolvedLocale = locale ?? (dir === "rtl" ? "ar" : "en");
|
|
6433
|
-
const themeVars =
|
|
6815
|
+
const themeVars = useMemo7(() => theme ? buildTheme(theme) : null, [theme]);
|
|
6434
6816
|
useEffect4(() => {
|
|
6435
6817
|
if (typeof document === "undefined") return;
|
|
6436
6818
|
const el = document.createElement("div");
|
|
@@ -6458,12 +6840,12 @@ function DgaProvider({
|
|
|
6458
6840
|
}
|
|
6459
6841
|
}
|
|
6460
6842
|
}, [mode, dir, themeVars, portalEl]);
|
|
6461
|
-
const ctxValue =
|
|
6843
|
+
const ctxValue = useMemo7(
|
|
6462
6844
|
() => ({ dir, locale: resolvedLocale, mode, rootEl, portalEl }),
|
|
6463
6845
|
[dir, resolvedLocale, mode, rootEl, portalEl]
|
|
6464
6846
|
);
|
|
6465
|
-
const inner = /* @__PURE__ */
|
|
6466
|
-
return /* @__PURE__ */
|
|
6847
|
+
const inner = /* @__PURE__ */ jsx58(DirectionPrimitive.Provider, { dir, children });
|
|
6848
|
+
return /* @__PURE__ */ jsx58(DgaContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx58(
|
|
6467
6849
|
Component,
|
|
6468
6850
|
{
|
|
6469
6851
|
ref: setRootEl,
|
|
@@ -6473,7 +6855,7 @@ function DgaProvider({
|
|
|
6473
6855
|
"data-theme": mode,
|
|
6474
6856
|
className,
|
|
6475
6857
|
style: { colorScheme: mode, ...themeVars ?? {}, ...consumerStyle },
|
|
6476
|
-
children: isNested ? inner : /* @__PURE__ */
|
|
6858
|
+
children: isNested ? inner : /* @__PURE__ */ jsx58(TooltipPrimitive2.Provider, { delayDuration: 300, skipDelayDuration: 100, children: inner })
|
|
6477
6859
|
}
|
|
6478
6860
|
) });
|
|
6479
6861
|
}
|
|
@@ -6485,6 +6867,7 @@ export {
|
|
|
6485
6867
|
Alert,
|
|
6486
6868
|
AlertDescription,
|
|
6487
6869
|
AlertTitle,
|
|
6870
|
+
AspectRatio,
|
|
6488
6871
|
Avatar,
|
|
6489
6872
|
AvatarFallback,
|
|
6490
6873
|
AvatarGroup,
|
|
@@ -6523,6 +6906,7 @@ export {
|
|
|
6523
6906
|
CommandList,
|
|
6524
6907
|
CommandSeparator,
|
|
6525
6908
|
DatePicker,
|
|
6909
|
+
DateRangePicker,
|
|
6526
6910
|
DescriptionDetails,
|
|
6527
6911
|
DescriptionItem,
|
|
6528
6912
|
DescriptionList,
|
|
@@ -6695,6 +7079,8 @@ export {
|
|
|
6695
7079
|
createToast,
|
|
6696
7080
|
createToastStore,
|
|
6697
7081
|
datePickerVariants,
|
|
7082
|
+
dateRangePickerTriggerVariants,
|
|
7083
|
+
dateRangePickerVariants,
|
|
6698
7084
|
descriptionListVariants,
|
|
6699
7085
|
dividerVariants,
|
|
6700
7086
|
drawerVariants,
|