@madebywild/wvk 0.0.2 → 0.1.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/AGENTS.md +81 -0
- package/README.md +67 -0
- package/bin/wvk.mjs +198 -0
- package/dist/index.cjs +1246 -718
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +288 -71
- package/dist/index.d.ts +288 -71
- package/dist/index.js +1228 -722
- package/dist/index.js.map +1 -1
- package/dist/styles.css +99 -3
- package/package.json +10 -3
package/dist/index.cjs
CHANGED
|
@@ -32,11 +32,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
32
|
var src_exports = {};
|
|
33
33
|
__export(src_exports, {
|
|
34
34
|
Alert: () => Alert,
|
|
35
|
-
|
|
35
|
+
AnimatePresence: () => import_framer_motion7.AnimatePresence,
|
|
36
36
|
BottomTabBar: () => BottomTabBar,
|
|
37
37
|
BottomTabBarItem: () => BottomTabBarItem,
|
|
38
38
|
Button: () => Button,
|
|
39
|
-
ButtonDecorativeIconGlyph: () => ButtonDecorativeIconGlyph,
|
|
40
39
|
Checkbox: () => Checkbox,
|
|
41
40
|
FieldGroup: () => FieldGroup,
|
|
42
41
|
FieldLabel: () => FieldLabel,
|
|
@@ -45,20 +44,37 @@ __export(src_exports, {
|
|
|
45
44
|
Link: () => Link2,
|
|
46
45
|
ListItem: () => ListItem,
|
|
47
46
|
LoadingSpinner: () => LoadingSpinner,
|
|
47
|
+
Menu: () => Menu2,
|
|
48
|
+
MenuGroup: () => MenuGroup,
|
|
49
|
+
MenuGroupLabel: () => MenuGroupLabel,
|
|
50
|
+
MenuItem: () => MenuItem,
|
|
51
|
+
MenuPopup: () => MenuPopup,
|
|
52
|
+
MenuSeparator: () => MenuSeparator,
|
|
53
|
+
MenuTrigger: () => MenuTrigger,
|
|
54
|
+
Meter: () => Meter,
|
|
48
55
|
Pagination: () => Pagination,
|
|
49
56
|
ProgressBar: () => ProgressBar,
|
|
50
57
|
Radio: () => Radio,
|
|
58
|
+
RadioGroup: () => RadioGroup,
|
|
59
|
+
RadioGroupItem: () => RadioGroupItem,
|
|
51
60
|
SegmentedControl: () => SegmentedControl,
|
|
52
61
|
SegmentedControlItem: () => SegmentedControlItem,
|
|
53
62
|
SegmentedControlTrigger: () => SegmentedControlTrigger,
|
|
54
63
|
Select: () => Select,
|
|
64
|
+
SelectGroup: () => SelectGroup,
|
|
65
|
+
SelectGroupLabel: () => SelectGroupLabel,
|
|
66
|
+
SelectItem: () => SelectItem,
|
|
67
|
+
SelectSeparator: () => SelectSeparator,
|
|
55
68
|
Slider: () => Slider,
|
|
56
69
|
SplitButton: () => SplitButton,
|
|
57
70
|
StarRating: () => StarRating,
|
|
58
71
|
TAG_LEADING_ICON_NAMES: () => TAG_LEADING_ICON_NAMES,
|
|
59
72
|
Tab: () => Tab,
|
|
73
|
+
TabIndicator: () => TabIndicator,
|
|
60
74
|
TabList: () => TabList,
|
|
75
|
+
TabPanel: () => TabPanel,
|
|
61
76
|
Tabs: () => Tabs,
|
|
77
|
+
TabsContent: () => TabsContent,
|
|
62
78
|
TabsList: () => TabsList,
|
|
63
79
|
TabsTrigger: () => TabsTrigger,
|
|
64
80
|
Tag: () => Tag2,
|
|
@@ -73,20 +89,25 @@ __export(src_exports, {
|
|
|
73
89
|
ThemeSwitcher: () => ThemeSwitcher,
|
|
74
90
|
ToggleSwitch: () => ToggleSwitch,
|
|
75
91
|
Tooltip: () => Tooltip,
|
|
92
|
+
TooltipPopup: () => TooltipPopup,
|
|
93
|
+
TooltipProvider: () => TooltipProvider,
|
|
76
94
|
VideoControls: () => VideoControls,
|
|
77
95
|
VideoPlaceholder: () => VideoPlaceholder,
|
|
96
|
+
WhimsyCursor: () => WhimsyCursor,
|
|
78
97
|
buttonVariants: () => buttonVariants,
|
|
79
98
|
checkboxFrameVariants: () => checkboxFrameVariants,
|
|
80
99
|
cn: () => cn,
|
|
100
|
+
fadeInUp: () => fadeInUp,
|
|
81
101
|
hasRenderableFieldLabelText: () => hasRenderableFieldLabelText,
|
|
82
102
|
linkVariants: () => linkVariants,
|
|
83
103
|
listItemVariants: () => listItemVariants,
|
|
104
|
+
motion: () => import_framer_motion7.motion,
|
|
84
105
|
placeholderVariants: () => placeholderVariants,
|
|
85
106
|
radioFrameVariants: () => radioFrameVariants,
|
|
86
|
-
selectFieldVariants: () => selectFieldVariants,
|
|
87
107
|
selectShellVariants: () => selectShellVariants,
|
|
88
108
|
selectVariants: () => selectShellVariants,
|
|
89
109
|
splitButtonVariants: () => splitButtonVariants,
|
|
110
|
+
staggerContainer: () => staggerContainer,
|
|
90
111
|
tabListVariants: () => tabListVariants,
|
|
91
112
|
tagVariants: () => tagVariants,
|
|
92
113
|
textAreaFieldVariants: () => textAreaFieldVariants,
|
|
@@ -94,6 +115,7 @@ __export(src_exports, {
|
|
|
94
115
|
textInputShellVariants: () => textInputShellVariants,
|
|
95
116
|
toggleSwitchVariants: () => toggleSwitchVariants,
|
|
96
117
|
toggleThumbVariants: () => toggleThumbVariants,
|
|
118
|
+
useCursorStyle: () => useCursorStyle,
|
|
97
119
|
useTheme: () => useTheme,
|
|
98
120
|
wvkIconBoxLgClass: () => wvkIconBoxLgClass,
|
|
99
121
|
wvkIconLgClass: () => wvkIconLgClass,
|
|
@@ -104,6 +126,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
104
126
|
|
|
105
127
|
// src/components/ui/alert.tsx
|
|
106
128
|
var React = __toESM(require("react"), 1);
|
|
129
|
+
var import_framer_motion = require("framer-motion");
|
|
107
130
|
var import_class_variance_authority = require("class-variance-authority");
|
|
108
131
|
|
|
109
132
|
// src/lib/utils.ts
|
|
@@ -4842,12 +4865,15 @@ var Alert = React.forwardRef(
|
|
|
4842
4865
|
const resolvedIcon = icon ?? defaultIcons[resolvedVariant];
|
|
4843
4866
|
const bodyId = React.useId();
|
|
4844
4867
|
return /* @__PURE__ */ (0, import_jsx_runtime184.jsxs)(
|
|
4845
|
-
|
|
4868
|
+
import_framer_motion.motion.div,
|
|
4846
4869
|
{
|
|
4847
4870
|
className: cn(alertVariants({ variant, className })),
|
|
4848
4871
|
ref,
|
|
4849
4872
|
role: "alert",
|
|
4850
4873
|
"aria-describedby": children ? bodyId : void 0,
|
|
4874
|
+
initial: { opacity: 0, y: -6 },
|
|
4875
|
+
animate: { opacity: 1, y: 0 },
|
|
4876
|
+
transition: { duration: 0.25, ease: "easeOut" },
|
|
4851
4877
|
...props,
|
|
4852
4878
|
children: [
|
|
4853
4879
|
resolvedIcon && /* @__PURE__ */ (0, import_jsx_runtime184.jsx)("span", { className: "mt-0.5 shrink-0", children: resolvedIcon }),
|
|
@@ -4932,11 +4958,11 @@ BottomTabBarItem.displayName = "BottomTabBarItem";
|
|
|
4932
4958
|
|
|
4933
4959
|
// src/components/ui/button.tsx
|
|
4934
4960
|
var React3 = __toESM(require("react"), 1);
|
|
4935
|
-
var
|
|
4961
|
+
var import_use_render = require("@base-ui-components/react/use-render");
|
|
4936
4962
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
4937
4963
|
var import_jsx_runtime186 = require("react/jsx-runtime");
|
|
4938
4964
|
var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
4939
|
-
"inline-flex items-center justify-center font-bold whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
|
|
4965
|
+
"inline-flex items-center justify-center font-bold whitespace-nowrap transition-[transform,colors] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 active:scale-[0.97]",
|
|
4940
4966
|
{
|
|
4941
4967
|
variants: {
|
|
4942
4968
|
variant: {
|
|
@@ -4951,11 +4977,21 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
4951
4977
|
sm: "h-8 px-3 text-xs rounded-[var(--radius-md)] gap-1",
|
|
4952
4978
|
md: "h-10 px-4 text-sm rounded-[var(--radius-md)] gap-1.5",
|
|
4953
4979
|
lg: "h-14 px-6 text-sm rounded-[var(--radius-md)] gap-2"
|
|
4980
|
+
},
|
|
4981
|
+
iconOnly: {
|
|
4982
|
+
true: "p-0 gap-0",
|
|
4983
|
+
false: ""
|
|
4954
4984
|
}
|
|
4955
4985
|
},
|
|
4986
|
+
compoundVariants: [
|
|
4987
|
+
{ size: "sm", iconOnly: true, class: "w-8" },
|
|
4988
|
+
{ size: "md", iconOnly: true, class: "w-10" },
|
|
4989
|
+
{ size: "lg", iconOnly: true, class: "w-14" }
|
|
4990
|
+
],
|
|
4956
4991
|
defaultVariants: {
|
|
4957
4992
|
variant: "primary",
|
|
4958
|
-
size: "lg"
|
|
4993
|
+
size: "lg",
|
|
4994
|
+
iconOnly: false
|
|
4959
4995
|
}
|
|
4960
4996
|
}
|
|
4961
4997
|
);
|
|
@@ -4964,37 +5000,56 @@ var Button = React3.forwardRef(
|
|
|
4964
5000
|
className,
|
|
4965
5001
|
variant,
|
|
4966
5002
|
size,
|
|
4967
|
-
|
|
5003
|
+
iconOnly,
|
|
5004
|
+
render,
|
|
4968
5005
|
leadingIcon,
|
|
4969
5006
|
trailingIcon,
|
|
4970
5007
|
children,
|
|
4971
5008
|
...props
|
|
4972
5009
|
}, ref) => {
|
|
4973
|
-
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
4974
5010
|
const resolvedSize = size ?? "lg";
|
|
4975
|
-
const showIcons = !
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
/* @__PURE__ */ (0, import_jsx_runtime186.jsx)("span", { className: "
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
5011
|
+
const showIcons = !iconOnly && !render && Boolean(leadingIcon || trailingIcon);
|
|
5012
|
+
let content;
|
|
5013
|
+
if (iconOnly) {
|
|
5014
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center text-current [&_svg]:block", children });
|
|
5015
|
+
} else if (showIcons) {
|
|
5016
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime186.jsxs)(import_jsx_runtime186.Fragment, { children: [
|
|
5017
|
+
leadingIcon ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center text-current [&_svg]:block", children: leadingIcon }) : null,
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime186.jsx)("span", { className: "min-w-0", children }),
|
|
5019
|
+
trailingIcon ? /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("span", { className: "inline-flex shrink-0 items-center justify-center text-current [&_svg]:block", children: trailingIcon }) : null
|
|
5020
|
+
] });
|
|
5021
|
+
} else {
|
|
5022
|
+
content = children;
|
|
5023
|
+
}
|
|
5024
|
+
const element = (0, import_use_render.useRender)({
|
|
5025
|
+
defaultTagName: "button",
|
|
5026
|
+
render,
|
|
5027
|
+
ref,
|
|
5028
|
+
props: {
|
|
4986
5029
|
...props,
|
|
5030
|
+
className: cn(
|
|
5031
|
+
buttonVariants({
|
|
5032
|
+
variant,
|
|
5033
|
+
size: resolvedSize,
|
|
5034
|
+
iconOnly: Boolean(iconOnly),
|
|
5035
|
+
className
|
|
5036
|
+
})
|
|
5037
|
+
),
|
|
4987
5038
|
children: content
|
|
4988
5039
|
}
|
|
4989
|
-
);
|
|
5040
|
+
});
|
|
5041
|
+
return element;
|
|
4990
5042
|
}
|
|
4991
5043
|
);
|
|
4992
5044
|
Button.displayName = "Button";
|
|
4993
5045
|
|
|
4994
5046
|
// src/components/ui/checkbox.tsx
|
|
4995
5047
|
var React4 = __toESM(require("react"), 1);
|
|
5048
|
+
var import_checkbox = require("@base-ui-components/react/checkbox");
|
|
5049
|
+
var import_framer_motion2 = require("framer-motion");
|
|
4996
5050
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
4997
5051
|
var import_jsx_runtime187 = require("react/jsx-runtime");
|
|
5052
|
+
var CHECKBOX_TAP_TRANSITION = { type: "spring", stiffness: 600, damping: 22 };
|
|
4998
5053
|
var CHECKMARK_PATH = "m7.951 12.537 7.296-8.195a1 1 0 0 1 1.506 1.317l-8 9a1 1 0 0 1-1.46.048l-4-4a1 1 0 1 1 1.414-1.414z";
|
|
4999
5054
|
var MINUS_PATH = "M4 9h12a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2Z";
|
|
5000
5055
|
var CHECKBOX_MARK_GROUP_TRANSFORM = `translate(11 11) scale(${11 / 12}) translate(-10 -10)`;
|
|
@@ -5002,7 +5057,7 @@ var checkboxFrameVariants = (0, import_class_variance_authority3.cva)(
|
|
|
5002
5057
|
[
|
|
5003
5058
|
"relative inline-flex items-center justify-center p-0 bg-transparent border-0 cursor-pointer transition-colors",
|
|
5004
5059
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
5005
|
-
"disabled:pointer-events-none disabled:opacity-50"
|
|
5060
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
|
|
5006
5061
|
],
|
|
5007
5062
|
{
|
|
5008
5063
|
variants: {
|
|
@@ -5019,75 +5074,74 @@ var checkboxFrameVariants = (0, import_class_variance_authority3.cva)(
|
|
|
5019
5074
|
);
|
|
5020
5075
|
var Checkbox = React4.forwardRef(
|
|
5021
5076
|
({
|
|
5022
|
-
checked = false,
|
|
5023
|
-
indeterminate = false,
|
|
5024
|
-
onCheckedChange,
|
|
5025
|
-
disabled = false,
|
|
5026
5077
|
className,
|
|
5027
|
-
size
|
|
5028
|
-
|
|
5078
|
+
size,
|
|
5079
|
+
onCheckedChange,
|
|
5080
|
+
indeterminate,
|
|
5029
5081
|
...rest
|
|
5030
5082
|
}, ref) => {
|
|
5031
|
-
const handleClick = (e) => {
|
|
5032
|
-
onClick?.(e);
|
|
5033
|
-
if (!disabled && !e.defaultPrevented) {
|
|
5034
|
-
onCheckedChange?.(!checked);
|
|
5035
|
-
}
|
|
5036
|
-
};
|
|
5037
|
-
const isActive = checked || indeterminate;
|
|
5038
5083
|
const s = size ?? "lg";
|
|
5039
5084
|
return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5040
|
-
|
|
5085
|
+
import_checkbox.Checkbox.Root,
|
|
5041
5086
|
{
|
|
5042
|
-
...rest,
|
|
5043
5087
|
ref,
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
disabled,
|
|
5048
|
-
onClick: handleClick,
|
|
5088
|
+
indeterminate,
|
|
5089
|
+
onCheckedChange: (checked) => onCheckedChange?.(checked),
|
|
5090
|
+
nativeButton: true,
|
|
5049
5091
|
className: cn(checkboxFrameVariants({ size: s }), className),
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5060
|
-
"
|
|
5061
|
-
{
|
|
5062
|
-
x: "0.5",
|
|
5063
|
-
y: "0.5",
|
|
5064
|
-
width: "21",
|
|
5065
|
-
height: "21",
|
|
5066
|
-
rx: "4",
|
|
5067
|
-
fill: isActive ? "var(--color-primary)" : "transparent",
|
|
5068
|
-
stroke: isActive ? "var(--color-primary)" : "var(--color-primary)",
|
|
5069
|
-
strokeWidth: "1"
|
|
5070
|
-
}
|
|
5071
|
-
),
|
|
5072
|
-
checked && !indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5073
|
-
"g",
|
|
5074
|
-
{
|
|
5075
|
-
fill: "var(--color-primary-foreground)",
|
|
5076
|
-
transform: CHECKBOX_MARK_GROUP_TRANSFORM,
|
|
5077
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("path", { d: CHECKMARK_PATH })
|
|
5078
|
-
}
|
|
5079
|
-
) : null,
|
|
5080
|
-
indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5081
|
-
"g",
|
|
5092
|
+
...rest,
|
|
5093
|
+
render: (props, state) => {
|
|
5094
|
+
const isActive = state.checked || state.indeterminate;
|
|
5095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5096
|
+
import_framer_motion2.motion.span,
|
|
5097
|
+
{
|
|
5098
|
+
className: "inline-flex",
|
|
5099
|
+
whileTap: { scale: 0.85 },
|
|
5100
|
+
transition: CHECKBOX_TAP_TRANSITION,
|
|
5101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("button", { ...props, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime187.jsxs)(
|
|
5102
|
+
"svg",
|
|
5082
5103
|
{
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5104
|
+
className: "size-full max-h-none max-w-none",
|
|
5105
|
+
viewBox: "0 0 22 22",
|
|
5106
|
+
fill: "none",
|
|
5107
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5108
|
+
"aria-hidden": true,
|
|
5109
|
+
children: [
|
|
5110
|
+
/* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5111
|
+
"rect",
|
|
5112
|
+
{
|
|
5113
|
+
x: "0.5",
|
|
5114
|
+
y: "0.5",
|
|
5115
|
+
width: "21",
|
|
5116
|
+
height: "21",
|
|
5117
|
+
rx: "4",
|
|
5118
|
+
fill: isActive ? "var(--color-primary)" : "transparent",
|
|
5119
|
+
stroke: "var(--color-primary)",
|
|
5120
|
+
strokeWidth: "1"
|
|
5121
|
+
}
|
|
5122
|
+
),
|
|
5123
|
+
state.checked && !state.indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5124
|
+
"g",
|
|
5125
|
+
{
|
|
5126
|
+
fill: "var(--color-primary-foreground)",
|
|
5127
|
+
transform: CHECKBOX_MARK_GROUP_TRANSFORM,
|
|
5128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("path", { d: CHECKMARK_PATH })
|
|
5129
|
+
}
|
|
5130
|
+
) : null,
|
|
5131
|
+
state.indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(
|
|
5132
|
+
"g",
|
|
5133
|
+
{
|
|
5134
|
+
fill: "var(--color-primary-foreground)",
|
|
5135
|
+
transform: CHECKBOX_MARK_GROUP_TRANSFORM,
|
|
5136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)("path", { d: MINUS_PATH })
|
|
5137
|
+
}
|
|
5138
|
+
) : null
|
|
5139
|
+
]
|
|
5086
5140
|
}
|
|
5087
|
-
)
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5141
|
+
) })
|
|
5142
|
+
}
|
|
5143
|
+
);
|
|
5144
|
+
}
|
|
5091
5145
|
}
|
|
5092
5146
|
);
|
|
5093
5147
|
}
|
|
@@ -5099,6 +5153,7 @@ var React6 = __toESM(require("react"), 1);
|
|
|
5099
5153
|
|
|
5100
5154
|
// src/components/ui/tooltip.tsx
|
|
5101
5155
|
var React5 = __toESM(require("react"), 1);
|
|
5156
|
+
var import_tooltip = require("@base-ui-components/react/tooltip");
|
|
5102
5157
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
5103
5158
|
var import_jsx_runtime188 = require("react/jsx-runtime");
|
|
5104
5159
|
var tooltipVariants = (0, import_class_variance_authority4.cva)("relative rounded-[var(--radius-md)] w-max", {
|
|
@@ -5159,6 +5214,41 @@ var Tooltip = React5.forwardRef(
|
|
|
5159
5214
|
}
|
|
5160
5215
|
);
|
|
5161
5216
|
Tooltip.displayName = "Tooltip";
|
|
5217
|
+
var TooltipProvider = import_tooltip.Tooltip.Provider;
|
|
5218
|
+
function TooltipPopup({
|
|
5219
|
+
trigger,
|
|
5220
|
+
children,
|
|
5221
|
+
theme,
|
|
5222
|
+
size,
|
|
5223
|
+
side = "top",
|
|
5224
|
+
sideOffset = 8,
|
|
5225
|
+
className,
|
|
5226
|
+
...rest
|
|
5227
|
+
}) {
|
|
5228
|
+
const resolvedTheme = theme ?? "dark";
|
|
5229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(import_tooltip.Tooltip.Root, { children: [
|
|
5230
|
+
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_tooltip.Tooltip.Trigger, { render: trigger }),
|
|
5231
|
+
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_tooltip.Tooltip.Positioner, { side, sideOffset, children: /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(
|
|
5232
|
+
import_tooltip.Tooltip.Popup,
|
|
5233
|
+
{
|
|
5234
|
+
className: cn(tooltipVariants({ theme, size }), className),
|
|
5235
|
+
...rest,
|
|
5236
|
+
children: [
|
|
5237
|
+
children,
|
|
5238
|
+
/* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
|
|
5239
|
+
import_tooltip.Tooltip.Arrow,
|
|
5240
|
+
{
|
|
5241
|
+
className: cn(
|
|
5242
|
+
"h-0 w-0 border-l-[4px] border-r-[4px] border-t-[4px] border-l-transparent border-r-transparent",
|
|
5243
|
+
resolvedTheme === "dark" ? "border-t-primary" : "border-t-border"
|
|
5244
|
+
)
|
|
5245
|
+
}
|
|
5246
|
+
)
|
|
5247
|
+
]
|
|
5248
|
+
}
|
|
5249
|
+
) }) })
|
|
5250
|
+
] });
|
|
5251
|
+
}
|
|
5162
5252
|
|
|
5163
5253
|
// src/components/ui/field-label.tsx
|
|
5164
5254
|
var import_jsx_runtime189 = require("react/jsx-runtime");
|
|
@@ -5352,16 +5442,17 @@ InfoBar.displayName = "InfoBar";
|
|
|
5352
5442
|
|
|
5353
5443
|
// src/components/ui/link.tsx
|
|
5354
5444
|
var React8 = __toESM(require("react"), 1);
|
|
5445
|
+
var import_framer_motion3 = require("framer-motion");
|
|
5355
5446
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
5356
5447
|
var import_jsx_runtime192 = require("react/jsx-runtime");
|
|
5357
5448
|
var linkVariants = (0, import_class_variance_authority5.cva)(
|
|
5358
|
-
"inline-flex w-fit items-center gap-[var(--wvk-gap-sm)] font-bold
|
|
5449
|
+
"relative inline-flex w-fit items-center gap-[var(--wvk-gap-sm)] font-bold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
5359
5450
|
{
|
|
5360
5451
|
variants: {
|
|
5361
5452
|
theme: {
|
|
5362
|
-
dark: "text-primary
|
|
5363
|
-
light: "text-primary-foreground
|
|
5364
|
-
medium: "text-muted-foreground
|
|
5453
|
+
dark: "text-primary",
|
|
5454
|
+
light: "text-primary-foreground",
|
|
5455
|
+
medium: "text-muted-foreground"
|
|
5365
5456
|
},
|
|
5366
5457
|
size: {
|
|
5367
5458
|
body: "text-sm leading-5",
|
|
@@ -5375,13 +5466,36 @@ var linkVariants = (0, import_class_variance_authority5.cva)(
|
|
|
5375
5466
|
}
|
|
5376
5467
|
);
|
|
5377
5468
|
var Link2 = React8.forwardRef(
|
|
5378
|
-
({ className, theme, size, ...props }, ref) => {
|
|
5379
|
-
|
|
5469
|
+
({ className, theme, size, underlined = false, children, onMouseEnter, onMouseLeave, ...props }, ref) => {
|
|
5470
|
+
const [hovered, setHovered] = React8.useState(false);
|
|
5471
|
+
const showUnderline = underlined ? !hovered : hovered;
|
|
5472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)(
|
|
5380
5473
|
"a",
|
|
5381
5474
|
{
|
|
5382
5475
|
className: cn(linkVariants({ theme, size, className })),
|
|
5383
5476
|
ref,
|
|
5384
|
-
|
|
5477
|
+
onMouseEnter: (e) => {
|
|
5478
|
+
setHovered(true);
|
|
5479
|
+
onMouseEnter?.(e);
|
|
5480
|
+
},
|
|
5481
|
+
onMouseLeave: (e) => {
|
|
5482
|
+
setHovered(false);
|
|
5483
|
+
onMouseLeave?.(e);
|
|
5484
|
+
},
|
|
5485
|
+
...props,
|
|
5486
|
+
children: [
|
|
5487
|
+
children,
|
|
5488
|
+
/* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
|
|
5489
|
+
import_framer_motion3.motion.span,
|
|
5490
|
+
{
|
|
5491
|
+
"aria-hidden": true,
|
|
5492
|
+
className: "pointer-events-none absolute bottom-0 left-0 h-0.5 w-full origin-left bg-current",
|
|
5493
|
+
animate: { scaleX: showUnderline ? 1 : 0 },
|
|
5494
|
+
initial: { scaleX: underlined ? 1 : 0 },
|
|
5495
|
+
transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] }
|
|
5496
|
+
}
|
|
5497
|
+
)
|
|
5498
|
+
]
|
|
5385
5499
|
}
|
|
5386
5500
|
);
|
|
5387
5501
|
}
|
|
@@ -5656,10 +5770,58 @@ var VideoControls = React11.forwardRef(
|
|
|
5656
5770
|
);
|
|
5657
5771
|
VideoControls.displayName = "VideoControls";
|
|
5658
5772
|
|
|
5659
|
-
// src/components/ui/
|
|
5773
|
+
// src/components/ui/menu.tsx
|
|
5660
5774
|
var React12 = __toESM(require("react"), 1);
|
|
5661
|
-
var
|
|
5775
|
+
var import_menu = require("@base-ui-components/react/menu");
|
|
5662
5776
|
var import_jsx_runtime196 = require("react/jsx-runtime");
|
|
5777
|
+
var Menu2 = import_menu.Menu.Root;
|
|
5778
|
+
var MenuTrigger = import_menu.Menu.Trigger;
|
|
5779
|
+
var MenuPopup = React12.forwardRef(
|
|
5780
|
+
({ className, children, side = "bottom", sideOffset = 6, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(import_menu.Menu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(import_menu.Menu.Positioner, { side, sideOffset, children: /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
5781
|
+
import_menu.Menu.Popup,
|
|
5782
|
+
{
|
|
5783
|
+
ref,
|
|
5784
|
+
className: cn(
|
|
5785
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-[var(--radius-md)] border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none",
|
|
5786
|
+
className
|
|
5787
|
+
),
|
|
5788
|
+
...rest,
|
|
5789
|
+
children
|
|
5790
|
+
}
|
|
5791
|
+
) }) })
|
|
5792
|
+
);
|
|
5793
|
+
MenuPopup.displayName = "MenuPopup";
|
|
5794
|
+
var MenuItem = React12.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
5795
|
+
import_menu.Menu.Item,
|
|
5796
|
+
{
|
|
5797
|
+
ref,
|
|
5798
|
+
className: cn(
|
|
5799
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-[var(--radius-sm)] px-2 py-1.5 text-sm outline-none transition-colors",
|
|
5800
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
5801
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
5802
|
+
className
|
|
5803
|
+
),
|
|
5804
|
+
...rest
|
|
5805
|
+
}
|
|
5806
|
+
));
|
|
5807
|
+
MenuItem.displayName = "MenuItem";
|
|
5808
|
+
var MenuSeparator = React12.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
|
|
5809
|
+
"div",
|
|
5810
|
+
{
|
|
5811
|
+
ref,
|
|
5812
|
+
role: "separator",
|
|
5813
|
+
className: cn("my-1 h-px bg-border", className),
|
|
5814
|
+
...rest
|
|
5815
|
+
}
|
|
5816
|
+
));
|
|
5817
|
+
MenuSeparator.displayName = "MenuSeparator";
|
|
5818
|
+
var MenuGroup = import_menu.Menu.Group;
|
|
5819
|
+
var MenuGroupLabel = import_menu.Menu.GroupLabel;
|
|
5820
|
+
|
|
5821
|
+
// src/components/ui/pagination.tsx
|
|
5822
|
+
var React13 = __toESM(require("react"), 1);
|
|
5823
|
+
var import_class_variance_authority9 = require("class-variance-authority");
|
|
5824
|
+
var import_jsx_runtime197 = require("react/jsx-runtime");
|
|
5663
5825
|
var paginationVariants = (0, import_class_variance_authority9.cva)("inline-flex items-center", {
|
|
5664
5826
|
variants: {
|
|
5665
5827
|
size: {
|
|
@@ -5677,11 +5839,11 @@ var dotSizes = {
|
|
|
5677
5839
|
md: { active: "w-2.5 h-2.5", inactive: "w-2 h-2" },
|
|
5678
5840
|
lg: { active: "w-3 h-3", inactive: "w-2 h-2" }
|
|
5679
5841
|
};
|
|
5680
|
-
var Pagination =
|
|
5842
|
+
var Pagination = React13.forwardRef(
|
|
5681
5843
|
({ pages, current, onPageChange, size = "md", className, ...rest }, ref) => {
|
|
5682
5844
|
const sizeKey = size ?? "md";
|
|
5683
5845
|
const sizes = dotSizes[sizeKey];
|
|
5684
|
-
return /* @__PURE__ */ (0,
|
|
5846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
|
|
5685
5847
|
"div",
|
|
5686
5848
|
{
|
|
5687
5849
|
...rest,
|
|
@@ -5691,7 +5853,7 @@ var Pagination = React12.forwardRef(
|
|
|
5691
5853
|
className: cn(paginationVariants({ size, className })),
|
|
5692
5854
|
children: Array.from({ length: pages }, (_, i) => {
|
|
5693
5855
|
const isActive = i === current;
|
|
5694
|
-
return /* @__PURE__ */ (0,
|
|
5856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
|
|
5695
5857
|
"button",
|
|
5696
5858
|
{
|
|
5697
5859
|
type: "button",
|
|
@@ -5713,43 +5875,54 @@ var Pagination = React12.forwardRef(
|
|
|
5713
5875
|
Pagination.displayName = "Pagination";
|
|
5714
5876
|
|
|
5715
5877
|
// src/components/ui/progress-bar.tsx
|
|
5716
|
-
var
|
|
5717
|
-
var
|
|
5718
|
-
var
|
|
5878
|
+
var React14 = __toESM(require("react"), 1);
|
|
5879
|
+
var import_progress = require("@base-ui-components/react/progress");
|
|
5880
|
+
var import_meter = require("@base-ui-components/react/meter");
|
|
5881
|
+
var import_jsx_runtime198 = require("react/jsx-runtime");
|
|
5882
|
+
var ProgressBar = React14.forwardRef(
|
|
5719
5883
|
({ className, value = 0, ...props }, ref) => {
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
"div",
|
|
5884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
5885
|
+
import_progress.Progress.Root,
|
|
5723
5886
|
{
|
|
5724
|
-
className: cn("w-full h-2 bg-muted rounded-full overflow-hidden", className),
|
|
5725
5887
|
ref,
|
|
5726
|
-
|
|
5727
|
-
"
|
|
5728
|
-
"aria-valuemin": 0,
|
|
5729
|
-
"aria-valuemax": 100,
|
|
5888
|
+
value,
|
|
5889
|
+
className: cn("w-full", className),
|
|
5730
5890
|
...props,
|
|
5731
|
-
children: /* @__PURE__ */ (0,
|
|
5732
|
-
"div",
|
|
5733
|
-
{
|
|
5734
|
-
className: "h-full bg-primary rounded-full transition-all duration-300",
|
|
5735
|
-
style: { width: `${clampedValue}%` }
|
|
5736
|
-
}
|
|
5737
|
-
)
|
|
5891
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(import_progress.Progress.Track, { className: "block h-2 w-full overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(import_progress.Progress.Indicator, { className: "block h-full rounded-full bg-primary transition-all duration-300" }) })
|
|
5738
5892
|
}
|
|
5739
5893
|
);
|
|
5740
5894
|
}
|
|
5741
5895
|
);
|
|
5742
5896
|
ProgressBar.displayName = "ProgressBar";
|
|
5897
|
+
var Meter = React14.forwardRef(
|
|
5898
|
+
({ className, value = 0, ...props }, ref) => {
|
|
5899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
5900
|
+
import_meter.Meter.Root,
|
|
5901
|
+
{
|
|
5902
|
+
ref,
|
|
5903
|
+
value,
|
|
5904
|
+
className: cn("w-full", className),
|
|
5905
|
+
...props,
|
|
5906
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(import_meter.Meter.Track, { className: "block h-2 w-full overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(import_meter.Meter.Indicator, { className: "block h-full rounded-full bg-primary transition-all duration-300" }) })
|
|
5907
|
+
}
|
|
5908
|
+
);
|
|
5909
|
+
}
|
|
5910
|
+
);
|
|
5911
|
+
Meter.displayName = "Meter";
|
|
5743
5912
|
|
|
5744
5913
|
// src/components/ui/radio.tsx
|
|
5745
|
-
var
|
|
5914
|
+
var React15 = __toESM(require("react"), 1);
|
|
5915
|
+
var import_radio = require("@base-ui-components/react/radio");
|
|
5916
|
+
var import_radio_group = require("@base-ui-components/react/radio-group");
|
|
5917
|
+
var import_framer_motion4 = require("framer-motion");
|
|
5746
5918
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
5747
|
-
var
|
|
5919
|
+
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
5920
|
+
var RADIO_TAP_TRANSITION = { type: "spring", stiffness: 600, damping: 22 };
|
|
5748
5921
|
var radioFrameVariants = (0, import_class_variance_authority10.cva)(
|
|
5749
5922
|
[
|
|
5750
5923
|
"inline-flex items-center justify-center p-0 bg-transparent border-0 cursor-pointer transition-colors",
|
|
5751
5924
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
5752
|
-
"disabled:pointer-events-none disabled:opacity-50"
|
|
5925
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50 disabled:pointer-events-none disabled:opacity-50"
|
|
5753
5926
|
],
|
|
5754
5927
|
{
|
|
5755
5928
|
variants: {
|
|
@@ -5764,7 +5937,33 @@ var radioFrameVariants = (0, import_class_variance_authority10.cva)(
|
|
|
5764
5937
|
}
|
|
5765
5938
|
}
|
|
5766
5939
|
);
|
|
5767
|
-
|
|
5940
|
+
function RadioGlyph({ checked }) {
|
|
5941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsxs)(
|
|
5942
|
+
"svg",
|
|
5943
|
+
{
|
|
5944
|
+
className: "size-full max-h-none max-w-none",
|
|
5945
|
+
viewBox: "0 0 24 24",
|
|
5946
|
+
fill: "none",
|
|
5947
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5948
|
+
"aria-hidden": true,
|
|
5949
|
+
children: [
|
|
5950
|
+
/* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
5951
|
+
"circle",
|
|
5952
|
+
{
|
|
5953
|
+
cx: "12",
|
|
5954
|
+
cy: "12",
|
|
5955
|
+
r: "11.5",
|
|
5956
|
+
stroke: "var(--color-primary)",
|
|
5957
|
+
strokeWidth: "1",
|
|
5958
|
+
fill: "transparent"
|
|
5959
|
+
}
|
|
5960
|
+
),
|
|
5961
|
+
checked && /* @__PURE__ */ (0, import_jsx_runtime199.jsx)("circle", { cx: "12", cy: "12", r: "5", fill: "var(--color-primary)" })
|
|
5962
|
+
]
|
|
5963
|
+
}
|
|
5964
|
+
);
|
|
5965
|
+
}
|
|
5966
|
+
var Radio = React15.forwardRef(
|
|
5768
5967
|
({
|
|
5769
5968
|
checked = false,
|
|
5770
5969
|
onCheckedChange,
|
|
@@ -5777,57 +5976,80 @@ var Radio = React14.forwardRef(
|
|
|
5777
5976
|
}, ref) => {
|
|
5778
5977
|
const handleClick = (e) => {
|
|
5779
5978
|
onClick?.(e);
|
|
5780
|
-
if (!disabled && !e.defaultPrevented) {
|
|
5781
|
-
onCheckedChange?.(
|
|
5979
|
+
if (!disabled && !e.defaultPrevented && !checked) {
|
|
5980
|
+
onCheckedChange?.(true);
|
|
5782
5981
|
}
|
|
5783
5982
|
};
|
|
5784
5983
|
const s = size ?? "lg";
|
|
5785
|
-
return /* @__PURE__ */ (0,
|
|
5786
|
-
|
|
5984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
5985
|
+
import_framer_motion4.motion.span,
|
|
5986
|
+
{
|
|
5987
|
+
className: cn("inline-flex", disabled && "pointer-events-none"),
|
|
5988
|
+
whileTap: { scale: 0.85 },
|
|
5989
|
+
transition: RADIO_TAP_TRANSITION,
|
|
5990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
5991
|
+
"button",
|
|
5992
|
+
{
|
|
5993
|
+
...rest,
|
|
5994
|
+
ref,
|
|
5995
|
+
type: "button",
|
|
5996
|
+
role: "radio",
|
|
5997
|
+
"aria-checked": checked,
|
|
5998
|
+
"data-value": value,
|
|
5999
|
+
disabled,
|
|
6000
|
+
onClick: handleClick,
|
|
6001
|
+
className: cn(radioFrameVariants({ size: s }), className),
|
|
6002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(RadioGlyph, { checked })
|
|
6003
|
+
}
|
|
6004
|
+
)
|
|
6005
|
+
}
|
|
6006
|
+
);
|
|
6007
|
+
}
|
|
6008
|
+
);
|
|
6009
|
+
Radio.displayName = "Radio";
|
|
6010
|
+
var RadioGroup = React15.forwardRef(
|
|
6011
|
+
({ className, onValueChange, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
6012
|
+
import_radio_group.RadioGroup,
|
|
6013
|
+
{
|
|
6014
|
+
ref,
|
|
6015
|
+
onValueChange: (value) => onValueChange?.(value),
|
|
6016
|
+
className: cn("flex flex-col gap-2", className),
|
|
6017
|
+
...rest
|
|
6018
|
+
}
|
|
6019
|
+
)
|
|
6020
|
+
);
|
|
6021
|
+
RadioGroup.displayName = "RadioGroup";
|
|
6022
|
+
var RadioGroupItem = React15.forwardRef(
|
|
6023
|
+
({ className, size, ...rest }, ref) => {
|
|
6024
|
+
const s = size ?? "lg";
|
|
6025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
6026
|
+
import_radio.Radio.Root,
|
|
5787
6027
|
{
|
|
5788
|
-
...rest,
|
|
5789
6028
|
ref,
|
|
5790
|
-
|
|
5791
|
-
role: "radio",
|
|
5792
|
-
"aria-checked": checked,
|
|
5793
|
-
"data-value": value,
|
|
5794
|
-
disabled,
|
|
5795
|
-
onClick: handleClick,
|
|
6029
|
+
nativeButton: true,
|
|
5796
6030
|
className: cn(radioFrameVariants({ size: s }), className),
|
|
5797
|
-
|
|
5798
|
-
|
|
6031
|
+
...rest,
|
|
6032
|
+
render: (props, state) => /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(
|
|
6033
|
+
import_framer_motion4.motion.span,
|
|
5799
6034
|
{
|
|
5800
|
-
className: "
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
"aria-hidden": true,
|
|
5805
|
-
children: [
|
|
5806
|
-
/* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
|
|
5807
|
-
"circle",
|
|
5808
|
-
{
|
|
5809
|
-
cx: "12",
|
|
5810
|
-
cy: "12",
|
|
5811
|
-
r: "11.5",
|
|
5812
|
-
stroke: "var(--color-primary)",
|
|
5813
|
-
strokeWidth: "1",
|
|
5814
|
-
fill: "transparent"
|
|
5815
|
-
}
|
|
5816
|
-
),
|
|
5817
|
-
checked && /* @__PURE__ */ (0, import_jsx_runtime198.jsx)("circle", { cx: "12", cy: "12", r: "5", fill: "var(--color-primary)" })
|
|
5818
|
-
]
|
|
6035
|
+
className: "inline-flex",
|
|
6036
|
+
whileTap: { scale: 0.85 },
|
|
6037
|
+
transition: RADIO_TAP_TRANSITION,
|
|
6038
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)("button", { ...props, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(RadioGlyph, { checked: state.checked }) })
|
|
5819
6039
|
}
|
|
5820
6040
|
)
|
|
5821
6041
|
}
|
|
5822
6042
|
);
|
|
5823
6043
|
}
|
|
5824
6044
|
);
|
|
5825
|
-
|
|
6045
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
5826
6046
|
|
|
5827
6047
|
// src/components/ui/segmented-control.tsx
|
|
5828
|
-
var
|
|
6048
|
+
var React16 = __toESM(require("react"), 1);
|
|
6049
|
+
var import_toggle_group = require("@base-ui-components/react/toggle-group");
|
|
6050
|
+
var import_toggle = require("@base-ui-components/react/toggle");
|
|
5829
6051
|
var import_class_variance_authority11 = require("class-variance-authority");
|
|
5830
|
-
var
|
|
6052
|
+
var import_jsx_runtime200 = require("react/jsx-runtime");
|
|
5831
6053
|
var controlVariants = (0, import_class_variance_authority11.cva)(
|
|
5832
6054
|
[
|
|
5833
6055
|
"inline-flex min-w-0 items-stretch overflow-hidden rounded-[var(--radius-md)]",
|
|
@@ -5858,7 +6080,11 @@ var segmentVariants = (0, import_class_variance_authority11.cva)(
|
|
|
5858
6080
|
"text-center text-sm font-bold leading-5 transition-colors",
|
|
5859
6081
|
"border-0 border-r border-[var(--wvk-border-bold)] last:border-r-0",
|
|
5860
6082
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
5861
|
-
"[&_svg]:shrink-0 [&_svg]:text-current"
|
|
6083
|
+
"[&_svg]:shrink-0 [&_svg]:text-current",
|
|
6084
|
+
/** Semantic primary / primary-foreground: blue pill + white ink in light; white pill + blue ink in dark. */
|
|
6085
|
+
"data-[pressed]:bg-primary data-[pressed]:text-primary-foreground",
|
|
6086
|
+
"bg-transparent text-[var(--wvk-foreground-primary)] hover:bg-[var(--wvk-surface-tertiary)]",
|
|
6087
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[disabled]:pointer-events-none"
|
|
5862
6088
|
],
|
|
5863
6089
|
{
|
|
5864
6090
|
variants: {
|
|
@@ -5867,11 +6093,6 @@ var segmentVariants = (0, import_class_variance_authority11.cva)(
|
|
|
5867
6093
|
md: "gap-2 px-[var(--wvk-px-md)] py-0 text-sm leading-5",
|
|
5868
6094
|
lg: "gap-2 px-[var(--wvk-px-lg)] py-0 text-sm leading-5"
|
|
5869
6095
|
},
|
|
5870
|
-
active: {
|
|
5871
|
-
/** Semantic primary / primary-foreground: blue pill + white ink in light; white pill + blue ink in dark. */
|
|
5872
|
-
true: "bg-primary text-primary-foreground",
|
|
5873
|
-
false: "bg-transparent text-[var(--wvk-foreground-primary)] hover:bg-[var(--wvk-surface-tertiary)]"
|
|
5874
|
-
},
|
|
5875
6096
|
widthMode: {
|
|
5876
6097
|
fill: "min-w-0 flex-1",
|
|
5877
6098
|
auto: "shrink-0 grow-0"
|
|
@@ -5879,20 +6100,19 @@ var segmentVariants = (0, import_class_variance_authority11.cva)(
|
|
|
5879
6100
|
},
|
|
5880
6101
|
defaultVariants: {
|
|
5881
6102
|
size: "md",
|
|
5882
|
-
active: false,
|
|
5883
6103
|
widthMode: "fill"
|
|
5884
6104
|
}
|
|
5885
6105
|
}
|
|
5886
6106
|
);
|
|
5887
|
-
var SegmentedControlContext =
|
|
6107
|
+
var SegmentedControlContext = React16.createContext(null);
|
|
5888
6108
|
function useSegmentedControlContext(component) {
|
|
5889
|
-
const ctx =
|
|
6109
|
+
const ctx = React16.useContext(SegmentedControlContext);
|
|
5890
6110
|
if (!ctx) {
|
|
5891
6111
|
throw new Error(`${component} must be used within <SegmentedControl>`);
|
|
5892
6112
|
}
|
|
5893
6113
|
return ctx;
|
|
5894
6114
|
}
|
|
5895
|
-
var SegmentedControl =
|
|
6115
|
+
var SegmentedControl = React16.forwardRef(
|
|
5896
6116
|
({
|
|
5897
6117
|
value,
|
|
5898
6118
|
onChange,
|
|
@@ -5909,31 +6129,30 @@ var SegmentedControl = React15.forwardRef(
|
|
|
5909
6129
|
labelInfo,
|
|
5910
6130
|
children
|
|
5911
6131
|
}, ref) => {
|
|
5912
|
-
const labelId =
|
|
6132
|
+
const labelId = React16.useId();
|
|
5913
6133
|
const resolvedSize = size ?? "md";
|
|
5914
6134
|
const widthMode = autoWidth ? "auto" : "fill";
|
|
5915
6135
|
const labelled = fieldLabel && hasRenderableFieldLabelText(label);
|
|
5916
|
-
const notify =
|
|
6136
|
+
const notify = React16.useCallback(
|
|
5917
6137
|
(next) => {
|
|
5918
6138
|
onValueChange?.(next);
|
|
5919
6139
|
onChange?.(next);
|
|
5920
6140
|
},
|
|
5921
6141
|
[onChange, onValueChange]
|
|
5922
6142
|
);
|
|
5923
|
-
const ctx =
|
|
5924
|
-
() => ({
|
|
5925
|
-
|
|
5926
|
-
onValueChange: notify,
|
|
5927
|
-
size: resolvedSize,
|
|
5928
|
-
widthMode
|
|
5929
|
-
}),
|
|
5930
|
-
[value, notify, resolvedSize, widthMode]
|
|
6143
|
+
const ctx = React16.useMemo(
|
|
6144
|
+
() => ({ size: resolvedSize, widthMode }),
|
|
6145
|
+
[resolvedSize, widthMode]
|
|
5931
6146
|
);
|
|
5932
|
-
const
|
|
5933
|
-
|
|
6147
|
+
const group = /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
6148
|
+
import_toggle_group.ToggleGroup,
|
|
5934
6149
|
{
|
|
5935
6150
|
ref,
|
|
5936
|
-
|
|
6151
|
+
value: value ? [value] : [],
|
|
6152
|
+
onValueChange: (next) => {
|
|
6153
|
+
const v = next[0];
|
|
6154
|
+
if (typeof v === "string") notify(v);
|
|
6155
|
+
},
|
|
5937
6156
|
"aria-label": labelled ? void 0 : ariaLabel,
|
|
5938
6157
|
"aria-labelledby": labelled ? labelId : void 0,
|
|
5939
6158
|
className: cn(
|
|
@@ -5942,8 +6161,8 @@ var SegmentedControl = React15.forwardRef(
|
|
|
5942
6161
|
children
|
|
5943
6162
|
}
|
|
5944
6163
|
);
|
|
5945
|
-
return /* @__PURE__ */ (0,
|
|
5946
|
-
/* @__PURE__ */ (0,
|
|
6164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(SegmentedControlContext.Provider, { value: ctx, children: labelled ? /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)("div", { className: "flex w-full min-w-0 flex-col gap-1", children: [
|
|
6165
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
5947
6166
|
FieldLabel,
|
|
5948
6167
|
{
|
|
5949
6168
|
id: labelId,
|
|
@@ -5954,28 +6173,23 @@ var SegmentedControl = React15.forwardRef(
|
|
|
5954
6173
|
children: label
|
|
5955
6174
|
}
|
|
5956
6175
|
),
|
|
5957
|
-
|
|
5958
|
-
] }) :
|
|
6176
|
+
group
|
|
6177
|
+
] }) : group });
|
|
5959
6178
|
}
|
|
5960
6179
|
);
|
|
5961
6180
|
SegmentedControl.displayName = "SegmentedControl";
|
|
5962
|
-
var SegmentedControlItem =
|
|
6181
|
+
var SegmentedControlItem = React16.forwardRef(
|
|
5963
6182
|
({
|
|
5964
|
-
value
|
|
6183
|
+
value,
|
|
5965
6184
|
label,
|
|
5966
6185
|
icon,
|
|
5967
6186
|
iconPlacement = "trailing",
|
|
5968
|
-
disabled,
|
|
5969
6187
|
className,
|
|
5970
|
-
type = "button",
|
|
5971
6188
|
...rest
|
|
5972
6189
|
}, ref) => {
|
|
5973
|
-
const {
|
|
5974
|
-
"SegmentedControlItem"
|
|
5975
|
-
);
|
|
5976
|
-
const isActive = itemValue === value;
|
|
6190
|
+
const { size, widthMode } = useSegmentedControlContext("SegmentedControlItem");
|
|
5977
6191
|
const iconBoxClass2 = size === "sm" ? wvkIconSmClass : wvkIconLgClass;
|
|
5978
|
-
const iconBox = icon ? /* @__PURE__ */ (0,
|
|
6192
|
+
const iconBox = icon ? /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
5979
6193
|
"span",
|
|
5980
6194
|
{
|
|
5981
6195
|
className: cn(
|
|
@@ -5987,30 +6201,19 @@ var SegmentedControlItem = React15.forwardRef(
|
|
|
5987
6201
|
) : null;
|
|
5988
6202
|
const hasLabel = Boolean(label);
|
|
5989
6203
|
const hasIcon = Boolean(icon);
|
|
5990
|
-
const content = hasLabel && hasIcon ? iconPlacement === "leading" ? /* @__PURE__ */ (0,
|
|
6204
|
+
const content = hasLabel && hasIcon ? iconPlacement === "leading" ? /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(import_jsx_runtime200.Fragment, { children: [
|
|
5991
6205
|
iconBox,
|
|
5992
|
-
/* @__PURE__ */ (0,
|
|
5993
|
-
] }) : /* @__PURE__ */ (0,
|
|
5994
|
-
/* @__PURE__ */ (0,
|
|
6206
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)("span", { className: "min-w-0 truncate", children: label })
|
|
6207
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)(import_jsx_runtime200.Fragment, { children: [
|
|
6208
|
+
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)("span", { className: "min-w-0 truncate", children: label }),
|
|
5995
6209
|
iconBox
|
|
5996
|
-
] }) : hasIcon ? iconBox : hasLabel ? /* @__PURE__ */ (0,
|
|
5997
|
-
return /* @__PURE__ */ (0,
|
|
5998
|
-
|
|
6210
|
+
] }) : hasIcon ? iconBox : hasLabel ? /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("span", { className: "min-w-0 truncate", children: label }) : null;
|
|
6211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
6212
|
+
import_toggle.Toggle,
|
|
5999
6213
|
{
|
|
6000
6214
|
ref,
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
"aria-selected": isActive,
|
|
6004
|
-
disabled,
|
|
6005
|
-
"data-active": isActive ? "" : void 0,
|
|
6006
|
-
onClick: () => {
|
|
6007
|
-
if (!disabled) onValueChange(itemValue);
|
|
6008
|
-
},
|
|
6009
|
-
className: cn(
|
|
6010
|
-
segmentVariants({ size, active: isActive, widthMode }),
|
|
6011
|
-
disabled && "cursor-not-allowed opacity-50 pointer-events-none",
|
|
6012
|
-
className
|
|
6013
|
-
),
|
|
6215
|
+
value,
|
|
6216
|
+
className: cn(segmentVariants({ size, widthMode }), className),
|
|
6014
6217
|
...rest,
|
|
6015
6218
|
children: content
|
|
6016
6219
|
}
|
|
@@ -6022,20 +6225,21 @@ var SegmentedControlTrigger = SegmentedControlItem;
|
|
|
6022
6225
|
SegmentedControlTrigger.displayName = "SegmentedControlTrigger";
|
|
6023
6226
|
|
|
6024
6227
|
// src/components/ui/select.tsx
|
|
6025
|
-
var
|
|
6228
|
+
var React17 = __toESM(require("react"), 1);
|
|
6229
|
+
var import_select = require("@base-ui-components/react/select");
|
|
6026
6230
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
6027
|
-
var
|
|
6231
|
+
var import_jsx_runtime201 = require("react/jsx-runtime");
|
|
6028
6232
|
var selectShellVariants = (0, import_class_variance_authority12.cva)(
|
|
6029
6233
|
[
|
|
6030
6234
|
"relative isolate min-h-0 min-w-0 w-full overflow-visible border-0 bg-[var(--input-surface)] text-[var(--input-text)] outline-none transition-[box-shadow,background-color,color]",
|
|
6031
|
-
"focus-
|
|
6032
|
-
"
|
|
6235
|
+
"data-[popup-open]:shadow-[0_0_0_2px_var(--input-focus)] focus-visible:shadow-[0_0_0_2px_var(--input-focus)]",
|
|
6236
|
+
"data-[disabled]:bg-wvk-tertiary data-[disabled]:text-[var(--input-text)]/40 data-[disabled]:cursor-not-allowed"
|
|
6033
6237
|
],
|
|
6034
6238
|
{
|
|
6035
6239
|
variants: {
|
|
6036
6240
|
inputStyle: {
|
|
6037
|
-
border: "shadow-[0_0_0_1px_var(--input-border-rest)]
|
|
6038
|
-
solid: "shadow-none
|
|
6241
|
+
border: "shadow-[0_0_0_1px_var(--input-border-rest)] data-[disabled]:shadow-[0_0_0_1px_var(--input-border-rest)]",
|
|
6242
|
+
solid: "shadow-none data-[disabled]:shadow-none"
|
|
6039
6243
|
},
|
|
6040
6244
|
size: {
|
|
6041
6245
|
sm: "h-8 rounded-[var(--radius-md)]",
|
|
@@ -6049,26 +6253,11 @@ var selectShellVariants = (0, import_class_variance_authority12.cva)(
|
|
|
6049
6253
|
}
|
|
6050
6254
|
}
|
|
6051
6255
|
);
|
|
6052
|
-
var
|
|
6053
|
-
[
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
],
|
|
6058
|
-
{
|
|
6059
|
-
variants: {
|
|
6060
|
-
size: {
|
|
6061
|
-
/* pr: inset + chevron (kit 20px on md/lg, 14px sm) + gap so text never clips the icon */
|
|
6062
|
-
sm: "rounded-[var(--radius-md)] pl-[var(--wvk-px-sm)] pr-[calc(var(--wvk-px-sm)+var(--wvk-icon-sm)+var(--wvk-gap-lg))] text-xs",
|
|
6063
|
-
md: "rounded-[var(--radius-md)] pl-[var(--wvk-px-md)] pr-[calc(var(--wvk-px-md)+var(--wvk-icon-lg)+var(--wvk-gap-lg))] text-sm",
|
|
6064
|
-
lg: "rounded-[var(--radius-md)] pl-[var(--wvk-px-lg)] pr-[calc(var(--wvk-px-lg)+var(--wvk-icon-lg)+var(--wvk-gap-lg))] text-sm"
|
|
6065
|
-
}
|
|
6066
|
-
},
|
|
6067
|
-
defaultVariants: {
|
|
6068
|
-
size: "md"
|
|
6069
|
-
}
|
|
6070
|
-
}
|
|
6071
|
-
);
|
|
6256
|
+
var triggerInsetClass = {
|
|
6257
|
+
sm: "pl-[var(--wvk-px-sm)] pr-[calc(var(--wvk-px-sm)+var(--wvk-icon-sm)+var(--wvk-gap-lg))] text-xs",
|
|
6258
|
+
md: "pl-[var(--wvk-px-md)] pr-[calc(var(--wvk-px-md)+var(--wvk-icon-lg)+var(--wvk-gap-lg))] text-sm",
|
|
6259
|
+
lg: "pl-[var(--wvk-px-lg)] pr-[calc(var(--wvk-px-lg)+var(--wvk-icon-lg)+var(--wvk-gap-lg))] text-sm"
|
|
6260
|
+
};
|
|
6072
6261
|
var chevronInset = {
|
|
6073
6262
|
sm: "right-[var(--wvk-px-sm)]",
|
|
6074
6263
|
md: "right-[var(--wvk-px-md)]",
|
|
@@ -6079,292 +6268,302 @@ var chevronIconClass = {
|
|
|
6079
6268
|
md: "size-[length:var(--wvk-icon-lg)] min-h-0 min-w-0 shrink-0",
|
|
6080
6269
|
lg: "size-[length:var(--wvk-icon-lg)] min-h-0 min-w-0 shrink-0"
|
|
6081
6270
|
};
|
|
6082
|
-
var
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6271
|
+
var SelectContext = React17.createContext({ multiple: false });
|
|
6272
|
+
var Select = React17.forwardRef(
|
|
6273
|
+
(props, ref) => {
|
|
6274
|
+
const {
|
|
6275
|
+
className,
|
|
6276
|
+
inputStyle,
|
|
6277
|
+
size = "md",
|
|
6278
|
+
placeholder,
|
|
6279
|
+
children,
|
|
6280
|
+
disabled,
|
|
6281
|
+
multiple,
|
|
6282
|
+
value,
|
|
6283
|
+
defaultValue,
|
|
6284
|
+
onValueChange,
|
|
6285
|
+
fieldLabel = false,
|
|
6286
|
+
label,
|
|
6287
|
+
labelRequired,
|
|
6288
|
+
labelOptional = false,
|
|
6289
|
+
labelIcon,
|
|
6290
|
+
labelInfo,
|
|
6291
|
+
id: idProp,
|
|
6292
|
+
name,
|
|
6293
|
+
required,
|
|
6294
|
+
open,
|
|
6295
|
+
defaultOpen,
|
|
6296
|
+
onOpenChange,
|
|
6297
|
+
"aria-label": ariaLabel
|
|
6298
|
+
} = props;
|
|
6299
|
+
const generatedId = React17.useId();
|
|
6103
6300
|
const controlId = idProp ?? generatedId;
|
|
6104
6301
|
const s = size ?? "md";
|
|
6105
6302
|
const style = inputStyle ?? "border";
|
|
6106
|
-
const
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
"
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
className
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
]
|
|
6132
|
-
}
|
|
6133
|
-
),
|
|
6134
|
-
/* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
6135
|
-
"div",
|
|
6136
|
-
{
|
|
6137
|
-
className: cn(
|
|
6138
|
-
"pointer-events-none absolute top-1/2 z-[2] flex -translate-y-1/2 items-center justify-center overflow-visible text-[var(--input-icon-muted)]",
|
|
6139
|
-
chevronInset[s]
|
|
6140
|
-
),
|
|
6141
|
-
"aria-hidden": true,
|
|
6142
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
6143
|
-
ChevronUpDown_default,
|
|
6303
|
+
const isMultiple = Boolean(multiple);
|
|
6304
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
6305
|
+
import_select.Select.Trigger,
|
|
6306
|
+
{
|
|
6307
|
+
ref,
|
|
6308
|
+
id: controlId,
|
|
6309
|
+
disabled,
|
|
6310
|
+
"aria-label": ariaLabel,
|
|
6311
|
+
className: cn(
|
|
6312
|
+
selectShellVariants({ inputStyle: style, size: s }),
|
|
6313
|
+
"flex items-center gap-1 text-left",
|
|
6314
|
+
triggerInsetClass[s],
|
|
6315
|
+
className
|
|
6316
|
+
),
|
|
6317
|
+
children: [
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(import_select.Select.Value, { className: "flex-1 min-w-0 truncate", children: (v) => {
|
|
6319
|
+
const empty = v == null || v === "" || Array.isArray(v) && v.length === 0;
|
|
6320
|
+
if (empty) {
|
|
6321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)("span", { className: "text-[var(--input-placeholder)]", children: placeholder });
|
|
6322
|
+
}
|
|
6323
|
+
if (Array.isArray(v)) return v.join(", ");
|
|
6324
|
+
return v;
|
|
6325
|
+
} }),
|
|
6326
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6327
|
+
import_select.Select.Icon,
|
|
6144
6328
|
{
|
|
6145
|
-
className: chevronIconClass[s],
|
|
6146
6329
|
"aria-hidden": true,
|
|
6147
|
-
|
|
6330
|
+
className: cn(
|
|
6331
|
+
"pointer-events-none absolute top-1/2 z-[2] flex -translate-y-1/2 items-center justify-center text-[var(--input-icon-muted)]",
|
|
6332
|
+
chevronInset[s]
|
|
6333
|
+
),
|
|
6334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(ChevronUpDown_default, { className: chevronIconClass[s], "aria-hidden": true })
|
|
6148
6335
|
}
|
|
6149
6336
|
)
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6337
|
+
]
|
|
6338
|
+
}
|
|
6339
|
+
);
|
|
6340
|
+
const popup = /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(import_select.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6341
|
+
import_select.Select.Positioner,
|
|
6342
|
+
{
|
|
6343
|
+
alignItemWithTrigger: false,
|
|
6344
|
+
sideOffset: 6,
|
|
6345
|
+
className: "z-50 outline-none",
|
|
6346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6347
|
+
import_select.Select.Popup,
|
|
6157
6348
|
{
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6349
|
+
className: cn(
|
|
6350
|
+
/* `--available-height` caps to viewport; the explicit `max-h` caps to a
|
|
6351
|
+
reasonable list size so menus with many items scroll. */
|
|
6352
|
+
"min-w-[var(--anchor-width)] max-h-[min(var(--available-height),18rem)] overflow-auto",
|
|
6353
|
+
"rounded-[var(--radius-md)]",
|
|
6354
|
+
"bg-[var(--wvk-surface-primary)] text-[var(--wvk-foreground-primary)]",
|
|
6355
|
+
/* Border sits *outside* the popup via ring (no layout shift) and uses
|
|
6356
|
+
the kit's low-transparency "dark" ramp — blue on light theme,
|
|
6357
|
+
white on dark theme — so the outline reads against either canvas.
|
|
6358
|
+
shadow-lg = elevated drop. */
|
|
6359
|
+
"shadow-lg ring-1 ring-[var(--wvk-transparency-dark-20)]",
|
|
6360
|
+
"p-1 outline-none"
|
|
6361
|
+
),
|
|
6362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(import_select.Select.List, { children })
|
|
6164
6363
|
}
|
|
6165
|
-
)
|
|
6166
|
-
|
|
6167
|
-
|
|
6364
|
+
)
|
|
6365
|
+
}
|
|
6366
|
+
) });
|
|
6367
|
+
const baseProps = {
|
|
6368
|
+
disabled,
|
|
6369
|
+
name,
|
|
6370
|
+
required,
|
|
6371
|
+
open,
|
|
6372
|
+
defaultOpen,
|
|
6373
|
+
onOpenChange: onOpenChange ? (next) => onOpenChange(next) : void 0
|
|
6374
|
+
};
|
|
6375
|
+
const root = isMultiple ? /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
6376
|
+
import_select.Select.Root,
|
|
6377
|
+
{
|
|
6378
|
+
multiple: true,
|
|
6379
|
+
value,
|
|
6380
|
+
defaultValue,
|
|
6381
|
+
onValueChange: (v) => onValueChange?.(
|
|
6382
|
+
v
|
|
6383
|
+
),
|
|
6384
|
+
...baseProps,
|
|
6385
|
+
children: [
|
|
6386
|
+
trigger,
|
|
6387
|
+
popup
|
|
6388
|
+
]
|
|
6389
|
+
}
|
|
6390
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
6391
|
+
import_select.Select.Root,
|
|
6392
|
+
{
|
|
6393
|
+
value,
|
|
6394
|
+
defaultValue,
|
|
6395
|
+
onValueChange: (v) => onValueChange?.(
|
|
6396
|
+
v
|
|
6397
|
+
),
|
|
6398
|
+
...baseProps,
|
|
6399
|
+
children: [
|
|
6400
|
+
trigger,
|
|
6401
|
+
popup
|
|
6402
|
+
]
|
|
6403
|
+
}
|
|
6404
|
+
);
|
|
6405
|
+
const ctx = React17.useMemo(
|
|
6406
|
+
() => ({ multiple: isMultiple }),
|
|
6407
|
+
[isMultiple]
|
|
6408
|
+
);
|
|
6409
|
+
const wrappedRoot = /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(SelectContext.Provider, { value: ctx, children: root });
|
|
6410
|
+
if (fieldLabel && hasRenderableFieldLabelText(label)) {
|
|
6411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)("div", { className: "flex w-full min-w-0 flex-col gap-1", children: [
|
|
6412
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6413
|
+
FieldLabel,
|
|
6414
|
+
{
|
|
6415
|
+
htmlFor: controlId,
|
|
6416
|
+
required: labelRequired,
|
|
6417
|
+
optional: labelOptional,
|
|
6418
|
+
icon: labelIcon,
|
|
6419
|
+
info: labelInfo,
|
|
6420
|
+
children: label
|
|
6421
|
+
}
|
|
6422
|
+
),
|
|
6423
|
+
wrappedRoot
|
|
6424
|
+
] });
|
|
6168
6425
|
}
|
|
6169
|
-
return
|
|
6426
|
+
return wrappedRoot;
|
|
6170
6427
|
}
|
|
6171
6428
|
);
|
|
6172
6429
|
Select.displayName = "Select";
|
|
6430
|
+
function MultiSelectGlyph({ checked }) {
|
|
6431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6432
|
+
"span",
|
|
6433
|
+
{
|
|
6434
|
+
className: cn(
|
|
6435
|
+
"inline-flex size-4 shrink-0 items-center justify-center rounded-[3px] border border-[var(--color-primary)] transition-colors",
|
|
6436
|
+
checked ? "bg-[var(--color-primary)] text-[var(--color-primary-foreground)]" : "bg-transparent text-transparent"
|
|
6437
|
+
),
|
|
6438
|
+
"aria-hidden": true,
|
|
6439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(Checkmark_default, { className: "size-3" })
|
|
6440
|
+
}
|
|
6441
|
+
);
|
|
6442
|
+
}
|
|
6443
|
+
var SelectItem = React17.forwardRef(
|
|
6444
|
+
({ className, children, leadingIcon, trailingIcon, ...rest }, ref) => {
|
|
6445
|
+
const { multiple } = React17.useContext(SelectContext);
|
|
6446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(
|
|
6447
|
+
import_select.Select.Item,
|
|
6448
|
+
{
|
|
6449
|
+
ref,
|
|
6450
|
+
className: cn(
|
|
6451
|
+
"relative flex w-full cursor-pointer select-none items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1.5 text-sm outline-none transition-colors",
|
|
6452
|
+
"text-[var(--wvk-foreground-primary)] data-[selected]:font-bold",
|
|
6453
|
+
"data-[highlighted]:bg-[var(--wvk-surface-tertiary)]",
|
|
6454
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
6455
|
+
className
|
|
6456
|
+
),
|
|
6457
|
+
...rest,
|
|
6458
|
+
children: [
|
|
6459
|
+
multiple ? (
|
|
6460
|
+
/* Multi: checkbox on the LEFT, always rendered so labels align. */
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6462
|
+
import_select.Select.ItemIndicator,
|
|
6463
|
+
{
|
|
6464
|
+
keepMounted: true,
|
|
6465
|
+
render: (props, state) => /* @__PURE__ */ (0, import_jsx_runtime201.jsx)("span", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(MultiSelectGlyph, { checked: state.selected }) }),
|
|
6466
|
+
className: "inline-flex shrink-0 items-center justify-center"
|
|
6467
|
+
}
|
|
6468
|
+
)
|
|
6469
|
+
) : null,
|
|
6470
|
+
leadingIcon ? /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6471
|
+
"span",
|
|
6472
|
+
{
|
|
6473
|
+
className: "inline-flex size-4 shrink-0 items-center justify-center text-current [&_svg]:size-full",
|
|
6474
|
+
"aria-hidden": true,
|
|
6475
|
+
children: leadingIcon
|
|
6476
|
+
}
|
|
6477
|
+
) : null,
|
|
6478
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(import_select.Select.ItemText, { className: "min-w-0 flex-1 truncate", children }),
|
|
6479
|
+
trailingIcon ? /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6480
|
+
"span",
|
|
6481
|
+
{
|
|
6482
|
+
className: "inline-flex size-4 shrink-0 items-center justify-center text-current [&_svg]:size-full",
|
|
6483
|
+
"aria-hidden": true,
|
|
6484
|
+
children: trailingIcon
|
|
6485
|
+
}
|
|
6486
|
+
) : null,
|
|
6487
|
+
!multiple ? (
|
|
6488
|
+
/* Single: tick on the RIGHT, only when selected. */
|
|
6489
|
+
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(import_select.Select.ItemIndicator, { className: "inline-flex size-4 shrink-0 items-center justify-center text-current", children: /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(Checkmark_default, { className: "size-4", "aria-hidden": true }) })
|
|
6490
|
+
) : null
|
|
6491
|
+
]
|
|
6492
|
+
}
|
|
6493
|
+
);
|
|
6494
|
+
}
|
|
6495
|
+
);
|
|
6496
|
+
SelectItem.displayName = "SelectItem";
|
|
6497
|
+
var SelectGroup = import_select.Select.Group;
|
|
6498
|
+
var SelectGroupLabel = React17.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6499
|
+
import_select.Select.GroupLabel,
|
|
6500
|
+
{
|
|
6501
|
+
ref,
|
|
6502
|
+
className: cn(
|
|
6503
|
+
"px-2 py-1 text-xs font-bold uppercase tracking-wide text-[var(--wvk-foreground-tertiary)]",
|
|
6504
|
+
className
|
|
6505
|
+
),
|
|
6506
|
+
...rest
|
|
6507
|
+
}
|
|
6508
|
+
));
|
|
6509
|
+
SelectGroupLabel.displayName = "SelectGroupLabel";
|
|
6510
|
+
var SelectSeparator = React17.forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6511
|
+
"div",
|
|
6512
|
+
{
|
|
6513
|
+
ref,
|
|
6514
|
+
role: "separator",
|
|
6515
|
+
className: cn("my-1 h-px bg-[var(--wvk-border-default)]", className),
|
|
6516
|
+
...rest
|
|
6517
|
+
}
|
|
6518
|
+
));
|
|
6519
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
6173
6520
|
|
|
6174
6521
|
// src/components/ui/slider.tsx
|
|
6175
|
-
var
|
|
6176
|
-
var
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
var Slider = React17.forwardRef(
|
|
6522
|
+
var React18 = __toESM(require("react"), 1);
|
|
6523
|
+
var import_slider = require("@base-ui-components/react/slider");
|
|
6524
|
+
var import_jsx_runtime202 = require("react/jsx-runtime");
|
|
6525
|
+
var thumbClass = "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-4 h-4 rounded-[var(--radius-full)] bg-white border-2 border-primary cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background dark:bg-primary-foreground";
|
|
6526
|
+
var Slider = React18.forwardRef(
|
|
6181
6527
|
({
|
|
6182
6528
|
value,
|
|
6183
6529
|
onChange,
|
|
6184
6530
|
min = 0,
|
|
6185
6531
|
max = 100,
|
|
6532
|
+
step = 1,
|
|
6186
6533
|
disabled = false,
|
|
6187
6534
|
className,
|
|
6188
6535
|
...rest
|
|
6189
6536
|
}, ref) => {
|
|
6190
|
-
const trackRef = React17.useRef(null);
|
|
6191
|
-
const draggingRef = React17.useRef(null);
|
|
6192
6537
|
const isRange = Array.isArray(value);
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
const toPercent = (v) => (v - min) / (max - min) * 100;
|
|
6196
|
-
const valueFromPosition = (clientX) => {
|
|
6197
|
-
const track = trackRef.current;
|
|
6198
|
-
if (!track) return min;
|
|
6199
|
-
const rect = track.getBoundingClientRect();
|
|
6200
|
-
const ratio = clamp((clientX - rect.left) / rect.width, 0, 1);
|
|
6201
|
-
return Math.round(min + ratio * (max - min));
|
|
6202
|
-
};
|
|
6203
|
-
const handlePointerDown = (e, thumb) => {
|
|
6204
|
-
if (disabled) return;
|
|
6205
|
-
e.preventDefault();
|
|
6206
|
-
e.target.setPointerCapture(e.pointerId);
|
|
6207
|
-
draggingRef.current = thumb;
|
|
6208
|
-
};
|
|
6209
|
-
const handlePointerMove = (e) => {
|
|
6210
|
-
if (!draggingRef.current || disabled) return;
|
|
6211
|
-
const next = valueFromPosition(e.clientX);
|
|
6212
|
-
if (draggingRef.current === "single") {
|
|
6213
|
-
onChange?.(next);
|
|
6214
|
-
} else if (draggingRef.current === "start") {
|
|
6215
|
-
onChange?.([clamp(next, min, rangeValue[1]), rangeValue[1]]);
|
|
6216
|
-
} else {
|
|
6217
|
-
onChange?.([rangeValue[0], clamp(next, rangeValue[0], max)]);
|
|
6218
|
-
}
|
|
6219
|
-
};
|
|
6220
|
-
const handlePointerUp = () => {
|
|
6221
|
-
draggingRef.current = null;
|
|
6222
|
-
};
|
|
6223
|
-
const handleKeyDown = (e, thumb) => {
|
|
6224
|
-
if (disabled) return;
|
|
6225
|
-
const step = 1;
|
|
6226
|
-
if (thumb === "single") {
|
|
6227
|
-
if (e.key === "ArrowRight" || e.key === "ArrowUp") {
|
|
6228
|
-
e.preventDefault();
|
|
6229
|
-
onChange?.(clamp(singleValue + step, min, max));
|
|
6230
|
-
} else if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
|
|
6231
|
-
e.preventDefault();
|
|
6232
|
-
onChange?.(clamp(singleValue - step, min, max));
|
|
6233
|
-
} else if (e.key === "Home") {
|
|
6234
|
-
e.preventDefault();
|
|
6235
|
-
onChange?.(min);
|
|
6236
|
-
} else if (e.key === "End") {
|
|
6237
|
-
e.preventDefault();
|
|
6238
|
-
onChange?.(max);
|
|
6239
|
-
}
|
|
6240
|
-
} else if (thumb === "start") {
|
|
6241
|
-
if (e.key === "ArrowRight" || e.key === "ArrowUp") {
|
|
6242
|
-
e.preventDefault();
|
|
6243
|
-
onChange?.([clamp(rangeValue[0] + step, min, rangeValue[1]), rangeValue[1]]);
|
|
6244
|
-
} else if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
|
|
6245
|
-
e.preventDefault();
|
|
6246
|
-
onChange?.([clamp(rangeValue[0] - step, min, rangeValue[1]), rangeValue[1]]);
|
|
6247
|
-
} else if (e.key === "Home") {
|
|
6248
|
-
e.preventDefault();
|
|
6249
|
-
onChange?.([min, rangeValue[1]]);
|
|
6250
|
-
} else if (e.key === "End") {
|
|
6251
|
-
e.preventDefault();
|
|
6252
|
-
onChange?.([rangeValue[1], rangeValue[1]]);
|
|
6253
|
-
}
|
|
6254
|
-
} else {
|
|
6255
|
-
if (e.key === "ArrowRight" || e.key === "ArrowUp") {
|
|
6256
|
-
e.preventDefault();
|
|
6257
|
-
onChange?.([rangeValue[0], clamp(rangeValue[1] + step, rangeValue[0], max)]);
|
|
6258
|
-
} else if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
|
|
6259
|
-
e.preventDefault();
|
|
6260
|
-
onChange?.([rangeValue[0], clamp(rangeValue[1] - step, rangeValue[0], max)]);
|
|
6261
|
-
} else if (e.key === "Home") {
|
|
6262
|
-
e.preventDefault();
|
|
6263
|
-
onChange?.([rangeValue[0], rangeValue[0]]);
|
|
6264
|
-
} else if (e.key === "End") {
|
|
6265
|
-
e.preventDefault();
|
|
6266
|
-
onChange?.([rangeValue[0], max]);
|
|
6267
|
-
}
|
|
6268
|
-
}
|
|
6269
|
-
};
|
|
6270
|
-
const handleTrackClick = (e) => {
|
|
6271
|
-
if (disabled) return;
|
|
6272
|
-
const next = valueFromPosition(e.clientX);
|
|
6273
|
-
if (!isRange) {
|
|
6274
|
-
onChange?.(next);
|
|
6275
|
-
} else {
|
|
6276
|
-
const distStart = Math.abs(next - rangeValue[0]);
|
|
6277
|
-
const distEnd = Math.abs(next - rangeValue[1]);
|
|
6278
|
-
if (distStart <= distEnd) {
|
|
6279
|
-
onChange?.([clamp(next, min, rangeValue[1]), rangeValue[1]]);
|
|
6280
|
-
} else {
|
|
6281
|
-
onChange?.([rangeValue[0], clamp(next, rangeValue[0], max)]);
|
|
6282
|
-
}
|
|
6283
|
-
}
|
|
6284
|
-
};
|
|
6285
|
-
const thumbStyle = "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-4 h-4 rounded-[var(--radius-full)] bg-white border-2 border-primary cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background dark:bg-primary-foreground";
|
|
6286
|
-
return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6287
|
-
"div",
|
|
6538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(
|
|
6539
|
+
import_slider.Slider.Root,
|
|
6288
6540
|
{
|
|
6289
|
-
...rest,
|
|
6290
6541
|
ref,
|
|
6542
|
+
value,
|
|
6543
|
+
onValueChange: (next) => {
|
|
6544
|
+
if (Array.isArray(next)) {
|
|
6545
|
+
onChange?.([next[0], next[1]]);
|
|
6546
|
+
} else {
|
|
6547
|
+
onChange?.(next);
|
|
6548
|
+
}
|
|
6549
|
+
},
|
|
6550
|
+
min,
|
|
6551
|
+
max,
|
|
6552
|
+
step,
|
|
6553
|
+
disabled,
|
|
6291
6554
|
className: cn(
|
|
6292
6555
|
"relative w-full select-none",
|
|
6293
|
-
disabled && "
|
|
6556
|
+
disabled && "opacity-50",
|
|
6294
6557
|
className
|
|
6295
6558
|
),
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
{
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
children: isRange ? /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(import_jsx_runtime201.Fragment, { children: [
|
|
6305
|
-
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6306
|
-
"div",
|
|
6307
|
-
{
|
|
6308
|
-
className: "absolute top-0 h-full rounded-[var(--radius-full)] bg-primary",
|
|
6309
|
-
style: {
|
|
6310
|
-
left: `${toPercent(rangeValue[0])}%`,
|
|
6311
|
-
width: `${toPercent(rangeValue[1]) - toPercent(rangeValue[0])}%`
|
|
6312
|
-
}
|
|
6313
|
-
}
|
|
6314
|
-
),
|
|
6315
|
-
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6316
|
-
"div",
|
|
6317
|
-
{
|
|
6318
|
-
role: "slider",
|
|
6319
|
-
tabIndex: disabled ? -1 : 0,
|
|
6320
|
-
"aria-valuemin": min,
|
|
6321
|
-
"aria-valuemax": max,
|
|
6322
|
-
"aria-valuenow": rangeValue[0],
|
|
6323
|
-
className: thumbStyle,
|
|
6324
|
-
style: { left: `${toPercent(rangeValue[0])}%` },
|
|
6325
|
-
onPointerDown: (e) => handlePointerDown(e, "start"),
|
|
6326
|
-
onKeyDown: (e) => handleKeyDown(e, "start")
|
|
6327
|
-
}
|
|
6328
|
-
),
|
|
6329
|
-
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6330
|
-
"div",
|
|
6331
|
-
{
|
|
6332
|
-
role: "slider",
|
|
6333
|
-
tabIndex: disabled ? -1 : 0,
|
|
6334
|
-
"aria-valuemin": min,
|
|
6335
|
-
"aria-valuemax": max,
|
|
6336
|
-
"aria-valuenow": rangeValue[1],
|
|
6337
|
-
className: thumbStyle,
|
|
6338
|
-
style: { left: `${toPercent(rangeValue[1])}%` },
|
|
6339
|
-
onPointerDown: (e) => handlePointerDown(e, "end"),
|
|
6340
|
-
onKeyDown: (e) => handleKeyDown(e, "end")
|
|
6341
|
-
}
|
|
6342
|
-
)
|
|
6343
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime201.jsxs)(import_jsx_runtime201.Fragment, { children: [
|
|
6344
|
-
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6345
|
-
"div",
|
|
6346
|
-
{
|
|
6347
|
-
className: "absolute top-0 left-0 h-full rounded-[var(--radius-full)] bg-primary",
|
|
6348
|
-
style: { width: `${toPercent(singleValue)}%` }
|
|
6349
|
-
}
|
|
6350
|
-
),
|
|
6351
|
-
/* @__PURE__ */ (0, import_jsx_runtime201.jsx)(
|
|
6352
|
-
"div",
|
|
6353
|
-
{
|
|
6354
|
-
role: "slider",
|
|
6355
|
-
tabIndex: disabled ? -1 : 0,
|
|
6356
|
-
"aria-valuemin": min,
|
|
6357
|
-
"aria-valuemax": max,
|
|
6358
|
-
"aria-valuenow": singleValue,
|
|
6359
|
-
className: thumbStyle,
|
|
6360
|
-
style: { left: `${toPercent(singleValue)}%` },
|
|
6361
|
-
onPointerDown: (e) => handlePointerDown(e, "single"),
|
|
6362
|
-
onKeyDown: (e) => handleKeyDown(e, "single")
|
|
6363
|
-
}
|
|
6364
|
-
)
|
|
6365
|
-
] })
|
|
6366
|
-
}
|
|
6367
|
-
)
|
|
6559
|
+
...rest,
|
|
6560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_slider.Slider.Control, { className: "relative h-2 w-full cursor-pointer rounded-[var(--radius-full)] bg-muted", children: [
|
|
6561
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_slider.Slider.Track, { className: "h-full w-full rounded-[var(--radius-full)]", children: /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_slider.Slider.Indicator, { className: "h-full rounded-[var(--radius-full)] bg-primary" }) }),
|
|
6562
|
+
isRange ? /* @__PURE__ */ (0, import_jsx_runtime202.jsxs)(import_jsx_runtime202.Fragment, { children: [
|
|
6563
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_slider.Slider.Thumb, { index: 0, className: thumbClass }),
|
|
6564
|
+
/* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_slider.Slider.Thumb, { index: 1, className: thumbClass })
|
|
6565
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime202.jsx)(import_slider.Slider.Thumb, { className: thumbClass })
|
|
6566
|
+
] })
|
|
6368
6567
|
}
|
|
6369
6568
|
);
|
|
6370
6569
|
}
|
|
@@ -6372,9 +6571,9 @@ var Slider = React17.forwardRef(
|
|
|
6372
6571
|
Slider.displayName = "Slider";
|
|
6373
6572
|
|
|
6374
6573
|
// src/components/ui/split-button.tsx
|
|
6375
|
-
var
|
|
6574
|
+
var React19 = __toESM(require("react"), 1);
|
|
6376
6575
|
var import_class_variance_authority13 = require("class-variance-authority");
|
|
6377
|
-
var
|
|
6576
|
+
var import_jsx_runtime203 = require("react/jsx-runtime");
|
|
6378
6577
|
var splitButtonVariants = (0, import_class_variance_authority13.cva)(
|
|
6379
6578
|
"inline-flex items-center font-bold whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
|
|
6380
6579
|
{
|
|
@@ -6408,9 +6607,9 @@ var caretPadding = {
|
|
|
6408
6607
|
lg: "px-4"
|
|
6409
6608
|
};
|
|
6410
6609
|
function CaretIcon({ className }) {
|
|
6411
|
-
return /* @__PURE__ */ (0,
|
|
6610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(ChevronDown_default, { className: cn(wvkIconLgClass, className), "aria-hidden": true });
|
|
6412
6611
|
}
|
|
6413
|
-
var SplitButton =
|
|
6612
|
+
var SplitButton = React19.forwardRef(
|
|
6414
6613
|
({
|
|
6415
6614
|
className,
|
|
6416
6615
|
variant,
|
|
@@ -6422,7 +6621,7 @@ var SplitButton = React18.forwardRef(
|
|
|
6422
6621
|
...props
|
|
6423
6622
|
}, ref) => {
|
|
6424
6623
|
const resolvedSize = size ?? "lg";
|
|
6425
|
-
return /* @__PURE__ */ (0,
|
|
6624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(
|
|
6426
6625
|
"div",
|
|
6427
6626
|
{
|
|
6428
6627
|
...wrapperProps,
|
|
@@ -6431,7 +6630,7 @@ var SplitButton = React18.forwardRef(
|
|
|
6431
6630
|
wrapperProps?.className
|
|
6432
6631
|
),
|
|
6433
6632
|
children: [
|
|
6434
|
-
/* @__PURE__ */ (0,
|
|
6633
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
6435
6634
|
"button",
|
|
6436
6635
|
{
|
|
6437
6636
|
ref,
|
|
@@ -6444,14 +6643,14 @@ var SplitButton = React18.forwardRef(
|
|
|
6444
6643
|
children
|
|
6445
6644
|
}
|
|
6446
6645
|
),
|
|
6447
|
-
/* @__PURE__ */ (0,
|
|
6646
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
6448
6647
|
"span",
|
|
6449
6648
|
{
|
|
6450
6649
|
className: "h-8 w-px self-center opacity-20 bg-current",
|
|
6451
6650
|
"aria-hidden": "true"
|
|
6452
6651
|
}
|
|
6453
6652
|
),
|
|
6454
|
-
/* @__PURE__ */ (0,
|
|
6653
|
+
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)(
|
|
6455
6654
|
"button",
|
|
6456
6655
|
{
|
|
6457
6656
|
type: "button",
|
|
@@ -6462,7 +6661,7 @@ var SplitButton = React18.forwardRef(
|
|
|
6462
6661
|
caretPadding[resolvedSize]
|
|
6463
6662
|
),
|
|
6464
6663
|
"aria-label": "Open menu",
|
|
6465
|
-
children: /* @__PURE__ */ (0,
|
|
6664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(CaretIcon, {})
|
|
6466
6665
|
}
|
|
6467
6666
|
)
|
|
6468
6667
|
]
|
|
@@ -6473,17 +6672,17 @@ var SplitButton = React18.forwardRef(
|
|
|
6473
6672
|
SplitButton.displayName = "SplitButton";
|
|
6474
6673
|
|
|
6475
6674
|
// src/components/ui/star-rating.tsx
|
|
6476
|
-
var
|
|
6477
|
-
var
|
|
6675
|
+
var React20 = __toESM(require("react"), 1);
|
|
6676
|
+
var import_jsx_runtime204 = require("react/jsx-runtime");
|
|
6478
6677
|
function StarIcon({ filled }) {
|
|
6479
6678
|
if (filled) {
|
|
6480
|
-
return /* @__PURE__ */ (0,
|
|
6679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(StarActive_default, { className: wvkIconLgClass, "aria-hidden": true });
|
|
6481
6680
|
}
|
|
6482
|
-
return /* @__PURE__ */ (0,
|
|
6681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(Star_default, { className: wvkIconLgClass, "aria-hidden": true });
|
|
6483
6682
|
}
|
|
6484
|
-
var StarRating =
|
|
6683
|
+
var StarRating = React20.forwardRef(
|
|
6485
6684
|
({ value = 0, onChange, readonly = false, className }, ref) => {
|
|
6486
|
-
const buttonRefs =
|
|
6685
|
+
const buttonRefs = React20.useRef([]);
|
|
6487
6686
|
const handleKeyDown = (e, starValue) => {
|
|
6488
6687
|
if (readonly) return;
|
|
6489
6688
|
if (e.key === "ArrowRight" || e.key === "ArrowUp") {
|
|
@@ -6498,7 +6697,7 @@ var StarRating = React19.forwardRef(
|
|
|
6498
6697
|
buttonRefs.current[next - 1]?.focus();
|
|
6499
6698
|
}
|
|
6500
6699
|
};
|
|
6501
|
-
return /* @__PURE__ */ (0,
|
|
6700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
6502
6701
|
"div",
|
|
6503
6702
|
{
|
|
6504
6703
|
ref,
|
|
@@ -6508,7 +6707,7 @@ var StarRating = React19.forwardRef(
|
|
|
6508
6707
|
children: Array.from({ length: 5 }, (_, i) => {
|
|
6509
6708
|
const starValue = i + 1;
|
|
6510
6709
|
const filled = starValue <= value;
|
|
6511
|
-
return /* @__PURE__ */ (0,
|
|
6710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
6512
6711
|
"button",
|
|
6513
6712
|
{
|
|
6514
6713
|
ref: (el) => {
|
|
@@ -6526,7 +6725,7 @@ var StarRating = React19.forwardRef(
|
|
|
6526
6725
|
readonly ? "cursor-default" : "cursor-pointer hover:scale-110 transition-transform",
|
|
6527
6726
|
filled ? "text-primary" : "text-muted-foreground"
|
|
6528
6727
|
),
|
|
6529
|
-
children: /* @__PURE__ */ (0,
|
|
6728
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(StarIcon, { filled })
|
|
6530
6729
|
},
|
|
6531
6730
|
starValue
|
|
6532
6731
|
);
|
|
@@ -6538,11 +6737,12 @@ var StarRating = React19.forwardRef(
|
|
|
6538
6737
|
StarRating.displayName = "StarRating";
|
|
6539
6738
|
|
|
6540
6739
|
// src/components/ui/tabs.tsx
|
|
6541
|
-
var
|
|
6740
|
+
var React21 = __toESM(require("react"), 1);
|
|
6741
|
+
var import_tabs = require("@base-ui-components/react/tabs");
|
|
6542
6742
|
var import_class_variance_authority14 = require("class-variance-authority");
|
|
6543
|
-
var
|
|
6743
|
+
var import_jsx_runtime205 = require("react/jsx-runtime");
|
|
6544
6744
|
var tabListVariants = (0, import_class_variance_authority14.cva)(
|
|
6545
|
-
"inline-flex w-full items-stretch border-b border-[var(--wvk-
|
|
6745
|
+
"inline-flex w-full items-stretch border-b border-[var(--wvk-transparency-dark-20)]",
|
|
6546
6746
|
{
|
|
6547
6747
|
variants: {
|
|
6548
6748
|
size: {
|
|
@@ -6556,44 +6756,40 @@ var tabListVariants = (0, import_class_variance_authority14.cva)(
|
|
|
6556
6756
|
}
|
|
6557
6757
|
}
|
|
6558
6758
|
);
|
|
6559
|
-
var
|
|
6560
|
-
var TabListContext = React20.createContext(null);
|
|
6759
|
+
var TabListContext = React21.createContext(null);
|
|
6561
6760
|
function Tabs({
|
|
6562
|
-
value
|
|
6761
|
+
value,
|
|
6563
6762
|
defaultValue = "",
|
|
6564
6763
|
onValueChange,
|
|
6764
|
+
className,
|
|
6565
6765
|
children,
|
|
6566
|
-
|
|
6766
|
+
...rest
|
|
6567
6767
|
}) {
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
const ctx = React20.useMemo(
|
|
6579
|
-
() => ({ value, onValueChange: setValue }),
|
|
6580
|
-
[value, setValue]
|
|
6768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
6769
|
+
import_tabs.Tabs.Root,
|
|
6770
|
+
{
|
|
6771
|
+
value,
|
|
6772
|
+
defaultValue,
|
|
6773
|
+
onValueChange: (next) => onValueChange?.(next),
|
|
6774
|
+
className: cn("w-full", className),
|
|
6775
|
+
...rest,
|
|
6776
|
+
children
|
|
6777
|
+
}
|
|
6581
6778
|
);
|
|
6582
|
-
return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(TabsContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime204.jsx)("div", { className: cn("w-full", className), children }) });
|
|
6583
6779
|
}
|
|
6584
|
-
var TabList =
|
|
6585
|
-
({ children, size, autoWidth = false, className }, ref) => {
|
|
6780
|
+
var TabList = React21.forwardRef(
|
|
6781
|
+
({ children, size, autoWidth = false, className, ...rest }, ref) => {
|
|
6586
6782
|
const resolvedSize = size ?? "md";
|
|
6587
|
-
const listCtx =
|
|
6783
|
+
const listCtx = React21.useMemo(
|
|
6588
6784
|
() => ({ size: resolvedSize, autoWidth }),
|
|
6589
6785
|
[resolvedSize, autoWidth]
|
|
6590
6786
|
);
|
|
6591
|
-
return /* @__PURE__ */ (0,
|
|
6592
|
-
|
|
6787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(TabListContext.Provider, { value: listCtx, children: /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
6788
|
+
import_tabs.Tabs.List,
|
|
6593
6789
|
{
|
|
6594
6790
|
ref,
|
|
6595
|
-
role: "tablist",
|
|
6596
6791
|
className: cn(tabListVariants({ size: resolvedSize }), className),
|
|
6792
|
+
...rest,
|
|
6597
6793
|
children
|
|
6598
6794
|
}
|
|
6599
6795
|
) });
|
|
@@ -6605,68 +6801,58 @@ var tabTextSize = {
|
|
|
6605
6801
|
md: "text-sm",
|
|
6606
6802
|
lg: "text-sm"
|
|
6607
6803
|
};
|
|
6608
|
-
var Tab =
|
|
6804
|
+
var Tab = React21.forwardRef(
|
|
6609
6805
|
({
|
|
6610
6806
|
value: tabValue = "",
|
|
6611
6807
|
label,
|
|
6612
6808
|
icon,
|
|
6613
6809
|
iconPlacement = "trailing",
|
|
6614
|
-
active: activeLegacy,
|
|
6615
6810
|
children,
|
|
6616
|
-
onClick,
|
|
6617
6811
|
className,
|
|
6618
|
-
type = "button",
|
|
6619
6812
|
...rest
|
|
6620
6813
|
}, ref) => {
|
|
6621
|
-
const
|
|
6622
|
-
const listCtx = React20.useContext(TabListContext);
|
|
6814
|
+
const listCtx = React21.useContext(TabListContext);
|
|
6623
6815
|
const size = listCtx?.size ?? "md";
|
|
6624
6816
|
const fillRow = listCtx ? !listCtx.autoWidth : true;
|
|
6625
|
-
const
|
|
6626
|
-
const iconBox = icon ? /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(
|
|
6817
|
+
const iconBox = icon ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
6627
6818
|
"span",
|
|
6628
6819
|
{
|
|
6629
6820
|
className: cn(
|
|
6630
6821
|
wvkIconMdClass,
|
|
6631
|
-
"inline-flex items-center justify-center text-current [&_svg]:size-full"
|
|
6822
|
+
"inline-flex shrink-0 items-center justify-center text-current [&_svg]:size-full"
|
|
6632
6823
|
),
|
|
6633
6824
|
children: icon
|
|
6634
6825
|
}
|
|
6635
6826
|
) : null;
|
|
6636
6827
|
let inner;
|
|
6637
6828
|
if (!icon) {
|
|
6638
|
-
inner = label != null ? /* @__PURE__ */ (0,
|
|
6829
|
+
inner = label != null ? /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("span", { className: "min-w-0 truncate", children: label }) : children;
|
|
6639
6830
|
} else {
|
|
6640
6831
|
const textContent = label ?? children;
|
|
6641
6832
|
const hasText = textContent != null && textContent !== false && !(Array.isArray(textContent) && textContent.length === 0);
|
|
6642
|
-
inner = hasText && icon ? iconPlacement === "leading" ? /* @__PURE__ */ (0,
|
|
6833
|
+
inner = hasText && icon ? iconPlacement === "leading" ? /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(import_jsx_runtime205.Fragment, { children: [
|
|
6643
6834
|
iconBox,
|
|
6644
|
-
/* @__PURE__ */ (0,
|
|
6645
|
-
] }) : /* @__PURE__ */ (0,
|
|
6646
|
-
/* @__PURE__ */ (0,
|
|
6835
|
+
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)("span", { className: "min-w-0 truncate", children: textContent })
|
|
6836
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime205.jsxs)(import_jsx_runtime205.Fragment, { children: [
|
|
6837
|
+
/* @__PURE__ */ (0, import_jsx_runtime205.jsx)("span", { className: "min-w-0 truncate", children: textContent }),
|
|
6647
6838
|
iconBox
|
|
6648
6839
|
] }) : iconBox;
|
|
6649
6840
|
}
|
|
6650
|
-
return /* @__PURE__ */ (0,
|
|
6651
|
-
|
|
6841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)(
|
|
6842
|
+
import_tabs.Tabs.Tab,
|
|
6652
6843
|
{
|
|
6653
6844
|
ref,
|
|
6654
|
-
|
|
6655
|
-
role: "tab",
|
|
6656
|
-
"aria-selected": isActive,
|
|
6845
|
+
value: tabValue,
|
|
6657
6846
|
className: cn(
|
|
6658
|
-
"
|
|
6847
|
+
"flex items-center justify-center gap-2 px-4 -mb-px",
|
|
6659
6848
|
fillRow ? "min-w-0 flex-1" : "shrink-0 grow-0",
|
|
6660
6849
|
"border-0 border-b-2 bg-transparent transition-colors",
|
|
6661
6850
|
tabTextSize[size],
|
|
6662
6851
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
6663
|
-
|
|
6852
|
+
"border-transparent font-normal text-foreground hover:text-foreground/80",
|
|
6853
|
+
"data-[active]:border-[var(--wvk-border-bold)] data-[active]:font-bold data-[active]:text-foreground",
|
|
6664
6854
|
className
|
|
6665
6855
|
),
|
|
6666
|
-
onClick: (e) => {
|
|
6667
|
-
tabsCtx?.onValueChange(tabValue);
|
|
6668
|
-
onClick?.(e);
|
|
6669
|
-
},
|
|
6670
6856
|
...rest,
|
|
6671
6857
|
children: inner
|
|
6672
6858
|
}
|
|
@@ -6674,22 +6860,23 @@ var Tab = React20.forwardRef(
|
|
|
6674
6860
|
}
|
|
6675
6861
|
);
|
|
6676
6862
|
Tab.displayName = "Tab";
|
|
6863
|
+
var TabPanel = import_tabs.Tabs.Panel;
|
|
6864
|
+
var TabIndicator = import_tabs.Tabs.Indicator;
|
|
6677
6865
|
var TabsList = TabList;
|
|
6678
|
-
TabsList.displayName = "TabsList";
|
|
6679
6866
|
var TabsTrigger = Tab;
|
|
6680
|
-
|
|
6867
|
+
var TabsContent = TabPanel;
|
|
6681
6868
|
|
|
6682
6869
|
// src/components/ui/tag.tsx
|
|
6683
|
-
var
|
|
6870
|
+
var React22 = __toESM(require("react"), 1);
|
|
6684
6871
|
var import_class_variance_authority15 = require("class-variance-authority");
|
|
6685
|
-
var
|
|
6872
|
+
var import_jsx_runtime206 = require("react/jsx-runtime");
|
|
6686
6873
|
function TagIconGlyph(props) {
|
|
6687
|
-
return /* @__PURE__ */ (0,
|
|
6874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Tag_default, { ...props });
|
|
6688
6875
|
}
|
|
6689
6876
|
function applyTagIconSizing(node) {
|
|
6690
|
-
if (!
|
|
6877
|
+
if (!React22.isValidElement(node)) return node;
|
|
6691
6878
|
const el = node;
|
|
6692
|
-
return
|
|
6879
|
+
return React22.cloneElement(el, {
|
|
6693
6880
|
className: cn("size-full", el.props.className)
|
|
6694
6881
|
});
|
|
6695
6882
|
}
|
|
@@ -6722,15 +6909,15 @@ function resolveTagLeadingContent(showLeadingIcon, leadingIcon, icon, size) {
|
|
|
6722
6909
|
if (showLeadingIcon === false) return null;
|
|
6723
6910
|
if (showLeadingIcon === true) {
|
|
6724
6911
|
if (leadingIcon != null) {
|
|
6725
|
-
return /* @__PURE__ */ (0,
|
|
6912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(TagLeadingIcon, { name: leadingIcon, className: "size-full", "aria-hidden": true });
|
|
6726
6913
|
}
|
|
6727
6914
|
if (icon != null) return applyTagIconSizing(icon);
|
|
6728
|
-
return /* @__PURE__ */ (0,
|
|
6915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(TagIconGlyph, { className: "size-full", "aria-hidden": true });
|
|
6729
6916
|
}
|
|
6730
6917
|
if (icon != null) return applyTagIconSizing(icon);
|
|
6731
6918
|
return null;
|
|
6732
6919
|
}
|
|
6733
|
-
var Tag2 =
|
|
6920
|
+
var Tag2 = React22.forwardRef(
|
|
6734
6921
|
({
|
|
6735
6922
|
className,
|
|
6736
6923
|
tagStyle,
|
|
@@ -6755,14 +6942,14 @@ var Tag2 = React21.forwardRef(
|
|
|
6755
6942
|
const body = hasLabelProp ? label : children;
|
|
6756
6943
|
const hasBody = body != null && body !== false && !(typeof body === "string" && body.trim() === "");
|
|
6757
6944
|
const clampTitle = labelTooltip ?? (hasLabelProp && typeof label === "string" && label.length > 0 ? label : void 0) ?? (typeof children === "string" && children.trim().length > 0 ? children : void 0);
|
|
6758
|
-
return /* @__PURE__ */ (0,
|
|
6945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(
|
|
6759
6946
|
"span",
|
|
6760
6947
|
{
|
|
6761
6948
|
className: cn(tagVariants({ tagStyle, size, className })),
|
|
6762
6949
|
ref,
|
|
6763
6950
|
...props,
|
|
6764
6951
|
children: [
|
|
6765
|
-
leading != null ? /* @__PURE__ */ (0,
|
|
6952
|
+
leading != null ? /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
6766
6953
|
"span",
|
|
6767
6954
|
{
|
|
6768
6955
|
className: cn(tagIconBoxClass[resolvedSize]),
|
|
@@ -6770,7 +6957,7 @@ var Tag2 = React21.forwardRef(
|
|
|
6770
6957
|
children: leading
|
|
6771
6958
|
}
|
|
6772
6959
|
) : null,
|
|
6773
|
-
hasBody ? /* @__PURE__ */ (0,
|
|
6960
|
+
hasBody ? /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
6774
6961
|
"span",
|
|
6775
6962
|
{
|
|
6776
6963
|
className: "min-h-0 min-w-0 flex-1 line-clamp-3 break-words text-left whitespace-normal [overflow-wrap:anywhere]",
|
|
@@ -6778,7 +6965,7 @@ var Tag2 = React21.forwardRef(
|
|
|
6778
6965
|
children: body
|
|
6779
6966
|
}
|
|
6780
6967
|
) : null,
|
|
6781
|
-
onClose ? /* @__PURE__ */ (0,
|
|
6968
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(
|
|
6782
6969
|
"button",
|
|
6783
6970
|
{
|
|
6784
6971
|
type: "button",
|
|
@@ -6788,7 +6975,7 @@ var Tag2 = React21.forwardRef(
|
|
|
6788
6975
|
tagIconBoxClass[resolvedSize]
|
|
6789
6976
|
),
|
|
6790
6977
|
"aria-label": "Remove",
|
|
6791
|
-
children: /* @__PURE__ */ (0,
|
|
6978
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Close_default, { className: "size-full", "aria-hidden": true })
|
|
6792
6979
|
}
|
|
6793
6980
|
) : null
|
|
6794
6981
|
]
|
|
@@ -6799,9 +6986,10 @@ var Tag2 = React21.forwardRef(
|
|
|
6799
6986
|
Tag2.displayName = "Tag";
|
|
6800
6987
|
|
|
6801
6988
|
// src/components/ui/text-area.tsx
|
|
6802
|
-
var
|
|
6989
|
+
var React23 = __toESM(require("react"), 1);
|
|
6990
|
+
var import_field = require("@base-ui-components/react/field");
|
|
6803
6991
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
6804
|
-
var
|
|
6992
|
+
var import_jsx_runtime207 = require("react/jsx-runtime");
|
|
6805
6993
|
var textAreaShellVariants = (0, import_class_variance_authority16.cva)(
|
|
6806
6994
|
[
|
|
6807
6995
|
"relative flex w-full min-w-0 flex-col border-0 bg-[var(--input-surface)] text-[var(--input-text)] outline-none transition-[box-shadow,background-color,color]",
|
|
@@ -6861,7 +7049,7 @@ function mergeRefs(...refs) {
|
|
|
6861
7049
|
}
|
|
6862
7050
|
};
|
|
6863
7051
|
}
|
|
6864
|
-
var TextArea =
|
|
7052
|
+
var TextArea = React23.forwardRef(
|
|
6865
7053
|
({
|
|
6866
7054
|
className,
|
|
6867
7055
|
inputStyle,
|
|
@@ -6877,16 +7065,17 @@ var TextArea = React22.forwardRef(
|
|
|
6877
7065
|
id: idProp,
|
|
6878
7066
|
...props
|
|
6879
7067
|
}, ref) => {
|
|
6880
|
-
const innerRef =
|
|
7068
|
+
const innerRef = React23.useRef(null);
|
|
6881
7069
|
const setRefs = mergeRefs(ref, innerRef);
|
|
6882
|
-
const generatedId =
|
|
7070
|
+
const generatedId = React23.useId();
|
|
6883
7071
|
const controlId = idProp ?? generatedId;
|
|
6884
7072
|
const s = size ?? "md";
|
|
6885
7073
|
const minH = MIN_HEIGHT_PX[s];
|
|
6886
|
-
const [heightPx, setHeightPx] =
|
|
6887
|
-
const dragRef =
|
|
7074
|
+
const [heightPx, setHeightPx] = React23.useState(null);
|
|
7075
|
+
const dragRef = React23.useRef(
|
|
6888
7076
|
null
|
|
6889
7077
|
);
|
|
7078
|
+
const [isDragging, setIsDragging] = React23.useState(false);
|
|
6890
7079
|
const onResizePointerDown = (e) => {
|
|
6891
7080
|
if (disabled) return;
|
|
6892
7081
|
e.preventDefault();
|
|
@@ -6898,6 +7087,7 @@ var TextArea = React22.forwardRef(
|
|
|
6898
7087
|
startY: e.clientY,
|
|
6899
7088
|
startH: ta.getBoundingClientRect().height
|
|
6900
7089
|
};
|
|
7090
|
+
setIsDragging(true);
|
|
6901
7091
|
};
|
|
6902
7092
|
const onResizePointerMove = (e) => {
|
|
6903
7093
|
const drag = dragRef.current;
|
|
@@ -6912,10 +7102,11 @@ var TextArea = React22.forwardRef(
|
|
|
6912
7102
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
6913
7103
|
}
|
|
6914
7104
|
dragRef.current = null;
|
|
7105
|
+
setIsDragging(false);
|
|
6915
7106
|
};
|
|
6916
|
-
const shell = /* @__PURE__ */ (0,
|
|
6917
|
-
/* @__PURE__ */ (0,
|
|
6918
|
-
|
|
7107
|
+
const shell = /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { "data-wvk-input": "shell", style: { cursor: disabled ? "not-allowed" : "var(--wvk-cursor-text)" }, className: cn(textAreaShellVariants({ inputStyle, size }), className), children: [
|
|
7108
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
7109
|
+
import_field.Field.Control,
|
|
6919
7110
|
{
|
|
6920
7111
|
ref: setRefs,
|
|
6921
7112
|
id: controlId,
|
|
@@ -6925,20 +7116,24 @@ var TextArea = React22.forwardRef(
|
|
|
6925
7116
|
...style,
|
|
6926
7117
|
...heightPx != null ? { height: `${heightPx}px` } : void 0
|
|
6927
7118
|
},
|
|
7119
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)("textarea", {}),
|
|
6928
7120
|
...props
|
|
6929
7121
|
}
|
|
6930
7122
|
),
|
|
6931
|
-
!disabled && /* @__PURE__ */ (0,
|
|
7123
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
6932
7124
|
"button",
|
|
6933
7125
|
{
|
|
6934
7126
|
type: "button",
|
|
6935
|
-
className:
|
|
7127
|
+
className: cn(
|
|
7128
|
+
"absolute bottom-0 right-0 z-10 flex h-8 w-8 touch-none items-center justify-center border-0 bg-transparent p-0 select-none outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
7129
|
+
isDragging ? "cursor-grabbing" : "cursor-ns-resize"
|
|
7130
|
+
),
|
|
6936
7131
|
onPointerDown: onResizePointerDown,
|
|
6937
7132
|
onPointerMove: onResizePointerMove,
|
|
6938
7133
|
onPointerUp: onResizePointerUp,
|
|
6939
7134
|
onPointerCancel: onResizePointerUp,
|
|
6940
7135
|
"aria-label": "Drag to resize height",
|
|
6941
|
-
children: /* @__PURE__ */ (0,
|
|
7136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
6942
7137
|
Expand_default,
|
|
6943
7138
|
{
|
|
6944
7139
|
className: cn(
|
|
@@ -6952,8 +7147,8 @@ var TextArea = React22.forwardRef(
|
|
|
6952
7147
|
)
|
|
6953
7148
|
] });
|
|
6954
7149
|
if (fieldLabel && hasRenderableFieldLabelText(label)) {
|
|
6955
|
-
return /* @__PURE__ */ (0,
|
|
6956
|
-
/* @__PURE__ */ (0,
|
|
7150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime207.jsxs)("div", { className: "flex w-full min-w-0 flex-col gap-1", children: [
|
|
7151
|
+
/* @__PURE__ */ (0, import_jsx_runtime207.jsx)(
|
|
6957
7152
|
FieldLabel,
|
|
6958
7153
|
{
|
|
6959
7154
|
htmlFor: controlId,
|
|
@@ -6973,9 +7168,10 @@ var TextArea = React22.forwardRef(
|
|
|
6973
7168
|
TextArea.displayName = "TextArea";
|
|
6974
7169
|
|
|
6975
7170
|
// src/components/ui/text-input.tsx
|
|
6976
|
-
var
|
|
7171
|
+
var React24 = __toESM(require("react"), 1);
|
|
7172
|
+
var import_input = require("@base-ui-components/react/input");
|
|
6977
7173
|
var import_class_variance_authority17 = require("class-variance-authority");
|
|
6978
|
-
var
|
|
7174
|
+
var import_jsx_runtime208 = require("react/jsx-runtime");
|
|
6979
7175
|
var textInputShellVariants = (0, import_class_variance_authority17.cva)(
|
|
6980
7176
|
[
|
|
6981
7177
|
"flex min-w-0 w-full items-center border-0 bg-[var(--input-surface)] text-[var(--input-text)] outline-none transition-[box-shadow,background-color,color]",
|
|
@@ -7035,15 +7231,15 @@ function mergeRefs2(...refs) {
|
|
|
7035
7231
|
};
|
|
7036
7232
|
}
|
|
7037
7233
|
function ClearGlyph() {
|
|
7038
|
-
return /* @__PURE__ */ (0,
|
|
7234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(Close_default, { "aria-hidden": true, className: "size-full" });
|
|
7039
7235
|
}
|
|
7040
7236
|
function TextInputSearchIcon(props) {
|
|
7041
|
-
return /* @__PURE__ */ (0,
|
|
7237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(MagnifyingGlass_default, { "aria-hidden": true, className: "size-full", ...props });
|
|
7042
7238
|
}
|
|
7043
7239
|
function TextInputCalendarIcon(props) {
|
|
7044
|
-
return /* @__PURE__ */ (0,
|
|
7240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(Calendar_default, { "aria-hidden": true, className: "size-full", ...props });
|
|
7045
7241
|
}
|
|
7046
|
-
var TextInput =
|
|
7242
|
+
var TextInput = React24.forwardRef(
|
|
7047
7243
|
({
|
|
7048
7244
|
className,
|
|
7049
7245
|
inputStyle,
|
|
@@ -7066,11 +7262,11 @@ var TextInput = React23.forwardRef(
|
|
|
7066
7262
|
id: idProp,
|
|
7067
7263
|
...props
|
|
7068
7264
|
}, ref) => {
|
|
7069
|
-
const innerRef =
|
|
7070
|
-
const generatedId =
|
|
7265
|
+
const innerRef = React24.useRef(null);
|
|
7266
|
+
const generatedId = React24.useId();
|
|
7071
7267
|
const inputId = idProp ?? generatedId;
|
|
7072
7268
|
const controlled = value !== void 0;
|
|
7073
|
-
const [internalValue, setInternalValue] =
|
|
7269
|
+
const [internalValue, setInternalValue] = React24.useState(
|
|
7074
7270
|
() => defaultValue?.toString() ?? ""
|
|
7075
7271
|
);
|
|
7076
7272
|
const displayLength = controlled ? String(value ?? "").length : internalValue.length;
|
|
@@ -7092,7 +7288,7 @@ var TextInput = React23.forwardRef(
|
|
|
7092
7288
|
onChange?.(e);
|
|
7093
7289
|
};
|
|
7094
7290
|
const setRefs = mergeRefs2(ref, innerRef);
|
|
7095
|
-
const clearBtn = reserveClear ? /* @__PURE__ */ (0,
|
|
7291
|
+
const clearBtn = reserveClear ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
7096
7292
|
"button",
|
|
7097
7293
|
{
|
|
7098
7294
|
type: "button",
|
|
@@ -7105,16 +7301,18 @@ var TextInput = React23.forwardRef(
|
|
|
7105
7301
|
showClear ? "hover:text-[var(--input-text)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--input-surface)]" : "pointer-events-none opacity-0"
|
|
7106
7302
|
),
|
|
7107
7303
|
"aria-label": "Clear input",
|
|
7108
|
-
children: /* @__PURE__ */ (0,
|
|
7304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(ClearGlyph, {})
|
|
7109
7305
|
}
|
|
7110
7306
|
) : null;
|
|
7111
7307
|
const hasAction = action != null && action !== false;
|
|
7112
|
-
const shell = /* @__PURE__ */ (0,
|
|
7308
|
+
const shell = /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(
|
|
7113
7309
|
"div",
|
|
7114
7310
|
{
|
|
7311
|
+
"data-wvk-input": "shell",
|
|
7312
|
+
style: { cursor: disabled ? "not-allowed" : "var(--wvk-cursor-text)" },
|
|
7115
7313
|
className: cn(textInputShellVariants({ inputStyle, size }), className),
|
|
7116
7314
|
children: [
|
|
7117
|
-
leadingIcon ? /* @__PURE__ */ (0,
|
|
7315
|
+
leadingIcon ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
7118
7316
|
"span",
|
|
7119
7317
|
{
|
|
7120
7318
|
className: cn(iconBoxClass[s], "text-[var(--input-icon-muted)]"),
|
|
@@ -7122,8 +7320,8 @@ var TextInput = React23.forwardRef(
|
|
|
7122
7320
|
children: leadingIcon
|
|
7123
7321
|
}
|
|
7124
7322
|
) : null,
|
|
7125
|
-
/* @__PURE__ */ (0,
|
|
7126
|
-
|
|
7323
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
7324
|
+
import_input.Input,
|
|
7127
7325
|
{
|
|
7128
7326
|
ref: setRefs,
|
|
7129
7327
|
id: inputId,
|
|
@@ -7134,9 +7332,9 @@ var TextInput = React23.forwardRef(
|
|
|
7134
7332
|
...props
|
|
7135
7333
|
}
|
|
7136
7334
|
),
|
|
7137
|
-
/* @__PURE__ */ (0,
|
|
7335
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsxs)("div", { className: "flex min-w-0 shrink-0 items-center gap-2", children: [
|
|
7138
7336
|
clearBtn,
|
|
7139
|
-
trailingIcon ? /* @__PURE__ */ (0,
|
|
7337
|
+
trailingIcon ? /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
7140
7338
|
"span",
|
|
7141
7339
|
{
|
|
7142
7340
|
className: cn(
|
|
@@ -7147,23 +7345,23 @@ var TextInput = React23.forwardRef(
|
|
|
7147
7345
|
children: trailingIcon
|
|
7148
7346
|
}
|
|
7149
7347
|
) : null,
|
|
7150
|
-
hasAction ? /* @__PURE__ */ (0,
|
|
7151
|
-
/* @__PURE__ */ (0,
|
|
7348
|
+
hasAction ? /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)(import_jsx_runtime208.Fragment, { children: [
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
7152
7350
|
"span",
|
|
7153
7351
|
{
|
|
7154
7352
|
className: "h-6 w-px shrink-0 rounded-full bg-[var(--input-border-rest)]",
|
|
7155
7353
|
"aria-hidden": true
|
|
7156
7354
|
}
|
|
7157
7355
|
),
|
|
7158
|
-
/* @__PURE__ */ (0,
|
|
7356
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)("div", { className: "min-w-0 text-sm font-bold uppercase leading-5 text-[var(--input-text)] [&_a]:border-0 [&_a]:text-sm [&_a]:font-bold [&_a]:uppercase [&_a]:leading-5 [&_a]:text-[var(--input-text)]", children: action })
|
|
7159
7357
|
] }) : null
|
|
7160
7358
|
] })
|
|
7161
7359
|
]
|
|
7162
7360
|
}
|
|
7163
7361
|
);
|
|
7164
7362
|
if (fieldLabel && hasRenderableFieldLabelText(label)) {
|
|
7165
|
-
return /* @__PURE__ */ (0,
|
|
7166
|
-
/* @__PURE__ */ (0,
|
|
7363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)("div", { className: "flex w-full min-w-0 flex-col gap-1", children: [
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime208.jsx)(
|
|
7167
7365
|
FieldLabel,
|
|
7168
7366
|
{
|
|
7169
7367
|
htmlFor: inputId,
|
|
@@ -7183,15 +7381,19 @@ var TextInput = React23.forwardRef(
|
|
|
7183
7381
|
TextInput.displayName = "TextInput";
|
|
7184
7382
|
|
|
7185
7383
|
// src/components/ui/toggle-switch.tsx
|
|
7186
|
-
var
|
|
7384
|
+
var React25 = __toESM(require("react"), 1);
|
|
7385
|
+
var import_switch = require("@base-ui-components/react/switch");
|
|
7386
|
+
var import_framer_motion5 = require("framer-motion");
|
|
7187
7387
|
var import_class_variance_authority18 = require("class-variance-authority");
|
|
7188
|
-
var
|
|
7388
|
+
var import_jsx_runtime209 = require("react/jsx-runtime");
|
|
7189
7389
|
var toggleSwitchVariants = (0, import_class_variance_authority18.cva)(
|
|
7190
7390
|
[
|
|
7191
|
-
"relative inline-flex shrink-0 cursor-pointer border transition-colors",
|
|
7391
|
+
"relative inline-flex shrink-0 cursor-pointer border transition-colors overflow-hidden",
|
|
7192
7392
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
7193
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
7194
|
-
"rounded-full"
|
|
7393
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50 disabled:pointer-events-none disabled:opacity-50",
|
|
7394
|
+
"rounded-full",
|
|
7395
|
+
"data-[checked]:bg-primary data-[checked]:border-primary",
|
|
7396
|
+
"data-[unchecked]:bg-transparent data-[unchecked]:border-primary"
|
|
7195
7397
|
],
|
|
7196
7398
|
{
|
|
7197
7399
|
variants: {
|
|
@@ -7202,15 +7404,10 @@ var toggleSwitchVariants = (0, import_class_variance_authority18.cva)(
|
|
|
7202
7404
|
md: "h-7 w-12 [--toggle-pad:3px] [--thumb-size:20px]",
|
|
7203
7405
|
/** ~32×56px — pairs with Checkbox/Radio `lg`. */
|
|
7204
7406
|
lg: "h-8 w-14 [--toggle-pad:2px] [--thumb-size:26px]"
|
|
7205
|
-
},
|
|
7206
|
-
checked: {
|
|
7207
|
-
true: "bg-primary border-primary",
|
|
7208
|
-
false: "bg-transparent border-primary"
|
|
7209
7407
|
}
|
|
7210
7408
|
},
|
|
7211
7409
|
defaultVariants: {
|
|
7212
|
-
size: "lg"
|
|
7213
|
-
checked: false
|
|
7410
|
+
size: "lg"
|
|
7214
7411
|
}
|
|
7215
7412
|
}
|
|
7216
7413
|
);
|
|
@@ -7218,49 +7415,82 @@ var toggleThumbVariants = (0, import_class_variance_authority18.cva)(
|
|
|
7218
7415
|
[
|
|
7219
7416
|
"pointer-events-none absolute top-1/2 -translate-y-1/2 rounded-full",
|
|
7220
7417
|
"h-[length:var(--thumb-size)] w-[length:var(--thumb-size)]",
|
|
7221
|
-
"transition-[left] duration-200 ease-in-out"
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
}
|
|
7233
|
-
}
|
|
7234
|
-
);
|
|
7235
|
-
var ToggleSwitch = React24.forwardRef(
|
|
7418
|
+
"transition-[left] duration-200 ease-in-out",
|
|
7419
|
+
"data-[checked]:left-[calc(100%_-_var(--toggle-pad)_-_var(--thumb-size))] data-[checked]:bg-white dark:data-[checked]:bg-primary-foreground",
|
|
7420
|
+
"data-[unchecked]:left-[var(--toggle-pad)] data-[unchecked]:bg-primary"
|
|
7421
|
+
]
|
|
7422
|
+
);
|
|
7423
|
+
var THUMB_CONFIG = {
|
|
7424
|
+
sm: { size: 16, pad: 3, leftOn: 23 },
|
|
7425
|
+
md: { size: 20, pad: 3, leftOn: 23 },
|
|
7426
|
+
lg: { size: 26, pad: 2, leftOn: 26 }
|
|
7427
|
+
};
|
|
7428
|
+
var ToggleSwitch = React25.forwardRef(
|
|
7236
7429
|
({
|
|
7237
|
-
checked = false,
|
|
7238
|
-
onCheckedChange,
|
|
7239
|
-
disabled = false,
|
|
7240
7430
|
className,
|
|
7241
7431
|
size = "lg",
|
|
7242
|
-
|
|
7432
|
+
onCheckedChange,
|
|
7243
7433
|
...rest
|
|
7244
7434
|
}, ref) => {
|
|
7245
|
-
const handleClick = (e) => {
|
|
7246
|
-
onClick?.(e);
|
|
7247
|
-
if (!disabled && !e.defaultPrevented) {
|
|
7248
|
-
onCheckedChange?.(!checked);
|
|
7249
|
-
}
|
|
7250
|
-
};
|
|
7251
7435
|
const s = size ?? "lg";
|
|
7252
|
-
|
|
7253
|
-
|
|
7436
|
+
const cfg = THUMB_CONFIG[s];
|
|
7437
|
+
const [isPressed, setIsPressed] = React25.useState(false);
|
|
7438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
7439
|
+
import_switch.Switch.Root,
|
|
7254
7440
|
{
|
|
7255
|
-
...rest,
|
|
7256
7441
|
ref,
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7442
|
+
onCheckedChange: (checked) => onCheckedChange?.(checked),
|
|
7443
|
+
nativeButton: true,
|
|
7444
|
+
className: cn(toggleSwitchVariants({ size: s }), className),
|
|
7445
|
+
...rest,
|
|
7446
|
+
render: (props, state) => /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
7447
|
+
"button",
|
|
7448
|
+
{
|
|
7449
|
+
...props,
|
|
7450
|
+
type: "button",
|
|
7451
|
+
onPointerDown: (e) => {
|
|
7452
|
+
setIsPressed(true);
|
|
7453
|
+
props.onPointerDown?.(e);
|
|
7454
|
+
},
|
|
7455
|
+
onPointerUp: (e) => {
|
|
7456
|
+
setIsPressed(false);
|
|
7457
|
+
props.onPointerUp?.(e);
|
|
7458
|
+
},
|
|
7459
|
+
onPointerLeave: (e) => {
|
|
7460
|
+
setIsPressed(false);
|
|
7461
|
+
props.onPointerLeave?.(e);
|
|
7462
|
+
},
|
|
7463
|
+
onPointerCancel: () => setIsPressed(false),
|
|
7464
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(
|
|
7465
|
+
import_framer_motion5.motion.span,
|
|
7466
|
+
{
|
|
7467
|
+
"aria-hidden": true,
|
|
7468
|
+
className: cn(
|
|
7469
|
+
"pointer-events-none absolute rounded-full",
|
|
7470
|
+
state.checked ? "bg-white dark:bg-primary-foreground" : "bg-primary"
|
|
7471
|
+
),
|
|
7472
|
+
style: {
|
|
7473
|
+
height: cfg.size,
|
|
7474
|
+
top: "50%",
|
|
7475
|
+
marginTop: -(cfg.size / 2),
|
|
7476
|
+
originX: state.checked ? 1 : 0
|
|
7477
|
+
},
|
|
7478
|
+
initial: false,
|
|
7479
|
+
animate: {
|
|
7480
|
+
left: state.checked ? cfg.leftOn : cfg.pad,
|
|
7481
|
+
width: cfg.size,
|
|
7482
|
+
scaleX: isPressed ? 1.28 : 1,
|
|
7483
|
+
scaleY: isPressed ? 0.82 : 1
|
|
7484
|
+
},
|
|
7485
|
+
transition: {
|
|
7486
|
+
left: { type: "spring", stiffness: 420, damping: 30 },
|
|
7487
|
+
scaleX: { type: "spring", stiffness: 700, damping: 22 },
|
|
7488
|
+
scaleY: { type: "spring", stiffness: 700, damping: 22 }
|
|
7489
|
+
}
|
|
7490
|
+
}
|
|
7491
|
+
)
|
|
7492
|
+
}
|
|
7493
|
+
)
|
|
7264
7494
|
}
|
|
7265
7495
|
);
|
|
7266
7496
|
}
|
|
@@ -7268,18 +7498,263 @@ var ToggleSwitch = React24.forwardRef(
|
|
|
7268
7498
|
ToggleSwitch.displayName = "ToggleSwitch";
|
|
7269
7499
|
|
|
7270
7500
|
// src/components/theme-provider.tsx
|
|
7271
|
-
var
|
|
7272
|
-
|
|
7501
|
+
var React27 = __toESM(require("react"), 1);
|
|
7502
|
+
|
|
7503
|
+
// src/components/whimsy-cursor.tsx
|
|
7504
|
+
var React26 = __toESM(require("react"), 1);
|
|
7505
|
+
var import_framer_motion6 = require("framer-motion");
|
|
7506
|
+
var import_jsx_runtime210 = require("react/jsx-runtime");
|
|
7507
|
+
var INTERACTIVE_SELECTOR = [
|
|
7508
|
+
"a[href]",
|
|
7509
|
+
"button:not(:disabled)",
|
|
7510
|
+
'[role="button"]:not([aria-disabled="true"])',
|
|
7511
|
+
'[role="link"]',
|
|
7512
|
+
'[role="tab"]',
|
|
7513
|
+
'[role="menuitem"]',
|
|
7514
|
+
"label[for]",
|
|
7515
|
+
"summary",
|
|
7516
|
+
'input[type="checkbox"]:not(:disabled)',
|
|
7517
|
+
'input[type="radio"]:not(:disabled)',
|
|
7518
|
+
"select:not(:disabled)",
|
|
7519
|
+
".cursor-pointer"
|
|
7520
|
+
].join(",");
|
|
7521
|
+
var ACTIVE_CLASS = "wvk-whimsy-cursor-active";
|
|
7522
|
+
var HIDE_STYLE_ID = "wvk-whimsy-cursor-style";
|
|
7523
|
+
var HIDE_NATIVE_CSS = `
|
|
7524
|
+
html.${ACTIVE_CLASS},
|
|
7525
|
+
html.${ACTIVE_CLASS} *,
|
|
7526
|
+
html.${ACTIVE_CLASS} *::before,
|
|
7527
|
+
html.${ACTIVE_CLASS} *::after {
|
|
7528
|
+
cursor: none !important;
|
|
7529
|
+
}
|
|
7530
|
+
`;
|
|
7531
|
+
function injectStyle(id, css) {
|
|
7532
|
+
if (typeof document === "undefined" || document.getElementById(id)) return;
|
|
7533
|
+
const style = document.createElement("style");
|
|
7534
|
+
style.id = id;
|
|
7535
|
+
style.textContent = css;
|
|
7536
|
+
document.head.appendChild(style);
|
|
7537
|
+
}
|
|
7538
|
+
function WhimsyCursor({
|
|
7539
|
+
hoverRotateDeg = -22
|
|
7540
|
+
} = {}) {
|
|
7541
|
+
const wrapperRef = React26.useRef(null);
|
|
7542
|
+
const [hover, setHover] = React26.useState(false);
|
|
7543
|
+
const [visible, setVisible] = React26.useState(false);
|
|
7544
|
+
const variant = hover ? "pointer" : "default";
|
|
7545
|
+
const hotspot = variant === "pointer" ? { x: 12, y: 8 } : { x: 9, y: 5 };
|
|
7546
|
+
React26.useEffect(() => {
|
|
7547
|
+
if (typeof window === "undefined") return;
|
|
7548
|
+
if (!window.matchMedia("(pointer: fine)").matches) return;
|
|
7549
|
+
injectStyle(HIDE_STYLE_ID, HIDE_NATIVE_CSS);
|
|
7550
|
+
document.documentElement.classList.add(ACTIVE_CLASS);
|
|
7551
|
+
let rafId = null;
|
|
7552
|
+
let nextX = 0;
|
|
7553
|
+
let nextY = 0;
|
|
7554
|
+
let dirty = false;
|
|
7555
|
+
const draw = () => {
|
|
7556
|
+
rafId = null;
|
|
7557
|
+
if (!dirty) return;
|
|
7558
|
+
const el = wrapperRef.current;
|
|
7559
|
+
if (el) {
|
|
7560
|
+
el.style.transform = `translate3d(${nextX}px, ${nextY}px, 0)`;
|
|
7561
|
+
}
|
|
7562
|
+
dirty = false;
|
|
7563
|
+
};
|
|
7564
|
+
const schedule = () => {
|
|
7565
|
+
if (rafId == null) rafId = requestAnimationFrame(draw);
|
|
7566
|
+
};
|
|
7567
|
+
const onMove = (e) => {
|
|
7568
|
+
nextX = e.clientX;
|
|
7569
|
+
nextY = e.clientY;
|
|
7570
|
+
dirty = true;
|
|
7571
|
+
setVisible(true);
|
|
7572
|
+
const target = e.target;
|
|
7573
|
+
const isInteractive = !!target?.closest?.(INTERACTIVE_SELECTOR);
|
|
7574
|
+
setHover((prev) => prev !== isInteractive ? isInteractive : prev);
|
|
7575
|
+
schedule();
|
|
7576
|
+
};
|
|
7577
|
+
const onLeave = () => setVisible(false);
|
|
7578
|
+
const onEnter = () => setVisible(true);
|
|
7579
|
+
window.addEventListener("pointermove", onMove, { passive: true });
|
|
7580
|
+
document.addEventListener("pointerleave", onLeave);
|
|
7581
|
+
document.addEventListener("pointerenter", onEnter);
|
|
7582
|
+
return () => {
|
|
7583
|
+
window.removeEventListener("pointermove", onMove);
|
|
7584
|
+
document.removeEventListener("pointerleave", onLeave);
|
|
7585
|
+
document.removeEventListener("pointerenter", onEnter);
|
|
7586
|
+
if (rafId != null) cancelAnimationFrame(rafId);
|
|
7587
|
+
document.documentElement.classList.remove(ACTIVE_CLASS);
|
|
7588
|
+
};
|
|
7589
|
+
}, []);
|
|
7590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7591
|
+
"div",
|
|
7592
|
+
{
|
|
7593
|
+
ref: wrapperRef,
|
|
7594
|
+
"aria-hidden": true,
|
|
7595
|
+
style: {
|
|
7596
|
+
position: "fixed",
|
|
7597
|
+
top: 0,
|
|
7598
|
+
left: 0,
|
|
7599
|
+
width: 32,
|
|
7600
|
+
height: 32,
|
|
7601
|
+
pointerEvents: "none",
|
|
7602
|
+
zIndex: 2147483647,
|
|
7603
|
+
opacity: visible ? 1 : 0,
|
|
7604
|
+
transition: "opacity 120ms ease",
|
|
7605
|
+
marginLeft: -hotspot.x,
|
|
7606
|
+
marginTop: -hotspot.y,
|
|
7607
|
+
willChange: "transform"
|
|
7608
|
+
},
|
|
7609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7610
|
+
import_framer_motion6.motion.div,
|
|
7611
|
+
{
|
|
7612
|
+
className: "wvk-whimsy-cursor-rotor",
|
|
7613
|
+
"data-hover": hover ? "true" : "false",
|
|
7614
|
+
animate: { rotate: hover ? hoverRotateDeg : 0 },
|
|
7615
|
+
transition: { type: "spring", stiffness: 600, damping: 12, mass: 0.4 },
|
|
7616
|
+
style: {
|
|
7617
|
+
width: 32,
|
|
7618
|
+
height: 32,
|
|
7619
|
+
transformOrigin: `${hotspot.x}px ${hotspot.y}px`
|
|
7620
|
+
},
|
|
7621
|
+
children: variant === "pointer" ? /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(PointerSvg, {}) : /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(DefaultSvg, {})
|
|
7622
|
+
}
|
|
7623
|
+
)
|
|
7624
|
+
}
|
|
7625
|
+
);
|
|
7626
|
+
}
|
|
7627
|
+
function DefaultSvg() {
|
|
7628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
7629
|
+
"svg",
|
|
7630
|
+
{
|
|
7631
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7632
|
+
width: 32,
|
|
7633
|
+
height: 32,
|
|
7634
|
+
fill: "none",
|
|
7635
|
+
viewBox: "0 0 32 32",
|
|
7636
|
+
children: [
|
|
7637
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7638
|
+
"filter",
|
|
7639
|
+
{
|
|
7640
|
+
id: "wvk-whimsy-cursor-default-shadow",
|
|
7641
|
+
filterUnits: "userSpaceOnUse",
|
|
7642
|
+
x: "-4",
|
|
7643
|
+
y: "-4",
|
|
7644
|
+
width: "40",
|
|
7645
|
+
height: "40",
|
|
7646
|
+
colorInterpolationFilters: "sRGB",
|
|
7647
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7648
|
+
"feDropShadow",
|
|
7649
|
+
{
|
|
7650
|
+
dx: "0",
|
|
7651
|
+
dy: "1.25",
|
|
7652
|
+
stdDeviation: "1",
|
|
7653
|
+
floodColor: "#000000",
|
|
7654
|
+
floodOpacity: "0.38"
|
|
7655
|
+
}
|
|
7656
|
+
)
|
|
7657
|
+
}
|
|
7658
|
+
) }),
|
|
7659
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("g", { filter: "url(#wvk-whimsy-cursor-default-shadow)", children: [
|
|
7660
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7661
|
+
"path",
|
|
7662
|
+
{
|
|
7663
|
+
fill: "#0055FF",
|
|
7664
|
+
d: "M10 6.028v14.637a.5.5 0 0 0 .86.348l2.424-2.503a.5.5 0 0 1 .808.127l2.225 4.523a1 1 0 0 0 1.379.435l2.234-1.229a1 1 0 0 0 .41-1.33l-2.192-4.31a.5.5 0 0 1 .446-.726h3.96a.5.5 0 0 0 .31-.893L10.808 5.635a.5.5 0 0 0-.809.393Z"
|
|
7665
|
+
}
|
|
7666
|
+
),
|
|
7667
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7668
|
+
"path",
|
|
7669
|
+
{
|
|
7670
|
+
stroke: "white",
|
|
7671
|
+
strokeOpacity: ".8",
|
|
7672
|
+
strokeWidth: "2",
|
|
7673
|
+
d: "M9.42 4.985a1.502 1.502 0 0 1 1.882-.225l.125.089L23.48 14.32a1.501 1.501 0 0 1-.926 2.68h-3.147l1.823 3.583a2 2 0 0 1-.819 2.66l-2.234 1.229a2 2 0 0 1-2.759-.87l-1.911-3.886-1.93 1.993A1.5 1.5 0 0 1 9 20.665V6.028a1.5 1.5 0 0 1 .32-.926l.1-.117Z"
|
|
7674
|
+
}
|
|
7675
|
+
)
|
|
7676
|
+
] })
|
|
7677
|
+
]
|
|
7678
|
+
}
|
|
7679
|
+
);
|
|
7680
|
+
}
|
|
7681
|
+
function PointerSvg() {
|
|
7682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime210.jsxs)(
|
|
7683
|
+
"svg",
|
|
7684
|
+
{
|
|
7685
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7686
|
+
width: 32,
|
|
7687
|
+
height: 32,
|
|
7688
|
+
fill: "none",
|
|
7689
|
+
viewBox: "0 0 32 32",
|
|
7690
|
+
children: [
|
|
7691
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7692
|
+
"filter",
|
|
7693
|
+
{
|
|
7694
|
+
id: "wvk-whimsy-cursor-pointer-shadow",
|
|
7695
|
+
filterUnits: "userSpaceOnUse",
|
|
7696
|
+
x: "-4",
|
|
7697
|
+
y: "-4",
|
|
7698
|
+
width: "40",
|
|
7699
|
+
height: "40",
|
|
7700
|
+
colorInterpolationFilters: "sRGB",
|
|
7701
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7702
|
+
"feDropShadow",
|
|
7703
|
+
{
|
|
7704
|
+
dx: "0",
|
|
7705
|
+
dy: "1.25",
|
|
7706
|
+
stdDeviation: "1",
|
|
7707
|
+
floodColor: "#000000",
|
|
7708
|
+
floodOpacity: "0.38"
|
|
7709
|
+
}
|
|
7710
|
+
)
|
|
7711
|
+
}
|
|
7712
|
+
) }),
|
|
7713
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsxs)("g", { filter: "url(#wvk-whimsy-cursor-pointer-shadow)", children: [
|
|
7714
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7715
|
+
"path",
|
|
7716
|
+
{
|
|
7717
|
+
fill: "white",
|
|
7718
|
+
d: "M18.5 30H13c-5.44 0-9.083-4.964-11.41-14.272C.659 12.003 3.917 8.913 7 9.65V6a5 5 0 0 1 10 0v2.1a4.99 4.99 0 0 1 2.105.98A5 5 0 0 1 24.001 11a5 5 0 0 1 5 5v4c0 .19-.019.38-.054.565C28.409 25.897 23.907 30 18.5 30Z"
|
|
7719
|
+
}
|
|
7720
|
+
),
|
|
7721
|
+
/* @__PURE__ */ (0, import_jsx_runtime210.jsx)(
|
|
7722
|
+
"path",
|
|
7723
|
+
{
|
|
7724
|
+
fill: "#0055FF",
|
|
7725
|
+
d: "M25 19.5V16a1 1 0 1 0-2 0 1 1 0 1 1-2 0v-2a1 1 0 1 0-2 0 1 1 0 1 1-2 0 3 3 0 0 1 5.895-.79A3 3 0 0 1 27 16v4a1 1 0 0 1-.033.256A8.5 8.5 0 0 1 18.5 28H13c-4.284 0-7.37-4.357-9.47-12.758-.698-2.792 2.321-4.805 4.177-2.95L9 13.587V6a3 3 0 1 1 6 0v7a1 1 0 1 1-2 0V6a1 1 0 1 0-2 0v10a1 1 0 0 1-1.707.707l-3-3c-.344-.344-1.053.129-.823 1.05C7.37 22.358 9.95 26 13 26h5.5a6.5 6.5 0 0 0 6.5-6.5ZM16 10a3 3 0 0 1 3 3v1a1 1 0 1 1-2 0v-1a1 1 0 1 0-2 0 1 1 0 1 1-2 0 3 3 0 0 1 3-3Zm-1 7a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1Zm4 0a1 1 0 0 1 1 1v3a1 1 0 1 1-2 0v-3a1 1 0 0 1 1-1Z"
|
|
7726
|
+
}
|
|
7727
|
+
)
|
|
7728
|
+
] })
|
|
7729
|
+
]
|
|
7730
|
+
}
|
|
7731
|
+
);
|
|
7732
|
+
}
|
|
7733
|
+
|
|
7734
|
+
// src/components/theme-provider.tsx
|
|
7735
|
+
var import_jsx_runtime211 = require("react/jsx-runtime");
|
|
7273
7736
|
var STORAGE_KEY = "wvk-theme";
|
|
7737
|
+
var CURSOR_STYLE_STORAGE_KEY = "wvk-cursor-style";
|
|
7738
|
+
var CURSOR_STYLE_CLASS_ARROW = "wvk-cursor-style-arrow";
|
|
7274
7739
|
var CURSOR_STYLE_ID = "wvk-cursor-style";
|
|
7275
7740
|
var CURSOR_DEFAULT = 'url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSIgdmlld0JveD0iMCAwIDMyIDMyIj4KICA8ZGVmcz4KICAgIDxmaWx0ZXIKICAgICAgaWQ9Ind2ay1jdXJzb3Itc2hhZG93IgogICAgICBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiCiAgICAgIHg9Ii00IgogICAgICB5PSItNCIKICAgICAgd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ICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMiIvPgogICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMTYgMCIvPgogICAgICA8ZmVCbGVuZCBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfNDgxMF82ODUiLz4KICAgICAgPGZlQmxlbmQgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzQ4MTBfNjg1IiByZXN1bHQ9InNoYXBlIi8+CiAgICA8L2ZpbHRlcj4KICA8L2RlZnM+Cjwvc3ZnPgo=") 16 17, text';
|
|
7278
7746
|
var CURSOR_FALLBACK_CSS = `
|
|
7279
7747
|
:root {
|
|
7280
7748
|
--wvk-cursor-default: ${CURSOR_DEFAULT};
|
|
7749
|
+
--wvk-cursor-default-arrow: ${CURSOR_DEFAULT_ARROW};
|
|
7281
7750
|
--wvk-cursor-pointer: ${CURSOR_POINTER};
|
|
7282
7751
|
--wvk-cursor-move: ${CURSOR_MOVE};
|
|
7752
|
+
--wvk-cursor-grabbing: ${CURSOR_GRABBING};
|
|
7753
|
+
--wvk-cursor-text: ${CURSOR_TEXT};
|
|
7754
|
+
}
|
|
7755
|
+
|
|
7756
|
+
html.${CURSOR_STYLE_CLASS_ARROW} {
|
|
7757
|
+
--wvk-cursor-default: var(--wvk-cursor-default-arrow);
|
|
7283
7758
|
}
|
|
7284
7759
|
|
|
7285
7760
|
html {
|
|
@@ -7295,8 +7770,13 @@ input[type="url"],
|
|
|
7295
7770
|
input[type="password"],
|
|
7296
7771
|
input[type="number"],
|
|
7297
7772
|
textarea,
|
|
7298
|
-
[contenteditable="true"]
|
|
7299
|
-
|
|
7773
|
+
[contenteditable="true"],
|
|
7774
|
+
[data-wvk-input="shell"] {
|
|
7775
|
+
cursor: var(--wvk-cursor-text);
|
|
7776
|
+
}
|
|
7777
|
+
|
|
7778
|
+
[data-wvk-input="shell"]:has(:disabled) {
|
|
7779
|
+
cursor: not-allowed;
|
|
7300
7780
|
}
|
|
7301
7781
|
|
|
7302
7782
|
a[href],
|
|
@@ -7318,16 +7798,29 @@ select:not(:disabled),
|
|
|
7318
7798
|
cursor: var(--wvk-cursor-default);
|
|
7319
7799
|
}
|
|
7320
7800
|
|
|
7321
|
-
.cursor-
|
|
7322
|
-
|
|
7801
|
+
.cursor-text {
|
|
7802
|
+
cursor: var(--wvk-cursor-text);
|
|
7803
|
+
}
|
|
7804
|
+
|
|
7323
7805
|
.cursor-grabbing {
|
|
7806
|
+
cursor: var(--wvk-cursor-grabbing);
|
|
7807
|
+
}
|
|
7808
|
+
|
|
7809
|
+
.cursor-move,
|
|
7810
|
+
.cursor-grab {
|
|
7324
7811
|
cursor: var(--wvk-cursor-move);
|
|
7325
7812
|
}
|
|
7326
7813
|
`;
|
|
7327
|
-
var ThemeContext =
|
|
7814
|
+
var ThemeContext = React27.createContext(null);
|
|
7328
7815
|
function applyThemeClass(theme) {
|
|
7329
7816
|
document.documentElement.classList.toggle("dark", theme === "dark");
|
|
7330
7817
|
}
|
|
7818
|
+
function applyCursorStyleClass(style) {
|
|
7819
|
+
document.documentElement.classList.toggle(
|
|
7820
|
+
CURSOR_STYLE_CLASS_ARROW,
|
|
7821
|
+
style === "arrow"
|
|
7822
|
+
);
|
|
7823
|
+
}
|
|
7331
7824
|
function ensureCursorStyleFallback() {
|
|
7332
7825
|
const root = document.documentElement;
|
|
7333
7826
|
const hasPackageCursorCss = getComputedStyle(root).getPropertyValue("--wvk-cursor-default").trim();
|
|
@@ -7339,12 +7832,17 @@ function ensureCursorStyleFallback() {
|
|
|
7339
7832
|
style.textContent = CURSOR_FALLBACK_CSS;
|
|
7340
7833
|
document.head.appendChild(style);
|
|
7341
7834
|
}
|
|
7342
|
-
function ThemeProvider({
|
|
7343
|
-
|
|
7344
|
-
|
|
7835
|
+
function ThemeProvider({
|
|
7836
|
+
children,
|
|
7837
|
+
cursorStyle: cursorStyleProp = "default",
|
|
7838
|
+
whimsyCursor = true
|
|
7839
|
+
}) {
|
|
7840
|
+
const [theme, setThemeState] = React27.useState("light");
|
|
7841
|
+
const [cursorStyle, setCursorStyleState] = React27.useState(cursorStyleProp);
|
|
7842
|
+
React27.useInsertionEffect(() => {
|
|
7345
7843
|
ensureCursorStyleFallback();
|
|
7346
7844
|
}, []);
|
|
7347
|
-
|
|
7845
|
+
React27.useEffect(() => {
|
|
7348
7846
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
7349
7847
|
if (stored === "dark" || stored === "light") {
|
|
7350
7848
|
setThemeState(stored);
|
|
@@ -7352,37 +7850,63 @@ function ThemeProvider({ children }) {
|
|
|
7352
7850
|
setThemeState("dark");
|
|
7353
7851
|
}
|
|
7354
7852
|
}, []);
|
|
7355
|
-
|
|
7853
|
+
React27.useEffect(() => {
|
|
7854
|
+
const stored = localStorage.getItem(CURSOR_STYLE_STORAGE_KEY);
|
|
7855
|
+
if (stored === "default" || stored === "arrow") {
|
|
7856
|
+
setCursorStyleState(stored);
|
|
7857
|
+
} else if (document.documentElement.classList.contains(CURSOR_STYLE_CLASS_ARROW)) {
|
|
7858
|
+
setCursorStyleState("arrow");
|
|
7859
|
+
}
|
|
7860
|
+
}, []);
|
|
7861
|
+
React27.useEffect(() => {
|
|
7356
7862
|
applyThemeClass(theme);
|
|
7357
7863
|
}, [theme]);
|
|
7358
|
-
|
|
7864
|
+
React27.useEffect(() => {
|
|
7865
|
+
applyCursorStyleClass(cursorStyle);
|
|
7866
|
+
}, [cursorStyle]);
|
|
7867
|
+
const setTheme = React27.useCallback((t) => {
|
|
7359
7868
|
setThemeState(t);
|
|
7360
7869
|
localStorage.setItem(STORAGE_KEY, t);
|
|
7361
7870
|
}, []);
|
|
7362
|
-
const
|
|
7363
|
-
()
|
|
7364
|
-
|
|
7871
|
+
const setCursorStyle = React27.useCallback((c) => {
|
|
7872
|
+
setCursorStyleState(c);
|
|
7873
|
+
localStorage.setItem(CURSOR_STYLE_STORAGE_KEY, c);
|
|
7874
|
+
}, []);
|
|
7875
|
+
const value = React27.useMemo(
|
|
7876
|
+
() => ({ theme, setTheme, cursorStyle, setCursorStyle }),
|
|
7877
|
+
[theme, setTheme, cursorStyle, setCursorStyle]
|
|
7365
7878
|
);
|
|
7366
|
-
|
|
7879
|
+
const cursorProps = cursorStyle === "arrow" || whimsyCursor === false ? null : whimsyCursor === true ? {} : whimsyCursor;
|
|
7880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime211.jsxs)(ThemeContext.Provider, { value, children: [
|
|
7881
|
+
cursorProps ? /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(WhimsyCursor, { ...cursorProps }) : null,
|
|
7882
|
+
children
|
|
7883
|
+
] });
|
|
7367
7884
|
}
|
|
7368
7885
|
function useTheme() {
|
|
7369
|
-
const ctx =
|
|
7886
|
+
const ctx = React27.useContext(ThemeContext);
|
|
7370
7887
|
if (!ctx) {
|
|
7371
7888
|
throw new Error("useTheme must be used inside <ThemeProvider>");
|
|
7372
7889
|
}
|
|
7373
7890
|
return ctx;
|
|
7374
7891
|
}
|
|
7892
|
+
function useCursorStyle() {
|
|
7893
|
+
const ctx = React27.useContext(ThemeContext);
|
|
7894
|
+
if (!ctx) {
|
|
7895
|
+
throw new Error("useCursorStyle must be used inside <ThemeProvider>");
|
|
7896
|
+
}
|
|
7897
|
+
return { cursorStyle: ctx.cursorStyle, setCursorStyle: ctx.setCursorStyle };
|
|
7898
|
+
}
|
|
7375
7899
|
|
|
7376
7900
|
// src/components/theme-switcher.tsx
|
|
7377
|
-
var
|
|
7378
|
-
var
|
|
7901
|
+
var React28 = __toESM(require("react"), 1);
|
|
7902
|
+
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
7379
7903
|
function ThemeSwitcher() {
|
|
7380
|
-
const ctx =
|
|
7904
|
+
const ctx = React28.useContext(ThemeContext);
|
|
7381
7905
|
if (!ctx) {
|
|
7382
7906
|
return null;
|
|
7383
7907
|
}
|
|
7384
7908
|
const { theme, setTheme } = ctx;
|
|
7385
|
-
return /* @__PURE__ */ (0,
|
|
7909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)(
|
|
7386
7910
|
SegmentedControl,
|
|
7387
7911
|
{
|
|
7388
7912
|
size: "sm",
|
|
@@ -7391,19 +7915,19 @@ function ThemeSwitcher() {
|
|
|
7391
7915
|
onValueChange: (v) => setTheme(v),
|
|
7392
7916
|
"aria-label": "Color theme",
|
|
7393
7917
|
children: [
|
|
7394
|
-
/* @__PURE__ */ (0,
|
|
7918
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
7395
7919
|
SegmentedControlItem,
|
|
7396
7920
|
{
|
|
7397
7921
|
value: "light",
|
|
7398
|
-
icon: /* @__PURE__ */ (0,
|
|
7922
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(Sun_default, { "aria-hidden": true, className: "size-full" }),
|
|
7399
7923
|
"aria-label": "Light theme"
|
|
7400
7924
|
}
|
|
7401
7925
|
),
|
|
7402
|
-
/* @__PURE__ */ (0,
|
|
7926
|
+
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(
|
|
7403
7927
|
SegmentedControlItem,
|
|
7404
7928
|
{
|
|
7405
7929
|
value: "dark",
|
|
7406
|
-
icon: /* @__PURE__ */ (0,
|
|
7930
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(Moon_default, { "aria-hidden": true, className: "size-full" }),
|
|
7407
7931
|
"aria-label": "Dark theme"
|
|
7408
7932
|
}
|
|
7409
7933
|
)
|
|
@@ -7412,49 +7936,30 @@ function ThemeSwitcher() {
|
|
|
7412
7936
|
);
|
|
7413
7937
|
}
|
|
7414
7938
|
|
|
7415
|
-
// src/lib/
|
|
7416
|
-
var
|
|
7417
|
-
var
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
"search",
|
|
7423
|
-
"user",
|
|
7424
|
-
"settings"
|
|
7425
|
-
];
|
|
7426
|
-
var iconClass = (size) => cn(size === "lg" ? wvkIconLgClass : wvkIconMdClass, "shrink-0");
|
|
7427
|
-
function ButtonDecorativeIconGlyph({
|
|
7428
|
-
name,
|
|
7429
|
-
size,
|
|
7430
|
-
className
|
|
7431
|
-
}) {
|
|
7432
|
-
const c = cn(iconClass(size), className);
|
|
7433
|
-
switch (name) {
|
|
7434
|
-
case "plus":
|
|
7435
|
-
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(Plus_default, { className: c, "aria-hidden": true });
|
|
7436
|
-
case "chevronRight":
|
|
7437
|
-
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(ChevronRight_default, { className: c, "aria-hidden": true });
|
|
7438
|
-
case "home":
|
|
7439
|
-
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(Home_default, { className: c, "aria-hidden": true });
|
|
7440
|
-
case "search":
|
|
7441
|
-
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(MagnifyingGlass_default, { className: c, "aria-hidden": true });
|
|
7442
|
-
case "user":
|
|
7443
|
-
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(User_default, { className: c, "aria-hidden": true });
|
|
7444
|
-
case "settings":
|
|
7445
|
-
return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(Settings_default, { className: c, "aria-hidden": true });
|
|
7446
|
-
default:
|
|
7447
|
-
return null;
|
|
7939
|
+
// src/lib/motion-presets.ts
|
|
7940
|
+
var import_framer_motion7 = require("framer-motion");
|
|
7941
|
+
var staggerContainer = {
|
|
7942
|
+
hidden: { opacity: 0 },
|
|
7943
|
+
show: {
|
|
7944
|
+
opacity: 1,
|
|
7945
|
+
transition: { staggerChildren: 0.05 }
|
|
7448
7946
|
}
|
|
7449
|
-
}
|
|
7947
|
+
};
|
|
7948
|
+
var fadeInUp = {
|
|
7949
|
+
hidden: { opacity: 0, y: 8 },
|
|
7950
|
+
show: {
|
|
7951
|
+
opacity: 1,
|
|
7952
|
+
y: 0,
|
|
7953
|
+
transition: { duration: 0.2, ease: "easeOut" }
|
|
7954
|
+
}
|
|
7955
|
+
};
|
|
7450
7956
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7451
7957
|
0 && (module.exports = {
|
|
7452
7958
|
Alert,
|
|
7453
|
-
|
|
7959
|
+
AnimatePresence,
|
|
7454
7960
|
BottomTabBar,
|
|
7455
7961
|
BottomTabBarItem,
|
|
7456
7962
|
Button,
|
|
7457
|
-
ButtonDecorativeIconGlyph,
|
|
7458
7963
|
Checkbox,
|
|
7459
7964
|
FieldGroup,
|
|
7460
7965
|
FieldLabel,
|
|
@@ -7463,20 +7968,37 @@ function ButtonDecorativeIconGlyph({
|
|
|
7463
7968
|
Link,
|
|
7464
7969
|
ListItem,
|
|
7465
7970
|
LoadingSpinner,
|
|
7971
|
+
Menu,
|
|
7972
|
+
MenuGroup,
|
|
7973
|
+
MenuGroupLabel,
|
|
7974
|
+
MenuItem,
|
|
7975
|
+
MenuPopup,
|
|
7976
|
+
MenuSeparator,
|
|
7977
|
+
MenuTrigger,
|
|
7978
|
+
Meter,
|
|
7466
7979
|
Pagination,
|
|
7467
7980
|
ProgressBar,
|
|
7468
7981
|
Radio,
|
|
7982
|
+
RadioGroup,
|
|
7983
|
+
RadioGroupItem,
|
|
7469
7984
|
SegmentedControl,
|
|
7470
7985
|
SegmentedControlItem,
|
|
7471
7986
|
SegmentedControlTrigger,
|
|
7472
7987
|
Select,
|
|
7988
|
+
SelectGroup,
|
|
7989
|
+
SelectGroupLabel,
|
|
7990
|
+
SelectItem,
|
|
7991
|
+
SelectSeparator,
|
|
7473
7992
|
Slider,
|
|
7474
7993
|
SplitButton,
|
|
7475
7994
|
StarRating,
|
|
7476
7995
|
TAG_LEADING_ICON_NAMES,
|
|
7477
7996
|
Tab,
|
|
7997
|
+
TabIndicator,
|
|
7478
7998
|
TabList,
|
|
7999
|
+
TabPanel,
|
|
7479
8000
|
Tabs,
|
|
8001
|
+
TabsContent,
|
|
7480
8002
|
TabsList,
|
|
7481
8003
|
TabsTrigger,
|
|
7482
8004
|
Tag,
|
|
@@ -7491,20 +8013,25 @@ function ButtonDecorativeIconGlyph({
|
|
|
7491
8013
|
ThemeSwitcher,
|
|
7492
8014
|
ToggleSwitch,
|
|
7493
8015
|
Tooltip,
|
|
8016
|
+
TooltipPopup,
|
|
8017
|
+
TooltipProvider,
|
|
7494
8018
|
VideoControls,
|
|
7495
8019
|
VideoPlaceholder,
|
|
8020
|
+
WhimsyCursor,
|
|
7496
8021
|
buttonVariants,
|
|
7497
8022
|
checkboxFrameVariants,
|
|
7498
8023
|
cn,
|
|
8024
|
+
fadeInUp,
|
|
7499
8025
|
hasRenderableFieldLabelText,
|
|
7500
8026
|
linkVariants,
|
|
7501
8027
|
listItemVariants,
|
|
8028
|
+
motion,
|
|
7502
8029
|
placeholderVariants,
|
|
7503
8030
|
radioFrameVariants,
|
|
7504
|
-
selectFieldVariants,
|
|
7505
8031
|
selectShellVariants,
|
|
7506
8032
|
selectVariants,
|
|
7507
8033
|
splitButtonVariants,
|
|
8034
|
+
staggerContainer,
|
|
7508
8035
|
tabListVariants,
|
|
7509
8036
|
tagVariants,
|
|
7510
8037
|
textAreaFieldVariants,
|
|
@@ -7512,6 +8039,7 @@ function ButtonDecorativeIconGlyph({
|
|
|
7512
8039
|
textInputShellVariants,
|
|
7513
8040
|
toggleSwitchVariants,
|
|
7514
8041
|
toggleThumbVariants,
|
|
8042
|
+
useCursorStyle,
|
|
7515
8043
|
useTheme,
|
|
7516
8044
|
wvkIconBoxLgClass,
|
|
7517
8045
|
wvkIconLgClass,
|