@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.
@@ -6,9 +6,12 @@ export type BooleanSwitchWithLabelProps = BooleanSwitchProps & {
|
|
6
6
|
label?: React.ReactNode;
|
7
7
|
error?: boolean;
|
8
8
|
autoFocus?: boolean;
|
9
|
+
fullWidth?: boolean;
|
10
|
+
className?: string;
|
11
|
+
inputClassName?: string;
|
9
12
|
};
|
10
13
|
/**
|
11
14
|
* Simple boolean switch.
|
12
15
|
*
|
13
16
|
*/
|
14
|
-
export declare const BooleanSwitchWithLabel: ({ value, position, invisible, onValueChange, error, label, autoFocus, disabled, size, ...props }: BooleanSwitchWithLabelProps) => import("react/jsx-runtime").JSX.Element;
|
17
|
+
export declare const BooleanSwitchWithLabel: ({ value, position, invisible, onValueChange, error, label, autoFocus, disabled, size, className, fullWidth, inputClassName, ...props }: BooleanSwitchWithLabelProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.es.js
CHANGED
@@ -485,6 +485,9 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
|
|
485
485
|
autoFocus,
|
486
486
|
disabled,
|
487
487
|
size,
|
488
|
+
className,
|
489
|
+
fullWidth = true,
|
490
|
+
inputClassName,
|
488
491
|
...props
|
489
492
|
}) {
|
490
493
|
const ref = React__default.useRef(null);
|
@@ -506,13 +509,15 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
|
|
506
509
|
!invisible && fieldBackgroundMixin,
|
507
510
|
!invisible && (disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin),
|
508
511
|
disabled ? "cursor-default" : "cursor-pointer",
|
509
|
-
"rounded-md max-w-full justify-between
|
512
|
+
"rounded-md max-w-full justify-between box-border relative inline-flex items-center",
|
510
513
|
!invisible && focus && !disabled ? focusedClasses : "",
|
511
514
|
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",
|
512
515
|
size === "smallest" ? "min-h-[40px]" : size === "small" ? "min-h-[48px]" : "min-h-[64px]",
|
513
516
|
size === "smallest" ? "pl-2" : "pl-4",
|
514
517
|
size === "smallest" ? "pr-4" : "pr-6",
|
515
|
-
position === "end" ? "flex-row-reverse" : "flex-row"
|
518
|
+
position === "end" ? "flex-row-reverse" : "flex-row",
|
519
|
+
fullWidth ? "w-full" : "",
|
520
|
+
className
|
516
521
|
),
|
517
522
|
onClick: disabled ? void 0 : (e) => {
|
518
523
|
if (props.allowIndeterminate) {
|
@@ -530,7 +535,7 @@ const BooleanSwitchWithLabel = function BooleanSwitchWithLabel2({
|
|
530
535
|
value,
|
531
536
|
ref: refInput,
|
532
537
|
size,
|
533
|
-
className: invisible && focus ? focusedClasses : "",
|
538
|
+
className: cls(invisible && focus ? focusedClasses : "", inputClassName),
|
534
539
|
disabled,
|
535
540
|
...props
|
536
541
|
}
|