@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
@@ -3,7 +3,7 @@ export type BooleanSwitchProps = {
|
|
3
3
|
value: boolean | null;
|
4
4
|
className?: string;
|
5
5
|
disabled?: boolean;
|
6
|
-
size?: "
|
6
|
+
size?: "small" | "medium" | "large";
|
7
7
|
} & ({
|
8
8
|
allowIndeterminate: true;
|
9
9
|
onValueChange?: (newValue: boolean | null) => void;
|
@@ -8,7 +8,7 @@ export type ChipColorKey = keyof typeof CHIP_COLORS;
|
|
8
8
|
export interface ChipProps {
|
9
9
|
className?: string;
|
10
10
|
children: React.ReactNode;
|
11
|
-
size?: "
|
11
|
+
size?: "small" | "medium" | "large";
|
12
12
|
colorScheme?: ChipColorScheme | ChipColorKey;
|
13
13
|
error?: boolean;
|
14
14
|
outlined?: boolean;
|
@@ -18,6 +18,6 @@ export type FileUploadProps = {
|
|
18
18
|
title?: React.ReactNode;
|
19
19
|
uploadDescription?: React.ReactNode;
|
20
20
|
preventDropOnDocument?: boolean;
|
21
|
-
size?: "
|
21
|
+
size?: "medium" | "large";
|
22
22
|
};
|
23
23
|
export declare function FileUpload({ accept, onFilesAdded, onFilesRejected, maxSize, disabled, maxFiles, title, uploadDescription, children, preventDropOnDocument, size }: React.PropsWithChildren<FileUploadProps>): import("react/jsx-runtime").JSX.Element;
|
@@ -11,7 +11,7 @@ export type SelectProps = {
|
|
11
11
|
onValueChange?: (updatedValue: string) => void;
|
12
12
|
placeholder?: React.ReactNode;
|
13
13
|
renderValue?: (value: string) => React.ReactNode;
|
14
|
-
size?: "small" | "medium";
|
14
|
+
size?: "small" | "medium" | "large";
|
15
15
|
label?: React.ReactNode | string;
|
16
16
|
disabled?: boolean;
|
17
17
|
error?: boolean;
|
@@ -13,7 +13,7 @@ export type TextFieldProps<T extends string | number> = {
|
|
13
13
|
endAdornment?: React.ReactNode;
|
14
14
|
autoFocus?: boolean;
|
15
15
|
placeholder?: string;
|
16
|
-
size?: "
|
16
|
+
size?: "small" | "medium" | "large";
|
17
17
|
className?: string;
|
18
18
|
style?: React.CSSProperties;
|
19
19
|
inputClassName?: string;
|
package/dist/index.es.js
CHANGED
@@ -416,7 +416,7 @@ const BooleanSwitch = React__default.forwardRef(
|
|
416
416
|
className,
|
417
417
|
onValueChange,
|
418
418
|
disabled = false,
|
419
|
-
size = "
|
419
|
+
size = "medium",
|
420
420
|
...props
|
421
421
|
}, ref) {
|
422
422
|
return /* @__PURE__ */ jsxs(
|
@@ -436,7 +436,7 @@ const BooleanSwitch = React__default.forwardRef(
|
|
436
436
|
}
|
437
437
|
},
|
438
438
|
className: cls(
|
439
|
-
size === "
|
439
|
+
size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]",
|
440
440
|
"outline-none rounded-full relative shadow-sm",
|
441
441
|
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",
|
442
442
|
className
|
@@ -450,10 +450,10 @@ const BooleanSwitch = React__default.forwardRef(
|
|
450
450
|
"block rounded-full transition-transform duration-100 transform will-change-auto",
|
451
451
|
disabled ? "bg-surface-accent-400 dark:bg-surface-accent-600" : "bg-surface-accent-400 dark:bg-surface-accent-600",
|
452
452
|
{
|
453
|
-
"w-[21px] h-[10px]": size === "
|
454
|
-
"w-[19px] h-[8px]": size === "
|
455
|
-
"translate-x-[10px]": size === "
|
456
|
-
"translate-x-[9px]": size === "
|
453
|
+
"w-[21px] h-[10px]": size === "medium" || size === "large",
|
454
|
+
"w-[19px] h-[8px]": size === "small",
|
455
|
+
"translate-x-[10px]": size === "medium" || size === "large",
|
456
|
+
"translate-x-[9px]": size === "small"
|
457
457
|
}
|
458
458
|
)
|
459
459
|
},
|
@@ -466,10 +466,10 @@ const BooleanSwitch = React__default.forwardRef(
|
|
466
466
|
"block rounded-full transition-transform duration-100 transform will-change-auto",
|
467
467
|
disabled ? "bg-surface-accent-300 dark:bg-surface-accent-700" : value ? "bg-white" : "bg-surface-accent-600 dark:bg-surface-accent-400",
|
468
468
|
{
|
469
|
-
"w-[21px] h-[21px]": size === "
|
470
|
-
"w-[19px] h-[19px]": size === "
|
471
|
-
[value ? "translate-x-[19px]" : "translate-x-[3px]"]: size === "
|
472
|
-
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "
|
469
|
+
"w-[21px] h-[21px]": size === "medium" || size === "large",
|
470
|
+
"w-[19px] h-[19px]": size === "small",
|
471
|
+
[value ? "translate-x-[19px]" : "translate-x-[3px]"]: size === "medium" || size === "large",
|
472
|
+
[value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small"
|
473
473
|
}
|
474
474
|
)
|
475
475
|
},
|
@@ -517,9 +517,9 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
|
|
517
517
|
"rounded-md max-w-full justify-between box-border relative inline-flex items-center",
|
518
518
|
!invisible && focus && !disabled ? focusedClasses : "",
|
519
519
|
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",
|
520
|
-
size === "
|
521
|
-
size === "
|
522
|
-
size === "
|
520
|
+
size === "small" ? "min-h-[40px]" : size === "medium" ? "min-h-[48px]" : "min-h-[64px]",
|
521
|
+
size === "small" ? "pl-2" : "pl-4",
|
522
|
+
size === "small" ? "pr-4" : "pr-6",
|
523
523
|
position === "end" ? "flex-row-reverse" : "flex-row",
|
524
524
|
fullWidth ? "w-full" : "",
|
525
525
|
className
|
@@ -548,7 +548,7 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
|
|
548
548
|
/* @__PURE__ */ jsx("div", { className: cls(
|
549
549
|
"flex-grow",
|
550
550
|
position === "end" ? "mr-4" : "ml-4",
|
551
|
-
size === "
|
551
|
+
size === "small" ? "text-sm" : "text-base"
|
552
552
|
), children: label })
|
553
553
|
]
|
554
554
|
}
|
@@ -13622,9 +13622,9 @@ const Checkbox = ({
|
|
13622
13622
|
);
|
13623
13623
|
};
|
13624
13624
|
const sizeClassNames = {
|
13625
|
-
|
13626
|
-
|
13627
|
-
|
13625
|
+
small: "px-2 py-0.5 text-sm",
|
13626
|
+
medium: "px-3 py-1 text-sm",
|
13627
|
+
large: "px-4 py-1.5 text-sm"
|
13628
13628
|
};
|
13629
13629
|
function Chip({
|
13630
13630
|
children,
|
@@ -13633,7 +13633,7 @@ function Chip({
|
|
13633
13633
|
outlined,
|
13634
13634
|
onClick,
|
13635
13635
|
icon,
|
13636
|
-
size = "
|
13636
|
+
size = "large",
|
13637
13637
|
className,
|
13638
13638
|
style
|
13639
13639
|
}) {
|
@@ -13848,7 +13848,7 @@ const DateTimeField = ({
|
|
13848
13848
|
clearable,
|
13849
13849
|
mode = "date",
|
13850
13850
|
error,
|
13851
|
-
size = "
|
13851
|
+
size = "large",
|
13852
13852
|
className,
|
13853
13853
|
style,
|
13854
13854
|
inputClassName,
|
@@ -13912,8 +13912,8 @@ const DateTimeField = ({
|
|
13912
13912
|
!invisible && fieldBackgroundMixin,
|
13913
13913
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
13914
13914
|
{
|
13915
|
-
"min-h-[48px]": size === "
|
13916
|
-
"min-h-[64px]": size === "
|
13915
|
+
"min-h-[48px]": size === "medium",
|
13916
|
+
"min-h-[64px]": size === "large"
|
13917
13917
|
},
|
13918
13918
|
className
|
13919
13919
|
),
|
@@ -13950,7 +13950,7 @@ const DateTimeField = ({
|
|
13950
13950
|
"w-full outline-none bg-transparent leading-normal text-base px-3",
|
13951
13951
|
clearable ? "pr-14" : "pr-12",
|
13952
13952
|
"rounded-md",
|
13953
|
-
size === "
|
13953
|
+
size === "medium" ? "min-h-[48px]" : "min-h-[64px]",
|
13954
13954
|
label ? "pt-8 pb-2" : "py-2",
|
13955
13955
|
inputClassName,
|
13956
13956
|
disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-surface-accent-600 dark:text-surface-accent-500"
|
@@ -13980,9 +13980,9 @@ const DateTimeField = ({
|
|
13980
13980
|
}
|
13981
13981
|
),
|
13982
13982
|
invalidValue && /* @__PURE__ */ jsxs("div", { className: "flex items-center m-2", children: [
|
13983
|
-
/* @__PURE__ */ jsx(ErrorIcon, { size: "
|
13983
|
+
/* @__PURE__ */ jsx(ErrorIcon, { size: "medium", color: "error" }),
|
13984
13984
|
/* @__PURE__ */ jsxs("div", { className: "pl-2", children: [
|
13985
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-
|
13985
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-large", children: "Invalid date value for this field" }),
|
13986
13986
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", children: `The provided value is: ${JSON.stringify(value)}` })
|
13987
13987
|
] })
|
13988
13988
|
] })
|
@@ -14300,8 +14300,8 @@ function FileUpload({
|
|
14300
14300
|
"flex gap-2",
|
14301
14301
|
"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",
|
14302
14302
|
{
|
14303
|
-
"h-44": size === "
|
14304
|
-
"h-28": size === "
|
14303
|
+
"h-44": size === "large",
|
14304
|
+
"h-28": size === "medium",
|
14305
14305
|
"cursor-pointer": !disabled,
|
14306
14306
|
[fieldBackgroundHoverMixin]: !isDragActive,
|
14307
14307
|
"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-red-500": isDragReject,
|
@@ -14895,7 +14895,7 @@ const MultiSelect = React.forwardRef(
|
|
14895
14895
|
return /* @__PURE__ */ jsxs(
|
14896
14896
|
Chip,
|
14897
14897
|
{
|
14898
|
-
size: "
|
14898
|
+
size: "medium",
|
14899
14899
|
className: cls("flex flex-row items-center p-1"),
|
14900
14900
|
children: [
|
14901
14901
|
option?.children,
|
@@ -14976,8 +14976,8 @@ const MultiSelect = React.forwardRef(
|
|
14976
14976
|
/* @__PURE__ */ jsx(Separator, { orientation: "horizontal", className: "my-0" }),
|
14977
14977
|
/* @__PURE__ */ jsxs(Command.List, { children: [
|
14978
14978
|
/* @__PURE__ */ jsx(Command.Empty, { className: "px-4 py-2", children: "No results found." }),
|
14979
|
-
|
14980
|
-
/* @__PURE__ */ jsxs(
|
14979
|
+
/* @__PURE__ */ jsxs(Command.Group, { children: [
|
14980
|
+
includeSelectAll && /* @__PURE__ */ jsxs(
|
14981
14981
|
Command.Item,
|
14982
14982
|
{
|
14983
14983
|
onSelect: toggleAll,
|
@@ -15216,7 +15216,7 @@ const Select = forwardRef(({
|
|
15216
15216
|
placeholder,
|
15217
15217
|
renderValue,
|
15218
15218
|
label,
|
15219
|
-
size = "
|
15219
|
+
size = "large",
|
15220
15220
|
error,
|
15221
15221
|
disabled,
|
15222
15222
|
padding = true,
|
@@ -15259,12 +15259,16 @@ const Select = forwardRef(({
|
|
15259
15259
|
children: [
|
15260
15260
|
typeof label === "string" ? /* @__PURE__ */ jsx(SelectInputLabel, { error, children: label }) : label,
|
15261
15261
|
/* @__PURE__ */ jsx("div", { className: cls(
|
15262
|
-
size === "small" ? "min-h-[42px]" : "min-h-[64px]",
|
15263
15262
|
"select-none rounded-md text-sm",
|
15264
15263
|
invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin,
|
15265
15264
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
15266
15265
|
"relative flex items-center",
|
15267
|
-
className
|
15266
|
+
className,
|
15267
|
+
{
|
15268
|
+
"min-h-[28px]": size === "small",
|
15269
|
+
"min-h-[42px]": size === "medium",
|
15270
|
+
"min-h-[64px]": size === "large"
|
15271
|
+
}
|
15268
15272
|
), children: /* @__PURE__ */ jsxs(
|
15269
15273
|
SelectPrimitive.Trigger,
|
15270
15274
|
{
|
@@ -15272,14 +15276,22 @@ const Select = forwardRef(({
|
|
15272
15276
|
id,
|
15273
15277
|
className: cls(
|
15274
15278
|
"w-full h-full",
|
15275
|
-
|
15276
|
-
|
15279
|
+
padding ? {
|
15280
|
+
"px-4": size === "large",
|
15281
|
+
"px-3": size === "medium",
|
15282
|
+
"px-2": size === "small"
|
15283
|
+
} : "",
|
15277
15284
|
"outline-none focus:outline-none",
|
15278
15285
|
"select-none rounded-md text-sm",
|
15279
15286
|
error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark",
|
15280
15287
|
error ? "border border-red-500 dark:border-red-600" : "",
|
15281
15288
|
disabled ? "text-surface-accent-600 dark:text-surface-accent-400" : "text-surface-accent-800 dark:text-white",
|
15282
15289
|
"relative flex flex-row items-center",
|
15290
|
+
{
|
15291
|
+
"min-h-[28px]": size === "small",
|
15292
|
+
"min-h-[42px]": size === "medium",
|
15293
|
+
"min-h-[64px]": size === "large"
|
15294
|
+
},
|
15283
15295
|
inputClassName
|
15284
15296
|
),
|
15285
15297
|
children: [
|
@@ -15290,7 +15302,11 @@ const Select = forwardRef(({
|
|
15290
15302
|
className: cls(
|
15291
15303
|
"flex-grow w-full max-w-full flex flex-row gap-2 items-center",
|
15292
15304
|
"overflow-visible",
|
15293
|
-
|
15305
|
+
{
|
15306
|
+
"min-h-[28px]": size === "small",
|
15307
|
+
"min-h-[42px]": size === "medium",
|
15308
|
+
"min-h-[64px]": size === "large"
|
15309
|
+
}
|
15294
15310
|
),
|
15295
15311
|
children: /* @__PURE__ */ jsxs(
|
15296
15312
|
SelectPrimitive.Value,
|
@@ -15303,7 +15319,15 @@ const Select = forwardRef(({
|
|
15303
15319
|
className: "w-full",
|
15304
15320
|
children: [
|
15305
15321
|
hasValue && value && renderValue ? renderValue(value) : placeholder,
|
15306
|
-
hasValue && !renderValue &&
|
15322
|
+
hasValue && !renderValue && (() => {
|
15323
|
+
const childrenProps = Children.map(children, (child) => {
|
15324
|
+
if (React__default.isValidElement(child)) {
|
15325
|
+
return child.props;
|
15326
|
+
}
|
15327
|
+
}).filter(Boolean);
|
15328
|
+
const option = childrenProps.find((o) => o.value === value);
|
15329
|
+
return option?.children;
|
15330
|
+
})()
|
15307
15331
|
]
|
15308
15332
|
}
|
15309
15333
|
)
|
@@ -15323,8 +15347,11 @@ const Select = forwardRef(({
|
|
15323
15347
|
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(
|
15324
15348
|
ExpandMoreIcon,
|
15325
15349
|
{
|
15326
|
-
size: "
|
15327
|
-
className: cls("
|
15350
|
+
size: "medium",
|
15351
|
+
className: cls("transition", open ? "rotate-180" : "", {
|
15352
|
+
"px-2": size === "large",
|
15353
|
+
"px-1": size === "medium" || size === "small"
|
15354
|
+
})
|
15328
15355
|
}
|
15329
15356
|
) })
|
15330
15357
|
]
|
@@ -15817,7 +15844,7 @@ function TextField({
|
|
15817
15844
|
endAdornment,
|
15818
15845
|
autoFocus,
|
15819
15846
|
placeholder,
|
15820
|
-
size = "
|
15847
|
+
size = "large",
|
15821
15848
|
className,
|
15822
15849
|
style,
|
15823
15850
|
inputClassName,
|
@@ -15872,8 +15899,8 @@ function TextField({
|
|
15872
15899
|
"rounded-md",
|
15873
15900
|
invisible ? focusedInvisibleMixin : "",
|
15874
15901
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
15875
|
-
size === "
|
15876
|
-
label ? size === "
|
15902
|
+
size === "small" ? "min-h-[32px]" : size === "medium" ? "min-h-[48px]" : "min-h-[64px]",
|
15903
|
+
label ? size === "large" ? "pt-8 pb-2" : "pt-4 pb-2" : "py-2",
|
15877
15904
|
focused ? "text-text-primary dark:text-text-primary-dark" : "",
|
15878
15905
|
endAdornment ? "pr-10" : "pr-3",
|
15879
15906
|
disabled && "border border-transparent outline-none opacity-50 dark:opacity-50 text-surface-accent-800 dark:text-white",
|
@@ -15897,9 +15924,9 @@ function TextField({
|
|
15897
15924
|
disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
|
15898
15925
|
error ? "border border-red-500 dark:border-red-600" : "",
|
15899
15926
|
{
|
15900
|
-
"min-h-[32px]": !invisible && size === "
|
15901
|
-
"min-h-[48px]": !invisible && size === "
|
15902
|
-
"min-h-[64px]": !invisible && size === "
|
15927
|
+
"min-h-[32px]": !invisible && size === "small",
|
15928
|
+
"min-h-[48px]": !invisible && size === "medium",
|
15929
|
+
"min-h-[64px]": !invisible && size === "large"
|
15903
15930
|
},
|
15904
15931
|
className
|
15905
15932
|
),
|
@@ -15910,7 +15937,7 @@ function TextField({
|
|
15910
15937
|
{
|
15911
15938
|
className: cls(
|
15912
15939
|
"pointer-events-none absolute",
|
15913
|
-
size === "
|
15940
|
+
size === "large" ? "top-1" : "-top-1",
|
15914
15941
|
!error ? focused ? "text-primary dark:text-primary" : "text-text-secondary dark:text-text-secondary-dark" : "text-red-500 dark:text-red-600",
|
15915
15942
|
disabled ? "opacity-50" : ""
|
15916
15943
|
),
|
@@ -15922,7 +15949,11 @@ function TextField({
|
|
15922
15949
|
endAdornment && /* @__PURE__ */ jsx(
|
15923
15950
|
"div",
|
15924
15951
|
{
|
15925
|
-
className: "flex flex-row justify-center items-center absolute h-full right-0 top-0
|
15952
|
+
className: cls("flex flex-row justify-center items-center absolute h-full right-0 top-0", {
|
15953
|
+
"mr-4": size === "large",
|
15954
|
+
"mr-3": size === "medium",
|
15955
|
+
"mr-2": size === "small"
|
15956
|
+
}),
|
15926
15957
|
children: endAdornment
|
15927
15958
|
}
|
15928
15959
|
)
|