@soroush.tech/design-system 0.1.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/LICENSE +21 -0
- package/README.md +278 -0
- package/dist/AppBar.cjs +71 -0
- package/dist/AppBar.d.cts +23 -0
- package/dist/AppBar.d.mts +23 -0
- package/dist/AppBar.mjs +69 -0
- package/dist/Avatar.cjs +106 -0
- package/dist/Avatar.d.cts +28 -0
- package/dist/Avatar.d.mts +28 -0
- package/dist/Avatar.mjs +103 -0
- package/dist/Backdrop.cjs +26 -0
- package/dist/Backdrop.d.cts +10 -0
- package/dist/Backdrop.d.mts +10 -0
- package/dist/Backdrop.mjs +25 -0
- package/dist/Button.cjs +178 -0
- package/dist/Button.d.cts +2 -0
- package/dist/Button.d.mts +2 -0
- package/dist/Button.mjs +175 -0
- package/dist/ButtonGroup.cjs +110 -0
- package/dist/ButtonGroup.d.cts +2 -0
- package/dist/ButtonGroup.d.mts +2 -0
- package/dist/ButtonGroup.mjs +107 -0
- package/dist/ButtonGroupContext-DS-kl9lG.mjs +5 -0
- package/dist/ButtonGroupContext-NtkVeDVE.cjs +9 -0
- package/dist/Card.cjs +95 -0
- package/dist/Card.d.cts +18 -0
- package/dist/Card.d.mts +18 -0
- package/dist/Card.mjs +93 -0
- package/dist/Checkbox.cjs +192 -0
- package/dist/Checkbox.d.cts +2 -0
- package/dist/Checkbox.d.mts +2 -0
- package/dist/Checkbox.mjs +190 -0
- package/dist/CircularProgress.cjs +136 -0
- package/dist/CircularProgress.d.cts +34 -0
- package/dist/CircularProgress.d.mts +34 -0
- package/dist/CircularProgress.mjs +133 -0
- package/dist/CodeBlock.cjs +101 -0
- package/dist/CodeBlock.d.cts +2 -0
- package/dist/CodeBlock.d.mts +2 -0
- package/dist/CodeBlock.mjs +100 -0
- package/dist/Drawer.cjs +69 -0
- package/dist/Drawer.d.cts +22 -0
- package/dist/Drawer.d.mts +22 -0
- package/dist/Drawer.mjs +66 -0
- package/dist/Field.cjs +59 -0
- package/dist/Field.d.cts +36 -0
- package/dist/Field.d.mts +36 -0
- package/dist/Field.mjs +58 -0
- package/dist/Flex.cjs +21 -0
- package/dist/Flex.d.cts +2 -0
- package/dist/Flex.d.mts +2 -0
- package/dist/Flex.mjs +19 -0
- package/dist/FocusTrap.cjs +82 -0
- package/dist/FocusTrap.d.cts +24 -0
- package/dist/FocusTrap.d.mts +24 -0
- package/dist/FocusTrap.mjs +81 -0
- package/dist/Form.cjs +44 -0
- package/dist/Form.d.cts +41 -0
- package/dist/Form.d.mts +41 -0
- package/dist/Form.mjs +42 -0
- package/dist/FormContext-CRmRgDgu.cjs +10 -0
- package/dist/FormContext-_G3sxJyQ.mjs +6 -0
- package/dist/FormControl.cjs +84 -0
- package/dist/FormControl.d.cts +78 -0
- package/dist/FormControl.d.mts +78 -0
- package/dist/FormControl.mjs +81 -0
- package/dist/FormControlContext-CyxdOxdN.mjs +6 -0
- package/dist/FormControlContext-aeKTjRKY.cjs +10 -0
- package/dist/FormHelperText.cjs +40 -0
- package/dist/FormHelperText.d.cts +16 -0
- package/dist/FormHelperText.d.mts +16 -0
- package/dist/FormHelperText.mjs +39 -0
- package/dist/FormLabel.cjs +34 -0
- package/dist/FormLabel.d.cts +2 -0
- package/dist/FormLabel.d.mts +2 -0
- package/dist/FormLabel.mjs +33 -0
- package/dist/Grid.cjs +37 -0
- package/dist/Grid.d.cts +21 -0
- package/dist/Grid.d.mts +21 -0
- package/dist/Grid.mjs +32 -0
- package/dist/Icon-1YtNCUKo.cjs +755 -0
- package/dist/Icon-CAKRmFz3.mjs +742 -0
- package/dist/Icon.cjs +4 -0
- package/dist/Icon.d.cts +2 -0
- package/dist/Icon.d.mts +2 -0
- package/dist/Icon.mjs +2 -0
- package/dist/Image.cjs +82 -0
- package/dist/Image.d.cts +2 -0
- package/dist/Image.d.mts +2 -0
- package/dist/Image.mjs +80 -0
- package/dist/LinearProgress.cjs +217 -0
- package/dist/LinearProgress.d.cts +36 -0
- package/dist/LinearProgress.d.mts +36 -0
- package/dist/LinearProgress.mjs +214 -0
- package/dist/Link.cjs +64 -0
- package/dist/Link.d.cts +2 -0
- package/dist/Link.d.mts +2 -0
- package/dist/Link.mjs +62 -0
- package/dist/Markdown/Control.cjs +61 -0
- package/dist/Markdown/Control.d.cts +18 -0
- package/dist/Markdown/Control.d.mts +18 -0
- package/dist/Markdown/Control.mjs +60 -0
- package/dist/Markdown/Editor.cjs +130 -0
- package/dist/Markdown/Editor.d.cts +40 -0
- package/dist/Markdown/Editor.d.mts +40 -0
- package/dist/Markdown/Editor.mjs +128 -0
- package/dist/Markdown/Preview.cjs +241 -0
- package/dist/Markdown/Preview.d.cts +55 -0
- package/dist/Markdown/Preview.d.mts +55 -0
- package/dist/Markdown/Preview.mjs +236 -0
- package/dist/Markdown/Toolbar.cjs +4 -0
- package/dist/Markdown/Toolbar.d.cts +13 -0
- package/dist/Markdown/Toolbar.d.mts +13 -0
- package/dist/Markdown/Toolbar.mjs +2 -0
- package/dist/Markdown.cjs +13 -0
- package/dist/Markdown.d.cts +80 -0
- package/dist/Markdown.d.mts +80 -0
- package/dist/Markdown.mjs +6 -0
- package/dist/MarkdownContext-BN8A3W-J.mjs +11 -0
- package/dist/MarkdownContext-DSwjzpH8.cjs +22 -0
- package/dist/MenuItem.cjs +150 -0
- package/dist/MenuItem.d.cts +51 -0
- package/dist/MenuItem.d.mts +51 -0
- package/dist/MenuItem.mjs +147 -0
- package/dist/Modal-BDMPTSXv.cjs +351 -0
- package/dist/Modal-DR60peRg.mjs +327 -0
- package/dist/Modal.cjs +6 -0
- package/dist/Modal.d.cts +2 -0
- package/dist/Modal.d.mts +2 -0
- package/dist/Modal.mjs +2 -0
- package/dist/NativeSelect.cjs +189 -0
- package/dist/NativeSelect.d.cts +62 -0
- package/dist/NativeSelect.d.mts +62 -0
- package/dist/NativeSelect.mjs +186 -0
- package/dist/Pagination/PaginationItem.cjs +116 -0
- package/dist/Pagination/PaginationItem.d.cts +2 -0
- package/dist/Pagination/PaginationItem.d.mts +2 -0
- package/dist/Pagination/PaginationItem.mjs +114 -0
- package/dist/Pagination.cjs +134 -0
- package/dist/Pagination.d.cts +23 -0
- package/dist/Pagination.d.mts +23 -0
- package/dist/Pagination.mjs +130 -0
- package/dist/Paper.cjs +51 -0
- package/dist/Paper.d.cts +2 -0
- package/dist/Paper.d.mts +2 -0
- package/dist/Paper.mjs +48 -0
- package/dist/Popover-B61J7C79.mjs +252 -0
- package/dist/Popover-CRDLmywF.cjs +259 -0
- package/dist/Popover.cjs +3 -0
- package/dist/Popover.d.cts +84 -0
- package/dist/Popover.d.mts +84 -0
- package/dist/Popover.mjs +2 -0
- package/dist/Portal.cjs +20 -0
- package/dist/Portal.d.cts +18 -0
- package/dist/Portal.d.mts +18 -0
- package/dist/Portal.mjs +19 -0
- package/dist/Quote.cjs +11 -0
- package/dist/Quote.d.cts +2 -0
- package/dist/Quote.d.mts +2 -0
- package/dist/Quote.mjs +10 -0
- package/dist/Radio.cjs +143 -0
- package/dist/Radio.d.cts +38 -0
- package/dist/Radio.d.mts +38 -0
- package/dist/Radio.mjs +141 -0
- package/dist/Select.cjs +528 -0
- package/dist/Select.d.cts +68 -0
- package/dist/Select.d.mts +68 -0
- package/dist/Select.mjs +525 -0
- package/dist/Skeleton.cjs +82 -0
- package/dist/Skeleton.d.cts +21 -0
- package/dist/Skeleton.d.mts +21 -0
- package/dist/Skeleton.mjs +79 -0
- package/dist/Switch.cjs +332 -0
- package/dist/Switch.d.cts +40 -0
- package/dist/Switch.d.mts +40 -0
- package/dist/Switch.mjs +329 -0
- package/dist/Table/Table.cjs +65 -0
- package/dist/Table/Table.d.cts +2 -0
- package/dist/Table/Table.d.mts +2 -0
- package/dist/Table/Table.mjs +63 -0
- package/dist/Table/TableBody.cjs +42 -0
- package/dist/Table/TableBody.d.cts +2 -0
- package/dist/Table/TableBody.d.mts +2 -0
- package/dist/Table/TableBody.mjs +40 -0
- package/dist/Table/TableCell.cjs +93 -0
- package/dist/Table/TableCell.d.cts +2 -0
- package/dist/Table/TableCell.d.mts +2 -0
- package/dist/Table/TableCell.mjs +91 -0
- package/dist/Table/TableContainer.cjs +15 -0
- package/dist/Table/TableContainer.d.cts +2 -0
- package/dist/Table/TableContainer.d.mts +2 -0
- package/dist/Table/TableContainer.mjs +14 -0
- package/dist/Table/TableControl.cjs +42 -0
- package/dist/Table/TableControl.d.cts +2 -0
- package/dist/Table/TableControl.d.mts +2 -0
- package/dist/Table/TableControl.mjs +41 -0
- package/dist/Table/TableFooter.cjs +42 -0
- package/dist/Table/TableFooter.d.cts +2 -0
- package/dist/Table/TableFooter.d.mts +2 -0
- package/dist/Table/TableFooter.mjs +40 -0
- package/dist/Table/TableHead.cjs +42 -0
- package/dist/Table/TableHead.d.cts +2 -0
- package/dist/Table/TableHead.d.mts +2 -0
- package/dist/Table/TableHead.mjs +40 -0
- package/dist/Table/TablePagination.cjs +89 -0
- package/dist/Table/TablePagination.d.cts +2 -0
- package/dist/Table/TablePagination.d.mts +2 -0
- package/dist/Table/TablePagination.mjs +88 -0
- package/dist/Table/TablePaginationActions.cjs +65 -0
- package/dist/Table/TablePaginationActions.d.cts +2 -0
- package/dist/Table/TablePaginationActions.d.mts +2 -0
- package/dist/Table/TablePaginationActions.mjs +63 -0
- package/dist/Table/TableRow.cjs +56 -0
- package/dist/Table/TableRow.d.cts +2 -0
- package/dist/Table/TableRow.d.mts +2 -0
- package/dist/Table/TableRow.mjs +54 -0
- package/dist/Table/TableSortLabel.cjs +62 -0
- package/dist/Table/TableSortLabel.d.cts +2 -0
- package/dist/Table/TableSortLabel.d.mts +2 -0
- package/dist/Table/TableSortLabel.mjs +60 -0
- package/dist/Table/hooks.cjs +112 -0
- package/dist/Table/hooks.d.cts +3 -0
- package/dist/Table/hooks.d.mts +3 -0
- package/dist/Table/hooks.mjs +109 -0
- package/dist/Table.cjs +31 -0
- package/dist/Table.d.cts +16 -0
- package/dist/Table.d.mts +16 -0
- package/dist/Table.mjs +15 -0
- package/dist/TableContext-2qH7XYJB.d.cts +19 -0
- package/dist/TableContext-2qH7XYJB.d.mts +19 -0
- package/dist/TableContext-BRWPghAI.mjs +6 -0
- package/dist/TableContext-qqp35o8z.cjs +10 -0
- package/dist/TableSectionContext-meIG4lFZ.mjs +5 -0
- package/dist/TableSectionContext-pYlJ-duI.cjs +9 -0
- package/dist/TextInput-6o37Zddp.cjs +231 -0
- package/dist/TextInput-D_lHYJlL.mjs +224 -0
- package/dist/TextInput.cjs +3 -0
- package/dist/TextInput.d.cts +2 -0
- package/dist/TextInput.d.mts +2 -0
- package/dist/TextInput.mjs +2 -0
- package/dist/ThemeProvider.cjs +15 -0
- package/dist/ThemeProvider.d.cts +20 -0
- package/dist/ThemeProvider.d.mts +20 -0
- package/dist/ThemeProvider.mjs +14 -0
- package/dist/ToggleButton/ToggleButton.cjs +58 -0
- package/dist/ToggleButton/ToggleButton.d.cts +14 -0
- package/dist/ToggleButton/ToggleButton.d.mts +14 -0
- package/dist/ToggleButton/ToggleButton.mjs +56 -0
- package/dist/ToggleButton/ToggleButtonGroup.cjs +54 -0
- package/dist/ToggleButton/ToggleButtonGroup.d.cts +23 -0
- package/dist/ToggleButton/ToggleButtonGroup.d.mts +23 -0
- package/dist/ToggleButton/ToggleButtonGroup.mjs +52 -0
- package/dist/ToggleButton.cjs +7 -0
- package/dist/ToggleButton.d.cts +4 -0
- package/dist/ToggleButton.d.mts +4 -0
- package/dist/ToggleButton.mjs +4 -0
- package/dist/ToggleButtonGroupContext-CqD-Afho.d.cts +15 -0
- package/dist/ToggleButtonGroupContext-CqD-Afho.d.mts +15 -0
- package/dist/ToggleButtonGroupContext-DxIyy8ze.mjs +5 -0
- package/dist/ToggleButtonGroupContext-Ewc5Ixas.cjs +9 -0
- package/dist/Toolbar-B-W22Sk4.cjs +459 -0
- package/dist/Toolbar-KbR97iJS.mjs +448 -0
- package/dist/Typography.cjs +64 -0
- package/dist/Typography.d.cts +3 -0
- package/dist/Typography.d.mts +3 -0
- package/dist/Typography.mjs +61 -0
- package/dist/View.cjs +40 -0
- package/dist/View.d.cts +2 -0
- package/dist/View.d.mts +2 -0
- package/dist/View.mjs +38 -0
- package/dist/applyAction-B2B-hnP3.mjs +98 -0
- package/dist/applyAction-B2uVHxOE.cjs +103 -0
- package/dist/createTheme-Dts2F4R_.d.cts +21 -0
- package/dist/createTheme-Dts2F4R_.d.mts +21 -0
- package/dist/hooks/useCopyToClipboard.cjs +33 -0
- package/dist/hooks/useCopyToClipboard.d.cts +16 -0
- package/dist/hooks/useCopyToClipboard.d.mts +16 -0
- package/dist/hooks/useCopyToClipboard.mjs +31 -0
- package/dist/hooks.cjs +52 -0
- package/dist/hooks.d.cts +40 -0
- package/dist/hooks.d.mts +40 -0
- package/dist/hooks.mjs +41 -0
- package/dist/index-4rC2j7fR.d.cts +46 -0
- package/dist/index-8dzWTpFp.d.cts +24 -0
- package/dist/index-B1rCD6Oo.d.cts +17 -0
- package/dist/index-BH8jQOdF.d.mts +46 -0
- package/dist/index-BLRMuO_x.d.mts +24 -0
- package/dist/index-BLfFycfJ.d.mts +72 -0
- package/dist/index-BPrjvi7B.d.cts +13 -0
- package/dist/index-BX5-NfbX.d.cts +94 -0
- package/dist/index-Bihpwn75.d.cts +64 -0
- package/dist/index-BlfIbAMs.d.cts +45 -0
- package/dist/index-BnzUumAC2.d.mts +30 -0
- package/dist/index-BoqlPb3Z.d.mts +13 -0
- package/dist/index-BqVgv2B_.d.mts +42 -0
- package/dist/index-Bwi4kRpf.d.mts +79 -0
- package/dist/index-Bx24ZnOV.d.mts +43 -0
- package/dist/index-C-P_hipv.d.mts +21 -0
- package/dist/index-C0xMvDjL.d.mts +49 -0
- package/dist/index-C5_ciaeo.d.cts +79 -0
- package/dist/index-CDVnvjIE.d.cts +27 -0
- package/dist/index-CDcGTGR4.d.cts +21 -0
- package/dist/index-CEOZI-6L.d.mts +48 -0
- package/dist/index-CLU39rUS2.d.mts +30 -0
- package/dist/index-CM_KCTee.d.cts +48 -0
- package/dist/index-CT9uGKrs.d.cts +30 -0
- package/dist/index-CcYSvIJi.d.cts +21 -0
- package/dist/index-CdF_4ckE.d.mts +11 -0
- package/dist/index-CeYkEXU2.d.cts +68 -0
- package/dist/index-Cl_yBpzW2.d.mts +13 -0
- package/dist/index-Cv_UOfYx.d.mts +18 -0
- package/dist/index-CxSNNzBT2.d.mts +68 -0
- package/dist/index-CyZYXDn0.d.cts +42 -0
- package/dist/index-DASvoACZ.d.cts +49 -0
- package/dist/index-DBGE6yKw.d.mts +16 -0
- package/dist/index-DCQ2fsDu.d.mts +40 -0
- package/dist/index-DD2AVtiR.d.cts +16 -0
- package/dist/index-DE5PtzPn.d.mts +27 -0
- package/dist/index-DOPXpr2J.d.cts +43 -0
- package/dist/index-DSCMXFTn.d.cts +30 -0
- package/dist/index-DTkQSXQD.d.cts +11 -0
- package/dist/index-DeJWkpf9.d.cts +16 -0
- package/dist/index-DeiZHSwA.d.cts +12 -0
- package/dist/index-Des8BisQ.d.mts +12 -0
- package/dist/index-Dg8-CPOO.d.cts +18 -0
- package/dist/index-DgRS5Aqv.d.mts +16 -0
- package/dist/index-Dm9HfgV6.d.mts +63 -0
- package/dist/index-DmJIuQJj.d.mts +24 -0
- package/dist/index-Dp81rWM1.d.cts +72 -0
- package/dist/index-Dtzj8X58.d.cts +40 -0
- package/dist/index-DvW2eETV.d.mts +21 -0
- package/dist/index-Dy03o__A.d.mts +94 -0
- package/dist/index-FwTocqhP.d.cts +34 -0
- package/dist/index-GVsFY00r.d.cts +21 -0
- package/dist/index-Nqco3fsM.d.cts +13 -0
- package/dist/index-g-9DZ_KQ.d.cts +28 -0
- package/dist/index-g9EThkSg.d.mts +21 -0
- package/dist/index-kpk9e3xM2.d.mts +45 -0
- package/dist/index-pX7tBQdJ.d.mts +34 -0
- package/dist/index-u57CbuAU2.d.mts +28 -0
- package/dist/index-x80UG39F.d.cts +24 -0
- package/dist/index-z35LEYG8.d.mts +17 -0
- package/dist/index.cjs +68 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +3 -0
- package/dist/inputVariantStyles-BBkkYQtE.cjs +32 -0
- package/dist/inputVariantStyles-CcqpGfuP.mjs +28 -0
- package/dist/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/dist/rolldown-runtime-DDXJien1.cjs +50 -0
- package/dist/src-BiocWFSR.cjs +60 -0
- package/dist/src-DcNT2aIK.mjs +49 -0
- package/dist/themeDefault-B-QjpGEO.cjs +16 -0
- package/dist/themeDefault-CjXaY3ok.mjs +11 -0
- package/dist/themes-D1SAp3SL.d.mts +500 -0
- package/dist/themes-D81JYbqm.d.cts +500 -0
- package/dist/themes.cjs +318 -0
- package/dist/themes.d.cts +3 -0
- package/dist/themes.d.mts +3 -0
- package/dist/themes.mjs +303 -0
- package/dist/useDefaultProps-Cb-5FNok.cjs +19 -0
- package/dist/useDefaultProps-CoApb4KT.mjs +14 -0
- package/dist/useTableSort--XMWjujs.d.cts +51 -0
- package/dist/useTableSort-CpDs4cGq.d.mts +51 -0
- package/dist/utils/styleCache.cjs +7 -0
- package/dist/utils/styleCache.d.cts +3 -0
- package/dist/utils/styleCache.d.mts +4 -0
- package/dist/utils/styleCache.mjs +5 -0
- package/dist/utils.cjs +65 -0
- package/dist/utils.d.cts +39 -0
- package/dist/utils.d.mts +39 -0
- package/dist/utils.mjs +58 -0
- package/package.json +125 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Theme } from "@emotion/react";
|
|
2
|
+
//#region src/Table/TableContext.d.ts
|
|
3
|
+
/** Cell padding modes broadcast from `Table` to descendant cells. */
|
|
4
|
+
type TableCellPadding = 'normal' | 'none';
|
|
5
|
+
/** Table-wide cell config, provided by `Table` and consumed by `TableCell` / `TableSortLabel`. */
|
|
6
|
+
interface TableContextValue {
|
|
7
|
+
size?: keyof Theme['sizes'];
|
|
8
|
+
cellPadding?: TableCellPadding;
|
|
9
|
+
hasStickyHeader?: boolean;
|
|
10
|
+
/** Palette color for descendant rows' hover/selected shading — a row's own `color` wins. */
|
|
11
|
+
color?: keyof Theme['palette'];
|
|
12
|
+
/** Hides inactive sort icons (revealed on hover/focus). */
|
|
13
|
+
shouldHideSortIcon?: boolean;
|
|
14
|
+
/** Truncates overflowing cell text with an ellipsis. */
|
|
15
|
+
hasEllipsis?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const TableContext: import("react").Context<TableContextValue>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TableContext as n, TableContextValue as r, TableCellPadding as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
require("@emotion/react");
|
|
2
|
+
//#region src/Table/TableContext.ts
|
|
3
|
+
const TableContext = (0, require("react").createContext)({});
|
|
4
|
+
//#endregion
|
|
5
|
+
Object.defineProperty(exports, "TableContext", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return TableContext;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/Table/TableSectionContext.ts
|
|
2
|
+
const TableSectionContext = (0, require("react").createContext)(void 0);
|
|
3
|
+
//#endregion
|
|
4
|
+
Object.defineProperty(exports, "TableSectionContext", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return TableSectionContext;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
const require_src = require("./src-BiocWFSR.cjs");
|
|
2
|
+
const require_themeDefault = require("./themeDefault-B-QjpGEO.cjs");
|
|
3
|
+
const require_FormControl = require("./FormControl.cjs");
|
|
4
|
+
const require_inputVariantStyles = require("./inputVariantStyles-BBkkYQtE.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let _soroush_tech_styled_system_should_forward_prop = require("@soroush.tech/styled-system/should-forward-prop");
|
|
8
|
+
let _emotion_react = require("@emotion/react");
|
|
9
|
+
//#region src/TextInput/TextAreaAutoResize.tsx
|
|
10
|
+
const adjust = (el, minRows, maxRows) => {
|
|
11
|
+
const style = getComputedStyle(el);
|
|
12
|
+
const lineHeight = Number.parseFloat(style.lineHeight) || Number.parseFloat(style.fontSize) * 1.2;
|
|
13
|
+
const paddingY = Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom);
|
|
14
|
+
el.style.height = "auto";
|
|
15
|
+
const scrollHeight = el.scrollHeight;
|
|
16
|
+
const min = minRows == null ? 0 : Number(minRows) * lineHeight + paddingY;
|
|
17
|
+
const max = maxRows == null ? Infinity : Number(maxRows) * lineHeight + paddingY;
|
|
18
|
+
el.style.height = `${Math.min(max, Math.max(min, scrollHeight))}px`;
|
|
19
|
+
el.style.overflow = scrollHeight > max ? "auto" : "hidden";
|
|
20
|
+
};
|
|
21
|
+
const TextAreaAutoResize = (0, react.forwardRef)(function TextAreaAutoResize({ value, onChange, minRows, maxRows, ...rest }, forwardedRef) {
|
|
22
|
+
const innerRef = (0, react.useRef)(null);
|
|
23
|
+
const setRef = (0, react.useCallback)((el) => {
|
|
24
|
+
innerRef.current = el;
|
|
25
|
+
if (typeof forwardedRef === "function") forwardedRef(el);
|
|
26
|
+
else if (forwardedRef) forwardedRef.current = el;
|
|
27
|
+
}, [forwardedRef]);
|
|
28
|
+
(0, react.useLayoutEffect)(() => {
|
|
29
|
+
adjust(innerRef.current, minRows, maxRows);
|
|
30
|
+
}, [
|
|
31
|
+
value,
|
|
32
|
+
minRows,
|
|
33
|
+
maxRows
|
|
34
|
+
]);
|
|
35
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
36
|
+
ref: setRef,
|
|
37
|
+
value,
|
|
38
|
+
onChange: (0, react.useCallback)((e) => {
|
|
39
|
+
adjust(e.currentTarget, minRows, maxRows);
|
|
40
|
+
onChange?.(e);
|
|
41
|
+
}, [
|
|
42
|
+
onChange,
|
|
43
|
+
minRows,
|
|
44
|
+
maxRows
|
|
45
|
+
]),
|
|
46
|
+
...rest
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/TextInput/TextInput.tsx
|
|
51
|
+
const shouldForwardProp = (0, _soroush_tech_styled_system_should_forward_prop.createShouldForwardProp)([
|
|
52
|
+
..._soroush_tech_styled_system_should_forward_prop.props,
|
|
53
|
+
"as",
|
|
54
|
+
"color",
|
|
55
|
+
"textColor",
|
|
56
|
+
"variant",
|
|
57
|
+
"error",
|
|
58
|
+
"disabled",
|
|
59
|
+
"fullWidth"
|
|
60
|
+
]);
|
|
61
|
+
const baseStyle = {
|
|
62
|
+
display: "inline-flex",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
transition: "border-color 0.15s ease"
|
|
65
|
+
};
|
|
66
|
+
const backgroundStyle = ({ theme, textColor = require_themeDefault.themeDefault(theme, "accentTextColor", "primary") }) => {
|
|
67
|
+
return {
|
|
68
|
+
backgroundColor: (0, require_src.src_exports.get)(theme, `background.${require_themeDefault.themeDefault(theme, "inputBg", "terminal")}`),
|
|
69
|
+
color: (0, require_src.src_exports.get)(theme, `text.${textColor}`),
|
|
70
|
+
fontFamily: (0, require_src.src_exports.get)(theme, "fonts.body"),
|
|
71
|
+
fontSize: (0, require_src.src_exports.get)(theme, "fontSizes.1"),
|
|
72
|
+
lineHeight: (0, require_src.src_exports.get)(theme, "lineHeights.base")
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const colorBorder = ({ theme, color = require_themeDefault.themeDefault(theme, "color", "primary"), error }) => {
|
|
76
|
+
return { borderColor: error ? (0, require_src.src_exports.get)(theme, "palette.error.main") : (0, require_src.src_exports.get)(theme, `palette.${color}.light`) };
|
|
77
|
+
};
|
|
78
|
+
const focusVisibleRing = ({ theme }) => ({ "&:has(:focus-visible)": {
|
|
79
|
+
outline: `2px solid ${(0, require_src.src_exports.get)(theme, `palette.${require_themeDefault.themeDefault(theme, "color", "primary")}.main`)}`,
|
|
80
|
+
outlineOffset: "2px"
|
|
81
|
+
} });
|
|
82
|
+
const focusWithinColor = ({ theme, color = require_themeDefault.themeDefault(theme, "color", "primary"), error }) => ({ "&:focus-within": { borderColor: error ? (0, require_src.src_exports.get)(theme, "palette.error.main") : (0, require_src.src_exports.get)(theme, `palette.${color}.main`) } });
|
|
83
|
+
const borderRadiusStyle = ({ variant: v = "default", borderRadius, theme }) => {
|
|
84
|
+
if (v === "underline" || v === "text" || !borderRadius) return {};
|
|
85
|
+
return { borderRadius: (0, require_src.src_exports.get)(theme, `radii.${borderRadius}`) };
|
|
86
|
+
};
|
|
87
|
+
const layoutStyles = ({ fullWidth, disabled }) => ({
|
|
88
|
+
...fullWidth ? {
|
|
89
|
+
display: "flex",
|
|
90
|
+
width: "100%"
|
|
91
|
+
} : {},
|
|
92
|
+
...disabled ? {
|
|
93
|
+
opacity: .5,
|
|
94
|
+
cursor: "not-allowed",
|
|
95
|
+
pointerEvents: "none"
|
|
96
|
+
} : {}
|
|
97
|
+
});
|
|
98
|
+
const nativeBaseStyles = {
|
|
99
|
+
flex: 1,
|
|
100
|
+
minWidth: 0,
|
|
101
|
+
width: "100%",
|
|
102
|
+
border: "none",
|
|
103
|
+
outline: "none",
|
|
104
|
+
background: "transparent",
|
|
105
|
+
color: "inherit",
|
|
106
|
+
fontFamily: "inherit",
|
|
107
|
+
lineHeight: "inherit",
|
|
108
|
+
"&::placeholder": {
|
|
109
|
+
color: "inherit",
|
|
110
|
+
opacity: .5
|
|
111
|
+
},
|
|
112
|
+
"&:disabled": { cursor: "not-allowed" }
|
|
113
|
+
};
|
|
114
|
+
const textAreaBaseStyles = {
|
|
115
|
+
resize: "none",
|
|
116
|
+
overflow: "auto"
|
|
117
|
+
};
|
|
118
|
+
function InputBase({ inputSize, inputComponent, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(inputComponent ?? "input", {
|
|
120
|
+
...props,
|
|
121
|
+
size: inputSize
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const widthStyles = (0, require_src.src_exports.system)({
|
|
125
|
+
width: true,
|
|
126
|
+
minWidth: true,
|
|
127
|
+
maxWidth: true
|
|
128
|
+
});
|
|
129
|
+
const sizeVariants = ({ theme, size }) => {
|
|
130
|
+
const s = theme.sizes[size];
|
|
131
|
+
return {
|
|
132
|
+
paddingTop: theme.space[s.paddingTop],
|
|
133
|
+
paddingBottom: theme.space[s.paddingBottom],
|
|
134
|
+
paddingLeft: theme.space[s.paddingLeft],
|
|
135
|
+
paddingRight: theme.space[s.paddingRight],
|
|
136
|
+
fontSize: theme.fontSizes[s.fontSize]
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
const TextInputRoot = require_src.styled("div", {
|
|
140
|
+
name: "TextInput",
|
|
141
|
+
label: "TextInput",
|
|
142
|
+
shouldForwardProp,
|
|
143
|
+
systemProps: [require_src.src_exports.space, widthStyles]
|
|
144
|
+
})(baseStyle, require_inputVariantStyles.inputVariantStyles, borderRadiusStyle, colorBorder, focusWithinColor, focusVisibleRing, backgroundStyle, layoutStyles);
|
|
145
|
+
const StyledInput = require_src.styled(InputBase, {
|
|
146
|
+
name: "TextInput",
|
|
147
|
+
slot: "input",
|
|
148
|
+
label: "TextInputInput"
|
|
149
|
+
})(nativeBaseStyles, sizeVariants);
|
|
150
|
+
const shouldForwardInputProps = (prop) => prop !== "size";
|
|
151
|
+
const StyledTextarea = require_src.styled("textarea", {
|
|
152
|
+
name: "TextInput",
|
|
153
|
+
slot: "input",
|
|
154
|
+
label: "TextInputTextarea",
|
|
155
|
+
shouldForwardProp: shouldForwardInputProps
|
|
156
|
+
})(nativeBaseStyles, textAreaBaseStyles, sizeVariants);
|
|
157
|
+
const StyledAutoResizeTextarea = require_src.styled(TextAreaAutoResize, {
|
|
158
|
+
name: "TextInput",
|
|
159
|
+
slot: "input",
|
|
160
|
+
label: "TextInputTextarea",
|
|
161
|
+
shouldForwardProp: shouldForwardInputProps
|
|
162
|
+
})(nativeBaseStyles, textAreaBaseStyles, sizeVariants);
|
|
163
|
+
function TextInput({ autoComplete, autoFocus, borderRadius, classes, components, color: colorProp, textColor: textColorProp, disabled: disabledProp, error: errorProp, fullWidth: fullWidthProp, id: idProp, inputComponent, inputProps, inputSize, maxRows, minRows, multiline = false, name, onChange, placeholder, readOnly, required: requiredProp, resize = false, rows, size: sizeProp, type = "text", value, variant: variantProp, className, "data-testid": dataTestid, ...spaceProps }) {
|
|
164
|
+
const fc = require_FormControl.useFormControl({
|
|
165
|
+
id: idProp,
|
|
166
|
+
error: errorProp,
|
|
167
|
+
disabled: disabledProp,
|
|
168
|
+
required: requiredProp,
|
|
169
|
+
size: sizeProp,
|
|
170
|
+
fullWidth: fullWidthProp,
|
|
171
|
+
color: colorProp,
|
|
172
|
+
textColor: textColorProp
|
|
173
|
+
});
|
|
174
|
+
const { id, error, disabled, required, size, fullWidth } = fc;
|
|
175
|
+
const theme = (0, _emotion_react.useTheme)();
|
|
176
|
+
const color = fc.color ?? require_themeDefault.themeDefault(theme, "color", "primary");
|
|
177
|
+
const textColor = fc.textColor ?? require_themeDefault.themeDefault(theme, "accentTextColor", "primary");
|
|
178
|
+
const variant = variantProp ?? require_themeDefault.themeDefault(theme, "inputVariant", "default");
|
|
179
|
+
const isAutoResize = resize;
|
|
180
|
+
const isMultiline = multiline || rows !== void 0 && Number(rows) > 1;
|
|
181
|
+
const isTextarea = (isAutoResize || isMultiline) && (!type || type === "text");
|
|
182
|
+
const rootClassName = [className, classes?.root].filter(Boolean).join(" ") || void 0;
|
|
183
|
+
const resolvedInputComponent = inputComponent ?? components?.Input;
|
|
184
|
+
const inputElProps = {
|
|
185
|
+
...inputProps,
|
|
186
|
+
id,
|
|
187
|
+
name,
|
|
188
|
+
disabled,
|
|
189
|
+
required,
|
|
190
|
+
autoComplete,
|
|
191
|
+
autoFocus,
|
|
192
|
+
placeholder,
|
|
193
|
+
readOnly,
|
|
194
|
+
onChange,
|
|
195
|
+
value,
|
|
196
|
+
className: classes?.input,
|
|
197
|
+
type: isTextarea ? void 0 : type,
|
|
198
|
+
rows: isMultiline && rows !== void 0 ? Number(rows) : void 0,
|
|
199
|
+
size,
|
|
200
|
+
"aria-describedby": inputProps?.["aria-describedby"] ?? fc["aria-describedby"]
|
|
201
|
+
};
|
|
202
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TextInputRoot, {
|
|
203
|
+
as: components?.Root,
|
|
204
|
+
color,
|
|
205
|
+
textColor,
|
|
206
|
+
variant,
|
|
207
|
+
error,
|
|
208
|
+
disabled,
|
|
209
|
+
fullWidth,
|
|
210
|
+
borderRadius,
|
|
211
|
+
className: rootClassName,
|
|
212
|
+
"data-testid": dataTestid,
|
|
213
|
+
...spaceProps,
|
|
214
|
+
children: isTextarea && isAutoResize ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledAutoResizeTextarea, {
|
|
215
|
+
...inputElProps,
|
|
216
|
+
minRows: minRows ?? rows,
|
|
217
|
+
maxRows
|
|
218
|
+
}) : isTextarea ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTextarea, { ...inputElProps }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledInput, {
|
|
219
|
+
inputComponent: resolvedInputComponent,
|
|
220
|
+
inputSize,
|
|
221
|
+
...inputElProps
|
|
222
|
+
})
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
226
|
+
Object.defineProperty(exports, "TextInput", {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
get: function() {
|
|
229
|
+
return TextInput;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { a as createShouldForwardProp, c as props, d as styled, l as src_exports, u as useTheme } from "./src-DcNT2aIK.mjs";
|
|
2
|
+
import { t as themeDefault } from "./themeDefault-CjXaY3ok.mjs";
|
|
3
|
+
import { useFormControl } from "./FormControl.mjs";
|
|
4
|
+
import { t as inputVariantStyles } from "./inputVariantStyles-CcqpGfuP.mjs";
|
|
5
|
+
import { forwardRef, useCallback, useLayoutEffect, useRef } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/TextInput/TextAreaAutoResize.tsx
|
|
8
|
+
const adjust = (el, minRows, maxRows) => {
|
|
9
|
+
const style = getComputedStyle(el);
|
|
10
|
+
const lineHeight = Number.parseFloat(style.lineHeight) || Number.parseFloat(style.fontSize) * 1.2;
|
|
11
|
+
const paddingY = Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom);
|
|
12
|
+
el.style.height = "auto";
|
|
13
|
+
const scrollHeight = el.scrollHeight;
|
|
14
|
+
const min = minRows == null ? 0 : Number(minRows) * lineHeight + paddingY;
|
|
15
|
+
const max = maxRows == null ? Infinity : Number(maxRows) * lineHeight + paddingY;
|
|
16
|
+
el.style.height = `${Math.min(max, Math.max(min, scrollHeight))}px`;
|
|
17
|
+
el.style.overflow = scrollHeight > max ? "auto" : "hidden";
|
|
18
|
+
};
|
|
19
|
+
const TextAreaAutoResize = forwardRef(function TextAreaAutoResize({ value, onChange, minRows, maxRows, ...rest }, forwardedRef) {
|
|
20
|
+
const innerRef = useRef(null);
|
|
21
|
+
const setRef = useCallback((el) => {
|
|
22
|
+
innerRef.current = el;
|
|
23
|
+
if (typeof forwardedRef === "function") forwardedRef(el);
|
|
24
|
+
else if (forwardedRef) forwardedRef.current = el;
|
|
25
|
+
}, [forwardedRef]);
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
adjust(innerRef.current, minRows, maxRows);
|
|
28
|
+
}, [
|
|
29
|
+
value,
|
|
30
|
+
minRows,
|
|
31
|
+
maxRows
|
|
32
|
+
]);
|
|
33
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
34
|
+
ref: setRef,
|
|
35
|
+
value,
|
|
36
|
+
onChange: useCallback((e) => {
|
|
37
|
+
adjust(e.currentTarget, minRows, maxRows);
|
|
38
|
+
onChange?.(e);
|
|
39
|
+
}, [
|
|
40
|
+
onChange,
|
|
41
|
+
minRows,
|
|
42
|
+
maxRows
|
|
43
|
+
]),
|
|
44
|
+
...rest
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/TextInput/TextInput.tsx
|
|
49
|
+
const shouldForwardProp = createShouldForwardProp([
|
|
50
|
+
...props,
|
|
51
|
+
"as",
|
|
52
|
+
"color",
|
|
53
|
+
"textColor",
|
|
54
|
+
"variant",
|
|
55
|
+
"error",
|
|
56
|
+
"disabled",
|
|
57
|
+
"fullWidth"
|
|
58
|
+
]);
|
|
59
|
+
const baseStyle = {
|
|
60
|
+
display: "inline-flex",
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
transition: "border-color 0.15s ease"
|
|
63
|
+
};
|
|
64
|
+
const backgroundStyle = ({ theme, textColor = themeDefault(theme, "accentTextColor", "primary") }) => {
|
|
65
|
+
return {
|
|
66
|
+
backgroundColor: (0, src_exports.get)(theme, `background.${themeDefault(theme, "inputBg", "terminal")}`),
|
|
67
|
+
color: (0, src_exports.get)(theme, `text.${textColor}`),
|
|
68
|
+
fontFamily: (0, src_exports.get)(theme, "fonts.body"),
|
|
69
|
+
fontSize: (0, src_exports.get)(theme, "fontSizes.1"),
|
|
70
|
+
lineHeight: (0, src_exports.get)(theme, "lineHeights.base")
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const colorBorder = ({ theme, color = themeDefault(theme, "color", "primary"), error }) => {
|
|
74
|
+
return { borderColor: error ? (0, src_exports.get)(theme, "palette.error.main") : (0, src_exports.get)(theme, `palette.${color}.light`) };
|
|
75
|
+
};
|
|
76
|
+
const focusVisibleRing = ({ theme }) => ({ "&:has(:focus-visible)": {
|
|
77
|
+
outline: `2px solid ${(0, src_exports.get)(theme, `palette.${themeDefault(theme, "color", "primary")}.main`)}`,
|
|
78
|
+
outlineOffset: "2px"
|
|
79
|
+
} });
|
|
80
|
+
const focusWithinColor = ({ theme, color = themeDefault(theme, "color", "primary"), error }) => ({ "&:focus-within": { borderColor: error ? (0, src_exports.get)(theme, "palette.error.main") : (0, src_exports.get)(theme, `palette.${color}.main`) } });
|
|
81
|
+
const borderRadiusStyle = ({ variant: v = "default", borderRadius, theme }) => {
|
|
82
|
+
if (v === "underline" || v === "text" || !borderRadius) return {};
|
|
83
|
+
return { borderRadius: (0, src_exports.get)(theme, `radii.${borderRadius}`) };
|
|
84
|
+
};
|
|
85
|
+
const layoutStyles = ({ fullWidth, disabled }) => ({
|
|
86
|
+
...fullWidth ? {
|
|
87
|
+
display: "flex",
|
|
88
|
+
width: "100%"
|
|
89
|
+
} : {},
|
|
90
|
+
...disabled ? {
|
|
91
|
+
opacity: .5,
|
|
92
|
+
cursor: "not-allowed",
|
|
93
|
+
pointerEvents: "none"
|
|
94
|
+
} : {}
|
|
95
|
+
});
|
|
96
|
+
const nativeBaseStyles = {
|
|
97
|
+
flex: 1,
|
|
98
|
+
minWidth: 0,
|
|
99
|
+
width: "100%",
|
|
100
|
+
border: "none",
|
|
101
|
+
outline: "none",
|
|
102
|
+
background: "transparent",
|
|
103
|
+
color: "inherit",
|
|
104
|
+
fontFamily: "inherit",
|
|
105
|
+
lineHeight: "inherit",
|
|
106
|
+
"&::placeholder": {
|
|
107
|
+
color: "inherit",
|
|
108
|
+
opacity: .5
|
|
109
|
+
},
|
|
110
|
+
"&:disabled": { cursor: "not-allowed" }
|
|
111
|
+
};
|
|
112
|
+
const textAreaBaseStyles = {
|
|
113
|
+
resize: "none",
|
|
114
|
+
overflow: "auto"
|
|
115
|
+
};
|
|
116
|
+
function InputBase({ inputSize, inputComponent, ...props }) {
|
|
117
|
+
return /* @__PURE__ */ jsx(inputComponent ?? "input", {
|
|
118
|
+
...props,
|
|
119
|
+
size: inputSize
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const widthStyles = (0, src_exports.system)({
|
|
123
|
+
width: true,
|
|
124
|
+
minWidth: true,
|
|
125
|
+
maxWidth: true
|
|
126
|
+
});
|
|
127
|
+
const sizeVariants = ({ theme, size }) => {
|
|
128
|
+
const s = theme.sizes[size];
|
|
129
|
+
return {
|
|
130
|
+
paddingTop: theme.space[s.paddingTop],
|
|
131
|
+
paddingBottom: theme.space[s.paddingBottom],
|
|
132
|
+
paddingLeft: theme.space[s.paddingLeft],
|
|
133
|
+
paddingRight: theme.space[s.paddingRight],
|
|
134
|
+
fontSize: theme.fontSizes[s.fontSize]
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
const TextInputRoot = styled("div", {
|
|
138
|
+
name: "TextInput",
|
|
139
|
+
label: "TextInput",
|
|
140
|
+
shouldForwardProp,
|
|
141
|
+
systemProps: [src_exports.space, widthStyles]
|
|
142
|
+
})(baseStyle, inputVariantStyles, borderRadiusStyle, colorBorder, focusWithinColor, focusVisibleRing, backgroundStyle, layoutStyles);
|
|
143
|
+
const StyledInput = styled(InputBase, {
|
|
144
|
+
name: "TextInput",
|
|
145
|
+
slot: "input",
|
|
146
|
+
label: "TextInputInput"
|
|
147
|
+
})(nativeBaseStyles, sizeVariants);
|
|
148
|
+
const shouldForwardInputProps = (prop) => prop !== "size";
|
|
149
|
+
const StyledTextarea = styled("textarea", {
|
|
150
|
+
name: "TextInput",
|
|
151
|
+
slot: "input",
|
|
152
|
+
label: "TextInputTextarea",
|
|
153
|
+
shouldForwardProp: shouldForwardInputProps
|
|
154
|
+
})(nativeBaseStyles, textAreaBaseStyles, sizeVariants);
|
|
155
|
+
const StyledAutoResizeTextarea = styled(TextAreaAutoResize, {
|
|
156
|
+
name: "TextInput",
|
|
157
|
+
slot: "input",
|
|
158
|
+
label: "TextInputTextarea",
|
|
159
|
+
shouldForwardProp: shouldForwardInputProps
|
|
160
|
+
})(nativeBaseStyles, textAreaBaseStyles, sizeVariants);
|
|
161
|
+
function TextInput({ autoComplete, autoFocus, borderRadius, classes, components, color: colorProp, textColor: textColorProp, disabled: disabledProp, error: errorProp, fullWidth: fullWidthProp, id: idProp, inputComponent, inputProps, inputSize, maxRows, minRows, multiline = false, name, onChange, placeholder, readOnly, required: requiredProp, resize = false, rows, size: sizeProp, type = "text", value, variant: variantProp, className, "data-testid": dataTestid, ...spaceProps }) {
|
|
162
|
+
const fc = useFormControl({
|
|
163
|
+
id: idProp,
|
|
164
|
+
error: errorProp,
|
|
165
|
+
disabled: disabledProp,
|
|
166
|
+
required: requiredProp,
|
|
167
|
+
size: sizeProp,
|
|
168
|
+
fullWidth: fullWidthProp,
|
|
169
|
+
color: colorProp,
|
|
170
|
+
textColor: textColorProp
|
|
171
|
+
});
|
|
172
|
+
const { id, error, disabled, required, size, fullWidth } = fc;
|
|
173
|
+
const theme = useTheme();
|
|
174
|
+
const color = fc.color ?? themeDefault(theme, "color", "primary");
|
|
175
|
+
const textColor = fc.textColor ?? themeDefault(theme, "accentTextColor", "primary");
|
|
176
|
+
const variant = variantProp ?? themeDefault(theme, "inputVariant", "default");
|
|
177
|
+
const isAutoResize = resize;
|
|
178
|
+
const isMultiline = multiline || rows !== void 0 && Number(rows) > 1;
|
|
179
|
+
const isTextarea = (isAutoResize || isMultiline) && (!type || type === "text");
|
|
180
|
+
const rootClassName = [className, classes?.root].filter(Boolean).join(" ") || void 0;
|
|
181
|
+
const resolvedInputComponent = inputComponent ?? components?.Input;
|
|
182
|
+
const inputElProps = {
|
|
183
|
+
...inputProps,
|
|
184
|
+
id,
|
|
185
|
+
name,
|
|
186
|
+
disabled,
|
|
187
|
+
required,
|
|
188
|
+
autoComplete,
|
|
189
|
+
autoFocus,
|
|
190
|
+
placeholder,
|
|
191
|
+
readOnly,
|
|
192
|
+
onChange,
|
|
193
|
+
value,
|
|
194
|
+
className: classes?.input,
|
|
195
|
+
type: isTextarea ? void 0 : type,
|
|
196
|
+
rows: isMultiline && rows !== void 0 ? Number(rows) : void 0,
|
|
197
|
+
size,
|
|
198
|
+
"aria-describedby": inputProps?.["aria-describedby"] ?? fc["aria-describedby"]
|
|
199
|
+
};
|
|
200
|
+
return /* @__PURE__ */ jsx(TextInputRoot, {
|
|
201
|
+
as: components?.Root,
|
|
202
|
+
color,
|
|
203
|
+
textColor,
|
|
204
|
+
variant,
|
|
205
|
+
error,
|
|
206
|
+
disabled,
|
|
207
|
+
fullWidth,
|
|
208
|
+
borderRadius,
|
|
209
|
+
className: rootClassName,
|
|
210
|
+
"data-testid": dataTestid,
|
|
211
|
+
...spaceProps,
|
|
212
|
+
children: isTextarea && isAutoResize ? /* @__PURE__ */ jsx(StyledAutoResizeTextarea, {
|
|
213
|
+
...inputElProps,
|
|
214
|
+
minRows: minRows ?? rows,
|
|
215
|
+
maxRows
|
|
216
|
+
}) : isTextarea ? /* @__PURE__ */ jsx(StyledTextarea, { ...inputElProps }) : /* @__PURE__ */ jsx(StyledInput, {
|
|
217
|
+
inputComponent: resolvedInputComponent,
|
|
218
|
+
inputSize,
|
|
219
|
+
...inputElProps
|
|
220
|
+
})
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
export { TextInput as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as TextInputSize, i as TextInputProps, n as TextInputClasses, o as TextInputTextColor, r as TextInputColor, s as TextInputVariant, t as TextInput } from "./index-C5_ciaeo.cjs";
|
|
2
|
+
export { TextInput, TextInputClasses, TextInputColor, TextInputProps, TextInputSize, TextInputTextColor, TextInputVariant };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as TextInputSize, i as TextInputProps, n as TextInputClasses, o as TextInputTextColor, r as TextInputColor, s as TextInputVariant, t as TextInput } from "./index-Bwi4kRpf.mjs";
|
|
2
|
+
export { TextInput, TextInputClasses, TextInputColor, TextInputProps, TextInputSize, TextInputTextColor, TextInputVariant };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_utils = require("./utils.cjs");
|
|
3
|
+
const require_themes = require("./themes.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _emotion_react = require("@emotion/react");
|
|
7
|
+
//#region src/ThemeProvider/ThemeProvider.tsx
|
|
8
|
+
function ThemeProvider({ children, theme = require_themes.baseTheme, defaults }) {
|
|
9
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_emotion_react.ThemeProvider, {
|
|
10
|
+
theme: (0, react.useMemo)(() => defaults ? require_utils.createTheme(theme, { defaults }) : theme, [theme, defaults]),
|
|
11
|
+
children
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.ThemeProvider = ThemeProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { f as Theme, v as ThemeDefaults } from "./themes-D81JYbqm.cjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/ThemeProvider/ThemeProvider.d.ts
|
|
4
|
+
interface ThemeProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* The active theme. Bring one theme, or as many as you like — switching
|
|
8
|
+
* between them is your state, not the provider's. Defaults to the built-in
|
|
9
|
+
* `baseTheme`.
|
|
10
|
+
*/
|
|
11
|
+
theme?: Theme;
|
|
12
|
+
/**
|
|
13
|
+
* Optional component default token/variant keys, merged into the theme
|
|
14
|
+
* (e.g. `{ size: 'compact' }` makes every sized component default to your key).
|
|
15
|
+
*/
|
|
16
|
+
defaults?: ThemeDefaults;
|
|
17
|
+
}
|
|
18
|
+
declare function ThemeProvider({ children, theme, defaults }: Readonly<ThemeProviderProps>): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ThemeProvider };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { f as Theme, v as ThemeDefaults } from "./themes-D1SAp3SL.mjs";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/ThemeProvider/ThemeProvider.d.ts
|
|
4
|
+
interface ThemeProviderProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* The active theme. Bring one theme, or as many as you like — switching
|
|
8
|
+
* between them is your state, not the provider's. Defaults to the built-in
|
|
9
|
+
* `baseTheme`.
|
|
10
|
+
*/
|
|
11
|
+
theme?: Theme;
|
|
12
|
+
/**
|
|
13
|
+
* Optional component default token/variant keys, merged into the theme
|
|
14
|
+
* (e.g. `{ size: 'compact' }` makes every sized component default to your key).
|
|
15
|
+
*/
|
|
16
|
+
defaults?: ThemeDefaults;
|
|
17
|
+
}
|
|
18
|
+
declare function ThemeProvider({ children, theme, defaults }: Readonly<ThemeProviderProps>): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ThemeProvider };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as EmotionThemeProvider } from "./src-DcNT2aIK.mjs";
|
|
2
|
+
import { createTheme } from "./utils.mjs";
|
|
3
|
+
import { baseTheme } from "./themes.mjs";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/ThemeProvider/ThemeProvider.tsx
|
|
7
|
+
function ThemeProvider({ children, theme = baseTheme, defaults }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(EmotionThemeProvider, {
|
|
9
|
+
theme: useMemo(() => defaults ? createTheme(theme, { defaults }) : theme, [theme, defaults]),
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ThemeProvider };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_src = require("../src-BiocWFSR.cjs");
|
|
3
|
+
const require_themeDefault = require("../themeDefault-B-QjpGEO.cjs");
|
|
4
|
+
const require_utils = require("../utils.cjs");
|
|
5
|
+
const require_ButtonGroupContext = require("../ButtonGroupContext-NtkVeDVE.cjs");
|
|
6
|
+
const require_Button = require("../Button.cjs");
|
|
7
|
+
const require_ToggleButtonGroupContext = require("../ToggleButtonGroupContext-Ewc5Ixas.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let _emotion_react = require("@emotion/react");
|
|
11
|
+
//#region src/ToggleButton/ToggleButton/ToggleButton.tsx
|
|
12
|
+
const stateStyles = ({ theme, color = require_themeDefault.themeDefault(theme, "neutralColor", "default"), isSelected }) => {
|
|
13
|
+
const c = theme.palette[color];
|
|
14
|
+
if (isSelected) return {
|
|
15
|
+
backgroundColor: require_utils.alpha(c.main, .16),
|
|
16
|
+
color: c.main,
|
|
17
|
+
borderColor: c.main,
|
|
18
|
+
"&:hover:not(:disabled)": { backgroundColor: require_utils.alpha(c.main, .24) },
|
|
19
|
+
"&:active:not(:disabled)": { backgroundColor: require_utils.alpha(c.main, .24) }
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
color: (0, require_src.src_exports.get)(theme, "text.primary"),
|
|
23
|
+
borderColor: (0, require_src.src_exports.get)(theme, "border.light")
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const ToggleButtonRoot = require_src.styled(require_Button.Button, {
|
|
27
|
+
name: "ToggleButton",
|
|
28
|
+
label: "ToggleButton",
|
|
29
|
+
shouldForwardProp: (prop) => prop !== "isSelected"
|
|
30
|
+
})(stateStyles);
|
|
31
|
+
const isValueSelected = (value, groupValue) => {
|
|
32
|
+
if (groupValue == null) return false;
|
|
33
|
+
return Array.isArray(groupValue) ? groupValue.includes(value) : groupValue === value;
|
|
34
|
+
};
|
|
35
|
+
function ToggleButton({ value, isSelected, color, onChange, onClick, type = "button", ...rest }) {
|
|
36
|
+
const group = (0, react.useContext)(require_ToggleButtonGroupContext.ToggleButtonGroupContext);
|
|
37
|
+
const buttonGroup = (0, react.useContext)(require_ButtonGroupContext.ButtonGroupContext);
|
|
38
|
+
const theme = (0, _emotion_react.useTheme)();
|
|
39
|
+
const selected = isSelected ?? isValueSelected(value, group.value);
|
|
40
|
+
const resolvedColor = color ?? buttonGroup.color ?? require_themeDefault.themeDefault(theme, "neutralColor", "default");
|
|
41
|
+
const handleClick = (event) => {
|
|
42
|
+
onClick?.(event);
|
|
43
|
+
group.onToggle?.(value);
|
|
44
|
+
onChange?.(value);
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleButtonRoot, {
|
|
47
|
+
type,
|
|
48
|
+
variant: "outlined",
|
|
49
|
+
isSelected: selected,
|
|
50
|
+
color: resolvedColor,
|
|
51
|
+
"aria-pressed": selected,
|
|
52
|
+
onClick: handleClick,
|
|
53
|
+
value,
|
|
54
|
+
...rest
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
exports.ToggleButton = ToggleButton;
|