@soroush.tech/design-system 0.1.0 → 1.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/README.md +47 -36
- package/dist/AppBar.cjs +2 -2
- package/dist/AppBar.d.cts +3 -2
- package/dist/AppBar.d.mts +3 -2
- package/dist/AppBar.mjs +2 -2
- package/dist/Avatar.cjs +4 -4
- package/dist/Avatar.d.cts +3 -2
- package/dist/Avatar.d.mts +3 -2
- package/dist/Avatar.mjs +3 -2
- package/dist/Backdrop.cjs +1 -1
- package/dist/Backdrop.d.cts +1 -1
- package/dist/Backdrop.d.mts +1 -1
- package/dist/Backdrop.mjs +1 -1
- package/dist/Button.cjs +5 -12
- package/dist/Button.d.cts +1 -1
- package/dist/Button.d.mts +1 -1
- package/dist/Button.mjs +3 -9
- package/dist/ButtonGroup.cjs +2 -2
- package/dist/ButtonGroup.d.cts +1 -1
- package/dist/ButtonGroup.d.mts +1 -1
- package/dist/ButtonGroup.mjs +2 -2
- package/dist/Card.cjs +6 -7
- package/dist/Card.d.cts +3 -3
- package/dist/Card.d.mts +3 -3
- package/dist/Card.mjs +4 -4
- package/dist/Checkbox.cjs +2 -2
- package/dist/Checkbox.d.cts +42 -1
- package/dist/Checkbox.d.mts +42 -1
- package/dist/Checkbox.mjs +2 -2
- package/dist/CircularProgress.cjs +2 -2
- package/dist/CircularProgress.d.cts +3 -2
- package/dist/CircularProgress.d.mts +3 -2
- package/dist/CircularProgress.mjs +2 -2
- package/dist/Drawer.cjs +2 -2
- package/dist/Drawer.d.cts +2 -2
- package/dist/Drawer.d.mts +2 -2
- package/dist/Drawer.mjs +2 -2
- package/dist/Flex.cjs +3 -7
- package/dist/Flex.d.cts +1 -1
- package/dist/Flex.d.mts +1 -1
- package/dist/Flex.mjs +3 -9
- package/dist/FocusTrap.cjs +1 -1
- package/dist/FocusTrap.mjs +1 -1
- package/dist/Form.cjs +2 -3
- package/dist/Form.d.cts +1 -1
- package/dist/Form.d.mts +1 -1
- package/dist/Form.mjs +2 -3
- package/dist/{FormContext-CRmRgDgu.cjs → FormContext-BGCsWAFc.cjs} +0 -1
- package/dist/{FormContext-_G3sxJyQ.mjs → FormContext-LrjAGe6U.mjs} +0 -1
- package/dist/FormControl.cjs +6 -6
- package/dist/FormControl.d.cts +2 -2
- package/dist/FormControl.d.mts +2 -2
- package/dist/FormControl.mjs +5 -5
- package/dist/{FormControlContext-aeKTjRKY.cjs → FormControlContext-74gvPGFk.cjs} +0 -1
- package/dist/{FormControlContext-CyxdOxdN.mjs → FormControlContext-CC2kToms.mjs} +0 -1
- package/dist/FormHelperText.cjs +3 -3
- package/dist/FormHelperText.d.cts +1 -1
- package/dist/FormHelperText.d.mts +1 -1
- package/dist/FormHelperText.mjs +3 -3
- package/dist/FormLabel.cjs +3 -3
- package/dist/FormLabel.d.cts +17 -1
- package/dist/FormLabel.d.mts +17 -1
- package/dist/FormLabel.mjs +3 -3
- package/dist/Grid.cjs +3 -26
- package/dist/Grid.d.cts +4 -10
- package/dist/Grid.d.mts +4 -10
- package/dist/Grid.mjs +3 -25
- package/dist/{Icon-1YtNCUKo.cjs → Icon-BOjk5r39.cjs} +75 -5
- package/dist/{Icon-CAKRmFz3.mjs → Icon-CYjD0Bad.mjs} +74 -3
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.d.cts +1 -1
- package/dist/Icon.d.mts +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/Image.cjs +1 -1
- package/dist/Image.d.cts +16 -1
- package/dist/Image.d.mts +16 -1
- package/dist/Image.mjs +1 -1
- package/dist/LinearProgress.cjs +2 -2
- package/dist/LinearProgress.d.cts +3 -2
- package/dist/LinearProgress.d.mts +3 -2
- package/dist/LinearProgress.mjs +2 -2
- package/dist/Link.cjs +5 -9
- package/dist/Link.d.cts +9 -1
- package/dist/Link.d.mts +9 -1
- package/dist/Link.mjs +4 -7
- package/dist/MenuItem.cjs +6 -7
- package/dist/MenuItem.d.cts +2 -1
- package/dist/MenuItem.d.mts +2 -1
- package/dist/MenuItem.mjs +4 -3
- package/dist/{Modal-BDMPTSXv.cjs → Modal-DZH-DzMZ.cjs} +2 -2
- package/dist/{Modal-DR60peRg.mjs → Modal-dy5l7gfH.mjs} +2 -2
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.d.cts +1 -1
- package/dist/Modal.d.mts +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/NativeSelect.cjs +5 -5
- package/dist/NativeSelect.d.cts +3 -2
- package/dist/NativeSelect.d.mts +3 -2
- package/dist/NativeSelect.mjs +4 -3
- package/dist/Pagination/PaginationItem.cjs +3 -3
- package/dist/Pagination/PaginationItem.d.cts +1 -1
- package/dist/Pagination/PaginationItem.d.mts +1 -1
- package/dist/Pagination/PaginationItem.mjs +3 -3
- package/dist/Pagination.cjs +1 -1
- package/dist/Pagination.d.cts +2 -22
- package/dist/Pagination.d.mts +2 -22
- package/dist/Pagination.mjs +1 -1
- package/dist/Paper.cjs +5 -8
- package/dist/Paper.d.cts +1 -1
- package/dist/Paper.d.mts +1 -1
- package/dist/Paper.mjs +3 -4
- package/dist/{Popover-B61J7C79.mjs → Popover-Chgtjn-N.mjs} +3 -2
- package/dist/{Popover-CRDLmywF.cjs → Popover-pEVboMZO.cjs} +4 -4
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.d.cts +4 -3
- package/dist/Popover.d.mts +4 -3
- package/dist/Popover.mjs +1 -1
- package/dist/Pressable.cjs +123 -0
- package/dist/Pressable.d.cts +2 -0
- package/dist/Pressable.d.mts +2 -0
- package/dist/Pressable.mjs +121 -0
- package/dist/Quote.cjs +1 -1
- package/dist/Quote.d.cts +13 -1
- package/dist/Quote.d.mts +13 -1
- package/dist/Quote.mjs +1 -1
- package/dist/Radio.cjs +2 -2
- package/dist/Radio.d.cts +2 -2
- package/dist/Radio.d.mts +2 -2
- package/dist/Radio.mjs +2 -2
- package/dist/Select.cjs +10 -32
- package/dist/Select.d.cts +3 -2
- package/dist/Select.d.mts +3 -2
- package/dist/Select.mjs +9 -30
- package/dist/Sidebar/Sidebar.cjs +94 -0
- package/dist/Sidebar/Sidebar.d.cts +59 -0
- package/dist/Sidebar/Sidebar.d.mts +59 -0
- package/dist/Sidebar/Sidebar.mjs +93 -0
- package/dist/Sidebar/SidebarItem.cjs +125 -0
- package/dist/Sidebar/SidebarItem.d.cts +39 -0
- package/dist/Sidebar/SidebarItem.d.mts +39 -0
- package/dist/Sidebar/SidebarItem.mjs +124 -0
- package/dist/Sidebar.cjs +7 -0
- package/dist/Sidebar.d.cts +4 -0
- package/dist/Sidebar.d.mts +4 -0
- package/dist/Sidebar.mjs +4 -0
- package/dist/SidebarContext-DgSLwjur.mjs +10 -0
- package/dist/SidebarContext-ao6lRfTX.d.cts +37 -0
- package/dist/SidebarContext-ao6lRfTX.d.mts +37 -0
- package/dist/SidebarContext-jG6OioC-.cjs +14 -0
- package/dist/Skeleton.cjs +1 -1
- package/dist/Skeleton.d.cts +2 -1
- package/dist/Skeleton.d.mts +2 -1
- package/dist/Skeleton.mjs +1 -1
- package/dist/Switch.cjs +4 -4
- package/dist/Switch.d.cts +2 -1
- package/dist/Switch.d.mts +2 -1
- package/dist/Switch.mjs +3 -2
- package/dist/Table/Table.cjs +2 -2
- package/dist/Table/Table.d.cts +47 -1
- package/dist/Table/Table.d.mts +47 -1
- package/dist/Table/Table.mjs +2 -2
- package/dist/Table/TableBody.cjs +1 -1
- package/dist/Table/TableBody.d.cts +21 -1
- package/dist/Table/TableBody.d.mts +21 -1
- package/dist/Table/TableBody.mjs +1 -1
- package/dist/Table/TableCell.cjs +3 -3
- package/dist/Table/TableCell.d.cts +1 -1
- package/dist/Table/TableCell.d.mts +1 -1
- package/dist/Table/TableCell.mjs +3 -3
- package/dist/Table/TableContainer.cjs +1 -1
- package/dist/Table/TableContainer.d.cts +17 -1
- package/dist/Table/TableContainer.d.mts +17 -1
- package/dist/Table/TableContainer.mjs +1 -1
- package/dist/Table/TableControl.d.cts +27 -1
- package/dist/Table/TableControl.d.mts +27 -1
- package/dist/Table/TableFooter.cjs +1 -1
- package/dist/Table/TableFooter.d.cts +21 -1
- package/dist/Table/TableFooter.d.mts +21 -1
- package/dist/Table/TableFooter.mjs +1 -1
- package/dist/Table/TableHead.cjs +1 -1
- package/dist/Table/TableHead.d.cts +21 -1
- package/dist/Table/TableHead.d.mts +21 -1
- package/dist/Table/TableHead.mjs +1 -1
- package/dist/Table/TablePagination.cjs +1 -1
- package/dist/Table/TablePagination.d.cts +44 -1
- package/dist/Table/TablePagination.d.mts +44 -1
- package/dist/Table/TablePagination.mjs +1 -1
- package/dist/Table/TablePaginationActions.cjs +4 -4
- package/dist/Table/TablePaginationActions.d.cts +1 -1
- package/dist/Table/TablePaginationActions.d.mts +1 -1
- package/dist/Table/TablePaginationActions.mjs +3 -2
- package/dist/Table/TableRow.cjs +3 -3
- package/dist/Table/TableRow.d.cts +29 -1
- package/dist/Table/TableRow.d.mts +29 -1
- package/dist/Table/TableRow.mjs +3 -3
- package/dist/Table/TableSortLabel.cjs +3 -3
- package/dist/Table/TableSortLabel.d.cts +1 -1
- package/dist/Table/TableSortLabel.d.mts +1 -1
- package/dist/Table/TableSortLabel.mjs +3 -3
- package/dist/Table/hooks.d.cts +39 -2
- package/dist/Table/hooks.d.mts +39 -2
- package/dist/Table.cjs +1 -1
- package/dist/Table.d.cts +14 -15
- package/dist/Table.d.mts +14 -15
- package/dist/Table.mjs +1 -1
- package/dist/{TableContext-qqp35o8z.cjs → TableContext-Bfg1C3Sr.cjs} +0 -1
- package/dist/{TableContext-2qH7XYJB.d.cts → TableContext-BoOxdk8p.d.cts} +1 -1
- package/dist/{TableContext-2qH7XYJB.d.mts → TableContext-DV31j6HO.d.mts} +1 -1
- package/dist/{TableContext-BRWPghAI.mjs → TableContext-Dyr89h_k.mjs} +0 -1
- package/dist/TextInput.cjs +228 -2
- package/dist/TextInput.d.cts +79 -1
- package/dist/TextInput.d.mts +79 -1
- package/dist/TextInput.mjs +226 -1
- package/dist/ToggleButton/ToggleButton.cjs +4 -4
- package/dist/ToggleButton/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton/ToggleButton.d.mts +1 -1
- package/dist/ToggleButton/ToggleButton.mjs +3 -2
- package/dist/ToggleButton/ToggleButtonGroup.cjs +4 -4
- package/dist/ToggleButton/ToggleButtonGroup.d.cts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.mts +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.mjs +3 -2
- package/dist/ToggleButton.d.cts +1 -1
- package/dist/ToggleButton.d.mts +1 -1
- package/dist/Typography.cjs +3 -3
- package/dist/Typography.d.cts +2 -2
- package/dist/Typography.d.mts +2 -2
- package/dist/Typography.mjs +2 -1
- package/dist/View.cjs +1 -3
- package/dist/View.d.cts +1 -1
- package/dist/View.d.mts +1 -1
- package/dist/View.mjs +1 -3
- package/dist/emotion-BAyqVw0c.mjs +6 -0
- package/dist/emotion-DviPkkGL.cjs +10 -0
- package/dist/engine.cjs +80 -0
- package/dist/engine.d.cts +21 -0
- package/dist/engine.d.mts +21 -0
- package/dist/engine.mjs +69 -0
- package/dist/{index-BqVgv2B_.d.mts → index--mvTGo8F.d.cts} +3 -2
- package/dist/{index-DSCMXFTn.d.cts → index-ATXjtAOY.d.mts} +2 -1
- package/dist/{index-CDVnvjIE.d.cts → index-B2hrssyF.d.mts} +2 -2
- package/dist/index-B3FrhO2r.d.cts +24 -0
- package/dist/{index-BnzUumAC2.d.mts → index-B7aaTHOe.d.cts} +2 -1
- package/dist/{index-DmJIuQJj.d.mts → index-BItZoGZ1.d.mts} +3 -2
- package/dist/{index-DASvoACZ.d.cts → index-BJ8OC_Zh.d.cts} +2 -2
- package/dist/{index-BLfFycfJ.d.mts → index-BL3jwIQU.d.mts} +9 -2
- package/dist/{index-4rC2j7fR.d.cts → index-BNP_iejT.d.cts} +3 -2
- package/dist/{index-Dy03o__A.d.mts → index-BfpjEqqt.d.cts} +2 -1
- package/dist/index-BoOs5h_b.d.mts +53 -0
- package/dist/{index-CeYkEXU2.d.cts → index-BwUnDd9W.d.mts} +2 -2
- package/dist/{index-BH8jQOdF.d.mts → index-C7j38wne.d.mts} +3 -2
- package/dist/{index-Dp81rWM1.d.cts → index-CA_X-mXg.d.cts} +9 -2
- package/dist/index-CO3Qq0I0.d.mts +49 -0
- package/dist/{index-BLRMuO_x.d.mts → index-CYTaYcm3.d.cts} +3 -4
- package/dist/index-Ca0Pj5m2.d.mts +24 -0
- package/dist/{index-DE5PtzPn.d.mts → index-CvaEVk-f.d.cts} +2 -2
- package/dist/{index-C0xMvDjL.d.mts → index-D8U2tk1L.d.mts} +2 -2
- package/dist/{index-Dm9HfgV6.d.mts → index-D8b5OCLe.d.mts} +17 -7
- package/dist/{index-B1rCD6Oo.d.cts → index-DEv2QslH.d.mts} +4 -6
- package/dist/{index-CyZYXDn0.d.cts → index-DF3Hweir.d.mts} +3 -2
- package/dist/{index-Bihpwn75.d.cts → index-DLJ-li1B.d.cts} +17 -7
- package/dist/{index-FwTocqhP.d.cts → index-DjtGkwRM.d.cts} +2 -3
- package/dist/{index-BX5-NfbX.d.cts → index-Ds__py2h.d.mts} +2 -1
- package/dist/{index-x80UG39F.d.cts → index-KZUd8B5E.d.mts} +3 -4
- package/dist/index-MsUtFRul.d.cts +53 -0
- package/dist/index-dtLxevvf.d.cts +49 -0
- package/dist/{index-pX7tBQdJ.d.mts → index-q6EgsH9R.d.mts} +2 -3
- package/dist/{index-8dzWTpFp.d.cts → index-v99yMdts.d.cts} +3 -2
- package/dist/{index-CxSNNzBT2.d.mts → index-yr4HkKOj.d.cts} +2 -2
- package/dist/{index-z35LEYG8.d.mts → index-zFYi0f1t.d.cts} +4 -6
- package/dist/index.cjs +2 -32
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{src-DcNT2aIK.mjs → src-BJy4dM4f.mjs} +5 -10
- package/dist/{src-BiocWFSR.cjs → src-C8PIppTy.cjs} +2 -7
- package/dist/{hooks.cjs → style.cjs} +5 -23
- package/dist/style.d.cts +23 -0
- package/dist/style.d.mts +23 -0
- package/dist/{hooks.mjs → style.mjs} +6 -16
- package/dist/theme-Du6xgPsg.cjs +470 -0
- package/dist/{themes.mjs → theme-V6lYzd3j.mjs} +68 -14
- package/dist/theme.cjs +23 -0
- package/dist/theme.d.cts +3 -0
- package/dist/theme.d.mts +3 -0
- package/dist/theme.mjs +3 -0
- package/dist/{themeDefault-B-QjpGEO.cjs → themeDefault-Cebi08Cv.cjs} +1 -1
- package/dist/{themeDefault-CjXaY3ok.mjs → themeDefault-Z3KmyIbm.mjs} +1 -1
- package/dist/themes-CUV79qWU.d.cts +503 -0
- package/dist/themes-CUV79qWU.d.mts +503 -0
- package/dist/{useTableSort--XMWjujs.d.cts → useTablePagination-7jiSvKCh.d.cts} +25 -25
- package/dist/{useTableSort-CpDs4cGq.d.mts → useTablePagination-HaIcJPv-.d.mts} +25 -25
- package/dist/utils.cjs +0 -29
- package/dist/utils.d.cts +1 -19
- package/dist/utils.d.mts +1 -19
- package/dist/utils.mjs +1 -27
- package/package.json +431 -24
- package/dist/CodeBlock.cjs +0 -101
- package/dist/CodeBlock.d.cts +0 -2
- package/dist/CodeBlock.d.mts +0 -2
- package/dist/CodeBlock.mjs +0 -100
- package/dist/Field.cjs +0 -59
- package/dist/Field.d.cts +0 -36
- package/dist/Field.d.mts +0 -36
- package/dist/Field.mjs +0 -58
- package/dist/Markdown/Control.cjs +0 -61
- package/dist/Markdown/Control.d.cts +0 -18
- package/dist/Markdown/Control.d.mts +0 -18
- package/dist/Markdown/Control.mjs +0 -60
- package/dist/Markdown/Editor.cjs +0 -130
- package/dist/Markdown/Editor.d.cts +0 -40
- package/dist/Markdown/Editor.d.mts +0 -40
- package/dist/Markdown/Editor.mjs +0 -128
- package/dist/Markdown/Preview.cjs +0 -241
- package/dist/Markdown/Preview.d.cts +0 -55
- package/dist/Markdown/Preview.d.mts +0 -55
- package/dist/Markdown/Preview.mjs +0 -236
- package/dist/Markdown/Toolbar.cjs +0 -4
- package/dist/Markdown/Toolbar.d.cts +0 -13
- package/dist/Markdown/Toolbar.d.mts +0 -13
- package/dist/Markdown/Toolbar.mjs +0 -2
- package/dist/Markdown.cjs +0 -13
- package/dist/Markdown.d.cts +0 -80
- package/dist/Markdown.d.mts +0 -80
- package/dist/Markdown.mjs +0 -6
- package/dist/MarkdownContext-BN8A3W-J.mjs +0 -11
- package/dist/MarkdownContext-DSwjzpH8.cjs +0 -22
- package/dist/TextInput-6o37Zddp.cjs +0 -231
- package/dist/TextInput-D_lHYJlL.mjs +0 -224
- package/dist/ThemeProvider.cjs +0 -15
- package/dist/ThemeProvider.d.cts +0 -20
- package/dist/ThemeProvider.d.mts +0 -20
- package/dist/ThemeProvider.mjs +0 -14
- package/dist/Toolbar-B-W22Sk4.cjs +0 -459
- package/dist/Toolbar-KbR97iJS.mjs +0 -448
- package/dist/applyAction-B2B-hnP3.mjs +0 -98
- package/dist/applyAction-B2uVHxOE.cjs +0 -103
- package/dist/createTheme-Dts2F4R_.d.cts +0 -21
- package/dist/createTheme-Dts2F4R_.d.mts +0 -21
- package/dist/hooks/useCopyToClipboard.cjs +0 -33
- package/dist/hooks/useCopyToClipboard.d.cts +0 -16
- package/dist/hooks/useCopyToClipboard.d.mts +0 -16
- package/dist/hooks/useCopyToClipboard.mjs +0 -31
- package/dist/hooks.d.cts +0 -40
- package/dist/hooks.d.mts +0 -40
- package/dist/index-BPrjvi7B.d.cts +0 -13
- package/dist/index-BlfIbAMs.d.cts +0 -45
- package/dist/index-BoqlPb3Z.d.mts +0 -13
- package/dist/index-Bwi4kRpf.d.mts +0 -79
- package/dist/index-Bx24ZnOV.d.mts +0 -43
- package/dist/index-C-P_hipv.d.mts +0 -21
- package/dist/index-C5_ciaeo.d.cts +0 -79
- package/dist/index-CDcGTGR4.d.cts +0 -21
- package/dist/index-CEOZI-6L.d.mts +0 -48
- package/dist/index-CLU39rUS2.d.mts +0 -30
- package/dist/index-CM_KCTee.d.cts +0 -48
- package/dist/index-CT9uGKrs.d.cts +0 -30
- package/dist/index-CcYSvIJi.d.cts +0 -21
- package/dist/index-CdF_4ckE.d.mts +0 -11
- package/dist/index-Cl_yBpzW2.d.mts +0 -13
- package/dist/index-Cv_UOfYx.d.mts +0 -18
- package/dist/index-DBGE6yKw.d.mts +0 -16
- package/dist/index-DCQ2fsDu.d.mts +0 -40
- package/dist/index-DD2AVtiR.d.cts +0 -16
- package/dist/index-DOPXpr2J.d.cts +0 -43
- package/dist/index-DTkQSXQD.d.cts +0 -11
- package/dist/index-DeJWkpf9.d.cts +0 -16
- package/dist/index-DeiZHSwA.d.cts +0 -12
- package/dist/index-Des8BisQ.d.mts +0 -12
- package/dist/index-Dg8-CPOO.d.cts +0 -18
- package/dist/index-DgRS5Aqv.d.mts +0 -16
- package/dist/index-Dtzj8X58.d.cts +0 -40
- package/dist/index-DvW2eETV.d.mts +0 -21
- package/dist/index-GVsFY00r.d.cts +0 -21
- package/dist/index-Nqco3fsM.d.cts +0 -13
- package/dist/index-g-9DZ_KQ.d.cts +0 -28
- package/dist/index-g9EThkSg.d.mts +0 -21
- package/dist/index-kpk9e3xM2.d.mts +0 -45
- package/dist/index-u57CbuAU2.d.mts +0 -28
- package/dist/themes-D1SAp3SL.d.mts +0 -500
- package/dist/themes-D81JYbqm.d.cts +0 -500
- package/dist/themes.cjs +0 -318
- package/dist/themes.d.cts +0 -3
- package/dist/themes.d.mts +0 -3
- package/dist/useDefaultProps-Cb-5FNok.cjs +0 -19
- package/dist/useDefaultProps-CoApb4KT.mjs +0 -14
- package/dist/utils/styleCache.cjs +0 -7
- package/dist/utils/styleCache.d.cts +0 -3
- package/dist/utils/styleCache.d.mts +0 -4
- package/dist/utils/styleCache.mjs +0 -5
package/dist/CodeBlock.mjs
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { d as styled } from "./src-DcNT2aIK.mjs";
|
|
2
|
-
import { useCopyToClipboard } from "./hooks/useCopyToClipboard.mjs";
|
|
3
|
-
import { View } from "./View.mjs";
|
|
4
|
-
import { Button } from "./Button.mjs";
|
|
5
|
-
import { t as Icon } from "./Icon-CAKRmFz3.mjs";
|
|
6
|
-
import { useRef } from "react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
//#region src/CodeBlock/CodeBlock.tsx
|
|
9
|
-
const syntaxStyles = ({ theme }) => ({
|
|
10
|
-
color: theme.syntax.base,
|
|
11
|
-
fontFamily: theme.fonts.mono,
|
|
12
|
-
"& .hljs-comment, & .hljs-quote, & .hljs-doctag, & .hljs-meta.prompt_": {
|
|
13
|
-
color: theme.syntax.comment,
|
|
14
|
-
fontStyle: "italic"
|
|
15
|
-
},
|
|
16
|
-
"& .hljs-keyword, & .hljs-built_in, & .hljs-literal, & .hljs-selector-tag, & .hljs-selector-pseudo, & .hljs-selector-attr": { color: theme.syntax.keyword },
|
|
17
|
-
"& .hljs-type, & .hljs-title.class_": { color: theme.syntax.type },
|
|
18
|
-
"& .hljs-string, & .hljs-regexp, & .hljs-char, & .hljs-meta .hljs-string, & .hljs-addition": { color: theme.syntax.string },
|
|
19
|
-
"& .hljs-number, & .hljs-symbol, & .hljs-bullet, & .hljs-link": { color: theme.syntax.number },
|
|
20
|
-
"& .hljs-variable.constant_, & .hljs-property": { color: theme.syntax.constant },
|
|
21
|
-
"& .hljs-title, & .hljs-section, & .hljs-attr, & .hljs-attribute, & .hljs-selector-id": { color: theme.syntax.title },
|
|
22
|
-
"& .hljs-tag, & .hljs-name, & .hljs-meta, & .hljs-variable, & .hljs-selector-class, & .hljs-deletion": { color: theme.syntax.tag },
|
|
23
|
-
"& .hljs-emphasis": { fontStyle: "italic" },
|
|
24
|
-
"& .hljs-strong": { fontWeight: "bold" }
|
|
25
|
-
});
|
|
26
|
-
const CodeSurface = styled(View, {
|
|
27
|
-
name: "CodeBlock",
|
|
28
|
-
slot: "surface",
|
|
29
|
-
label: "CodeSurface"
|
|
30
|
-
})(syntaxStyles);
|
|
31
|
-
const Wrapper = styled(View, {
|
|
32
|
-
name: "CodeBlock",
|
|
33
|
-
label: "CodeBlock"
|
|
34
|
-
})({
|
|
35
|
-
display: "grid",
|
|
36
|
-
gridTemplateColumns: "minmax(0, 1fr)",
|
|
37
|
-
"& .code-copy": {
|
|
38
|
-
opacity: 0,
|
|
39
|
-
transition: "opacity 120ms ease"
|
|
40
|
-
},
|
|
41
|
-
"&:hover .code-copy, &:focus-within .code-copy": { opacity: 1 },
|
|
42
|
-
"@media (hover: none)": { "& .code-copy": { opacity: 1 } }
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* Fenced-code block: a horizontally scrollable, syntax-highlighted surface with a
|
|
46
|
-
* copy-to-clipboard button that sticks to the top-right while the block is in view.
|
|
47
|
-
*/
|
|
48
|
-
function CodeBlock({ children, ...rest }) {
|
|
49
|
-
const surfaceRef = useRef(null);
|
|
50
|
-
const { copied, copy } = useCopyToClipboard();
|
|
51
|
-
const handleCopy = () => {
|
|
52
|
-
const raw = surfaceRef.current.textContent;
|
|
53
|
-
let end = raw.length;
|
|
54
|
-
while (end > 0 && raw[end - 1] === "\n") end--;
|
|
55
|
-
const text = raw.slice(0, end);
|
|
56
|
-
if (text) copy(text);
|
|
57
|
-
};
|
|
58
|
-
return /* @__PURE__ */ jsxs(Wrapper, {
|
|
59
|
-
my: 2,
|
|
60
|
-
position: "relative",
|
|
61
|
-
...rest,
|
|
62
|
-
children: [/* @__PURE__ */ jsx(View, {
|
|
63
|
-
position: "absolute",
|
|
64
|
-
top: "8px",
|
|
65
|
-
right: "8px",
|
|
66
|
-
zIndex: 1,
|
|
67
|
-
bg: "paper",
|
|
68
|
-
borderRadius: "sm",
|
|
69
|
-
className: "code-copy",
|
|
70
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
71
|
-
type: "button",
|
|
72
|
-
variant: "outlined",
|
|
73
|
-
color: "default",
|
|
74
|
-
size: "sm",
|
|
75
|
-
borderRadius: "sm",
|
|
76
|
-
onClick: handleCopy,
|
|
77
|
-
"aria-label": copied ? "Copied" : "Copy code",
|
|
78
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
79
|
-
name: copied ? "check" : "content_copy",
|
|
80
|
-
color: copied ? "success" : "primary",
|
|
81
|
-
size: "1.1rem"
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
}), /* @__PURE__ */ jsx(CodeSurface, {
|
|
85
|
-
as: "pre",
|
|
86
|
-
tabIndex: 0,
|
|
87
|
-
ref: surfaceRef,
|
|
88
|
-
bg: "terminal",
|
|
89
|
-
p: 3,
|
|
90
|
-
borderRadius: "md",
|
|
91
|
-
borderColor: "light",
|
|
92
|
-
borderWidth: "thin",
|
|
93
|
-
maxWidth: "100%",
|
|
94
|
-
overflow: "auto",
|
|
95
|
-
children
|
|
96
|
-
})]
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
//#endregion
|
|
100
|
-
export { CodeBlock };
|
package/dist/Field.cjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_Flex = require("./Flex.cjs");
|
|
3
|
-
const require_FormControl = require("./FormControl.cjs");
|
|
4
|
-
const require_FormLabel = require("./FormLabel.cjs");
|
|
5
|
-
const require_FormHelperText = require("./FormHelperText.cjs");
|
|
6
|
-
require("@emotion/react");
|
|
7
|
-
let react = require("react");
|
|
8
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
-
require("@tanstack/react-form");
|
|
10
|
-
//#region src/Field/Field.tsx
|
|
11
|
-
/**
|
|
12
|
-
* The single bridge between the design-system form layer and TanStack Form.
|
|
13
|
-
* Wraps `form.Field`, derives the error-display flag, and composes
|
|
14
|
-
* FormControl / FormLabel / FormHelperText so id and aria wiring are automatic.
|
|
15
|
-
*
|
|
16
|
-
* Error UX: shown only once the field is touched or after a submit attempt — never on
|
|
17
|
-
* initial render — and only the first error message is displayed.
|
|
18
|
-
*/
|
|
19
|
-
function Field({ form, name, label, labelProps, helperText, required, size, fullWidth, children }) {
|
|
20
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(form.Field, {
|
|
21
|
-
name,
|
|
22
|
-
children: (field) => {
|
|
23
|
-
const api = field;
|
|
24
|
-
const message = api.state.meta.errors[0]?.message;
|
|
25
|
-
const hasError = (api.state.meta.isTouched || form.state.isSubmitted) && Boolean(message);
|
|
26
|
-
const helper = hasError ? message : helperText;
|
|
27
|
-
const child = children;
|
|
28
|
-
const control = (0, react.cloneElement)(child, {
|
|
29
|
-
name: api.name,
|
|
30
|
-
value: api.state.value,
|
|
31
|
-
onChange: (event) => api.handleChange(event.target.value),
|
|
32
|
-
inputProps: {
|
|
33
|
-
...child.props.inputProps,
|
|
34
|
-
onBlur: api.handleBlur
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormControl.FormControl, {
|
|
38
|
-
error: hasError,
|
|
39
|
-
required,
|
|
40
|
-
size,
|
|
41
|
-
fullWidth,
|
|
42
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Flex.Flex, {
|
|
43
|
-
flexDirection: "column",
|
|
44
|
-
gap: 2,
|
|
45
|
-
children: [
|
|
46
|
-
label == null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormLabel.FormLabel, {
|
|
47
|
-
...labelProps,
|
|
48
|
-
children: label
|
|
49
|
-
}),
|
|
50
|
-
control,
|
|
51
|
-
helper == null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormHelperText.FormHelperText, { children: helper })
|
|
52
|
-
]
|
|
53
|
-
})
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
//#endregion
|
|
59
|
-
exports.Field = Field;
|
package/dist/Field.d.cts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { n as FormLabelProps } from "./index-Dg8-CPOO.cjs";
|
|
2
|
-
import { Theme } from "@emotion/react";
|
|
3
|
-
import { ReactElement, ReactNode } from "react";
|
|
4
|
-
import { DeepKeys, FormAsyncValidateOrFn, FormValidateOrFn, ReactFormExtendedApi } from "@tanstack/react-form";
|
|
5
|
-
//#region src/Field/Field.d.ts
|
|
6
|
-
interface FieldProps<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta, TName extends DeepKeys<TFormData> = DeepKeys<TFormData>> {
|
|
7
|
-
form: ReactFormExtendedApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
|
|
8
|
-
/** Type-safe field name — checked against the form's value schema. */
|
|
9
|
-
name: TName;
|
|
10
|
-
/** Optional label; rendered as a FormLabel above the control. */
|
|
11
|
-
label?: ReactNode;
|
|
12
|
-
/** Typography props forwarded to the FormLabel — restyle the label without losing the wiring. */
|
|
13
|
-
labelProps?: Omit<FormLabelProps, 'children' | 'required' | 'htmlFor'>;
|
|
14
|
-
/** Optional helper text; replaced by the error message while the field is invalid. */
|
|
15
|
-
helperText?: ReactNode;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
size?: keyof Theme['sizes'];
|
|
18
|
-
fullWidth?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* The control element, e.g. `<TextInput />`. Field clones it and injects the binding
|
|
21
|
-
* from the TanStack field — `name`, `value`, `onChange`, and `inputProps.onBlur` — so the
|
|
22
|
-
* call site stays declarative and the control never imports the form library.
|
|
23
|
-
*/
|
|
24
|
-
children: ReactElement;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The single bridge between the design-system form layer and TanStack Form.
|
|
28
|
-
* Wraps `form.Field`, derives the error-display flag, and composes
|
|
29
|
-
* FormControl / FormLabel / FormHelperText so id and aria wiring are automatic.
|
|
30
|
-
*
|
|
31
|
-
* Error UX: shown only once the field is touched or after a submit attempt — never on
|
|
32
|
-
* initial render — and only the first error message is displayed.
|
|
33
|
-
*/
|
|
34
|
-
declare function Field<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta, TName extends DeepKeys<TFormData> = DeepKeys<TFormData>>({ form, name, label, labelProps, helperText, required, size, fullWidth, children }: Readonly<FieldProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TName>>): import("react").JSX.Element;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { Field, FieldProps };
|
package/dist/Field.d.mts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { n as FormLabelProps } from "./index-Cv_UOfYx.mjs";
|
|
2
|
-
import { Theme } from "@emotion/react";
|
|
3
|
-
import { ReactElement, ReactNode } from "react";
|
|
4
|
-
import { DeepKeys, FormAsyncValidateOrFn, FormValidateOrFn, ReactFormExtendedApi } from "@tanstack/react-form";
|
|
5
|
-
//#region src/Field/Field.d.ts
|
|
6
|
-
interface FieldProps<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta, TName extends DeepKeys<TFormData> = DeepKeys<TFormData>> {
|
|
7
|
-
form: ReactFormExtendedApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>;
|
|
8
|
-
/** Type-safe field name — checked against the form's value schema. */
|
|
9
|
-
name: TName;
|
|
10
|
-
/** Optional label; rendered as a FormLabel above the control. */
|
|
11
|
-
label?: ReactNode;
|
|
12
|
-
/** Typography props forwarded to the FormLabel — restyle the label without losing the wiring. */
|
|
13
|
-
labelProps?: Omit<FormLabelProps, 'children' | 'required' | 'htmlFor'>;
|
|
14
|
-
/** Optional helper text; replaced by the error message while the field is invalid. */
|
|
15
|
-
helperText?: ReactNode;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
size?: keyof Theme['sizes'];
|
|
18
|
-
fullWidth?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* The control element, e.g. `<TextInput />`. Field clones it and injects the binding
|
|
21
|
-
* from the TanStack field — `name`, `value`, `onChange`, and `inputProps.onBlur` — so the
|
|
22
|
-
* call site stays declarative and the control never imports the form library.
|
|
23
|
-
*/
|
|
24
|
-
children: ReactElement;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The single bridge between the design-system form layer and TanStack Form.
|
|
28
|
-
* Wraps `form.Field`, derives the error-display flag, and composes
|
|
29
|
-
* FormControl / FormLabel / FormHelperText so id and aria wiring are automatic.
|
|
30
|
-
*
|
|
31
|
-
* Error UX: shown only once the field is touched or after a submit attempt — never on
|
|
32
|
-
* initial render — and only the first error message is displayed.
|
|
33
|
-
*/
|
|
34
|
-
declare function Field<TFormData, TOnMount extends undefined | FormValidateOrFn<TFormData>, TOnChange extends undefined | FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, TSubmitMeta, TName extends DeepKeys<TFormData> = DeepKeys<TFormData>>({ form, name, label, labelProps, helperText, required, size, fullWidth, children }: Readonly<FieldProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, TName>>): import("react").JSX.Element;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { Field, FieldProps };
|
package/dist/Field.mjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Flex } from "./Flex.mjs";
|
|
2
|
-
import { FormControl } from "./FormControl.mjs";
|
|
3
|
-
import { FormLabel } from "./FormLabel.mjs";
|
|
4
|
-
import { FormHelperText } from "./FormHelperText.mjs";
|
|
5
|
-
import "@emotion/react";
|
|
6
|
-
import { cloneElement } from "react";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import "@tanstack/react-form";
|
|
9
|
-
//#region src/Field/Field.tsx
|
|
10
|
-
/**
|
|
11
|
-
* The single bridge between the design-system form layer and TanStack Form.
|
|
12
|
-
* Wraps `form.Field`, derives the error-display flag, and composes
|
|
13
|
-
* FormControl / FormLabel / FormHelperText so id and aria wiring are automatic.
|
|
14
|
-
*
|
|
15
|
-
* Error UX: shown only once the field is touched or after a submit attempt — never on
|
|
16
|
-
* initial render — and only the first error message is displayed.
|
|
17
|
-
*/
|
|
18
|
-
function Field({ form, name, label, labelProps, helperText, required, size, fullWidth, children }) {
|
|
19
|
-
return /* @__PURE__ */ jsx(form.Field, {
|
|
20
|
-
name,
|
|
21
|
-
children: (field) => {
|
|
22
|
-
const api = field;
|
|
23
|
-
const message = api.state.meta.errors[0]?.message;
|
|
24
|
-
const hasError = (api.state.meta.isTouched || form.state.isSubmitted) && Boolean(message);
|
|
25
|
-
const helper = hasError ? message : helperText;
|
|
26
|
-
const child = children;
|
|
27
|
-
const control = cloneElement(child, {
|
|
28
|
-
name: api.name,
|
|
29
|
-
value: api.state.value,
|
|
30
|
-
onChange: (event) => api.handleChange(event.target.value),
|
|
31
|
-
inputProps: {
|
|
32
|
-
...child.props.inputProps,
|
|
33
|
-
onBlur: api.handleBlur
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return /* @__PURE__ */ jsx(FormControl, {
|
|
37
|
-
error: hasError,
|
|
38
|
-
required,
|
|
39
|
-
size,
|
|
40
|
-
fullWidth,
|
|
41
|
-
children: /* @__PURE__ */ jsxs(Flex, {
|
|
42
|
-
flexDirection: "column",
|
|
43
|
-
gap: 2,
|
|
44
|
-
children: [
|
|
45
|
-
label == null ? null : /* @__PURE__ */ jsx(FormLabel, {
|
|
46
|
-
...labelProps,
|
|
47
|
-
children: label
|
|
48
|
-
}),
|
|
49
|
-
control,
|
|
50
|
-
helper == null ? null : /* @__PURE__ */ jsx(FormHelperText, { children: helper })
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
export { Field };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_applyAction = require("../applyAction-B2uVHxOE.cjs");
|
|
3
|
-
const require_MarkdownContext = require("../MarkdownContext-DSwjzpH8.cjs");
|
|
4
|
-
let react = require("react");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
//#region src/Markdown/Control/Control.tsx
|
|
7
|
-
/**
|
|
8
|
-
* The headless root of the Markdown compound: owns the shared value/selection state and exposes
|
|
9
|
-
* it (plus a `dispatch` for toolbar actions) via context. It renders no UI of its own — the
|
|
10
|
-
* consumer arranges the parts and decides which panes to show.
|
|
11
|
-
*/
|
|
12
|
-
function Control({ value, onChange, children }) {
|
|
13
|
-
const lastSelectionRef = (0, react.useRef)(null);
|
|
14
|
-
const pendingSelectionRef = (0, react.useRef)(null);
|
|
15
|
-
const context = (0, react.useMemo)(() => {
|
|
16
|
-
const dispatch = (action) => {
|
|
17
|
-
const { start, end } = lastSelectionRef.current ?? {
|
|
18
|
-
start: value.length,
|
|
19
|
-
end: value.length
|
|
20
|
-
};
|
|
21
|
-
const next = require_applyAction.applyAction(action, {
|
|
22
|
-
value,
|
|
23
|
-
selectionStart: start,
|
|
24
|
-
selectionEnd: end
|
|
25
|
-
});
|
|
26
|
-
const selection = {
|
|
27
|
-
start: next.selectionStart,
|
|
28
|
-
end: next.selectionEnd
|
|
29
|
-
};
|
|
30
|
-
pendingSelectionRef.current = selection;
|
|
31
|
-
lastSelectionRef.current = selection;
|
|
32
|
-
onChange(next.value);
|
|
33
|
-
};
|
|
34
|
-
const rememberSelection = (selection) => {
|
|
35
|
-
lastSelectionRef.current = selection;
|
|
36
|
-
};
|
|
37
|
-
const queueSelection = (selection) => {
|
|
38
|
-
pendingSelectionRef.current = selection;
|
|
39
|
-
lastSelectionRef.current = selection;
|
|
40
|
-
};
|
|
41
|
-
const takeQueuedSelection = () => {
|
|
42
|
-
const selection = pendingSelectionRef.current;
|
|
43
|
-
pendingSelectionRef.current = null;
|
|
44
|
-
return selection;
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
value,
|
|
48
|
-
onChange,
|
|
49
|
-
dispatch,
|
|
50
|
-
rememberSelection,
|
|
51
|
-
queueSelection,
|
|
52
|
-
takeQueuedSelection
|
|
53
|
-
};
|
|
54
|
-
}, [value, onChange]);
|
|
55
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MarkdownContext.MarkdownContext.Provider, {
|
|
56
|
-
value: context,
|
|
57
|
-
children
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
exports.Control = Control;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
//#region src/Markdown/Control/Control.d.ts
|
|
3
|
-
interface ControlProps {
|
|
4
|
-
/** Current markdown source (controlled). */
|
|
5
|
-
value: string;
|
|
6
|
-
/** Called with the next source on edit or a toolbar action. */
|
|
7
|
-
onChange: (value: string) => void;
|
|
8
|
-
/** The composed parts — `Markdown.Toolbar`, `Markdown.Editor`, `Markdown.Preview`, … */
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* The headless root of the Markdown compound: owns the shared value/selection state and exposes
|
|
13
|
-
* it (plus a `dispatch` for toolbar actions) via context. It renders no UI of its own — the
|
|
14
|
-
* consumer arranges the parts and decides which panes to show.
|
|
15
|
-
*/
|
|
16
|
-
declare function Control({ value, onChange, children }: Readonly<ControlProps>): import("react").JSX.Element;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { Control, ControlProps };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
//#region src/Markdown/Control/Control.d.ts
|
|
3
|
-
interface ControlProps {
|
|
4
|
-
/** Current markdown source (controlled). */
|
|
5
|
-
value: string;
|
|
6
|
-
/** Called with the next source on edit or a toolbar action. */
|
|
7
|
-
onChange: (value: string) => void;
|
|
8
|
-
/** The composed parts — `Markdown.Toolbar`, `Markdown.Editor`, `Markdown.Preview`, … */
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* The headless root of the Markdown compound: owns the shared value/selection state and exposes
|
|
13
|
-
* it (plus a `dispatch` for toolbar actions) via context. It renders no UI of its own — the
|
|
14
|
-
* consumer arranges the parts and decides which panes to show.
|
|
15
|
-
*/
|
|
16
|
-
declare function Control({ value, onChange, children }: Readonly<ControlProps>): import("react").JSX.Element;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { Control, ControlProps };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { t as applyAction } from "../applyAction-B2B-hnP3.mjs";
|
|
2
|
-
import { t as MarkdownContext } from "../MarkdownContext-BN8A3W-J.mjs";
|
|
3
|
-
import { useMemo, useRef } from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region src/Markdown/Control/Control.tsx
|
|
6
|
-
/**
|
|
7
|
-
* The headless root of the Markdown compound: owns the shared value/selection state and exposes
|
|
8
|
-
* it (plus a `dispatch` for toolbar actions) via context. It renders no UI of its own — the
|
|
9
|
-
* consumer arranges the parts and decides which panes to show.
|
|
10
|
-
*/
|
|
11
|
-
function Control({ value, onChange, children }) {
|
|
12
|
-
const lastSelectionRef = useRef(null);
|
|
13
|
-
const pendingSelectionRef = useRef(null);
|
|
14
|
-
const context = useMemo(() => {
|
|
15
|
-
const dispatch = (action) => {
|
|
16
|
-
const { start, end } = lastSelectionRef.current ?? {
|
|
17
|
-
start: value.length,
|
|
18
|
-
end: value.length
|
|
19
|
-
};
|
|
20
|
-
const next = applyAction(action, {
|
|
21
|
-
value,
|
|
22
|
-
selectionStart: start,
|
|
23
|
-
selectionEnd: end
|
|
24
|
-
});
|
|
25
|
-
const selection = {
|
|
26
|
-
start: next.selectionStart,
|
|
27
|
-
end: next.selectionEnd
|
|
28
|
-
};
|
|
29
|
-
pendingSelectionRef.current = selection;
|
|
30
|
-
lastSelectionRef.current = selection;
|
|
31
|
-
onChange(next.value);
|
|
32
|
-
};
|
|
33
|
-
const rememberSelection = (selection) => {
|
|
34
|
-
lastSelectionRef.current = selection;
|
|
35
|
-
};
|
|
36
|
-
const queueSelection = (selection) => {
|
|
37
|
-
pendingSelectionRef.current = selection;
|
|
38
|
-
lastSelectionRef.current = selection;
|
|
39
|
-
};
|
|
40
|
-
const takeQueuedSelection = () => {
|
|
41
|
-
const selection = pendingSelectionRef.current;
|
|
42
|
-
pendingSelectionRef.current = null;
|
|
43
|
-
return selection;
|
|
44
|
-
};
|
|
45
|
-
return {
|
|
46
|
-
value,
|
|
47
|
-
onChange,
|
|
48
|
-
dispatch,
|
|
49
|
-
rememberSelection,
|
|
50
|
-
queueSelection,
|
|
51
|
-
takeQueuedSelection
|
|
52
|
-
};
|
|
53
|
-
}, [value, onChange]);
|
|
54
|
-
return /* @__PURE__ */ jsx(MarkdownContext.Provider, {
|
|
55
|
-
value: context,
|
|
56
|
-
children
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//#endregion
|
|
60
|
-
export { Control };
|
package/dist/Markdown/Editor.cjs
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
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_Flex = require("../Flex.cjs");
|
|
5
|
-
const require_Typography = require("../Typography.cjs");
|
|
6
|
-
const require_applyAction = require("../applyAction-B2uVHxOE.cjs");
|
|
7
|
-
const require_MarkdownContext = require("../MarkdownContext-DSwjzpH8.cjs");
|
|
8
|
-
const require_TextInput = require("../TextInput-6o37Zddp.cjs");
|
|
9
|
-
let react = require("react");
|
|
10
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
-
let _emotion_react = require("@emotion/react");
|
|
12
|
-
//#region src/Markdown/Editor/Editor.tsx
|
|
13
|
-
const EditorRoot = require_src.styled(require_Flex.Flex, {
|
|
14
|
-
name: "MarkdownEditor",
|
|
15
|
-
label: "MarkdownEditor"
|
|
16
|
-
})();
|
|
17
|
-
const INDENT_ACTION = {
|
|
18
|
-
id: "indent",
|
|
19
|
-
label: "",
|
|
20
|
-
ariaLabel: "",
|
|
21
|
-
kind: "linePrefix",
|
|
22
|
-
linePrefix: " "
|
|
23
|
-
};
|
|
24
|
-
const noop = () => {};
|
|
25
|
-
/**
|
|
26
|
-
* The source `<textarea>`, with selection tracking and Tab-to-indent. Inside a `Control` it is
|
|
27
|
-
* driven by context (so the `Toolbar` can act on it); on its own it is a plain controlled field
|
|
28
|
-
* via `value`/`onChange`.
|
|
29
|
-
*/
|
|
30
|
-
function Editor({ value: valueProp, onChange: onChangeProp, placeholder = "Write your article in Markdown…", minRows = 16, variant, color, textColor: textColorProp, size, name, id, error, required, disabled, showShortcutHint = true }) {
|
|
31
|
-
const context = (0, react.useContext)(require_MarkdownContext.MarkdownContext);
|
|
32
|
-
const theme = (0, _emotion_react.useTheme)();
|
|
33
|
-
const textColor = textColorProp ?? require_themeDefault.themeDefault(theme, "textColor", "initial");
|
|
34
|
-
const hintId = (0, react.useId)();
|
|
35
|
-
const localPendingRef = (0, react.useRef)(null);
|
|
36
|
-
const value = context?.value ?? valueProp ?? "";
|
|
37
|
-
const onChange = context?.onChange ?? onChangeProp ?? noop;
|
|
38
|
-
const paneRef = (0, react.useRef)(null);
|
|
39
|
-
const queueSelection = (selection) => {
|
|
40
|
-
if (context) context.queueSelection(selection);
|
|
41
|
-
else localPendingRef.current = selection;
|
|
42
|
-
};
|
|
43
|
-
const takeQueuedSelection = () => {
|
|
44
|
-
if (context) return context.takeQueuedSelection();
|
|
45
|
-
const selection = localPendingRef.current;
|
|
46
|
-
localPendingRef.current = null;
|
|
47
|
-
return selection;
|
|
48
|
-
};
|
|
49
|
-
const rememberSelection = (event) => {
|
|
50
|
-
if (!context) return;
|
|
51
|
-
const { selectionStart, selectionEnd } = event.currentTarget;
|
|
52
|
-
context.rememberSelection({
|
|
53
|
-
start: selectionStart,
|
|
54
|
-
end: selectionEnd
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
const handleKeyDown = (event) => {
|
|
58
|
-
const el = event.currentTarget;
|
|
59
|
-
if (event.key === "Escape" || (event.metaKey || event.ctrlKey) && event.shiftKey && event.key.toLowerCase() === "m") {
|
|
60
|
-
event.preventDefault();
|
|
61
|
-
el.blur();
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (event.key === "Tab" && !event.shiftKey) {
|
|
65
|
-
event.preventDefault();
|
|
66
|
-
const { selectionStart, selectionEnd } = el;
|
|
67
|
-
const next = value.slice(selectionStart, selectionEnd).includes("\n") ? require_applyAction.applyAction(INDENT_ACTION, {
|
|
68
|
-
value,
|
|
69
|
-
selectionStart,
|
|
70
|
-
selectionEnd
|
|
71
|
-
}) : {
|
|
72
|
-
value: value.slice(0, selectionStart) + " " + value.slice(selectionEnd),
|
|
73
|
-
selectionStart: selectionStart + 1,
|
|
74
|
-
selectionEnd: selectionStart + 1
|
|
75
|
-
};
|
|
76
|
-
queueSelection({
|
|
77
|
-
start: next.selectionStart,
|
|
78
|
-
end: next.selectionEnd
|
|
79
|
-
});
|
|
80
|
-
onChange(next.value);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
(0, react.useLayoutEffect)(() => {
|
|
84
|
-
const selection = takeQueuedSelection();
|
|
85
|
-
if (!selection) return;
|
|
86
|
-
const textarea = paneRef.current.querySelector("textarea");
|
|
87
|
-
textarea.focus();
|
|
88
|
-
textarea.setSelectionRange(selection.start, selection.end);
|
|
89
|
-
});
|
|
90
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(EditorRoot, {
|
|
91
|
-
ref: paneRef,
|
|
92
|
-
flexDirection: "column",
|
|
93
|
-
flex: 1,
|
|
94
|
-
minWidth: 0,
|
|
95
|
-
gap: 1,
|
|
96
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TextInput.TextInput, {
|
|
97
|
-
multiline: true,
|
|
98
|
-
resize: true,
|
|
99
|
-
fullWidth: true,
|
|
100
|
-
variant,
|
|
101
|
-
color,
|
|
102
|
-
textColor,
|
|
103
|
-
size,
|
|
104
|
-
name,
|
|
105
|
-
id,
|
|
106
|
-
error,
|
|
107
|
-
required,
|
|
108
|
-
disabled,
|
|
109
|
-
minRows,
|
|
110
|
-
value,
|
|
111
|
-
placeholder,
|
|
112
|
-
onChange: (event) => onChange(event.target.value),
|
|
113
|
-
inputProps: {
|
|
114
|
-
"aria-label": "Markdown source",
|
|
115
|
-
"aria-describedby": showShortcutHint ? hintId : void 0,
|
|
116
|
-
onSelect: rememberSelection,
|
|
117
|
-
onBlur: rememberSelection,
|
|
118
|
-
onKeyDown: handleKeyDown
|
|
119
|
-
}
|
|
120
|
-
}), showShortcutHint && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
121
|
-
id: hintId,
|
|
122
|
-
variant: "caption",
|
|
123
|
-
color: "secondary",
|
|
124
|
-
m: 0,
|
|
125
|
-
children: "Tab inserts a tab · press Escape or Ctrl/Cmd+Shift+M to move focus out."
|
|
126
|
-
})]
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
exports.Editor = Editor;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { a as TextInputSize, o as TextInputTextColor, r as TextInputColor, s as TextInputVariant } from "../index-C5_ciaeo.cjs";
|
|
2
|
-
//#region src/Markdown/Editor/Editor.d.ts
|
|
3
|
-
interface EditorProps {
|
|
4
|
-
/** Standalone source value — used when rendered outside a `Control`. Ignored inside one. */
|
|
5
|
-
value?: string;
|
|
6
|
-
/** Standalone change handler — used when rendered outside a `Control`. Ignored inside one. */
|
|
7
|
-
onChange?: (value: string) => void;
|
|
8
|
-
/** Placeholder shown while the source is empty. */
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
/** Minimum visible rows of the source textarea. Default: `16`. */
|
|
11
|
-
minRows?: number;
|
|
12
|
-
/** Visual style of the source input — forwarded to `TextInput`. Default: `'default'`. */
|
|
13
|
-
variant?: TextInputVariant;
|
|
14
|
-
/** Focus/active border colour — forwarded to `TextInput`. */
|
|
15
|
-
color?: TextInputColor;
|
|
16
|
-
/** Text colour of the typed source — forwarded to `TextInput`. Default: `'initial'`. */
|
|
17
|
-
textColor?: TextInputTextColor;
|
|
18
|
-
/** Padding/font-size density — forwarded to `TextInput`. */
|
|
19
|
-
size?: TextInputSize;
|
|
20
|
-
/** Native `name` on the textarea — set it for native `<form>` submission / FormData. */
|
|
21
|
-
name?: string;
|
|
22
|
-
/** `id` for label association. Falls back to the enclosing `FormControl`. */
|
|
23
|
-
id?: string;
|
|
24
|
-
/** Marks the field invalid (error border). Falls back to the enclosing `FormControl`. */
|
|
25
|
-
error?: boolean;
|
|
26
|
-
/** Marks the field required. Falls back to the enclosing `FormControl`. */
|
|
27
|
-
required?: boolean;
|
|
28
|
-
/** Disables editing. Falls back to the enclosing `FormControl`. */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
/** Shows a one-line hint about the Tab / focus-release shortcuts under the field. Default: `true`. */
|
|
31
|
-
showShortcutHint?: boolean;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The source `<textarea>`, with selection tracking and Tab-to-indent. Inside a `Control` it is
|
|
35
|
-
* driven by context (so the `Toolbar` can act on it); on its own it is a plain controlled field
|
|
36
|
-
* via `value`/`onChange`.
|
|
37
|
-
*/
|
|
38
|
-
declare function Editor({ value: valueProp, onChange: onChangeProp, placeholder, minRows, variant, color, textColor: textColorProp, size, name, id, error, required, disabled, showShortcutHint }: Readonly<EditorProps>): import("react").JSX.Element;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { Editor, EditorProps };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { a as TextInputSize, o as TextInputTextColor, r as TextInputColor, s as TextInputVariant } from "../index-Bwi4kRpf.mjs";
|
|
2
|
-
//#region src/Markdown/Editor/Editor.d.ts
|
|
3
|
-
interface EditorProps {
|
|
4
|
-
/** Standalone source value — used when rendered outside a `Control`. Ignored inside one. */
|
|
5
|
-
value?: string;
|
|
6
|
-
/** Standalone change handler — used when rendered outside a `Control`. Ignored inside one. */
|
|
7
|
-
onChange?: (value: string) => void;
|
|
8
|
-
/** Placeholder shown while the source is empty. */
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
/** Minimum visible rows of the source textarea. Default: `16`. */
|
|
11
|
-
minRows?: number;
|
|
12
|
-
/** Visual style of the source input — forwarded to `TextInput`. Default: `'default'`. */
|
|
13
|
-
variant?: TextInputVariant;
|
|
14
|
-
/** Focus/active border colour — forwarded to `TextInput`. */
|
|
15
|
-
color?: TextInputColor;
|
|
16
|
-
/** Text colour of the typed source — forwarded to `TextInput`. Default: `'initial'`. */
|
|
17
|
-
textColor?: TextInputTextColor;
|
|
18
|
-
/** Padding/font-size density — forwarded to `TextInput`. */
|
|
19
|
-
size?: TextInputSize;
|
|
20
|
-
/** Native `name` on the textarea — set it for native `<form>` submission / FormData. */
|
|
21
|
-
name?: string;
|
|
22
|
-
/** `id` for label association. Falls back to the enclosing `FormControl`. */
|
|
23
|
-
id?: string;
|
|
24
|
-
/** Marks the field invalid (error border). Falls back to the enclosing `FormControl`. */
|
|
25
|
-
error?: boolean;
|
|
26
|
-
/** Marks the field required. Falls back to the enclosing `FormControl`. */
|
|
27
|
-
required?: boolean;
|
|
28
|
-
/** Disables editing. Falls back to the enclosing `FormControl`. */
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
/** Shows a one-line hint about the Tab / focus-release shortcuts under the field. Default: `true`. */
|
|
31
|
-
showShortcutHint?: boolean;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The source `<textarea>`, with selection tracking and Tab-to-indent. Inside a `Control` it is
|
|
35
|
-
* driven by context (so the `Toolbar` can act on it); on its own it is a plain controlled field
|
|
36
|
-
* via `value`/`onChange`.
|
|
37
|
-
*/
|
|
38
|
-
declare function Editor({ value: valueProp, onChange: onChangeProp, placeholder, minRows, variant, color, textColor: textColorProp, size, name, id, error, required, disabled, showShortcutHint }: Readonly<EditorProps>): import("react").JSX.Element;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { Editor, EditorProps };
|