@fangxinyan/lumina 0.6.2 → 0.6.3

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.
Files changed (141) hide show
  1. package/README.md +2 -1
  2. package/dist/{Alert-JJ7GB3UU.css → Alert-QBKIDY5H.css} +7 -0
  3. package/dist/Alert.cjs +3 -3
  4. package/dist/Alert.d.cts +3 -2
  5. package/dist/Alert.d.ts +3 -2
  6. package/dist/Alert.js +2 -2
  7. package/dist/AutoComplete.cjs +5 -5
  8. package/dist/AutoComplete.js +4 -4
  9. package/dist/Badge.d.cts +1 -0
  10. package/dist/Badge.d.ts +1 -0
  11. package/dist/{Button-SDQD25AG.css → Button-4Z3Q6KII.css} +56 -36
  12. package/dist/Button.cjs +3 -3
  13. package/dist/Button.d.cts +6 -5
  14. package/dist/Button.d.ts +6 -5
  15. package/dist/Button.js +2 -2
  16. package/dist/Calendar.cjs +3 -3
  17. package/dist/Calendar.js +2 -2
  18. package/dist/{Cascader-C2DFSMKJ.css → Cascader-3BLLA7EN.css} +13 -0
  19. package/dist/Cascader.cjs +5 -5
  20. package/dist/Cascader.d.cts +4 -2
  21. package/dist/Cascader.d.ts +4 -2
  22. package/dist/Cascader.js +4 -4
  23. package/dist/Checkbox.cjs +3 -3
  24. package/dist/Checkbox.js +2 -2
  25. package/dist/Collapse.cjs +3 -3
  26. package/dist/Collapse.js +2 -2
  27. package/dist/CommandPalette.cjs +5 -5
  28. package/dist/CommandPalette.js +4 -4
  29. package/dist/Drawer.cjs +3 -3
  30. package/dist/Drawer.js +2 -2
  31. package/dist/Icon.cjs +55 -47
  32. package/dist/Icon.d.cts +9 -1
  33. package/dist/Icon.d.ts +9 -1
  34. package/dist/Icon.js +1 -1
  35. package/dist/{Image-4MN34O6P.css → Image-MRYQCRQ5.css} +78 -0
  36. package/dist/Image.cjs +12 -4
  37. package/dist/Image.d.cts +79 -6
  38. package/dist/Image.d.ts +79 -6
  39. package/dist/Image.js +2 -2
  40. package/dist/{Input-3G4ONWNU.css → Input-HUBJ55OH.css} +10 -0
  41. package/dist/Input.cjs +5 -5
  42. package/dist/Input.d.cts +4 -3
  43. package/dist/Input.d.ts +4 -3
  44. package/dist/Input.js +3 -3
  45. package/dist/InputNumber.cjs +5 -5
  46. package/dist/InputNumber.js +4 -4
  47. package/dist/Message.cjs +6 -6
  48. package/dist/Message.js +2 -2
  49. package/dist/Modal.cjs +4 -4
  50. package/dist/Modal.d.cts +1 -0
  51. package/dist/Modal.d.ts +1 -0
  52. package/dist/Modal.js +3 -3
  53. package/dist/Pagination.cjs +7 -7
  54. package/dist/Pagination.js +6 -6
  55. package/dist/{Select-JVBQAZBG.css → Select-Z5VYPEEY.css} +26 -1
  56. package/dist/Select.cjs +6 -6
  57. package/dist/Select.d.cts +4 -3
  58. package/dist/Select.d.ts +4 -3
  59. package/dist/Select.js +5 -5
  60. package/dist/Table.cjs +9 -9
  61. package/dist/Table.js +8 -8
  62. package/dist/TablePro.cjs +10 -10
  63. package/dist/TablePro.js +9 -9
  64. package/dist/{Tag-LB3OOJAO.css → Tag-HDYCDPFS.css} +14 -1
  65. package/dist/Tag.cjs +3 -3
  66. package/dist/Tag.d.cts +4 -3
  67. package/dist/Tag.d.ts +4 -3
  68. package/dist/Tag.js +2 -2
  69. package/dist/Textarea.cjs +4 -4
  70. package/dist/Textarea.js +2 -2
  71. package/dist/Theme.cjs +14 -10
  72. package/dist/Theme.d.cts +29 -6
  73. package/dist/Theme.d.ts +29 -6
  74. package/dist/Theme.js +1 -1
  75. package/dist/Typography.cjs +7 -7
  76. package/dist/Typography.d.cts +1 -0
  77. package/dist/Typography.d.ts +1 -0
  78. package/dist/Typography.js +2 -2
  79. package/dist/{chunk-MT7UWY6T.cjs → chunk-2HQCUBA7.cjs} +2 -2
  80. package/dist/{chunk-OF3SGLZY.js → chunk-47VG2P34.js} +9 -1
  81. package/dist/{chunk-ZIP7F4UF.cjs → chunk-5DKRY67M.cjs} +4 -4
  82. package/dist/{chunk-DQTSTJ6O.js → chunk-5H5YP2TB.js} +3 -3
  83. package/dist/{chunk-QGHYQCF3.cjs → chunk-5MN3PMF4.cjs} +8 -8
  84. package/dist/{chunk-FBVVRTX2.cjs → chunk-6HMTV6P4.cjs} +2 -2
  85. package/dist/{chunk-RF2EY5JS.cjs → chunk-6ZXQJRAT.cjs} +153 -34
  86. package/dist/{chunk-4WTU5P3O.cjs → chunk-7AG524YZ.cjs} +3 -3
  87. package/dist/{chunk-CEJ7VBR6.js → chunk-7IYKKLV3.js} +2 -2
  88. package/dist/{chunk-FJNWUELL.js → chunk-AAGF7K3L.js} +1 -1
  89. package/dist/{chunk-AWXCSX6J.js → chunk-BPOOVO5T.js} +3 -3
  90. package/dist/{chunk-EJBHR2P5.js → chunk-BVQ77VRY.js} +2 -2
  91. package/dist/{chunk-7NGMQIST.js → chunk-CETNCRZ4.js} +2 -2
  92. package/dist/{chunk-K2KYM7LW.cjs → chunk-DG5VQ6BO.cjs} +2 -2
  93. package/dist/chunk-DWAN57G4.js +243 -0
  94. package/dist/{chunk-CXWEOAVU.js → chunk-ET6DYQVZ.js} +1 -1
  95. package/dist/{chunk-WKKSAGYH.js → chunk-FBYUZOZP.js} +7 -7
  96. package/dist/{chunk-EIY7KEJ3.cjs → chunk-FGW5GJ22.cjs} +2 -2
  97. package/dist/{chunk-33NCTOEB.js → chunk-FWPBORRB.js} +1 -1
  98. package/dist/{chunk-EQEJTN3V.js → chunk-GIZU3H6H.js} +1 -1
  99. package/dist/{chunk-HPFQXYKG.cjs → chunk-H4LGWZMH.cjs} +9 -9
  100. package/dist/{chunk-6LZ54NPO.cjs → chunk-HKF2V5MM.cjs} +33 -23
  101. package/dist/{chunk-WGZ2KJTZ.js → chunk-HLFH5HWR.js} +1 -1
  102. package/dist/{chunk-UMDGS4BP.js → chunk-I5WTQ5Y3.js} +4 -4
  103. package/dist/{chunk-MUXP7ASL.js → chunk-J2HZTJO6.js} +1 -1
  104. package/dist/{chunk-NN25YMOL.js → chunk-J5ZGYQZK.js} +153 -35
  105. package/dist/{chunk-CHMCL7AV.js → chunk-JCEHZ336.js} +1 -1
  106. package/dist/{chunk-FFZ6OMZI.js → chunk-JVUVOR6S.js} +1 -1
  107. package/dist/{chunk-ON4DEDMI.js → chunk-K5IGFBDR.js} +1 -1
  108. package/dist/{chunk-35ZGBAA3.cjs → chunk-K7FV7W6U.cjs} +5 -5
  109. package/dist/{chunk-XD3JGL5O.js → chunk-ME5BZ2WA.js} +1 -1
  110. package/dist/{chunk-OQBDU5I2.cjs → chunk-MPVCYU2K.cjs} +2 -2
  111. package/dist/{chunk-CUXV6QNN.cjs → chunk-P6EZG2R7.cjs} +5 -5
  112. package/dist/{chunk-SKMP2A5O.cjs → chunk-P6P4DGLF.cjs} +2 -2
  113. package/dist/{chunk-TEG7NJHS.cjs → chunk-PULGVK2I.cjs} +2 -2
  114. package/dist/{chunk-TZJH5HBT.cjs → chunk-QP3VCSRY.cjs} +5 -5
  115. package/dist/{chunk-MQV2XN4B.cjs → chunk-R2TEDH2F.cjs} +5 -5
  116. package/dist/{chunk-JD7A6VM3.js → chunk-SQGPSMSK.js} +5 -5
  117. package/dist/{chunk-GNEZQMKH.js → chunk-TGL5BGMR.js} +4 -4
  118. package/dist/{chunk-5WAXZJG5.cjs → chunk-TP567B3L.cjs} +5 -5
  119. package/dist/{chunk-XTIN5545.js → chunk-UKS23N3L.js} +31 -21
  120. package/dist/{chunk-TJII7BQ2.cjs → chunk-V272XR3F.cjs} +10 -0
  121. package/dist/chunk-VFFIE2VO.cjs +271 -0
  122. package/dist/{chunk-OYMJVU66.cjs → chunk-X5GCOMC3.cjs} +15 -15
  123. package/dist/{chunk-3AS5B7MQ.cjs → chunk-XSN4TLN5.cjs} +10 -10
  124. package/dist/{chunk-6ACKL3WH.cjs → chunk-ZKE73UQF.cjs} +3 -3
  125. package/dist/index.cjs +130 -110
  126. package/dist/index.d.cts +5 -5
  127. package/dist/index.d.ts +5 -5
  128. package/dist/index.js +24 -24
  129. package/dist/styles.css +202 -38
  130. package/docs/llms/alert.md +4 -3
  131. package/docs/llms/button.md +4 -3
  132. package/docs/llms/cascader.md +3 -0
  133. package/docs/llms/image.md +72 -1
  134. package/docs/llms/input.md +3 -2
  135. package/docs/llms/select.md +2 -2
  136. package/docs/llms/tag.md +3 -2
  137. package/docs/llms/theme.md +41 -4
  138. package/docs/llms.md +4 -4
  139. package/package.json +16 -1
  140. package/dist/chunk-B2KEZQ6S.cjs +0 -116
  141. package/dist/chunk-PH3YECMF.js +0 -90
