@underverse-ui/underverse 1.0.198 → 1.0.199
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/api-reference.json +1 -1
- package/dist/index.cjs +196 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +253 -223
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3112,6 +3112,39 @@ function useOverlayScrollbarTarget(targetRef, options = {}) {
|
|
|
3112
3112
|
}
|
|
3113
3113
|
var OverlayScrollbarProvider_default = OverlayScrollbarProvider;
|
|
3114
3114
|
|
|
3115
|
+
// src/components/form-control-size.ts
|
|
3116
|
+
var formControlSizeStyles = {
|
|
3117
|
+
sm: {
|
|
3118
|
+
control: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
|
|
3119
|
+
compactControl: "h-8 px-2.5 text-sm leading-none md:h-7 md:text-xs",
|
|
3120
|
+
input: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
|
|
3121
|
+
label: "text-xs",
|
|
3122
|
+
icon: "h-4 w-4 md:h-3.5 md:w-3.5",
|
|
3123
|
+
iconButton: "h-7 w-7 md:h-6 md:w-6",
|
|
3124
|
+
tag: "h-5 max-w-24 px-2 text-[10px] leading-none"
|
|
3125
|
+
},
|
|
3126
|
+
md: {
|
|
3127
|
+
control: "h-10 px-3 text-sm leading-none",
|
|
3128
|
+
compactControl: "h-10 px-3 text-sm leading-none",
|
|
3129
|
+
input: "h-10 px-4 text-sm leading-none",
|
|
3130
|
+
label: "text-sm",
|
|
3131
|
+
icon: "h-4 w-4",
|
|
3132
|
+
iconButton: "h-8 w-8",
|
|
3133
|
+
tag: "h-6 max-w-28 px-2 text-xs leading-none"
|
|
3134
|
+
},
|
|
3135
|
+
lg: {
|
|
3136
|
+
control: "h-12 px-4 text-base leading-none",
|
|
3137
|
+
compactControl: "h-12 px-4 text-base leading-none",
|
|
3138
|
+
input: "h-12 px-5 text-base leading-none",
|
|
3139
|
+
label: "text-base",
|
|
3140
|
+
icon: "h-5 w-5",
|
|
3141
|
+
iconButton: "h-10 w-10",
|
|
3142
|
+
tag: "h-7 max-w-32 px-2.5 text-sm leading-none"
|
|
3143
|
+
}
|
|
3144
|
+
};
|
|
3145
|
+
var formControlFixedClass = "min-h-0 overflow-hidden";
|
|
3146
|
+
var formControlValueClass = "max-h-full min-w-0 flex-1 truncate whitespace-nowrap";
|
|
3147
|
+
|
|
3115
3148
|
// src/components/Input.tsx
|
|
3116
3149
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3117
3150
|
var Input = (0, import_react4.forwardRef)(
|
|
@@ -3175,23 +3208,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
3175
3208
|
error: "border-destructive focus-visible:outline-none focus-visible:border-destructive"
|
|
3176
3209
|
}
|
|
3177
3210
|
};
|
|
3178
|
-
const sizeStyles8 =
|
|
3179
|
-
sm: {
|
|
3180
|
-
input: "px-3 py-1.5 text-sm h-8 md:h-7 md:py-1 md:text-xs",
|
|
3181
|
-
icon: "w-4 h-4",
|
|
3182
|
-
button: "h-7 w-7"
|
|
3183
|
-
},
|
|
3184
|
-
md: {
|
|
3185
|
-
input: "px-4 py-2 text-sm h-10",
|
|
3186
|
-
icon: "w-5 h-5",
|
|
3187
|
-
button: "h-8 w-8"
|
|
3188
|
-
},
|
|
3189
|
-
lg: {
|
|
3190
|
-
input: "px-5 py-4 text-base h-12",
|
|
3191
|
-
icon: "w-6 h-6",
|
|
3192
|
-
button: "h-10 w-10"
|
|
3193
|
-
}
|
|
3194
|
-
};
|
|
3211
|
+
const sizeStyles8 = formControlSizeStyles;
|
|
3195
3212
|
const getErrorKey = (v) => {
|
|
3196
3213
|
if (v.valueMissing) return "required";
|
|
3197
3214
|
if (v.typeMismatch) return "typeMismatch";
|
|
@@ -3250,7 +3267,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
3250
3267
|
htmlFor: resolvedId,
|
|
3251
3268
|
className: cn(
|
|
3252
3269
|
// Label size follows input size
|
|
3253
|
-
size
|
|
3270
|
+
sizeStyles8[size].label,
|
|
3254
3271
|
"font-medium transition-colors duration-200",
|
|
3255
3272
|
// default color and highlight while any descendant focused
|
|
3256
3273
|
disabled ? "text-muted-foreground" : cn("text-foreground group-focus-within:text-primary", success && "text-primary"),
|
|
@@ -3284,7 +3301,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
3284
3301
|
"div",
|
|
3285
3302
|
{
|
|
3286
3303
|
className: cn(
|
|
3287
|
-
"absolute left-3 top-1/2 -translate-y-1/2 z-10",
|
|
3304
|
+
"absolute left-3 top-1/2 -translate-y-1/2 z-10 flex max-h-full items-center overflow-hidden",
|
|
3288
3305
|
"text-muted-foreground transition-colors duration-200",
|
|
3289
3306
|
// highlight icon when input (or controls) focused
|
|
3290
3307
|
"group-focus-within:text-primary"
|
|
@@ -3314,6 +3331,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
3314
3331
|
"aria-describedby": [errorId, descId].filter(Boolean).join(" ") || void 0,
|
|
3315
3332
|
className: cn(
|
|
3316
3333
|
"w-full text-foreground transition-all duration-200 ease-out",
|
|
3334
|
+
formControlFixedClass,
|
|
3317
3335
|
"placeholder:text-muted-foreground focus:outline-none focus-visible:outline-none",
|
|
3318
3336
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
3319
3337
|
// Size styles
|
|
@@ -3349,7 +3367,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
3349
3367
|
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-md",
|
|
3350
3368
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
3351
3369
|
"active:bg-accent active:text-accent-foreground",
|
|
3352
|
-
sizeStyles8[size].
|
|
3370
|
+
sizeStyles8[size].iconButton
|
|
3353
3371
|
),
|
|
3354
3372
|
tabIndex: 0,
|
|
3355
3373
|
"aria-label": gi18n.clearInput ?? "Clear input",
|
|
@@ -3365,7 +3383,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
|
3365
3383
|
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-full",
|
|
3366
3384
|
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring/40",
|
|
3367
3385
|
"active:bg-accent/50 active:text-accent-foreground",
|
|
3368
|
-
sizeStyles8[size].
|
|
3386
|
+
sizeStyles8[size].iconButton
|
|
3369
3387
|
),
|
|
3370
3388
|
tabIndex: 0,
|
|
3371
3389
|
"aria-label": showPassword ? gi18n.hidePassword ?? "Hide password" : gi18n.showPassword ?? "Show password",
|
|
@@ -5904,23 +5922,23 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
5904
5922
|
const moreLabel = labels?.moreCount?.replace("{count}", String(hiddenCount)) ?? `+${hiddenCount} more`;
|
|
5905
5923
|
const sizeStyles8 = {
|
|
5906
5924
|
sm: {
|
|
5907
|
-
container:
|
|
5908
|
-
input:
|
|
5909
|
-
tag:
|
|
5925
|
+
container: formControlSizeStyles.sm.control,
|
|
5926
|
+
input: formControlSizeStyles.sm.label,
|
|
5927
|
+
tag: formControlSizeStyles.sm.tag,
|
|
5910
5928
|
tagIcon: "h-3 w-3",
|
|
5911
5929
|
button: "h-7 text-xs px-2"
|
|
5912
5930
|
},
|
|
5913
5931
|
md: {
|
|
5914
|
-
container:
|
|
5915
|
-
input:
|
|
5916
|
-
tag:
|
|
5932
|
+
container: formControlSizeStyles.md.control,
|
|
5933
|
+
input: formControlSizeStyles.md.label,
|
|
5934
|
+
tag: formControlSizeStyles.md.tag,
|
|
5917
5935
|
tagIcon: "h-3.5 w-3.5",
|
|
5918
5936
|
button: "h-9 text-sm px-3"
|
|
5919
5937
|
},
|
|
5920
5938
|
lg: {
|
|
5921
|
-
container:
|
|
5922
|
-
input:
|
|
5923
|
-
tag:
|
|
5939
|
+
container: formControlSizeStyles.lg.control,
|
|
5940
|
+
input: formControlSizeStyles.lg.label,
|
|
5941
|
+
tag: formControlSizeStyles.lg.tag,
|
|
5924
5942
|
tagIcon: "h-4 w-4",
|
|
5925
5943
|
button: "h-11 text-base px-4"
|
|
5926
5944
|
}
|
|
@@ -5991,7 +6009,7 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
5991
6009
|
htmlFor: inputId,
|
|
5992
6010
|
className: cn(
|
|
5993
6011
|
"block font-medium transition-colors duration-200",
|
|
5994
|
-
size
|
|
6012
|
+
formControlSizeStyles[size].label,
|
|
5995
6013
|
disabled ? "text-muted-foreground" : isFocused ? "text-primary" : "text-foreground",
|
|
5996
6014
|
labelClassName
|
|
5997
6015
|
),
|
|
@@ -6012,7 +6030,8 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
6012
6030
|
{
|
|
6013
6031
|
onClick: handleContainerClick,
|
|
6014
6032
|
className: cn(
|
|
6015
|
-
"flex
|
|
6033
|
+
"flex items-center gap-1.5 cursor-text",
|
|
6034
|
+
formControlFixedClass,
|
|
6016
6035
|
"bg-background border border-input",
|
|
6017
6036
|
"transition-all duration-200",
|
|
6018
6037
|
"hover:border-accent-foreground/20",
|
|
@@ -6026,13 +6045,13 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
6026
6045
|
"span",
|
|
6027
6046
|
{
|
|
6028
6047
|
className: cn(
|
|
6029
|
-
"inline-flex items-center",
|
|
6048
|
+
"inline-flex min-w-0 shrink-0 items-center gap-1 overflow-hidden rounded-full",
|
|
6030
6049
|
"bg-primary/10 text-primary font-mono",
|
|
6031
6050
|
"animate-in fade-in-0 zoom-in-95 duration-200",
|
|
6032
6051
|
sizeStyles8[size].tag
|
|
6033
6052
|
),
|
|
6034
6053
|
children: [
|
|
6035
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "
|
|
6054
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "min-w-0 truncate", children: tag }),
|
|
6036
6055
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6037
6056
|
"button",
|
|
6038
6057
|
{
|
|
@@ -6066,7 +6085,7 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
6066
6085
|
setIsExpanded(true);
|
|
6067
6086
|
},
|
|
6068
6087
|
className: cn(
|
|
6069
|
-
"inline-flex items-center cursor-pointer",
|
|
6088
|
+
"inline-flex shrink-0 items-center cursor-pointer overflow-hidden rounded-full",
|
|
6070
6089
|
"bg-muted text-muted-foreground hover:bg-muted/80",
|
|
6071
6090
|
"transition-colors duration-150",
|
|
6072
6091
|
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
@@ -6085,7 +6104,7 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
6085
6104
|
setIsExpanded(false);
|
|
6086
6105
|
},
|
|
6087
6106
|
className: cn(
|
|
6088
|
-
"inline-flex items-center cursor-pointer",
|
|
6107
|
+
"inline-flex shrink-0 items-center cursor-pointer overflow-hidden rounded-full",
|
|
6089
6108
|
"bg-muted/50 text-muted-foreground hover:bg-muted/80",
|
|
6090
6109
|
"transition-colors duration-150",
|
|
6091
6110
|
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
@@ -6115,7 +6134,7 @@ var TagInput = (0, import_react10.forwardRef)(
|
|
|
6115
6134
|
placeholder: isMaxReached ? `Max ${maxTags} tags` : currentPlaceholder,
|
|
6116
6135
|
disabled: disabled || isMaxReached,
|
|
6117
6136
|
className: cn(
|
|
6118
|
-
"
|
|
6137
|
+
"h-full min-w-0 flex-1 bg-transparent outline-none",
|
|
6119
6138
|
"placeholder:text-muted-foreground",
|
|
6120
6139
|
"disabled:cursor-not-allowed",
|
|
6121
6140
|
sizeStyles8[size].input
|
|
@@ -9111,7 +9130,7 @@ var DropdownMenuSub = ({ label, icon: Icon, disabled, borderMode, children }) =>
|
|
|
9111
9130
|
}
|
|
9112
9131
|
);
|
|
9113
9132
|
};
|
|
9114
|
-
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className, borderMode }) => {
|
|
9133
|
+
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className, borderMode, size = "md" }) => {
|
|
9115
9134
|
const globalConfig = useUnderverseUIConfig();
|
|
9116
9135
|
const resolvedBorderMode = borderMode ?? globalConfig.dropdownMenu?.borderMode ?? globalConfig.borderMode;
|
|
9117
9136
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -9121,15 +9140,17 @@ var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", cla
|
|
|
9121
9140
|
"button",
|
|
9122
9141
|
{
|
|
9123
9142
|
className: cn(
|
|
9124
|
-
"inline-flex items-center justify-between gap-2
|
|
9143
|
+
"inline-flex items-center justify-between gap-2 border bg-background border-border/60",
|
|
9125
9144
|
resolvedBorderMode ? getBorderRadiusClass(resolvedBorderMode) : "rounded-2xl",
|
|
9145
|
+
formControlFixedClass,
|
|
9146
|
+
formControlSizeStyles[size].control,
|
|
9126
9147
|
"hover:bg-accent/50",
|
|
9127
9148
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
9128
9149
|
className
|
|
9129
9150
|
),
|
|
9130
9151
|
children: [
|
|
9131
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "
|
|
9132
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", className: "opacity-70", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
9152
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: cn(formControlValueClass, "max-w-64 text-foreground/90"), children: value || placeholder }),
|
|
9153
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", className: "shrink-0 opacity-70", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
9133
9154
|
]
|
|
9134
9155
|
}
|
|
9135
9156
|
),
|
|
@@ -9380,9 +9401,9 @@ var Combobox = ({
|
|
|
9380
9401
|
lg: "px-4 py-3 text-base gap-3"
|
|
9381
9402
|
};
|
|
9382
9403
|
const iconSizeStyles = {
|
|
9383
|
-
sm:
|
|
9384
|
-
md:
|
|
9385
|
-
lg:
|
|
9404
|
+
sm: formControlSizeStyles.sm.icon,
|
|
9405
|
+
md: formControlSizeStyles.md.icon,
|
|
9406
|
+
lg: formControlSizeStyles.lg.icon
|
|
9386
9407
|
};
|
|
9387
9408
|
const checkIconSizeStyles = {
|
|
9388
9409
|
sm: "h-3.5 w-3.5",
|
|
@@ -9589,9 +9610,9 @@ var Combobox = ({
|
|
|
9589
9610
|
}
|
|
9590
9611
|
);
|
|
9591
9612
|
const sizeStyles8 = {
|
|
9592
|
-
sm:
|
|
9593
|
-
md:
|
|
9594
|
-
lg:
|
|
9613
|
+
sm: formControlSizeStyles.sm.control,
|
|
9614
|
+
md: formControlSizeStyles.md.control,
|
|
9615
|
+
lg: formControlSizeStyles.lg.control
|
|
9595
9616
|
};
|
|
9596
9617
|
const variantStyles6 = {
|
|
9597
9618
|
default: "border border-input bg-background hover:bg-accent/5 hover:border-primary/40",
|
|
@@ -9599,7 +9620,7 @@ var Combobox = ({
|
|
|
9599
9620
|
ghost: "border-0 bg-transparent hover:bg-accent/50",
|
|
9600
9621
|
filled: "border-0 bg-muted/50 hover:bg-muted/80"
|
|
9601
9622
|
};
|
|
9602
|
-
const labelSize = size
|
|
9623
|
+
const labelSize = formControlSizeStyles[size].label;
|
|
9603
9624
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
9604
9625
|
const dropdownBackgroundStyle = matchTriggerBackground && triggerBackgroundColor ? { backgroundColor: triggerBackgroundColor } : void 0;
|
|
9605
9626
|
const triggerButtonBaseProps = {
|
|
@@ -9625,7 +9646,8 @@ var Combobox = ({
|
|
|
9625
9646
|
}
|
|
9626
9647
|
},
|
|
9627
9648
|
className: cn(
|
|
9628
|
-
"group flex w-full items-center justify-between
|
|
9649
|
+
"group flex w-full items-center justify-between transition-all duration-200",
|
|
9650
|
+
formControlFixedClass,
|
|
9629
9651
|
radiusClass,
|
|
9630
9652
|
sizeStyles8[size],
|
|
9631
9653
|
variantStyles6[variant],
|
|
@@ -9637,8 +9659,8 @@ var Combobox = ({
|
|
|
9637
9659
|
)
|
|
9638
9660
|
};
|
|
9639
9661
|
const triggerContents = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
9640
|
-
selectedIcon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "
|
|
9641
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("
|
|
9662
|
+
selectedIcon && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn("mr-2 flex shrink-0 items-center justify-center overflow-hidden text-primary", formControlSizeStyles[size].icon), children: selectedIcon }),
|
|
9663
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: cn(formControlValueClass, "text-left", !displayValue && "text-muted-foreground", fontBold && "font-semibold"), children: renderValue && selectedOption ? renderValue(selectedOption) : displayValue || placeholder }),
|
|
9642
9664
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-1.5 ml-2 shrink-0", children: [
|
|
9643
9665
|
allowClear && value && !disabled && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
9644
9666
|
"div",
|
|
@@ -10612,7 +10634,7 @@ var DatePicker = ({
|
|
|
10612
10634
|
useShadCNAnimations();
|
|
10613
10635
|
const sizeStyles8 = {
|
|
10614
10636
|
sm: {
|
|
10615
|
-
trigger:
|
|
10637
|
+
trigger: formControlSizeStyles.sm.compactControl,
|
|
10616
10638
|
dayCell: "w-7 h-7 text-xs",
|
|
10617
10639
|
monthCell: "w-6 h-6 text-xs",
|
|
10618
10640
|
navButton: "p-1.5",
|
|
@@ -10623,13 +10645,13 @@ var DatePicker = ({
|
|
|
10623
10645
|
actionIcon: "w-2.5 h-2.5",
|
|
10624
10646
|
contentWidth: 240,
|
|
10625
10647
|
contentPadding: "p-4",
|
|
10626
|
-
label:
|
|
10648
|
+
label: formControlSizeStyles.sm.label,
|
|
10627
10649
|
weekdayLabel: "text-[9px] py-1",
|
|
10628
10650
|
headerMargin: "mb-2",
|
|
10629
10651
|
footerMargin: "mt-3 pt-2 gap-1.5"
|
|
10630
10652
|
},
|
|
10631
10653
|
md: {
|
|
10632
|
-
trigger:
|
|
10654
|
+
trigger: formControlSizeStyles.md.control,
|
|
10633
10655
|
dayCell: "w-8 h-8 text-sm",
|
|
10634
10656
|
monthCell: "w-8 h-8 text-sm",
|
|
10635
10657
|
navButton: "p-2",
|
|
@@ -10640,13 +10662,13 @@ var DatePicker = ({
|
|
|
10640
10662
|
actionIcon: "w-3.5 h-3.5",
|
|
10641
10663
|
contentWidth: 280,
|
|
10642
10664
|
contentPadding: "p-5",
|
|
10643
|
-
label:
|
|
10665
|
+
label: formControlSizeStyles.md.label,
|
|
10644
10666
|
weekdayLabel: "text-[10px] py-1.5",
|
|
10645
10667
|
headerMargin: "mb-4",
|
|
10646
10668
|
footerMargin: "mt-4 pt-3 gap-2"
|
|
10647
10669
|
},
|
|
10648
10670
|
lg: {
|
|
10649
|
-
trigger:
|
|
10671
|
+
trigger: formControlSizeStyles.lg.control,
|
|
10650
10672
|
dayCell: "w-10 h-10 text-base",
|
|
10651
10673
|
monthCell: "w-10 h-10 text-base",
|
|
10652
10674
|
navButton: "p-2.5",
|
|
@@ -10657,7 +10679,7 @@ var DatePicker = ({
|
|
|
10657
10679
|
actionIcon: "w-4 h-4",
|
|
10658
10680
|
contentWidth: 340,
|
|
10659
10681
|
contentPadding: "p-6",
|
|
10660
|
-
label:
|
|
10682
|
+
label: formControlSizeStyles.lg.label,
|
|
10661
10683
|
weekdayLabel: "text-xs py-2",
|
|
10662
10684
|
headerMargin: "mb-5",
|
|
10663
10685
|
footerMargin: "mt-5 pt-4 gap-2.5"
|
|
@@ -11015,6 +11037,7 @@ var DatePicker = ({
|
|
|
11015
11037
|
"aria-invalid": !!effectiveError,
|
|
11016
11038
|
className: cn(
|
|
11017
11039
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
11040
|
+
formControlFixedClass,
|
|
11018
11041
|
getBorderRadiusClass(resolvedBorderMode),
|
|
11019
11042
|
sizeStyles8[size].trigger,
|
|
11020
11043
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
@@ -11028,7 +11051,7 @@ var DatePicker = ({
|
|
|
11028
11051
|
className
|
|
11029
11052
|
),
|
|
11030
11053
|
children: [
|
|
11031
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2.5
|
|
11054
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-2.5 overflow-hidden", children: [
|
|
11032
11055
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11033
11056
|
"div",
|
|
11034
11057
|
{
|
|
@@ -11060,7 +11083,7 @@ var DatePicker = ({
|
|
|
11060
11083
|
e.stopPropagation();
|
|
11061
11084
|
}
|
|
11062
11085
|
},
|
|
11063
|
-
className: "
|
|
11086
|
+
className: "h-full min-w-0 flex-1 truncate bg-transparent border-none outline-none focus:outline-none p-0 text-foreground font-medium placeholder-muted-foreground/60"
|
|
11064
11087
|
}
|
|
11065
11088
|
)
|
|
11066
11089
|
] }),
|
|
@@ -11297,7 +11320,7 @@ var DateRangePicker = ({
|
|
|
11297
11320
|
};
|
|
11298
11321
|
const sizeStyles8 = {
|
|
11299
11322
|
sm: {
|
|
11300
|
-
trigger:
|
|
11323
|
+
trigger: formControlSizeStyles.sm.compactControl,
|
|
11301
11324
|
dayCell: "w-7 h-7 text-xs",
|
|
11302
11325
|
monthCell: "w-6 h-6 text-xs",
|
|
11303
11326
|
navButton: "p-1.5",
|
|
@@ -11308,13 +11331,13 @@ var DateRangePicker = ({
|
|
|
11308
11331
|
actionIcon: "w-2.5 h-2.5",
|
|
11309
11332
|
contentWidth: 240,
|
|
11310
11333
|
contentPadding: "p-4",
|
|
11311
|
-
label:
|
|
11334
|
+
label: formControlSizeStyles.sm.label,
|
|
11312
11335
|
weekdayLabel: "text-[9px] py-1",
|
|
11313
11336
|
headerMargin: "mb-2",
|
|
11314
11337
|
footerMargin: "mt-3 pt-2 gap-1.5"
|
|
11315
11338
|
},
|
|
11316
11339
|
md: {
|
|
11317
|
-
trigger:
|
|
11340
|
+
trigger: formControlSizeStyles.md.control,
|
|
11318
11341
|
dayCell: "w-8 h-8 text-sm",
|
|
11319
11342
|
monthCell: "w-8 h-8 text-sm",
|
|
11320
11343
|
navButton: "p-2",
|
|
@@ -11325,13 +11348,13 @@ var DateRangePicker = ({
|
|
|
11325
11348
|
actionIcon: "w-3.5 h-3.5",
|
|
11326
11349
|
contentWidth: 280,
|
|
11327
11350
|
contentPadding: "p-5",
|
|
11328
|
-
label:
|
|
11351
|
+
label: formControlSizeStyles.md.label,
|
|
11329
11352
|
weekdayLabel: "text-[10px] py-1.5",
|
|
11330
11353
|
headerMargin: "mb-4",
|
|
11331
11354
|
footerMargin: "mt-4 pt-3 gap-2"
|
|
11332
11355
|
},
|
|
11333
11356
|
lg: {
|
|
11334
|
-
trigger:
|
|
11357
|
+
trigger: formControlSizeStyles.lg.control,
|
|
11335
11358
|
dayCell: "w-10 h-10 text-base",
|
|
11336
11359
|
monthCell: "w-10 h-10 text-base",
|
|
11337
11360
|
navButton: "p-2.5",
|
|
@@ -11342,7 +11365,7 @@ var DateRangePicker = ({
|
|
|
11342
11365
|
actionIcon: "w-4 h-4",
|
|
11343
11366
|
contentWidth: 340,
|
|
11344
11367
|
contentPadding: "p-6",
|
|
11345
|
-
label:
|
|
11368
|
+
label: formControlSizeStyles.lg.label,
|
|
11346
11369
|
weekdayLabel: "text-xs py-2",
|
|
11347
11370
|
headerMargin: "mb-5",
|
|
11348
11371
|
footerMargin: "mt-5 pt-4 gap-2.5"
|
|
@@ -11769,6 +11792,7 @@ var DateRangePicker = ({
|
|
|
11769
11792
|
"aria-invalid": !!effectiveError,
|
|
11770
11793
|
className: cn(
|
|
11771
11794
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
11795
|
+
formControlFixedClass,
|
|
11772
11796
|
getBorderRadiusClass(resolvedBorderMode),
|
|
11773
11797
|
sizeStyles8[size].trigger,
|
|
11774
11798
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
@@ -11781,7 +11805,7 @@ var DateRangePicker = ({
|
|
|
11781
11805
|
effectiveError && "border-destructive/60 focus-within:ring-destructive/50 bg-destructive/5"
|
|
11782
11806
|
),
|
|
11783
11807
|
children: [
|
|
11784
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("flex
|
|
11808
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("flex min-h-0 min-w-0 flex-1 items-center overflow-hidden", size === "sm" ? "gap-1.5" : "gap-2.5"), children: [
|
|
11785
11809
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11786
11810
|
"div",
|
|
11787
11811
|
{
|
|
@@ -11813,11 +11837,11 @@ var DateRangePicker = ({
|
|
|
11813
11837
|
e.stopPropagation();
|
|
11814
11838
|
}
|
|
11815
11839
|
},
|
|
11816
|
-
className: "
|
|
11840
|
+
className: "h-full min-w-0 flex-1 truncate bg-transparent border-none outline-none focus:outline-none p-0 text-foreground font-medium placeholder-muted-foreground/60"
|
|
11817
11841
|
}
|
|
11818
11842
|
)
|
|
11819
11843
|
] }),
|
|
11820
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { className: cn(sizeStyles8[size].navIcon), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
11844
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: cn("shrink-0 transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("svg", { className: cn(sizeStyles8[size].navIcon), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
11821
11845
|
]
|
|
11822
11846
|
}
|
|
11823
11847
|
),
|
|
@@ -12267,7 +12291,7 @@ var LunarDatePicker = ({
|
|
|
12267
12291
|
useShadCNAnimations();
|
|
12268
12292
|
const sizeStyles8 = {
|
|
12269
12293
|
sm: {
|
|
12270
|
-
trigger:
|
|
12294
|
+
trigger: formControlSizeStyles.sm.compactControl,
|
|
12271
12295
|
dayCell: "w-7 h-7 text-xs",
|
|
12272
12296
|
monthCell: "w-6 h-6 text-xs",
|
|
12273
12297
|
navButton: "p-1.5",
|
|
@@ -12278,13 +12302,13 @@ var LunarDatePicker = ({
|
|
|
12278
12302
|
actionIcon: "w-2.5 h-2.5",
|
|
12279
12303
|
contentWidth: 240,
|
|
12280
12304
|
contentPadding: "p-4",
|
|
12281
|
-
label:
|
|
12305
|
+
label: formControlSizeStyles.sm.label,
|
|
12282
12306
|
weekdayLabel: "text-[9px] py-1",
|
|
12283
12307
|
headerMargin: "mb-2",
|
|
12284
12308
|
footerMargin: "mt-3 pt-2 gap-1.5"
|
|
12285
12309
|
},
|
|
12286
12310
|
md: {
|
|
12287
|
-
trigger:
|
|
12311
|
+
trigger: formControlSizeStyles.md.control,
|
|
12288
12312
|
dayCell: "w-8 h-8 text-sm",
|
|
12289
12313
|
monthCell: "w-8 h-8 text-sm",
|
|
12290
12314
|
navButton: "p-2",
|
|
@@ -12295,13 +12319,13 @@ var LunarDatePicker = ({
|
|
|
12295
12319
|
actionIcon: "w-3.5 h-3.5",
|
|
12296
12320
|
contentWidth: 280,
|
|
12297
12321
|
contentPadding: "p-5",
|
|
12298
|
-
label:
|
|
12322
|
+
label: formControlSizeStyles.md.label,
|
|
12299
12323
|
weekdayLabel: "text-[10px] py-1.5",
|
|
12300
12324
|
headerMargin: "mb-4",
|
|
12301
12325
|
footerMargin: "mt-4 pt-3 gap-2"
|
|
12302
12326
|
},
|
|
12303
12327
|
lg: {
|
|
12304
|
-
trigger:
|
|
12328
|
+
trigger: formControlSizeStyles.lg.control,
|
|
12305
12329
|
dayCell: "w-10 h-10 text-base",
|
|
12306
12330
|
monthCell: "w-10 h-10 text-base",
|
|
12307
12331
|
navButton: "p-2.5",
|
|
@@ -12312,7 +12336,7 @@ var LunarDatePicker = ({
|
|
|
12312
12336
|
actionIcon: "w-4 h-4",
|
|
12313
12337
|
contentWidth: 340,
|
|
12314
12338
|
contentPadding: "p-6",
|
|
12315
|
-
label:
|
|
12339
|
+
label: formControlSizeStyles.lg.label,
|
|
12316
12340
|
weekdayLabel: "text-xs py-2",
|
|
12317
12341
|
headerMargin: "mb-5",
|
|
12318
12342
|
footerMargin: "mt-5 pt-4 gap-2.5"
|
|
@@ -12701,6 +12725,7 @@ var LunarDatePicker = ({
|
|
|
12701
12725
|
"aria-invalid": !!effectiveError,
|
|
12702
12726
|
className: cn(
|
|
12703
12727
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
12728
|
+
formControlFixedClass,
|
|
12704
12729
|
getBorderRadiusClass(resolvedBorderMode),
|
|
12705
12730
|
sizeStyles8[size].trigger,
|
|
12706
12731
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
@@ -12714,7 +12739,7 @@ var LunarDatePicker = ({
|
|
|
12714
12739
|
className
|
|
12715
12740
|
),
|
|
12716
12741
|
children: [
|
|
12717
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2.5
|
|
12742
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-2.5 overflow-hidden", children: [
|
|
12718
12743
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
12719
12744
|
"div",
|
|
12720
12745
|
{
|
|
@@ -12746,7 +12771,7 @@ var LunarDatePicker = ({
|
|
|
12746
12771
|
e.stopPropagation();
|
|
12747
12772
|
}
|
|
12748
12773
|
},
|
|
12749
|
-
className: "
|
|
12774
|
+
className: "h-full min-w-0 flex-1 truncate bg-transparent border-none outline-none focus:outline-none p-0 text-foreground font-medium placeholder-muted-foreground/60"
|
|
12750
12775
|
}
|
|
12751
12776
|
)
|
|
12752
12777
|
] }),
|
|
@@ -12830,7 +12855,7 @@ var LunarDateRangePicker = ({
|
|
|
12830
12855
|
const wheelDeltaRef = React35.useRef(0);
|
|
12831
12856
|
const sizeStyles8 = {
|
|
12832
12857
|
sm: {
|
|
12833
|
-
trigger:
|
|
12858
|
+
trigger: formControlSizeStyles.sm.compactControl,
|
|
12834
12859
|
dayCell: "w-7 h-7 text-xs",
|
|
12835
12860
|
monthCell: "w-6 h-6 text-xs",
|
|
12836
12861
|
navButton: "p-1.5",
|
|
@@ -12841,13 +12866,13 @@ var LunarDateRangePicker = ({
|
|
|
12841
12866
|
actionIcon: "w-2.5 h-2.5",
|
|
12842
12867
|
contentWidth: 240,
|
|
12843
12868
|
contentPadding: "p-4",
|
|
12844
|
-
label:
|
|
12869
|
+
label: formControlSizeStyles.sm.label,
|
|
12845
12870
|
weekdayLabel: "text-[9px] py-1",
|
|
12846
12871
|
headerMargin: "mb-2",
|
|
12847
12872
|
footerMargin: "mt-3 pt-2 gap-1.5"
|
|
12848
12873
|
},
|
|
12849
12874
|
md: {
|
|
12850
|
-
trigger:
|
|
12875
|
+
trigger: formControlSizeStyles.md.control,
|
|
12851
12876
|
dayCell: "w-8 h-8 text-sm",
|
|
12852
12877
|
monthCell: "w-8 h-8 text-sm",
|
|
12853
12878
|
navButton: "p-2",
|
|
@@ -12858,13 +12883,13 @@ var LunarDateRangePicker = ({
|
|
|
12858
12883
|
actionIcon: "w-3.5 h-3.5",
|
|
12859
12884
|
contentWidth: 280,
|
|
12860
12885
|
contentPadding: "p-5",
|
|
12861
|
-
label:
|
|
12886
|
+
label: formControlSizeStyles.md.label,
|
|
12862
12887
|
weekdayLabel: "text-[10px] py-1.5",
|
|
12863
12888
|
headerMargin: "mb-4",
|
|
12864
12889
|
footerMargin: "mt-4 pt-3 gap-2"
|
|
12865
12890
|
},
|
|
12866
12891
|
lg: {
|
|
12867
|
-
trigger:
|
|
12892
|
+
trigger: formControlSizeStyles.lg.control,
|
|
12868
12893
|
dayCell: "w-10 h-10 text-base",
|
|
12869
12894
|
monthCell: "w-10 h-10 text-base",
|
|
12870
12895
|
navButton: "p-2.5",
|
|
@@ -12875,7 +12900,7 @@ var LunarDateRangePicker = ({
|
|
|
12875
12900
|
actionIcon: "w-4 h-4",
|
|
12876
12901
|
contentWidth: 340,
|
|
12877
12902
|
contentPadding: "p-6",
|
|
12878
|
-
label:
|
|
12903
|
+
label: formControlSizeStyles.lg.label,
|
|
12879
12904
|
weekdayLabel: "text-xs py-2",
|
|
12880
12905
|
headerMargin: "mb-5",
|
|
12881
12906
|
footerMargin: "mt-5 pt-4 gap-2.5"
|
|
@@ -13322,6 +13347,7 @@ var LunarDateRangePicker = ({
|
|
|
13322
13347
|
"aria-invalid": !!effectiveError,
|
|
13323
13348
|
className: cn(
|
|
13324
13349
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
13350
|
+
formControlFixedClass,
|
|
13325
13351
|
getBorderRadiusClass(borderMode ?? "full"),
|
|
13326
13352
|
sizeStyles8[size].trigger,
|
|
13327
13353
|
disabled ? "border-border/40 opacity-50 cursor-not-allowed" : [
|
|
@@ -13334,7 +13360,7 @@ var LunarDateRangePicker = ({
|
|
|
13334
13360
|
effectiveError && "border-destructive/60 focus-within:ring-destructive/50 bg-destructive/5"
|
|
13335
13361
|
),
|
|
13336
13362
|
children: [
|
|
13337
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("flex
|
|
13363
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn("flex min-h-0 min-w-0 flex-1 items-center overflow-hidden", size === "sm" ? "gap-1.5" : "gap-2.5"), children: [
|
|
13338
13364
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
13339
13365
|
"div",
|
|
13340
13366
|
{
|
|
@@ -13345,9 +13371,9 @@ var LunarDateRangePicker = ({
|
|
|
13345
13371
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react18.Calendar, { className: cn("transition-transform duration-300", sizeStyles8[size].calendarIcon, isOpen && "scale-110") })
|
|
13346
13372
|
}
|
|
13347
13373
|
),
|
|
13348
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("w-
|
|
13374
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("min-w-0 flex-1 truncate whitespace-nowrap font-medium", !tempStart && "text-muted-foreground/60"), children: tempStart ? displayLabel : placeholder })
|
|
13349
13375
|
] }),
|
|
13350
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { className: cn(sizeStyles8[size].navIcon), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
13376
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: cn("shrink-0 transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { className: cn(sizeStyles8[size].navIcon), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) })
|
|
13351
13377
|
]
|
|
13352
13378
|
}
|
|
13353
13379
|
),
|
|
@@ -13975,9 +14001,9 @@ function MonthYearPicker({
|
|
|
13975
14001
|
setOpen(false);
|
|
13976
14002
|
};
|
|
13977
14003
|
const sizeClasses2 = {
|
|
13978
|
-
sm: { label:
|
|
13979
|
-
md: { label:
|
|
13980
|
-
lg: { label:
|
|
14004
|
+
sm: { label: formControlSizeStyles.sm.label, control: formControlSizeStyles.sm.compactControl, icon: formControlSizeStyles.sm.icon },
|
|
14005
|
+
md: { label: formControlSizeStyles.md.label, control: formControlSizeStyles.md.control, icon: formControlSizeStyles.md.icon },
|
|
14006
|
+
lg: { label: formControlSizeStyles.lg.label, control: formControlSizeStyles.lg.control, icon: formControlSizeStyles.lg.icon }
|
|
13981
14007
|
};
|
|
13982
14008
|
const panelSizeClasses = {
|
|
13983
14009
|
sm: { contentPadding: "p-4", stackGap: "space-y-3", displayText: "text-lg", actionText: "text-[11px]", actionPadding: "px-3 py-2" },
|
|
@@ -14005,9 +14031,8 @@ function MonthYearPicker({
|
|
|
14005
14031
|
className: cn(
|
|
14006
14032
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
14007
14033
|
getBorderRadiusClass(resolvedBorderMode),
|
|
14008
|
-
sz.
|
|
14009
|
-
|
|
14010
|
-
sz.text,
|
|
14034
|
+
sz.control,
|
|
14035
|
+
formControlFixedClass,
|
|
14011
14036
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
14012
14037
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
14013
14038
|
"transition-all duration-300 ease-out",
|
|
@@ -14019,7 +14044,7 @@ function MonthYearPicker({
|
|
|
14019
14044
|
className
|
|
14020
14045
|
),
|
|
14021
14046
|
children: [
|
|
14022
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2.5", children: [
|
|
14047
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-2.5 overflow-hidden", children: [
|
|
14023
14048
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
14024
14049
|
"div",
|
|
14025
14050
|
{
|
|
@@ -14033,7 +14058,7 @@ function MonthYearPicker({
|
|
|
14033
14058
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
14034
14059
|
"span",
|
|
14035
14060
|
{
|
|
14036
|
-
className: cn("
|
|
14061
|
+
className: cn(formControlValueClass, "font-medium transition-colors duration-200", !hasValue && "text-muted-foreground", hasValue && "text-foreground"),
|
|
14037
14062
|
children: hasValue ? display : placeholder
|
|
14038
14063
|
}
|
|
14039
14064
|
)
|
|
@@ -15691,9 +15716,9 @@ function TimePicker({
|
|
|
15691
15716
|
}
|
|
15692
15717
|
};
|
|
15693
15718
|
const sizeClasses2 = {
|
|
15694
|
-
sm: { label:
|
|
15695
|
-
md: { label:
|
|
15696
|
-
lg: { label:
|
|
15719
|
+
sm: { label: formControlSizeStyles.sm.label, control: formControlSizeStyles.sm.compactControl, icon: formControlSizeStyles.sm.icon },
|
|
15720
|
+
md: { label: formControlSizeStyles.md.label, control: formControlSizeStyles.md.control, icon: formControlSizeStyles.md.icon },
|
|
15721
|
+
lg: { label: formControlSizeStyles.lg.label, control: formControlSizeStyles.lg.control, icon: formControlSizeStyles.lg.icon }
|
|
15697
15722
|
};
|
|
15698
15723
|
const sz = sizeClasses2[size];
|
|
15699
15724
|
const effectivePanelSize = variant === "compact" ? size === "lg" ? "md" : "sm" : size;
|
|
@@ -15716,9 +15741,8 @@ function TimePicker({
|
|
|
15716
15741
|
className: cn(
|
|
15717
15742
|
"group flex w-full items-center justify-between border bg-background/80 backdrop-blur-sm",
|
|
15718
15743
|
getBorderRadiusClass(resolvedBorderMode),
|
|
15719
|
-
sz.
|
|
15720
|
-
|
|
15721
|
-
sz.text,
|
|
15744
|
+
sz.control,
|
|
15745
|
+
formControlFixedClass,
|
|
15722
15746
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
15723
15747
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
15724
15748
|
"transition-all duration-300 ease-out",
|
|
@@ -15730,7 +15754,7 @@ function TimePicker({
|
|
|
15730
15754
|
className
|
|
15731
15755
|
),
|
|
15732
15756
|
children: [
|
|
15733
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2.5", children: [
|
|
15757
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-2.5 overflow-hidden", children: [
|
|
15734
15758
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
15735
15759
|
"div",
|
|
15736
15760
|
{
|
|
@@ -15745,7 +15769,8 @@ function TimePicker({
|
|
|
15745
15769
|
"span",
|
|
15746
15770
|
{
|
|
15747
15771
|
className: cn(
|
|
15748
|
-
|
|
15772
|
+
formControlValueClass,
|
|
15773
|
+
"font-medium transition-colors duration-200",
|
|
15749
15774
|
!hasCommittedValue && "text-muted-foreground",
|
|
15750
15775
|
hasCommittedValue ? "text-foreground" : ""
|
|
15751
15776
|
),
|
|
@@ -16209,9 +16234,9 @@ var DateTimePicker = ({
|
|
|
16209
16234
|
const [localRequiredError, setLocalRequiredError] = React39.useState();
|
|
16210
16235
|
const sizeStyles8 = {
|
|
16211
16236
|
sm: {
|
|
16212
|
-
trigger:
|
|
16213
|
-
icon:
|
|
16214
|
-
label:
|
|
16237
|
+
trigger: formControlSizeStyles.sm.compactControl,
|
|
16238
|
+
icon: formControlSizeStyles.sm.icon,
|
|
16239
|
+
label: formControlSizeStyles.sm.label,
|
|
16215
16240
|
buttonSize: "sm",
|
|
16216
16241
|
calendarSize: "sm",
|
|
16217
16242
|
timePickerSize: "sm",
|
|
@@ -16219,9 +16244,9 @@ var DateTimePicker = ({
|
|
|
16219
16244
|
gap: "gap-2"
|
|
16220
16245
|
},
|
|
16221
16246
|
md: {
|
|
16222
|
-
trigger:
|
|
16223
|
-
icon:
|
|
16224
|
-
label:
|
|
16247
|
+
trigger: formControlSizeStyles.md.control,
|
|
16248
|
+
icon: formControlSizeStyles.md.icon,
|
|
16249
|
+
label: formControlSizeStyles.md.label,
|
|
16225
16250
|
buttonSize: "sm",
|
|
16226
16251
|
calendarSize: "md",
|
|
16227
16252
|
timePickerSize: "md",
|
|
@@ -16229,9 +16254,9 @@ var DateTimePicker = ({
|
|
|
16229
16254
|
gap: "gap-3"
|
|
16230
16255
|
},
|
|
16231
16256
|
lg: {
|
|
16232
|
-
trigger:
|
|
16233
|
-
icon:
|
|
16234
|
-
label:
|
|
16257
|
+
trigger: formControlSizeStyles.lg.control,
|
|
16258
|
+
icon: formControlSizeStyles.lg.icon,
|
|
16259
|
+
label: formControlSizeStyles.lg.label,
|
|
16235
16260
|
buttonSize: "md",
|
|
16236
16261
|
calendarSize: "lg",
|
|
16237
16262
|
timePickerSize: "lg",
|
|
@@ -16381,6 +16406,7 @@ var DateTimePicker = ({
|
|
|
16381
16406
|
"aria-invalid": !!effectiveError,
|
|
16382
16407
|
className: cn(
|
|
16383
16408
|
"flex w-full items-center justify-between border border-input bg-background",
|
|
16409
|
+
formControlFixedClass,
|
|
16384
16410
|
getBorderRadiusClass(resolvedBorderMode),
|
|
16385
16411
|
sizeStyles8[size].trigger,
|
|
16386
16412
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
@@ -16389,7 +16415,7 @@ var DateTimePicker = ({
|
|
|
16389
16415
|
effectiveError && "border-destructive/60 bg-destructive/5"
|
|
16390
16416
|
),
|
|
16391
16417
|
children: [
|
|
16392
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "
|
|
16418
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: cn(formControlValueClass, "text-left"), children: displayValue || placeholder || "Select date & time" }),
|
|
16393
16419
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex shrink-0 items-center gap-2 text-muted-foreground", children: [
|
|
16394
16420
|
value && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
16395
16421
|
"span",
|
|
@@ -19587,25 +19613,25 @@ var MultiCombobox = ({
|
|
|
19587
19613
|
}, [maxInitialOptions, normalizedOptions.length, searchMode, virtualized]);
|
|
19588
19614
|
const sizeStyles8 = {
|
|
19589
19615
|
sm: {
|
|
19590
|
-
trigger:
|
|
19591
|
-
icon:
|
|
19616
|
+
trigger: formControlSizeStyles.sm.control,
|
|
19617
|
+
icon: formControlSizeStyles.sm.icon,
|
|
19592
19618
|
search: "px-8 py-1.5 text-xs",
|
|
19593
19619
|
item: "text-xs px-3 py-1.5",
|
|
19594
|
-
tag:
|
|
19620
|
+
tag: formControlSizeStyles.sm.tag
|
|
19595
19621
|
},
|
|
19596
19622
|
md: {
|
|
19597
|
-
trigger:
|
|
19598
|
-
icon:
|
|
19623
|
+
trigger: formControlSizeStyles.md.control,
|
|
19624
|
+
icon: formControlSizeStyles.md.icon,
|
|
19599
19625
|
search: "px-10 py-2 text-sm",
|
|
19600
19626
|
item: "text-sm px-3 py-2",
|
|
19601
|
-
tag:
|
|
19627
|
+
tag: formControlSizeStyles.md.tag
|
|
19602
19628
|
},
|
|
19603
19629
|
lg: {
|
|
19604
|
-
trigger:
|
|
19605
|
-
icon:
|
|
19630
|
+
trigger: formControlSizeStyles.lg.control,
|
|
19631
|
+
icon: formControlSizeStyles.lg.icon,
|
|
19606
19632
|
search: "px-10 py-3 text-base",
|
|
19607
19633
|
item: "text-base px-3 py-3",
|
|
19608
|
-
tag:
|
|
19634
|
+
tag: formControlSizeStyles.lg.tag
|
|
19609
19635
|
}
|
|
19610
19636
|
};
|
|
19611
19637
|
const variantStyles6 = {
|
|
@@ -19616,7 +19642,7 @@ var MultiCombobox = ({
|
|
|
19616
19642
|
const autoId = (0, import_react24.useId)();
|
|
19617
19643
|
const resolvedId = id ? String(id) : `multicombobox-${autoId}`;
|
|
19618
19644
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
19619
|
-
const labelSize = size
|
|
19645
|
+
const labelSize = formControlSizeStyles[size].label;
|
|
19620
19646
|
const listboxId = `${resolvedId}-listbox`;
|
|
19621
19647
|
const renderOptionItem = (item, index, virtualItem) => {
|
|
19622
19648
|
const isSelected = value.includes(item.value);
|
|
@@ -19840,6 +19866,7 @@ var MultiCombobox = ({
|
|
|
19840
19866
|
"aria-invalid": !!effectiveError,
|
|
19841
19867
|
className: cn(
|
|
19842
19868
|
"group flex w-full items-center gap-2 transition-all duration-200",
|
|
19869
|
+
formControlFixedClass,
|
|
19843
19870
|
getBorderRadiusClass(resolvedBorderMode),
|
|
19844
19871
|
sizeStyles8[size].trigger,
|
|
19845
19872
|
variantStyles6[variant],
|
|
@@ -19849,22 +19876,22 @@ var MultiCombobox = ({
|
|
|
19849
19876
|
!!effectiveError && "border-destructive focus-visible:ring-destructive/30"
|
|
19850
19877
|
),
|
|
19851
19878
|
children: [
|
|
19852
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className:
|
|
19879
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-1.5 overflow-hidden", children: value.length > 0 ? showTags ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
19853
19880
|
visibleTags.map((option) => {
|
|
19854
19881
|
if (renderTag) {
|
|
19855
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
19882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "inline-flex max-h-full min-w-0 shrink overflow-hidden", children: renderTag(option, () => handleRemove(option.value)) }, option.value);
|
|
19856
19883
|
}
|
|
19857
19884
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
19858
19885
|
"span",
|
|
19859
19886
|
{
|
|
19860
19887
|
className: cn(
|
|
19861
|
-
"inline-flex items-center gap-1.5 bg-primary/10 text-primary
|
|
19888
|
+
"inline-flex min-w-0 shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-primary/10 text-primary transition-all duration-200",
|
|
19862
19889
|
"hover:bg-primary/20",
|
|
19863
19890
|
sizeStyles8[size].tag
|
|
19864
19891
|
),
|
|
19865
19892
|
children: [
|
|
19866
19893
|
showSelectedIcons && option.icon && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "shrink-0 w-3.5 h-3.5 flex items-center justify-center", children: option.icon }),
|
|
19867
|
-
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "
|
|
19894
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "min-w-0 truncate", children: displayFormat(option) }),
|
|
19868
19895
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
19869
19896
|
"span",
|
|
19870
19897
|
{
|
|
@@ -19893,7 +19920,7 @@ var MultiCombobox = ({
|
|
|
19893
19920
|
);
|
|
19894
19921
|
}),
|
|
19895
19922
|
hiddenCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: cn("inline-flex items-center bg-muted text-muted-foreground rounded-lg shrink-0", sizeStyles8[size].tag), children: gi18n.moreCount ? gi18n.moreCount(hiddenCount) : `+${hiddenCount} more` })
|
|
19896
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "
|
|
19923
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: cn(formControlValueClass, "font-medium"), children: gi18n.selectedCount ? gi18n.selectedCount(value.length) : `${value.length} item${value.length > 1 ? "s" : ""} selected` }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: cn(formControlValueClass, "text-muted-foreground"), children: placeholder }) }),
|
|
19897
19924
|
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
19898
19925
|
showClear && value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
19899
19926
|
"div",
|
|
@@ -21867,29 +21894,29 @@ function CategoryTreeSelect(props) {
|
|
|
21867
21894
|
const selectedCount = valueArray.length;
|
|
21868
21895
|
const triggerSizeStyles = {
|
|
21869
21896
|
sm: {
|
|
21870
|
-
button:
|
|
21897
|
+
button: formControlSizeStyles.sm.control,
|
|
21871
21898
|
iconWrap: "p-1",
|
|
21872
|
-
icon:
|
|
21873
|
-
text:
|
|
21874
|
-
badge:
|
|
21875
|
-
actionIcon:
|
|
21899
|
+
icon: formControlSizeStyles.sm.icon,
|
|
21900
|
+
text: formControlSizeStyles.sm.label,
|
|
21901
|
+
badge: formControlSizeStyles.sm.tag,
|
|
21902
|
+
actionIcon: formControlSizeStyles.sm.icon,
|
|
21876
21903
|
clearIcon: "h-3 w-3"
|
|
21877
21904
|
},
|
|
21878
21905
|
md: {
|
|
21879
|
-
button:
|
|
21906
|
+
button: formControlSizeStyles.md.control,
|
|
21880
21907
|
iconWrap: "p-1.5",
|
|
21881
21908
|
icon: "w-4 h-4",
|
|
21882
|
-
text:
|
|
21883
|
-
badge:
|
|
21909
|
+
text: formControlSizeStyles.md.label,
|
|
21910
|
+
badge: formControlSizeStyles.md.tag,
|
|
21884
21911
|
actionIcon: "w-4 h-4",
|
|
21885
21912
|
clearIcon: "h-3.5 w-3.5"
|
|
21886
21913
|
},
|
|
21887
21914
|
lg: {
|
|
21888
|
-
button:
|
|
21915
|
+
button: formControlSizeStyles.lg.control,
|
|
21889
21916
|
iconWrap: "p-1.5",
|
|
21890
21917
|
icon: "w-5 h-5",
|
|
21891
|
-
text:
|
|
21892
|
-
badge:
|
|
21918
|
+
text: formControlSizeStyles.lg.label,
|
|
21919
|
+
badge: formControlSizeStyles.lg.tag,
|
|
21893
21920
|
actionIcon: "w-5 h-5",
|
|
21894
21921
|
clearIcon: "h-4 w-4"
|
|
21895
21922
|
}
|
|
@@ -22011,6 +22038,7 @@ function CategoryTreeSelect(props) {
|
|
|
22011
22038
|
},
|
|
22012
22039
|
className: cn(
|
|
22013
22040
|
"group flex w-full items-center justify-between transition-all duration-200",
|
|
22041
|
+
formControlFixedClass,
|
|
22014
22042
|
getBorderRadiusClass(resolvedBorderMode ?? "full"),
|
|
22015
22043
|
"backdrop-blur-sm",
|
|
22016
22044
|
triggerSizeStyles[size].button,
|
|
@@ -22021,7 +22049,7 @@ function CategoryTreeSelect(props) {
|
|
|
22021
22049
|
effectiveError && "border-destructive focus-visible:ring-destructive/30"
|
|
22022
22050
|
),
|
|
22023
22051
|
children: [
|
|
22024
|
-
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 text-left", children: [
|
|
22052
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-2.5 overflow-hidden text-left", children: [
|
|
22025
22053
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
22026
22054
|
"div",
|
|
22027
22055
|
{
|
|
@@ -22037,7 +22065,8 @@ function CategoryTreeSelect(props) {
|
|
|
22037
22065
|
"span",
|
|
22038
22066
|
{
|
|
22039
22067
|
className: cn(
|
|
22040
|
-
|
|
22068
|
+
formControlValueClass,
|
|
22069
|
+
"font-medium transition-colors duration-200",
|
|
22041
22070
|
triggerSizeStyles[size].text,
|
|
22042
22071
|
selectedCount === 0 ? "text-muted-foreground" : "text-foreground"
|
|
22043
22072
|
),
|
|
@@ -22061,7 +22090,7 @@ function CategoryTreeSelect(props) {
|
|
|
22061
22090
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.X, { className: triggerSizeStyles[size].clearIcon })
|
|
22062
22091
|
}
|
|
22063
22092
|
),
|
|
22064
|
-
selectedCount > 0 && !singleSelect && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: cn("rounded-full bg-primary/15 font-bold text-primary", triggerSizeStyles[size].badge), children: selectedCount }),
|
|
22093
|
+
selectedCount > 0 && !singleSelect && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: cn("inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/15 font-bold text-primary", triggerSizeStyles[size].badge), children: selectedCount }),
|
|
22065
22094
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react29.ChevronDown, { className: triggerSizeStyles[size].actionIcon }) })
|
|
22066
22095
|
] })
|
|
22067
22096
|
]
|
|
@@ -24689,9 +24718,9 @@ function ColorPicker({
|
|
|
24689
24718
|
const alphaPct = Math.round(rgba.a * 100);
|
|
24690
24719
|
const harmony = showHarmony ? getColorHarmony(rgba) : null;
|
|
24691
24720
|
const sizeClasses2 = {
|
|
24692
|
-
sm:
|
|
24693
|
-
md:
|
|
24694
|
-
lg:
|
|
24721
|
+
sm: formControlSizeStyles.sm.control,
|
|
24722
|
+
md: formControlSizeStyles.md.control,
|
|
24723
|
+
lg: formControlSizeStyles.lg.control
|
|
24695
24724
|
};
|
|
24696
24725
|
const swatchSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "md";
|
|
24697
24726
|
const trigger = /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
@@ -24700,16 +24729,17 @@ function ColorPicker({
|
|
|
24700
24729
|
type: "button",
|
|
24701
24730
|
disabled,
|
|
24702
24731
|
className: cn(
|
|
24703
|
-
"w-full
|
|
24732
|
+
"w-full border border-input bg-background flex items-center justify-between",
|
|
24704
24733
|
getBorderRadiusClass(resolvedBorderMode),
|
|
24705
24734
|
sizeClasses2[size],
|
|
24735
|
+
formControlFixedClass,
|
|
24706
24736
|
"hover:border-accent-foreground/30 transition-colors",
|
|
24707
24737
|
disabled && "opacity-50 cursor-not-allowed",
|
|
24708
24738
|
triggerClassName
|
|
24709
24739
|
),
|
|
24710
24740
|
"aria-label": gi18n.openColorPicker ?? "Open color picker",
|
|
24711
24741
|
children: [
|
|
24712
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
24742
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 items-center gap-2 overflow-hidden", children: [
|
|
24713
24743
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
24714
24744
|
"span",
|
|
24715
24745
|
{
|
|
@@ -24717,9 +24747,9 @@ function ColorPicker({
|
|
|
24717
24747
|
style: { backgroundColor: withAlpha ? `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})` : hexForInput }
|
|
24718
24748
|
}
|
|
24719
24749
|
),
|
|
24720
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "font-mono text-muted-foreground", children: text })
|
|
24750
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: cn(formControlValueClass, "font-mono text-muted-foreground"), children: text })
|
|
24721
24751
|
] }),
|
|
24722
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react35.Pipette, { className: cn(size
|
|
24752
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react35.Pipette, { className: cn(formControlSizeStyles[size].icon, "shrink-0 text-muted-foreground") })
|
|
24723
24753
|
]
|
|
24724
24754
|
}
|
|
24725
24755
|
);
|
|
@@ -37611,7 +37641,7 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
37611
37641
|
posB -= size;
|
|
37612
37642
|
}
|
|
37613
37643
|
}
|
|
37614
|
-
var
|
|
37644
|
+
var Fragment31 = class _Fragment {
|
|
37615
37645
|
/**
|
|
37616
37646
|
@internal
|
|
37617
37647
|
*/
|
|
@@ -37903,7 +37933,7 @@ var Fragment32 = class _Fragment {
|
|
|
37903
37933
|
throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
37904
37934
|
}
|
|
37905
37935
|
};
|
|
37906
|
-
|
|
37936
|
+
Fragment31.empty = new Fragment31([], 0);
|
|
37907
37937
|
var found = { index: 0, offset: 0 };
|
|
37908
37938
|
function retIndex(index, offset) {
|
|
37909
37939
|
found.index = index;
|
|
@@ -38128,7 +38158,7 @@ var Slice = class _Slice {
|
|
|
38128
38158
|
let openStart = json.openStart || 0, openEnd = json.openEnd || 0;
|
|
38129
38159
|
if (typeof openStart != "number" || typeof openEnd != "number")
|
|
38130
38160
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
38131
|
-
return new _Slice(
|
|
38161
|
+
return new _Slice(Fragment31.fromJSON(schema, json.content), openStart, openEnd);
|
|
38132
38162
|
}
|
|
38133
38163
|
/**
|
|
38134
38164
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -38143,7 +38173,7 @@ var Slice = class _Slice {
|
|
|
38143
38173
|
return new _Slice(fragment, openStart, openEnd);
|
|
38144
38174
|
}
|
|
38145
38175
|
};
|
|
38146
|
-
Slice.empty = new Slice(
|
|
38176
|
+
Slice.empty = new Slice(Fragment31.empty, 0, 0);
|
|
38147
38177
|
function removeRange(content, from, to) {
|
|
38148
38178
|
let { index, offset } = content.findIndex(from), child = content.maybeChild(index);
|
|
38149
38179
|
let { index: indexTo, offset: offsetTo } = content.findIndex(to);
|
|
@@ -38241,7 +38271,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
|
38241
38271
|
addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
|
|
38242
38272
|
}
|
|
38243
38273
|
addRange($to, null, depth, content);
|
|
38244
|
-
return new
|
|
38274
|
+
return new Fragment31(content);
|
|
38245
38275
|
}
|
|
38246
38276
|
function replaceTwoWay($from, $to, depth) {
|
|
38247
38277
|
let content = [];
|
|
@@ -38251,13 +38281,13 @@ function replaceTwoWay($from, $to, depth) {
|
|
|
38251
38281
|
addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
|
|
38252
38282
|
}
|
|
38253
38283
|
addRange($to, null, depth, content);
|
|
38254
|
-
return new
|
|
38284
|
+
return new Fragment31(content);
|
|
38255
38285
|
}
|
|
38256
38286
|
function prepareSliceForReplace(slice, $along) {
|
|
38257
38287
|
let extra = $along.depth - slice.openStart, parent = $along.node(extra);
|
|
38258
38288
|
let node = parent.copy(slice.content);
|
|
38259
38289
|
for (let i = extra - 1; i >= 0; i--)
|
|
38260
|
-
node = $along.node(i).copy(
|
|
38290
|
+
node = $along.node(i).copy(Fragment31.from(node));
|
|
38261
38291
|
return {
|
|
38262
38292
|
start: node.resolveNoCache(slice.openStart + extra),
|
|
38263
38293
|
end: node.resolveNoCache(node.content.size - slice.openEnd - extra)
|
|
@@ -38596,7 +38626,7 @@ var Node7 = class _Node {
|
|
|
38596
38626
|
this.type = type;
|
|
38597
38627
|
this.attrs = attrs;
|
|
38598
38628
|
this.marks = marks;
|
|
38599
|
-
this.content = content ||
|
|
38629
|
+
this.content = content || Fragment31.empty;
|
|
38600
38630
|
}
|
|
38601
38631
|
/**
|
|
38602
38632
|
The array of this node's child nodes.
|
|
@@ -38901,7 +38931,7 @@ var Node7 = class _Node {
|
|
|
38901
38931
|
can optionally pass `start` and `end` indices into the
|
|
38902
38932
|
replacement fragment.
|
|
38903
38933
|
*/
|
|
38904
|
-
canReplace(from, to, replacement =
|
|
38934
|
+
canReplace(from, to, replacement = Fragment31.empty, start = 0, end = replacement.childCount) {
|
|
38905
38935
|
let one = this.contentMatchAt(from).matchFragment(replacement, start, end);
|
|
38906
38936
|
let two = one && one.matchFragment(this.content, to);
|
|
38907
38937
|
if (!two || !two.validEnd)
|
|
@@ -38983,7 +39013,7 @@ var Node7 = class _Node {
|
|
|
38983
39013
|
throw new RangeError("Invalid text node in JSON");
|
|
38984
39014
|
return schema.text(json.text, marks);
|
|
38985
39015
|
}
|
|
38986
|
-
let content =
|
|
39016
|
+
let content = Fragment31.fromJSON(schema, json.content);
|
|
38987
39017
|
let node = schema.nodeType(json.type).create(json.attrs, content, marks);
|
|
38988
39018
|
node.type.checkAttrs(node.attrs);
|
|
38989
39019
|
return node;
|
|
@@ -39079,7 +39109,7 @@ var ContentMatch = class _ContentMatch {
|
|
|
39079
39109
|
function search(match, types) {
|
|
39080
39110
|
let finished = match.matchFragment(after, startIndex);
|
|
39081
39111
|
if (finished && (!toEnd || finished.validEnd))
|
|
39082
|
-
return
|
|
39112
|
+
return Fragment31.from(types.map((tp) => tp.createAndFill()));
|
|
39083
39113
|
for (let i = 0; i < match.next.length; i++) {
|
|
39084
39114
|
let { type, next } = match.next[i];
|
|
39085
39115
|
if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
|
|
@@ -39647,7 +39677,7 @@ function mapFragment(fragment, f, parent) {
|
|
|
39647
39677
|
child = f(child, parent, i);
|
|
39648
39678
|
mapped.push(child);
|
|
39649
39679
|
}
|
|
39650
|
-
return
|
|
39680
|
+
return Fragment31.fromArray(mapped);
|
|
39651
39681
|
}
|
|
39652
39682
|
var AddMarkStep = class _AddMarkStep extends Step {
|
|
39653
39683
|
/**
|
|
@@ -39764,7 +39794,7 @@ var AddNodeMarkStep = class _AddNodeMarkStep extends Step {
|
|
|
39764
39794
|
if (!node)
|
|
39765
39795
|
return StepResult.fail("No node at mark step's position");
|
|
39766
39796
|
let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
|
|
39767
|
-
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(
|
|
39797
|
+
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment31.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
39768
39798
|
}
|
|
39769
39799
|
invert(doc) {
|
|
39770
39800
|
let node = doc.nodeAt(this.pos);
|
|
@@ -39810,7 +39840,7 @@ var RemoveNodeMarkStep = class _RemoveNodeMarkStep extends Step {
|
|
|
39810
39840
|
if (!node)
|
|
39811
39841
|
return StepResult.fail("No node at mark step's position");
|
|
39812
39842
|
let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
|
|
39813
|
-
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(
|
|
39843
|
+
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment31.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
39814
39844
|
}
|
|
39815
39845
|
invert(doc) {
|
|
39816
39846
|
let node = doc.nodeAt(this.pos);
|
|
@@ -40011,7 +40041,7 @@ var AttrStep = class _AttrStep extends Step {
|
|
|
40011
40041
|
attrs[name] = node.attrs[name];
|
|
40012
40042
|
attrs[this.attr] = this.value;
|
|
40013
40043
|
let updated = node.type.create(attrs, null, node.marks);
|
|
40014
|
-
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(
|
|
40044
|
+
return StepResult.fromReplace(doc, this.pos, this.pos + 1, new Slice(Fragment31.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
40015
40045
|
}
|
|
40016
40046
|
getMap() {
|
|
40017
40047
|
return StepMap.empty;
|
|
@@ -40395,7 +40425,7 @@ var NodeSelection2 = class _NodeSelection extends Selection {
|
|
|
40395
40425
|
return new _NodeSelection($pos);
|
|
40396
40426
|
}
|
|
40397
40427
|
content() {
|
|
40398
|
-
return new Slice(
|
|
40428
|
+
return new Slice(Fragment31.from(this.node), 0, 0);
|
|
40399
40429
|
}
|
|
40400
40430
|
eq(other) {
|
|
40401
40431
|
return other instanceof _NodeSelection && other.anchor == this.anchor;
|
|
@@ -41123,10 +41153,10 @@ var CellSelection = class CellSelection2 extends Selection {
|
|
|
41123
41153
|
}
|
|
41124
41154
|
rowContent.push(cell);
|
|
41125
41155
|
}
|
|
41126
|
-
rows.push(table.child(row).copy(
|
|
41156
|
+
rows.push(table.child(row).copy(Fragment31.from(rowContent)));
|
|
41127
41157
|
}
|
|
41128
41158
|
const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
41129
|
-
return new Slice(
|
|
41159
|
+
return new Slice(Fragment31.from(fragment), 1, 1);
|
|
41130
41160
|
}
|
|
41131
41161
|
replace(tr, content = Slice.empty) {
|
|
41132
41162
|
const mapFrom = tr.steps.length, ranges = this.ranges;
|
|
@@ -41138,7 +41168,7 @@ var CellSelection = class CellSelection2 extends Selection {
|
|
|
41138
41168
|
if (sel) tr.setSelection(sel);
|
|
41139
41169
|
}
|
|
41140
41170
|
replaceWith(tr, node) {
|
|
41141
|
-
this.replace(tr, new Slice(
|
|
41171
|
+
this.replace(tr, new Slice(Fragment31.from(node), 0, 0));
|
|
41142
41172
|
}
|
|
41143
41173
|
forEachCell(f) {
|
|
41144
41174
|
const table = this.$anchorCell.node(-1);
|