@fangxinyan/lumina 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Accordion-3TQPKNN3.css → Accordion-REMDCQUD.css} +0 -1
- package/dist/Accordion.cjs +3 -3
- package/dist/Accordion.js +2 -2
- package/dist/Alert.cjs +3 -3
- package/dist/Alert.js +2 -2
- package/dist/AppShell.cjs +5 -5
- package/dist/AppShell.js +1 -1
- package/dist/AutoComplete-P5KZMZO5.css +54 -0
- package/dist/AutoComplete.cjs +15 -0
- package/dist/AutoComplete.cjs.map +1 -0
- package/dist/AutoComplete.d.cts +51 -0
- package/dist/AutoComplete.d.ts +51 -0
- package/dist/AutoComplete.js +6 -0
- package/dist/AutoComplete.js.map +1 -0
- package/dist/Avatar.cjs +2 -2
- package/dist/Avatar.js +1 -1
- package/dist/Button.cjs +4 -4
- package/dist/Button.js +2 -2
- package/dist/Calendar.cjs +3 -3
- package/dist/Calendar.js +2 -2
- package/dist/Card.cjs +3 -3
- package/dist/Card.js +1 -1
- package/dist/{Cascader-DTRTTXC2.css → Cascader-VSYEKQCG.css} +1 -1
- package/dist/Cascader.cjs +3 -3
- package/dist/Cascader.js +2 -2
- package/dist/Checkbox.cjs +4 -4
- package/dist/Checkbox.js +2 -2
- package/dist/{ColorPicker-GP7AQYUU.css → ColorPicker-SDDQGHCM.css} +1 -1
- package/dist/ColorPicker.cjs +2 -2
- package/dist/ColorPicker.js +1 -1
- package/dist/CommandPalette-T45DBMPY.css +139 -0
- package/dist/CommandPalette.cjs +14 -0
- package/dist/CommandPalette.cjs.map +1 -0
- package/dist/CommandPalette.d.cts +65 -0
- package/dist/CommandPalette.d.ts +65 -0
- package/dist/CommandPalette.js +5 -0
- package/dist/CommandPalette.js.map +1 -0
- package/dist/ContextMenu-FKW6CQW4.css +76 -0
- package/dist/ContextMenu.cjs +12 -0
- package/dist/ContextMenu.cjs.map +1 -0
- package/dist/ContextMenu.d.cts +50 -0
- package/dist/ContextMenu.d.ts +50 -0
- package/dist/ContextMenu.js +3 -0
- package/dist/ContextMenu.js.map +1 -0
- package/dist/Divider.cjs +2 -2
- package/dist/Divider.js +1 -1
- package/dist/Drawer.cjs +3 -3
- package/dist/Drawer.js +2 -2
- package/dist/Empty.cjs +4 -4
- package/dist/Empty.js +1 -1
- package/dist/Form-5GRVZNDO.css +67 -0
- package/dist/Form.cjs +20 -0
- package/dist/Form.cjs.map +1 -0
- package/dist/Form.d.cts +85 -0
- package/dist/Form.d.ts +85 -0
- package/dist/Form.js +3 -0
- package/dist/Form.js.map +1 -0
- package/dist/Icon.cjs +3 -3
- package/dist/Icon.d.cts +1 -1
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +1 -1
- package/dist/{Image-WYWORJT4.css → Image-4MN34O6P.css} +1 -1
- package/dist/Image.cjs +4 -4
- package/dist/Image.js +2 -2
- package/dist/Input.cjs +4 -4
- package/dist/Input.js +2 -2
- package/dist/InputNumber-VXQIWLQC.css +40 -0
- package/dist/InputNumber.cjs +14 -0
- package/dist/InputNumber.cjs.map +1 -0
- package/dist/InputNumber.d.cts +46 -0
- package/dist/InputNumber.d.ts +46 -0
- package/dist/InputNumber.js +5 -0
- package/dist/InputNumber.js.map +1 -0
- package/dist/List.cjs +2 -2
- package/dist/List.js +1 -1
- package/dist/{Modal-N4YVLEWW.css → Modal-XSDMU4XJ.css} +1 -1
- package/dist/Modal.cjs +4 -4
- package/dist/Modal.js +3 -3
- package/dist/Pagination.cjs +5 -5
- package/dist/Pagination.js +4 -4
- package/dist/{Popover-MGCMOXYP.css → Popover-NYEKT5CQ.css} +1 -1
- package/dist/Popover.cjs +2 -2
- package/dist/Popover.js +1 -1
- package/dist/Progress.cjs +3 -3
- package/dist/Progress.js +1 -1
- package/dist/{Select-EDG37C37.css → Select-J3CCVFJ7.css} +1 -1
- package/dist/Select.cjs +4 -4
- package/dist/Select.js +3 -3
- package/dist/Slider.cjs +2 -2
- package/dist/Slider.js +1 -1
- package/dist/Splitter-DHNOY4NC.css +66 -0
- package/dist/Splitter.cjs +12 -0
- package/dist/Splitter.cjs.map +1 -0
- package/dist/Splitter.d.cts +44 -0
- package/dist/Splitter.d.ts +44 -0
- package/dist/Splitter.js +3 -0
- package/dist/Splitter.js.map +1 -0
- package/dist/StatusBar-CDS2GPSI.css +58 -0
- package/dist/StatusBar.cjs +16 -0
- package/dist/StatusBar.cjs.map +1 -0
- package/dist/StatusBar.d.cts +39 -0
- package/dist/StatusBar.d.ts +39 -0
- package/dist/StatusBar.js +3 -0
- package/dist/StatusBar.js.map +1 -0
- package/dist/Switch.cjs +2 -2
- package/dist/Switch.js +1 -1
- package/dist/{Table-YKVM42SW.css → Table-2LPTOUIR.css} +1 -1
- package/dist/Table.cjs +8 -8
- package/dist/Table.js +6 -6
- package/dist/Tabs.cjs +3 -3
- package/dist/Tabs.js +1 -1
- package/dist/Tag.cjs +4 -4
- package/dist/Tag.js +2 -2
- package/dist/Theme.cjs +10 -10
- package/dist/Theme.js +1 -1
- package/dist/{Toast-ERHDN3WG.css → Toast-6PVSAXQ5.css} +1 -1
- package/dist/Toast.cjs +4 -4
- package/dist/Toast.js +2 -2
- package/dist/Tooltip.cjs +2 -2
- package/dist/Tooltip.js +1 -1
- package/dist/Typography.cjs +7 -7
- package/dist/Typography.js +2 -2
- package/dist/{chunk-IKI5CS4L.cjs → chunk-2ENTRT7R.cjs} +7 -7
- package/dist/{chunk-IKI5CS4L.cjs.map → chunk-2ENTRT7R.cjs.map} +1 -1
- package/dist/{chunk-FI7QO3I5.cjs → chunk-33TIL25B.cjs} +3 -3
- package/dist/{chunk-FI7QO3I5.cjs.map → chunk-33TIL25B.cjs.map} +1 -1
- package/dist/{chunk-5WF6M47X.cjs → chunk-3BZ47QNV.cjs} +8 -8
- package/dist/{chunk-5WF6M47X.cjs.map → chunk-3BZ47QNV.cjs.map} +1 -1
- package/dist/{chunk-NE4YEBFH.js → chunk-3UU2PUK4.js} +4 -4
- package/dist/{chunk-NE4YEBFH.js.map → chunk-3UU2PUK4.js.map} +1 -1
- package/dist/chunk-47Z4NIU4.js +118 -0
- package/dist/chunk-47Z4NIU4.js.map +1 -0
- package/dist/{chunk-4U4OY5RA.js → chunk-4SCDDSXY.js} +3 -3
- package/dist/{chunk-4U4OY5RA.js.map → chunk-4SCDDSXY.js.map} +1 -1
- package/dist/{chunk-NXOAYNG2.cjs → chunk-5BFETKVP.cjs} +3 -3
- package/dist/{chunk-NXOAYNG2.cjs.map → chunk-5BFETKVP.cjs.map} +1 -1
- package/dist/{chunk-VICGQC6G.cjs → chunk-5EAVXFFD.cjs} +3 -3
- package/dist/{chunk-VICGQC6G.cjs.map → chunk-5EAVXFFD.cjs.map} +1 -1
- package/dist/{chunk-OYGFMXAA.js → chunk-5N7347MI.js} +3 -3
- package/dist/{chunk-OYGFMXAA.js.map → chunk-5N7347MI.js.map} +1 -1
- package/dist/{chunk-VJN637MT.js → chunk-5PREWYTB.js} +3 -3
- package/dist/{chunk-VJN637MT.js.map → chunk-5PREWYTB.js.map} +1 -1
- package/dist/{chunk-BBPNQ44M.js → chunk-6GNFRP2H.js} +3 -3
- package/dist/{chunk-BBPNQ44M.js.map → chunk-6GNFRP2H.js.map} +1 -1
- package/dist/{chunk-ZVCMXDTP.js → chunk-6XZ362VL.js} +6 -6
- package/dist/{chunk-ZVCMXDTP.js.map → chunk-6XZ362VL.js.map} +1 -1
- package/dist/chunk-6Z24VO3K.js +184 -0
- package/dist/chunk-6Z24VO3K.js.map +1 -0
- package/dist/{chunk-K7PVJLW4.cjs → chunk-77TZHI76.cjs} +8 -8
- package/dist/{chunk-K7PVJLW4.cjs.map → chunk-77TZHI76.cjs.map} +1 -1
- package/dist/{chunk-QPZZNSRB.js → chunk-7M7NAMR5.js} +5 -5
- package/dist/{chunk-QPZZNSRB.js.map → chunk-7M7NAMR5.js.map} +1 -1
- package/dist/chunk-7T2SLRNL.cjs +140 -0
- package/dist/chunk-7T2SLRNL.cjs.map +1 -0
- package/dist/chunk-7YQWG7HR.cjs +45 -0
- package/dist/chunk-7YQWG7HR.cjs.map +1 -0
- package/dist/{chunk-TYQ5CN2C.js → chunk-AESLEYST.js} +5 -5
- package/dist/{chunk-TYQ5CN2C.js.map → chunk-AESLEYST.js.map} +1 -1
- package/dist/{chunk-PBBHUUXU.cjs → chunk-B5JH7NRZ.cjs} +3 -3
- package/dist/{chunk-PBBHUUXU.cjs.map → chunk-B5JH7NRZ.cjs.map} +1 -1
- package/dist/chunk-BCPAY65C.cjs +169 -0
- package/dist/chunk-BCPAY65C.cjs.map +1 -0
- package/dist/{chunk-E6R63QOL.js → chunk-CTYW42GG.js} +7 -7
- package/dist/{chunk-E6R63QOL.js.map → chunk-CTYW42GG.js.map} +1 -1
- package/dist/chunk-E62JFAHW.js +147 -0
- package/dist/chunk-E62JFAHW.js.map +1 -0
- package/dist/{chunk-WNGG25QX.js → chunk-FFZLSY2N.js} +3 -3
- package/dist/{chunk-WNGG25QX.js.map → chunk-FFZLSY2N.js.map} +1 -1
- package/dist/{chunk-IWVKITPN.js → chunk-FXQGPHK2.js} +4 -4
- package/dist/{chunk-IWVKITPN.js.map → chunk-FXQGPHK2.js.map} +1 -1
- package/dist/{chunk-Z7P6QGMT.js → chunk-GR5STMOA.js} +3 -3
- package/dist/{chunk-Z7P6QGMT.js.map → chunk-GR5STMOA.js.map} +1 -1
- package/dist/{chunk-RDLPX7RK.cjs → chunk-HJIKU6MF.cjs} +33 -7
- package/dist/chunk-HJIKU6MF.cjs.map +1 -0
- package/dist/{chunk-QESLHLTG.cjs → chunk-HXSAH4Y6.cjs} +9 -9
- package/dist/{chunk-QESLHLTG.cjs.map → chunk-HXSAH4Y6.cjs.map} +1 -1
- package/dist/{chunk-RPD2OIIP.js → chunk-I2HHC6QW.js} +4 -4
- package/dist/{chunk-RPD2OIIP.js.map → chunk-I2HHC6QW.js.map} +1 -1
- package/dist/{chunk-GZGZR4FT.js → chunk-I7WLFADD.js} +4 -4
- package/dist/{chunk-GZGZR4FT.js.map → chunk-I7WLFADD.js.map} +1 -1
- package/dist/chunk-IHACXMOI.js +307 -0
- package/dist/chunk-IHACXMOI.js.map +1 -0
- package/dist/chunk-IJA26LRY.cjs +209 -0
- package/dist/chunk-IJA26LRY.cjs.map +1 -0
- package/dist/chunk-IOWREUEP.js +170 -0
- package/dist/chunk-IOWREUEP.js.map +1 -0
- package/dist/{chunk-AXMEZGEG.cjs → chunk-IZDJCEMF.cjs} +3 -3
- package/dist/{chunk-AXMEZGEG.cjs.map → chunk-IZDJCEMF.cjs.map} +1 -1
- package/dist/{chunk-V34OPWKZ.js → chunk-JSDQVVQB.js} +3 -3
- package/dist/{chunk-V34OPWKZ.js.map → chunk-JSDQVVQB.js.map} +1 -1
- package/dist/{chunk-77BVQNAQ.js → chunk-JXHMJUVI.js} +4 -4
- package/dist/{chunk-77BVQNAQ.js.map → chunk-JXHMJUVI.js.map} +1 -1
- package/dist/{chunk-GIVMKGZN.js → chunk-KW7Z4IQC.js} +4 -4
- package/dist/{chunk-GIVMKGZN.js.map → chunk-KW7Z4IQC.js.map} +1 -1
- package/dist/{chunk-QTGDYQOT.cjs → chunk-LLNEDEST.cjs} +4 -4
- package/dist/{chunk-QTGDYQOT.cjs.map → chunk-LLNEDEST.cjs.map} +1 -1
- package/dist/{chunk-AJZKESHB.js → chunk-LXNR6TQK.js} +4 -4
- package/dist/{chunk-AJZKESHB.js.map → chunk-LXNR6TQK.js.map} +1 -1
- package/dist/{chunk-SBMOIE5C.cjs → chunk-MDQNUKCP.cjs} +14 -14
- package/dist/{chunk-SBMOIE5C.cjs.map → chunk-MDQNUKCP.cjs.map} +1 -1
- package/dist/{chunk-JKLQOB2F.cjs → chunk-MUFMJPRT.cjs} +3 -3
- package/dist/{chunk-JKLQOB2F.cjs.map → chunk-MUFMJPRT.cjs.map} +1 -1
- package/dist/{chunk-AEJJGUEN.cjs → chunk-N73JGXYZ.cjs} +5 -5
- package/dist/{chunk-AEJJGUEN.cjs.map → chunk-N73JGXYZ.cjs.map} +1 -1
- package/dist/{chunk-C5TGQ7CV.cjs → chunk-NN7WMXY4.cjs} +5 -5
- package/dist/{chunk-C5TGQ7CV.cjs.map → chunk-NN7WMXY4.cjs.map} +1 -1
- package/dist/{chunk-7H453VPW.cjs → chunk-NQQWCIE6.cjs} +3 -3
- package/dist/{chunk-7H453VPW.cjs.map → chunk-NQQWCIE6.cjs.map} +1 -1
- package/dist/{chunk-ZWP4LSS3.js → chunk-NS3C2ZSE.js} +3 -3
- package/dist/{chunk-ZWP4LSS3.js.map → chunk-NS3C2ZSE.js.map} +1 -1
- package/dist/{chunk-HKAQILD2.cjs → chunk-O2HMH5BI.cjs} +4 -4
- package/dist/{chunk-HKAQILD2.cjs.map → chunk-O2HMH5BI.cjs.map} +1 -1
- package/dist/{chunk-4MR4GVTD.js → chunk-O7C6S644.js} +32 -6
- package/dist/chunk-O7C6S644.js.map +1 -0
- package/dist/{chunk-K5MHL732.js → chunk-OM76QWUN.js} +5 -5
- package/dist/{chunk-K5MHL732.js.map → chunk-OM76QWUN.js.map} +1 -1
- package/dist/chunk-OWNVDXRQ.js +42 -0
- package/dist/chunk-OWNVDXRQ.js.map +1 -0
- package/dist/{chunk-3UFU63X7.cjs → chunk-OZVPJWXO.cjs} +3 -3
- package/dist/{chunk-3UFU63X7.cjs.map → chunk-OZVPJWXO.cjs.map} +1 -1
- package/dist/{chunk-M6CGYGEO.js → chunk-PKXXR76Q.js} +4 -4
- package/dist/{chunk-M6CGYGEO.js.map → chunk-PKXXR76Q.js.map} +1 -1
- package/dist/{chunk-7U6I44RV.cjs → chunk-Q7CDWNM6.cjs} +3 -3
- package/dist/{chunk-7U6I44RV.cjs.map → chunk-Q7CDWNM6.cjs.map} +1 -1
- package/dist/{chunk-437LB2V4.js → chunk-QJGKI2BD.js} +3 -3
- package/dist/{chunk-437LB2V4.js.map → chunk-QJGKI2BD.js.map} +1 -1
- package/dist/{chunk-GEYMWUW6.js → chunk-QOGROEVD.js} +23 -5
- package/dist/chunk-QOGROEVD.js.map +1 -0
- package/dist/chunk-QVFEKGKI.cjs +331 -0
- package/dist/chunk-QVFEKGKI.cjs.map +1 -0
- package/dist/chunk-RFU5HN4E.js +149 -0
- package/dist/chunk-RFU5HN4E.js.map +1 -0
- package/dist/{chunk-URF6RBW6.cjs → chunk-RQV7SMIZ.cjs} +6 -6
- package/dist/{chunk-URF6RBW6.cjs.map → chunk-RQV7SMIZ.cjs.map} +1 -1
- package/dist/{chunk-OPTTHURA.cjs → chunk-RWHWEQQX.cjs} +7 -7
- package/dist/{chunk-OPTTHURA.cjs.map → chunk-RWHWEQQX.cjs.map} +1 -1
- package/dist/{chunk-CCBHZYE6.cjs → chunk-SMHXSEBD.cjs} +9 -9
- package/dist/{chunk-CCBHZYE6.cjs.map → chunk-SMHXSEBD.cjs.map} +1 -1
- package/dist/{chunk-EPFYIR63.cjs → chunk-T4PI2ZX7.cjs} +16 -16
- package/dist/{chunk-EPFYIR63.cjs.map → chunk-T4PI2ZX7.cjs.map} +1 -1
- package/dist/{chunk-YEOARJKR.cjs → chunk-TQLCIXCK.cjs} +3 -3
- package/dist/{chunk-YEOARJKR.cjs.map → chunk-TQLCIXCK.cjs.map} +1 -1
- package/dist/{chunk-LSLYY5FN.js → chunk-TZLM5GF4.js} +6 -6
- package/dist/{chunk-LSLYY5FN.js.map → chunk-TZLM5GF4.js.map} +1 -1
- package/dist/{chunk-Z5X5AMLA.cjs → chunk-TZXEZFCI.cjs} +6 -6
- package/dist/{chunk-Z5X5AMLA.cjs.map → chunk-TZXEZFCI.cjs.map} +1 -1
- package/dist/{chunk-3WAFIUDQ.js → chunk-UQB5OHMO.js} +3 -3
- package/dist/{chunk-3WAFIUDQ.js.map → chunk-UQB5OHMO.js.map} +1 -1
- package/dist/chunk-VQBZKRIB.cjs +192 -0
- package/dist/chunk-VQBZKRIB.cjs.map +1 -0
- package/dist/{chunk-I7SSCSFH.js → chunk-W6I67HQQ.js} +3 -3
- package/dist/{chunk-I7SSCSFH.js.map → chunk-W6I67HQQ.js.map} +1 -1
- package/dist/{chunk-4GT5TOHP.js → chunk-WDBJVKSR.js} +3 -3
- package/dist/{chunk-4GT5TOHP.js.map → chunk-WDBJVKSR.js.map} +1 -1
- package/dist/{chunk-NSUD5B22.js → chunk-WUOFJPZ4.js} +4 -4
- package/dist/{chunk-NSUD5B22.js.map → chunk-WUOFJPZ4.js.map} +1 -1
- package/dist/{chunk-TWBJCFEJ.cjs → chunk-WVBFQB26.cjs} +8 -8
- package/dist/{chunk-TWBJCFEJ.cjs.map → chunk-WVBFQB26.cjs.map} +1 -1
- package/dist/chunk-WZ73TWB2.cjs +174 -0
- package/dist/chunk-WZ73TWB2.cjs.map +1 -0
- package/dist/{chunk-H6FCIJOP.js → chunk-XCYE4OQV.js} +4 -4
- package/dist/{chunk-H6FCIJOP.js.map → chunk-XCYE4OQV.js.map} +1 -1
- package/dist/{chunk-F7HW2PYR.cjs → chunk-XUT2Z2L6.cjs} +3 -3
- package/dist/{chunk-F7HW2PYR.cjs.map → chunk-XUT2Z2L6.cjs.map} +1 -1
- package/dist/{chunk-TZSWDH5T.cjs → chunk-XYVJ3FBQ.cjs} +6 -6
- package/dist/{chunk-TZSWDH5T.cjs.map → chunk-XYVJ3FBQ.cjs.map} +1 -1
- package/dist/{chunk-YVO7XO4W.cjs → chunk-YCHUHMNP.cjs} +22 -4
- package/dist/chunk-YCHUHMNP.cjs.map +1 -0
- package/dist/{chunk-LDENBYRC.cjs → chunk-YFBHVTKN.cjs} +8 -8
- package/dist/{chunk-LDENBYRC.cjs.map → chunk-YFBHVTKN.cjs.map} +1 -1
- package/dist/{chunk-IDM6JJLP.cjs → chunk-YZ2I7CDF.cjs} +3 -3
- package/dist/{chunk-IDM6JJLP.cjs.map → chunk-YZ2I7CDF.cjs.map} +1 -1
- package/dist/{chunk-OEHCA5IV.js → chunk-ZFJHUOFU.js} +5 -5
- package/dist/{chunk-OEHCA5IV.js.map → chunk-ZFJHUOFU.js.map} +1 -1
- package/dist/index.cjs +168 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +39 -32
- package/dist/index.js.map +1 -1
- package/dist/styles.css +25 -18
- package/dist/{tokens-HWQ7KWPG.css → tokens-BIIUTPKN.css} +17 -9
- package/dist/tokens.css +17 -9
- package/docs/llms/autocomplete.md +56 -0
- package/docs/llms/commandpalette.md +58 -0
- package/docs/llms/contextmenu.md +55 -0
- package/docs/llms/form.md +121 -0
- package/docs/llms/inputnumber.md +57 -0
- package/docs/llms/splitter.md +63 -0
- package/docs/llms/statusbar.md +53 -0
- package/docs/llms.md +8 -1
- package/package.json +1 -1
- package/dist/chunk-4MR4GVTD.js.map +0 -1
- package/dist/chunk-GEYMWUW6.js.map +0 -1
- package/dist/chunk-RDLPX7RK.cjs.map +0 -1
- package/dist/chunk-YVO7XO4W.cjs.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface CommandItem {
|
|
4
|
+
key: string;
|
|
5
|
+
/** Displayed label; also matched against the search query by default. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional secondary line — e.g. "Open recent". */
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
/** Leading icon. */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Right-aligned shortcut hint, e.g. `"⌘P"`. */
|
|
12
|
+
shortcut?: React.ReactNode;
|
|
13
|
+
/** Extra search terms beyond `label`. */
|
|
14
|
+
keywords?: string[];
|
|
15
|
+
/** Group heading. Items sharing a `group` appear under one heading. */
|
|
16
|
+
group?: string;
|
|
17
|
+
/** Ignored by default filter — still shown. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
onSelect?: () => void;
|
|
20
|
+
}
|
|
21
|
+
interface CommandPaletteProps {
|
|
22
|
+
open: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
items: CommandItem[];
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** Custom matcher. Return true to keep the item. */
|
|
27
|
+
filter?: (item: CommandItem, query: string) => boolean;
|
|
28
|
+
/** Shown when no item matches the query. */
|
|
29
|
+
emptyText?: React.ReactNode;
|
|
30
|
+
/** Reset the query to empty whenever the palette opens. Default true. */
|
|
31
|
+
resetOnOpen?: boolean;
|
|
32
|
+
/** Footer node. Pass `null` to hide. */
|
|
33
|
+
footer?: React.ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `CommandPalette` — ⌘K-style action launcher. Search + grouped items +
|
|
38
|
+
* keyboard nav. Rendered into `document.body`.
|
|
39
|
+
*
|
|
40
|
+
* The parent controls `open` via state — wire `Cmd/Ctrl+K` to toggle.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const [open, setOpen] = React.useState(false);
|
|
45
|
+
* React.useEffect(() => {
|
|
46
|
+
* const h = (e: KeyboardEvent) => {
|
|
47
|
+
* if ((e.metaKey || e.ctrlKey) && e.key === "k") { e.preventDefault(); setOpen(o => !o); }
|
|
48
|
+
* };
|
|
49
|
+
* window.addEventListener("keydown", h);
|
|
50
|
+
* return () => window.removeEventListener("keydown", h);
|
|
51
|
+
* }, []);
|
|
52
|
+
*
|
|
53
|
+
* <CommandPalette
|
|
54
|
+
* open={open}
|
|
55
|
+
* onOpenChange={setOpen}
|
|
56
|
+
* items={[
|
|
57
|
+
* { key: "new", label: "新建文件", icon: <Icon name="plus" size={14} />, group: "文件", shortcut: "⌘N", onSelect: () => {} },
|
|
58
|
+
* ...
|
|
59
|
+
* ]}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const CommandPalette: React.FC<CommandPaletteProps>;
|
|
64
|
+
|
|
65
|
+
export { type CommandItem, CommandPalette, type CommandPaletteProps };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface CommandItem {
|
|
4
|
+
key: string;
|
|
5
|
+
/** Displayed label; also matched against the search query by default. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional secondary line — e.g. "Open recent". */
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
/** Leading icon. */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Right-aligned shortcut hint, e.g. `"⌘P"`. */
|
|
12
|
+
shortcut?: React.ReactNode;
|
|
13
|
+
/** Extra search terms beyond `label`. */
|
|
14
|
+
keywords?: string[];
|
|
15
|
+
/** Group heading. Items sharing a `group` appear under one heading. */
|
|
16
|
+
group?: string;
|
|
17
|
+
/** Ignored by default filter — still shown. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
onSelect?: () => void;
|
|
20
|
+
}
|
|
21
|
+
interface CommandPaletteProps {
|
|
22
|
+
open: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
items: CommandItem[];
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** Custom matcher. Return true to keep the item. */
|
|
27
|
+
filter?: (item: CommandItem, query: string) => boolean;
|
|
28
|
+
/** Shown when no item matches the query. */
|
|
29
|
+
emptyText?: React.ReactNode;
|
|
30
|
+
/** Reset the query to empty whenever the palette opens. Default true. */
|
|
31
|
+
resetOnOpen?: boolean;
|
|
32
|
+
/** Footer node. Pass `null` to hide. */
|
|
33
|
+
footer?: React.ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `CommandPalette` — ⌘K-style action launcher. Search + grouped items +
|
|
38
|
+
* keyboard nav. Rendered into `document.body`.
|
|
39
|
+
*
|
|
40
|
+
* The parent controls `open` via state — wire `Cmd/Ctrl+K` to toggle.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const [open, setOpen] = React.useState(false);
|
|
45
|
+
* React.useEffect(() => {
|
|
46
|
+
* const h = (e: KeyboardEvent) => {
|
|
47
|
+
* if ((e.metaKey || e.ctrlKey) && e.key === "k") { e.preventDefault(); setOpen(o => !o); }
|
|
48
|
+
* };
|
|
49
|
+
* window.addEventListener("keydown", h);
|
|
50
|
+
* return () => window.removeEventListener("keydown", h);
|
|
51
|
+
* }, []);
|
|
52
|
+
*
|
|
53
|
+
* <CommandPalette
|
|
54
|
+
* open={open}
|
|
55
|
+
* onOpenChange={setOpen}
|
|
56
|
+
* items={[
|
|
57
|
+
* { key: "new", label: "新建文件", icon: <Icon name="plus" size={14} />, group: "文件", shortcut: "⌘N", onSelect: () => {} },
|
|
58
|
+
* ...
|
|
59
|
+
* ]}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const CommandPalette: React.FC<CommandPaletteProps>;
|
|
64
|
+
|
|
65
|
+
export { type CommandItem, CommandPalette, type CommandPaletteProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"CommandPalette.js"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* ============ ContextMenu ============ */
|
|
2
|
+
.context-menu {
|
|
3
|
+
z-index: 5000;
|
|
4
|
+
padding: 6px;
|
|
5
|
+
background: var(--bg);
|
|
6
|
+
border-radius: var(--r-md);
|
|
7
|
+
box-shadow: var(--neu-float);
|
|
8
|
+
border: 1px solid var(--divider);
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: 1px;
|
|
12
|
+
animation: menuIn 140ms var(--ease);
|
|
13
|
+
max-height: calc(100vh - 24px);
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.context-menu-item {
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-columns: 18px 1fr auto;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
padding: 6px 10px;
|
|
23
|
+
min-height: 28px;
|
|
24
|
+
border: none;
|
|
25
|
+
background: transparent;
|
|
26
|
+
box-shadow: none;
|
|
27
|
+
font: inherit;
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
color: var(--fg);
|
|
30
|
+
text-align: left;
|
|
31
|
+
border-radius: var(--r-sm);
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
|
|
34
|
+
box-shadow var(--dur-fast) var(--ease);
|
|
35
|
+
}
|
|
36
|
+
.context-menu-item:disabled { color: var(--fg-subtle); cursor: not-allowed; }
|
|
37
|
+
.context-menu-item.active:not(:disabled) {
|
|
38
|
+
background: var(--bg);
|
|
39
|
+
color: var(--accent-ink);
|
|
40
|
+
box-shadow: var(--neu-in-sm);
|
|
41
|
+
}
|
|
42
|
+
.context-menu-item.danger { color: var(--danger); }
|
|
43
|
+
.context-menu-item.danger.active:not(:disabled) {
|
|
44
|
+
background: var(--bg);
|
|
45
|
+
color: var(--danger);
|
|
46
|
+
box-shadow: var(--neu-in-sm);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.context-menu-icon {
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
align-items: center;
|
|
53
|
+
color: var(--fg-muted);
|
|
54
|
+
}
|
|
55
|
+
.context-menu-item.active:not(:disabled) .context-menu-icon { color: inherit; }
|
|
56
|
+
.context-menu-item.danger .context-menu-icon { color: var(--danger); }
|
|
57
|
+
|
|
58
|
+
.context-menu-label {
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.context-menu-shortcut {
|
|
65
|
+
font-family: var(--font-mono);
|
|
66
|
+
font-size: 11px;
|
|
67
|
+
color: var(--fg-subtle);
|
|
68
|
+
padding-left: 12px;
|
|
69
|
+
}
|
|
70
|
+
.context-menu-item.active:not(:disabled) .context-menu-shortcut { color: inherit; opacity: 0.8; }
|
|
71
|
+
|
|
72
|
+
.context-menu-divider {
|
|
73
|
+
height: 1px;
|
|
74
|
+
background: var(--divider);
|
|
75
|
+
margin: 4px 4px;
|
|
76
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkWZ73TWB2_cjs = require('./chunk-WZ73TWB2.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "ContextMenu", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkWZ73TWB2_cjs.ContextMenu; }
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=ContextMenu.cjs.map
|
|
12
|
+
//# sourceMappingURL=ContextMenu.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ContextMenu.cjs"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ContextMenuItem {
|
|
4
|
+
key: string;
|
|
5
|
+
/** Omit for `type: "divider"`. */
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Right-aligned shortcut hint, e.g. `"⌘C"`. */
|
|
9
|
+
shortcut?: React.ReactNode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Style the item as destructive (red). */
|
|
12
|
+
danger?: boolean;
|
|
13
|
+
/** Render a horizontal separator; other fields are ignored. */
|
|
14
|
+
type?: "divider";
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
}
|
|
17
|
+
interface ContextMenuProps {
|
|
18
|
+
items: ContextMenuItem[];
|
|
19
|
+
/**
|
|
20
|
+
* Any content — right-click anywhere inside the trigger area opens the menu.
|
|
21
|
+
* Internally wrapped in a `display: contents` span so layout is unaffected
|
|
22
|
+
* regardless of whether `children` is a DOM element or a React component.
|
|
23
|
+
*/
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/** Skip the menu entirely — browser default context menu will be used instead. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Minimum panel width in px. Default 180. */
|
|
28
|
+
minWidth?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `ContextMenu` — right-click menu. Wraps one child element; suppresses the
|
|
32
|
+
* browser's native menu and opens a neumorphic replacement at the cursor.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <ContextMenu
|
|
37
|
+
* items={[
|
|
38
|
+
* { key: "copy", label: "复制", shortcut: "⌘C", onSelect: copy },
|
|
39
|
+
* { key: "cut", label: "剪切", shortcut: "⌘X", onSelect: cut },
|
|
40
|
+
* { key: "d1", type: "divider" },
|
|
41
|
+
* { key: "del", label: "删除", danger: true, onSelect: del },
|
|
42
|
+
* ]}
|
|
43
|
+
* >
|
|
44
|
+
* <div>右键点击我</div>
|
|
45
|
+
* </ContextMenu>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare const ContextMenu: React.FC<ContextMenuProps>;
|
|
49
|
+
|
|
50
|
+
export { ContextMenu, type ContextMenuItem, type ContextMenuProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ContextMenuItem {
|
|
4
|
+
key: string;
|
|
5
|
+
/** Omit for `type: "divider"`. */
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Right-aligned shortcut hint, e.g. `"⌘C"`. */
|
|
9
|
+
shortcut?: React.ReactNode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Style the item as destructive (red). */
|
|
12
|
+
danger?: boolean;
|
|
13
|
+
/** Render a horizontal separator; other fields are ignored. */
|
|
14
|
+
type?: "divider";
|
|
15
|
+
onSelect?: () => void;
|
|
16
|
+
}
|
|
17
|
+
interface ContextMenuProps {
|
|
18
|
+
items: ContextMenuItem[];
|
|
19
|
+
/**
|
|
20
|
+
* Any content — right-click anywhere inside the trigger area opens the menu.
|
|
21
|
+
* Internally wrapped in a `display: contents` span so layout is unaffected
|
|
22
|
+
* regardless of whether `children` is a DOM element or a React component.
|
|
23
|
+
*/
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/** Skip the menu entirely — browser default context menu will be used instead. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Minimum panel width in px. Default 180. */
|
|
28
|
+
minWidth?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `ContextMenu` — right-click menu. Wraps one child element; suppresses the
|
|
32
|
+
* browser's native menu and opens a neumorphic replacement at the cursor.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <ContextMenu
|
|
37
|
+
* items={[
|
|
38
|
+
* { key: "copy", label: "复制", shortcut: "⌘C", onSelect: copy },
|
|
39
|
+
* { key: "cut", label: "剪切", shortcut: "⌘X", onSelect: cut },
|
|
40
|
+
* { key: "d1", type: "divider" },
|
|
41
|
+
* { key: "del", label: "删除", danger: true, onSelect: del },
|
|
42
|
+
* ]}
|
|
43
|
+
* >
|
|
44
|
+
* <div>右键点击我</div>
|
|
45
|
+
* </ContextMenu>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare const ContextMenu: React.FC<ContextMenuProps>;
|
|
49
|
+
|
|
50
|
+
export { ContextMenu, type ContextMenuItem, type ContextMenuProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ContextMenu.js"}
|
package/dist/Divider.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIZDJCEMF_cjs = require('./chunk-IZDJCEMF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Divider", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkIZDJCEMF_cjs.Divider; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=Divider.cjs.map
|
|
12
12
|
//# sourceMappingURL=Divider.cjs.map
|
package/dist/Divider.js
CHANGED
package/dist/Drawer.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkN73JGXYZ_cjs = require('./chunk-N73JGXYZ.cjs');
|
|
4
|
+
require('./chunk-YCHUHMNP.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Drawer", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkN73JGXYZ_cjs.Drawer; }
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=Drawer.cjs.map
|
|
13
13
|
//# sourceMappingURL=Drawer.cjs.map
|
package/dist/Drawer.js
CHANGED
package/dist/Empty.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXUT2Z2L6_cjs = require('./chunk-XUT2Z2L6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Empty", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkXUT2Z2L6_cjs.Empty; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "Skeleton", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkXUT2Z2L6_cjs.Skeleton; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "Spinner", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkXUT2Z2L6_cjs.Spinner; }
|
|
18
18
|
});
|
|
19
19
|
//# sourceMappingURL=Empty.cjs.map
|
|
20
20
|
//# sourceMappingURL=Empty.cjs.map
|
package/dist/Empty.js
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* ============ Form ============ */
|
|
2
|
+
.lumina-form { display: flex; flex-direction: column; gap: 18px; }
|
|
3
|
+
.lumina-form.layout-inline {
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
align-items: flex-start;
|
|
7
|
+
gap: 12px;
|
|
8
|
+
}
|
|
9
|
+
.lumina-form.layout-inline .form-item { flex: 0 0 auto; }
|
|
10
|
+
|
|
11
|
+
.form-item {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 6px;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
}
|
|
17
|
+
.lumina-form.layout-horizontal .form-item {
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
gap: 12px;
|
|
21
|
+
}
|
|
22
|
+
.lumina-form.layout-horizontal .form-item-label {
|
|
23
|
+
flex: 0 0 auto;
|
|
24
|
+
min-width: 96px;
|
|
25
|
+
padding-top: 10px;
|
|
26
|
+
text-align: right;
|
|
27
|
+
}
|
|
28
|
+
.lumina-form.layout-horizontal .form-item-control { flex: 1; min-width: 0; }
|
|
29
|
+
|
|
30
|
+
.form-item-label {
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
color: var(--fg);
|
|
34
|
+
padding-left: 2px;
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 4px;
|
|
38
|
+
}
|
|
39
|
+
.form-item-required {
|
|
40
|
+
color: var(--danger);
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
margin-right: 2px;
|
|
43
|
+
}
|
|
44
|
+
.form-item-control { min-width: 0; }
|
|
45
|
+
|
|
46
|
+
.form-item-error {
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
color: var(--danger);
|
|
49
|
+
padding-left: 2px;
|
|
50
|
+
animation: fadeIn 140ms var(--ease);
|
|
51
|
+
}
|
|
52
|
+
.form-item-help {
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
color: var(--fg-subtle);
|
|
55
|
+
padding-left: 2px;
|
|
56
|
+
}
|
|
57
|
+
.form-item-extra {
|
|
58
|
+
font-size: 11.5px;
|
|
59
|
+
color: var(--fg-subtle);
|
|
60
|
+
padding-left: 2px;
|
|
61
|
+
opacity: 0.85;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.form-item.has-error .input-wrap,
|
|
65
|
+
.form-item.has-error .select-trigger {
|
|
66
|
+
box-shadow: var(--neu-in-sm), 0 0 0 2px color-mix(in oklch, var(--danger) 30%, transparent);
|
|
67
|
+
}
|
package/dist/Form.cjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQVFEKGKI_cjs = require('./chunk-QVFEKGKI.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "Form", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkQVFEKGKI_cjs.Form; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "FormItem", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkQVFEKGKI_cjs.FormItem; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "useForm", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkQVFEKGKI_cjs.useForm; }
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=Form.cjs.map
|
|
20
|
+
//# sourceMappingURL=Form.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"Form.cjs"}
|
package/dist/Form.d.cts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type FormLayout = "horizontal" | "vertical" | "inline";
|
|
5
|
+
type Rule = {
|
|
6
|
+
required?: boolean;
|
|
7
|
+
message?: string;
|
|
8
|
+
pattern?: RegExp;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
len?: number;
|
|
12
|
+
type?: "string" | "number" | "email" | "url" | "array";
|
|
13
|
+
whitespace?: boolean;
|
|
14
|
+
validator?: (rule: Rule, value: unknown) => Promise<void> | void;
|
|
15
|
+
};
|
|
16
|
+
interface ErrorField {
|
|
17
|
+
name: string;
|
|
18
|
+
errors: string[];
|
|
19
|
+
}
|
|
20
|
+
interface FormInstance<V extends Record<string, unknown> = Record<string, unknown>> {
|
|
21
|
+
getFieldValue: <T = unknown>(name: string) => T;
|
|
22
|
+
getFieldsValue: (names?: string[]) => V;
|
|
23
|
+
setFieldValue: (name: string, value: unknown) => void;
|
|
24
|
+
setFieldsValue: (values: Partial<V>) => void;
|
|
25
|
+
resetFields: (names?: string[]) => void;
|
|
26
|
+
validateFields: (names?: string[]) => Promise<V>;
|
|
27
|
+
isFieldTouched: (name: string) => boolean;
|
|
28
|
+
getFieldError: (name: string) => string[];
|
|
29
|
+
/** Programmatic submit — runs validate then onFinish/onFinishFailed. */
|
|
30
|
+
submit: () => void;
|
|
31
|
+
}
|
|
32
|
+
/** `Form.useForm()` — create a form instance. Same shape as antd's hook. */
|
|
33
|
+
declare function useForm<V extends Record<string, unknown> = Record<string, unknown>>(): [FormInstance<V>];
|
|
34
|
+
interface FormProps<V extends Record<string, unknown> = Record<string, unknown>> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "onChange" | "onSubmit"> {
|
|
35
|
+
form?: FormInstance<V>;
|
|
36
|
+
layout?: FormLayout;
|
|
37
|
+
initialValues?: Partial<V>;
|
|
38
|
+
onFinish?: (values: V) => void;
|
|
39
|
+
onFinishFailed?: (info: {
|
|
40
|
+
values: Partial<V>;
|
|
41
|
+
errorFields: ErrorField[];
|
|
42
|
+
}) => void;
|
|
43
|
+
onValuesChange?: (changed: Partial<V>, all: V) => void;
|
|
44
|
+
/** Show the `*` mark before required field labels. Default true. */
|
|
45
|
+
requiredMark?: boolean;
|
|
46
|
+
/** Disable all fields inside. */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
children?: React.ReactNode;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
declare const FormRoot: <V extends Record<string, unknown> = Record<string, unknown>>(props: FormProps<V>) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
interface FormItemProps {
|
|
53
|
+
/** Field key. Omit for layout-only wrappers (no value binding). */
|
|
54
|
+
name?: string;
|
|
55
|
+
label?: React.ReactNode;
|
|
56
|
+
rules?: Rule[];
|
|
57
|
+
/** Render no wrapper — emit only the (bound) child. */
|
|
58
|
+
noStyle?: boolean;
|
|
59
|
+
/** Inject value into this prop name on the child. Default `"value"`. */
|
|
60
|
+
valuePropName?: string;
|
|
61
|
+
/** Listen for changes on this event name. Default `"onChange"`. */
|
|
62
|
+
trigger?: string;
|
|
63
|
+
/** Event names that trigger validation. Default `["onChange"]`. */
|
|
64
|
+
validateTrigger?: string | string[];
|
|
65
|
+
/** Initial value (used when the form instance has no value yet). */
|
|
66
|
+
initialValue?: unknown;
|
|
67
|
+
/** Extra help text shown under the field. Hidden when an error is shown. */
|
|
68
|
+
help?: React.ReactNode;
|
|
69
|
+
/** Supplementary description below the help line. */
|
|
70
|
+
extra?: React.ReactNode;
|
|
71
|
+
/** Explicitly mark the field as required (cosmetic). */
|
|
72
|
+
required?: boolean;
|
|
73
|
+
/** Hide the entire item (still keeps the field in the form). */
|
|
74
|
+
hidden?: boolean;
|
|
75
|
+
children?: React.ReactNode;
|
|
76
|
+
className?: string;
|
|
77
|
+
style?: React.CSSProperties;
|
|
78
|
+
}
|
|
79
|
+
declare const FormItem: React.FC<FormItemProps>;
|
|
80
|
+
declare const Form: typeof FormRoot & {
|
|
81
|
+
Item: typeof FormItem;
|
|
82
|
+
useForm: typeof useForm;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export { type ErrorField, Form, type FormInstance, FormItem, type FormItemProps, type FormLayout, type FormProps, type Rule, useForm };
|