@firecms/ui 3.0.0-canary.253 → 3.0.0-canary.255

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.
@@ -9,6 +9,7 @@ export type SelectProps<T extends SelectValue = string> = {
9
9
  value?: T;
10
10
  className?: string;
11
11
  inputClassName?: string;
12
+ viewportClassName?: string;
12
13
  onChange?: React.EventHandler<ChangeEvent<HTMLSelectElement>>;
13
14
  onValueChange?: (updatedValue: T) => void;
14
15
  placeholder?: React.ReactNode;
package/dist/index.es.js CHANGED
@@ -732,18 +732,22 @@ const BooleanSwitch = React__default.forwardRef(function BooleanSwitch2({
732
732
  } else {
733
733
  onValueChange?.(!value);
734
734
  }
735
- }, className: cls(size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]", "outline-none rounded-full relative shadow-sm", 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", className), ...props, children: [
735
+ }, className: cls(size === "smallest" ? "w-[34px] h-[18px] min-w-[34px] min-h-[18px]" : size === "small" ? "w-[38px] h-[22px] min-w-[38px] min-h-[22px]" : "w-[42px] h-[26px] min-w-[42px] min-h-[26px]", "outline-none rounded-full relative shadow-sm", 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", className), ...props, children: [
736
736
  allowIndeterminate && (value === null || value === void 0) && /* @__PURE__ */ jsx("div", { className: cls("block rounded-full transition-transform duration-100 transform will-change-auto", disabled ? "bg-surface-accent-400 dark:bg-surface-accent-600" : "bg-surface-accent-400 dark:bg-surface-accent-600", {
737
737
  "w-[21px] h-[10px]": size === "medium" || size === "large",
738
738
  "w-[19px] h-[8px]": size === "small",
739
+ "w-[16px] h-[6px]": size === "smallest",
739
740
  "translate-x-[10px]": size === "medium" || size === "large",
740
- "translate-x-[9px]": size === "small"
741
+ "translate-x-[9px]": size === "small",
742
+ "translate-x-[8px]": size === "smallest"
741
743
  }) }, "knob"),
742
744
  !(allowIndeterminate && (value === null || value === void 0)) && /* @__PURE__ */ jsx("div", { className: cls("block rounded-full transition-transform duration-100 transform will-change-auto", disabled ? "bg-surface-accent-300 dark:bg-surface-accent-700" : value ? "bg-white" : "bg-surface-accent-600 dark:bg-surface-accent-400", {
743
745
  "w-[21px] h-[21px]": size === "medium" || size === "large",
744
746
  "w-[19px] h-[19px]": size === "small",
747
+ "w-[16px] h-[16px]": size === "smallest",
745
748
  [value ? "translate-x-[19px]" : "translate-x-[3px]"]: size === "medium" || size === "large",
746
- [value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small"
749
+ [value ? "translate-x-[17px]" : "translate-x-[2px]"]: size === "small",
750
+ [value ? "translate-x-[16px]" : "translate-x-[1px]"]: size === "smallest"
747
751
  }) }, "knob")
748
752
  ] });
749
753
  });
@@ -775,7 +779,7 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
775
779
  "min-h-[32px]": size === "small",
776
780
  "min-h-[42px]": size === "medium",
777
781
  "min-h-[64px]": size === "large"
778
- }, size === "small" ? "pl-2" : "pl-4", size === "small" ? "pr-4" : "pr-6", position === "end" ? "flex-row-reverse" : "flex-row", fullWidth ? "w-full" : "", className), onClick: disabled ? void 0 : (e) => {
782
+ }, size === "small" || size === "smallest" ? "pl-2" : "pl-4", size === "small" || size === "smallest" ? "pr-4" : "pr-6", position === "end" ? "flex-row-reverse" : "flex-row", fullWidth ? "w-full" : "", className), onClick: disabled ? void 0 : (e) => {
779
783
  if (props.allowIndeterminate) {
780
784
  if (value === null || value === void 0) onValueChange?.(true);
781
785
  else if (value) onValueChange?.(false);
@@ -785,7 +789,7 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
785
789
  }
786
790
  }, children: [
787
791
  /* @__PURE__ */ jsx(BooleanSwitch, { value, ref: refInput, size, className: cls(invisible && focus ? focusedClasses : "", inputClassName), disabled, ...props }),
788
- /* @__PURE__ */ jsx("div", { className: cls("flex-grow", position === "end" ? "mr-4" : "ml-4", size === "small" ? "text-sm" : "text-base"), children: label })
792
+ /* @__PURE__ */ jsx("div", { className: cls("flex-grow", position === "end" ? "mr-4" : "ml-4", size === "small" || size === "smallest" ? "text-sm" : "text-base"), children: label })
789
793
  ] });
790
794
  };
791
795
  const ButtonInner = React__default.forwardRef((t0, ref) => {
@@ -30542,6 +30546,7 @@ const Select = forwardRef(({
30542
30546
  onValueChange,
30543
30547
  className,
30544
30548
  inputClassName,
30549
+ viewportClassName,
30545
30550
  placeholder,
30546
30551
  renderValue,
30547
30552
  label,
@@ -30636,7 +30641,7 @@ const Select = forwardRef(({
30636
30641
  e_0.stopPropagation();
30637
30642
  }, children: endAdornment })
30638
30643
  ] }),
30639
- /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(SelectPrimitive.Content, { position, className: cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-surface-900 p-2 rounded-lg", defaultBorderMixin), children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: "p-1", style: {
30644
+ /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(SelectPrimitive.Content, { position, className: cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-surface-900 p-2 rounded-lg", defaultBorderMixin), children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: cls("p-1", viewportClassName), style: {
30640
30645
  maxHeight: "var(--radix-select-content-available-height)"
30641
30646
  }, children }) }) })
30642
30647
  ] });