@datum-cloud/datum-ui 3.7.1 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-navigation/index.mjs +1 -1
- package/dist/{app-navigation-Bcx7hr9L.mjs → app-navigation-DyNZwlSG.mjs} +4 -4
- package/dist/assistant/index.mjs +9 -8
- package/dist/autocomplete/index.mjs +1 -1
- package/dist/{autocomplete-fSSmRLYK.mjs → autocomplete-CrCbO2VS.mjs} +12 -6
- package/dist/autosearch/index.mjs +3 -3
- package/dist/badge/index.mjs +182 -1
- package/dist/button/index.mjs +2 -2
- package/dist/{button-Dj6cKrWj.mjs → button-Cn4KagBO.mjs} +1 -1
- package/dist/{button-BU8TEbJ5.mjs → button-IK-Lnu_9.mjs} +1 -1
- package/dist/button-group/index.mjs +1 -1
- package/dist/{button-group-C3GKo-0p.mjs → button-group-DJ6X1SSj.mjs} +2 -2
- package/dist/{calendar-date-picker-BUwgVaI1.mjs → calendar-date-picker-BRKs56gR.mjs} +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/{card-save-bar-0XDpAJo_.mjs → card-save-bar-Te8jf-ie.mjs} +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/checkbox-BAo5sbHk.mjs +84 -0
- package/dist/collapsible/index.mjs +1 -6
- package/dist/collapsible-B-KP3JZ-.mjs +104 -0
- package/dist/components/base/checkbox/checkbox.d.ts +11 -3
- package/dist/components/base/collapsible/collapsible.d.ts +28 -0
- package/dist/components/base/collapsible/index.d.ts +1 -1
- package/dist/components/base/radio-group/radio-group.d.ts +11 -5
- package/dist/components/base/spinner/index.d.ts +1 -1
- package/dist/components/base/spinner/spinner.d.ts +11 -0
- package/dist/components/base/switch/switch.d.ts +6 -1
- package/dist/components/base/typography/typography.d.ts +1 -1
- package/dist/components/features/_shared/copy-state-icon.d.ts +12 -0
- package/dist/components/features/_shared/index.d.ts +2 -0
- package/dist/components/features/_shared/motion-chip.d.ts +293 -0
- package/dist/components/features/logs/hooks/use-logs-url-state.d.ts +59 -0
- package/dist/components/features/logs/index.d.ts +4 -1
- package/dist/components/features/logs/utils/facet-counts.d.ts +50 -0
- package/dist/components/features/logs/utils/facets.d.ts +2 -0
- package/dist/components/features/logs/utils/index.d.ts +4 -0
- package/dist/components/features/logs/utils/url-state.d.ts +61 -0
- package/dist/components/icons/spinner.icon.d.ts +17 -3
- package/dist/copy-state-icon-DMvXXsZm.mjs +61 -0
- package/dist/data-table/index.mjs +1 -1
- package/dist/{data-table-s2YrE79S.mjs → data-table-DFUnUydN.mjs} +8 -8
- package/dist/date-picker/index.mjs +3 -3
- package/dist/date-time-picker/index.mjs +1 -1
- package/dist/{date-time-picker-CLdaGiGC.mjs → date-time-picker-BRMm2QSz.mjs} +1 -1
- package/dist/{date-time-range-picker-RZX4CS4b.mjs → date-time-range-picker-CqGGJTLS.mjs} +20 -9
- package/dist/dropzone/index.mjs +1 -1
- package/dist/{dropzone-Cer9E-VH.mjs → dropzone-qKYfSe7o.mjs} +1 -1
- package/dist/empty-content/index.mjs +1 -1
- package/dist/{empty-content-B2FZ9cyt.mjs → empty-content-CTMHak36.mjs} +1 -1
- package/dist/field-styles-D-FJatHt.mjs +31 -0
- package/dist/form/index.mjs +1 -1
- package/dist/form/stepper/index.mjs +1 -1
- package/dist/{form-C4XcxxjK.mjs → form-VdbSqDjL.mjs} +20 -13
- package/dist/grouped-table/index.mjs +1 -1
- package/dist/{grouped-table-32RO2v7U.mjs → grouped-table-B4HzLXq6.mjs} +3 -3
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +7 -2
- package/dist/icons/index.mjs +1 -1
- package/dist/index.mjs +37 -37
- package/dist/{layers-XEND2WKv.mjs → layers-BC1Ny49w.mjs} +11 -3
- package/dist/loader-overlay/index.mjs +1 -1
- package/dist/{loader-overlay-JvB8IQo3.mjs → loader-overlay-DP0pvHuG.mjs} +1 -1
- package/dist/logs/index.mjs +412 -115
- package/dist/map/index.mjs +1 -1
- package/dist/more-actions/index.mjs +1 -1
- package/dist/{more-actions-D9k1ILzT.mjs → more-actions-DXQiV-bN.mjs} +2 -2
- package/dist/motion-chip-BczV7spP.mjs +52 -0
- package/dist/multi-select/index.mjs +1 -1
- package/dist/{multi-select-BUgx6VZF.mjs → multi-select-DwcsJdHt.mjs} +82 -66
- package/dist/picker/index.mjs +2 -2
- package/dist/{picker-C0h30DHf.mjs → picker-BHPtncpv.mjs} +2 -2
- package/dist/radio-group/index.mjs +1 -1
- package/dist/radio-group-Boxi2hm0.mjs +83 -0
- package/dist/responsive-dropdown/index.mjs +1 -1
- package/dist/{responsive-dropdown-DsWgpE_i.mjs → responsive-dropdown-B9cDUeHt.mjs} +1 -1
- package/dist/responsive-popover/index.mjs +1 -1
- package/dist/{responsive-popover-DJYd8lOK.mjs → responsive-popover-B_pUxrZ1.mjs} +1 -1
- package/dist/rich-text-editor/index.mjs +1 -1
- package/dist/{rich-text-editor-ibngjhQV.mjs → rich-text-editor-CPd_6vdZ.mjs} +2 -2
- package/dist/select/index.mjs +1 -1
- package/dist/{select-DemYhwnG.mjs → select-B0Xlz-wD.mjs} +3 -2
- package/dist/{select-jgK6wyXj.mjs → select-CGsHf70u.mjs} +7 -2
- package/dist/spinner/index.mjs +1 -1
- package/dist/spinner-DSlDJdWl.mjs +23 -0
- package/dist/spinner.icon-BiUnMAxw.mjs +104 -0
- package/dist/switch/index.mjs +1 -1
- package/dist/switch-IduVwiPZ.mjs +114 -0
- package/dist/tabs/index.mjs +1 -1
- package/dist/tag-input/index.mjs +1 -1
- package/dist/{tag-input-DAMY703F.mjs → tag-input-a3ktkGrH.mjs} +39 -32
- package/dist/task-queue/index.mjs +1 -1
- package/dist/{task-queue-dropdown-BgQSGDwg.mjs → task-queue-dropdown-BflEFiMi.mjs} +4 -4
- package/dist/time-picker/index.mjs +1 -1
- package/dist/{time-picker-DgHjdcMZ.mjs → time-picker-BFwH-Vd3.mjs} +1 -1
- package/dist/{to-api-format-EZInfj0_.mjs → to-api-format-BiWOTFha.mjs} +4 -4
- package/dist/transfer/index.mjs +1 -1
- package/dist/{transfer-91lwTOhX.mjs → transfer-DGUeAQUL.mjs} +1 -1
- package/dist/{use-breakpoint-zY_JYINK.mjs → use-breakpoint-Ce5tS4cU.mjs} +11 -5
- package/dist/{use-option-picker-CBMU72LU.mjs → use-option-picker-DXY2SNnT.mjs} +2 -2
- package/dist/utils/field-styles.d.ts +21 -0
- package/package.json +1 -4
- package/dist/badge-D7A6GfWn.mjs +0 -182
- package/dist/checkbox-CNljVnKj.mjs +0 -28
- package/dist/radio-group-0RxTmRnF.mjs +0 -43
- package/dist/spinner-DjEpx6Q3.mjs +0 -13
- package/dist/spinner.icon-D0SKuGFG.mjs +0 -47
- package/dist/switch-CWvVN9ea.mjs +0 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as MultiSelect } from "../multi-select-
|
|
1
|
+
export { t as MultiSelect } from "../multi-select-DwcsJdHt.mjs";
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
+
import { n as fieldPlaceholderClassName, r as fieldTriggerClassName, t as fieldIconClassName } from "./field-styles-D-FJatHt.mjs";
|
|
2
3
|
import { t as useControllableState } from "./use-controllable-state-DLeVgbAb.mjs";
|
|
3
|
-
import { n as OptionList, t as useOptionPicker } from "./use-option-picker-
|
|
4
|
-
import { t as ResponsivePopover } from "./responsive-popover-
|
|
4
|
+
import { n as OptionList, t as useOptionPicker } from "./use-option-picker-DXY2SNnT.mjs";
|
|
5
|
+
import { t as ResponsivePopover } from "./responsive-popover-B_pUxrZ1.mjs";
|
|
5
6
|
import { t as Separator } from "./separator-DNiiN2BN.mjs";
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
7
|
+
import { t as Icon } from "./icon-wrapper-CIk2th6R.mjs";
|
|
8
|
+
import { t as LoaderOverlay } from "./loader-overlay-DP0pvHuG.mjs";
|
|
9
|
+
import { n as useChipMotion, t as MotionBadge } from "./motion-chip-BczV7spP.mjs";
|
|
8
10
|
import { cva } from "class-variance-authority";
|
|
9
11
|
import { CheckIcon, ChevronDown, WandSparkles, XCircle, XIcon } from "lucide-react";
|
|
10
12
|
import * as React from "react";
|
|
11
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { AnimatePresence } from "motion/react";
|
|
12
15
|
// src/components/features/multi-select/multi-select-options.tsx
|
|
13
16
|
/**
|
|
14
17
|
* Presentational popover command list for the multi-select: the searchable
|
|
@@ -88,70 +91,84 @@ function IconAction({ label, onActivate, className, children }) {
|
|
|
88
91
|
function SelectedBadgeList({ selectedOptions, maxCount, variant, badgeClassName, clickableBadges, isAnimating, animation, onRemove, onClearExtra, onClearAll, onBadgeClick }) {
|
|
89
92
|
const visibleOptions = selectedOptions.slice(0, maxCount === -1 ? void 0 : maxCount);
|
|
90
93
|
const overflowCount = maxCount === -1 ? 0 : selectedOptions.length - maxCount;
|
|
94
|
+
const chipMotion = useChipMotion();
|
|
91
95
|
return /* @__PURE__ */ jsxs("div", {
|
|
92
|
-
className: "flex w-full items-center justify-between",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
94
|
-
className: "flex flex-wrap items-center gap-2",
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
96
|
+
className: "flex w-full items-center justify-between gap-2",
|
|
97
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: "relative flex min-w-0 flex-wrap items-center gap-2",
|
|
99
|
+
children: /* @__PURE__ */ jsxs(AnimatePresence, {
|
|
100
|
+
initial: false,
|
|
101
|
+
mode: "popLayout",
|
|
102
|
+
children: [visibleOptions.map((option) => {
|
|
103
|
+
const IconComponent = option.icon;
|
|
104
|
+
return /* @__PURE__ */ jsxs(MotionBadge, {
|
|
105
|
+
...chipMotion,
|
|
106
|
+
className: cn(multiSelectVariants({ variant }), "truncate", isAnimating && "animate-bounce", clickableBadges && "cursor-pointer", badgeClassName),
|
|
107
|
+
style: { animationDuration: `${animation}s` },
|
|
108
|
+
onClick: (event) => {
|
|
109
|
+
if (clickableBadges) {
|
|
110
|
+
event.stopPropagation();
|
|
111
|
+
event.preventDefault();
|
|
112
|
+
onBadgeClick?.(option);
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
children: [
|
|
116
|
+
IconComponent && /* @__PURE__ */ jsx(IconComponent, { className: "text-muted-foreground size-3" }),
|
|
117
|
+
/* @__PURE__ */ jsx("span", {
|
|
118
|
+
className: "max-w-[120px] truncate",
|
|
119
|
+
children: option.label
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ jsx(IconAction, {
|
|
122
|
+
label: `Remove ${option.label}`,
|
|
123
|
+
onActivate: () => onRemove(option.value),
|
|
124
|
+
className: "text-muted-foreground ml-1",
|
|
125
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
126
|
+
icon: XCircle,
|
|
127
|
+
size: 12,
|
|
128
|
+
className: "size-3",
|
|
129
|
+
"aria-hidden": "true"
|
|
130
|
+
})
|
|
120
131
|
})
|
|
132
|
+
]
|
|
133
|
+
}, option.value);
|
|
134
|
+
}), overflowCount > 0 && /* @__PURE__ */ jsxs(MotionBadge, {
|
|
135
|
+
...chipMotion,
|
|
136
|
+
className: cn(multiSelectVariants({ variant }), "text-muted-foreground", isAnimating && "animate-bounce"),
|
|
137
|
+
style: { animationDuration: `${animation}s` },
|
|
138
|
+
children: [`+ ${overflowCount} more`, /* @__PURE__ */ jsx(IconAction, {
|
|
139
|
+
label: "Clear extra selected",
|
|
140
|
+
onActivate: onClearExtra,
|
|
141
|
+
className: "text-muted-foreground ml-1",
|
|
142
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
143
|
+
icon: XCircle,
|
|
144
|
+
size: 12,
|
|
145
|
+
className: "size-3",
|
|
146
|
+
"aria-hidden": "true"
|
|
121
147
|
})
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
|
-
})
|
|
125
|
-
className: cn(multiSelectVariants({ variant }), "text-muted-foreground", isAnimating && "animate-bounce"),
|
|
126
|
-
style: { animationDuration: `${animation}s` },
|
|
127
|
-
children: [`+ ${overflowCount} more`, /* @__PURE__ */ jsx(IconAction, {
|
|
128
|
-
label: "Clear extra selected",
|
|
129
|
-
onActivate: onClearExtra,
|
|
130
|
-
className: "text-muted-foreground ml-1",
|
|
131
|
-
children: /* @__PURE__ */ jsx(XCircle, {
|
|
132
|
-
className: "size-3",
|
|
133
|
-
"aria-hidden": "true"
|
|
134
|
-
})
|
|
135
|
-
})]
|
|
136
|
-
})]
|
|
148
|
+
})]
|
|
149
|
+
}, "overflow")]
|
|
150
|
+
})
|
|
137
151
|
}), /* @__PURE__ */ jsxs("div", {
|
|
138
|
-
className: "flex items-center
|
|
152
|
+
className: "flex shrink-0 items-center gap-2",
|
|
139
153
|
children: [
|
|
140
154
|
/* @__PURE__ */ jsx(IconAction, {
|
|
141
155
|
label: "Clear all",
|
|
142
156
|
onActivate: onClearAll,
|
|
143
|
-
className: "text-muted-foreground
|
|
144
|
-
children: /* @__PURE__ */ jsx(
|
|
145
|
-
|
|
157
|
+
className: "text-muted-foreground hover:text-foreground rounded-sm",
|
|
158
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
159
|
+
icon: XIcon,
|
|
160
|
+
size: 14,
|
|
161
|
+
className: "size-3.5 shrink-0",
|
|
146
162
|
"aria-hidden": "true"
|
|
147
163
|
})
|
|
148
164
|
}),
|
|
149
165
|
/* @__PURE__ */ jsx("span", {
|
|
150
|
-
className: "bg-border
|
|
166
|
+
className: "bg-border h-4 w-px",
|
|
151
167
|
"aria-hidden": "true"
|
|
152
168
|
}),
|
|
153
|
-
/* @__PURE__ */ jsx(
|
|
154
|
-
|
|
169
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
170
|
+
icon: ChevronDown,
|
|
171
|
+
className: fieldIconClassName,
|
|
155
172
|
"aria-hidden": "true"
|
|
156
173
|
})
|
|
157
174
|
]
|
|
@@ -230,6 +247,7 @@ function MultiSelect({ options, onValueChange, variant, defaultValue = EMPTY_ARR
|
|
|
230
247
|
]
|
|
231
248
|
})]
|
|
232
249
|
})] }) : void 0;
|
|
250
|
+
const showBadges = hasSelection && !isLoading && options.length > 0;
|
|
233
251
|
const triggerJSX = /* @__PURE__ */ jsxs("button", {
|
|
234
252
|
...rest,
|
|
235
253
|
type: "button",
|
|
@@ -239,8 +257,8 @@ function MultiSelect({ options, onValueChange, variant, defaultValue = EMPTY_ARR
|
|
|
239
257
|
onTriggerClick?.(event);
|
|
240
258
|
setIsPopoverOpen((prev) => !prev);
|
|
241
259
|
},
|
|
242
|
-
className: cn(
|
|
243
|
-
children: [
|
|
260
|
+
className: cn(fieldTriggerClassName, "relative min-h-10 justify-between py-1", (disabled || isLoading) && "cursor-not-allowed opacity-50", className),
|
|
261
|
+
children: [showBadges ? /* @__PURE__ */ jsx(SelectedBadgeList, {
|
|
244
262
|
selectedOptions,
|
|
245
263
|
maxCount,
|
|
246
264
|
variant,
|
|
@@ -252,16 +270,14 @@ function MultiSelect({ options, onValueChange, variant, defaultValue = EMPTY_ARR
|
|
|
252
270
|
onClearExtra: clearExtraOptions,
|
|
253
271
|
onClearAll: handleClear,
|
|
254
272
|
onBadgeClick
|
|
255
|
-
}) : /* @__PURE__ */ jsxs("
|
|
256
|
-
className: "
|
|
257
|
-
children:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
})]
|
|
264
|
-
}), isLoading && /* @__PURE__ */ jsx(LoaderOverlay, { className: "rounded-lg" })]
|
|
273
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
274
|
+
className: cn("min-w-0 flex-1 truncate", fieldPlaceholderClassName),
|
|
275
|
+
children: placeholder
|
|
276
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
277
|
+
icon: ChevronDown,
|
|
278
|
+
className: fieldIconClassName,
|
|
279
|
+
"aria-hidden": "true"
|
|
280
|
+
})] }), isLoading && /* @__PURE__ */ jsx(LoaderOverlay, { className: "rounded-lg" })]
|
|
265
281
|
});
|
|
266
282
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
267
283
|
/* @__PURE__ */ jsx(ResponsivePopover, {
|
package/dist/picker/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as formatInTimezone, B as isDateBearingMode, C as PickerClear, D as PickerCalendar, E as PickerContent, F as zonedDateToIso, H as isTimeBearingMode, I as ALLOWED_STEPS, L as DATE_BEARING_MODES, M as getBrowserTimezone, N as getTimezoneOffset, O as PickerContext, P as isoToZonedDate, R as RANGE_MODES, S as PickerCancel, T as PickerReset, V as isRangeMode, _ as parseTimeString, a as PickerTimezoneIndicator, b as PickerPresets, d as DATE_PRESETS, f as getDefaultPresets, g as isValidTimeString, h as formatTimeLabel, i as PickerTrigger, j as formatTimezoneLabel, k as usePickerContext, l as usePresets, m as dateToYYYYMMDD, o as PickerTimeInput, p as usePickerState, r as formatPickerValue, s as useTimeSlots, t as DateTimeRangePicker, u as DATETIME_PRESETS, v as resolveCommit, w as PickerFooter, x as PickerApply, y as useKeyboardShortcuts, z as TIME_BEARING_MODES } from "../date-time-range-picker-
|
|
2
|
-
import { a as DateRangePicker, c as getDaysDifference, d as isSameDateRange, f as isSameStringRange, i as DateRangeTimePicker, l as isRangeValid, m as PickerTimezoneSelect, n as TimePicker, o as DatePicker, p as Picker, r as DateTimePicker, s as clampRange, t as TimeRangePicker, u as isSameDate } from "../picker-
|
|
1
|
+
import { A as formatInTimezone, B as isDateBearingMode, C as PickerClear, D as PickerCalendar, E as PickerContent, F as zonedDateToIso, H as isTimeBearingMode, I as ALLOWED_STEPS, L as DATE_BEARING_MODES, M as getBrowserTimezone, N as getTimezoneOffset, O as PickerContext, P as isoToZonedDate, R as RANGE_MODES, S as PickerCancel, T as PickerReset, V as isRangeMode, _ as parseTimeString, a as PickerTimezoneIndicator, b as PickerPresets, d as DATE_PRESETS, f as getDefaultPresets, g as isValidTimeString, h as formatTimeLabel, i as PickerTrigger, j as formatTimezoneLabel, k as usePickerContext, l as usePresets, m as dateToYYYYMMDD, o as PickerTimeInput, p as usePickerState, r as formatPickerValue, s as useTimeSlots, t as DateTimeRangePicker, u as DATETIME_PRESETS, v as resolveCommit, w as PickerFooter, x as PickerApply, y as useKeyboardShortcuts, z as TIME_BEARING_MODES } from "../date-time-range-picker-CqGGJTLS.mjs";
|
|
2
|
+
import { a as DateRangePicker, c as getDaysDifference, d as isSameDateRange, f as isSameStringRange, i as DateRangeTimePicker, l as isRangeValid, m as PickerTimezoneSelect, n as TimePicker, o as DatePicker, p as Picker, r as DateTimePicker, s as clampRange, t as TimeRangePicker, u as isSameDate } from "../picker-BHPtncpv.mjs";
|
|
3
3
|
export { ALLOWED_STEPS, DATETIME_PRESETS, DATE_BEARING_MODES, DATE_PRESETS, DatePicker, DateRangePicker, DateRangeTimePicker, DateTimePicker, DateTimeRangePicker, Picker, PickerApply, PickerCalendar, PickerCancel, PickerClear, PickerContent, PickerContext, PickerFooter, PickerPresets, PickerReset, PickerTimeInput, PickerTimezoneIndicator, PickerTimezoneSelect, PickerTrigger, RANGE_MODES, TIME_BEARING_MODES, TimePicker, TimeRangePicker, clampRange, dateToYYYYMMDD, formatInTimezone, formatPickerValue, formatTimeLabel, formatTimezoneLabel, getBrowserTimezone, getDaysDifference, getDefaultPresets, getTimezoneOffset, isDateBearingMode, isRangeMode, isRangeValid, isSameDate, isSameDateRange, isSameStringRange, isTimeBearingMode, isValidTimeString, isoToZonedDate, parseTimeString, resolveCommit, useKeyboardShortcuts, usePickerContext, usePickerState, usePresets, useTimeSlots, zonedDateToIso };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
-
import { i as SelectItem, l as SelectTrigger, n as SelectContent, t as Select, u as SelectValue } from "./select-
|
|
3
|
-
import { C as PickerClear, D as PickerCalendar, E as PickerContent, F as zonedDateToIso, H as isTimeBearingMode, P as isoToZonedDate, S as PickerCancel, T as PickerReset, _ as parseTimeString, a as PickerTimezoneIndicator, b as PickerPresets, c as Picker$1, i as PickerTrigger, k as usePickerContext, n as DefaultFooter, o as PickerTimeInput, r as formatPickerValue, w as PickerFooter, x as PickerApply } from "./date-time-range-picker-
|
|
2
|
+
import { i as SelectItem, l as SelectTrigger, n as SelectContent, t as Select, u as SelectValue } from "./select-CGsHf70u.mjs";
|
|
3
|
+
import { C as PickerClear, D as PickerCalendar, E as PickerContent, F as zonedDateToIso, H as isTimeBearingMode, P as isoToZonedDate, S as PickerCancel, T as PickerReset, _ as parseTimeString, a as PickerTimezoneIndicator, b as PickerPresets, c as Picker$1, i as PickerTrigger, k as usePickerContext, n as DefaultFooter, o as PickerTimeInput, r as formatPickerValue, w as PickerFooter, x as PickerApply } from "./date-time-range-picker-CqGGJTLS.mjs";
|
|
4
4
|
import { Clock, Globe } from "lucide-react";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as RadioGroup, n as RadioGroupItem } from "../radio-group-
|
|
1
|
+
export { t as RadioGroup, n as RadioGroupItem } from "../radio-group-Boxi2hm0.mjs";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
+
import { n as EASE } from "./motion-DOrRbLmy.mjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
6
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
7
|
+
// src/components/base/radio-group/radio-group.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The selected value, mirrored from Radix so each item can animate its dot in
|
|
10
|
+
* and out. `null` means there is no datum `RadioGroup` above the item (it was
|
|
11
|
+
* placed in a bare Radix root), in which case the item falls back to Radix's
|
|
12
|
+
* own mount/unmount and does not animate.
|
|
13
|
+
*/
|
|
14
|
+
const RadioGroupValueContext = React.createContext(null);
|
|
15
|
+
function RadioGroup({ ref, className, value: valueProp, defaultValue, onValueChange, ...props }) {
|
|
16
|
+
const [uncontrolled, setUncontrolled] = React.useState(defaultValue);
|
|
17
|
+
const value = valueProp ?? uncontrolled;
|
|
18
|
+
const handleValueChange = React.useCallback((next) => {
|
|
19
|
+
if (valueProp === void 0) setUncontrolled(next);
|
|
20
|
+
onValueChange?.(next);
|
|
21
|
+
}, [onValueChange, valueProp]);
|
|
22
|
+
return /* @__PURE__ */ jsx(RadioGroupValueContext, {
|
|
23
|
+
value,
|
|
24
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
25
|
+
ref,
|
|
26
|
+
"data-slot": "radio-group",
|
|
27
|
+
className: cn("grid gap-3", className),
|
|
28
|
+
value: valueProp,
|
|
29
|
+
defaultValue,
|
|
30
|
+
onValueChange: handleValueChange,
|
|
31
|
+
...props
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
RadioGroup.displayName = "RadioGroup";
|
|
36
|
+
const DOT_IN = {
|
|
37
|
+
type: "spring",
|
|
38
|
+
visualDuration: .2,
|
|
39
|
+
bounce: .35
|
|
40
|
+
};
|
|
41
|
+
const DOT_OUT = {
|
|
42
|
+
duration: .1,
|
|
43
|
+
ease: EASE.out
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* RadioGroupItem renders the Radix primitive directly (not the shadcn wrapper)
|
|
47
|
+
* so the dot can stay mounted and animate out as well as in. The dot pops in
|
|
48
|
+
* from half size with a small spring and fades out quickly when another option
|
|
49
|
+
* takes the selection. Under reduced motion it only fades.
|
|
50
|
+
*/
|
|
51
|
+
function RadioGroupItem({ ref, className, value, ...props }) {
|
|
52
|
+
const groupValue = React.use(RadioGroupValueContext);
|
|
53
|
+
const reduceMotion = Boolean(useReducedMotion());
|
|
54
|
+
const animated = groupValue !== null;
|
|
55
|
+
const visible = animated ? groupValue === value : true;
|
|
56
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
57
|
+
ref,
|
|
58
|
+
value,
|
|
59
|
+
"data-slot": "radio-group-item",
|
|
60
|
+
className: cn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", "transition-[color,box-shadow,transform] duration-[var(--duration-fast)] ease-out active:scale-[0.92] disabled:active:scale-100", className),
|
|
61
|
+
...props,
|
|
62
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
63
|
+
forceMount: animated ? true : void 0,
|
|
64
|
+
"data-slot": "radio-group-indicator",
|
|
65
|
+
className: "flex size-full items-center justify-center",
|
|
66
|
+
children: /* @__PURE__ */ jsx(motion.span, {
|
|
67
|
+
"aria-hidden": true,
|
|
68
|
+
className: "bg-primary size-2 rounded-full",
|
|
69
|
+
initial: false,
|
|
70
|
+
animate: visible ? {
|
|
71
|
+
scale: 1,
|
|
72
|
+
opacity: 1
|
|
73
|
+
} : {
|
|
74
|
+
scale: reduceMotion ? 1 : .5,
|
|
75
|
+
opacity: 0
|
|
76
|
+
},
|
|
77
|
+
transition: visible && !reduceMotion ? DOT_IN : DOT_OUT
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
83
|
+
export { RadioGroupItem as n, RadioGroup as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as ResponsiveDropdown } from "../responsive-dropdown-
|
|
1
|
+
export { t as ResponsiveDropdown } from "../responsive-dropdown-B9cDUeHt.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as useBreakpoint } from "./use-breakpoint-
|
|
1
|
+
import { t as useBreakpoint } from "./use-breakpoint-Ce5tS4cU.mjs";
|
|
2
2
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
3
3
|
import { i as useInSheet, t as ResponsiveSheetTrigger } from "./mobile-sheet-1995HYY_.mjs";
|
|
4
4
|
import { i as PopoverTrigger, r as PopoverContent, t as Popover } from "./popover-7YxyP_W0.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as ResponsivePopover } from "../responsive-popover-
|
|
1
|
+
export { t as ResponsivePopover } from "../responsive-popover-B_pUxrZ1.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as useBreakpoint } from "./use-breakpoint-
|
|
1
|
+
import { t as useBreakpoint } from "./use-breakpoint-Ce5tS4cU.mjs";
|
|
2
2
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
3
3
|
import { i as useInSheet, t as ResponsiveSheetTrigger } from "./mobile-sheet-1995HYY_.mjs";
|
|
4
4
|
import { i as PopoverTrigger, r as PopoverContent, t as Popover } from "./popover-7YxyP_W0.mjs";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as RichTextContent } from "../rich-text-content-BiIIowBU.mjs";
|
|
2
|
-
import { n as useRichTextEditor, t as RichTextEditor } from "../rich-text-editor-
|
|
2
|
+
import { n as useRichTextEditor, t as RichTextEditor } from "../rich-text-editor-CPd_6vdZ.mjs";
|
|
3
3
|
export { RichTextContent, RichTextEditor, useRichTextEditor };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
2
|
import { t as Tooltip } from "./tooltip-OIySjJWW.mjs";
|
|
3
|
-
import { t as Button } from "./button-
|
|
3
|
+
import { t as Button } from "./button-Cn4KagBO.mjs";
|
|
4
4
|
import { t as Input } from "./input-DsT5qkJn.mjs";
|
|
5
|
-
import { t as ResponsivePopover } from "./responsive-popover-
|
|
5
|
+
import { t as ResponsivePopover } from "./responsive-popover-B_pUxrZ1.mjs";
|
|
6
6
|
import { t as Icon } from "./icon-wrapper-CIk2th6R.mjs";
|
|
7
7
|
import { BoldIcon, ItalicIcon, LinkIcon, StrikethroughIcon, UnderlineIcon, UnlinkIcon } from "lucide-react";
|
|
8
8
|
import { createContext, use, useCallback, useEffect, useState } from "react";
|
package/dist/select/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Select, n as SelectContent, r as SelectGroup, i as SelectItem, a as SelectLabel, o as SelectScrollDownButton, s as SelectScrollUpButton, c as SelectSeparator, l as SelectTrigger, u as SelectValue } from "../select-
|
|
1
|
+
export { t as Select, n as SelectContent, r as SelectGroup, i as SelectItem, a as SelectLabel, o as SelectScrollDownButton, s as SelectScrollUpButton, c as SelectSeparator, l as SelectTrigger, u as SelectValue } from "../select-B0Xlz-wD.mjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { a as SelectLabel$1, c as SelectSeparator$1, i as SelectItem$1, l as SelectTrigger$1, n as SelectContent$1, o as SelectScrollDownButton$1, r as SelectGroup$1, s as SelectScrollUpButton$1, t as Select$1, u as SelectValue$1 } from "./select-
|
|
1
|
+
import { a as SelectLabel$1, c as SelectSeparator$1, i as SelectItem$1, l as SelectTrigger$1, n as SelectContent$1, o as SelectScrollDownButton$1, r as SelectGroup$1, s as SelectScrollUpButton$1, t as Select$1, u as SelectValue$1 } from "./select-CGsHf70u.mjs";
|
|
2
2
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
3
|
+
import { r as fieldTriggerClassName } from "./field-styles-D-FJatHt.mjs";
|
|
3
4
|
import "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
// src/components/base/select/select.tsx
|
|
@@ -16,7 +17,7 @@ SelectGroup.displayName = "SelectGroup";
|
|
|
16
17
|
function SelectTrigger({ ref, className, ...props }) {
|
|
17
18
|
return /* @__PURE__ */ jsx(SelectTrigger$1, {
|
|
18
19
|
ref,
|
|
19
|
-
className: cn(
|
|
20
|
+
className: cn(fieldTriggerClassName, "data-[placeholder]:text-input-placeholder", className),
|
|
20
21
|
...props
|
|
21
22
|
});
|
|
22
23
|
}
|
|
@@ -25,11 +25,16 @@ function SelectValue({ ...props }) {
|
|
|
25
25
|
function SelectTrigger({ className, children, ...props }) {
|
|
26
26
|
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
27
27
|
"data-slot": "select-trigger",
|
|
28
|
-
className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive rounded-md border bg-transparent py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "flex h-auto min-h-10 w-full items-center justify-between px-3 text-sm font-
|
|
28
|
+
className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive rounded-md border bg-transparent py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "flex h-auto min-h-10 w-full items-center justify-between gap-2 px-3 text-sm font-normal", className),
|
|
29
29
|
...props,
|
|
30
30
|
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
31
31
|
asChild: true,
|
|
32
|
-
children: /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
32
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
33
|
+
className: "text-muted-foreground size-4 shrink-0",
|
|
34
|
+
size: 16,
|
|
35
|
+
strokeWidth: 1,
|
|
36
|
+
absoluteStrokeWidth: true
|
|
37
|
+
})
|
|
33
38
|
})]
|
|
34
39
|
});
|
|
35
40
|
}
|
package/dist/spinner/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Spinner } from "../spinner-
|
|
1
|
+
export { t as Spinner } from "../spinner-DSlDJdWl.mjs";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
+
import { t as SpinnerIcon } from "./spinner.icon-BiUnMAxw.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/components/base/spinner/spinner.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Standalone loading indicator, announced to assistive tech as a status.
|
|
7
|
+
*
|
|
8
|
+
* Built on `SpinnerIcon`. It differs in three ways: it is `size-4` unless a
|
|
9
|
+
* size class is passed, it carries `role="status"`, and its colour comes from
|
|
10
|
+
* `className` (default `text-primary`), so `<Spinner className="text-white" />`
|
|
11
|
+
* recolours the arc and its track together.
|
|
12
|
+
*/
|
|
13
|
+
function Spinner({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(SpinnerIcon, {
|
|
15
|
+
role: "status",
|
|
16
|
+
"aria-label": "Loading",
|
|
17
|
+
size: null,
|
|
18
|
+
indicatorClassName: "",
|
|
19
|
+
className: cn("text-primary size-4", className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { Spinner as t };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { motion } from "motion/react";
|
|
6
|
+
// src/components/icons/spinner.icon.tsx
|
|
7
|
+
const spinnerVariants = cva("shrink-0", {
|
|
8
|
+
variants: { size: {
|
|
9
|
+
"xs": "size-3",
|
|
10
|
+
"sm": "size-4",
|
|
11
|
+
"md": "size-6",
|
|
12
|
+
"lg": "size-8",
|
|
13
|
+
"xl": "size-10",
|
|
14
|
+
"2xl": "size-12",
|
|
15
|
+
"3xl": "size-14",
|
|
16
|
+
"4xl": "size-16",
|
|
17
|
+
"5xl": "size-18",
|
|
18
|
+
"6xl": "size-20",
|
|
19
|
+
"7xl": "size-22",
|
|
20
|
+
"8xl": "size-24",
|
|
21
|
+
"9xl": "size-26"
|
|
22
|
+
} },
|
|
23
|
+
defaultVariants: { size: "md" }
|
|
24
|
+
});
|
|
25
|
+
/** Seconds per full turn. Quick enough that waiting feels shorter. */
|
|
26
|
+
const REVOLUTION = .8;
|
|
27
|
+
const CENTER = 32;
|
|
28
|
+
const RADIUS = 29;
|
|
29
|
+
/**
|
|
30
|
+
* The indicator: an arc running clockwise from 12 o'clock. Its tail sits at
|
|
31
|
+
* the top and its head at the far end, so the head leads as the spinner turns.
|
|
32
|
+
*/
|
|
33
|
+
const ARC_DEGREES = 150;
|
|
34
|
+
const ARC_END = {
|
|
35
|
+
x: CENTER + RADIUS * Math.sin(ARC_DEGREES * Math.PI / 180),
|
|
36
|
+
y: CENTER - RADIUS * Math.cos(ARC_DEGREES * Math.PI / 180)
|
|
37
|
+
};
|
|
38
|
+
const ARC_PATH = `M ${CENTER} 3 A ${RADIUS} ${RADIUS} 0 0 1 ${ARC_END.x} ${ARC_END.y}`;
|
|
39
|
+
/** Track opacity when it follows the indicator colour. */
|
|
40
|
+
const TRACK_OPACITY = .18;
|
|
41
|
+
/**
|
|
42
|
+
* A loading spinner: a faint full-circle track with an arc that fades from a
|
|
43
|
+
* transparent tail to a solid, rounded head, turning clockwise.
|
|
44
|
+
*
|
|
45
|
+
* The rotation runs through Motion as a full `transform` keyframe animation,
|
|
46
|
+
* which Motion hands to the Web Animations API. That keeps it on the
|
|
47
|
+
* compositor, so the spinner stays smooth while the main thread is busy doing
|
|
48
|
+
* whatever the user is waiting for. It keeps spinning under reduced motion:
|
|
49
|
+
* it is essential loading feedback, not decoration.
|
|
50
|
+
*/
|
|
51
|
+
function SpinnerIcon({ size, className, trackClassName, indicatorClassName = "text-primary", ...props }) {
|
|
52
|
+
const gradientId = `spinner-tail-${React.useId().replace(/[^\w-]/g, "")}`;
|
|
53
|
+
return /* @__PURE__ */ jsx(motion.svg, {
|
|
54
|
+
viewBox: "0 0 64 64",
|
|
55
|
+
fill: "none",
|
|
56
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
57
|
+
"data-slot": "spinner",
|
|
58
|
+
className: cn(spinnerVariants({ size }), className),
|
|
59
|
+
animate: { transform: ["rotate(0deg)", "rotate(360deg)"] },
|
|
60
|
+
transition: {
|
|
61
|
+
duration: REVOLUTION,
|
|
62
|
+
ease: "linear",
|
|
63
|
+
repeat: Infinity
|
|
64
|
+
},
|
|
65
|
+
...props,
|
|
66
|
+
children: /* @__PURE__ */ jsxs("g", {
|
|
67
|
+
className: indicatorClassName,
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
70
|
+
id: gradientId,
|
|
71
|
+
gradientUnits: "userSpaceOnUse",
|
|
72
|
+
x1: CENTER,
|
|
73
|
+
y1: 3,
|
|
74
|
+
x2: ARC_END.x,
|
|
75
|
+
y2: ARC_END.y,
|
|
76
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
77
|
+
offset: "0",
|
|
78
|
+
stopColor: "currentColor",
|
|
79
|
+
stopOpacity: "0"
|
|
80
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
81
|
+
offset: "1",
|
|
82
|
+
stopColor: "currentColor"
|
|
83
|
+
})]
|
|
84
|
+
}) }),
|
|
85
|
+
/* @__PURE__ */ jsx("circle", {
|
|
86
|
+
cx: CENTER,
|
|
87
|
+
cy: CENTER,
|
|
88
|
+
r: RADIUS,
|
|
89
|
+
stroke: "currentColor",
|
|
90
|
+
strokeWidth: "5",
|
|
91
|
+
opacity: trackClassName ? void 0 : TRACK_OPACITY,
|
|
92
|
+
className: trackClassName
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx("path", {
|
|
95
|
+
d: ARC_PATH,
|
|
96
|
+
stroke: `url(#${gradientId})`,
|
|
97
|
+
strokeWidth: "5",
|
|
98
|
+
strokeLinecap: "round"
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
export { SpinnerIcon as t };
|
package/dist/switch/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Switch } from "../switch-
|
|
1
|
+
export { t as Switch } from "../switch-IduVwiPZ.mjs";
|