@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.esm.js
CHANGED
|
@@ -10356,7 +10356,7 @@ function Switch(props) {
|
|
|
10356
10356
|
topLabel = props.topLabel,
|
|
10357
10357
|
bottomLabel = props.bottomLabel,
|
|
10358
10358
|
rightLabel = props.rightLabel,
|
|
10359
|
-
|
|
10359
|
+
leftLabel = props.leftLabel,
|
|
10360
10360
|
ariaLabel = props.ariaLabel;
|
|
10361
10361
|
var isControlled = typeof checked === "boolean";
|
|
10362
10362
|
var _useState = useState(defaultChecked),
|
|
@@ -10406,7 +10406,7 @@ function Switch(props) {
|
|
|
10406
10406
|
var fallbackOnClass = isOn && !bgColor ? "bg-sky-500" : "";
|
|
10407
10407
|
|
|
10408
10408
|
// Accessible label fallback: prefer ariaLabel, otherwise first provided visible label, otherwise "Toggle"
|
|
10409
|
-
var accessibleLabel = ariaLabel || rightLabel ||
|
|
10409
|
+
var accessibleLabel = ariaLabel || rightLabel || leftLabel || topLabel || bottomLabel || "Toggle";
|
|
10410
10410
|
|
|
10411
10411
|
// Container layout: column if top or bottom labels exist, otherwise row
|
|
10412
10412
|
var containerIsColumn = Boolean(topLabel || bottomLabel);
|
|
@@ -10419,10 +10419,10 @@ function Switch(props) {
|
|
|
10419
10419
|
className: labelOpacityClass
|
|
10420
10420
|
}, topLabel) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
10421
10421
|
className: "inline-flex items-center gap-2"
|
|
10422
|
-
},
|
|
10422
|
+
}, leftLabel ? /*#__PURE__*/React__default.createElement("label", {
|
|
10423
10423
|
htmlFor: idRef.current,
|
|
10424
10424
|
className: labelOpacityClass
|
|
10425
|
-
},
|
|
10425
|
+
}, leftLabel) : null, /*#__PURE__*/React__default.createElement("button", {
|
|
10426
10426
|
id: idRef.current,
|
|
10427
10427
|
type: "button",
|
|
10428
10428
|
role: "switch",
|
|
@@ -10522,13 +10522,13 @@ var Form = function Form(_ref) {
|
|
|
10522
10522
|
placeholder = field.placeholder,
|
|
10523
10523
|
fieldProps = _objectWithoutProperties$1(field, _excluded2$3);
|
|
10524
10524
|
var error = (_errors$name = errors[name]) === null || _errors$name === void 0 ? void 0 : _errors$name.message;
|
|
10525
|
-
var commonProps = _objectSpread$8({
|
|
10525
|
+
var commonProps = _objectSpread$8(_objectSpread$8({
|
|
10526
10526
|
name: name,
|
|
10527
10527
|
label: label,
|
|
10528
10528
|
required: required,
|
|
10529
10529
|
error: error,
|
|
10530
10530
|
placeholder: placeholder
|
|
10531
|
-
}, fieldProps);
|
|
10531
|
+
}, fieldProps), field.options);
|
|
10532
10532
|
switch (type) {
|
|
10533
10533
|
case "text":
|
|
10534
10534
|
case "email":
|
|
@@ -10784,13 +10784,13 @@ var Form = function Form(_ref) {
|
|
|
10784
10784
|
onChange = _ref9$field.onChange,
|
|
10785
10785
|
value = _ref9$field.value,
|
|
10786
10786
|
ref = _ref9$field.ref;
|
|
10787
|
-
return /*#__PURE__*/React__default.createElement(Switch, {
|
|
10787
|
+
return /*#__PURE__*/React__default.createElement(Switch, _extends({
|
|
10788
10788
|
checked: !!value,
|
|
10789
10789
|
onChange: onChange,
|
|
10790
10790
|
ref: ref,
|
|
10791
10791
|
label: label,
|
|
10792
10792
|
disabled: fieldProps.disabled
|
|
10793
|
-
});
|
|
10793
|
+
}, commonProps));
|
|
10794
10794
|
}
|
|
10795
10795
|
});
|
|
10796
10796
|
case "custom":
|