@fangxinyan/lumina 0.6.18 → 0.8.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/{Alert-HVPI6L4V.css → Alert-DJ3K7N7L.css} +9 -9
- package/dist/Alert.cjs +5 -3
- package/dist/Alert.d.cts +2 -2
- package/dist/Alert.d.ts +2 -2
- package/dist/Alert.js +4 -2
- package/dist/{AppShell-FZCD4C56.css → AppShell-OWJRJ4ZD.css} +57 -22
- package/dist/AppShell.cjs +8 -5
- package/dist/AppShell.d.cts +19 -16
- package/dist/AppShell.d.ts +19 -16
- package/dist/AppShell.js +4 -1
- package/dist/{AutoComplete-4YZBMW4E.css → AutoComplete-PNCYHU2T.css} +8 -8
- package/dist/AutoComplete.cjs +9 -6
- package/dist/AutoComplete.d.cts +2 -1
- package/dist/AutoComplete.d.ts +2 -1
- package/dist/AutoComplete.js +8 -5
- package/dist/Avatar-YBU2YZTW.css +48 -0
- package/dist/Avatar.cjs +4 -2
- package/dist/Avatar.d.cts +6 -2
- package/dist/Avatar.d.ts +6 -2
- package/dist/Avatar.js +3 -1
- package/dist/Badge-DBWJEV4C.css +22 -0
- package/dist/Badge.cjs +4 -2
- package/dist/Badge.d.cts +6 -2
- package/dist/Badge.d.ts +6 -2
- package/dist/Badge.js +3 -1
- package/dist/{Button-TUMZUQLI.css → Button-ILNZUX2N.css} +28 -21
- package/dist/Button.cjs +6 -4
- package/dist/Button.d.cts +2 -14
- package/dist/Button.d.ts +2 -14
- package/dist/Button.js +4 -2
- package/dist/{Calendar-I6NHCXIB.css → Calendar-QJ5HWEJQ.css} +26 -26
- package/dist/Calendar.cjs +5 -3
- package/dist/Calendar.d.cts +8 -4
- package/dist/Calendar.d.ts +8 -4
- package/dist/Calendar.js +4 -2
- package/dist/Card-VPMTWAWZ.css +98 -0
- package/dist/Card.cjs +7 -3
- package/dist/Card.d.cts +8 -4
- package/dist/Card.d.ts +8 -4
- package/dist/Card.js +6 -2
- package/dist/Cascader-YBVDK6DC.css +168 -0
- package/dist/Cascader.cjs +9 -6
- package/dist/Cascader.d.cts +21 -3
- package/dist/Cascader.d.ts +21 -3
- package/dist/Cascader.js +8 -5
- package/dist/Checkbox-IHFML4FV.css +50 -0
- package/dist/Checkbox.cjs +5 -3
- package/dist/Checkbox.d.cts +10 -2
- package/dist/Checkbox.d.ts +10 -2
- package/dist/Checkbox.js +4 -2
- package/dist/{Collapse-UNBHEPYP.css → Collapse-BTSBHBSY.css} +12 -7
- package/dist/Collapse.cjs +5 -3
- package/dist/Collapse.d.cts +2 -2
- package/dist/Collapse.d.ts +2 -2
- package/dist/Collapse.js +4 -2
- package/dist/{ColorPicker-LPG6QPYF.css → ColorPicker-GRZOKR5O.css} +17 -32
- package/dist/ColorPicker.cjs +9 -3
- package/dist/ColorPicker.d.cts +7 -11
- package/dist/ColorPicker.d.ts +7 -11
- package/dist/ColorPicker.js +8 -2
- package/dist/{CommandPalette-RTKWNH2D.css → CommandPalette-GHTX7AAA.css} +22 -23
- package/dist/CommandPalette.cjs +8 -5
- package/dist/CommandPalette.d.cts +5 -28
- package/dist/CommandPalette.d.ts +5 -28
- package/dist/CommandPalette.js +7 -4
- package/dist/{ContextMenu-WRR2SSWL.css → ContextMenu-NG524Y2P.css} +17 -17
- package/dist/ContextMenu.cjs +5 -2
- package/dist/ContextMenu.d.cts +2 -19
- package/dist/ContextMenu.d.ts +2 -19
- package/dist/ContextMenu.js +4 -1
- package/dist/{DatePicker-VDVSIARF.css → DatePicker-ZSFDXAYD.css} +4 -4
- package/dist/DatePicker.cjs +11 -8
- package/dist/DatePicker.d.cts +4 -7
- package/dist/DatePicker.d.ts +4 -7
- package/dist/DatePicker.js +10 -7
- package/dist/{DateTimePicker-DRX7XA74.css → DateTimePicker-EWSISVIF.css} +17 -17
- package/dist/DateTimePicker.cjs +11 -8
- package/dist/DateTimePicker.d.cts +4 -8
- package/dist/DateTimePicker.d.ts +4 -8
- package/dist/DateTimePicker.js +10 -7
- package/dist/{Divider-RPQCVH3J.css → Divider-OI2BXPBU.css} +10 -10
- package/dist/Divider.cjs +4 -2
- package/dist/Divider.d.cts +2 -2
- package/dist/Divider.d.ts +2 -2
- package/dist/Divider.js +3 -1
- package/dist/{Drawer-7KICRM4L.css → Drawer-VCXAXWV6.css} +30 -17
- package/dist/Drawer.cjs +6 -3
- package/dist/Drawer.d.cts +25 -3
- package/dist/Drawer.d.ts +25 -3
- package/dist/Drawer.js +5 -2
- package/dist/{Empty-CZTRZMZQ.css → Empty-U5CBLCAL.css} +5 -5
- package/dist/Empty.cjs +4 -2
- package/dist/Empty.d.cts +2 -2
- package/dist/Empty.d.ts +2 -2
- package/dist/Empty.js +3 -1
- package/dist/{Form-NGCQWTMZ.css → Form-DNEDZRJA.css} +7 -7
- package/dist/Form.cjs +7 -4
- package/dist/Form.d.cts +4 -3
- package/dist/Form.d.ts +4 -3
- package/dist/Form.js +4 -1
- package/dist/Icon-HJSUVW4O.css +12 -0
- package/dist/Icon.cjs +51 -49
- package/dist/Icon.d.cts +8 -8
- package/dist/Icon.d.ts +8 -8
- package/dist/Icon.js +3 -1
- package/dist/{Image-NISJRUWX.css → Image-CZJPPURT.css} +25 -23
- package/dist/Image.cjs +10 -7
- package/dist/Image.d.cts +5 -24
- package/dist/Image.d.ts +5 -24
- package/dist/Image.js +6 -3
- package/dist/{Input-7GDPGP3E.css → Input-ZUASNDXM.css} +15 -15
- package/dist/Input.cjs +7 -5
- package/dist/Input.d.cts +2 -1
- package/dist/Input.d.ts +2 -1
- package/dist/Input.js +5 -3
- package/dist/{InputNumber-VXQIWLQC.css → InputNumber-6NHBMRT4.css} +7 -7
- package/dist/InputNumber.cjs +7 -5
- package/dist/InputNumber.d.cts +2 -1
- package/dist/InputNumber.d.ts +2 -1
- package/dist/InputNumber.js +6 -4
- package/dist/List-6BQIFAIT.css +42 -0
- package/dist/List.cjs +4 -2
- package/dist/List.d.cts +2 -2
- package/dist/List.d.ts +2 -2
- package/dist/List.js +3 -1
- package/dist/{Message-H222YGR6.css → Message-OTZWQTQ5.css} +13 -13
- package/dist/Message.cjs +9 -6
- package/dist/Message.d.cts +18 -2
- package/dist/Message.d.ts +18 -2
- package/dist/Message.js +5 -2
- package/dist/{Modal-ZFWNFEA5.css → Modal-UI2FXNDR.css} +29 -18
- package/dist/Modal.cjs +7 -4
- package/dist/Modal.d.cts +13 -2
- package/dist/Modal.d.ts +13 -2
- package/dist/Modal.js +6 -3
- package/dist/Pagination-POJTWMYR.css +70 -0
- package/dist/Pagination.cjs +11 -8
- package/dist/Pagination.d.cts +2 -2
- package/dist/Pagination.d.ts +2 -2
- package/dist/Pagination.js +10 -7
- package/dist/{Popover-Y3LDCJPW.css → Popover-LCXLR3EU.css} +13 -14
- package/dist/Popover.cjs +6 -3
- package/dist/Popover.d.cts +3 -10
- package/dist/Popover.d.ts +3 -10
- package/dist/Popover.js +5 -2
- package/dist/Progress-33WE2NI7.css +90 -0
- package/dist/Progress.cjs +4 -2
- package/dist/Progress.d.cts +4 -2
- package/dist/Progress.d.ts +4 -2
- package/dist/Progress.js +3 -1
- package/dist/{Radio-IQKASYDF.css → Radio-RL7232MZ.css} +21 -13
- package/dist/Radio.cjs +5 -3
- package/dist/Radio.d.cts +18 -5
- package/dist/Radio.d.ts +18 -5
- package/dist/Radio.js +3 -1
- package/dist/{Select-YZ2NUJSX.css → Select-TU37MAHZ.css} +64 -40
- package/dist/Select.cjs +10 -7
- package/dist/Select.d.cts +28 -3
- package/dist/Select.d.ts +28 -3
- package/dist/Select.js +9 -6
- package/dist/{Skeleton-CVWH2VWN.css → Skeleton-FMFE3BRI.css} +9 -4
- package/dist/Skeleton.cjs +4 -2
- package/dist/Skeleton.d.cts +2 -4
- package/dist/Skeleton.d.ts +2 -4
- package/dist/Skeleton.js +3 -1
- package/dist/Slider-FZ5MI4X2.css +145 -0
- package/dist/Slider.cjs +4 -2
- package/dist/Slider.d.cts +6 -5
- package/dist/Slider.d.ts +6 -5
- package/dist/Slider.js +3 -1
- package/dist/{Spin-GONGPV4Q.css → Spin-F5YIEENO.css} +15 -9
- package/dist/Spin.cjs +4 -2
- package/dist/Spin.d.cts +2 -2
- package/dist/Spin.d.ts +2 -2
- package/dist/Spin.js +3 -1
- package/dist/{Splitter-DHNOY4NC.css → Splitter-IQ3PFIKK.css} +4 -4
- package/dist/Splitter.cjs +4 -2
- package/dist/Splitter.d.cts +18 -12
- package/dist/Splitter.d.ts +18 -12
- package/dist/Splitter.js +3 -1
- package/dist/{StatusBar-FJKEEPXU.css → StatusBar-TCGR3LXP.css} +23 -9
- package/dist/StatusBar.cjs +5 -3
- package/dist/StatusBar.d.cts +5 -17
- package/dist/StatusBar.d.ts +5 -17
- package/dist/StatusBar.js +3 -1
- package/dist/{Surface-UDDN3DGL.css → Surface-CTN775GD.css} +10 -10
- package/dist/Surface.cjs +6 -5
- package/dist/Surface.d.cts +10 -1
- package/dist/Surface.d.ts +10 -1
- package/dist/Surface.js +4 -3
- package/dist/{Switch-COAQIOMH.css → Switch-TATU3LPB.css} +16 -8
- package/dist/Switch.cjs +4 -2
- package/dist/Switch.d.cts +10 -4
- package/dist/Switch.d.ts +10 -4
- package/dist/Switch.js +3 -1
- package/dist/{Table-IWHIIGRJ.css → Table-KB6EEBDJ.css} +105 -53
- package/dist/Table.cjs +14 -10
- package/dist/Table.d.cts +38 -3
- package/dist/Table.d.ts +38 -3
- package/dist/Table.js +13 -9
- package/dist/{TablePro-3NGWERWT.css → TablePro-WYE6TXWJ.css} +5 -5
- package/dist/TablePro.cjs +15 -11
- package/dist/TablePro.d.cts +1 -0
- package/dist/TablePro.d.ts +1 -0
- package/dist/TablePro.js +14 -10
- package/dist/{Tabs-X5U5PCPV.css → Tabs-FB2AMBWL.css} +24 -10
- package/dist/Tabs.cjs +4 -2
- package/dist/Tabs.d.cts +8 -2
- package/dist/Tabs.d.ts +8 -2
- package/dist/Tabs.js +3 -1
- package/dist/Tag-5GIZLRAH.css +42 -0
- package/dist/Tag.cjs +5 -3
- package/dist/Tag.d.cts +2 -2
- package/dist/Tag.d.ts +2 -2
- package/dist/Tag.js +4 -2
- package/dist/{Textarea-YHWKHIFE.css → Textarea-ZGHBZNLX.css} +10 -10
- package/dist/Textarea.cjs +6 -4
- package/dist/Textarea.d.cts +2 -4
- package/dist/Textarea.d.ts +2 -4
- package/dist/Textarea.js +4 -2
- package/dist/Theme-CLedeJ_C.d.ts +193 -0
- package/dist/Theme-uQq2B0Yk.d.cts +193 -0
- package/dist/Theme.cjs +57 -11
- package/dist/Theme.d.cts +26 -145
- package/dist/Theme.d.ts +26 -145
- package/dist/Theme.js +3 -1
- package/dist/{ThemePanel-TEHB2JCQ.css → ThemePanel-EHNAS4RN.css} +52 -52
- package/dist/ThemePanel.cjs +17 -15
- package/dist/ThemePanel.d.cts +3 -13
- package/dist/ThemePanel.d.ts +3 -13
- package/dist/ThemePanel.js +14 -12
- package/dist/{TimePicker-ZBJOXH3U.css → TimePicker-WJ3FSK6A.css} +17 -17
- package/dist/TimePicker.cjs +10 -7
- package/dist/TimePicker.d.cts +2 -8
- package/dist/TimePicker.d.ts +2 -8
- package/dist/TimePicker.js +9 -6
- package/dist/{Timeline-CRFZ3I2W.css → Timeline-FUFO2UGY.css} +28 -13
- package/dist/Timeline.cjs +5 -3
- package/dist/Timeline.d.cts +2 -7
- package/dist/Timeline.d.ts +2 -7
- package/dist/Timeline.js +4 -2
- package/dist/{Tooltip-5FSPJWLX.css → Tooltip-2EUNTOTW.css} +3 -3
- package/dist/Tooltip.cjs +6 -3
- package/dist/Tooltip.d.cts +2 -2
- package/dist/Tooltip.d.ts +2 -2
- package/dist/Tooltip.js +5 -2
- package/dist/{Typography-32QQLD4F.css → Typography-CQ2OZXQH.css} +105 -42
- package/dist/Typography.cjs +11 -8
- package/dist/Typography.d.cts +12 -36
- package/dist/Typography.d.ts +12 -36
- package/dist/Typography.js +6 -3
- package/dist/chunk-2A4GYSN4.js +294 -0
- package/dist/{chunk-QMX67CVT.cjs → chunk-2AUXUZ3Z.cjs} +56 -31
- package/dist/chunk-2BIOTRQC.js +40 -0
- package/dist/{chunk-A6O25EP2.js → chunk-2HIN5NFM.js} +14 -6
- package/dist/{chunk-I7TOBKJO.js → chunk-3DKFS44V.js} +84 -23
- package/dist/{chunk-X5MYHDEQ.cjs → chunk-3EMWDDWK.cjs} +372 -117
- package/dist/chunk-3F424R5P.js +143 -0
- package/dist/chunk-3IZZBM56.js +269 -0
- package/dist/{chunk-DUFRASGO.js → chunk-3QXP2ZNP.js} +18 -23
- package/dist/{chunk-5QEI7GGA.cjs → chunk-434Y2JVW.cjs} +60 -27
- package/dist/{chunk-SOCYOUGM.js → chunk-4SKHRPDH.js} +168 -64
- package/dist/{chunk-R3DTXVP2.js → chunk-5AXNUX3J.js} +8 -5
- package/dist/chunk-5CZA33BK.cjs +229 -0
- package/dist/{chunk-6K5YI4ZE.js → chunk-62VV5COT.js} +16 -6
- package/dist/{chunk-2FOC3D6X.js → chunk-63RSKQID.js} +23 -7
- package/dist/chunk-6DKPJ5LV.cjs +294 -0
- package/dist/{chunk-OTSDPQPV.js → chunk-6RQJXSWN.js} +50 -30
- package/dist/{chunk-V5KUC5VH.cjs → chunk-77HU7JWK.cjs} +40 -13
- package/dist/chunk-7QAVPVMW.js +180 -0
- package/dist/chunk-7VLAHOA7.cjs +191 -0
- package/dist/chunk-ALAG4ZUH.js +72 -0
- package/dist/chunk-ARUN2DMD.js +39 -0
- package/dist/chunk-AUO2YYHB.js +248 -0
- package/dist/{chunk-6MEOLYNQ.js → chunk-AURYNA6G.js} +6 -5
- package/dist/chunk-BIPOXOHP.cjs +287 -0
- package/dist/{chunk-BVQOJKRX.js → chunk-BKW5PXEO.js} +115 -72
- package/dist/chunk-DRDDQCDD.js +322 -0
- package/dist/chunk-DU2DSERH.js +190 -0
- package/dist/chunk-DURKCGEM.js +496 -0
- package/dist/{chunk-PSQ3HNZP.cjs → chunk-E66PSVBU.cjs} +106 -19
- package/dist/chunk-EAUB6FEN.js +262 -0
- package/dist/chunk-EE5KXDRK.cjs +1223 -0
- package/dist/chunk-EE7IJ3MB.js +1 -0
- package/dist/chunk-EUTK2ZRJ.cjs +61 -0
- package/dist/{chunk-HSAJUEO7.cjs → chunk-F7WUCOBP.cjs} +150 -86
- package/dist/{chunk-YB3IWIOJ.cjs → chunk-FJB3243S.cjs} +18 -23
- package/dist/chunk-FKCPSVC4.cjs +188 -0
- package/dist/chunk-FMUHLIHB.cjs +94 -0
- package/dist/chunk-FY73C7JK.js +520 -0
- package/dist/{chunk-6EOSMK34.cjs → chunk-G5LCOBOT.cjs} +20 -1
- package/dist/{chunk-5ERD3W24.cjs → chunk-GFKWSDD6.cjs} +18 -8
- package/dist/{chunk-T2O4DTDE.cjs → chunk-GTFP7HA3.cjs} +58 -32
- package/dist/chunk-HQFKXTX6.js +60 -0
- package/dist/{chunk-V5SQOZPF.js → chunk-HQNDVNTQ.js} +38 -20
- package/dist/chunk-HSDMJUB6.cjs +319 -0
- package/dist/chunk-HVPUGYBY.js +166 -0
- package/dist/chunk-HYHBCHFM.cjs +167 -0
- package/dist/chunk-HYJSMFZA.cjs +2 -0
- package/dist/chunk-I4YPBAQ5.js +163 -0
- package/dist/chunk-IJDM2U3B.js +100 -0
- package/dist/chunk-J5UEQ3ZQ.js +226 -0
- package/dist/chunk-JBS353O4.cjs +248 -0
- package/dist/{chunk-IPSNC5VZ.js → chunk-JHM7MN3G.js} +15 -7
- package/dist/{chunk-6Q76VLCE.cjs → chunk-JKUXA3U6.cjs} +50 -30
- package/dist/{chunk-D7GK6H6V.js → chunk-K5HGHOG7.js} +50 -21
- package/dist/chunk-KATJAJUU.js +78 -0
- package/dist/chunk-KCDOC3HS.cjs +100 -0
- package/dist/{chunk-M4NJTJKV.cjs → chunk-LDX6Q6RK.cjs} +8 -5
- package/dist/chunk-LEDESWNL.js +83 -0
- package/dist/chunk-LG62MPMU.cjs +213 -0
- package/dist/{chunk-7NTTRKNT.js → chunk-LJVQQEME.js} +54 -28
- package/dist/{chunk-FDZG27IG.js → chunk-LQMOYVQF.js} +57 -32
- package/dist/{chunk-P2OQTJZP.cjs → chunk-MCDW3VKZ.cjs} +17 -6
- package/dist/{chunk-BT2RXFT4.cjs → chunk-MUZQWIMR.cjs} +121 -78
- package/dist/chunk-NRJXZPZR.cjs +351 -0
- package/dist/chunk-O6G3F5L4.js +311 -0
- package/dist/{chunk-3VSHGM54.js → chunk-OLYSSZHP.js} +126 -68
- package/dist/{chunk-A4Z7PLHV.cjs → chunk-PIJV2FHO.cjs} +135 -77
- package/dist/{chunk-L6GIV5DQ.cjs → chunk-PJFYIXBX.cjs} +40 -22
- package/dist/{chunk-NXBFEIUX.cjs → chunk-PNKNZREC.cjs} +266 -130
- package/dist/{chunk-FYSXJXNW.js → chunk-PQOBBASY.js} +10 -9
- package/dist/chunk-Q565GDVK.cjs +205 -0
- package/dist/{chunk-FDUQPAQE.cjs → chunk-Q5HLC56A.cjs} +122 -28
- package/dist/chunk-QDCPVI3S.cjs +333 -0
- package/dist/{chunk-ZR4IMROK.js → chunk-QDMFXRPI.js} +122 -28
- package/dist/chunk-QDY56GGO.js +234 -0
- package/dist/{chunk-4KDABJSY.cjs → chunk-QNQSNVCU.cjs} +86 -25
- package/dist/chunk-QYPA77OI.cjs +55 -0
- package/dist/{chunk-BW76ENTW.cjs → chunk-RERMZNF3.cjs} +10 -9
- package/dist/chunk-RMGFRAZ2.cjs +270 -0
- package/dist/chunk-RPO7657K.js +228 -0
- package/dist/chunk-RR7KWH26.cjs +122 -0
- package/dist/chunk-SF7BPXDJ.cjs +518 -0
- package/dist/chunk-STQDKMS5.cjs +288 -0
- package/dist/{chunk-HG6YS4I7.js → chunk-SXLRWYQQ.js} +71 -24
- package/dist/{chunk-SW2HMNCA.cjs → chunk-T4RR6NVU.cjs} +17 -9
- package/dist/{chunk-6SPMHY54.js → chunk-TSL3F2K3.js} +20 -2
- package/dist/{chunk-BNY2NVTL.cjs → chunk-TYZ6L7E6.cjs} +48 -28
- package/dist/{chunk-MOZ52KN6.js → chunk-U3SG2YT2.js} +39 -12
- package/dist/{chunk-POU3W5J3.cjs → chunk-U5YYOOLC.cjs} +13 -6
- package/dist/chunk-UE4HFGJ6.js +264 -0
- package/dist/chunk-ULTDRMGN.js +1175 -0
- package/dist/{chunk-6HF6UF73.js → chunk-UQI4R32R.js} +368 -113
- package/dist/{chunk-MWEHU7YO.cjs → chunk-VA3JWOAB.cjs} +172 -68
- package/dist/chunk-VQEMMJHC.js +33 -0
- package/dist/{chunk-S2ZGXBUH.cjs → chunk-VVRXNGYL.cjs} +218 -42
- package/dist/{chunk-JMFHL7GN.cjs → chunk-VX6MZO4K.cjs} +100 -22
- package/dist/{chunk-4ACCOYBY.cjs → chunk-WHBKQZU5.cjs} +24 -8
- package/dist/{chunk-UGAN4BBW.js → chunk-WMISXERU.js} +262 -126
- package/dist/{chunk-MYW7LNB2.cjs → chunk-WROF2PVG.cjs} +40 -21
- package/dist/{chunk-5VOUUQF5.js → chunk-Y22PTPA7.js} +145 -81
- package/dist/chunk-Y2MT6PI6.js +207 -0
- package/dist/chunk-YAYSXZZZ.cjs +82 -0
- package/dist/{chunk-6LN4VVX7.js → chunk-YBGMTQ2V.js} +48 -28
- package/dist/{chunk-TYLDISRK.js → chunk-YKHIIC7M.js} +13 -6
- package/dist/{chunk-3VXGZ3SJ.js → chunk-YPMQC5HX.js} +57 -24
- package/dist/{chunk-UWL6DRZW.cjs → chunk-YUJ7Z6N2.cjs} +74 -27
- package/dist/{chunk-LEMMFFEY.cjs → chunk-ZEYK37VW.cjs} +15 -7
- package/dist/{chunk-ES7AWMNH.cjs → chunk-ZHVR4YPB.cjs} +6 -5
- package/dist/{chunk-MPOO5VPW.cjs → chunk-ZYIE3BH7.cjs} +50 -21
- package/dist/componentThemeTypes-Jt4B5aU8.d.cts +77 -0
- package/dist/componentThemeTypes-Jt4B5aU8.d.ts +77 -0
- package/dist/index.cjs +253 -206
- package/dist/index.d.cts +11 -9
- package/dist/index.d.ts +11 -9
- package/dist/index.js +56 -53
- package/dist/styles.css +1663 -695
- package/dist/{tokens-RYJ3DFTU.css → tokens-CEJVVA3G.css} +10 -0
- package/dist/tokens.css +10 -0
- package/docs/llms/appshell.md +9 -6
- package/docs/llms/autocomplete.md +8 -2
- package/docs/llms/avatar.md +2 -0
- package/docs/llms/badge.md +2 -0
- package/docs/llms/calendar.md +7 -2
- package/docs/llms/card.md +20 -1
- package/docs/llms/cascader.md +27 -5
- package/docs/llms/checkbox.md +13 -0
- package/docs/llms/collapse.md +13 -5
- package/docs/llms/colorpicker.md +4 -3
- package/docs/llms/commandpalette.md +10 -2
- package/docs/llms/contextmenu.md +14 -2
- package/docs/llms/datepicker.md +7 -0
- package/docs/llms/datetimepicker.md +7 -0
- package/docs/llms/drawer.md +27 -4
- package/docs/llms/form.md +5 -2
- package/docs/llms/icon.md +25 -1
- package/docs/llms/image.md +3 -3
- package/docs/llms/list.md +11 -0
- package/docs/llms/message.md +31 -8
- package/docs/llms/modal.md +20 -8
- package/docs/llms/pagination.md +12 -4
- package/docs/llms/popover.md +11 -1
- package/docs/llms/progress.md +1 -0
- package/docs/llms/radio.md +13 -0
- package/docs/llms/select.md +48 -2
- package/docs/llms/sidebar.md +24 -0
- package/docs/llms/slider.md +5 -2
- package/docs/llms/splitter.md +17 -3
- package/docs/llms/switch.md +13 -0
- package/docs/llms/table.md +7 -8
- package/docs/llms/tablepro.md +23 -1
- package/docs/llms/tabs.md +21 -0
- package/docs/llms/theme.md +83 -28
- package/docs/llms/themepanel.md +1 -0
- package/docs/llms/titlebar.md +1 -0
- package/docs/llms/tooltip.md +7 -2
- package/docs/llms/typography.md +27 -3
- package/docs/llms/windowcontrols.md +11 -3
- package/docs/llms.md +2 -2
- package/package.json +212 -2
- package/dist/Avatar-TNPOHVY5.css +0 -40
- package/dist/Badge-DPGLV3D3.css +0 -22
- package/dist/Card-W3ATFUJW.css +0 -77
- package/dist/Cascader-ANEQUPMI.css +0 -150
- package/dist/Checkbox-EDNPZRIP.css +0 -42
- package/dist/List-LSMU5QAC.css +0 -26
- package/dist/Pagination-YSZSNFHG.css +0 -68
- package/dist/Progress-CZNXCYGW.css +0 -80
- package/dist/Slider-UM2IZZBH.css +0 -127
- package/dist/Tag-G2XWAL7A.css +0 -42
- package/dist/chunk-262ED6WQ.cjs +0 -88
- package/dist/chunk-4HJBF4GY.js +0 -218
- package/dist/chunk-4TTRHEGM.cjs +0 -217
- package/dist/chunk-5A6KSYWA.cjs +0 -67
- package/dist/chunk-5MOYKVB7.js +0 -192
- package/dist/chunk-7IO3EOHN.cjs +0 -200
- package/dist/chunk-7QXP6DXC.cjs +0 -129
- package/dist/chunk-AAPZLBHQ.js +0 -165
- package/dist/chunk-ARUPS7JH.js +0 -66
- package/dist/chunk-ATUPFAPZ.cjs +0 -76
- package/dist/chunk-CFZVWY5N.js +0 -178
- package/dist/chunk-DSLYWX4O.js +0 -25
- package/dist/chunk-E22OIVYP.js +0 -349
- package/dist/chunk-FQJY4D3T.cjs +0 -47
- package/dist/chunk-GNV6W4BN.js +0 -495
- package/dist/chunk-HBO7ZDEQ.js +0 -29
- package/dist/chunk-I777JTTG.js +0 -150
- package/dist/chunk-IOAOG5L7.js +0 -191
- package/dist/chunk-IOUAZYK2.cjs +0 -116
- package/dist/chunk-IZHH6CVY.js +0 -123
- package/dist/chunk-JFL2WMJZ.js +0 -106
- package/dist/chunk-KMPFESEV.js +0 -41
- package/dist/chunk-KYV75JPQ.js +0 -147
- package/dist/chunk-N7OQNSII.cjs +0 -145
- package/dist/chunk-P64NPZBG.js +0 -113
- package/dist/chunk-PKNRTFNE.cjs +0 -526
- package/dist/chunk-PU7VXDAS.js +0 -64
- package/dist/chunk-RFI5R42I.cjs +0 -138
- package/dist/chunk-RR2BKV65.js +0 -39
- package/dist/chunk-RSSOX4RQ.cjs +0 -240
- package/dist/chunk-RZEFKXL3.cjs +0 -104
- package/dist/chunk-S7IHWY24.js +0 -81
- package/dist/chunk-SOQ56ZI2.cjs +0 -49
- package/dist/chunk-TBNPJPYG.cjs +0 -61
- package/dist/chunk-TJECLLN4.js +0 -344
- package/dist/chunk-ULUD3FED.cjs +0 -138
- package/dist/chunk-UW57F3UO.cjs +0 -371
- package/dist/chunk-VA2I7ZAL.cjs +0 -190
- package/dist/chunk-VS3I5OKA.cjs +0 -214
- package/dist/chunk-WMGMIE2D.js +0 -113
- package/dist/chunk-X7XP6GEI.cjs +0 -63
- package/dist/chunk-XCXUGHDF.js +0 -91
- package/dist/chunk-YAFDVNXT.js +0 -27
- package/dist/chunk-ZD3L4V3H.js +0 -54
- package/dist/chunk-ZTCRD2FL.js +0 -45
|
@@ -1,47 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import './
|
|
1
|
+
import { useOverlayZIndex, useOverlayLayer, OverlayZIndexProvider } from './chunk-2A4GYSN4.js';
|
|
2
|
+
import { Button } from './chunk-JHM7MN3G.js';
|
|
3
|
+
import { Icon } from './chunk-LQMOYVQF.js';
|
|
4
|
+
import { useComponentPortalTheme, InternalComponentThemePart, withComponentTheme } from './chunk-DRDDQCDD.js';
|
|
5
|
+
import { usePortalContainer } from './chunk-ULTDRMGN.js';
|
|
6
|
+
import './tokens-CEJVVA3G.css';
|
|
4
7
|
import './shared-NJHRNLRH.css';
|
|
5
|
-
import './Modal-
|
|
8
|
+
import './Modal-UI2FXNDR.css';
|
|
6
9
|
import * as React from 'react';
|
|
7
10
|
import ReactDOM from 'react-dom';
|
|
8
11
|
import { createRoot } from 'react-dom/client';
|
|
9
|
-
import { jsxs,
|
|
12
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
13
|
|
|
11
14
|
var ANIM_MS = 280;
|
|
12
|
-
var ModalBase = React.forwardRef(({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
15
|
+
var ModalBase = React.forwardRef((props, ref) => {
|
|
16
|
+
const hasExplicitWidth = props.width !== void 0;
|
|
17
|
+
const {
|
|
18
|
+
open,
|
|
19
|
+
onClose,
|
|
20
|
+
onCancel,
|
|
21
|
+
onOk,
|
|
22
|
+
title,
|
|
23
|
+
description,
|
|
24
|
+
footer,
|
|
25
|
+
children,
|
|
26
|
+
width = 440,
|
|
27
|
+
closable = true,
|
|
28
|
+
closeIcon,
|
|
29
|
+
maskClosable = true,
|
|
30
|
+
maskClassName = "",
|
|
31
|
+
maskStyle,
|
|
32
|
+
escClosable = true,
|
|
33
|
+
okText = "\u786E\u5B9A",
|
|
34
|
+
cancelText = "\u53D6\u6D88",
|
|
35
|
+
okButtonProps,
|
|
36
|
+
cancelButtonProps,
|
|
37
|
+
confirmLoading,
|
|
38
|
+
bodyClassName = "",
|
|
39
|
+
bodyStyle,
|
|
40
|
+
bodyProps,
|
|
41
|
+
bodyOverflow,
|
|
42
|
+
bodyInset = "safe",
|
|
43
|
+
destroyOnClose = false,
|
|
44
|
+
afterOpenChange,
|
|
45
|
+
zIndex,
|
|
46
|
+
className = "",
|
|
47
|
+
style,
|
|
48
|
+
onClick,
|
|
49
|
+
...rest
|
|
50
|
+
} = props;
|
|
51
|
+
const portalContainer = usePortalContainer();
|
|
52
|
+
const portalTheme = useComponentPortalTheme("Modal");
|
|
53
|
+
const panelRef = React.useRef(null);
|
|
54
|
+
const titleId = React.useId();
|
|
55
|
+
const descriptionId = React.useId();
|
|
56
|
+
const overlayZIndex = useOverlayZIndex(open, zIndex);
|
|
45
57
|
const [hasOpenedOnce, setHasOpenedOnce] = React.useState(open);
|
|
46
58
|
React.useEffect(() => {
|
|
47
59
|
if (open) setHasOpenedOnce(true);
|
|
@@ -50,29 +62,49 @@ var ModalBase = React.forwardRef(({
|
|
|
50
62
|
if (onCancel) onCancel();
|
|
51
63
|
else onClose?.();
|
|
52
64
|
}, [onCancel, onClose]);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
useOverlayLayer({
|
|
66
|
+
open: open && portalContainer != null,
|
|
67
|
+
containerRef: panelRef,
|
|
68
|
+
zIndex: overlayZIndex,
|
|
69
|
+
onEscape: handleCancel,
|
|
70
|
+
escapeEnabled: escClosable,
|
|
71
|
+
trapFocus: true,
|
|
72
|
+
autoFocus: true,
|
|
73
|
+
restoreFocus: true,
|
|
74
|
+
lockScroll: true
|
|
75
|
+
});
|
|
76
|
+
const setPanelRef = React.useCallback((node) => {
|
|
77
|
+
panelRef.current = node;
|
|
78
|
+
if (typeof ref === "function") ref(node);
|
|
79
|
+
else if (ref) ref.current = node;
|
|
80
|
+
}, [ref]);
|
|
61
81
|
const prevOpen = React.useRef(open);
|
|
82
|
+
const afterOpenChangeRef = React.useRef(afterOpenChange);
|
|
83
|
+
afterOpenChangeRef.current = afterOpenChange;
|
|
62
84
|
React.useEffect(() => {
|
|
63
85
|
if (prevOpen.current !== open) {
|
|
64
86
|
prevOpen.current = open;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return () => window.clearTimeout(id);
|
|
68
|
-
}
|
|
87
|
+
const id = window.setTimeout(() => afterOpenChangeRef.current?.(open), ANIM_MS);
|
|
88
|
+
return () => window.clearTimeout(id);
|
|
69
89
|
}
|
|
70
|
-
}, [open
|
|
71
|
-
if (
|
|
90
|
+
}, [open]);
|
|
91
|
+
if (!portalContainer) return null;
|
|
72
92
|
if (!hasOpenedOnce) return null;
|
|
73
93
|
if (!open && destroyOnClose) return null;
|
|
74
|
-
const overlayStyle =
|
|
75
|
-
|
|
94
|
+
const overlayStyle = {
|
|
95
|
+
...portalTheme.styles.overlay,
|
|
96
|
+
...maskStyle,
|
|
97
|
+
zIndex: overlayZIndex
|
|
98
|
+
};
|
|
99
|
+
const panelStyle = {
|
|
100
|
+
...portalTheme.style,
|
|
101
|
+
width,
|
|
102
|
+
maxWidth: "92vw",
|
|
103
|
+
...portalTheme.styles.popup,
|
|
104
|
+
...hasExplicitWidth ? { width } : null,
|
|
105
|
+
...style
|
|
106
|
+
};
|
|
107
|
+
const defaultFooter = /* @__PURE__ */ jsxs(InternalComponentThemePart, { components: "Button", children: [
|
|
76
108
|
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: handleCancel, ...cancelButtonProps, children: cancelText }),
|
|
77
109
|
/* @__PURE__ */ jsx(
|
|
78
110
|
Button,
|
|
@@ -85,21 +117,21 @@ var ModalBase = React.forwardRef(({
|
|
|
85
117
|
}
|
|
86
118
|
)
|
|
87
119
|
] });
|
|
88
|
-
const modalBodyStyle = bodyOverflow == null ? bodyStyle : { overflow: bodyOverflow, ...bodyStyle };
|
|
120
|
+
const modalBodyStyle = bodyOverflow == null ? { ...portalTheme.styles.body, ...bodyStyle } : { ...portalTheme.styles.body, overflow: bodyOverflow, ...bodyStyle };
|
|
89
121
|
return ReactDOM.createPortal(
|
|
90
|
-
/* @__PURE__ */ jsx(
|
|
122
|
+
/* @__PURE__ */ jsx(OverlayZIndexProvider, { zIndex: overlayZIndex, children: /* @__PURE__ */ jsx(
|
|
91
123
|
"div",
|
|
92
124
|
{
|
|
93
|
-
className: ["modal-overlay", open ? "" : "hidden",
|
|
125
|
+
className: ["modal-overlay", open ? "" : "hidden", maskClassName].filter(Boolean).join(" "),
|
|
94
126
|
style: overlayStyle,
|
|
95
127
|
onClick: () => maskClosable && handleCancel(),
|
|
96
128
|
role: "presentation",
|
|
97
129
|
children: /* @__PURE__ */ jsxs(
|
|
98
130
|
"div",
|
|
99
131
|
{
|
|
100
|
-
ref,
|
|
101
|
-
className: "modal",
|
|
102
|
-
style:
|
|
132
|
+
ref: setPanelRef,
|
|
133
|
+
className: ["modal", className].filter(Boolean).join(" "),
|
|
134
|
+
style: panelStyle,
|
|
103
135
|
onClick: (e) => {
|
|
104
136
|
onClick?.(e);
|
|
105
137
|
e.stopPropagation();
|
|
@@ -107,12 +139,16 @@ var ModalBase = React.forwardRef(({
|
|
|
107
139
|
role: "dialog",
|
|
108
140
|
"aria-modal": true,
|
|
109
141
|
"aria-hidden": !open,
|
|
142
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
143
|
+
"aria-describedby": description ? descriptionId : void 0,
|
|
144
|
+
tabIndex: -1,
|
|
145
|
+
...portalTheme.dataAttributes,
|
|
110
146
|
...rest,
|
|
111
147
|
children: [
|
|
112
148
|
(title || description || closable) && /* @__PURE__ */ jsxs("div", { className: "modal-head", children: [
|
|
113
149
|
/* @__PURE__ */ jsxs("div", { className: "modal-titles", children: [
|
|
114
|
-
title && /* @__PURE__ */ jsx("div", { className: "modal-title", children: title }),
|
|
115
|
-
description && /* @__PURE__ */ jsx("div", { className: "modal-desc", children: description })
|
|
150
|
+
title && /* @__PURE__ */ jsx("div", { id: titleId, className: "modal-title", children: title }),
|
|
151
|
+
description && /* @__PURE__ */ jsx("div", { id: descriptionId, className: "modal-desc", children: description })
|
|
116
152
|
] }),
|
|
117
153
|
closable && /* @__PURE__ */ jsx(
|
|
118
154
|
"button",
|
|
@@ -129,7 +165,7 @@ var ModalBase = React.forwardRef(({
|
|
|
129
165
|
"div",
|
|
130
166
|
{
|
|
131
167
|
...bodyProps,
|
|
132
|
-
className:
|
|
168
|
+
className: ["modal-body", `inset-${bodyInset}`, bodyClassName].filter(Boolean).join(" "),
|
|
133
169
|
style: modalBodyStyle,
|
|
134
170
|
children
|
|
135
171
|
}
|
|
@@ -139,11 +175,17 @@ var ModalBase = React.forwardRef(({
|
|
|
139
175
|
}
|
|
140
176
|
)
|
|
141
177
|
}
|
|
142
|
-
),
|
|
143
|
-
|
|
178
|
+
) }),
|
|
179
|
+
portalContainer
|
|
144
180
|
);
|
|
145
181
|
});
|
|
146
182
|
ModalBase.displayName = "Modal";
|
|
183
|
+
var ThemedModalBase = withComponentTheme(
|
|
184
|
+
ModalBase,
|
|
185
|
+
"Modal",
|
|
186
|
+
["modal", "button"],
|
|
187
|
+
{ portalOnly: true }
|
|
188
|
+
);
|
|
147
189
|
var staticHandles = /* @__PURE__ */ new Set();
|
|
148
190
|
var staticIconName = {
|
|
149
191
|
confirm: "info",
|
|
@@ -189,13 +231,13 @@ var StaticModalHost = ({
|
|
|
189
231
|
setLoading(true);
|
|
190
232
|
result.then((next) => {
|
|
191
233
|
if (next !== false) destroy();
|
|
192
|
-
}).finally(() => setLoading(false));
|
|
234
|
+
}, () => void 0).finally(() => setLoading(false));
|
|
193
235
|
return;
|
|
194
236
|
}
|
|
195
237
|
destroy();
|
|
196
238
|
}, [destroy, onOk]);
|
|
197
239
|
const okVariant = kind === "error" ? "danger" : "primary";
|
|
198
|
-
const mergedFooter = footer !== void 0 ? footer : okCancel ? /* @__PURE__ */ jsxs(
|
|
240
|
+
const mergedFooter = footer !== void 0 ? footer : okCancel ? /* @__PURE__ */ jsxs(InternalComponentThemePart, { components: "Button", children: [
|
|
199
241
|
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: close, ...cancelButtonProps, children: cancelText }),
|
|
200
242
|
/* @__PURE__ */ jsx(
|
|
201
243
|
Button,
|
|
@@ -207,7 +249,7 @@ var StaticModalHost = ({
|
|
|
207
249
|
children: okText
|
|
208
250
|
}
|
|
209
251
|
)
|
|
210
|
-
] }) : /* @__PURE__ */ jsx(
|
|
252
|
+
] }) : /* @__PURE__ */ jsx(InternalComponentThemePart, { components: "Button", children: /* @__PURE__ */ jsx(
|
|
211
253
|
Button,
|
|
212
254
|
{
|
|
213
255
|
variant: okVariant,
|
|
@@ -216,9 +258,9 @@ var StaticModalHost = ({
|
|
|
216
258
|
...okButtonProps,
|
|
217
259
|
children: okText
|
|
218
260
|
}
|
|
219
|
-
);
|
|
261
|
+
) });
|
|
220
262
|
return /* @__PURE__ */ jsx(
|
|
221
|
-
|
|
263
|
+
ThemedModalBase,
|
|
222
264
|
{
|
|
223
265
|
...modalProps,
|
|
224
266
|
open,
|
|
@@ -227,7 +269,8 @@ var StaticModalHost = ({
|
|
|
227
269
|
footer: mergedFooter,
|
|
228
270
|
maskClosable: maskClosable ?? false,
|
|
229
271
|
escClosable: escClosable ?? true,
|
|
230
|
-
className
|
|
272
|
+
className,
|
|
273
|
+
maskClassName: ["modal-static-overlay", config.maskClassName].filter(Boolean).join(" "),
|
|
231
274
|
children: /* @__PURE__ */ jsxs("div", { className: "modal-static-body", children: [
|
|
232
275
|
icon !== false && /* @__PURE__ */ jsx("span", { className: `modal-static-icon ${kind}`, children: icon ?? /* @__PURE__ */ jsx(Icon, { name: staticIconName[kind], size: 20 }) }),
|
|
233
276
|
/* @__PURE__ */ jsx("div", { className: "modal-static-content", children: content ?? children })
|
|
@@ -284,7 +327,7 @@ var createStaticModal = (kind, config) => {
|
|
|
284
327
|
render();
|
|
285
328
|
return handle;
|
|
286
329
|
};
|
|
287
|
-
var Modal =
|
|
330
|
+
var Modal = ThemedModalBase;
|
|
288
331
|
Modal.confirm = (config) => createStaticModal("confirm", config);
|
|
289
332
|
Modal.info = (config) => createStaticModal("info", config);
|
|
290
333
|
Modal.success = (config) => createStaticModal("success", config);
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { useVisualThemeSnapshot, useComponentOverrides, subscribeImperativeThemeChange, useOwnerPortalTheme, resolveVisualThemeSnapshot, componentTokensToStyle, visualThemeToStyle, VisualThemeProvider, ComponentOverridesProvider, OwnerPortalThemeProvider, DEFAULT_THEME_COLORS } from './chunk-ULTDRMGN.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
|
|
6
|
+
var ACCENT_KEYS = /* @__PURE__ */ new Set([
|
|
7
|
+
"sky",
|
|
8
|
+
"coral",
|
|
9
|
+
"mint",
|
|
10
|
+
"violet",
|
|
11
|
+
"amber",
|
|
12
|
+
"rose"
|
|
13
|
+
]);
|
|
14
|
+
var InternalComponentThemePartContext = React.createContext([]);
|
|
15
|
+
function InternalComponentThemePart({
|
|
16
|
+
components,
|
|
17
|
+
children
|
|
18
|
+
}) {
|
|
19
|
+
const inherited = React.useContext(InternalComponentThemePartContext);
|
|
20
|
+
const value = React.useMemo(() => {
|
|
21
|
+
const next = Array.isArray(components) ? components : [components];
|
|
22
|
+
return [...inherited, ...next];
|
|
23
|
+
}, [components, inherited]);
|
|
24
|
+
return /* @__PURE__ */ jsx(InternalComponentThemePartContext.Provider, { value, children });
|
|
25
|
+
}
|
|
26
|
+
var THEME_COLOR_VARIABLES = {
|
|
27
|
+
bg: "--bg",
|
|
28
|
+
bgRaised: "--bg-raised",
|
|
29
|
+
bgSunken: "--bg-sunken",
|
|
30
|
+
fg: "--fg",
|
|
31
|
+
fgMuted: "--fg-muted",
|
|
32
|
+
fgSubtle: "--fg-subtle",
|
|
33
|
+
border: "--border",
|
|
34
|
+
divider: "--divider",
|
|
35
|
+
shadowDark: "--shadow-dark",
|
|
36
|
+
shadowLight: "--shadow-light",
|
|
37
|
+
accent: "--accent",
|
|
38
|
+
accentInk: "--accent-ink",
|
|
39
|
+
accentSoft: "--accent-soft",
|
|
40
|
+
accentGlow: "--accent-glow",
|
|
41
|
+
info: "--info",
|
|
42
|
+
success: "--success",
|
|
43
|
+
warning: "--warning",
|
|
44
|
+
danger: "--danger"
|
|
45
|
+
};
|
|
46
|
+
function normalizeComponentThemeInput(theme) {
|
|
47
|
+
if (theme === void 0) return void 0;
|
|
48
|
+
if (typeof theme === "string") {
|
|
49
|
+
return ACCENT_KEYS.has(theme) ? { accent: theme } : { baseColor: theme };
|
|
50
|
+
}
|
|
51
|
+
return theme;
|
|
52
|
+
}
|
|
53
|
+
function mergeComponentTheme(inherited, own) {
|
|
54
|
+
if (!inherited && !own) return void 0;
|
|
55
|
+
return {
|
|
56
|
+
...inherited,
|
|
57
|
+
...own,
|
|
58
|
+
colors: { ...inherited?.colors ?? {}, ...own?.colors ?? {} },
|
|
59
|
+
tokens: { ...inherited?.tokens ?? {}, ...own?.tokens ?? {} },
|
|
60
|
+
components: own?.components
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function hasExplicitIconForeground(config) {
|
|
64
|
+
if (!config) return false;
|
|
65
|
+
return config.baseColor !== void 0 || config.colorScheme !== void 0 || config.colors?.fg !== void 0 || config.tokens?.fg !== void 0 || config.tokens?.["--fg"] !== void 0 || config.tokens?.["--lmn-icon-fg"] !== void 0;
|
|
66
|
+
}
|
|
67
|
+
function getStaticColorScheme(rootElement) {
|
|
68
|
+
if (typeof document === "undefined") return "light";
|
|
69
|
+
const inheritedElement = rootElement?.parentElement ?? document.documentElement;
|
|
70
|
+
const themeScope = inheritedElement.closest("[data-theme]");
|
|
71
|
+
return themeScope?.dataset.theme === "dark" ? "dark" : "light";
|
|
72
|
+
}
|
|
73
|
+
function hasLocalStaticThemeScope(rootElement) {
|
|
74
|
+
if (!rootElement || typeof document === "undefined") return false;
|
|
75
|
+
const themeScope = rootElement.parentElement?.closest("[data-theme]");
|
|
76
|
+
return themeScope != null && themeScope !== document.documentElement && themeScope !== document.body;
|
|
77
|
+
}
|
|
78
|
+
function getFallbackSnapshot(rootElement) {
|
|
79
|
+
const colorScheme = getStaticColorScheme(rootElement);
|
|
80
|
+
return {
|
|
81
|
+
colorScheme,
|
|
82
|
+
intensity: 5,
|
|
83
|
+
colors: { ...DEFAULT_THEME_COLORS[colorScheme] }
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function getDefaultSnapshot(rootElement) {
|
|
87
|
+
const fallback = getFallbackSnapshot(rootElement);
|
|
88
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
89
|
+
return fallback;
|
|
90
|
+
}
|
|
91
|
+
const inheritedElement = rootElement?.parentElement ?? document.documentElement;
|
|
92
|
+
const computed = window.getComputedStyle(inheritedElement);
|
|
93
|
+
const colors = { ...fallback.colors };
|
|
94
|
+
for (const key of Object.keys(THEME_COLOR_VARIABLES)) {
|
|
95
|
+
const value = computed.getPropertyValue(THEME_COLOR_VARIABLES[key]).trim();
|
|
96
|
+
if (value) colors[key] = value;
|
|
97
|
+
}
|
|
98
|
+
const shadowDepth = Number.parseFloat(computed.getPropertyValue("--d"));
|
|
99
|
+
const intensity = Number.isFinite(shadowDepth) ? (shadowDepth - 0.4) / 0.12 : fallback.intensity;
|
|
100
|
+
return { ...fallback, intensity, colors };
|
|
101
|
+
}
|
|
102
|
+
function createInheritedTokenResetStyle(ownerStyle, cssPrefixes) {
|
|
103
|
+
const variablePrefixes = cssPrefixes.map((prefix) => `--lmn-${prefix}-`);
|
|
104
|
+
const style = {};
|
|
105
|
+
for (const property of Object.keys(ownerStyle)) {
|
|
106
|
+
if (variablePrefixes.some((prefix) => property.startsWith(prefix))) {
|
|
107
|
+
style[property] = "initial";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return style;
|
|
111
|
+
}
|
|
112
|
+
function useComponentThemeRootRef(forwardedRef, { component, theme }) {
|
|
113
|
+
const inheritedVisualTheme = useVisualThemeSnapshot();
|
|
114
|
+
const inheritedOverrides = useComponentOverrides();
|
|
115
|
+
const [rootState, setRootState] = React.useState({
|
|
116
|
+
element: null,
|
|
117
|
+
revision: 0
|
|
118
|
+
});
|
|
119
|
+
const mountedRootRef = React.useRef(null);
|
|
120
|
+
const tracksRootElement = React.useRef(false);
|
|
121
|
+
const shouldTrackConfiguredTheme = inheritedVisualTheme === null && (theme !== void 0 || inheritedOverrides[component] !== void 0);
|
|
122
|
+
const shouldDetectLocalStaticTheme = inheritedVisualTheme === null;
|
|
123
|
+
const rootRef = React.useCallback((node) => {
|
|
124
|
+
mountedRootRef.current = node;
|
|
125
|
+
const shouldTrackNode = node !== null && (shouldTrackConfiguredTheme || shouldDetectLocalStaticTheme && hasLocalStaticThemeScope(node));
|
|
126
|
+
if (shouldTrackNode) {
|
|
127
|
+
tracksRootElement.current = true;
|
|
128
|
+
setRootState((current) => current.element === node ? current : { element: node, revision: current.revision + 1 });
|
|
129
|
+
} else if (node !== null) {
|
|
130
|
+
tracksRootElement.current = false;
|
|
131
|
+
setRootState((current) => current.element === null ? current : { element: null, revision: current.revision + 1 });
|
|
132
|
+
} else {
|
|
133
|
+
tracksRootElement.current = false;
|
|
134
|
+
}
|
|
135
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
136
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
137
|
+
}, [forwardedRef, shouldDetectLocalStaticTheme, shouldTrackConfiguredTheme]);
|
|
138
|
+
useIsomorphicLayoutEffect(() => {
|
|
139
|
+
if (!shouldDetectLocalStaticTheme) return;
|
|
140
|
+
return subscribeImperativeThemeChange((target) => {
|
|
141
|
+
const node = mountedRootRef.current;
|
|
142
|
+
if (!node || !target.contains(node)) return;
|
|
143
|
+
const shouldTrackNode = shouldTrackConfiguredTheme || hasLocalStaticThemeScope(node);
|
|
144
|
+
if (!shouldTrackNode && !tracksRootElement.current) return;
|
|
145
|
+
tracksRootElement.current = shouldTrackNode;
|
|
146
|
+
setRootState((current) => ({
|
|
147
|
+
element: shouldTrackNode ? node : null,
|
|
148
|
+
revision: current.revision + 1
|
|
149
|
+
}));
|
|
150
|
+
});
|
|
151
|
+
}, [shouldDetectLocalStaticTheme, shouldTrackConfiguredTheme]);
|
|
152
|
+
return [rootState.element, rootRef];
|
|
153
|
+
}
|
|
154
|
+
function ComponentThemeBoundary({
|
|
155
|
+
component,
|
|
156
|
+
cssPrefix,
|
|
157
|
+
theme,
|
|
158
|
+
rootElement,
|
|
159
|
+
children
|
|
160
|
+
}) {
|
|
161
|
+
const inheritedVisualTheme = useVisualThemeSnapshot();
|
|
162
|
+
const inheritedOwner = useOwnerPortalTheme();
|
|
163
|
+
const inheritedOverrides = useComponentOverrides();
|
|
164
|
+
const internalComponents = React.useContext(InternalComponentThemePartContext);
|
|
165
|
+
const own = normalizeComponentThemeInput(theme);
|
|
166
|
+
const override = inheritedOverrides[component];
|
|
167
|
+
const config = mergeComponentTheme(override, own);
|
|
168
|
+
const active = config !== void 0;
|
|
169
|
+
const scope = own?.scope ?? "self";
|
|
170
|
+
const cssPrefixes = Array.isArray(cssPrefix) ? cssPrefix : [cssPrefix];
|
|
171
|
+
const isOwnedInternalPart = internalComponents.includes(component);
|
|
172
|
+
const matchesInheritedCssPrefix = cssPrefixes.some(
|
|
173
|
+
(prefix) => inheritedOwner?.cssPrefixes.includes(prefix)
|
|
174
|
+
);
|
|
175
|
+
const shouldResetSelfTheme = !active && inheritedOwner !== null && !isOwnedInternalPart && (inheritedOwner?.component === component || matchesInheritedCssPrefix) && !inheritedOwner.subtree;
|
|
176
|
+
const hasLocalStaticTheme = inheritedVisualTheme === null && hasLocalStaticThemeScope(rootElement);
|
|
177
|
+
const inheritedSnapshot = inheritedVisualTheme ?? (shouldResetSelfTheme && inheritedOwner ? inheritedOwner.inheritedSnapshot : active || hasLocalStaticTheme ? getDefaultSnapshot(rootElement) : getFallbackSnapshot(rootElement));
|
|
178
|
+
const snapshot = active ? resolveVisualThemeSnapshot(config, inheritedSnapshot) : inheritedSnapshot;
|
|
179
|
+
const inheritedTokenResetStyle = shouldResetSelfTheme && inheritedOwner ? createInheritedTokenResetStyle(inheritedOwner.style, cssPrefixes) : {};
|
|
180
|
+
const prefixedStyle = active || shouldResetSelfTheme ? cssPrefixes.reduce((result, currentPrefix) => {
|
|
181
|
+
const prefix = `lmn-${currentPrefix}-`;
|
|
182
|
+
return {
|
|
183
|
+
...result,
|
|
184
|
+
...visualThemeToStyle(snapshot, prefix),
|
|
185
|
+
...active ? componentTokensToStyle(config.tokens, prefix) : null
|
|
186
|
+
};
|
|
187
|
+
}, inheritedTokenResetStyle) : {};
|
|
188
|
+
const subtreeStyle = active && scope === "subtree" ? visualThemeToStyle(snapshot) : {};
|
|
189
|
+
const styles = override?.styles ?? {};
|
|
190
|
+
const rootStyle = {
|
|
191
|
+
...styles.root ?? {},
|
|
192
|
+
...prefixedStyle,
|
|
193
|
+
...subtreeStyle
|
|
194
|
+
};
|
|
195
|
+
const rootDataAttributes = active || shouldResetSelfTheme ? active && scope === "subtree" ? {
|
|
196
|
+
"data-theme": snapshot.colorScheme,
|
|
197
|
+
"data-lumina-color-scheme": snapshot.colorScheme
|
|
198
|
+
} : { "data-lumina-color-scheme": snapshot.colorScheme } : {};
|
|
199
|
+
if (component === "Icon" && active && hasExplicitIconForeground(config)) {
|
|
200
|
+
rootDataAttributes["data-lumina-icon-color"] = "";
|
|
201
|
+
}
|
|
202
|
+
const shouldApplyPortalTheme = active || inheritedVisualTheme !== null || hasLocalStaticTheme;
|
|
203
|
+
const portalStyle = shouldApplyPortalTheme ? {
|
|
204
|
+
...visualThemeToStyle(inheritedSnapshot),
|
|
205
|
+
...prefixedStyle,
|
|
206
|
+
...scope === "subtree" ? subtreeStyle : {}
|
|
207
|
+
} : {};
|
|
208
|
+
const portalDataAttributes = shouldApplyPortalTheme ? {
|
|
209
|
+
"data-theme": scope === "subtree" ? snapshot.colorScheme : inheritedSnapshot.colorScheme,
|
|
210
|
+
"data-lumina-color-scheme": snapshot.colorScheme
|
|
211
|
+
} : {};
|
|
212
|
+
const state = {
|
|
213
|
+
active,
|
|
214
|
+
scope,
|
|
215
|
+
snapshot,
|
|
216
|
+
rootStyle,
|
|
217
|
+
rootDataAttributes,
|
|
218
|
+
portalStyle,
|
|
219
|
+
portalDataAttributes,
|
|
220
|
+
styles
|
|
221
|
+
};
|
|
222
|
+
const consumedIndex = internalComponents.indexOf(component);
|
|
223
|
+
const remainingInternalComponents = isOwnedInternalPart ? [
|
|
224
|
+
...internalComponents.slice(0, consumedIndex),
|
|
225
|
+
...internalComponents.slice(consumedIndex + 1)
|
|
226
|
+
] : internalComponents;
|
|
227
|
+
const ownerPortalTheme = active ? {
|
|
228
|
+
component,
|
|
229
|
+
cssPrefixes,
|
|
230
|
+
style: portalStyle,
|
|
231
|
+
colorScheme: snapshot.colorScheme,
|
|
232
|
+
inheritedColorScheme: inheritedSnapshot.colorScheme,
|
|
233
|
+
inheritedSnapshot,
|
|
234
|
+
subtree: scope === "subtree",
|
|
235
|
+
styles
|
|
236
|
+
} : shouldResetSelfTheme ? null : inheritedOwner;
|
|
237
|
+
const providedVisualTheme = active && scope === "subtree" ? snapshot : !active && hasLocalStaticTheme ? inheritedSnapshot : null;
|
|
238
|
+
return /* @__PURE__ */ jsx(VisualThemeProvider, { value: providedVisualTheme ?? inheritedVisualTheme, children: /* @__PURE__ */ jsx(ComponentOverridesProvider, { value: own?.components, children: /* @__PURE__ */ jsx(OwnerPortalThemeProvider, { value: ownerPortalTheme, children: /* @__PURE__ */ jsx(InternalComponentThemePartContext.Provider, { value: remainingInternalComponents, children: children(state) }) }) }) });
|
|
239
|
+
}
|
|
240
|
+
function mergeComponentRootStyleWithInstanceStyle(rootStyle, instanceStyle) {
|
|
241
|
+
if (!instanceStyle) return rootStyle;
|
|
242
|
+
const overrides = {};
|
|
243
|
+
const instanceRecord = instanceStyle;
|
|
244
|
+
for (const property of Object.keys(rootStyle)) {
|
|
245
|
+
if (Object.prototype.hasOwnProperty.call(instanceRecord, property)) {
|
|
246
|
+
overrides[property] = instanceRecord[property];
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return { ...rootStyle, ...overrides };
|
|
250
|
+
}
|
|
251
|
+
function withInternalComponentThemePart(Component, components) {
|
|
252
|
+
const Wrapped = React.forwardRef(
|
|
253
|
+
(props, ref) => /* @__PURE__ */ jsx(InternalComponentThemePart, { components, children: React.createElement(Component, { ...props, ref }) })
|
|
254
|
+
);
|
|
255
|
+
Wrapped.displayName = `InternalThemePart(${typeof Component === "string" ? Component : Component.displayName ?? Component.name ?? "Component"})`;
|
|
256
|
+
return Wrapped;
|
|
257
|
+
}
|
|
258
|
+
function useComponentPortalTheme(component) {
|
|
259
|
+
const owner = useOwnerPortalTheme();
|
|
260
|
+
const inherited = useVisualThemeSnapshot();
|
|
261
|
+
const matchesOwner = owner && (Array.isArray(component) ? component.includes(owner.component) : owner.component === component);
|
|
262
|
+
if (matchesOwner && owner) {
|
|
263
|
+
return {
|
|
264
|
+
style: owner.style,
|
|
265
|
+
dataAttributes: {
|
|
266
|
+
"data-theme": owner.subtree ? owner.colorScheme : owner.inheritedColorScheme,
|
|
267
|
+
"data-lumina-color-scheme": owner.colorScheme
|
|
268
|
+
},
|
|
269
|
+
styles: owner.styles
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
if (!inherited) {
|
|
273
|
+
return { style: {}, dataAttributes: {}, styles: {} };
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
style: visualThemeToStyle(inherited),
|
|
277
|
+
dataAttributes: {
|
|
278
|
+
"data-theme": inherited.colorScheme,
|
|
279
|
+
"data-lumina-color-scheme": inherited.colorScheme
|
|
280
|
+
},
|
|
281
|
+
styles: {}
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function withComponentTheme(Component, component, cssPrefix = component.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), options = {}) {
|
|
285
|
+
const Wrapped = React.forwardRef((props, ref) => {
|
|
286
|
+
const { theme, style, ...rest } = props;
|
|
287
|
+
const [rootElement, rootRef] = useComponentThemeRootRef(
|
|
288
|
+
options.portalOnly ? void 0 : ref,
|
|
289
|
+
{ component, theme }
|
|
290
|
+
);
|
|
291
|
+
const themedNode = /* @__PURE__ */ jsx(
|
|
292
|
+
ComponentThemeBoundary,
|
|
293
|
+
{
|
|
294
|
+
component,
|
|
295
|
+
cssPrefix,
|
|
296
|
+
theme,
|
|
297
|
+
rootElement,
|
|
298
|
+
children: (state) => React.createElement(Component, {
|
|
299
|
+
...rest,
|
|
300
|
+
...state.rootDataAttributes,
|
|
301
|
+
ref: options.portalOnly ? ref : rootRef,
|
|
302
|
+
style: { ...state.rootStyle, ...style }
|
|
303
|
+
})
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
if (!options.portalOnly) return themedNode;
|
|
307
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
308
|
+
/* @__PURE__ */ jsx(
|
|
309
|
+
"template",
|
|
310
|
+
{
|
|
311
|
+
ref: rootRef,
|
|
312
|
+
"data-lumina-theme-anchor": component
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
themedNode
|
|
316
|
+
] });
|
|
317
|
+
});
|
|
318
|
+
Wrapped.displayName = Component.displayName ?? component;
|
|
319
|
+
return Wrapped;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export { ComponentThemeBoundary, InternalComponentThemePart, mergeComponentRootStyleWithInstanceStyle, normalizeComponentThemeInput, useComponentPortalTheme, useComponentThemeRootRef, withComponentTheme, withInternalComponentThemePart };
|