@@ -1,10 +1,10 @@
1
- import { Tag } from './chunk-DQTSTJ6O.js';
1
+ import { Tag } from './chunk-5H5YP2TB.js';
2
2
  import { useFloating } from './chunk-DUFRASGO.js';
3
- import { Input } from './chunk-XTIN5545.js';
4
- import { Icon } from './chunk-OF3SGLZY.js';
3
+ import { Input } from './chunk-UKS23N3L.js';
4
+ import { Icon, renderIconSlot } from './chunk-47VG2P34.js';
5
5
  import './tokens-BIIUTPKN.css';
6
6
  import './shared-NJHRNLRH.css';
7
- import './Select-JVBQAZBG.css';
7
+ import './Select-Z5VYPEEY.css';
8
8
  import * as React from 'react';
9
9
  import { createPortal } from 'react-dom';
10
10
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -218,8 +218,8 @@ var SelectInner = (props, forwardedRef) => {
218
218
  const current = allFlat.find((o) => o.value === singleValue);
219
219
  if (!current) return /* @__PURE__ */ jsx("span", { className: "placeholder", children: placeholder });
220
220
  return /* @__PURE__ */ jsxs("span", { className: "select-value", children: [
221
- current.icon && /* @__PURE__ */ jsx(Icon, { name: current.icon, size: 14 }),
222
- /* @__PURE__ */ jsx("span", { children: current.label })
221
+ renderIconSlot(current.icon, { size: 14, className: "select-icon" }),
222
+ /* @__PURE__ */ jsx("span", { className: "select-value-label", children: current.label })
223
223
  ] });
224
224
  };
