@fibery/ui-kit 9.0.1 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/lib/a11y-color.js +12 -10
  2. package/lib/actions-menu/actions-menu-item.js +1 -1
  3. package/lib/actions-menu/actions-menu-props.d.ts +2 -0
  4. package/lib/actions-menu/actions-menu-separator.d.ts +2 -2
  5. package/lib/actions-menu/actions-menu-sub-command-menu.js +5 -4
  6. package/lib/actions-menu/actions-menu.d.ts +1 -1
  7. package/lib/actions-menu/actions-menu.js +2 -1
  8. package/lib/actions-menu/contexts/actions-menu-context.js +12 -11
  9. package/lib/actions-menu/index.d.ts +3 -3
  10. package/lib/ai/max-tokens.js +6 -5
  11. package/lib/antd/ant-modal.d.ts +1 -1
  12. package/lib/antd/ant-modal.js +28 -1
  13. package/lib/antd/ant-upload.d.ts +1 -1
  14. package/lib/antd/ant-upload.js +23 -18
  15. package/lib/antd/input-number.js +2 -2
  16. package/lib/antd/input.js +7 -6
  17. package/lib/antd/utils.js +2 -1
  18. package/lib/avatar-colors.js +1 -1
  19. package/lib/avatar.d.ts +1 -10
  20. package/lib/avatar.js +48 -38
  21. package/lib/avatar.wyw-in-js.css +1 -1
  22. package/lib/banner/banner-action.js +2 -1
  23. package/lib/board-table-loader.js +1 -1
  24. package/lib/button/button.js +1 -1
  25. package/lib/button/icon-button.js +1 -1
  26. package/lib/canvas-colors.js +2 -2
  27. package/lib/card-container.d.ts +2 -6
  28. package/lib/card-container.js +5 -5
  29. package/lib/color-filter.js +2 -2
  30. package/lib/color-inspect.js +1 -1
  31. package/lib/color-picker/color-picker-or-loader.d.ts +2 -2
  32. package/lib/color-utils.js +1 -1
  33. package/lib/comment.d.ts +1 -0
  34. package/lib/comment.js +29 -20
  35. package/lib/comment.wyw-in-js.css +9 -7
  36. package/lib/context-menu/index.js +1 -0
  37. package/lib/context-menu/index.wyw-in-js.css +1 -1
  38. package/lib/copy-to-clipboard.js +2 -1
  39. package/lib/date-picker/autocomplete.js +12 -10
  40. package/lib/date-picker/date-range-input.js +9 -7
  41. package/lib/date-picker/day-with-start-end-buttons.js +0 -2
  42. package/lib/date-picker/get-weekends-for-month.js +4 -2
  43. package/lib/date-picker/relative-date-picker.js +5 -3
  44. package/lib/date-picker/single-date-input.js +9 -7
  45. package/lib/date-picker/single-date-picker.d.ts +1 -2
  46. package/lib/date-picker/single-date-picker.js +2 -1
  47. package/lib/date-picker/types.d.ts +1 -2
  48. package/lib/day-select/day-select.js +2 -1
  49. package/lib/day-select/week-day-select.d.ts +2 -2
  50. package/lib/day-select/week-day-select.js +4 -3
  51. package/lib/design-system/alpha.d.ts +6 -0
  52. package/lib/design-system/alpha.js +11 -7
  53. package/lib/design-system/colors-charts.d.ts +4 -0
  54. package/lib/design-system/colors-charts.js +14 -0
  55. package/lib/design-system/colors-js.d.ts +2 -4
  56. package/lib/design-system/colors-js.js +8 -10
  57. package/lib/design-system/fns.enum.js +7 -4
  58. package/lib/design-system/fns.icon.js +1 -1
  59. package/lib/design-system/fns.js +7 -4
  60. package/lib/design-system/theme.d.ts +7 -7
  61. package/lib/design-system/theme.js +7 -12
  62. package/lib/design-system/vars.js +1 -2
  63. package/lib/design-system.d.ts +3 -2
  64. package/lib/design-system.js +3 -2
  65. package/lib/emoji-picker/app-icon-picker.d.ts +2 -2
  66. package/lib/emoji-picker/emoji-picker-content-with-color.d.ts +2 -2
  67. package/lib/emoji-picker/emoji-picker.d.ts +2 -2
  68. package/lib/emoji-picker/icon-emoji-picker.d.ts +1 -2
  69. package/lib/emoji-picker/primitives/content.js +10 -9
  70. package/lib/emoji-picker/primitives/emoji.js +22 -14
  71. package/lib/emoji-picker/primitives/emoji.wyw-in-js.css +4 -3
  72. package/lib/emoji-picker/primitives/grid.js +0 -1
  73. package/lib/emoji-picker/primitives/preview-provider.js +4 -3
  74. package/lib/emoji-picker/primitives/root.js +10 -9
  75. package/lib/emoji-picker/primitives/skin-provider.js +5 -4
  76. package/lib/emoji-picker/stores/emoji-data-store.d.ts +2 -2
  77. package/lib/emoji-picker/stores/emoji-data-store.js +8 -8
  78. package/lib/emoji-picker/stores/static-emoji-data-store.js +2 -1
  79. package/lib/emoji.js +5 -2
  80. package/lib/errors.d.ts +2 -3
  81. package/lib/fibermoji-placeholder.js +5 -7
  82. package/lib/field-type-icon.js +2 -1
  83. package/lib/file-item/file-icon.js +2 -1
  84. package/lib/file-item.js +3 -10
  85. package/lib/guide-link.js +1 -1
  86. package/lib/highlight-colors.js +2 -1
  87. package/lib/hotkey-scope.js +2 -1
  88. package/lib/icons/ast/build.d.ts +5 -0
  89. package/lib/icons/ast/build.js +25 -0
  90. package/lib/icons/ast/index.d.ts +2 -4
  91. package/lib/icons/ast/index.js +5 -7
  92. package/lib/icons/ast/spinner.js +8 -15
  93. package/lib/icons/icon.js +4 -3
  94. package/lib/icons/react/{plus.d.ts → build.d.ts} +4 -4
  95. package/lib/icons/react/{plus.js → build.js} +6 -6
  96. package/lib/icons/react/index.d.ts +2 -4
  97. package/lib/icons/react/index.js +5 -7
  98. package/lib/images-gallery/get-gallery-src.js +1 -1
  99. package/lib/images-gallery/slide-buttons.js +8 -4
  100. package/lib/images-gallery/thumbnails-mime-types-white-list.js +1 -1
  101. package/lib/integration-compact-info-button.js +1 -2
  102. package/lib/is-in-popup.d.ts +1 -2
  103. package/lib/is-in-popup.js +6 -0
  104. package/lib/loaders.d.ts +1 -9
  105. package/lib/loaders.js +2 -39
  106. package/lib/loaders.wyw-in-js.css +2 -4
  107. package/lib/loading-sausage.js +7 -6
  108. package/lib/mobile-drawer.d.ts +2 -1
  109. package/lib/mobile-drawer.js +24 -12
  110. package/lib/mobile-drawer.wyw-in-js.css +4 -3
  111. package/lib/mobile-keyboard-aware-popup.js +6 -5
  112. package/lib/modal-menu/contexts/modal-menu-context.d.ts +1 -0
  113. package/lib/modal-menu/modal-menu-content.d.ts +1 -1
  114. package/lib/modal-menu/modal-menu-content.js +16 -6
  115. package/lib/modal-menu/modal-menu-drawer-content.d.ts +7 -0
  116. package/lib/modal-menu/modal-menu-drawer-content.js +13 -0
  117. package/lib/modal-menu/modal-menu-root.d.ts +2 -1
  118. package/lib/modal-menu/modal-menu-root.js +24 -21
  119. package/lib/modal-menu/modal-submenu.js +10 -9
  120. package/lib/nested-menu-item.d.ts +1 -1
  121. package/lib/number-input/number-input-inline-with-autosize.d.ts +1 -2
  122. package/lib/number-input/number-input-inline-with-autosize.js +9 -6
  123. package/lib/number-input/number-input-inline-with-autosize.wyw-in-js.css +0 -1
  124. package/lib/number-input/number-input.js +13 -11
  125. package/lib/number-input/styles.d.ts +1 -9
  126. package/lib/number-input/styles.js +3 -9
  127. package/lib/number-input/styles.wyw-in-js.css +2 -3
  128. package/lib/number-input/text-area-auto-sized.d.ts +1 -2
  129. package/lib/number-input/text-area-auto-sized.js +2 -2
  130. package/lib/number-input/text-input-auto-sized.d.ts +1 -2
  131. package/lib/number-input/text-input-auto-sized.js +2 -2
  132. package/lib/online-users.js +2 -2
  133. package/lib/open-popover-tracker.js +7 -6
  134. package/lib/palettes/neutral.js +1 -1
  135. package/lib/palettes/warm.js +1 -1
  136. package/lib/phone.js +1 -1
  137. package/lib/popover/index.d.ts +9 -12
  138. package/lib/popover/index.js +66 -75
  139. package/lib/popover/mobile-popover-context.js +12 -11
  140. package/lib/popover/mobile-popover.d.ts +2 -2
  141. package/lib/popover/mobile-popover.js +16 -15
  142. package/lib/popover/modifiers.js +4 -4
  143. package/lib/popover/popup-modifiers-context.d.ts +3 -5
  144. package/lib/preference-setting.js +6 -8
  145. package/lib/reactions/reaction-button.js +36 -25
  146. package/lib/reactions/reaction-button.wyw-in-js.css +16 -16
  147. package/lib/reactions/reaction-picker.js +22 -10
  148. package/lib/reactions/reaction-picker.wyw-in-js.css +1 -0
  149. package/lib/reactions/tootltip.js +2 -1
  150. package/lib/select/components/drop-down-indicator.js +1 -1
  151. package/lib/select/components/menu-list-virtualized.js +1 -1
  152. package/lib/select/components/option.js +2 -1
  153. package/lib/select/index.d.ts +2 -1
  154. package/lib/select/select-in-popover.js +1 -1
  155. package/lib/select/select-trigger.d.ts +4 -0
  156. package/lib/select/select-trigger.js +25 -0
  157. package/lib/select/select-trigger.wyw-in-js.css +1 -0
  158. package/lib/select/select.d.ts +6 -2
  159. package/lib/select/select.js +13 -8
  160. package/lib/select/styles.js +2 -2
  161. package/lib/spinner.d.ts +5 -0
  162. package/lib/spinner.js +17 -0
  163. package/lib/spinner.wyw-in-js.css +1 -0
  164. package/lib/tab-nav/tab-nav.d.ts +4 -2
  165. package/lib/tab-nav/tab-nav.js +2 -2
  166. package/lib/thematic.js +322 -321
  167. package/lib/theme-provider.d.ts +1 -3
  168. package/lib/theme-settings-core.d.ts +13 -1
  169. package/lib/theme-settings-core.js +37 -1
  170. package/lib/theme-settings.d.ts +3 -2
  171. package/lib/theme-settings.js +7 -2
  172. package/lib/toast/toast-action.js +2 -1
  173. package/lib/toast/toast-provider.d.ts +1 -2
  174. package/lib/toast/toast-queue.d.ts +1 -2
  175. package/lib/toast/toast-queue.js +7 -8
  176. package/lib/toast/toast.js +7 -6
  177. package/lib/toggle.js +3 -3
  178. package/lib/tooltip-if-overflown.js +2 -1
  179. package/lib/tooltip.js +1 -1
  180. package/lib/type-badge.d.ts +8 -28
  181. package/lib/type-badge.js +39 -50
  182. package/lib/type-badge.wyw-in-js.css +11 -10
  183. package/lib/unit/container.d.ts +12 -0
  184. package/lib/unit/container.js +50 -0
  185. package/lib/unit/context.d.ts +29 -0
  186. package/lib/unit/context.js +9 -0
  187. package/lib/unit/index.d.ts +4 -2
  188. package/lib/unit/index.js +2 -1
  189. package/lib/unit/nav-button.d.ts +12 -0
  190. package/lib/unit/nav-button.js +18 -0
  191. package/lib/unit/styles.d.ts +6 -9
  192. package/lib/unit/styles.js +13 -16
  193. package/lib/unit/styles.wyw-in-js.css +10 -16
  194. package/lib/unit/unit-content-layout.d.ts +4 -3
  195. package/lib/unit/unit-content-layout.js +9 -9
  196. package/lib/unit/unit-content.d.ts +6 -5
  197. package/lib/unit/unit-content.js +83 -18
  198. package/lib/unit/unit-content.wyw-in-js.css +6 -2
  199. package/lib/unit/unit.d.ts +38 -5
  200. package/lib/unit/unit.js +43 -12
  201. package/lib/use-long-press.d.ts +6 -6
  202. package/lib/with-data.d.ts +35 -37
  203. package/lib/with-data.js +23 -22
  204. package/lib/workflow-progress-icon.js +2 -2
  205. package/package.json +4 -4
  206. package/lib/beta-badge.d.ts +0 -8
  207. package/lib/beta-badge.js +0 -13
  208. package/lib/beta-badge.wyw-in-js.css +0 -1
  209. package/lib/checkbox-multi-select.d.ts +0 -21
  210. package/lib/checkbox-multi-select.js +0 -41
  211. package/lib/checkbox-multi-select.wyw-in-js.css +0 -3
  212. package/lib/country-selector.d.ts +0 -9
  213. package/lib/country-selector.js +0 -21
  214. package/lib/features.d.ts +0 -8
  215. package/lib/features.js +0 -15
  216. package/lib/flags.d.ts +0 -4
  217. package/lib/flags.js +0 -7
  218. package/lib/icons/ast/alert-triangle.d.ts +0 -5
  219. package/lib/icons/ast/alert-triangle.js +0 -25
  220. package/lib/icons/ast/field-units-large.d.ts +0 -5
  221. package/lib/icons/ast/field-units-large.js +0 -25
  222. package/lib/icons/ast/plus.d.ts +0 -5
  223. package/lib/icons/ast/plus.js +0 -25
  224. package/lib/icons/react/alert-triangle.d.ts +0 -15
  225. package/lib/icons/react/alert-triangle.js +0 -21
  226. package/lib/icons/react/field-units-large.d.ts +0 -15
  227. package/lib/icons/react/field-units-large.js +0 -21
  228. package/lib/layout.d.ts +0 -28
  229. package/lib/layout.js +0 -66
  230. package/lib/layout.wyw-in-js.css +0 -2
  231. package/lib/new-card-placeholder.d.ts +0 -26
  232. package/lib/new-card-placeholder.js +0 -141
  233. package/lib/new-card-placeholder.wyw-in-js.css +0 -5
  234. package/lib/unit/primitive.d.ts +0 -5
  235. package/lib/unit/primitive.js +0 -108
  236. package/lib/unit/primitive.wyw-in-js.css +0 -3
  237. package/lib/unit/types.d.ts +0 -34
  238. package/lib/unit/types.js +0 -0
  239. package/lib/unit/unit-button-group.d.ts +0 -13
  240. package/lib/unit/unit-button-group.js +0 -23
