@firecms/ui 3.0.0-canary.142 → 3.0.0-canary.143

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/ui",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.142",
4
+ "version": "3.0.0-canary.143",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -107,7 +107,7 @@
107
107
  "src",
108
108
  "tailwind.config.js"
109
109
  ],
110
- "gitHead": "9adfc426dab9b7e197f1080065e08d49366fdadd",
110
+ "gitHead": "7c386c049ca33c56779546c4598771f8dc3b8e62",
111
111
  "publishConfig": {
112
112
  "access": "public"
113
113
  }
@@ -15,6 +15,9 @@ export type BooleanSwitchWithLabelProps = BooleanSwitchProps & {
15
15
  label?: React.ReactNode,
16
16
  error?: boolean,
17
17
  autoFocus?: boolean,
18
+ fullWidth?: boolean,
19
+ className?: string,
20
+ inputClassName?: string,
18
21
  };
19
22
 
20
23
  /**
@@ -31,6 +34,9 @@ export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
31
34
  autoFocus,
32
35
  disabled,
33
36
  size,
37
+ className,
38
+ fullWidth = true,
39
+ inputClassName,
34
40
  ...props
35
41
  }: BooleanSwitchWithLabelProps) {
36
42
 
@@ -58,13 +64,15 @@ export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
58
64
  !invisible && fieldBackgroundMixin,
59
65
  !invisible && (disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin),
60
66
  disabled ? "cursor-default" : "cursor-pointer",
61
- "rounded-md max-w-full justify-between w-full box-border relative inline-flex items-center",
67
+ "rounded-md max-w-full justify-between box-border relative inline-flex items-center",
62
68
  !invisible && focus && !disabled ? focusedClasses : "",
63
69
  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")),
64
70
  size === "smallest" ? "min-h-[40px]" : (size === "small" ? "min-h-[48px]" : "min-h-[64px]"),
65
71
  size === "smallest" ? "pl-2" : "pl-4",
66
72
  size === "smallest" ? "pr-4" : "pr-6",
67
- position === "end" ? "flex-row-reverse" : "flex-row"
73
+ position === "end" ? "flex-row-reverse" : "flex-row",
74
+ fullWidth ? "w-full" : "",
75
+ className
68
76
  )}
69
77
  onClick={disabled ? undefined : (e) => {
70
78
  if (props.allowIndeterminate) {
@@ -82,7 +90,7 @@ export const BooleanSwitchWithLabel = function BooleanSwitchWithLabel({
82
90
  value={value}
83
91
  ref={refInput}
84
92
  size={size}
85
- className={invisible && focus ? focusedClasses : ""}
93
+ className={cls(invisible && focus ? focusedClasses : "", inputClassName)}
86
94
  disabled={disabled}
87
95
  {...props}
88
96
  />