225
225
  const hasSelection = isMulti ? (multiValue?.length ?? 0) > 0 : singleValue !== void 0;
@@ -242,7 +242,7 @@ var SelectInner = (props, forwardedRef) => {
242
242
  onClick: () => isMulti ? toggleMulti(o) : pickSingle(o),
243
243
  children: [
244
244
  isMulti && /* @__PURE__ */ jsx("span", { className: `menu-check ${sel ? "on" : ""}`, "aria-hidden": true, children: sel && /* @__PURE__ */ jsx(Icon, { name: "check", size: 11, stroke: 3 }) }),
245
- o.icon && /* @__PURE__ */ jsx(Icon, { name: o.icon, size: 14 }),
245
+ renderIconSlot(o.icon, { size: 14, className: "menu-item-icon" }),
246
246
  /* @__PURE__ */ jsxs("span", { className: "menu-item-body", children: [
247
247
  /* @__PURE__ */ jsx("span", { className: "menu-item-label", children: o.label }),
248
248
  o.description && /* @__PURE__ */ jsx("span", { className: "menu-item-desc", children: o.description })
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkTJII7BQ2_cjs = require('./chunk-TJII7BQ2.cjs');
3
+ var chunkV272XR3F_cjs = require('./chunk-V272XR3F.cjs');
4
4
  require('./tokens-BIIUTPKN.css');
5
5
  require('./shared-NJHRNLRH.css');
6
6
  require('./Collapse-66U5YJFY.css');
@@ -112,7 +112,7 @@ var Collapse = React__namespace.forwardRef(({
112
112
  toggle(it.key, it.disabled);
113
113
  }
114
114
  },
115
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkTJII7BQ2_cjs.Icon, { name: "chevDown", size: 16 })
115
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkV272XR3F_cjs.Icon, { name: "chevDown", size: 16 })
116
116
  }
117
117
  )
118
118
  ]
@@ -1,4 +1,4 @@
1
- import { Icon } from './chunk-OF3SGLZY.js';
1
+ import { Icon } from './chunk-47VG2P34.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './Calendar-LHZELUDL.css';
@@ -1,4 +1,4 @@
1
- import { Icon } from './chunk-OF3SGLZY.js';
1
+ import { Icon } from './chunk-47VG2P34.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './Checkbox-U5EUDSYS.css';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk5WAXZJG5_cjs = require('./chunk-5WAXZJG5.cjs');
4
- var chunkTJII7BQ2_cjs = require('./chunk-TJII7BQ2.cjs');
3
+ var chunkTP567B3L_cjs = require('./chunk-TP567B3L.cjs');
4
+ var chunkV272XR3F_cjs = require('./chunk-V272XR3F.cjs');
5
5
  require('./tokens-BIIUTPKN.css');
6
6
  require('./shared-NJHRNLRH.css');
7
7
  require('./Modal-2QNDW4SO.css');
@@ -92,9 +92,9 @@ var ModalBase = React__namespace.forwardRef(({
92
92
  if (!open && destroyOnClose) return null;
93
93
  const overlayStyle = zIndex != null ? { zIndex } : void 0;
94
94
  const defaultFooter = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
95
- /* @__PURE__ */ jsxRuntime.jsx(chunk5WAXZJG5_cjs.Button, { variant: "ghost", onClick: handleCancel, ...cancelButtonProps, children: cancelText }),
95
+ /* @__PURE__ */ jsxRuntime.jsx(chunkTP567B3L_cjs.Button, { variant: "ghost", onClick: handleCancel, ...cancelButtonProps, children: cancelText }),
96
96
  /* @__PURE__ */ jsxRuntime.jsx(
97
- chunk5WAXZJG5_cjs.Button,
97
+ chunkTP567B3L_cjs.Button,
98
98
  {
99
99
  variant: "primary",
100
100
  loading: confirmLoading,
@@ -139,7 +139,7 @@ var ModalBase = React__namespace.forwardRef(({
139
139
  className: "modal-close",
140
140
  onClick: handleCancel,
141
141
  "aria-label": "Close",
142
- children: closeIcon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkTJII7BQ2_cjs.Icon, { name: "x", size: 16 })
142
+ children: closeIcon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkV272XR3F_cjs.Icon, { name: "x", size: 16 })
143
143
  }
144
144
  )
145
145
  ] }),
@@ -206,9 +206,9 @@ var StaticModalHost = ({
206
206
  }, [destroy, onOk]);
207
207
  const okVariant = kind === "error" ? "danger" : "primary";
208
208
  const mergedFooter = footer !== void 0 ? footer : okCancel ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
209
- /* @__PURE__ */ jsxRuntime.jsx(chunk5WAXZJG5_cjs.Button, { variant: "ghost", onClick: close, ...cancelButtonProps, children: cancelText }),
209
+ /* @__PURE__ */ jsxRuntime.jsx(chunkTP567B3L_cjs.Button, { variant: "ghost", onClick: close, ...cancelButtonProps, children: cancelText }),
210
210
  /* @__PURE__ */ jsxRuntime.jsx(
211
- chunk5WAXZJG5_cjs.Button,
211
+ chunkTP567B3L_cjs.Button,
212
212
  {
213
213
  variant: okVariant,
214
214
  loading: loading || confirmLoading,
@@ -218,7 +218,7 @@ var StaticModalHost = ({
218
218
  }
219
219
  )
220
220
  ] }) : /* @__PURE__ */ jsxRuntime.jsx(
221
- chunk5WAXZJG5_cjs.Button,
221
+ chunkTP567B3L_cjs.Button,
222
222
  {
223
223
  variant: okVariant,
224
224
  loading: loading || confirmLoading,
@@ -239,7 +239,7 @@ var StaticModalHost = ({
239
239
  escClosable: escClosable ?? true,
240
240
  className: `modal-static-overlay ${className}`,
241
241
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-static-body", children: [
242
- icon !== false && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `modal-static-icon ${kind}`, children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkTJII7BQ2_cjs.Icon, { name: staticIconName[kind], size: 20 }) }),
242
+ icon !== false && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `modal-static-icon ${kind}`, children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(chunkV272XR3F_cjs.Icon, { name: staticIconName[kind], size: 20 }) }),
243
243
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "modal-static-content", children: content ?? children })
244
244
  ] })
