@szum-tech/design-system 3.5.0 → 3.6.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.
Files changed (43) hide show
  1. package/dist/{chunk-Y6EVJSAH.cjs → chunk-3ZRMIVJM.cjs} +6 -0
  2. package/dist/chunk-54PWKHYF.cjs +58 -0
  3. package/dist/chunk-5Q3H4MOX.js +123 -0
  4. package/dist/chunk-6WGZMVJT.cjs +132 -0
  5. package/dist/chunk-FUS2IGBX.js +54 -0
  6. package/dist/{chunk-LLQ52RQE.js → chunk-GWRG4LH5.js} +1 -1
  7. package/dist/{chunk-YHDEDCPE.cjs → chunk-JXZ27PK6.cjs} +3 -3
  8. package/dist/chunk-N2Q3D32M.js +86 -0
  9. package/dist/{chunk-U4AWAABZ.js → chunk-O7QFYWMK.js} +6 -0
  10. package/dist/chunk-Z33XUQTB.cjs +108 -0
  11. package/dist/components/badge/index.cjs +10 -2
  12. package/dist/components/badge/index.d.cts +11 -2
  13. package/dist/components/badge/index.d.ts +11 -2
  14. package/dist/components/badge/index.js +1 -1
  15. package/dist/components/button/index.cjs +8 -7
  16. package/dist/components/button/index.d.cts +1 -1
  17. package/dist/components/button/index.d.ts +1 -1
  18. package/dist/components/button/index.js +7 -6
  19. package/dist/components/color-swatch/index.cjs +12 -0
  20. package/dist/components/color-swatch/index.d.cts +22 -0
  21. package/dist/components/color-swatch/index.d.ts +22 -0
  22. package/dist/components/color-swatch/index.js +3 -0
  23. package/dist/components/dialog/index.cjs +9 -9
  24. package/dist/components/dialog/index.d.cts +13 -12
  25. package/dist/components/dialog/index.d.ts +13 -12
  26. package/dist/components/dialog/index.js +1 -1
  27. package/dist/components/index.cjs +100 -87
  28. package/dist/components/index.d.cts +2 -1
  29. package/dist/components/index.d.ts +2 -1
  30. package/dist/components/index.js +7 -6
  31. package/dist/components/item/index.d.cts +1 -1
  32. package/dist/components/item/index.d.ts +1 -1
  33. package/dist/components/select/index.cjs +7 -7
  34. package/dist/components/select/index.js +1 -1
  35. package/dist/components/stepper/index.cjs +26 -25
  36. package/dist/components/stepper/index.js +7 -6
  37. package/dist/components/toaster/index.cjs +9 -8
  38. package/dist/components/toaster/index.js +7 -6
  39. package/package.json +19 -19
  40. package/dist/chunk-6VC76QIP.js +0 -27
  41. package/dist/chunk-AGVEKVWD.js +0 -78
  42. package/dist/chunk-PH4LO5TE.cjs +0 -87
  43. package/dist/chunk-RDYKJP7U.cjs +0 -29
