@firecms/ui 3.0.0-canary.107 → 3.0.0-canary.109
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/Menu.d.ts +2 -1
- package/dist/components/Select.d.ts +3 -3
- package/dist/components/Tooltip.d.ts +3 -2
- package/dist/index.css +56 -0
- package/dist/index.es.js +96 -89
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +95 -88
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +1 -1
- package/package.json +108 -106
- package/src/components/Chip.tsx +1 -1
- package/src/components/InputLabel.tsx +4 -2
- package/src/components/Menu.tsx +30 -24
- package/src/components/Select.tsx +79 -90
- package/src/components/TextField.tsx +1 -1
- package/src/components/Tooltip.tsx +17 -9
- package/src/components/Typography.tsx +14 -14
- package/src/index.css +56 -0
- package/src/styles.ts +1 -1
package/dist/index.umd.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(function(global, factory) {
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react"), require("@radix-ui/react-collapsible"), require("clsx"), require("tailwind-merge"), require("date-fns/locale"), require("react-datepicker"), require("@radix-ui/react-checkbox"), require("material-icons/iconfont/filled.css"), require("@radix-ui/react-
|
3
|
-
})(this, function(exports2, jsxRuntime, React, Collapsible, clsx, tailwindMerge, locales, DatePicker, CheckboxPrimitive, filled_css,
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react"), require("@radix-ui/react-collapsible"), require("clsx"), require("tailwind-merge"), require("date-fns/locale"), require("react-datepicker"), require("@radix-ui/react-checkbox"), require("material-icons/iconfont/filled.css"), require("@radix-ui/react-dialog"), require("react-dropzone"), require("@radix-ui/react-label"), require("react-fast-compare"), require("markdown-it"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-menubar"), require("cmdk"), require("@radix-ui/react-radio-group"), require("@radix-ui/react-select"), require("@radix-ui/react-separator"), require("react-dom"), require("@radix-ui/react-tooltip"), require("@radix-ui/react-tabs"), require("@radix-ui/react-popover")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react", "@radix-ui/react-collapsible", "clsx", "tailwind-merge", "date-fns/locale", "react-datepicker", "@radix-ui/react-checkbox", "material-icons/iconfont/filled.css", "@radix-ui/react-dialog", "react-dropzone", "@radix-ui/react-label", "react-fast-compare", "markdown-it", "@radix-ui/react-dropdown-menu", "@radix-ui/react-menubar", "cmdk", "@radix-ui/react-radio-group", "@radix-ui/react-select", "@radix-ui/react-separator", "react-dom", "@radix-ui/react-tooltip", "@radix-ui/react-tabs", "@radix-ui/react-popover"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["FireCMS UI"] = {}, global.jsxRuntime, global.React, global.Collapsible, global.clsx, global.tailwindMerge, global.locales, global.DatePicker, global.CheckboxPrimitive, null, global.DialogPrimitive, global.reactDropzone, global.LabelPrimitive, global.equal, global.MarkdownIt, global.DropdownMenu, global.MenubarPrimitive, global.cmdk, global.RadioGroupPrimitive, global.SelectPrimitive, global.SeparatorPrimitive, global.ReactDOM, global.TooltipPrimitive, global.TabsPrimitive, global.PopoverPrimitive));
|
3
|
+
})(this, function(exports2, jsxRuntime, React, Collapsible, clsx, tailwindMerge, locales, DatePicker, CheckboxPrimitive, filled_css, DialogPrimitive, reactDropzone, LabelPrimitive, equal, MarkdownIt, DropdownMenu, MenubarPrimitive, cmdk, RadioGroupPrimitive, SelectPrimitive, SeparatorPrimitive, ReactDOM, TooltipPrimitive, TabsPrimitive, PopoverPrimitive) {
|
4
4
|
"use strict";
|
5
5
|
function _interopNamespaceDefault(e) {
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
@@ -22,8 +22,8 @@
|
|
22
22
|
const Collapsible__namespace = /* @__PURE__ */ _interopNamespaceDefault(Collapsible);
|
23
23
|
const locales__namespace = /* @__PURE__ */ _interopNamespaceDefault(locales);
|
24
24
|
const CheckboxPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CheckboxPrimitive);
|
25
|
-
const LabelPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(LabelPrimitive);
|
26
25
|
const DialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DialogPrimitive);
|
26
|
+
const LabelPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(LabelPrimitive);
|
27
27
|
const DropdownMenu__namespace = /* @__PURE__ */ _interopNamespaceDefault(DropdownMenu);
|
28
28
|
const MenubarPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(MenubarPrimitive);
|
29
29
|
const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
|
@@ -39,7 +39,7 @@
|
|
39
39
|
const fieldBackgroundMixin = "bg-opacity-50 bg-slate-200 dark:bg-gray-800 dark:bg-opacity-60";
|
40
40
|
const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-slate-100 dark:bg-gray-800 dark:bg-opacity-0";
|
41
41
|
const fieldBackgroundDisabledMixin = "dark:bg-gray-800 bg-opacity-50 dark:bg-opacity-90";
|
42
|
-
const fieldBackgroundHoverMixin = "hover:bg-opacity-
|
42
|
+
const fieldBackgroundHoverMixin = "hover:bg-opacity-50 dark:hover:bg-gray-700 dark:hover:bg-opacity-40";
|
43
43
|
const defaultBorderMixin = "border-gray-100 dark:border-gray-800 dark:border-opacity-80";
|
44
44
|
const paperMixin = "bg-white rounded-md dark:bg-gray-950 border dark:border-gray-800 dark:border-opacity-80 border-gray-100";
|
45
45
|
const cardMixin = "bg-white border border-gray-100 dark:border-transparent rounded-md dark:bg-gray-950 dark:border-gray-800 dark:border-opacity-50 m-1 -p-1";
|
@@ -13651,7 +13651,7 @@
|
|
13651
13651
|
"div",
|
13652
13652
|
{
|
13653
13653
|
className: cls(
|
13654
|
-
"rounded-lg w-
|
13654
|
+
"rounded-lg w-max h-fit font-regular inline-flex gap-1",
|
13655
13655
|
"text-ellipsis",
|
13656
13656
|
onClick ? "cursor-pointer hover:bg-slate-300 hover:dark:bg-slate-700" : "",
|
13657
13657
|
sizeClassNames[size],
|
@@ -13725,27 +13725,6 @@
|
|
13725
13725
|
);
|
13726
13726
|
};
|
13727
13727
|
const IconButton = React.forwardRef(IconButtonInner);
|
13728
|
-
const Label = React__namespace.forwardRef(({
|
13729
|
-
className,
|
13730
|
-
border,
|
13731
|
-
onClick,
|
13732
|
-
...props
|
13733
|
-
}, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
13734
|
-
LabelPrimitive__namespace.Root,
|
13735
|
-
{
|
13736
|
-
ref,
|
13737
|
-
onClick,
|
13738
|
-
className: cls(
|
13739
|
-
"text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
13740
|
-
border && "border border-gray-300 dark:border-gray-700 rounded-md px-3 py-1.5",
|
13741
|
-
onClick && "hover:cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-800",
|
13742
|
-
defaultBorderMixin,
|
13743
|
-
className
|
13744
|
-
),
|
13745
|
-
...props
|
13746
|
-
}
|
13747
|
-
));
|
13748
|
-
Label.displayName = LabelPrimitive__namespace.Root.displayName;
|
13749
13728
|
const defaultClasses = {
|
13750
13729
|
root: "origin-left transition-transform block whitespace-nowrap overflow-hidden text-overflow-ellipsis max-w-full",
|
13751
13730
|
shrink: "transform translate-y-[2px] scale-75 translate-x-[12px]",
|
@@ -13766,11 +13745,15 @@
|
|
13766
13745
|
className
|
13767
13746
|
);
|
13768
13747
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
13769
|
-
|
13748
|
+
"label",
|
13770
13749
|
{
|
13750
|
+
className: cls(
|
13751
|
+
"text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
13752
|
+
defaultBorderMixin,
|
13753
|
+
computedClassName
|
13754
|
+
),
|
13771
13755
|
"data-shrink": shrink,
|
13772
13756
|
ref,
|
13773
|
-
className: computedClassName,
|
13774
13757
|
...other
|
13775
13758
|
}
|
13776
13759
|
);
|
@@ -13816,20 +13799,20 @@
|
|
13816
13799
|
label: "mb-2"
|
13817
13800
|
};
|
13818
13801
|
const variantToClasses = {
|
13819
|
-
h1: "
|
13820
|
-
h2: "
|
13821
|
-
h3: "
|
13822
|
-
h4: "
|
13823
|
-
h5: "
|
13824
|
-
h6: "
|
13825
|
-
subtitle1: "
|
13826
|
-
subtitle2: "
|
13827
|
-
body1: "
|
13828
|
-
body2: "
|
13829
|
-
label: "
|
13830
|
-
inherit: "
|
13831
|
-
caption: "
|
13832
|
-
button: "
|
13802
|
+
h1: "typography-h1",
|
13803
|
+
h2: "typography-h2",
|
13804
|
+
h3: "typography-h3",
|
13805
|
+
h4: "typography-h4",
|
13806
|
+
h5: "typography-h5",
|
13807
|
+
h6: "typography-h6",
|
13808
|
+
subtitle1: "typography-subtitle1",
|
13809
|
+
subtitle2: "typography-subtitle2",
|
13810
|
+
body1: "typography-body1",
|
13811
|
+
body2: "typography-body2",
|
13812
|
+
label: "typography-label",
|
13813
|
+
inherit: "typography-inherit",
|
13814
|
+
caption: "typography-caption",
|
13815
|
+
button: "typography-button"
|
13833
13816
|
};
|
13834
13817
|
function Typography({
|
13835
13818
|
align = "inherit",
|
@@ -15149,6 +15132,27 @@
|
|
15149
15132
|
}
|
15150
15133
|
);
|
15151
15134
|
}
|
15135
|
+
const Label = React__namespace.forwardRef(({
|
15136
|
+
className,
|
15137
|
+
border,
|
15138
|
+
onClick,
|
15139
|
+
...props
|
15140
|
+
}, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
15141
|
+
LabelPrimitive__namespace.Root,
|
15142
|
+
{
|
15143
|
+
ref,
|
15144
|
+
onClick,
|
15145
|
+
className: cls(
|
15146
|
+
"text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
15147
|
+
border && "border border-gray-300 dark:border-gray-700 rounded-md px-3 py-1.5",
|
15148
|
+
onClick && "hover:cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-800",
|
15149
|
+
defaultBorderMixin,
|
15150
|
+
className
|
15151
|
+
),
|
15152
|
+
...props
|
15153
|
+
}
|
15154
|
+
));
|
15155
|
+
Label.displayName = LabelPrimitive__namespace.Root.displayName;
|
15152
15156
|
function LoadingButton({
|
15153
15157
|
children,
|
15154
15158
|
loading,
|
@@ -15199,27 +15203,33 @@
|
|
15199
15203
|
},
|
15200
15204
|
equal
|
15201
15205
|
);
|
15202
|
-
|
15206
|
+
const Menu = React.forwardRef(({
|
15203
15207
|
children,
|
15204
15208
|
trigger,
|
15205
15209
|
open,
|
15206
15210
|
defaultOpen,
|
15207
15211
|
onOpenChange,
|
15208
15212
|
portalContainer
|
15209
|
-
})
|
15210
|
-
|
15211
|
-
|
15212
|
-
|
15213
|
-
|
15214
|
-
|
15215
|
-
|
15216
|
-
|
15217
|
-
|
15218
|
-
|
15219
|
-
|
15220
|
-
|
15221
|
-
|
15222
|
-
|
15213
|
+
}, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
15214
|
+
DropdownMenu__namespace.Root,
|
15215
|
+
{
|
15216
|
+
open,
|
15217
|
+
defaultOpen,
|
15218
|
+
onOpenChange,
|
15219
|
+
children: [
|
15220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
15221
|
+
DropdownMenu__namespace.Trigger,
|
15222
|
+
{
|
15223
|
+
ref,
|
15224
|
+
asChild: true,
|
15225
|
+
children: trigger
|
15226
|
+
}
|
15227
|
+
),
|
15228
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Content, { className: cls(paperMixin, "shadow py-2 z-30"), children }) })
|
15229
|
+
]
|
15230
|
+
}
|
15231
|
+
));
|
15232
|
+
Menu.displayName = "Menu";
|
15223
15233
|
function MenuItem({
|
15224
15234
|
children,
|
15225
15235
|
dense = false,
|
@@ -15805,7 +15815,7 @@
|
|
15805
15815
|
}
|
15806
15816
|
);
|
15807
15817
|
}
|
15808
|
-
|
15818
|
+
const Select = React.forwardRef(({
|
15809
15819
|
inputRef,
|
15810
15820
|
open,
|
15811
15821
|
name,
|
@@ -15832,7 +15842,7 @@
|
|
15832
15842
|
invisible,
|
15833
15843
|
children,
|
15834
15844
|
...props
|
15835
|
-
}) {
|
15845
|
+
}, ref) => {
|
15836
15846
|
const [openInternal, setOpenInternal] = React.useState(false);
|
15837
15847
|
React.useEffect(() => {
|
15838
15848
|
setOpenInternal(open ?? false);
|
@@ -15905,34 +15915,30 @@
|
|
15905
15915
|
inputClassName
|
15906
15916
|
),
|
15907
15917
|
children: [
|
15908
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
15909
|
-
"
|
15910
|
-
"overflow-visible",
|
15911
|
-
size === "small" ? "h-[42px]" : "h-[64px]"
|
15912
|
-
), children: /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Value, { placeholder, className: "w-full", children: [
|
15913
|
-
renderValue && (hasValue && Array.isArray(value) ? value.map((v, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 max-w-full", children: renderValue ? renderValue(v, i) : v }, v)) : typeof value === "string" ? renderValue ? renderValue(value, 0) : value : placeholder),
|
15914
|
-
renderValues && (!hasValue || Array.isArray(value)) ? renderValues(value ?? []) : null,
|
15915
|
-
!renderValue && !renderValues && hasValue
|
15916
|
-
] }) }),
|
15917
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { className: cls(
|
15918
|
-
"px-2 h-full flex items-center"
|
15919
|
-
), children: /* @__PURE__ */ jsxRuntime.jsx(
|
15920
|
-
ExpandMoreIcon,
|
15918
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
15919
|
+
"div",
|
15921
15920
|
{
|
15922
|
-
|
15923
|
-
className: cls(
|
15921
|
+
ref,
|
15922
|
+
className: cls(
|
15923
|
+
"flex-grow w-full max-w-full flex flex-row gap-2 items-center",
|
15924
|
+
"overflow-visible",
|
15925
|
+
size === "small" ? "h-[42px]" : "h-[64px]"
|
15926
|
+
),
|
15927
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Value, { placeholder, className: "w-full", children: [
|
15928
|
+
renderValue && (hasValue && Array.isArray(value) ? value.map((v, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 max-w-full", children: renderValue ? renderValue(v, i) : v }, v)) : typeof value === "string" ? renderValue ? renderValue(value, 0) : value : placeholder),
|
15929
|
+
renderValues && (!hasValue || Array.isArray(value)) ? renderValues(value ?? []) : null,
|
15930
|
+
!renderValue && !renderValues && hasValue
|
15931
|
+
] })
|
15924
15932
|
}
|
15925
|
-
)
|
15933
|
+
),
|
15934
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsxRuntime.jsx(ExpandMoreIcon, { size: "small", className: cls("transition", open ? "rotate-180" : "") }) })
|
15926
15935
|
]
|
15927
15936
|
}
|
15928
15937
|
),
|
15929
15938
|
endAdornment && /* @__PURE__ */ jsxRuntime.jsx(
|
15930
15939
|
"div",
|
15931
15940
|
{
|
15932
|
-
className: cls(
|
15933
|
-
"absolute h-full flex items-center",
|
15934
|
-
size === "small" ? "right-10" : "right-14"
|
15935
|
-
),
|
15941
|
+
className: cls("absolute h-full flex items-center", size === "small" ? "right-10" : "right-14"),
|
15936
15942
|
onClick: (e) => e.stopPropagation(),
|
15937
15943
|
children: endAdornment
|
15938
15944
|
}
|
@@ -15949,9 +15955,7 @@
|
|
15949
15955
|
SelectPrimitive__namespace.Viewport,
|
15950
15956
|
{
|
15951
15957
|
className: "p-1",
|
15952
|
-
style: {
|
15953
|
-
maxHeight: "var(--radix-select-content-available-height)"
|
15954
|
-
},
|
15958
|
+
style: { maxHeight: "var(--radix-select-content-available-height)" },
|
15955
15959
|
children
|
15956
15960
|
}
|
15957
15961
|
)
|
@@ -15960,7 +15964,8 @@
|
|
15960
15964
|
]
|
15961
15965
|
}
|
15962
15966
|
);
|
15963
|
-
}
|
15967
|
+
});
|
15968
|
+
Select.displayName = "Select";
|
15964
15969
|
function SelectItem({
|
15965
15970
|
value,
|
15966
15971
|
children,
|
@@ -16461,7 +16466,7 @@
|
|
16461
16466
|
InputLabel,
|
16462
16467
|
{
|
16463
16468
|
className: cls(
|
16464
|
-
"
|
16469
|
+
"absolute",
|
16465
16470
|
size === "medium" ? "top-1" : "-top-1",
|
16466
16471
|
!error ? focused ? "text-primary dark:text-primary" : "text-text-secondary dark:text-text-secondary-dark" : "text-red-500 dark:text-red-600",
|
16467
16472
|
disabled ? "opacity-50" : ""
|
@@ -16491,17 +16496,19 @@
|
|
16491
16496
|
align,
|
16492
16497
|
onOpenChange,
|
16493
16498
|
title,
|
16494
|
-
className,
|
16495
|
-
style,
|
16496
16499
|
tooltipClassName,
|
16497
16500
|
tooltipStyle,
|
16498
|
-
children
|
16501
|
+
children,
|
16502
|
+
asChild = false,
|
16503
|
+
className,
|
16504
|
+
style
|
16499
16505
|
}) => {
|
16500
16506
|
useInjectStyles("Tooltip", styles);
|
16501
16507
|
if (!title)
|
16502
16508
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
16509
|
+
const trigger = asChild ? /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { asChild: true, children }) : /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style, className, children }) });
|
16503
16510
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Provider, { delayDuration, children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipPrimitive__namespace.Root, { open, onOpenChange, defaultOpen, children: [
|
16504
|
-
|
16511
|
+
trigger,
|
16505
16512
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
16506
16513
|
TooltipPrimitive__namespace.Content,
|
16507
16514
|
{
|