245
245
  }
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkOQBDU5I2_cjs = require('./chunk-OQBDU5I2.cjs');
4
- var chunkTJII7BQ2_cjs = require('./chunk-TJII7BQ2.cjs');
3
+ var chunkMPVCYU2K_cjs = require('./chunk-MPVCYU2K.cjs');
4
+ var chunkV272XR3F_cjs = require('./chunk-V272XR3F.cjs');
5
5
  require('./tokens-BIIUTPKN.css');
6
6
  require('./shared-NJHRNLRH.css');
7
- require('./Input-3G4ONWNU.css');
7
+ require('./Input-HUBJ55OH.css');
8
8
  var React = require('react');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
 
@@ -73,6 +73,32 @@ var InputBase = React__namespace.forwardRef(
73
73
  e.stopPropagation();
74
74
  if (!disabled) handler(e);
75
75
  } : void 0;
76
+ const renderAffixIcon = (icon, side, handler) => {
77
+ if (icon == null || icon === false) return null;
78
+ const className2 = `${side}${handler ? " interactive" : ""}`;
79
+ if (chunkV272XR3F_cjs.isIconName(icon)) {
80
+ return /* @__PURE__ */ jsxRuntime.jsx(
81
+ chunkV272XR3F_cjs.Icon,
82
+ {
83
+ name: icon,
84
+ size: 14,
85
+ className: className2,
86
+ onClick: handleIconClick(handler)
87
+ }
88
+ );
89
+ }
90
+ return /* @__PURE__ */ jsxRuntime.jsx(
91
+ "span",
92
+ {
93
+ className: className2,
94
+ onClick: handler ? (e) => {
95
+ e.stopPropagation();
96
+ if (!disabled) handler(e);
97
+ } : void 0,
98
+ children: chunkV272XR3F_cjs.renderIconSlot(icon)
99
+ }
100
+ );
101
+ };
76
102
  const handleChange = (e) => {
77
103
  if (!isControlled) setInner(e.target.value);
78
104
  onChange?.(e);
@@ -94,15 +120,7 @@ var InputBase = React__namespace.forwardRef(
94
120
  const showClear = !!allowClear && !!currentValue && !disabled;
95
121
  const count = currentValue ? currentValue.length : 0;
96
122
  const inputElement = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapCls, children: [
97
- leadingIcon && /* @__PURE__ */ jsxRuntime.jsx(
98
- chunkTJII7BQ2_cjs.Icon,
99
- {
100
- name: leadingIcon,
101
- size: 14,
102
- className: `lead${onLeadingIconClick ? " interactive" : ""}`,
103
- onClick: handleIconClick(onLeadingIconClick)
104
- }
105
- ),
123
+ renderAffixIcon(leadingIcon, "lead", onLeadingIconClick),
106
124
  prefix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "input-affix prefix", children: prefix }),
107
125
  /* @__PURE__ */ jsxRuntime.jsx(
108
126
  "input",
@@ -128,18 +146,10 @@ var InputBase = React__namespace.forwardRef(
128
146
  tabIndex: -1,
129
147
  onMouseDown: (e) => e.preventDefault(),
130
148
  onClick: handleClear,
131
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkTJII7BQ2_cjs.Icon, { name: "x", size: 12 })
149
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkV272XR3F_cjs.Icon, { name: "x", size: 12 })
132
150
  }
133
151
  ),
134
- trailingIcon && /* @__PURE__ */ jsxRuntime.jsx(
135
- chunkTJII7BQ2_cjs.Icon,
136
- {
137
- name: trailingIcon,
138
- size: 14,
139
- className: `trail${onTrailingIconClick ? " interactive" : ""}`,
140
- onClick: handleIconClick(onTrailingIconClick)
141
- }
142
- )
152
+ renderAffixIcon(trailingIcon, "trail", onTrailingIconClick)
143
153
  ] });
144
154
  if (!showCount) return inputElement;