@@ -3749,6 +3749,12 @@ function RemoveScrollSideCar(props) {
3749
3749
  if ("touches" in event && moveDirection === "h" && target.type === "range") {
3750
3750
  return false;
3751
3751
  }
3752
+ var selection = window.getSelection();
3753
+ var anchorNode = selection && selection.anchorNode;
3754
+ var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
3755
+ if (isTouchingSelection) {
3756
+ return false;
3757
+ }
3752
3758
  var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
3753
3759
  if (!canBeScrolledInMainDirection) {
3754
3760
  return true;
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
4
+ var radixUi = require('radix-ui');
5
+ var classVarianceAuthority = require('class-variance-authority');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ var badgeVariants = classVarianceAuthority.cva(
9
+ "border-border focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring [&>svg]:pointer-events-none [&>svg]:size-3",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ primary: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",
14
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",
15
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
16
+ success: "bg-success text-success-foreground [a&]:hover:bg-success/90 border-transparent focus-visible:ring-success/20",
17
+ warning: "bg-warning text-warning-foreground [a&]:hover:bg-warning/90 border-transparent focus-visible:ring-warning/20",
18
+ error: "bg-error [a&]:hover:bg-error/90 focus-visible:ring-error/20 dark:focus-visible:ring-error/40 dark:bg-error/60 text-error-foreground border-transparent"
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ variant: "primary"
23
+ }
24
+ }
25
+ );
26
+ function Badge({ className, variant = "primary", asChild = false, ...props }) {
27
+ const Comp = asChild ? radixUi.Slot.Slot : "span";
28
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { "data-slot": "badge", className: chunkH2BWO3SI_cjs.cn(badgeVariants({ variant }), className), ...props });
29
+ }
30
+ function BadgeButton({ className, asChild = false, ...props }) {
31
+ const Comp = asChild ? radixUi.Slot.Slot : "span";
32
+ return /* @__PURE__ */ jsxRuntime.jsx(
33
+ Comp,
34
+ {
35
+ "data-slot": "badge-button",
36
+ className: chunkH2BWO3SI_cjs.cn(
37
+ "-me-0.5 inline-flex size-3.5 cursor-pointer items-center justify-center rounded-md p-0 leading-none opacity-60 transition-all hover:opacity-100 [&>svg]:size-3.5! [&>svg]:opacity-100!",
38
+ className
39
+ ),
40
+ role: "button",
41
+ ...props
42
+ }
43
+ );
44
+ }
45
+ function BadgeDot({ className, ...props }) {
46
+ return /* @__PURE__ */ jsxRuntime.jsx(
47
+ "span",
48
+ {
49
+ "data-slot": "badge-dot",
50
+ className: chunkH2BWO3SI_cjs.cn("size-1.5 rounded-full bg-[currentColor] opacity-75", className),
51
+ ...props
52
+ }
53
+ );
54
+ }
55
+
56
+ exports.Badge = Badge;
57
+ exports.BadgeButton = BadgeButton;
58
+ exports.BadgeDot = BadgeDot;
@@ -0,0 +1,123 @@
1
+ import { cn } from './chunk-ZD2QRAOX.js';
2
+ import { Dialog as Dialog$1 } from 'radix-ui';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+ import { XIcon } from 'lucide-react';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { cva } from 'class-variance-authority';
7
+
8
+ function Dialog(props) {
9
+ return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "dialog", ...props });
10
+ }
11
+ function DialogClose(props) {
12
+ return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", ...props });
13
+ }
14
+ var dialogContentVariants = cva(
15
+ [
16
+ "bg-background fixed top-[50%] left-[50%] z-50 grid w-full gap-4 rounded border border-border p-6 shadow-lg duration-200 translate-x-[-50%] translate-y-[-50%] max-w-[calc(100%-1rem)]",
17
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 "
18
+ ],
19
+ {
20
+ variants: {
21
+ width: {
22
+ xs: "w-xs",
23
+ sm: "w-sm",
24
+ md: "w-md",
25
+ lg: "w-lg",
26
+ xl: "w-xl",
27
+ "2xl": "w-2xl",
28
+ "3xl": "w-3xl",
29
+ "4xl": "w-4xl",
30
+ "5xl": "w-5xl",
31
+ "6xl": "w-6xl",
32
+ full: "w-full"
33
+ }
34
+ },
35
+ defaultVariants: {
36
+ width: "md"
37
+ }
38
+ }
39
+ );
40
+ function DialogContent({
41
+ className,
42
+ children,
43
+ width = "md",
44
+ showCloseButton = false,
45
+ ...props
46
+ }) {
47
+ return /* @__PURE__ */ jsxs(Dialog$1.Portal, { "data-slot": "dialog-portal", children: [
48
+ /* @__PURE__ */ jsx(
49
+ Dialog$1.Overlay,
50
+ {
51
+ "data-slot": "dialog-overlay",
52
+ className: "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-background/80 fixed inset-0 z-50 backdrop-blur-xs"
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsxs(
56
+ Dialog$1.Content,
57
+ {
58
+ "data-slot": "dialog-content",
59
+ className: twMerge(dialogContentVariants({ width }), className),
60
+ ...props,
61
+ children: [
62
+ children,
63
+ showCloseButton ? /* @__PURE__ */ jsxs(
64
+ Dialog$1.Close,
65
+ {
66
+ "data-slot": "dialog-close",
67
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
68
+ children: [
69
+ /* @__PURE__ */ jsx(XIcon, {}),
70
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
71
+ ]
72
+ }
73
+ ) : null
74
+ ]
75
+ }
76
+ )
77
+ ] });
78
+ }
79
+ function DialogTrigger({ ...props }) {
80
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, { "data-slot": "dialog-trigger", ...props });
81
+ }
82
+ function DialogHeader({ className, ...props }) {
83
+ return /* @__PURE__ */ jsx(
84
+ "div",
85
+ {
86
+ "data-slot": "dialog-header",
87
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
88
+ ...props
89
+ }
90
+ );
91
+ }
92
+ function DialogFooter({ className, ...props }) {
93
+ return /* @__PURE__ */ jsx(
94
+ "div",
95
+ {
96
+ "data-slot": "dialog-footer",
97
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
98
+ ...props
99
+ }
100
+ );
101
+ }
102
+ function DialogTitle({ className, ...props }) {
103
+ return /* @__PURE__ */ jsx(
104
+ Dialog$1.Title,
105
+ {
106
+ "data-slot": "dialog-title",
107
+ className: cn("text-lg leading-none font-semibold", className),
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+ function DialogDescription({ className, ...props }) {
113
+ return /* @__PURE__ */ jsx(
114
+ Dialog$1.Description,
115
+ {
116
+ "data-slot": "dialog-description",
117
+ className: cn("text-muted-foreground text-sm", className),
118
+ ...props
119
+ }
120
+ );
121
+ }
122
+
123
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
@@ -0,0 +1,132 @@
1
+ 'use strict';
2
+
3
+ var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
4
+ var radixUi = require('radix-ui');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var lucideReact = require('lucide-react');
7
+ var tailwindMerge = require('tailwind-merge');
8
+ var classVarianceAuthority = require('class-variance-authority');
9
+
10
+ function Dialog(props) {
11
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Root, { "data-slot": "dialog", ...props });
12
+ }
13
+ function DialogClose(props) {
14
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "dialog-close", ...props });
15
+ }
16
+ var dialogContentVariants = classVarianceAuthority.cva(
17
+ [
18
+ "bg-background fixed top-[50%] left-[50%] z-50 grid w-full gap-4 rounded border border-border p-6 shadow-lg duration-200 translate-x-[-50%] translate-y-[-50%] max-w-[calc(100%-1rem)]",
19
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 "
20
+ ],
21
+ {
22
+ variants: {
23
+ width: {
24
+ xs: "w-xs",
25
+ sm: "w-sm",
26
+ md: "w-md",
27
+ lg: "w-lg",
28
+ xl: "w-xl",
29
+ "2xl": "w-2xl",
30
+ "3xl": "w-3xl",
31
+ "4xl": "w-4xl",
32
+ "5xl": "w-5xl",
33
+ "6xl": "w-6xl",
34
+ full: "w-full"
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ width: "md"
39
+ }
40
+ }
41
+ );
42
+ function DialogContent({
43
+ className,
44
+ children,
45
+ width = "md",
46
+ showCloseButton = false,
47
+ ...props
48
+ }) {
49
+ return /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Portal, { "data-slot": "dialog-portal", children: [
50
+ /* @__PURE__ */ jsxRuntime.jsx(
51
+ radixUi.Dialog.Overlay,
52
+ {
53
+ "data-slot": "dialog-overlay",
54
+ className: "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-background/80 fixed inset-0 z-50 backdrop-blur-xs"
55
+ }
56
+ ),
57
+ /* @__PURE__ */ jsxRuntime.jsxs(
58
+ radixUi.Dialog.Content,
59
+ {
60
+ "data-slot": "dialog-content",
61
+ className: tailwindMerge.twMerge(dialogContentVariants({ width }), className),
62
+ ...props,
63
+ children: [
64
+ children,
65
+ showCloseButton ? /* @__PURE__ */ jsxRuntime.jsxs(
66
+ radixUi.Dialog.Close,
67
+ {
68
+ "data-slot": "dialog-close",
69
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
70
+ children: [
71
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
72
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
73
+ ]
74
+ }
75
+ ) : null
76
+ ]
77
+ }
78
+ )
79
+ ] });
80
+ }
81
+ function DialogTrigger({ ...props }) {
82
+ return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { "data-slot": "dialog-trigger", ...props });
83
+ }
84
+ function DialogHeader({ className, ...props }) {
85
+ return /* @__PURE__ */ jsxRuntime.jsx(
86
+ "div",
87
+ {
88
+ "data-slot": "dialog-header",
89
+ className: chunkH2BWO3SI_cjs.cn("flex flex-col gap-2 text-center sm:text-left", className),
90
+ ...props
91
+ }
92
+ );
93
+ }
94
+ function DialogFooter({ className, ...props }) {
95
+ return /* @__PURE__ */ jsxRuntime.jsx(
96
+ "div",
97
+ {
98
+ "data-slot": "dialog-footer",
99
+ className: chunkH2BWO3SI_cjs.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
100
+ ...props
101
+ }
102
+ );
103
+ }
104
+ function DialogTitle({ className, ...props }) {
105
+ return /* @__PURE__ */ jsxRuntime.jsx(
106
+ radixUi.Dialog.Title,
107
+ {
108
+ "data-slot": "dialog-title",
109
+ className: chunkH2BWO3SI_cjs.cn("text-lg leading-none font-semibold", className),
110
+ ...props
111
+ }
112
+ );
113
+ }
114
+ function DialogDescription({ className, ...props }) {
115
+ return /* @__PURE__ */ jsxRuntime.jsx(
116
+ radixUi.Dialog.Description,
117
+ {
118
+ "data-slot": "dialog-description",
119
+ className: chunkH2BWO3SI_cjs.cn("text-muted-foreground text-sm", className),
120
+ ...props
121
+ }
122
+ );
123
+ }
124
+
125
+ exports.Dialog = Dialog;
126
+ exports.DialogClose = DialogClose;
127
+ exports.DialogContent = DialogContent;
128
+ exports.DialogDescription = DialogDescription;
129
+ exports.DialogFooter = DialogFooter;
130
+ exports.DialogHeader = DialogHeader;
131
+ exports.DialogTitle = DialogTitle;
132
+ exports.DialogTrigger = DialogTrigger;
@@ -0,0 +1,54 @@
1
+ import { cn } from './chunk-ZD2QRAOX.js';
2
+ import { Slot } from 'radix-ui';
3
+ import { cva } from 'class-variance-authority';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ var badgeVariants = cva(
7
+ "border-border focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring [&>svg]:pointer-events-none [&>svg]:size-3",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ primary: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",
12
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",
13
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
14
+ success: "bg-success text-success-foreground [a&]:hover:bg-success/90 border-transparent focus-visible:ring-success/20",
15
+ warning: "bg-warning text-warning-foreground [a&]:hover:bg-warning/90 border-transparent focus-visible:ring-warning/20",
16
+ error: "bg-error [a&]:hover:bg-error/90 focus-visible:ring-error/20 dark:focus-visible:ring-error/40 dark:bg-error/60 text-error-foreground border-transparent"
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ variant: "primary"
21
+ }
22
+ }
23
+ );
24
+ function Badge({ className, variant = "primary", asChild = false, ...props }) {
25
+ const Comp = asChild ? Slot.Slot : "span";
26
+ return /* @__PURE__ */ jsx(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
27
+ }
28
+ function BadgeButton({ className, asChild = false, ...props }) {
29
+ const Comp = asChild ? Slot.Slot : "span";
30
+ return /* @__PURE__ */ jsx(
31
+ Comp,
32
+ {
33
+ "data-slot": "badge-button",
34
+ className: cn(
35
+ "-me-0.5 inline-flex size-3.5 cursor-pointer items-center justify-center rounded-md p-0 leading-none opacity-60 transition-all hover:opacity-100 [&>svg]:size-3.5! [&>svg]:opacity-100!",
36
+ className
37
+ ),
38
+ role: "button",
39
+ ...props
40
+ }
41
+ );
42
+ }
43
+ function BadgeDot({ className, ...props }) {
44
+ return /* @__PURE__ */ jsx(
45
+ "span",
46
+ {
47
+ "data-slot": "badge-dot",
48
+ className: cn("size-1.5 rounded-full bg-[currentColor] opacity-75", className),
49
+ ...props
50
+ }
51
+ );
52
+ }
53
+
54
+ export { Badge, BadgeButton, BadgeDot };
@@ -1,4 +1,4 @@
1
- import { useComposedRefs } from './chunk-U4AWAABZ.js';
1
+ import { useComposedRefs } from './chunk-O7QFYWMK.js';
2
2
  import { Spinner } from './chunk-P5IUC7HJ.js';
3
3
  import { useDirection, Direction } from './chunk-H5O5L6XT.js';
4
4
  import { useLazyRef, useIsomorphicLayoutEffect } from './chunk-DFD2WUOU.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkY6EVJSAH_cjs = require('./chunk-Y6EVJSAH.cjs');
3
+ var chunk3ZRMIVJM_cjs = require('./chunk-3ZRMIVJM.cjs');
4
4
  var chunk3WSQRFUY_cjs = require('./chunk-3WSQRFUY.cjs');
5
5
  var chunkEW6TE3N5_cjs = require('./chunk-EW6TE3N5.cjs');
6
6
  var chunk7EYMOUWG_cjs = require('./chunk-7EYMOUWG.cjs');
@@ -315,7 +315,7 @@ function StepperNav({ className, children, asChild, ref, ...listProps }) {
315
315
  const isClickFocusRef = React5__namespace.useRef(false);
316
316
  const itemsRef = React5__namespace.useRef(/* @__PURE__ */ new Map());
317
317
  const listRef = React5__namespace.useRef(null);
318
- const composedRef = chunkY6EVJSAH_cjs.useComposedRefs(ref, listRef);
318
+ const composedRef = chunk3ZRMIVJM_cjs.useComposedRefs(ref, listRef);
319
319
  const onItemFocus = React5__namespace.useCallback((tabStopId2) => {
320
320
  setTabStopId(tabStopId2);
321
321
  }, []);
@@ -533,7 +533,7 @@ function StepperTrigger({ asChild, disabled, className, ref, ...triggerProps })
533
533
  const isTabStop = focusContext.tabStopId === triggerId;
534
534
  const dataState = getDataState(value, itemValue, stepState, steps);
535
535
  const triggerRef = React5__namespace.useRef(null);
536
- const composedRef = chunkY6EVJSAH_cjs.useComposedRefs(ref, triggerRef);
536
+ const composedRef = chunk3ZRMIVJM_cjs.useComposedRefs(ref, triggerRef);
537
537
  const isArrowKeyPressedRef = React5__namespace.useRef(false);
538
538
  const isMouseClickRef = React5__namespace.useRef(false);
539
539
  React5__namespace.useEffect(() => {
@@ -0,0 +1,86 @@
1
+ import { cn } from './chunk-ZD2QRAOX.js';
2
+ import * as React from 'react';
3
+ import { Slot } from 'radix-ui';
4
+ import { cva } from 'class-variance-authority';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ var colorSwatchVariants = cva(
8
+ "box-border rounded border border-border shadow-sm [background-clip:padding-box] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
9
+ {
10
+ variants: {
11
+ size: {
12
+ default: "size-8",
13
+ sm: "size-6",
14
+ lg: "size-12"
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ size: "default"
19
+ }
20
+ }
21
+ );
22
+
23
+ // src/components/color-swatch/color-swatch.utils.ts
24
+ function getIsCssColor(v) {
25
+ try {
26
+ return typeof CSS !== "undefined" && typeof CSS.supports === "function" ? CSS.supports("color", v) : true;
27
+ } catch {
28
+ return false;
29
+ }
30
+ }
31
+ function getHasAlpha(v) {
32
+ const s = v.trim().toLowerCase();
33
+ if (s === "transparent") return true;
34
+ if (/^#(?:[0-9a-f]{4}|[0-9a-f]{8})$/i.test(s)) return true;
35
+ if (/\b(?:rgba|hsla)\s*\(/i.test(s)) return true;
36
+ return /\b(?:rgb|hsl|lab|lch|oklab|oklch|color)\s*\([^)]*\/\s*[\d.]+%?\s*\)/i.test(s);
37
+ }
38
+ function ColorSwatch({
39
+ color,
40
+ size = "default",
41
+ asChild = false,
42
+ disabled = false,
43
+ withoutTransparency = false,
44
+ className,
45
+ style,
46
+ ...props
47
+ }) {
48
+ const colorValue = color?.trim();
49
+ const backgroundStyle = React.useMemo(() => {
50
+ if (!colorValue) {
51
+ return {
52
+ background: "linear-gradient(to bottom right, transparent calc(50% - 1px), hsl(var(--destructive)) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) no-repeat"
53
+ };
54
+ }
55
+ if (!getIsCssColor(colorValue)) {
56
+ return { backgroundColor: "transparent" };
57
+ }
58
+ if (!withoutTransparency && getHasAlpha(colorValue)) {
59
+ return {
60
+ background: `linear-gradient(${colorValue}, ${colorValue}), repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0% 50% / 10px 10px`
61
+ };
62
+ }
63
+ return { backgroundColor: colorValue };
64
+ }, [colorValue, withoutTransparency]);
65
+ const ariaLabel = !colorValue ? "No color selected" : `Color swatch: ${colorValue}`;
66
+ const Primitive = asChild ? Slot.Slot : "div";
67
+ return /* @__PURE__ */ jsx(
68
+ Primitive,
69
+ {
70
+ role: "img",
71
+ "aria-label": ariaLabel,
72
+ "aria-disabled": disabled || void 0,
73
+ "data-disabled": disabled ? "" : void 0,
74
+ "data-slot": "color-swatch",
75
+ ...props,
76
+ className: cn(colorSwatchVariants({ size }), className),
77
+ style: {
78
+ ...backgroundStyle,
79
+ forcedColorAdjust: "none",
80
+ ...style
81
+ }
82
+ }
83
+ );
84
+ }
85
+
86
+ export { ColorSwatch };
@@ -3728,6 +3728,12 @@ function RemoveScrollSideCar(props) {
3728
3728
  if ("touches" in event && moveDirection === "h" && target.type === "range") {
3729
3729
  return false;
3730
3730
  }
3731
+ var selection = window.getSelection();
3732
+ var anchorNode = selection && selection.anchorNode;
3733
+ var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
3734
+ if (isTouchingSelection) {
3735
+ return false;
3736
+ }
3731
3737
  var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
3732
3738
  if (!canBeScrolledInMainDirection) {
3733
3739
  return true;
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+
3
+ var chunkH2BWO3SI_cjs = require('./chunk-H2BWO3SI.cjs');
4
+ var React = require('react');
5
+ var radixUi = require('radix-ui');
6
+ var classVarianceAuthority = require('class-variance-authority');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
+
29
+ var colorSwatchVariants = classVarianceAuthority.cva(
30
+ "box-border rounded border border-border shadow-sm [background-clip:padding-box] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
31
+ {
32
+ variants: {
33
+ size: {
34
+ default: "size-8",
35
+ sm: "size-6",
36
+ lg: "size-12"
37
+ }
38
+ },
39
+ defaultVariants: {
40
+ size: "default"
41
+ }
42
+ }
43
+ );
44
+
45
+ // src/components/color-swatch/color-swatch.utils.ts
46
+ function getIsCssColor(v) {
47
+ try {
48
+ return typeof CSS !== "undefined" && typeof CSS.supports === "function" ? CSS.supports("color", v) : true;
49
+ } catch {
50
+ return false;
51
+ }
52
+ }
53
+ function getHasAlpha(v) {
54
+ const s = v.trim().toLowerCase();
55
+ if (s === "transparent") return true;
56
+ if (/^#(?:[0-9a-f]{4}|[0-9a-f]{8})$/i.test(s)) return true;
57
+ if (/\b(?:rgba|hsla)\s*\(/i.test(s)) return true;
58
+ return /\b(?:rgb|hsl|lab|lch|oklab|oklch|color)\s*\([^)]*\/\s*[\d.]+%?\s*\)/i.test(s);
59
+ }
60
+ function ColorSwatch({
61
+ color,
62
+ size = "default",
63
+ asChild = false,
64
+ disabled = false,
65
+ withoutTransparency = false,
66
+ className,
67
+ style,
68
+ ...props
69
+ }) {
70
+ const colorValue = color?.trim();
71
+ const backgroundStyle = React__namespace.useMemo(() => {
72
+ if (!colorValue) {
73
+ return {
74
+ background: "linear-gradient(to bottom right, transparent calc(50% - 1px), hsl(var(--destructive)) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) no-repeat"
75
+ };
76
+ }
77
+ if (!getIsCssColor(colorValue)) {
78
+ return { backgroundColor: "transparent" };
79
+ }
80
+ if (!withoutTransparency && getHasAlpha(colorValue)) {
81
+ return {
82
+ background: `linear-gradient(${colorValue}, ${colorValue}), repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0% 50% / 10px 10px`
83
+ };
84
+ }
85
+ return { backgroundColor: colorValue };
86
+ }, [colorValue, withoutTransparency]);
87
+ const ariaLabel = !colorValue ? "No color selected" : `Color swatch: ${colorValue}`;
88
+ const Primitive = asChild ? radixUi.Slot.Slot : "div";
89
+ return /* @__PURE__ */ jsxRuntime.jsx(
90
+ Primitive,
91
+ {
92
+ role: "img",
93
+ "aria-label": ariaLabel,
94
+ "aria-disabled": disabled || void 0,
95
+ "data-disabled": disabled ? "" : void 0,
96
+ "data-slot": "color-swatch",
97
+ ...props,
98
+ className: chunkH2BWO3SI_cjs.cn(colorSwatchVariants({ size }), className),
99
+ style: {
100
+ ...backgroundStyle,
101
+ forcedColorAdjust: "none",
102
+ ...style
103
+ }
104
+ }
105
+ );
106
+ }
107
+
108
+ exports.ColorSwatch = ColorSwatch;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRDYKJP7U_cjs = require('../../chunk-RDYKJP7U.cjs');
3
+ var chunk54PWKHYF_cjs = require('../../chunk-54PWKHYF.cjs');
4
4
  require('../../chunk-H2BWO3SI.cjs');
5
5
  require('../../chunk-3376ZTRC.cjs');
6
6
 
@@ -8,5 +8,13 @@ require('../../chunk-3376ZTRC.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "Badge", {
10
10
  enumerable: true,
11
- get: function () { return chunkRDYKJP7U_cjs.Badge; }
11
+ get: function () { return chunk54PWKHYF_cjs.Badge; }
12
+ });
13
+ Object.defineProperty(exports, "BadgeButton", {
14
+ enumerable: true,
15
+ get: function () { return chunk54PWKHYF_cjs.BadgeButton; }
16
+ });
17
+ Object.defineProperty(exports, "BadgeDot", {
18
+ enumerable: true,
19
+ get: function () { return chunk54PWKHYF_cjs.BadgeDot; }
12
20
  });
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
+ import React__default from 'react';
3
4
  import { VariantProps } from 'class-variance-authority';
4
5
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
6
 
6
7
  declare const badgeVariants: (props?: ({
7
- variant?: "default" | "secondary" | "error" | "outline" | null | undefined;
8
+ variant?: "primary" | "secondary" | "outline" | "success" | "warning" | "error" | null | undefined;
8
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
10
 
10
11
  type BadgeVariantsProps = VariantProps<typeof badgeVariants>;
@@ -16,4 +17,12 @@ type BadgeProps = React.ComponentProps<"span"> & {
16
17
  };
17
18
  declare function Badge({ className, variant, asChild, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
18
19
 
19
- export { Badge, type BadgeProps, type BadgeVariant };
20
+ type BadgeButtonProps = React__default.ComponentProps<"button"> & {
21
+ asChild?: boolean;
22
+ };
23
+ declare function BadgeButton({ className, asChild, ...props }: BadgeButtonProps): react_jsx_runtime.JSX.Element;
24
+
25
+ type BadgeDotProps = React.ComponentProps<"span">;
26
+ declare function BadgeDot({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
27
+
28
+ export { Badge, BadgeButton, type BadgeButtonProps, BadgeDot, type BadgeDotProps, type BadgeProps, type BadgeVariant };