@firecms/ui 3.0.0-canary.108 → 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/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-label"), require("@radix-ui/react-dialog"), require("react-dropzone"), 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-label", "@radix-ui/react-dialog", "react-dropzone", "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.LabelPrimitive, global.DialogPrimitive, global.reactDropzone, 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, LabelPrimitive, DialogPrimitive, reactDropzone, equal, MarkdownIt, DropdownMenu, MenubarPrimitive, cmdk, RadioGroupPrimitive, SelectPrimitive, SeparatorPrimitive, ReactDOM, TooltipPrimitive, TabsPrimitive, PopoverPrimitive) {
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);
@@ -13651,7 +13651,7 @@
13651
13651
  "div",
13652
13652
  {
13653
13653
  className: cls(
13654
- "rounded-lg w-fit h-fit font-regular inline-flex gap-1",
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
- Label,
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: "text-6xl font-headers font-light",
13820
- h2: "text-5xl font-headers font-light",
13821
- h3: "text-4xl font-headers font-normal",
13822
- h4: "text-3xl font-headers font-normal",
13823
- h5: "text-2xl font-headers font-normal",
13824
- h6: "text-xl font-headers font-medium",
13825
- subtitle1: "text-lg font-headers font-medium",
13826
- subtitle2: "text-base font-headers font-medium",
13827
- body1: "text-base",
13828
- body2: "text-sm",
13829
- label: "text-sm font-medium text-slate-500",
13830
- inherit: "text-inherit",
13831
- caption: "text-xs",
13832
- button: "text-sm font-medium"
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
- function Menu({
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
- return /* @__PURE__ */ jsxRuntime.jsxs(
15211
- DropdownMenu__namespace.Root,
15212
- {
15213
- open,
15214
- defaultOpen,
15215
- onOpenChange,
15216
- children: [
15217
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild: true, children: trigger }),
15218
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Content, { className: cls(paperMixin, "shadow py-2 z-30"), children }) })
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
- function Select({
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("div", { className: cls(
15909
- "flex-grow w-full max-w-full flex flex-row gap-2 items-center",
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
- size: "small",
15923
- className: cls("transition", open ? "rotate-180" : "")
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
- "pointer-events-none absolute",
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
- /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className, style, children }) }),
16511
+ trigger,
16505
16512
  /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
16506
16513
  TooltipPrimitive__namespace.Content,
16507
16514
  {