@platned/ui 0.9.1 → 0.9.3
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.cjs +15 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -804,7 +804,9 @@ var inputControlClasses = (size2, invalid, disabled) => clsx10(
|
|
|
804
804
|
disabled ? "cursor-not-allowed bg-disabled border-disabled text-disabled placeholder:text-disabled" : invalid ? "border-danger-secondary focus-visible:border-danger focus-visible:ring-danger" : "border-default focus-visible:border-brand focus-visible:ring-brand",
|
|
805
805
|
// read-only is not disabled: the value still matters and is still selectable, but it
|
|
806
806
|
// must not look editable. Nothing in the library styled this before 0.4.0.
|
|
807
|
-
|
|
807
|
+
// `enabled:` because a disabled input also matches `:read-only`. Through 0.9.1 that let this
|
|
808
|
+
// lighter fill override `bg-disabled`, so a disabled field looked read-only (0.9.2).
|
|
809
|
+
"enabled:read-only:bg-default-secondary enabled:read-only:cursor-default"
|
|
808
810
|
);
|
|
809
811
|
var Input = forwardRef6(function Input2({
|
|
810
812
|
label,
|
|
@@ -979,7 +981,8 @@ var TextareaControl = forwardRef7(
|
|
|
979
981
|
"focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
980
982
|
textareaBase[size2],
|
|
981
983
|
isDisabled ? "cursor-not-allowed resize-none border-disabled bg-disabled text-disabled placeholder:text-disabled" : isInvalid ? "border-danger-secondary focus-visible:border-danger focus-visible:ring-danger" : "border-default focus-visible:border-brand focus-visible:ring-brand",
|
|
982
|
-
|
|
984
|
+
// `enabled:`: a disabled textarea also matches `:read-only` (see Input).
|
|
985
|
+
"enabled:read-only:cursor-default enabled:read-only:resize-none enabled:read-only:bg-default-secondary",
|
|
983
986
|
className
|
|
984
987
|
),
|
|
985
988
|
...props
|
|
@@ -3618,7 +3621,7 @@ function FormCard({
|
|
|
3618
3621
|
);
|
|
3619
3622
|
}
|
|
3620
3623
|
function FormCardHeader({ title, subtitle }) {
|
|
3621
|
-
return /* @__PURE__ */ jsxs18("div", { className: "border-b border-default px-7 py-6", children: [
|
|
3624
|
+
return /* @__PURE__ */ jsxs18("div", { className: "border-b border-default px-4 py-5 sm:px-7 sm:py-6", children: [
|
|
3622
3625
|
/* @__PURE__ */ jsx25("h2", { className: "text-heading-sm font-semibold text-default leading-snug [overflow-wrap:anywhere]", children: title }),
|
|
3623
3626
|
subtitle && /* @__PURE__ */ jsx25("p", { className: "mt-1 text-body-xs text-default-secondary", children: subtitle })
|
|
3624
3627
|
] });
|
|
@@ -6827,11 +6830,20 @@ function FullscreenSurface({
|
|
|
6827
6830
|
className
|
|
6828
6831
|
}) {
|
|
6829
6832
|
const [node, setNode] = useState22(null);
|
|
6833
|
+
const [returnFocusTo] = useState22(
|
|
6834
|
+
() => typeof document === "undefined" ? null : document.activeElement
|
|
6835
|
+
);
|
|
6830
6836
|
return /* @__PURE__ */ jsx62(DialogPrimitive3.Root, { open: true, onOpenChange: (open) => !open && onClose(), children: /* @__PURE__ */ jsx62(DialogPrimitive3.Portal, { children: /* @__PURE__ */ jsxs43(
|
|
6831
6837
|
DialogPrimitive3.Content,
|
|
6832
6838
|
{
|
|
6833
6839
|
ref: setNode,
|
|
6834
6840
|
"aria-describedby": void 0,
|
|
6841
|
+
onCloseAutoFocus: (event) => {
|
|
6842
|
+
if (returnFocusTo?.isConnected && returnFocusTo !== document.body) {
|
|
6843
|
+
event.preventDefault();
|
|
6844
|
+
returnFocusTo.focus();
|
|
6845
|
+
}
|
|
6846
|
+
},
|
|
6835
6847
|
onEscapeKeyDown: (event) => void deferEscapeToInnerPopup(event),
|
|
6836
6848
|
className: cn(
|
|
6837
6849
|
"fixed inset-0 overflow-auto bg-default-secondary p-4 focus:outline-none lg:p-6",
|