@dreamtree-org/twreact-ui 1.0.60 → 1.0.61
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.esm.js +8 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10376,7 +10376,7 @@ function Switch(props) {
|
|
|
10376
10376
|
topLabel = props.topLabel,
|
|
10377
10377
|
bottomLabel = props.bottomLabel,
|
|
10378
10378
|
rightLabel = props.rightLabel,
|
|
10379
|
-
|
|
10379
|
+
leftLabel = props.leftLabel,
|
|
10380
10380
|
ariaLabel = props.ariaLabel;
|
|
10381
10381
|
var isControlled = typeof checked === "boolean";
|
|
10382
10382
|
var _useState = React.useState(defaultChecked),
|
|
@@ -10426,7 +10426,7 @@ function Switch(props) {
|
|
|
10426
10426
|
var fallbackOnClass = isOn && !bgColor ? "bg-sky-500" : "";
|
|
10427
10427
|
|
|
10428
10428
|
// Accessible label fallback: prefer ariaLabel, otherwise first provided visible label, otherwise "Toggle"
|
|
10429
|
-
var accessibleLabel = ariaLabel || rightLabel ||
|
|
10429
|
+
var accessibleLabel = ariaLabel || rightLabel || leftLabel || topLabel || bottomLabel || "Toggle";
|
|
10430
10430
|
|
|
10431
10431
|
// Container layout: column if top or bottom labels exist, otherwise row
|
|
10432
10432
|
var containerIsColumn = Boolean(topLabel || bottomLabel);
|
|
@@ -10439,10 +10439,10 @@ function Switch(props) {
|
|
|
10439
10439
|
className: labelOpacityClass
|
|
10440
10440
|
}, topLabel) : null, /*#__PURE__*/React.createElement("div", {
|
|
10441
10441
|
className: "inline-flex items-center gap-2"
|
|
10442
|
-
},
|
|
10442
|
+
}, leftLabel ? /*#__PURE__*/React.createElement("label", {
|
|
10443
10443
|
htmlFor: idRef.current,
|
|
10444
10444
|
className: labelOpacityClass
|
|
10445
|
-
},
|
|
10445
|
+
}, leftLabel) : null, /*#__PURE__*/React.createElement("button", {
|
|
10446
10446
|
id: idRef.current,
|
|
10447
10447
|
type: "button",
|
|
10448
10448
|
role: "switch",
|
|
@@ -10542,13 +10542,13 @@ var Form = function Form(_ref) {
|
|
|
10542
10542
|
placeholder = field.placeholder,
|
|
10543
10543
|
fieldProps = _objectWithoutProperties$1(field, _excluded2$3);
|
|
10544
10544
|
var error = (_errors$name = errors[name]) === null || _errors$name === void 0 ? void 0 : _errors$name.message;
|
|
10545
|
-
var commonProps = _objectSpread$8({
|
|
10545
|
+
var commonProps = _objectSpread$8(_objectSpread$8({
|
|
10546
10546
|
name: name,
|
|
10547
10547
|
label: label,
|
|
10548
10548
|
required: required,
|
|
10549
10549
|
error: error,
|
|
10550
10550
|
placeholder: placeholder
|
|
10551
|
-
}, fieldProps);
|
|
10551
|
+
}, fieldProps), field.options);
|
|
10552
10552
|
switch (type) {
|
|
10553
10553
|
case "text":
|
|
10554
10554
|
case "email":
|
|
@@ -10804,13 +10804,13 @@ var Form = function Form(_ref) {
|
|
|
10804
10804
|
onChange = _ref9$field.onChange,
|
|
10805
10805
|
value = _ref9$field.value,
|
|
10806
10806
|
ref = _ref9$field.ref;
|
|
10807
|
-
return /*#__PURE__*/React.createElement(Switch, {
|
|
10807
|
+
return /*#__PURE__*/React.createElement(Switch, _extends({
|
|
10808
10808
|
checked: !!value,
|
|
10809
10809
|
onChange: onChange,
|
|
10810
10810
|
ref: ref,
|
|
10811
10811
|
label: label,
|
|
10812
10812
|
disabled: fieldProps.disabled
|
|
10813
|
-
});
|
|
10813
|
+
}, commonProps));
|
|
10814
10814
|
}
|
|
10815
10815
|
});
|
|
10816
10816
|
case "custom":
|