@datum-cloud/datum-ui 3.7.1 → 3.8.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-D0zAcT78.mjs} +2 -2
- package/dist/autosearch/index.mjs +2 -2
- 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/{calendar-date-picker-BUwgVaI1.mjs → calendar-date-picker-CknZM6a2.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/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-CpBwO8Ea.mjs} +6 -6
- 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-Bc41Ixrs.mjs} +1 -1
- package/dist/{date-time-range-picker-RZX4CS4b.mjs → date-time-range-picker-yy1Acntn.mjs} +2 -2
- 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/form/index.mjs +1 -1
- package/dist/form/stepper/index.mjs +1 -1
- package/dist/{form-C4XcxxjK.mjs → form-DTaVgDSV.mjs} +19 -12
- package/dist/grouped-table/index.mjs +1 -1
- package/dist/{grouped-table-32RO2v7U.mjs → grouped-table-Dl6DclbV.mjs} +3 -3
- package/dist/icons/index.mjs +1 -1
- package/dist/index.mjs +32 -32
- package/dist/{layers-XEND2WKv.mjs → layers-DLUbkJtt.mjs} +10 -2
- 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 +39 -36
- package/dist/map/index.mjs +1 -1
- package/dist/more-actions/index.mjs +1 -1
- package/dist/{more-actions-D9k1ILzT.mjs → more-actions-BlSOVwa8.mjs} +1 -1
- package/dist/motion-chip-BczV7spP.mjs +52 -0
- package/dist/multi-select/index.mjs +1 -1
- package/dist/{multi-select-BUgx6VZF.mjs → multi-select-C2cBrqXl.mjs} +53 -45
- package/dist/picker/index.mjs +2 -2
- package/dist/{picker-C0h30DHf.mjs → picker-DC3GErYg.mjs} +1 -1
- package/dist/radio-group/index.mjs +1 -1
- package/dist/radio-group-Boxi2hm0.mjs +83 -0
- package/dist/rich-text-editor/index.mjs +1 -1
- package/dist/{rich-text-editor-ibngjhQV.mjs → rich-text-editor-BUz06s-b.mjs} +1 -1
- 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-DuCAAybs.mjs} +3 -3
- package/dist/time-picker/index.mjs +1 -1
- package/dist/{time-picker-DgHjdcMZ.mjs → time-picker-B_am4eAK.mjs} +1 -1
- package/dist/{to-api-format-EZInfj0_.mjs → to-api-format-DyImCzCn.mjs} +2 -2
- package/dist/transfer/index.mjs +1 -1
- package/dist/{transfer-91lwTOhX.mjs → transfer-DGUeAQUL.mjs} +1 -1
- package/dist/{use-option-picker-CBMU72LU.mjs → use-option-picker-DXY2SNnT.mjs} +2 -2
- 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,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-BUz06s-b.mjs";
|
|
3
3
|
export { RichTextContent, RichTextEditor, useRichTextEditor };
|
|
@@ -1,6 +1,6 @@
|
|
|
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
5
|
import { t as ResponsivePopover } from "./responsive-popover-DJYd8lOK.mjs";
|
|
6
6
|
import { t as Icon } from "./icon-wrapper-CIk2th6R.mjs";
|
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";
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
+
import { n as EASE, t as DURATION } from "./motion-DOrRbLmy.mjs";
|
|
3
|
+
import { t as useControllableState } from "./use-controllable-state-DLeVgbAb.mjs";
|
|
4
|
+
import { CheckIcon, XIcon } from "lucide-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
9
|
+
// src/components/base/switch/switch.tsx
|
|
10
|
+
/** Thumb diameter in px (`size-5`). */
|
|
11
|
+
const THUMB = 20;
|
|
12
|
+
/** How far the thumb travels: the track's inner width (44 - 2px border) minus the thumb. */
|
|
13
|
+
const TRAVEL = 22;
|
|
14
|
+
/** How much the thumb widens while pressed, toward the side it will move to. */
|
|
15
|
+
const STRETCH = 4;
|
|
16
|
+
const THUMB_SPRING = {
|
|
17
|
+
type: "spring",
|
|
18
|
+
visualDuration: .22,
|
|
19
|
+
bounce: .15
|
|
20
|
+
};
|
|
21
|
+
const GLYPH_TRANSITION = {
|
|
22
|
+
duration: DURATION.fast,
|
|
23
|
+
ease: EASE.out
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Switch renders the Radix primitive directly rather than wrapping the shadcn
|
|
27
|
+
* one, because its state glyphs go inside the thumb. Building it here keeps the
|
|
28
|
+
* shadcn base untouched, so that base can be regenerated from upstream without
|
|
29
|
+
* losing anything of ours.
|
|
30
|
+
*
|
|
31
|
+
* Motion drives the thumb: it slides on a light spring, stretches while the
|
|
32
|
+
* pointer is held down (so the press registers before the release toggles it),
|
|
33
|
+
* and the on/off glyphs cross-fade. Under reduced motion the thumb moves
|
|
34
|
+
* instantly and only the glyphs fade.
|
|
35
|
+
*/
|
|
36
|
+
function Switch({ ref, className, checked: checkedProp, defaultChecked, onCheckedChange, onPointerDown, onPointerUp, onPointerLeave, onPointerCancel, ...props }) {
|
|
37
|
+
const [checked, setChecked] = useControllableState(checkedProp, defaultChecked ?? false, onCheckedChange);
|
|
38
|
+
const [pressed, setPressed] = React.useState(false);
|
|
39
|
+
const reduceMotion = Boolean(useReducedMotion());
|
|
40
|
+
const stretch = pressed && !reduceMotion && !props.disabled ? STRETCH : 0;
|
|
41
|
+
const x = checked ? TRAVEL - stretch : 0;
|
|
42
|
+
return /* @__PURE__ */ jsx(SwitchPrimitive.Root, {
|
|
43
|
+
ref,
|
|
44
|
+
"data-slot": "switch",
|
|
45
|
+
checked,
|
|
46
|
+
onCheckedChange: setChecked,
|
|
47
|
+
onPointerDown: (event) => {
|
|
48
|
+
onPointerDown?.(event);
|
|
49
|
+
if (event.button === 0) setPressed(true);
|
|
50
|
+
},
|
|
51
|
+
onPointerUp: (event) => {
|
|
52
|
+
onPointerUp?.(event);
|
|
53
|
+
setPressed(false);
|
|
54
|
+
},
|
|
55
|
+
onPointerLeave: (event) => {
|
|
56
|
+
onPointerLeave?.(event);
|
|
57
|
+
setPressed(false);
|
|
58
|
+
},
|
|
59
|
+
onPointerCancel: (event) => {
|
|
60
|
+
onPointerCancel?.(event);
|
|
61
|
+
setPressed(false);
|
|
62
|
+
},
|
|
63
|
+
className: cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-6 w-11 shrink-0 items-center rounded-full border border-transparent shadow-xs outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", "transition-[background-color,border-color,box-shadow] duration-[var(--duration-fast)] ease-out", className),
|
|
64
|
+
...props,
|
|
65
|
+
children: /* @__PURE__ */ jsx(SwitchPrimitive.Thumb, {
|
|
66
|
+
asChild: true,
|
|
67
|
+
children: /* @__PURE__ */ jsxs(motion.span, {
|
|
68
|
+
"data-slot": "switch-thumb",
|
|
69
|
+
initial: false,
|
|
70
|
+
animate: {
|
|
71
|
+
x,
|
|
72
|
+
width: THUMB + stretch
|
|
73
|
+
},
|
|
74
|
+
transition: reduceMotion ? { duration: 0 } : THUMB_SPRING,
|
|
75
|
+
className: cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground text-muted-foreground dark:data-[state=unchecked]:text-background dark:data-[state=checked]:text-primary pointer-events-none relative flex h-5 items-center justify-center rounded-full ring-0"),
|
|
76
|
+
children: [/* @__PURE__ */ jsx(motion.span, {
|
|
77
|
+
"aria-hidden": true,
|
|
78
|
+
className: "absolute flex",
|
|
79
|
+
initial: false,
|
|
80
|
+
animate: checked ? {
|
|
81
|
+
opacity: 0,
|
|
82
|
+
scale: reduceMotion ? 1 : .5
|
|
83
|
+
} : {
|
|
84
|
+
opacity: 1,
|
|
85
|
+
scale: 1
|
|
86
|
+
},
|
|
87
|
+
transition: GLYPH_TRANSITION,
|
|
88
|
+
children: /* @__PURE__ */ jsx(XIcon, {
|
|
89
|
+
"aria-hidden": true,
|
|
90
|
+
className: "size-3"
|
|
91
|
+
})
|
|
92
|
+
}), /* @__PURE__ */ jsx(motion.span, {
|
|
93
|
+
"aria-hidden": true,
|
|
94
|
+
className: "absolute flex",
|
|
95
|
+
initial: false,
|
|
96
|
+
animate: checked ? {
|
|
97
|
+
opacity: 1,
|
|
98
|
+
scale: 1
|
|
99
|
+
} : {
|
|
100
|
+
opacity: 0,
|
|
101
|
+
scale: reduceMotion ? 1 : .5
|
|
102
|
+
},
|
|
103
|
+
transition: GLYPH_TRANSITION,
|
|
104
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {
|
|
105
|
+
"aria-hidden": true,
|
|
106
|
+
className: "size-3"
|
|
107
|
+
})
|
|
108
|
+
})]
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
Switch.displayName = "Switch";
|
|
114
|
+
export { Switch as t };
|
package/dist/tabs/index.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { t as cn } from "../utils-CTIuhCOs.mjs";
|
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
6
5
|
import { motion } from "motion/react";
|
|
6
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
7
7
|
// src/components/base/tabs/tabs.tsx
|
|
8
8
|
const TabsContext = React.createContext({
|
|
9
9
|
value: void 0,
|
package/dist/tag-input/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as TagsInput } from "../tag-input-
|
|
1
|
+
export { t as TagsInput } from "../tag-input-a3ktkGrH.mjs";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
-
import { t as Badge } from "./badge-D7A6GfWn.mjs";
|
|
3
2
|
import { t as Input } from "./input-DsT5qkJn.mjs";
|
|
4
3
|
import { t as Icon } from "./icon-wrapper-CIk2th6R.mjs";
|
|
4
|
+
import { n as useChipMotion, t as MotionBadge } from "./motion-chip-BczV7spP.mjs";
|
|
5
5
|
import { X } from "lucide-react";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { AnimatePresence } from "motion/react";
|
|
8
9
|
import { z } from "zod";
|
|
9
10
|
// src/components/features/tag-input/parse.ts
|
|
10
11
|
/**
|
|
@@ -94,37 +95,43 @@ function processPastedValues(rawValues, existing, { normalizer, validator, maxIt
|
|
|
94
95
|
*/
|
|
95
96
|
function TagInputField({ value, placeholder, input }) {
|
|
96
97
|
const { inputValue, activeIndex, setActiveIndex, disableInput, disableButton, removeValue, handleKeyDown, handlePaste, handleBlur, handleSelect, handleChange, mousePreventDefault } = input;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
type: "
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
98
|
+
const chipMotion = useChipMotion();
|
|
99
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(AnimatePresence, {
|
|
100
|
+
initial: false,
|
|
101
|
+
mode: "popLayout",
|
|
102
|
+
children: value.map((item, index) => /* @__PURE__ */ jsxs(MotionBadge, {
|
|
103
|
+
...chipMotion,
|
|
104
|
+
tabIndex: activeIndex !== -1 ? 0 : activeIndex,
|
|
105
|
+
"aria-disabled": disableButton,
|
|
106
|
+
"data-active": activeIndex === index,
|
|
107
|
+
className: cn("data-[active='true']:ring-muted-foreground relative flex items-center gap-1 truncate rounded px-1 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 data-[active='true']:ring-2"),
|
|
108
|
+
type: "secondary",
|
|
109
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "text-xs",
|
|
111
|
+
children: item
|
|
112
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
113
|
+
type: "button",
|
|
114
|
+
"aria-label": `Remove ${item} option`,
|
|
115
|
+
"aria-roledescription": "button to remove option",
|
|
116
|
+
disabled: disableButton,
|
|
117
|
+
onMouseDown: mousePreventDefault,
|
|
118
|
+
onClick: () => removeValue(item),
|
|
119
|
+
className: "disabled:cursor-not-allowed",
|
|
120
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
121
|
+
className: "sr-only",
|
|
122
|
+
children: [
|
|
123
|
+
"Remove",
|
|
124
|
+
item,
|
|
125
|
+
" ",
|
|
126
|
+
"option"
|
|
127
|
+
]
|
|
128
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
129
|
+
icon: X,
|
|
130
|
+
className: "hover:stroke-destructive h-4 w-4"
|
|
131
|
+
})]
|
|
125
132
|
})]
|
|
126
|
-
})
|
|
127
|
-
}
|
|
133
|
+
}, item))
|
|
134
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
128
135
|
tabIndex: 0,
|
|
129
136
|
"aria-label": "input tag",
|
|
130
137
|
disabled: disableInput,
|
|
@@ -408,7 +415,7 @@ function TagsInput({ ref, value, onValueChange, placeholder, maxItems, minItems,
|
|
|
408
415
|
...props,
|
|
409
416
|
ref,
|
|
410
417
|
dir,
|
|
411
|
-
className: cn("border-input-border bg-input-background/50 text-input-foreground flex min-h-10 flex-wrap items-center gap-1 overflow-hidden rounded-lg border px-3 py-2 transition-
|
|
418
|
+
className: cn("border-input-border bg-input-background/50 text-input-foreground relative flex min-h-10 flex-wrap items-center gap-1 overflow-hidden rounded-lg border px-3 py-2 transition-[border-color,box-shadow]", activeIndex === -1 ? "focus-within:border-input-focus-border focus-within:shadow-(--input-focus-shadow) focus-within:ring-0 focus-within:ring-offset-0 focus-within:outline-hidden" : "focus-within:ring-0 focus-within:ring-offset-0 focus-within:outline-hidden", className),
|
|
412
419
|
suppressHydrationWarning: true,
|
|
413
420
|
children: [(showValidationErrors && validationError || error) && /* @__PURE__ */ jsx("div", {
|
|
414
421
|
className: "mb-1 w-full text-sm text-red-500",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { v as LocalTaskStorage, _ as RedisTaskStorage, i as TaskPanel, s as TaskPanelActions, o as TaskPanelCounter, c as TaskPanelHeader, a as TaskPanelItem, h as TaskQueue, t as TaskQueueDropdown, m as TaskQueueProvider, r as TaskQueueTrigger, n as TaskSummaryDialog, y as createOrgMetadata, b as createProjectMetadata, x as createUserMetadata, g as detectStorage, l as getContextLabel, u as matchesCurrentScope, d as useCurrentScope, p as useTaskQueue, f as useTasksWithLabels } from "../task-queue-dropdown-
|
|
1
|
+
export { v as LocalTaskStorage, _ as RedisTaskStorage, i as TaskPanel, s as TaskPanelActions, o as TaskPanelCounter, c as TaskPanelHeader, a as TaskPanelItem, h as TaskQueue, t as TaskQueueDropdown, m as TaskQueueProvider, r as TaskQueueTrigger, n as TaskSummaryDialog, y as createOrgMetadata, b as createProjectMetadata, x as createUserMetadata, g as detectStorage, l as getContextLabel, u as matchesCurrentScope, d as useCurrentScope, p as useTaskQueue, f as useTasksWithLabels } from "../task-queue-dropdown-DuCAAybs.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as SpinnerIcon } from "./spinner.icon-
|
|
4
|
-
import { t as Button } from "./button-
|
|
2
|
+
import { Badge } from "./badge/index.mjs";
|
|
3
|
+
import { t as SpinnerIcon } from "./spinner.icon-BiUnMAxw.mjs";
|
|
4
|
+
import { t as Button } from "./button-Cn4KagBO.mjs";
|
|
5
5
|
import { t as Icon } from "./icon-wrapper-CIk2th6R.mjs";
|
|
6
6
|
import { t as Dialog } from "./dialog-C8RXIQYm.mjs";
|
|
7
7
|
import { t as ResponsiveDropdown } from "./responsive-dropdown-DsWgpE_i.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as TimePicker } from "../time-picker-
|
|
1
|
+
export { t as TimePicker } from "../time-picker-B_am4eAK.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as useDeprecationWarning } from "./use-deprecation-warning-BS1V4IS5.mjs";
|
|
2
|
-
import { n as TimePicker$1 } from "./picker-
|
|
2
|
+
import { n as TimePicker$1 } from "./picker-DC3GErYg.mjs";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
// src/components/features/time-picker/time-picker.tsx
|
|
5
5
|
const STEP_VALUES = [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
-
import { t as Button } from "./button-
|
|
2
|
+
import { t as Button } from "./button-Cn4KagBO.mjs";
|
|
3
3
|
import { Calendar } from "./calendar/index.mjs";
|
|
4
4
|
import { t as Input } from "./input-DsT5qkJn.mjs";
|
|
5
5
|
import { t as ResponsivePopover } from "./responsive-popover-DJYd8lOK.mjs";
|
|
6
6
|
import { i as SelectItem, l as SelectTrigger, n as SelectContent, t as Select, u as SelectValue } from "./select-DemYhwnG.mjs";
|
|
7
|
-
import { F as zonedDateToIso, M as getBrowserTimezone, N as getTimezoneOffset, P as isoToZonedDate, U as endOfDayInTz, W as startOfDayInTz, j as formatTimezoneLabel, t as DateTimeRangePicker } from "./date-time-range-picker-
|
|
7
|
+
import { F as zonedDateToIso, M as getBrowserTimezone, N as getTimezoneOffset, P as isoToZonedDate, U as endOfDayInTz, W as startOfDayInTz, j as formatTimezoneLabel, t as DateTimeRangePicker } from "./date-time-range-picker-yy1Acntn.mjs";
|
|
8
8
|
import { t as useDeprecationWarning } from "./use-deprecation-warning-BS1V4IS5.mjs";
|
|
9
9
|
import { CalendarIcon, Globe } from "lucide-react";
|
|
10
10
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
package/dist/transfer/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Transfer } from "../transfer-
|
|
1
|
+
export { t as Transfer } from "../transfer-DGUeAQUL.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
-
import { t as Button } from "./button-
|
|
2
|
+
import { t as Button } from "./button-Cn4KagBO.mjs";
|
|
3
3
|
import { Search, X } from "lucide-react";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as CommandInput, i as CommandGroup, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "./command-B0be-zU5.mjs";
|
|
2
1
|
import { t as useControllableState } from "./use-controllable-state-DLeVgbAb.mjs";
|
|
3
|
-
import { t as
|
|
2
|
+
import { a as CommandInput, i as CommandGroup, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "./command-B0be-zU5.mjs";
|
|
3
|
+
import { t as LoaderOverlay } from "./loader-overlay-DP0pvHuG.mjs";
|
|
4
4
|
import { CheckIcon } from "lucide-react";
|
|
5
5
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datum-cloud/datum-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.8.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/datum-cloud/datum-ui"
|
|
@@ -559,9 +559,6 @@
|
|
|
559
559
|
"monaco-editor": {
|
|
560
560
|
"optional": true
|
|
561
561
|
},
|
|
562
|
-
"motion": {
|
|
563
|
-
"optional": true
|
|
564
|
-
},
|
|
565
562
|
"nprogress": {
|
|
566
563
|
"optional": true
|
|
567
564
|
},
|
package/dist/badge-D7A6GfWn.mjs
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { t as cn } from "./utils-CTIuhCOs.mjs";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
// src/components/base/badge/badge.tsx
|
|
6
|
-
/**
|
|
7
|
-
* Datum Badge Component
|
|
8
|
-
* Similar to Button component but with badge-specific styling
|
|
9
|
-
* Supports types: primary, secondary, tertiary, quaternary, warning, danger, success
|
|
10
|
-
* Supports themes: solid, outline, light
|
|
11
|
-
*/
|
|
12
|
-
const badgeVariants = cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-all focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
13
|
-
variants: {
|
|
14
|
-
type: {
|
|
15
|
-
primary: "",
|
|
16
|
-
secondary: "",
|
|
17
|
-
tertiary: "",
|
|
18
|
-
quaternary: "",
|
|
19
|
-
info: "",
|
|
20
|
-
warning: "",
|
|
21
|
-
danger: "",
|
|
22
|
-
success: "",
|
|
23
|
-
muted: ""
|
|
24
|
-
},
|
|
25
|
-
theme: {
|
|
26
|
-
solid: "",
|
|
27
|
-
outline: "border",
|
|
28
|
-
light: "border-transparent"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
compoundVariants: [
|
|
32
|
-
{
|
|
33
|
-
type: "primary",
|
|
34
|
-
theme: "solid",
|
|
35
|
-
className: "border-transparent bg-[var(--color-badge-primary)] text-[var(--color-badge-primary-foreground)]"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
type: "primary",
|
|
39
|
-
theme: "outline",
|
|
40
|
-
className: "border-[var(--color-badge-primary)] text-[var(--color-badge-primary)] dark:border-[var(--color-badge-primary)] dark:text-[var(--color-badge-primary)]"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: "primary",
|
|
44
|
-
theme: "light",
|
|
45
|
-
className: "text-[var(--color-badge-primary)] bg-[var(--color-badge-primary)]/10 dark:text-[var(--color-badge-primary)] dark:bg-[var(--color-badge-primary)]/20"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
type: "secondary",
|
|
49
|
-
theme: "solid",
|
|
50
|
-
className: "border-transparent bg-[var(--color-badge-secondary)] text-[var(--color-badge-secondary-foreground)]"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: "secondary",
|
|
54
|
-
theme: "outline",
|
|
55
|
-
className: "border-[var(--color-badge-secondary)] text-[var(--color-badge-secondary)] dark:border-[var(--color-badge-secondary)] dark:text-[var(--color-badge-secondary)]"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
type: "secondary",
|
|
59
|
-
theme: "light",
|
|
60
|
-
className: "text-[var(--color-badge-secondary)] bg-[var(--color-badge-secondary)]/20 dark:text-[var(--color-badge-secondary)] dark:bg-[var(--color-badge-secondary)]/20"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
type: "tertiary",
|
|
64
|
-
theme: "solid",
|
|
65
|
-
className: "border-transparent bg-[var(--color-badge-tertiary)] text-[var(--color-badge-tertiary-foreground)]"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
type: "tertiary",
|
|
69
|
-
theme: "outline",
|
|
70
|
-
className: "border-[var(--color-badge-tertiary)] text-[var(--color-badge-tertiary)] dark:border-[var(--color-badge-tertiary)] dark:text-[var(--color-badge-tertiary)]"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
type: "tertiary",
|
|
74
|
-
theme: "light",
|
|
75
|
-
className: "text-[var(--color-badge-tertiary)] bg-[var(--color-badge-tertiary)]/20 dark:text-[var(--color-badge-tertiary)] dark:bg-[var(--color-badge-tertiary)]/20"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
type: "quaternary",
|
|
79
|
-
theme: "solid",
|
|
80
|
-
className: "border-transparent bg-[var(--color-badge-quaternary)] text-[var(--color-badge-quaternary-foreground)]"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
type: "quaternary",
|
|
84
|
-
theme: "outline",
|
|
85
|
-
className: "border-[var(--color-badge-quaternary)] text-[var(--color-badge-quaternary-foreground)] dark:border-[var(--color-badge-quaternary)] dark:text-[var(--color-badge-quaternary-foreground)]"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
type: "quaternary",
|
|
89
|
-
theme: "light",
|
|
90
|
-
className: "text-[var(--color-badge-quaternary-foreground)] bg-[var(--color-badge-quaternary)]/20 dark:text-[var(--color-badge-quaternary-foreground)] dark:bg-[var(--color-badge-quaternary)]/20"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
type: "info",
|
|
94
|
-
theme: "solid",
|
|
95
|
-
className: "border-transparent bg-[var(--color-badge-info)] text-[var(--color-badge-info-foreground)]"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
type: "info",
|
|
99
|
-
theme: "outline",
|
|
100
|
-
className: "border-[var(--color-badge-info)] text-[var(--color-badge-info)] dark:border-[var(--color-badge-info)] dark:text-[var(--color-badge-info)]"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
type: "info",
|
|
104
|
-
theme: "light",
|
|
105
|
-
className: "text-[var(--color-badge-info)] bg-[var(--color-badge-info)]/20 dark:text-[var(--color-badge-info)] dark:bg-[var(--color-badge-info)]/20"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
type: "warning",
|
|
109
|
-
theme: "solid",
|
|
110
|
-
className: "border-transparent bg-[var(--color-badge-warning)] text-[var(--color-badge-warning-foreground)]"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
type: "warning",
|
|
114
|
-
theme: "outline",
|
|
115
|
-
className: "border-[var(--color-badge-warning)] text-[var(--color-badge-warning)] dark:border-[var(--color-badge-warning)] dark:text-[var(--color-badge-warning)]"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
type: "warning",
|
|
119
|
-
theme: "light",
|
|
120
|
-
className: "text-[var(--color-badge-warning)] bg-[var(--color-badge-warning)]/20 dark:text-[var(--color-badge-warning)] dark:bg-[var(--color-badge-warning)]/20"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
type: "danger",
|
|
124
|
-
theme: "solid",
|
|
125
|
-
className: "border-transparent bg-[var(--color-badge-danger)] text-[var(--color-badge-danger-foreground)]"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
type: "danger",
|
|
129
|
-
theme: "outline",
|
|
130
|
-
className: "border-[var(--color-badge-danger)] text-[var(--color-badge-danger)] dark:border-[var(--color-badge-danger)] dark:text-[var(--color-badge-danger)]"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
type: "danger",
|
|
134
|
-
theme: "light",
|
|
135
|
-
className: "text-[var(--color-badge-danger)] bg-[var(--color-badge-danger)]/20 dark:text-[var(--color-badge-danger)] dark:bg-[var(--color-badge-danger)]/20"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
type: "success",
|
|
139
|
-
theme: "solid",
|
|
140
|
-
className: "border-transparent bg-[var(--color-badge-success)] text-[var(--color-badge-success-foreground)]"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
type: "success",
|
|
144
|
-
theme: "outline",
|
|
145
|
-
className: "border-[var(--color-badge-success)] text-[var(--color-badge-success)] dark:border-[var(--color-badge-success)] dark:text-[var(--color-badge-success)]"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
type: "success",
|
|
149
|
-
theme: "light",
|
|
150
|
-
className: "text-[var(--color-badge-success)] bg-[var(--color-badge-success)]/20 dark:text-[var(--color-badge-success)] dark:bg-[var(--color-badge-success)]/20"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
type: "muted",
|
|
154
|
-
theme: "solid",
|
|
155
|
-
className: "border-transparent text-[var(--color-badge-muted-foreground)] bg-[var(--color-badge-muted)] dark:border-[var(--color-badge-muted)]/20 dark:text-[var(--color-badge-muted)] dark:bg-[var(--color-badge-muted)]/20"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
type: "muted",
|
|
159
|
-
theme: "outline",
|
|
160
|
-
className: "border-[var(--color-badge-muted)] text-[var(--color-badge-muted)] dark:border-[var(--color-badge-muted)] dark:text-[var(--color-badge-muted)]"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
type: "muted",
|
|
164
|
-
theme: "light",
|
|
165
|
-
className: "text-[var(--muted-foreground)] bg-[var(--muted-foreground)]/15 dark:text-[var(--color-badge-muted)] dark:bg-[var(--color-badge-muted)]/20"
|
|
166
|
-
}
|
|
167
|
-
],
|
|
168
|
-
defaultVariants: {
|
|
169
|
-
type: "muted",
|
|
170
|
-
theme: "solid"
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
function Badge({ className, type, theme, ...props }) {
|
|
174
|
-
return /* @__PURE__ */ jsx("div", {
|
|
175
|
-
className: cn(badgeVariants({
|
|
176
|
-
type,
|
|
177
|
-
theme
|
|
178
|
-
}), className),
|
|
179
|
-
...props
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
export { badgeVariants as n, Badge as t };
|