145
155
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "input-shell", children: [
@@ -198,7 +208,7 @@ var InputPassword = React__namespace.forwardRef(
198
208
  InputPassword.displayName = "Input.Password";
199
209
  var Input = InputBase;
200
210
  Input.Password = InputPassword;
201
- Input.TextArea = chunkOQBDU5I2_cjs.Textarea;
211
+ Input.TextArea = chunkMPVCYU2K_cjs.Textarea;
202
212
 
203
213
  exports.Input = Input;
204
214
  exports.InputPassword = InputPassword;
@@ -1,4 +1,4 @@
1
- import { Icon } from './chunk-OF3SGLZY.js';
1
+ import { Icon } from './chunk-47VG2P34.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './Textarea-YNET7IBH.css';
@@ -1,7 +1,7 @@
1
- import { Icon } from './chunk-OF3SGLZY.js';
1
+ import { renderIconSlot, Icon } from './chunk-47VG2P34.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
- import './Alert-JJ7GB3UU.css';
4
+ import './Alert-QBKIDY5H.css';
5
5
  import * as React from 'react';
6
6
  import { jsxs, jsx } from 'react/jsx-runtime';
7
7
 
@@ -17,7 +17,7 @@ var Alert = React.forwardRef(({
17
17
  className = "",
18
18
  ...rest
19
19
  }, ref) => {
20
- const iconName = icon ?? (tone === "success" ? "check2" : tone === "warning" || tone === "danger" ? "alert" : "info");
20
+ const iconNode = icon ?? (tone === "success" ? "check2" : tone === "warning" || tone === "danger" ? "alert" : "info");
21
21
  return /* @__PURE__ */ jsxs(
22
22
  "div",
23
23
  {
@@ -26,7 +26,7 @@ var Alert = React.forwardRef(({
26
26
  role: "alert",
27
27
  ...rest,
28
28
  children: [
29
- showIcon && /* @__PURE__ */ jsx("span", { className: "alert-ico", children: /* @__PURE__ */ jsx(Icon, { name: iconName, size: 14 }) }),
29
+ showIcon && /* @__PURE__ */ jsx("span", { className: "alert-ico", children: renderIconSlot(iconNode, { size: 14 }) }),
30
30
  /* @__PURE__ */ jsxs("div", { className: "alert-body", children: [
31
31
  title && /* @__PURE__ */ jsx("div", { className: "alert-title", children: title }),
32
32
  children && /* @__PURE__ */ jsx("div", { className: "alert-desc", children })
@@ -1,4 +1,4 @@
1
- import { Table } from './chunk-AWXCSX6J.js';
1
+ import { Table } from './chunk-BPOOVO5T.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './TablePro-3XVHYLSL.css';
@@ -27,24 +27,95 @@ var FONT_STACKS = {
27
27
  };
28
28
  var DEFAULT_CONFIG = {
29
29
  mode: "light",
30
+ colorScheme: "light",
30
31
  accent: "sky",
31
32
  density: "comfortable",
32
33
  intensity: 5,
33
34
  radius: 20,
34
35
  font: "sf",
35
- tokens: {}
36
+ tokens: {},
37
+ themes: {}
36
38
  };
37
39
  var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
40
+ function isThemeBaseMode(mode) {
41
+ return mode === "light" || mode === "dark";
42
+ }
43
+ function isBuiltInThemeMode(mode) {
44
+ return mode === "light" || mode === "dark" || mode === "system";
45
+ }
46
+ function getThemePreset(themes, mode) {
47
+ if (!mode || isBuiltInThemeMode(mode)) return void 0;
48
+ return themes?.[mode];
49
+ }
50
+ function applyThemePreset(config, mode) {
51
+ const preset = getThemePreset(config.themes, mode);
52
+ if (!preset) {
53
+ return {
54
+ ...config,
55
+ mode,
56
+ colorScheme: isThemeBaseMode(mode) ? mode : config.colorScheme
57
+ };
58
+ }
59
+ return {
60
+ ...config,
61
+ mode,
62
+ colorScheme: preset.base ?? config.colorScheme ?? DEFAULT_CONFIG.colorScheme,
63
+ accent: preset.accent ?? config.accent,
64
+ density: preset.density ?? config.density,
65
+ intensity: preset.intensity ?? config.intensity,
66
+ radius: preset.radius ?? config.radius,
67
+ font: preset.font ?? config.font,
68
+ tokens: preset.tokens ? { ...preset.tokens } : config.tokens
69
+ };
70
+ }
71
+ function resolveThemeConfig(config) {
72
+ const mode = config.mode ?? DEFAULT_CONFIG.mode;
73
+ const themes = config.themes ?? DEFAULT_CONFIG.themes;
74
+ const preset = getThemePreset(themes, mode);
75
+ const presetConfig = preset ? {
76
+ ...preset.base ? { colorScheme: preset.base } : null,
77
+ ...preset.accent ? { accent: preset.accent } : null,
78
+ ...preset.density ? { density: preset.density } : null,
79
+ ...preset.intensity != null ? { intensity: preset.intensity } : null,
80
+ ...preset.radius != null ? { radius: preset.radius } : null,
81
+ ...preset.font ? { font: preset.font } : null
82
+ } : {};
83
+ const merged = {
84
+ ...DEFAULT_CONFIG,
85
+ ...presetConfig,
86
+ ...config,
87
+ mode,
88
+ themes,
89
+ tokens: {
90
+ ...preset?.tokens ?? {},
91
+ ...config.tokens ?? {}
92
+ }
93
+ };
94
+ return {
95
+ ...merged,
96
+ colorScheme: merged.colorScheme ?? preset?.base ?? DEFAULT_CONFIG.colorScheme,
97
+ accent: merged.accent ?? preset?.accent ?? DEFAULT_CONFIG.accent,
98
+ density: merged.density ?? preset?.density ?? DEFAULT_CONFIG.density,
99
+ intensity: merged.intensity ?? preset?.intensity ?? DEFAULT_CONFIG.intensity,
100
+ radius: merged.radius ?? preset?.radius ?? DEFAULT_CONFIG.radius,
101
+ font: merged.font ?? preset?.font ?? DEFAULT_CONFIG.font
102
+ };
103
+ }
38
104
  function resolveThemeMode(mode) {
39
105
  if (mode !== "system") return mode;
40
106
  if (!isBrowser) return "light";
41
107
  return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
42
108
  }
43
- function normalizeAccentInput(input, resolvedMode) {
109
+ function resolveThemeColorScheme(mode, themes, fallback) {
110
+ if (mode === "system") return fallback ?? resolveThemeMode(mode);
111
+ if (isThemeBaseMode(mode)) return mode;
112
+ return getThemePreset(themes, mode)?.base ?? fallback ?? DEFAULT_CONFIG.colorScheme;
113
+ }
114
+ function normalizeAccentInput(input, colorScheme) {
44
115
  if (typeof input === "string" && input in ACCENT_PRESETS) {
45
116
  const key = input;
46
117
  const base = ACCENT_PRESETS[key];
47
- if (resolvedMode === "dark") {
118
+ if (colorScheme === "dark") {
48
119
  return { key, palette: { ...base, ...ACCENT_PRESETS_DARK[key] } };
49
120
  }
50
121
  return { key, palette: base };
@@ -52,18 +123,20 @@ function normalizeAccentInput(input, resolvedMode) {
52
123
  const raw = typeof input === "string" ? { accent: input } : input;
53
124
  const { accent } = raw;
54
125
  const ink = raw.ink ?? `color-mix(in oklch, ${accent} 65%, black)`;
55
- const soft = raw.soft ?? (resolvedMode === "dark" ? `color-mix(in oklch, ${accent} 30%, black)` : `color-mix(in oklch, ${accent} 15%, white)`);
56
- const glow = raw.glow ?? (resolvedMode === "dark" ? `color-mix(in oklch, ${accent} 18%, transparent)` : `color-mix(in oklch, ${accent} 35%, transparent)`);
126
+ const soft = raw.soft ?? (colorScheme === "dark" ? `color-mix(in oklch, ${accent} 30%, black)` : `color-mix(in oklch, ${accent} 15%, white)`);
127
+ const glow = raw.glow ?? (colorScheme === "dark" ? `color-mix(in oklch, ${accent} 18%, transparent)` : `color-mix(in oklch, ${accent} 35%, transparent)`);
57
128
  return { key: "custom", palette: { accent, ink, soft, glow } };
58
129
  }
59
130
  function toVar(key) {
60
131
  return key.startsWith("--") ? key : `--${key}`;
61
132
  }
62
133
  function applyTheme(target, config) {
63
- const cfg = { ...DEFAULT_CONFIG, ...config };
64
- const resolvedMode = resolveThemeMode(cfg.mode);
65
- const { key, palette } = normalizeAccentInput(cfg.accent, resolvedMode);
66
- target.dataset.theme = resolvedMode;
134
+ const cfg = resolveThemeConfig(config);
135
+ resolveThemeMode(cfg.mode);
136
+ const colorScheme = resolveThemeColorScheme(cfg.mode, cfg.themes, cfg.colorScheme);
137
+ const { key, palette } = normalizeAccentInput(cfg.accent, colorScheme);
138
+ target.dataset.theme = colorScheme;
139
+ target.dataset.themeMode = cfg.mode;
67
140
  target.dataset.density = cfg.density;
68
141
  if (key === "custom") {
69
142
  delete target.dataset.accent;
@@ -124,7 +197,8 @@ function loadPersisted(key) {
124
197
  function persist(key, cfg) {
125
198
  if (!key || !isBrowser) return;
126
199
  try {
127
- localStorage.setItem(key, JSON.stringify(cfg));
200
+ const { themes: _themes, ...persisted } = cfg;
201
+ localStorage.setItem(key, JSON.stringify(persisted));
128
202
  } catch {
129
203
  }
130
204
  }
@@ -142,41 +216,69 @@ var ThemeProvider = (props) => {
142
216
  const initialConfig = React.useMemo(() => {
143
217
  const fromProps = {
144
218
  mode: configProps.mode ?? DEFAULT_CONFIG.mode,
219
+ colorScheme: configProps.colorScheme,
145
220
  accent: configProps.accent ?? DEFAULT_CONFIG.accent,
146
221
  density: configProps.density ?? DEFAULT_CONFIG.density,
147
222
  intensity: configProps.intensity ?? DEFAULT_CONFIG.intensity,
148
223
  radius: configProps.radius ?? DEFAULT_CONFIG.radius,
149
224
  font: configProps.font ?? DEFAULT_CONFIG.font,
150
- tokens: configProps.tokens ?? {}
225
+ tokens: configProps.tokens ?? {},
226
+ themes: configProps.themes ?? DEFAULT_CONFIG.themes
151
227
  };
152
228
  const persisted = loadPersisted(storageKey);
153
- return persisted ? { ...fromProps, ...persisted } : fromProps;
229
+ const seeded = applyThemePreset(fromProps, fromProps.mode ?? DEFAULT_CONFIG.mode);
230
+ const withExplicitProps = {
231
+ ...seeded,
232
+ ...configProps.colorScheme ? { colorScheme: configProps.colorScheme } : null,
233
+ ...configProps.accent ? { accent: configProps.accent } : null,
234
+ ...configProps.density ? { density: configProps.density } : null,
235
+ ...configProps.intensity != null ? { intensity: configProps.intensity } : null,
236
+ ...configProps.radius != null ? { radius: configProps.radius } : null,
237
+ ...configProps.font ? { font: configProps.font } : null,
238
+ ...configProps.tokens ? { tokens: configProps.tokens } : null
239
+ };
240
+ if (!persisted) return withExplicitProps;
241
+ const persistedMode = persisted.mode ?? withExplicitProps.mode ?? DEFAULT_CONFIG.mode;
242
+ return {
243
+ ...applyThemePreset({ ...withExplicitProps, mode: persistedMode }, persistedMode),
244
+ ...persisted
245
+ };
154
246
  }, []);
155
247
  const [config, setConfig] = React.useState(initialConfig);
156
248
  React.useEffect(() => {
157
249
  setConfig((c) => {
250
+ const base = {
251
+ ...c,
252
+ themes: configProps.themes ?? c.themes
253
+ };
254
+ const mode = configProps.mode ?? c.mode ?? DEFAULT_CONFIG.mode;
255
+ const nextFromMode = configProps.mode ? applyThemePreset(base, mode) : base;
158
256
  const next = {
159
- mode: configProps.mode ?? c.mode,
160
- accent: configProps.accent ?? c.accent,
161
- density: configProps.density ?? c.density,
162
- intensity: configProps.intensity ?? c.intensity,
163
- radius: configProps.radius ?? c.radius,
164
- font: configProps.font ?? c.font,
165
- tokens: configProps.tokens ?? c.tokens
257
+ ...nextFromMode,
258
+ mode,
259
+ colorScheme: configProps.colorScheme ?? nextFromMode.colorScheme,
260
+ accent: configProps.accent ?? nextFromMode.accent,
261
+ density: configProps.density ?? nextFromMode.density,
262
+ intensity: configProps.intensity ?? nextFromMode.intensity,
263
+ radius: configProps.radius ?? nextFromMode.radius,
264
+ font: configProps.font ?? nextFromMode.font,
265
+ tokens: configProps.tokens ?? nextFromMode.tokens
166
266
  };
167
- if (next.mode === c.mode && next.accent === c.accent && next.density === c.density && next.intensity === c.intensity && next.radius === c.radius && next.font === c.font && next.tokens === c.tokens) {
267
+ if (next.mode === c.mode && next.colorScheme === c.colorScheme && next.accent === c.accent && next.density === c.density && next.intensity === c.intensity && next.radius === c.radius && next.font === c.font && next.tokens === c.tokens && next.themes === c.themes) {
168
268
  return c;
169
269
  }
170
270
  return next;
171
271
  });
172
272
  }, [
173
273
  configProps.mode,
274
+ configProps.colorScheme,
174
275
  configProps.accent,
175
276
  configProps.density,
176
277
  configProps.intensity,
177
278
  configProps.radius,
178
279
  configProps.font,
179
- configProps.tokens
280
+ configProps.tokens,
281
+ configProps.themes
180
282
  ]);
181
283
  const [systemDark, setSystemDark] = React.useState(
182
284
  () => isBrowser && window.matchMedia("(prefers-color-scheme: dark)").matches
@@ -188,32 +290,47 @@ var ThemeProvider = (props) => {
188
290
  mql.addEventListener?.("change", handler);
189
291
  return () => mql.removeEventListener?.("change", handler);
190
292
  }, []);
191
- const resolvedMode = config.mode === "system" ? systemDark ? "dark" : "light" : config.mode;
293
+ const effectiveConfig = React.useMemo(() => resolveThemeConfig(config), [config]);
294
+ const activeTheme = React.useMemo(
295
+ () => getThemePreset(effectiveConfig.themes, effectiveConfig.mode) ?? null,
296
+ [effectiveConfig.mode, effectiveConfig.themes]
297
+ );
298
+ const colorScheme = effectiveConfig.mode === "system" ? systemDark ? "dark" : "light" : isThemeBaseMode(effectiveConfig.mode) ? effectiveConfig.mode : effectiveConfig.colorScheme ?? activeTheme?.base ?? DEFAULT_CONFIG.colorScheme;
299
+ const resolvedMode = effectiveConfig.mode === "system" ? colorScheme : effectiveConfig.mode;
192
300
  const { key: accentKey, palette: accentPalette } = React.useMemo(
193
- () => normalizeAccentInput(config.accent, resolvedMode),
194
- [config.accent, resolvedMode]
301
+ () => normalizeAccentInput(effectiveConfig.accent, colorScheme),
302
+ [effectiveConfig.accent, colorScheme]
195
303
  );
196
304
  const scopeRef = React.useRef(null);
305
+ const appliedTokenKeysRef = React.useRef(/* @__PURE__ */ new Set());
197
306
  React.useEffect(() => {
198
307
  if (!isBrowser) return;
199
308
  const el = target === "root" ? document.documentElement : scopeRef.current;
200
309
  if (!el) return;
201
- applyTheme(el, { ...config, mode: resolvedMode });
310
+ const nextTokenKeys = new Set(Object.keys(effectiveConfig.tokens));
311
+ for (const key of appliedTokenKeysRef.current) {
312
+ if (!nextTokenKeys.has(key)) el.style.removeProperty(toVar(key));
313
+ }
314
+ applyTheme(el, { ...effectiveConfig, colorScheme });
315
+ appliedTokenKeysRef.current = nextTokenKeys;
202
316
  persist(storageKey, config);
203
- }, [config, resolvedMode, target, storageKey]);
317
+ }, [config, effectiveConfig, colorScheme, target, storageKey]);
204
318
  const value = React.useMemo(() => {
205
319
  const patch = (p) => setConfig((c) => ({ ...c, ...p }));
206
320
  return {
207
- mode: config.mode,
321
+ mode: effectiveConfig.mode,
208
322
  resolvedMode,
323
+ colorScheme,
209
324
  accent: accentKey,
210
325
  accentPalette,
211
- density: config.density,
212
- intensity: config.intensity,
213
- radius: config.radius,
214
- font: config.font,
215
- tokens: config.tokens ?? {},
216
- setMode: (m) => patch({ mode: m }),
326
+ density: effectiveConfig.density,
327
+ intensity: effectiveConfig.intensity,
328
+ radius: effectiveConfig.radius,
329
+ font: effectiveConfig.font,
330
+ tokens: effectiveConfig.tokens,
331
+ themes: effectiveConfig.themes,
332
+ activeTheme,
333
+ setMode: (m) => setConfig((c) => applyThemePreset(c, m)),
217
334
  toggleMode: () => setConfig((c) => ({
218
335
  ...c,
219
336
  mode: c.mode === "dark" ? "light" : "dark"
@@ -224,10 +341,11 @@ var ThemeProvider = (props) => {
224
341
  setRadius: (n) => patch({ radius: n }),
225
342
  setFont: (f) => patch({ font: f }),
226
343
  setTokens: (t) => patch({ tokens: t }),
344
+ setThemes: (t) => patch({ themes: t }),
227
345
  update: patch,
228
346
  reset: () => setConfig(initialConfig)
229
347
  };
230
- }, [config, resolvedMode, accentKey, accentPalette, initialConfig]);
348
+ }, [effectiveConfig, resolvedMode, colorScheme, accentKey, accentPalette, activeTheme, initialConfig]);
231
349
  const onChangeRef = React.useRef(onChange);
232
350
  onChangeRef.current = onChange;
233
351
  React.useEffect(() => {
@@ -248,4 +366,4 @@ var ThemeProvider = (props) => {
248
366
  return /* @__PURE__ */ jsx(ThemeCtx.Provider, { value, children });
249
367
  };
250
368
 
251
- export { ACCENT_PRESETS, ACCENT_PRESETS_DARK, FONT_STACKS, ThemeProvider, applyTheme, normalizeAccentInput, resolveThemeMode, useTheme, useThemeOptional };
369
+ export { ACCENT_PRESETS, ACCENT_PRESETS_DARK, FONT_STACKS, ThemeProvider, applyTheme, normalizeAccentInput, resolveThemeColorScheme, resolveThemeMode, useTheme, useThemeOptional };
@@ -1,4 +1,4 @@
1
- import { Icon } from './chunk-OF3SGLZY.js';
1
+ import { Icon } from './chunk-47VG2P34.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './Drawer-IPGB4CXH.css';
@@ -1,4 +1,4 @@
1
- import { Icon } from './chunk-OF3SGLZY.js';
1
+ import { Icon } from './chunk-47VG2P34.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './Collapse-66U5YJFY.css';
@@ -1,4 +1,4 @@
1
- import { Icon } from './chunk-OF3SGLZY.js';
1
+ import { Icon } from './chunk-47VG2P34.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './Message-2MZ3LFPU.css';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkTJII7BQ2_cjs = require('./chunk-TJII7BQ2.cjs');
3
+ var chunkV272XR3F_cjs = require('./chunk-V272XR3F.cjs');
4
4
  require('./tokens-BIIUTPKN.css');
5
5
  require('./shared-NJHRNLRH.css');
6
- require('./Alert-JJ7GB3UU.css');
6
+ require('./Alert-QBKIDY5H.css');
7
7
  var React = require('react');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
 
@@ -39,7 +39,7 @@ var Alert = React__namespace.forwardRef(({
39
39
  className = "",
40
40
  ...rest
41
41
  }, ref) => {
42
- const iconName = icon ?? (tone === "success" ? "check2" : tone === "warning" || tone === "danger" ? "alert" : "info");
42
+ const iconNode = icon ?? (tone === "success" ? "check2" : tone === "warning" || tone === "danger" ? "alert" : "info");
43
43
  return /* @__PURE__ */ jsxRuntime.jsxs(
44
44
  "div",
45
45
  {
@@ -48,13 +48,13 @@ var Alert = React__namespace.forwardRef(({
48
48
  role: "alert",
49
49
  ...rest,
50
50
  children: [
51
- showIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "alert-ico", children: /* @__PURE__ */ jsxRuntime.jsx(chunkTJII7BQ2_cjs.Icon, { name: iconName, size: 14 }) }),
51
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "alert-ico", children: chunkV272XR3F_cjs.renderIconSlot(iconNode, { size: 14 }) }),
52
52
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "alert-body", children: [
53
53
  title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "alert-title", children: title }),
54
54
  children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "alert-desc", children })
55
55
  ] }),
56
56
  action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "alert-action", children: action }),
57
- closable && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "alert-close", onClick: onClose, "aria-label": "Dismiss", children: /* @__PURE__ */ jsxRuntime.jsx(chunkTJII7BQ2_cjs.Icon, { name: "x", size: 12 }) })
57
+ closable && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "alert-close", onClick: onClose, "aria-label": "Dismiss", children: /* @__PURE__ */ jsxRuntime.jsx(chunkV272XR3F_cjs.Icon, { name: "x", size: 12 }) })
58
58
  ]
59
59
  }
60
60
  );
@@ -1,4 +1,4 @@
1
- import { Input } from './chunk-XTIN5545.js';
1
+ import { Input } from './chunk-UKS23N3L.js';
2
2
  import './tokens-BIIUTPKN.css';
3
3
  import './shared-NJHRNLRH.css';
4
4
  import './CommandPalette-T45DBMPY.css';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkTJII7BQ2_cjs = require('./chunk-TJII7BQ2.cjs');
3
+ var chunkV272XR3F_cjs = require('./chunk-V272XR3F.cjs');
4
4
  require('./tokens-BIIUTPKN.css');
5
5
  require('./shared-NJHRNLRH.css');
6
6
  require('./Textarea-YNET7IBH.css');
@@ -86,7 +86,7 @@ var Textarea = React__namespace.forwardRef(
86
86
  tabIndex: -1,
87
87
  onMouseDown: (e) => e.preventDefault(),
88
88
  onClick: handleClear,
89
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkTJII7BQ2_cjs.Icon, { name: "x", size: 12 })
89
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkV272XR3F_cjs.Icon, { name: "x", size: 12 })
90
90
  }
91
91
  )
92
92
  ] });