@soroush.tech/design-system 1.2.0 → 1.3.0
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/Drawer.cjs +1 -1
- package/dist/Drawer.d.cts +1 -1
- package/dist/Drawer.d.mts +1 -1
- package/dist/Drawer.mjs +1 -1
- package/dist/{Modal-S2nb35q-.cjs → Modal-Bjfv7n4e.cjs} +23 -13
- package/dist/{Modal-COLrJoNW.mjs → Modal-C0oiFAj5.mjs} +16 -12
- package/dist/Modal.cjs +3 -2
- package/dist/Modal.d.cts +2 -2
- package/dist/Modal.d.mts +2 -2
- package/dist/Modal.mjs +2 -2
- package/dist/{Popover-BxN7ts_I.cjs → Popover-COoJ2p2I.cjs} +1 -1
- package/dist/{Popover-BjGubpna.mjs → Popover-mz_rnf5s.mjs} +1 -1
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.d.cts +1 -1
- package/dist/Popover.d.mts +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/Select.cjs +1 -1
- package/dist/Select.mjs +1 -1
- package/dist/TextInput.cjs +11 -9
- package/dist/TextInput.mjs +11 -9
- package/dist/{index-BfpjEqqt.d.cts → index-0law1kXY.d.cts} +5 -2
- package/dist/{index-Ds__py2h.d.mts → index-CqFd46gX.d.mts} +5 -2
- package/package.json +1 -1
package/dist/Drawer.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_src = require("./src-BJrcLd7P.cjs");
|
|
3
3
|
const require_Paper = require("./Paper.cjs");
|
|
4
|
-
const require_Modal = require("./Modal-
|
|
4
|
+
const require_Modal = require("./Modal-Bjfv7n4e.cjs");
|
|
5
5
|
require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let _emotion_react = require("@emotion/react");
|
package/dist/Drawer.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as PaperElevation } from "./index-CYTaYcm3.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { s as ModalProps } from "./index-0law1kXY.cjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
//#region src/Drawer/Drawer.d.ts
|
|
5
5
|
type DrawerAnchor = 'left' | 'right' | 'top' | 'bottom';
|
package/dist/Drawer.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as PaperElevation } from "./index-KZUd8B5E.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { s as ModalProps } from "./index-CqFd46gX.mjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
//#region src/Drawer/Drawer.d.ts
|
|
5
5
|
type DrawerAnchor = 'left' | 'right' | 'top' | 'bottom';
|
package/dist/Drawer.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as styled, r as keyframes, t as createShouldForwardProp } from "./src-BJy4dM4f.mjs";
|
|
2
2
|
import { Paper } from "./Paper.mjs";
|
|
3
|
-
import { t as Modal } from "./Modal-
|
|
3
|
+
import { t as Modal } from "./Modal-C0oiFAj5.mjs";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/Drawer/Drawer.tsx
|
|
@@ -52,22 +52,26 @@ const ARIA_HIDDEN_FORBIDDEN_TAGS = /* @__PURE__ */ new Set([
|
|
|
52
52
|
"SOURCE",
|
|
53
53
|
"TRACK"
|
|
54
54
|
]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
/** Hides an element from assistive tech. */
|
|
56
|
+
function hideFromAria(element) {
|
|
57
|
+
element.setAttribute("aria-hidden", "true");
|
|
58
|
+
}
|
|
59
|
+
/** Reveals an element to assistive tech again. */
|
|
60
|
+
function exposeToAria(element) {
|
|
61
|
+
element.removeAttribute("aria-hidden");
|
|
58
62
|
}
|
|
59
63
|
function isAriaHiddenForbidden(element) {
|
|
60
64
|
if (ARIA_HIDDEN_FORBIDDEN_TAGS.has(element.tagName)) return true;
|
|
61
65
|
return element.tagName === "INPUT" && element.getAttribute("type") === "hidden";
|
|
62
66
|
}
|
|
63
|
-
function ariaHiddenSiblings(container, mountElement, currentElement, hiddenSiblings,
|
|
67
|
+
function ariaHiddenSiblings(container, mountElement, currentElement, hiddenSiblings, apply) {
|
|
64
68
|
const exclude = /* @__PURE__ */ new Set([
|
|
65
69
|
mountElement,
|
|
66
70
|
currentElement,
|
|
67
71
|
...hiddenSiblings
|
|
68
72
|
]);
|
|
69
73
|
Array.from(container.children).forEach((element) => {
|
|
70
|
-
if (!exclude.has(element) && !isAriaHiddenForbidden(element))
|
|
74
|
+
if (!exclude.has(element) && !isAriaHiddenForbidden(element)) apply(element);
|
|
71
75
|
});
|
|
72
76
|
}
|
|
73
77
|
function getHiddenSiblings(container) {
|
|
@@ -116,9 +120,9 @@ var ModalManager = class {
|
|
|
116
120
|
if (existingIndex !== -1) return existingIndex;
|
|
117
121
|
const modalIndex = this.modals.length;
|
|
118
122
|
this.modals.push(modal);
|
|
119
|
-
|
|
123
|
+
exposeToAria(modal.modalRef);
|
|
120
124
|
const hiddenSiblings = getHiddenSiblings(container);
|
|
121
|
-
if (!disableAriaHidden) ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings,
|
|
125
|
+
if (!disableAriaHidden) ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, hideFromAria);
|
|
122
126
|
const containerState = this.containers.find((item) => item.container === container);
|
|
123
127
|
if (containerState) {
|
|
124
128
|
containerState.modals.push(modal);
|
|
@@ -146,13 +150,13 @@ var ModalManager = class {
|
|
|
146
150
|
this.modals.splice(modalIndex, 1);
|
|
147
151
|
if (containerState.modals.length === 0) {
|
|
148
152
|
if (containerState.restore) containerState.restore();
|
|
149
|
-
|
|
150
|
-
if (containerState.ariaHiddenApplied) ariaHiddenSiblings(containerState.container, modal.mount, modal.modalRef, containerState.hiddenSiblings,
|
|
153
|
+
(ariaHiddenState ? hideFromAria : exposeToAria)(modal.modalRef);
|
|
154
|
+
if (containerState.ariaHiddenApplied) ariaHiddenSiblings(containerState.container, modal.mount, modal.modalRef, containerState.hiddenSiblings, exposeToAria);
|
|
151
155
|
this.containers.splice(this.containers.indexOf(containerState), 1);
|
|
152
156
|
} else {
|
|
153
157
|
const nextTop = containerState.modals.at(-1);
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
(ariaHiddenState ? hideFromAria : exposeToAria)(modal.modalRef);
|
|
159
|
+
exposeToAria(nextTop.modalRef);
|
|
156
160
|
}
|
|
157
161
|
return modalIndex;
|
|
158
162
|
}
|
|
@@ -338,10 +342,16 @@ Object.defineProperty(exports, "ModalManager", {
|
|
|
338
342
|
return ModalManager;
|
|
339
343
|
}
|
|
340
344
|
});
|
|
341
|
-
Object.defineProperty(exports, "
|
|
345
|
+
Object.defineProperty(exports, "exposeToAria", {
|
|
346
|
+
enumerable: true,
|
|
347
|
+
get: function() {
|
|
348
|
+
return exposeToAria;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
Object.defineProperty(exports, "hideFromAria", {
|
|
342
352
|
enumerable: true,
|
|
343
353
|
get: function() {
|
|
344
|
-
return
|
|
354
|
+
return hideFromAria;
|
|
345
355
|
}
|
|
346
356
|
});
|
|
347
357
|
Object.defineProperty(exports, "useModal", {
|
|
@@ -51,22 +51,26 @@ const ARIA_HIDDEN_FORBIDDEN_TAGS = /* @__PURE__ */ new Set([
|
|
|
51
51
|
"SOURCE",
|
|
52
52
|
"TRACK"
|
|
53
53
|
]);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
/** Hides an element from assistive tech. */
|
|
55
|
+
function hideFromAria(element) {
|
|
56
|
+
element.setAttribute("aria-hidden", "true");
|
|
57
|
+
}
|
|
58
|
+
/** Reveals an element to assistive tech again. */
|
|
59
|
+
function exposeToAria(element) {
|
|
60
|
+
element.removeAttribute("aria-hidden");
|
|
57
61
|
}
|
|
58
62
|
function isAriaHiddenForbidden(element) {
|
|
59
63
|
if (ARIA_HIDDEN_FORBIDDEN_TAGS.has(element.tagName)) return true;
|
|
60
64
|
return element.tagName === "INPUT" && element.getAttribute("type") === "hidden";
|
|
61
65
|
}
|
|
62
|
-
function ariaHiddenSiblings(container, mountElement, currentElement, hiddenSiblings,
|
|
66
|
+
function ariaHiddenSiblings(container, mountElement, currentElement, hiddenSiblings, apply) {
|
|
63
67
|
const exclude = /* @__PURE__ */ new Set([
|
|
64
68
|
mountElement,
|
|
65
69
|
currentElement,
|
|
66
70
|
...hiddenSiblings
|
|
67
71
|
]);
|
|
68
72
|
Array.from(container.children).forEach((element) => {
|
|
69
|
-
if (!exclude.has(element) && !isAriaHiddenForbidden(element))
|
|
73
|
+
if (!exclude.has(element) && !isAriaHiddenForbidden(element)) apply(element);
|
|
70
74
|
});
|
|
71
75
|
}
|
|
72
76
|
function getHiddenSiblings(container) {
|
|
@@ -115,9 +119,9 @@ var ModalManager = class {
|
|
|
115
119
|
if (existingIndex !== -1) return existingIndex;
|
|
116
120
|
const modalIndex = this.modals.length;
|
|
117
121
|
this.modals.push(modal);
|
|
118
|
-
|
|
122
|
+
exposeToAria(modal.modalRef);
|
|
119
123
|
const hiddenSiblings = getHiddenSiblings(container);
|
|
120
|
-
if (!disableAriaHidden) ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings,
|
|
124
|
+
if (!disableAriaHidden) ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, hideFromAria);
|
|
121
125
|
const containerState = this.containers.find((item) => item.container === container);
|
|
122
126
|
if (containerState) {
|
|
123
127
|
containerState.modals.push(modal);
|
|
@@ -145,13 +149,13 @@ var ModalManager = class {
|
|
|
145
149
|
this.modals.splice(modalIndex, 1);
|
|
146
150
|
if (containerState.modals.length === 0) {
|
|
147
151
|
if (containerState.restore) containerState.restore();
|
|
148
|
-
|
|
149
|
-
if (containerState.ariaHiddenApplied) ariaHiddenSiblings(containerState.container, modal.mount, modal.modalRef, containerState.hiddenSiblings,
|
|
152
|
+
(ariaHiddenState ? hideFromAria : exposeToAria)(modal.modalRef);
|
|
153
|
+
if (containerState.ariaHiddenApplied) ariaHiddenSiblings(containerState.container, modal.mount, modal.modalRef, containerState.hiddenSiblings, exposeToAria);
|
|
150
154
|
this.containers.splice(this.containers.indexOf(containerState), 1);
|
|
151
155
|
} else {
|
|
152
156
|
const nextTop = containerState.modals.at(-1);
|
|
153
|
-
|
|
154
|
-
|
|
157
|
+
(ariaHiddenState ? hideFromAria : exposeToAria)(modal.modalRef);
|
|
158
|
+
exposeToAria(nextTop.modalRef);
|
|
155
159
|
}
|
|
156
160
|
return modalIndex;
|
|
157
161
|
}
|
|
@@ -325,4 +329,4 @@ function Modal({ isOpen, children, onClose, hasBackdrop = true, shouldKeepMounte
|
|
|
325
329
|
}) : content;
|
|
326
330
|
}
|
|
327
331
|
//#endregion
|
|
328
|
-
export {
|
|
332
|
+
export { hideFromAria as a, exposeToAria as i, useModal as n, ModalManager as r, Modal as t };
|
package/dist/Modal.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_Modal = require("./Modal-
|
|
2
|
+
const require_Modal = require("./Modal-Bjfv7n4e.cjs");
|
|
3
3
|
exports.Modal = require_Modal.Modal;
|
|
4
4
|
exports.ModalManager = require_Modal.ModalManager;
|
|
5
|
-
exports.
|
|
5
|
+
exports.exposeToAria = require_Modal.exposeToAria;
|
|
6
|
+
exports.hideFromAria = require_Modal.hideFromAria;
|
|
6
7
|
exports.useModal = require_Modal.useModal;
|
package/dist/Modal.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { ManagedModal, ManagedModalProps, Modal, ModalCloseReason, ModalManager, ModalProps, ModalScroll, UseModalParameters, UseModalReturnValue,
|
|
1
|
+
import { a as hideFromAria, c as ModalScroll, d as UseModalReturnValue, f as useModal, i as exposeToAria, l as ModalCloseReason, n as ManagedModalProps, o as Modal, r as ModalManager, s as ModalProps, t as ManagedModal, u as UseModalParameters } from "./index-0law1kXY.cjs";
|
|
2
|
+
export { ManagedModal, ManagedModalProps, Modal, ModalCloseReason, ModalManager, ModalProps, ModalScroll, UseModalParameters, UseModalReturnValue, exposeToAria, hideFromAria, useModal };
|
package/dist/Modal.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { ManagedModal, ManagedModalProps, Modal, ModalCloseReason, ModalManager, ModalProps, ModalScroll, UseModalParameters, UseModalReturnValue,
|
|
1
|
+
import { a as hideFromAria, c as ModalScroll, d as UseModalReturnValue, f as useModal, i as exposeToAria, l as ModalCloseReason, n as ManagedModalProps, o as Modal, r as ModalManager, s as ModalProps, t as ManagedModal, u as UseModalParameters } from "./index-CqFd46gX.mjs";
|
|
2
|
+
export { ManagedModal, ManagedModalProps, Modal, ModalCloseReason, ModalManager, ModalProps, ModalScroll, UseModalParameters, UseModalReturnValue, exposeToAria, hideFromAria, useModal };
|
package/dist/Modal.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { Modal, ModalManager,
|
|
1
|
+
import { a as hideFromAria, i as exposeToAria, n as useModal, r as ModalManager, t as Modal } from "./Modal-C0oiFAj5.mjs";
|
|
2
|
+
export { Modal, ModalManager, exposeToAria, hideFromAria, useModal };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_src = require("./src-BJrcLd7P.cjs");
|
|
2
2
|
const require_theme = require("./theme-CleLAV6A.cjs");
|
|
3
3
|
const require_Paper = require("./Paper.cjs");
|
|
4
|
-
const require_Modal = require("./Modal-
|
|
4
|
+
const require_Modal = require("./Modal-Bjfv7n4e.cjs");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as styled, t as createShouldForwardProp } from "./src-BJy4dM4f.mjs";
|
|
2
2
|
import { r as useTheme } from "./theme-Cudynq5K.mjs";
|
|
3
3
|
import { Paper } from "./Paper.mjs";
|
|
4
|
-
import { t as Modal } from "./Modal-
|
|
4
|
+
import { t as Modal } from "./Modal-C0oiFAj5.mjs";
|
|
5
5
|
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/Popover/utils/resolveAnchorEl.ts
|
package/dist/Popover.cjs
CHANGED
package/dist/Popover.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index-DLJ-li1B.cjs";
|
|
2
2
|
import { h as Theme } from "./themes-CUV79qWU.cjs";
|
|
3
3
|
import { n as PaperElevation, r as PaperProps } from "./index-CYTaYcm3.cjs";
|
|
4
|
-
import {
|
|
4
|
+
import { l as ModalCloseReason } from "./index-0law1kXY.cjs";
|
|
5
5
|
import { ReactNode, Ref } from "react";
|
|
6
6
|
//#region src/Popover/utils/resolveAnchorEl.d.ts
|
|
7
7
|
type PopoverAnchorEl = HTMLElement | (() => HTMLElement | null) | null;
|
package/dist/Popover.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h as Theme } from "./themes-CUV79qWU.mjs";
|
|
2
2
|
import "./index-D8b5OCLe.mjs";
|
|
3
3
|
import { n as PaperElevation, r as PaperProps } from "./index-KZUd8B5E.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { l as ModalCloseReason } from "./index-CqFd46gX.mjs";
|
|
5
5
|
import { ReactNode, Ref } from "react";
|
|
6
6
|
//#region src/Popover/utils/resolveAnchorEl.d.ts
|
|
7
7
|
type PopoverAnchorEl = HTMLElement | (() => HTMLElement | null) | null;
|
package/dist/Popover.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Popover } from "./Popover-
|
|
1
|
+
import { t as Popover } from "./Popover-mz_rnf5s.mjs";
|
|
2
2
|
export { Popover };
|
package/dist/Select.cjs
CHANGED
|
@@ -6,7 +6,7 @@ const require_Icon = require("./Icon-ByDvM-t1.cjs");
|
|
|
6
6
|
const require_FormControl = require("./FormControl.cjs");
|
|
7
7
|
const require_inputVariantStyles = require("./inputVariantStyles-BBkkYQtE.cjs");
|
|
8
8
|
const require_NativeSelect = require("./NativeSelect.cjs");
|
|
9
|
-
const require_Popover = require("./Popover-
|
|
9
|
+
const require_Popover = require("./Popover-COoJ2p2I.cjs");
|
|
10
10
|
let react = require("react");
|
|
11
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
package/dist/Select.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { t as Icon } from "./Icon-GgwNXKEY.mjs";
|
|
|
5
5
|
import { useFormControl } from "./FormControl.mjs";
|
|
6
6
|
import { t as inputVariantStyles } from "./inputVariantStyles-CcqpGfuP.mjs";
|
|
7
7
|
import { NativeSelect } from "./NativeSelect.mjs";
|
|
8
|
-
import { t as Popover } from "./Popover-
|
|
8
|
+
import { t as Popover } from "./Popover-mz_rnf5s.mjs";
|
|
9
9
|
import { Children, cloneElement, isValidElement, useCallback, useId, useState } from "react";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
//#region src/Select/hooks/useSelectPopover.ts
|
package/dist/TextInput.cjs
CHANGED
|
@@ -203,6 +203,16 @@ function TextInput({ autoComplete, autoFocus, borderRadius, classes, components,
|
|
|
203
203
|
size,
|
|
204
204
|
"aria-describedby": inputProps?.["aria-describedby"] ?? fc["aria-describedby"]
|
|
205
205
|
};
|
|
206
|
+
let inputElement = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledInput, {
|
|
207
|
+
inputComponent: resolvedInputComponent,
|
|
208
|
+
inputSize,
|
|
209
|
+
...inputElProps
|
|
210
|
+
});
|
|
211
|
+
if (isTextarea) inputElement = isAutoResize ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAutoResizeTextarea, {
|
|
212
|
+
...inputElProps,
|
|
213
|
+
minRows: minRows ?? rows,
|
|
214
|
+
maxRows
|
|
215
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTextarea, { ...inputElProps });
|
|
206
216
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextInputRoot, {
|
|
207
217
|
as: components?.Root,
|
|
208
218
|
color,
|
|
@@ -215,15 +225,7 @@ function TextInput({ autoComplete, autoFocus, borderRadius, classes, components,
|
|
|
215
225
|
className: rootClassName,
|
|
216
226
|
"data-testid": dataTestid,
|
|
217
227
|
...spaceProps,
|
|
218
|
-
children:
|
|
219
|
-
...inputElProps,
|
|
220
|
-
minRows: minRows ?? rows,
|
|
221
|
-
maxRows
|
|
222
|
-
}) : isTextarea ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTextarea, { ...inputElProps }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledInput, {
|
|
223
|
-
inputComponent: resolvedInputComponent,
|
|
224
|
-
inputSize,
|
|
225
|
-
...inputElProps
|
|
226
|
-
})
|
|
228
|
+
children: inputElement
|
|
227
229
|
});
|
|
228
230
|
}
|
|
229
231
|
//#endregion
|
package/dist/TextInput.mjs
CHANGED
|
@@ -201,6 +201,16 @@ function TextInput({ autoComplete, autoFocus, borderRadius, classes, components,
|
|
|
201
201
|
size,
|
|
202
202
|
"aria-describedby": inputProps?.["aria-describedby"] ?? fc["aria-describedby"]
|
|
203
203
|
};
|
|
204
|
+
let inputElement = /* @__PURE__ */ jsx(StyledInput, {
|
|
205
|
+
inputComponent: resolvedInputComponent,
|
|
206
|
+
inputSize,
|
|
207
|
+
...inputElProps
|
|
208
|
+
});
|
|
209
|
+
if (isTextarea) inputElement = isAutoResize ? /* @__PURE__ */ jsx(StyledAutoResizeTextarea, {
|
|
210
|
+
...inputElProps,
|
|
211
|
+
minRows: minRows ?? rows,
|
|
212
|
+
maxRows
|
|
213
|
+
}) : /* @__PURE__ */ jsx(StyledTextarea, { ...inputElProps });
|
|
204
214
|
return /* @__PURE__ */ jsx(TextInputRoot, {
|
|
205
215
|
as: components?.Root,
|
|
206
216
|
color,
|
|
@@ -213,15 +223,7 @@ function TextInput({ autoComplete, autoFocus, borderRadius, classes, components,
|
|
|
213
223
|
className: rootClassName,
|
|
214
224
|
"data-testid": dataTestid,
|
|
215
225
|
...spaceProps,
|
|
216
|
-
children:
|
|
217
|
-
...inputElProps,
|
|
218
|
-
minRows: minRows ?? rows,
|
|
219
|
-
maxRows
|
|
220
|
-
}) : isTextarea ? /* @__PURE__ */ jsx(StyledTextarea, { ...inputElProps }) : /* @__PURE__ */ jsx(StyledInput, {
|
|
221
|
-
inputComponent: resolvedInputComponent,
|
|
222
|
-
inputSize,
|
|
223
|
-
...inputElProps
|
|
224
|
-
})
|
|
226
|
+
children: inputElement
|
|
225
227
|
});
|
|
226
228
|
}
|
|
227
229
|
//#endregion
|
|
@@ -77,7 +77,10 @@ interface ManagedModal {
|
|
|
77
77
|
interface ManagedModalProps {
|
|
78
78
|
disableScrollLock?: boolean;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
/** Hides an element from assistive tech. */
|
|
81
|
+
declare function hideFromAria(element: Element): void;
|
|
82
|
+
/** Reveals an element to assistive tech again. */
|
|
83
|
+
declare function exposeToAria(element: Element): void;
|
|
81
84
|
/**
|
|
82
85
|
* Tracks every open modal and the containers they live in. A single shared
|
|
83
86
|
* instance coordinates stacking (`isTopModal`), scroll-lock, and `aria-hidden`
|
|
@@ -92,4 +95,4 @@ declare class ModalManager {
|
|
|
92
95
|
isTopModal(modal: ManagedModal): boolean;
|
|
93
96
|
}
|
|
94
97
|
//#endregion
|
|
95
|
-
export {
|
|
98
|
+
export { hideFromAria as a, ModalScroll as c, UseModalReturnValue as d, useModal as f, exposeToAria as i, ModalCloseReason as l, ManagedModalProps as n, Modal as o, ModalManager as r, ModalProps as s, ManagedModal as t, UseModalParameters as u };
|
|
@@ -77,7 +77,10 @@ interface ManagedModal {
|
|
|
77
77
|
interface ManagedModalProps {
|
|
78
78
|
disableScrollLock?: boolean;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
/** Hides an element from assistive tech. */
|
|
81
|
+
declare function hideFromAria(element: Element): void;
|
|
82
|
+
/** Reveals an element to assistive tech again. */
|
|
83
|
+
declare function exposeToAria(element: Element): void;
|
|
81
84
|
/**
|
|
82
85
|
* Tracks every open modal and the containers they live in. A single shared
|
|
83
86
|
* instance coordinates stacking (`isTopModal`), scroll-lock, and `aria-hidden`
|
|
@@ -92,4 +95,4 @@ declare class ModalManager {
|
|
|
92
95
|
isTopModal(modal: ManagedModal): boolean;
|
|
93
96
|
}
|
|
94
97
|
//#endregion
|
|
95
|
-
export {
|
|
98
|
+
export { hideFromAria as a, ModalScroll as c, UseModalReturnValue as d, useModal as f, exposeToAria as i, ModalCloseReason as l, ManagedModalProps as n, Modal as o, ModalManager as r, ModalProps as s, ManagedModal as t, UseModalParameters as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soroush.tech/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Emotion + @soroush.tech/styled-system React component library — token-driven light/dark themes, layout primitives, forms, and overlays.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|