@firecms/ui 3.0.0-canary.150 → 3.0.0-canary.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BooleanSwitch.d.ts +1 -1
- package/dist/components/Chip.d.ts +1 -1
- package/dist/components/DateTimeField.d.ts +1 -1
- package/dist/components/FileUpload.d.ts +1 -1
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/TextField.d.ts +1 -1
- package/dist/index.es.js +77 -46
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +77 -46
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/BooleanSwitch.tsx +11 -11
- package/src/components/BooleanSwitchWithLabel.tsx +4 -4
- package/src/components/Chip.tsx +5 -5
- package/src/components/DateTimeField.tsx +7 -7
- package/src/components/FileUpload.tsx +3 -3
- package/src/components/MultiSelect.tsx +5 -5
- package/src/components/Select.tsx +43 -11
- package/src/components/TextField.tsx +13 -9
package/dist/index.umd.js
CHANGED
@@ -427,7 +427,7 @@
|
|
427
427
|
className,
|
428
428
|
onValueChange,
|
429
429
|
disabled = false,
|
430
|
-
size = "
|
430
|
+
size = "medium",
|
431
431
|
...props
|
432
432
|
}, ref) {
|
433
433
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
@@ -447,7 +447,7 @@
|
|
447
447
|
}
|
448
448
|
},
|
449
449
|
className: cls(
|
450
|
-
size === "
|
450
|
+
size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]",
|
451
451
|
"outline-none rounded-full relative shadow-sm",
|
452
452
|
value ? disabled ? "bg-white bg-opacity-54 dark:bg-surface-accent-950 border-surface-accent-100 dark:border-surface-accent-700 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700" : "ring-secondary ring-1 bg-secondary dark:bg-secondary" : "bg-white bg-opacity-54 dark:bg-surface-accent-900 ring-1 ring-surface-accent-200 dark:ring-surface-accent-700",
|
453
453
|
className
|
@@ -461,10 +461,10 @@
|
|
461
461
|
"block rounded-full transition-transform duration-100 transform will-change-auto",
|
462
462
|
disabled ? "bg-surface-accent-400 dark:bg-surface-accent-600" : "bg-surface-accent-400 dark:bg-surface-accent-600",
|
463
463
|
{
|
464
|
-
"w-[21px] h-[10px]": size === "
|
465
|
-
"w-[19px] h-[8px]": size === "
|
466
|
-
"translate-x-[10px]": size === "
|
467
|
-
"translate-x-[9px]": size === "
|
464
|
+
"w-[21px] h-[10px]": size === "medium" || size === "large",
|
465
|
+
"w-[19px] h-[8px]": size === "small",
|
466
|
+
"translate-x-[10px]": size === "medium" || size === "large",
|
467
|
+
"translate-x-[9px]": size === "small"
|
468
468
|
}
|
469
469
|
)
|
470
470
|
},
|
@@ -477,10 +477,10 @@
|
|
477
477
|
"block rounded-full transition-transform duration-100 transform will-change-auto",
|
478
478
|
disabled ? "bg-surface-accent-300 dark:bg-surface-accent-700" : value ? "bg-white" : "bg-surface-accent-600 dark:bg-surface-accent-400",
|
479
479
|
{
|
480
|
-
"w-[21px] h-[21px]": size === "
|
481
|
-
"w-[19px] h-[19px]": size === "
|
482
|
-
[value ? "translate-x-[19px]" : "translate-x-[3px]"]: size === "
|
483
|
-
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "
|
480
|
+
"w-[21px] h-[21px]": size === "medium" || size === "large",
|
481
|
+
"w-[19px] h-[19px]": size === "small",
|
482
|
+
[value ? "translate-x-[19px]" : "translate-x-[3px]"]: size === "medium" || size === "large",
|
483
|
+
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small"
|
484
484
|
}
|
485
485
|
)
|
486
486
|
},
|
@@ -528,9 +528,9 @@
|
|
528
528
|
"rounded-md max-w-full justify-between box-border relative inline-flex items-center",
|
529
529
|
!invisible && focus && !disabled ? focusedClasses : "",
|
530
530
|
error ? "text-red-500 dark:text-red-600" : focus && !disabled ? "text-primary" : !disabled ? "text-text-primary dark:text-text-primary-dark" : "text-text-secondary dark:text-text-secondary-dark",
|
531
|
-
size === "
|
532
|
-
size === "
|
533
|
-
size === "
|
531
|
+
size === "small" ? "min-h-[40px]" : size === "medium" ? "min-h-[48px]" : "min-h-[64px]",
|
532
|
+
size === "small" ? "pl-2" : "pl-4",
|
533
|
+
size === "small" ? "pr-4" : "pr-6",
|
534
534
|
position === "end" ? "flex-row-reverse" : "flex-row",
|
535
535
|
fullWidth ? "w-full" : "",
|
536
536
|
className
|
@@ -559,7 +559,7 @@
|
|
559
559
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls(
|
560
560
|
"flex-grow",
|
561
561
|
position === "end" ? "mr-4" : "ml-4",
|
562
|
-
size === "
|
562
|
+
size === "small" ? "text-sm" : "text-base"
|
563
563
|
), children: label })
|
564
564
|
]
|
565
565
|
}
|
@@ -13633,9 +13633,9 @@
|
|
13633
13633
|
);
|
13634
13634
|
};
|
13635
13635
|
const sizeClassNames = {
|
13636
|
-
|
13637
|
-
|
13638
|
-
|
13636
|
+
small: "px-2 py-0.5 text-sm",
|
13637
|
+
medium: "px-3 py-1 text-sm",
|
13638
|
+
large: "px-4 py-1.5 text-sm"
|
13639
13639
|
};
|
13640
13640
|
function Chip({
|
13641
13641
|
children,
|
@@ -13644,7 +13644,7 @@
|
|
13644
13644
|
outlined,
|
13645
13645
|
onClick,
|
13646
13646
|
icon,
|
13647
|
-
size = "
|
13647
|
+
size = "large",
|
13648
13648
|
className,
|
13649
13649
|
style
|
13650
13650
|
}) {
|
@@ -13859,7 +13859,7 @@
|
|
13859
13859
|
clearable,
|
13860
13860
|
mode = "date",
|
13861
13861
|
error,
|
13862
|
-
size = "
|
13862
|
+
size = "large",
|
13863
13863
|
className,
|
13864
13864
|
style,
|
13865
13865
|
inputClassName,
|
@@ -13923,8 +13923,8 @@
|
|
13923
13923
|
!invisible && fieldBackgroundMixin,
|
13924
13924
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
13925
13925
|
{
|
13926
|
-
"min-h-[48px]": size === "
|
13927
|
-
"min-h-[64px]": size === "
|
13926
|
+
"min-h-[48px]": size === "medium",
|
13927
|
+
"min-h-[64px]": size === "large"
|
13928
13928
|
},
|
13929
13929
|
className
|
13930
13930
|
),
|
@@ -13961,7 +13961,7 @@
|
|
13961
13961
|
"w-full outline-none bg-transparent leading-normal text-base px-3",
|
13962
13962
|
clearable ? "pr-14" : "pr-12",
|
13963
13963
|
"rounded-md",
|
13964
|
-
size === "
|
13964
|
+
size === "medium" ? "min-h-[48px]" : "min-h-[64px]",
|
13965
13965
|
label ? "pt-8 pb-2" : "py-2",
|
13966
13966
|
inputClassName,
|
13967
13967
|
disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-surface-accent-600 dark:text-surface-accent-500"
|
@@ -13991,9 +13991,9 @@
|
|
13991
13991
|
}
|
13992
13992
|
),
|
13993
13993
|
invalidValue && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center m-2", children: [
|
13994
|
-
/* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, { size: "
|
13994
|
+
/* @__PURE__ */ jsxRuntime.jsx(ErrorIcon, { size: "medium", color: "error" }),
|
13995
13995
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pl-2", children: [
|
13996
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", className: "font-
|
13996
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", className: "font-large", children: "Invalid date value for this field" }),
|
13997
13997
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", children: `The provided value is: ${JSON.stringify(value)}` })
|
13998
13998
|
] })
|
13999
13999
|
] })
|
@@ -14311,8 +14311,8 @@
|
|
14311
14311
|
"flex gap-2",
|
14312
14312
|
"p-4 box-border relative items-center border-2 border-solid border-transparent outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid",
|
14313
14313
|
{
|
14314
|
-
"h-44": size === "
|
14315
|
-
"h-28": size === "
|
14314
|
+
"h-44": size === "large",
|
14315
|
+
"h-28": size === "medium",
|
14316
14316
|
"cursor-pointer": !disabled,
|
14317
14317
|
[fieldBackgroundHoverMixin]: !isDragActive,
|
14318
14318
|
"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-red-500": isDragReject,
|
@@ -14906,7 +14906,7 @@
|
|
14906
14906
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
14907
14907
|
Chip,
|
14908
14908
|
{
|
14909
|
-
size: "
|
14909
|
+
size: "medium",
|
14910
14910
|
className: cls("flex flex-row items-center p-1"),
|
14911
14911
|
children: [
|
14912
14912
|
option?.children,
|
@@ -14987,8 +14987,8 @@
|
|
14987
14987
|
/* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "horizontal", className: "my-0" }),
|
14988
14988
|
/* @__PURE__ */ jsxRuntime.jsxs(cmdk.Command.List, { children: [
|
14989
14989
|
/* @__PURE__ */ jsxRuntime.jsx(cmdk.Command.Empty, { className: "px-4 py-2", children: "No results found." }),
|
14990
|
-
|
14991
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
14990
|
+
/* @__PURE__ */ jsxRuntime.jsxs(cmdk.Command.Group, { children: [
|
14991
|
+
includeSelectAll && /* @__PURE__ */ jsxRuntime.jsxs(
|
14992
14992
|
cmdk.Command.Item,
|
14993
14993
|
{
|
14994
14994
|
onSelect: toggleAll,
|
@@ -15227,7 +15227,7 @@
|
|
15227
15227
|
placeholder,
|
15228
15228
|
renderValue,
|
15229
15229
|
label,
|
15230
|
-
size = "
|
15230
|
+
size = "large",
|
15231
15231
|
error,
|
15232
15232
|
disabled,
|
15233
15233
|
padding = true,
|
@@ -15270,12 +15270,16 @@
|
|
15270
15270
|
children: [
|
15271
15271
|
typeof label === "string" ? /* @__PURE__ */ jsxRuntime.jsx(SelectInputLabel, { error, children: label }) : label,
|
15272
15272
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cls(
|
15273
|
-
size === "small" ? "min-h-[42px]" : "min-h-[64px]",
|
15274
15273
|
"select-none rounded-md text-sm",
|
15275
15274
|
invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin,
|
15276
15275
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
15277
15276
|
"relative flex items-center",
|
15278
|
-
className
|
15277
|
+
className,
|
15278
|
+
{
|
15279
|
+
"min-h-[28px]": size === "small",
|
15280
|
+
"min-h-[42px]": size === "medium",
|
15281
|
+
"min-h-[64px]": size === "large"
|
15282
|
+
}
|
15279
15283
|
), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
15280
15284
|
SelectPrimitive__namespace.Trigger,
|
15281
15285
|
{
|
@@ -15283,14 +15287,22 @@
|
|
15283
15287
|
id,
|
15284
15288
|
className: cls(
|
15285
15289
|
"w-full h-full",
|
15286
|
-
|
15287
|
-
|
15290
|
+
padding ? {
|
15291
|
+
"px-4": size === "large",
|
15292
|
+
"px-3": size === "medium",
|
15293
|
+
"px-2": size === "small"
|
15294
|
+
} : "",
|
15288
15295
|
"outline-none focus:outline-none",
|
15289
15296
|
"select-none rounded-md text-sm",
|
15290
15297
|
error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark",
|
15291
15298
|
error ? "border border-red-500 dark:border-red-600" : "",
|
15292
15299
|
disabled ? "text-surface-accent-600 dark:text-surface-accent-400" : "text-surface-accent-800 dark:text-white",
|
15293
15300
|
"relative flex flex-row items-center",
|
15301
|
+
{
|
15302
|
+
"min-h-[28px]": size === "small",
|
15303
|
+
"min-h-[42px]": size === "medium",
|
15304
|
+
"min-h-[64px]": size === "large"
|
15305
|
+
},
|
15294
15306
|
inputClassName
|
15295
15307
|
),
|
15296
15308
|
children: [
|
@@ -15301,7 +15313,11 @@
|
|
15301
15313
|
className: cls(
|
15302
15314
|
"flex-grow w-full max-w-full flex flex-row gap-2 items-center",
|
15303
15315
|
"overflow-visible",
|
15304
|
-
|
15316
|
+
{
|
15317
|
+
"min-h-[28px]": size === "small",
|
15318
|
+
"min-h-[42px]": size === "medium",
|
15319
|
+
"min-h-[64px]": size === "large"
|
15320
|
+
}
|
15305
15321
|
),
|
15306
15322
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
15307
15323
|
SelectPrimitive__namespace.Value,
|
@@ -15314,7 +15330,15 @@
|
|
15314
15330
|
className: "w-full",
|
15315
15331
|
children: [
|
15316
15332
|
hasValue && value && renderValue ? renderValue(value) : placeholder,
|
15317
|
-
hasValue && !renderValue &&
|
15333
|
+
hasValue && !renderValue && (() => {
|
15334
|
+
const childrenProps = React.Children.map(children, (child) => {
|
15335
|
+
if (React.isValidElement(child)) {
|
15336
|
+
return child.props;
|
15337
|
+
}
|
15338
|
+
}).filter(Boolean);
|
15339
|
+
const option = childrenProps.find((o) => o.value === value);
|
15340
|
+
return option?.children;
|
15341
|
+
})()
|
15318
15342
|
]
|
15319
15343
|
}
|
15320
15344
|
)
|
@@ -15334,8 +15358,11 @@
|
|
15334
15358
|
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
15335
15359
|
ExpandMoreIcon,
|
15336
15360
|
{
|
15337
|
-
size: "
|
15338
|
-
className: cls("
|
15361
|
+
size: "medium",
|
15362
|
+
className: cls("transition", open ? "rotate-180" : "", {
|
15363
|
+
"px-2": size === "large",
|
15364
|
+
"px-1": size === "medium" || size === "small"
|
15365
|
+
})
|
15339
15366
|
}
|
15340
15367
|
) })
|
15341
15368
|
]
|
@@ -15828,7 +15855,7 @@
|
|
15828
15855
|
endAdornment,
|
15829
15856
|
autoFocus,
|
15830
15857
|
placeholder,
|
15831
|
-
size = "
|
15858
|
+
size = "large",
|
15832
15859
|
className,
|
15833
15860
|
style,
|
15834
15861
|
inputClassName,
|
@@ -15883,8 +15910,8 @@
|
|
15883
15910
|
"rounded-md",
|
15884
15911
|
invisible ? focusedInvisibleMixin : "",
|
15885
15912
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
15886
|
-
size === "
|
15887
|
-
label ? size === "
|
15913
|
+
size === "small" ? "min-h-[32px]" : size === "medium" ? "min-h-[48px]" : "min-h-[64px]",
|
15914
|
+
label ? size === "large" ? "pt-8 pb-2" : "pt-4 pb-2" : "py-2",
|
15888
15915
|
focused ? "text-text-primary dark:text-text-primary-dark" : "",
|
15889
15916
|
endAdornment ? "pr-10" : "pr-3",
|
15890
15917
|
disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-surface-accent-800 dark:text-white",
|
@@ -15908,9 +15935,9 @@
|
|
15908
15935
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
15909
15936
|
error ? "border border-red-500 dark:border-red-600" : "",
|
15910
15937
|
{
|
15911
|
-
"min-h-[32px]": !invisible && size === "
|
15912
|
-
"min-h-[48px]": !invisible && size === "
|
15913
|
-
"min-h-[64px]": !invisible && size === "
|
15938
|
+
"min-h-[32px]": !invisible && size === "small",
|
15939
|
+
"min-h-[48px]": !invisible && size === "medium",
|
15940
|
+
"min-h-[64px]": !invisible && size === "large"
|
15914
15941
|
},
|
15915
15942
|
className
|
15916
15943
|
),
|
@@ -15921,7 +15948,7 @@
|
|
15921
15948
|
{
|
15922
15949
|
className: cls(
|
15923
15950
|
"pointer-events-none absolute",
|
15924
|
-
size === "
|
15951
|
+
size === "large" ? "top-1" : "-top-1",
|
15925
15952
|
!error ? focused ? "text-primary dark:text-primary" : "text-text-secondary dark:text-text-secondary-dark" : "text-red-500 dark:text-red-600",
|
15926
15953
|
disabled ? "opacity-50" : ""
|
15927
15954
|
),
|
@@ -15933,7 +15960,11 @@
|
|
15933
15960
|
endAdornment && /* @__PURE__ */ jsxRuntime.jsx(
|
15934
15961
|
"div",
|
15935
15962
|
{
|
15936
|
-
className: "flex flex-row justify-center items-center absolute h-full right-0 top-0
|
15963
|
+
className: cls("flex flex-row justify-center items-center absolute h-full right-0 top-0", {
|
15964
|
+
"mr-4": size === "large",
|
15965
|
+
"mr-3": size === "medium",
|
15966
|
+
"mr-2": size === "small"
|
15967
|
+
}),
|
15937
15968
|
children: endAdornment
|
15938
15969
|
}
|
15939
15970
|
)
|