package/lib/thematic.js CHANGED
@@ -170,354 +170,355 @@ function Thematic() {
170
170
  canvasCol(sections, "section", "section")
171
171
  ];
172
172
  };
173
- return createPortal(/* @__PURE__ */ jsx(ThemeProvider, {
174
- portal: true,
175
- children: /* @__PURE__ */ jsx("div", {
176
- className: panelCss,
177
- onMouseEnter: () => setHovered(true),
178
- onMouseLeave: () => {
179
- setHovered(false);
180
- state.setPreviewPalette(void 0);
181
- },
182
- children: !expanded ? /* @__PURE__ */ jsx(ColorCoding, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
183
- /* @__PURE__ */ jsx(ScaleGrid, {
184
- isAltPressed: state.isAltPressed,
185
- inspectChannel,
186
- scales: makeScales()
187
- }),
188
- /* @__PURE__ */ jsx("div", {
189
- className: highlightRowCss,
190
- children: highlightHueNames.map((hue) => {
191
- const bg = theme.colors[bgKeyFrom(hue)];
192
- const fg = theme.colors[fgOnBgKeyFrom(hue)];
193
- return /* @__PURE__ */ jsx("div", {
194
- className: highlightSwatchCss,
195
- style: {
196
- background: bg,
197
- color: fg
198
- },
199
- title: hue,
200
- children: "Aa"
201
- }, hue);
202
- })
203
- }),
204
- /* @__PURE__ */ jsxs("div", {
173
+ const panel = /* @__PURE__ */ jsx("div", {
174
+ className: panelCss,
175
+ onMouseEnter: () => setHovered(true),
176
+ onMouseLeave: () => {
177
+ setHovered(false);
178
+ state.setPreviewPalette(void 0);
179
+ },
180
+ children: !expanded ? /* @__PURE__ */ jsx(ColorCoding, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
181
+ /* @__PURE__ */ jsx(ScaleGrid, {
182
+ isAltPressed: state.isAltPressed,
183
+ inspectChannel,
184
+ scales: makeScales()
185
+ }),
186
+ /* @__PURE__ */ jsx("div", {
187
+ className: highlightRowCss,
188
+ children: highlightHueNames.map((hue) => {
189
+ const bg = theme.colors[bgKeyFrom(hue)];
190
+ const fg = theme.colors[fgOnBgKeyFrom(hue)];
191
+ return /* @__PURE__ */ jsx("div", {
192
+ className: highlightSwatchCss,
193
+ style: {
194
+ background: bg,
195
+ color: fg
196
+ },
197
+ title: hue,
198
+ children: "Aa"
199
+ }, hue);
200
+ })
201
+ }),
202
+ /* @__PURE__ */ jsxs("div", {
203
+ style: {
204
+ display: "flex",
205
+ alignItems: "center",
206
+ gap: space.s8,
207
+ minHeight: 28
208
+ },
209
+ children: [/* @__PURE__ */ jsxs("div", {
205
210
  style: {
206
211
  display: "flex",
207
- alignItems: "center",
208
- gap: space.s8,
209
- minHeight: 28
212
+ gap: space.s2,
213
+ flexShrink: 0
210
214
  },
211
- children: [/* @__PURE__ */ jsxs("div", {
215
+ children: [/* @__PURE__ */ jsx(IconButton, {
216
+ size: "small",
217
+ variant: "ghost",
218
+ color: "neutral",
219
+ onClick: handleExport,
220
+ title: "Export",
221
+ children: /* @__PURE__ */ jsx(FileDownload, {})
222
+ }), /* @__PURE__ */ jsx(IconButton, {
223
+ size: "small",
224
+ variant: "ghost",
225
+ color: "neutral",
226
+ onClick: handleImport,
227
+ title: "Import",
228
+ children: /* @__PURE__ */ jsx(FileUpload, {})
229
+ })]
230
+ }), state.hoveredInfo && (() => {
231
+ const [hex, hsl, oklch] = inspectColor(state.hoveredInfo.color, { separator: " " }).split(" ");
232
+ return /* @__PURE__ */ jsxs("div", {
212
233
  style: {
213
- display: "flex",
214
- gap: space.s2,
215
- flexShrink: 0
234
+ display: "grid",
235
+ gridTemplateColumns: "auto 1fr",
236
+ columnGap: space.s8,
237
+ fontFamily: "monospace",
238
+ fontSize: 11,
239
+ lineHeight: "14px",
240
+ color: themeVars.colorTextSecondary
216
241
  },
217
- children: [/* @__PURE__ */ jsx(IconButton, {
218
- size: "small",
219
- variant: "ghost",
220
- color: "neutral",
221
- onClick: handleExport,
222
- title: "Export",
223
- children: /* @__PURE__ */ jsx(FileDownload, {})
224
- }), /* @__PURE__ */ jsx(IconButton, {
225
- size: "small",
226
- variant: "ghost",
227
- color: "neutral",
228
- onClick: handleImport,
229
- title: "Import",
230
- children: /* @__PURE__ */ jsx(FileUpload, {})
231
- })]
232
- }), state.hoveredInfo && (() => {
233
- const [hex, hsl, oklch] = inspectColor(state.hoveredInfo.color, { separator: " " }).split(" ");
234
- return /* @__PURE__ */ jsxs("div", {
235
- style: {
236
- display: "grid",
237
- gridTemplateColumns: "auto 1fr",
238
- columnGap: space.s8,
239
- fontFamily: "monospace",
240
- fontSize: 11,
241
- lineHeight: "14px",
242
- color: themeVars.colorTextSecondary
243
- },
244
- children: [
245
- /* @__PURE__ */ jsx("span", { children: hsl }),
246
- /* @__PURE__ */ jsx("span", { children: hex }),
247
- /* @__PURE__ */ jsx("span", { children: oklch?.replace("oklch", "lch") })
248
- ]
249
- });
250
- })()]
251
- }),
252
- /* @__PURE__ */ jsxs("div", {
253
- className: slidersCss,
254
- children: [
255
- /* @__PURE__ */ jsx("div", { className: sectionSeparatorCss }),
256
- /* @__PURE__ */ jsx("div", {
257
- className: sectionLabelCss,
258
- style: { fontWeight: 700 },
259
- children: "palette"
260
- }),
261
- /* @__PURE__ */ jsxs("div", {
262
- className: sectionLabelCss,
263
- children: ["base", state.prefs ? " *" : ""]
264
- }),
265
- /* @__PURE__ */ jsx("div", {
266
- className: controlRowCss,
267
- children: /* @__PURE__ */ jsx(ArrayEditor, {
268
- label: "L",
269
- values: state.baseCurves.lightness,
270
- onChange: (L) => state.setBaseCurves({
271
- ...state.baseCurves,
272
- lightness: L
273
- }),
274
- onLabelHover: inspL,
275
- onLabelLeave: inspOff
276
- })
277
- }),
278
- /* @__PURE__ */ jsx(ArraySlider, {
279
- label: state.prefs?.baseChroma !== void 0 ? "C *" : "C",
280
- values: state.baseCurves.chroma,
281
- onValuesChange: (C) => state.setBaseCurves({
242
+ children: [
243
+ /* @__PURE__ */ jsx("span", { children: hsl }),
244
+ /* @__PURE__ */ jsx("span", { children: hex }),
245
+ /* @__PURE__ */ jsx("span", { children: oklch?.replace("oklch", "lch") })
246
+ ]
247
+ });
248
+ })()]
249
+ }),
250
+ /* @__PURE__ */ jsxs("div", {
251
+ className: slidersCss,
252
+ children: [
253
+ /* @__PURE__ */ jsx("div", { className: sectionSeparatorCss }),
254
+ /* @__PURE__ */ jsx("div", {
255
+ className: sectionLabelCss,
256
+ style: { fontWeight: 700 },
257
+ children: "palette"
258
+ }),
259
+ /* @__PURE__ */ jsxs("div", {
260
+ className: sectionLabelCss,
261
+ children: ["base", state.prefs ? " *" : ""]
262
+ }),
263
+ /* @__PURE__ */ jsx("div", {
264
+ className: controlRowCss,
265
+ children: /* @__PURE__ */ jsx(ArrayEditor, {
266
+ label: "L",
267
+ values: state.baseCurves.lightness,
268
+ onChange: (L) => state.setBaseCurves({
282
269
  ...state.baseCurves,
283
- chroma: C
270
+ lightness: L
284
271
  }),
285
- sliderValue: state.prefsPresent.baseChroma ?? 0,
286
- onSliderChange: (v) => state.update({ baseChroma: v }),
287
- min: 0,
288
- max: .25,
289
- step: .001,
290
- gradient: chromaGradient(state.prefsPresent.baseHue ?? 0, .25),
291
- color: oklchColor(state.prefsPresent.baseHue ?? 0, state.prefsPresent.baseChroma ?? 0),
292
- onLabelHover: inspC,
272
+ onLabelHover: inspL,
293
273
  onLabelLeave: inspOff
274
+ })
275
+ }),
276
+ /* @__PURE__ */ jsx(ArraySlider, {
277
+ label: state.prefs?.baseChroma !== void 0 ? "C *" : "C",
278
+ values: state.baseCurves.chroma,
279
+ onValuesChange: (C) => state.setBaseCurves({
280
+ ...state.baseCurves,
281
+ chroma: C
294
282
  }),
295
- /* @__PURE__ */ jsx(Slider, {
296
- label: state.prefs?.baseHue !== void 0 ? "H *" : "H",
297
- value: state.prefsPresent.baseHue ?? 0,
298
- min: 0,
299
- max: 360,
300
- step: 1,
301
- onChange: (v) => state.update({ baseHue: v }),
302
- gradient: hueGradient(state.prefsPresent.baseChroma ?? 0),
303
- color: oklchColor(state.prefsPresent.baseHue ?? 0, state.prefsPresent.baseChroma ?? 0),
304
- onLabelHover: inspH,
305
- onLabelLeave: inspOff
306
- }),
307
- /* @__PURE__ */ jsxs("div", {
308
- className: sectionLabelCss,
309
- children: ["accent", state.prefs ? " *" : ""]
310
- }),
311
- /* @__PURE__ */ jsx("div", {
312
- className: controlRowCss,
313
- children: /* @__PURE__ */ jsx(ArrayEditor, {
314
- label: "L",
315
- values: state.accentCurves.lightness,
316
- onChange: (L) => state.setAccentCurves({
317
- ...state.accentCurves,
318
- lightness: L
319
- }),
320
- onLabelHover: inspL,
321
- onLabelLeave: inspOff
322
- })
323
- }),
324
- /* @__PURE__ */ jsx(ArraySlider, {
325
- label: state.prefs?.accentChroma !== void 0 ? "C *" : "C",
326
- values: state.accentCurves.chroma,
327
- onValuesChange: (C) => state.setAccentCurves({
283
+ sliderValue: state.prefsPresent.baseChroma ?? 0,
284
+ onSliderChange: (v) => state.update({ baseChroma: v }),
285
+ min: 0,
286
+ max: .25,
287
+ step: .001,
288
+ gradient: chromaGradient(state.prefsPresent.baseHue ?? 0, .25),
289
+ color: oklchColor(state.prefsPresent.baseHue ?? 0, state.prefsPresent.baseChroma ?? 0),
290
+ onLabelHover: inspC,
291
+ onLabelLeave: inspOff
292
+ }),
293
+ /* @__PURE__ */ jsx(Slider, {
294
+ label: state.prefs?.baseHue !== void 0 ? "H *" : "H",
295
+ value: state.prefsPresent.baseHue ?? 0,
296
+ min: 0,
297
+ max: 360,
298
+ step: 1,
299
+ onChange: (v) => state.update({ baseHue: v }),
300
+ gradient: hueGradient(state.prefsPresent.baseChroma ?? 0),
301
+ color: oklchColor(state.prefsPresent.baseHue ?? 0, state.prefsPresent.baseChroma ?? 0),
302
+ onLabelHover: inspH,
303
+ onLabelLeave: inspOff
304
+ }),
305
+ /* @__PURE__ */ jsxs("div", {
306
+ className: sectionLabelCss,
307
+ children: ["accent", state.prefs ? " *" : ""]
308
+ }),
309
+ /* @__PURE__ */ jsx("div", {
310
+ className: controlRowCss,
311
+ children: /* @__PURE__ */ jsx(ArrayEditor, {
312
+ label: "L",
313
+ values: state.accentCurves.lightness,
314
+ onChange: (L) => state.setAccentCurves({
328
315
  ...state.accentCurves,
329
- chroma: C
316
+ lightness: L
330
317
  }),
331
- sliderValue: state.prefsPresent.accentChroma,
332
- onSliderChange: (v) => state.update({ accentChroma: v }),
333
- min: .05,
334
- max: .25,
335
- step: .001,
336
- gradient: chromaGradient(state.prefsPresent.accentHue, .25),
337
- color: oklchColor(state.prefsPresent.accentHue, state.prefsPresent.accentChroma),
338
- onLabelHover: inspC,
339
- onLabelLeave: inspOff
340
- }),
341
- /* @__PURE__ */ jsx(Slider, {
342
- label: state.prefs?.accentHue !== void 0 ? "H *" : "H",
343
- value: state.prefsPresent.accentHue,
344
- min: 0,
345
- max: 360,
346
- step: 1,
347
- onChange: (v) => state.update({ accentHue: v }),
348
- gradient: hueGradient(state.prefsPresent.accentChroma),
349
- color: oklchColor(state.prefsPresent.accentHue, state.prefsPresent.accentChroma),
350
- onLabelHover: inspH,
318
+ onLabelHover: inspL,
351
319
  onLabelLeave: inspOff
320
+ })
321
+ }),
322
+ /* @__PURE__ */ jsx(ArraySlider, {
323
+ label: state.prefs?.accentChroma !== void 0 ? "C *" : "C",
324
+ values: state.accentCurves.chroma,
325
+ onValuesChange: (C) => state.setAccentCurves({
326
+ ...state.accentCurves,
327
+ chroma: C
352
328
  }),
353
- /* @__PURE__ */ jsxs("div", {
354
- className: sectionLabelCss,
355
- children: ["hue shift", state.prefs?.hueShiftTargetHue !== void 0 || state.prefs?.hueShiftAmount !== void 0 ? " *" : ""]
356
- }),
357
- /* @__PURE__ */ jsx(Slider, {
358
- label: state.prefs?.hueShiftTargetHue !== void 0 ? "target H *" : "target H",
359
- value: state.prefsPresent.hueShiftTargetHue ?? state.prefsPresent.baseHue ?? 0,
360
- min: 0,
361
- max: 360,
362
- step: 1,
363
- onChange: (v) => state.updateHueShift({ hueShiftTargetHue: v }),
364
- gradient: hueGradient(.15),
365
- color: oklchColor(state.prefsPresent.hueShiftTargetHue ?? state.prefsPresent.baseHue ?? 0, .15)
366
- }),
367
- /* @__PURE__ */ jsx(Slider, {
368
- label: state.prefs?.hueShiftAmount !== void 0 ? "amount *" : "amount",
369
- value: state.prefsPresent.hueShiftAmount ?? Math.min((state.prefsPresent.baseChroma ?? 0) * 2, .3),
370
- min: 0,
371
- max: 1,
372
- step: .01,
373
- onChange: (v) => state.updateHueShift({ hueShiftAmount: v })
374
- }),
375
- /* @__PURE__ */ jsx("div", { className: sectionSeparatorCss }),
376
- /* @__PURE__ */ jsxs("div", {
377
- className: sectionLabelCss,
378
- style: { fontWeight: 700 },
379
- children: [
380
- "deneutralize (",
381
- state.showDark ? "dark" : "light",
382
- ")",
383
- state.prefs?.filter || state.customPalette?.deneutralize ? " *" : ""
384
- ]
385
- }),
386
- /* @__PURE__ */ jsx(Slider, {
387
- label: "hue shift H",
388
- value: deneutralizeSpec?.hueShift?.targetHue ?? 0,
389
- min: 0,
390
- max: 360,
391
- step: 1,
392
- onChange: (v) => state.updateFilter({ hueShift: {
393
- targetHue: v,
394
- amount: deneutralizeSpec?.hueShift?.amount ?? 0
395
- } }),
396
- gradient: hueGradient(.15),
397
- color: oklchColor(deneutralizeSpec?.hueShift?.targetHue ?? 0, .15)
398
- }),
399
- /* @__PURE__ */ jsx(Slider, {
400
- label: "hue shift amt",
401
- value: deneutralizeSpec?.hueShift?.amount ?? 0,
402
- min: 0,
403
- max: 1,
404
- step: .01,
405
- onChange: (v) => state.updateFilter({ hueShift: {
406
- targetHue: deneutralizeSpec?.hueShift?.targetHue ?? 0,
407
- amount: v
408
- } })
409
- }),
410
- /* @__PURE__ */ jsx(Slider, {
411
- label: "oklch L",
412
- value: deneutralizeSpec?.oklchL ?? 1,
413
- min: 0,
414
- max: 2,
415
- step: .01,
416
- onChange: (v) => state.updateFilter({ oklchL: v })
417
- }),
418
- /* @__PURE__ */ jsx(Slider, {
419
- label: "oklch C",
420
- value: deneutralizeSpec?.oklchC ?? 1,
421
- min: 0,
422
- max: 3,
423
- step: .01,
424
- onChange: (v) => state.updateFilter({ oklchC: v })
425
- }),
426
- /* @__PURE__ */ jsx(SwatchAdjustSection, { state }),
427
- /* @__PURE__ */ jsx(CvdSection, { state }),
428
- /* @__PURE__ */ jsx(HighlightSection, { state })
429
- ]
430
- }),
431
- /* @__PURE__ */ jsx("div", { className: sectionSeparatorCss }),
432
- /* @__PURE__ */ jsxs("div", {
433
- className: buttonsCss,
434
- style: { justifyContent: "space-between" },
435
- children: [/* @__PURE__ */ jsx("div", {
329
+ sliderValue: state.prefsPresent.accentChroma,
330
+ onSliderChange: (v) => state.update({ accentChroma: v }),
331
+ min: .05,
332
+ max: .25,
333
+ step: .001,
334
+ gradient: chromaGradient(state.prefsPresent.accentHue, .25),
335
+ color: oklchColor(state.prefsPresent.accentHue, state.prefsPresent.accentChroma),
336
+ onLabelHover: inspC,
337
+ onLabelLeave: inspOff
338
+ }),
339
+ /* @__PURE__ */ jsx(Slider, {
340
+ label: state.prefs?.accentHue !== void 0 ? "H *" : "H",
341
+ value: state.prefsPresent.accentHue,
342
+ min: 0,
343
+ max: 360,
344
+ step: 1,
345
+ onChange: (v) => state.update({ accentHue: v }),
346
+ gradient: hueGradient(state.prefsPresent.accentChroma),
347
+ color: oklchColor(state.prefsPresent.accentHue, state.prefsPresent.accentChroma),
348
+ onLabelHover: inspH,
349
+ onLabelLeave: inspOff
350
+ }),
351
+ /* @__PURE__ */ jsxs("div", {
352
+ className: sectionLabelCss,
353
+ children: ["hue shift", state.prefs?.hueShiftTargetHue !== void 0 || state.prefs?.hueShiftAmount !== void 0 ? " *" : ""]
354
+ }),
355
+ /* @__PURE__ */ jsx(Slider, {
356
+ label: state.prefs?.hueShiftTargetHue !== void 0 ? "target H *" : "target H",
357
+ value: state.prefsPresent.hueShiftTargetHue ?? state.prefsPresent.baseHue ?? 0,
358
+ min: 0,
359
+ max: 360,
360
+ step: 1,
361
+ onChange: (v) => state.updateHueShift({ hueShiftTargetHue: v }),
362
+ gradient: hueGradient(.15),
363
+ color: oklchColor(state.prefsPresent.hueShiftTargetHue ?? state.prefsPresent.baseHue ?? 0, .15)
364
+ }),
365
+ /* @__PURE__ */ jsx(Slider, {
366
+ label: state.prefs?.hueShiftAmount !== void 0 ? "amount *" : "amount",
367
+ value: state.prefsPresent.hueShiftAmount ?? Math.min((state.prefsPresent.baseChroma ?? 0) * 2, .3),
368
+ min: 0,
369
+ max: 1,
370
+ step: .01,
371
+ onChange: (v) => state.updateHueShift({ hueShiftAmount: v })
372
+ }),
373
+ /* @__PURE__ */ jsx("div", { className: sectionSeparatorCss }),
374
+ /* @__PURE__ */ jsxs("div", {
375
+ className: sectionLabelCss,
376
+ style: { fontWeight: 700 },
377
+ children: [
378
+ "deneutralize (",
379
+ state.showDark ? "dark" : "light",
380
+ ")",
381
+ state.prefs?.filter || state.customPalette?.deneutralize ? " *" : ""
382
+ ]
383
+ }),
384
+ /* @__PURE__ */ jsx(Slider, {
385
+ label: "hue shift H",
386
+ value: deneutralizeSpec?.hueShift?.targetHue ?? 0,
387
+ min: 0,
388
+ max: 360,
389
+ step: 1,
390
+ onChange: (v) => state.updateFilter({ hueShift: {
391
+ targetHue: v,
392
+ amount: deneutralizeSpec?.hueShift?.amount ?? 0
393
+ } }),
394
+ gradient: hueGradient(.15),
395
+ color: oklchColor(deneutralizeSpec?.hueShift?.targetHue ?? 0, .15)
396
+ }),
397
+ /* @__PURE__ */ jsx(Slider, {
398
+ label: "hue shift amt",
399
+ value: deneutralizeSpec?.hueShift?.amount ?? 0,
400
+ min: 0,
401
+ max: 1,
402
+ step: .01,
403
+ onChange: (v) => state.updateFilter({ hueShift: {
404
+ targetHue: deneutralizeSpec?.hueShift?.targetHue ?? 0,
405
+ amount: v
406
+ } })
407
+ }),
408
+ /* @__PURE__ */ jsx(Slider, {
409
+ label: "oklch L",
410
+ value: deneutralizeSpec?.oklchL ?? 1,
411
+ min: 0,
412
+ max: 2,
413
+ step: .01,
414
+ onChange: (v) => state.updateFilter({ oklchL: v })
415
+ }),
416
+ /* @__PURE__ */ jsx(Slider, {
417
+ label: "oklch C",
418
+ value: deneutralizeSpec?.oklchC ?? 1,
419
+ min: 0,
420
+ max: 3,
421
+ step: .01,
422
+ onChange: (v) => state.updateFilter({ oklchC: v })
423
+ }),
424
+ /* @__PURE__ */ jsx(SwatchAdjustSection, { state }),
425
+ /* @__PURE__ */ jsx(CvdSection, { state }),
426
+ /* @__PURE__ */ jsx(HighlightSection, { state })
427
+ ]
428
+ }),
429
+ /* @__PURE__ */ jsx("div", { className: sectionSeparatorCss }),
430
+ /* @__PURE__ */ jsxs("div", {
431
+ className: buttonsCss,
432
+ style: { justifyContent: "space-between" },
433
+ children: [/* @__PURE__ */ jsx("div", {
434
+ style: {
435
+ display: "flex",
436
+ gap: space.s4
437
+ },
438
+ children: /* @__PURE__ */ jsx(IconButton, {
439
+ size: "small",
440
+ variant: state.pinned && !state.isAltPressed ? "soft" : "ghost",
441
+ color: "neutral",
442
+ onClick: () => state.isAltPressed ? state.setVisible(false) : state.setPinned(!state.pinned),
443
+ title: state.isAltPressed ? "Close" : state.pinned ? "Unpin" : "Pin",
444
+ children: state.isAltPressed ? /* @__PURE__ */ jsx(Close, {}) : state.pinned ? /* @__PURE__ */ jsx(PinFilled, {}) : /* @__PURE__ */ jsx(Pin, {})
445
+ })
446
+ }), /* @__PURE__ */ jsxs("div", {
447
+ style: {
448
+ display: "flex",
449
+ gap: space.s4
450
+ },
451
+ children: [state.isAltPressed ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
452
+ size: "small",
453
+ variant: state.staticPalette ? "solid" : "soft",
454
+ color: "error",
455
+ onClick: state.cycleStaticPalettes,
456
+ title: "Static palettes",
457
+ children: /* @__PURE__ */ jsx(Lab, {})
458
+ }), /* @__PURE__ */ jsx(IconButton, {
459
+ size: "small",
460
+ variant: "soft",
461
+ color: "accent",
462
+ onClick: state.randomize,
463
+ title: "Randomize",
464
+ children: /* @__PURE__ */ jsx(Refresh, {})
465
+ })] }) : /* @__PURE__ */ jsxs("div", {
436
466
  style: {
437
467
  display: "flex",
438
468
  gap: space.s4
439
469
  },
440
- children: /* @__PURE__ */ jsx(IconButton, {
470
+ onMouseLeave: () => state.setPreviewPalette(void 0),
471
+ children: [state.isModified ? /* @__PURE__ */ jsx(IconButton, {
441
472
  size: "small",
442
- variant: state.pinned && !state.isAltPressed ? "soft" : "ghost",
473
+ variant: "ghost",
443
474
  color: "neutral",
444
- onClick: () => state.isAltPressed ? state.setVisible(false) : state.setPinned(!state.pinned),
445
- title: state.isAltPressed ? "Close" : state.pinned ? "Unpin" : "Pin",
446
- children: state.isAltPressed ? /* @__PURE__ */ jsx(Close, {}) : state.pinned ? /* @__PURE__ */ jsx(PinFilled, {}) : /* @__PURE__ */ jsx(Pin, {})
447
- })
448
- }), /* @__PURE__ */ jsxs("div", {
449
- style: {
450
- display: "flex",
451
- gap: space.s4
452
- },
453
- children: [state.isAltPressed ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
454
- size: "small",
455
- variant: state.staticPalette ? "solid" : "soft",
456
- color: "error",
457
- onClick: state.cycleStaticPalettes,
458
- title: "Static palettes",
459
- children: /* @__PURE__ */ jsx(Lab, {})
460
- }), /* @__PURE__ */ jsx(IconButton, {
461
- size: "small",
462
- variant: "soft",
463
- color: "accent",
464
- onClick: state.randomize,
465
- title: "Randomize",
466
- children: /* @__PURE__ */ jsx(Refresh, {})
467
- })] }) : /* @__PURE__ */ jsxs("div", {
468
- style: {
469
- display: "flex",
470
- gap: space.s4
475
+ onClick: () => {
476
+ state.setPreviewPalette(void 0);
477
+ state.reset();
471
478
  },
472
- onMouseLeave: () => state.setPreviewPalette(void 0),
473
- children: [state.isModified ? /* @__PURE__ */ jsx(IconButton, {
479
+ onMouseEnter: () => state.setPreviewPalette(null),
480
+ title: "Defaults",
481
+ children: /* @__PURE__ */ jsx(Undo, {})
482
+ }) : null, (() => {
483
+ const shown = Boolean(state.previewPalette) ? !warm : warm;
484
+ return /* @__PURE__ */ jsx(IconButton, {
474
485
  size: "small",
475
- variant: "ghost",
486
+ variant: shown ? "soft" : "ghost",
476
487
  color: "neutral",
477
488
  onClick: () => {
478
489
  state.setPreviewPalette(void 0);
479
- state.reset();
490
+ if (state.isModified) state.reset();
491
+ setWarm(!warm);
480
492
  },
481
- onMouseEnter: () => state.setPreviewPalette(null),
482
- title: "Defaults",
483
- children: /* @__PURE__ */ jsx(Undo, {})
484
- }) : null, (() => {
485
- const shown = Boolean(state.previewPalette) ? !warm : warm;
486
- return /* @__PURE__ */ jsx(IconButton, {
487
- size: "small",
488
- variant: shown ? "soft" : "ghost",
489
- color: "neutral",
490
- onClick: () => {
491
- state.setPreviewPalette(void 0);
492
- if (state.isModified) state.reset();
493
- setWarm(!warm);
493
+ onMouseEnter: () => state.setPreviewPalette(selectPalette({
494
+ warmLook: !warm,
495
+ isArchitect: state.providerPalette.key.includes("arch")
496
+ })),
497
+ title: warm ? "warm → neutral" : "neutral → warm",
498
+ children: /* @__PURE__ */ jsx("span", {
499
+ style: {
500
+ fontSize: 11,
501
+ fontWeight: 600
494
502
  },
495
- onMouseEnter: () => state.setPreviewPalette(selectPalette({
496
- warmLook: !warm,
497
- isArchitect: state.providerPalette.key.includes("arch")
498
- })),
499
- title: warm ? "warm → neutral" : "neutral → warm",
500
- children: /* @__PURE__ */ jsx("span", {
501
- style: {
502
- fontSize: 11,
503
- fontWeight: 600
504
- },
505
- children: shown ? "W" : "N"
506
- })
507
- });
508
- })()]
509
- }), /* @__PURE__ */ jsx(IconButton, {
510
- size: "small",
511
- variant: "ghost",
512
- color: "neutral",
513
- onClick: state.cycleTheme,
514
- title: state.isAltPressed ? "auto" : state.themePref,
515
- children: themeIcons[state.isAltPressed ? "auto" : state.themePref]
516
- })]
503
+ children: shown ? "W" : "N"
504
+ })
505
+ });
506
+ })()]
507
+ }), /* @__PURE__ */ jsx(IconButton, {
508
+ size: "small",
509
+ variant: "ghost",
510
+ color: "neutral",
511
+ onClick: state.cycleTheme,
512
+ title: state.isAltPressed ? "auto" : state.themePref,
513
+ children: themeIcons[state.isAltPressed ? "auto" : state.themePref]
517
514
  })]
518
- })
519
- ] })
520
- })
515
+ })]
516
+ })
517
+ ] })
518
+ });
519
+ return createPortal(/* @__PURE__ */ jsx(ThemeProvider, {
520
+ portal: true,
521
+ children: panel
521
522
  }), document.body);
522
523
  }
523
524
  //#endregion