@orangelogic/design-system 3.18.0 → 3.20.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 (138) hide show
  1. package/library/chunks/{asset-link-format.Bk1qHIQA.js → asset-link-format.BnE0FbUH.js} +6 -6
  2. package/library/chunks/{button.DCyoZrRj.js → button.D1YIxtv-.js} +1 -1
  3. package/library/chunks/{color-swatch-group.BtVbKp-v.js → color-swatch-group.GEu5gVrg.js} +4788 -4335
  4. package/library/chunks/{color-swatch.DxxOpJXT.js → color-swatch.DdsUysbF.js} +1 -1
  5. package/library/chunks/{confirm-popover.-_1n24v-.js → confirm-popover.CJXyEa5A.js} +3 -3
  6. package/library/chunks/{dialog.Dl9aHLD4.js → dialog.BbQ4Du0M.js} +2 -2
  7. package/library/chunks/{document-viewer.B-jtpLuD.js → document-viewer.Bkf3JbWk.js} +7 -7
  8. package/library/chunks/{dot-pagination.BNoG-qx7.js → dot-pagination.CJRAtM51.js} +1 -1
  9. package/library/chunks/{folder-select.DWaC4EWa.js → folder-select.D8_6pC8Y.js} +4 -4
  10. package/library/chunks/gradient.CIzq8fOU.js +176 -0
  11. package/library/chunks/{header.v8maWlzT.js → header.BioJzPlg.js} +1 -1
  12. package/library/chunks/{i18n.CNnI4-0K.js → i18n.rtxrs1c1.js} +11 -3
  13. package/library/chunks/{icon-button.5-oAlIkv.js → icon-button.CbUddcgI.js} +1 -1
  14. package/library/chunks/{iframe.DOwG9Q7o.js → iframe.y7iCAVZP.js} +1 -1
  15. package/library/chunks/{image.BSh7WAGF.js → image.A2hE1WoV.js} +1 -1
  16. package/library/chunks/{index.Byin4Jfx.js → index.Ct-dh3Y5.js} +14 -14
  17. package/library/chunks/{input.Csf-S2nB.js → input.D1FFprPl.js} +1 -1
  18. package/library/chunks/{markdown.b03AOvFT.js → markdown.Dd_GFJK8.js} +2 -2
  19. package/library/chunks/{menu-item.HtTWOcq4.js → menu-item.0TbnDEDp.js} +1 -1
  20. package/library/chunks/{option.DgxoCq1j.js → option.CyorNG0S.js} +17 -17
  21. package/library/chunks/{pagination.C9NblxKt.js → pagination.D0BeaEIi.js} +5 -5
  22. package/library/chunks/{tab-group.B6Aej-jM.js → tab-group.C98CWzEH.js} +4 -4
  23. package/library/chunks/{toast.BxiewnAG.js → toast.CGIDPKV8.js} +1 -1
  24. package/library/chunks/{transformation.CjWnFhab.js → transformation.OaRYixzE.js} +11 -12
  25. package/library/chunks/{tree.pId63hLe.js → tree.DB-QLic1.js} +4 -7
  26. package/library/chunks/{types.Fkwo_sYp.js → types.DrJgdbwu.js} +13853 -14165
  27. package/library/components/alert.js +2 -2
  28. package/library/components/asset-link-format.js +4 -4
  29. package/library/components/atoms.js +15 -15
  30. package/library/components/audio.js +3 -3
  31. package/library/components/border-input-group.js +2 -2
  32. package/library/components/breadcrumb.js +1 -1
  33. package/library/components/button.js +2 -2
  34. package/library/components/color-picker.js +971 -337
  35. package/library/components/color-swatch-group.js +5 -5
  36. package/library/components/color-swatch.js +2 -2
  37. package/library/components/confirm-popover.js +4 -4
  38. package/library/components/copy-button.js +1 -1
  39. package/library/components/corner-position-input-group.js +3 -3
  40. package/library/components/date-calendar.js +1 -1
  41. package/library/components/details.js +1 -1
  42. package/library/components/dialog.js +3 -3
  43. package/library/components/document-viewer.js +3 -3
  44. package/library/components/dot-pagination.js +2 -2
  45. package/library/components/drawer.js +2 -2
  46. package/library/components/dropdown.js +2 -2
  47. package/library/components/dynamic-select.js +4 -4
  48. package/library/components/e-chart.js +1 -1
  49. package/library/components/element-clamp.js +2 -2
  50. package/library/components/file-on-demand.js +9 -9
  51. package/library/components/folder-select.js +4 -4
  52. package/library/components/format-bytes.js +1 -1
  53. package/library/components/format-date.js +1 -1
  54. package/library/components/format-number.js +1 -1
  55. package/library/components/format-time.js +1 -1
  56. package/library/components/header.js +2 -2
  57. package/library/components/icon-button.js +2 -2
  58. package/library/components/iframe.js +2 -2
  59. package/library/components/image-comparer.js +1 -1
  60. package/library/components/image.js +2 -2
  61. package/library/components/input.js +2 -2
  62. package/library/components/line-clamp.js +1 -1
  63. package/library/components/markdown.js +3 -3
  64. package/library/components/masonry.js +2 -2
  65. package/library/components/menu-item.js +2 -2
  66. package/library/components/menu.js +2 -2
  67. package/library/components/molecules.js +3 -3
  68. package/library/components/mutation-observer.js +1 -1
  69. package/library/components/option.js +2 -2
  70. package/library/components/organisms.js +2 -2
  71. package/library/components/padding-input-group.js +1 -1
  72. package/library/components/pagination.js +6 -6
  73. package/library/components/popup.js +1 -1
  74. package/library/components/position-picker.js +1 -1
  75. package/library/components/progress-bar.js +1 -1
  76. package/library/components/progress-ring.js +1 -1
  77. package/library/components/range.js +1 -1
  78. package/library/components/rating.js +1 -1
  79. package/library/components/relative-time.js +1 -1
  80. package/library/components/select.js +2 -2
  81. package/library/components/shadow-input-group.js +1 -1
  82. package/library/components/share-option-list.js +1 -1
  83. package/library/components/sidebar.js +1 -1
  84. package/library/components/size-input-group.js +3 -3
  85. package/library/components/spinner.js +1 -1
  86. package/library/components/split-panel.js +1 -1
  87. package/library/components/tab-group.js +5 -5
  88. package/library/components/tab.js +2 -2
  89. package/library/components/tag.js +2 -2
  90. package/library/components/tooltip.js +1 -1
  91. package/library/components/tree-item.js +2 -2
  92. package/library/components/tree.js +2 -2
  93. package/library/components/typeface.js +2 -2
  94. package/library/components/types.js +209 -200
  95. package/library/components/video.js +3 -3
  96. package/library/package.json +1 -1
  97. package/library/packages/atoms/src/components/audio/audio.d.ts +0 -1
  98. package/library/packages/atoms/src/components/color-picker/color-picker.d.ts +160 -2
  99. package/library/packages/atoms/src/components/color-picker/components/gradient-slider/gradient-slider.d.ts +80 -0
  100. package/library/packages/atoms/src/components/color-picker/components/gradient-slider/gradient-slider.styles.d.ts +2 -0
  101. package/library/packages/atoms/src/components/color-picker/components/gradient-stop-list/gradient-stop-list.d.ts +85 -0
  102. package/library/packages/atoms/src/components/color-picker/components/gradient-stop-list/gradient-stop-list.styles.d.ts +2 -0
  103. package/library/packages/atoms/src/components/input/input.d.ts +1 -1
  104. package/library/packages/atoms/src/components/option/option.d.ts +1 -1
  105. package/library/packages/atoms/src/components/tree/tree.d.ts +2 -2
  106. package/library/packages/atoms/src/components/video/video.d.ts +0 -1
  107. package/library/packages/events/src/cx-gradient-change.d.ts +10 -0
  108. package/library/packages/events/src/cx-gradient-stop-add.d.ts +9 -0
  109. package/library/packages/events/src/cx-gradient-stop-change.d.ts +10 -0
  110. package/library/packages/events/src/cx-gradient-stop-remove.d.ts +8 -0
  111. package/library/packages/events/src/cx-gradient-stop-select.d.ts +8 -0
  112. package/library/packages/events/src/cx-keydown.d.ts +4 -1
  113. package/library/packages/events/src/events.d.ts +5 -0
  114. package/library/packages/molecules/src/multi-select/components/board/board.d.ts +58 -2
  115. package/library/packages/molecules/src/multi-select/components/board-list-item/board-list-item.d.ts +14 -0
  116. package/library/packages/molecules/src/multi-select/controllers/filter-controller.d.ts +68 -0
  117. package/library/packages/molecules/src/multi-select/multi-select.d.ts +211 -0
  118. package/library/packages/molecules/src/multi-select/utils/base.d.ts +44 -0
  119. package/library/packages/molecules/src/multi-select/utils/reconcile.d.ts +57 -0
  120. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +11 -32
  121. package/library/packages/organisms/src/content-builder/blocks/audio/audio.d.ts +0 -1
  122. package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +4 -27
  123. package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +0 -12
  124. package/library/packages/organisms/src/content-builder/content-builder.d.ts +0 -150
  125. package/library/packages/organisms/src/content-builder/content-builder.utils.d.ts +0 -20
  126. package/library/packages/organisms/src/content-builder/plugins/wrapper-container.d.ts +0 -11
  127. package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +2 -10
  128. package/library/packages/types/src/board.d.ts +25 -0
  129. package/library/packages/types/src/color-picker.d.ts +35 -2
  130. package/library/packages/utils/src/custom-element/i18n.d.ts +8 -0
  131. package/library/packages/utils/src/gradient/gradient.d.ts +65 -0
  132. package/library/packages/utils/src/gradient/index.d.ts +1 -0
  133. package/library/packages/utils/src/index.d.ts +1 -0
  134. package/library/packages/utils/src/transformation/transformation.d.ts +0 -2
  135. package/library/react-web-component.d.ts +493 -473
  136. package/library/utils.js +127 -118
  137. package/package.json +1 -1
  138. package/library/packages/molecules/src/multi-select/multi-select.utils.d.ts +0 -3
@@ -1,13 +1,13 @@
1
1
  import { _ as kd, a as Sa, b as Be, c as Je } from "../chunks/inheritsLoose.BuSn_CvZ.js";
2
2
  import { c as ps, a as Bn } from "../chunks/_commonjsHelpers.DQNKXVTB.js";
3
3
  import { r as Sb } from "../chunks/___vite-browser-external_commonjs-proxy.C2tf3HsQ.js";
4
- import { C as Cb } from "../chunks/image.BSh7WAGF.js";
4
+ import { C as Cb } from "../chunks/image.A2hE1WoV.js";
5
5
  import Mb from "./resize-observer.js";
6
6
  import { r as Db, R as Pb, a as Rp, b as Lb } from "../chunks/resizable-component.styles.CAfXABBc.js";
7
7
  import { c as Rb } from "../chunks/component.styles.CAS3c9pM.js";
8
8
  import { b as Ib } from "../chunks/browser.BHOCIF_A.js";
9
9
  import { c as Ob } from "../chunks/custom-element.L4WJXn1j.js";
10
- import { L as kb } from "../chunks/i18n.CNnI4-0K.js";
10
+ import { L as kb } from "../chunks/i18n.rtxrs1c1.js";
11
11
  import { w as Ki } from "../chunks/watch.DJF5K-8U.js";
12
12
  import { i as Bb, x as Qc } from "../chunks/lit-element.jLBm65_O.js";
13
13
  import { n as Ri } from "../chunks/lib-cortex-element.CVMmyPMC.js";
@@ -46983,7 +46983,7 @@ let bt = class extends Pb {
46983
46983
  onLoadedMetadata() {
46984
46984
  this.isLoaded = !0, this.videoWidth = this.player?.videoWidth() || 0, this.videoHeight = this.player?.videoHeight() || 0, this.emit("cx-loaded-metadata", {
46985
46985
  detail: this
46986
- }), this.emit("cx-load");
46986
+ });
46987
46987
  }
46988
46988
  onError() {
46989
46989
  this.isLoaded = !0, this.emit("cx-error");
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "3.18.0",
4
+ "version": "3.20.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -19,7 +19,6 @@ import { default as CxTypography } from '../typography/typography';
19
19
  * @event cx-pause - Emitted when playback pauses.
20
20
  * @event {{ time: number }} cx-time-update - Emitted while the playback position changes. `time` is relative to `in-point` (starts at 0).
21
21
  * @event cx-ended - Emitted when playback reaches the end (or out-point when set).
22
- * @event cx-load - Emitted once the waveform has loaded and the player is ready; pairs with `cx-error` so a consumer can wait for either outcome.
23
22
  * @event cx-error - Emitted when the audio or waveform image fails to load.
24
23
  *
25
24
  * @csspart base - The main container.
@@ -1,13 +1,20 @@
1
1
  import { CortexFormControl, default as CortexElement } from '../../../../base/src/cortex-element.ts';
2
- import { ColorFormat } from '../../../../types/src/color-picker';
2
+ import { ColorFormat, ColorPickerMode, GradientType } from '../../../../types/src/color-picker';
3
3
  import { CSSResultGroup } from 'lit';
4
4
  import { default as CxButton } from '../button/button';
5
5
  import { default as CxButtonGroup } from '../button-group/button-group';
6
6
  import { default as CxDropdown } from '../dropdown/dropdown';
7
7
  import { default as CxIcon } from '../icon/icon';
8
8
  import { default as CxInput } from '../input/input';
9
+ import { default as CxOption } from '../option/option';
10
+ import { default as CxSelect } from '../select/select';
9
11
  import { default as CxSpinner } from '../spinner/spinner';
12
+ import { default as CxTab } from '../tab/tab';
13
+ import { default as CxTabGroup } from '../tab-group/tab-group';
14
+ import { default as CxTabPanel } from '../tab-panel/tab-panel';
10
15
  import { default as CxVisuallyHidden } from '../visually-hidden/visually-hidden';
16
+ import { default as CxGradientSlider } from './components/gradient-slider/gradient-slider';
17
+ import { default as CxGradientStopList } from './components/gradient-stop-list/gradient-stop-list';
11
18
 
12
19
  /**
13
20
  * @summary Color pickers allow the user to select a color.
@@ -52,6 +59,15 @@ import { default as CxVisuallyHidden } from '../visually-hidden/visually-hidden'
52
59
  * @csspart format-button__label - The format button’s exported `label` part.
53
60
  * @csspart format-button__suffix - The format button’s exported `suffix` part.
54
61
  * @csspart format-button__caret - The format button’s exported `caret` part.
62
+ * @csspart gradient-slider - The gradient preview bar shown in the Gradient tab.
63
+ * @csspart gradient-track - The gradient slider’s exported `track` part.
64
+ * @csspart gradient-marker - The gradient slider’s exported `marker` part.
65
+ * @csspart gradient-stop-list - The list of editable stop rows.
66
+ * @csspart gradient-stop-row - The stop list’s exported `row` part.
67
+ * @csspart gradient-add-stop-button - The stop list’s exported `add-button` part.
68
+ * @csspart gradient-delete-stop-button - The stop list’s exported `delete-button` part.
69
+ * @csspart gradient-type-select - The gradient type select (Linear / Radial).
70
+ * @csspart gradient-angle-input - The gradient angle input.
55
71
  *
56
72
  * @cssproperty --grid-width - The width of the color grid.
57
73
  * @cssproperty --grid-height - The height of the color grid.
@@ -73,9 +89,16 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
73
89
  'cx-button': typeof CxButton;
74
90
  'cx-button-group': typeof CxButtonGroup;
75
91
  'cx-dropdown': typeof CxDropdown;
92
+ 'cx-gradient-slider': typeof CxGradientSlider;
93
+ 'cx-gradient-stop-list': typeof CxGradientStopList;
76
94
  'cx-icon': typeof CxIcon;
77
95
  'cx-input': typeof CxInput;
96
+ 'cx-option': typeof CxOption;
97
+ 'cx-select': typeof CxSelect;
78
98
  'cx-spinner': typeof CxSpinner;
99
+ 'cx-tab': typeof CxTab;
100
+ 'cx-tab-group': typeof CxTabGroup;
101
+ 'cx-tab-panel': typeof CxTabPanel;
79
102
  'cx-visually-hidden': typeof CxVisuallyHidden;
80
103
  };
81
104
  private readonly formControlController;
@@ -85,6 +108,7 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
85
108
  input: CxInput;
86
109
  opacityInput: CxInput;
87
110
  dropdown: CxDropdown;
111
+ tabGroup: CxTabGroup;
88
112
  previewButton: HTMLButtonElement;
89
113
  trigger: HTMLButtonElement;
90
114
  private hasFocus;
@@ -96,6 +120,14 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
96
120
  private saturation;
97
121
  private brightness;
98
122
  private alpha;
123
+ /** The gradient being edited in the Gradient tab. */
124
+ private gradientValue;
125
+ /** The id of the gradient stop that the color controls currently edit. */
126
+ private activeStopId;
127
+ /** `swatches` parsed into a list, derived whenever that property changes. */
128
+ private parsedSwatches;
129
+ /** `customSwatches` parsed into a list, derived whenever that property changes. */
130
+ private parsedCustomSwatches;
99
131
  /**
100
132
  * The current value of the color picker. The value's format will vary based the `format` attribute. To get the value
101
133
  * in a specific format, use the `getFormattedValue()` method. The value is submitted as a name/value pair with form
@@ -128,6 +160,21 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
128
160
  emitFormat: ColorFormat | undefined;
129
161
  /** Renders the color picker inline rather than in a dropdown. */
130
162
  inline: boolean;
163
+ /**
164
+ * Adds a Gradient tab alongside the Solid tab. When the Gradient tab is active, `value` holds a
165
+ * CSS gradient string (e.g. `linear-gradient(90deg, #f00 0%, #00f 100%)`) instead of a single color.
166
+ */
167
+ gradient: boolean;
168
+ /**
169
+ * Which editing surface is active. Set automatically when `value` is assigned a gradient string,
170
+ * and when the user switches tabs. Has no effect unless `gradient` is enabled.
171
+ */
172
+ mode: ColorPickerMode;
173
+ /**
174
+ * The gradient types offered in the Gradient tab.
175
+ * Pass a space-separated string (e.g., "linear radial") or an array of gradient type values.
176
+ */
177
+ gradientTypes: GradientType[];
131
178
  /** Determines the size of the color picker's trigger. This has no effect on inline color pickers. */
132
179
  size: 'small' | 'medium' | 'large';
133
180
  /** Removes the button that lets users toggle between format. */
@@ -178,10 +225,21 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
178
225
  * Pairing value with emitFormat attribute. This is used to emit the value in a wanted format.
179
226
  */
180
227
  emitValue: string;
181
- /** Gets the validity state object */
228
+ /**
229
+ * Gets the validity state object.
230
+ *
231
+ * The text input lives in the Solid tab's controls, so it is absent while the Gradient tab
232
+ * is showing. `FormControlController` still polls this, so fall back to the host's own
233
+ * validity rather than dereferencing a missing input.
234
+ */
182
235
  get validity(): ValidityState;
183
236
  /** Gets the validation message */
184
237
  get validationMessage(): string;
238
+ /**
239
+ * Validity for the states this component can judge without the text input: a required
240
+ * control needs a value.
241
+ */
242
+ private get formValidity();
185
243
  constructor();
186
244
  runFirstUpdated(): void;
187
245
  private handleCopy;
@@ -208,6 +266,49 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
208
266
  private parseColor;
209
267
  private setColor;
210
268
  private setLetterCase;
269
+ /**
270
+ * Adopts an externally assigned CSS gradient string as the current gradient.
271
+ * @param value - The gradient string, already known to be parseable in shape.
272
+ */
273
+ private adoptGradientValue;
274
+ /** True when the Gradient tab is enabled and active. */
275
+ private get isGradientMode();
276
+ /** The gradient stop the color controls currently edit, if any. */
277
+ private get activeStop();
278
+ /**
279
+ * Writes the current HSVA state into the active stop and republishes `value` as a CSS
280
+ * gradient string.
281
+ * @param currentColor - The parsed color represented by the current HSVA state.
282
+ */
283
+ private syncGradientValue;
284
+ /**
285
+ * Formats the active stop's color for the text input, honoring the current format.
286
+ * @param currentColor - The parsed color represented by the current HSVA state.
287
+ * @returns The formatted color string.
288
+ */
289
+ private getStopInputValue;
290
+ /**
291
+ * Loads a stop's color into the HSVA controls without writing back to `value`.
292
+ * @param stop - The stop to load.
293
+ */
294
+ private loadStopIntoControls;
295
+ /**
296
+ * Publishes the current gradient as `value` without letting the `value` watcher re-adopt
297
+ * it. Re-adopting would re-parse the string and mint fresh stop ids, which destroys the
298
+ * marker being dragged; `isSafeValue` is the existing guard for "this component wrote
299
+ * `value` itself", and it must always be cleared again once the update settles.
300
+ */
301
+ private publishGradientValue;
302
+ /**
303
+ * Replaces the gradient's stops, republishes `value`, and keeps the active stop valid.
304
+ * @param stops - The next set of stops.
305
+ */
306
+ private applyGradientStops;
307
+ /**
308
+ * Seeds a two-stop gradient from the current solid color so switching to the Gradient tab
309
+ * starts from something visible rather than an empty bar.
310
+ */
311
+ private seedGradientFromCurrentColor;
211
312
  private syncValues;
212
313
  private handleAfterHide;
213
314
  private handleEyeDropper;
@@ -222,8 +323,39 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
222
323
  */
223
324
  private getFormatFromValue;
224
325
  private stopNestedEventPropagation;
326
+ private handleTabShow;
327
+ /** Moves editing to the Gradient tab, seeding stops on first use. */
328
+ private switchToGradientMode;
329
+ /** Moves editing back to the Solid tab, keeping the active stop's color. */
330
+ private switchToSolidMode;
331
+ private handleGradientStopSelect;
332
+ private handleGradientStopAdd;
333
+ private handleGradientStopRemove;
334
+ private handleGradientStopChange;
335
+ private handleGradientChange;
336
+ private handleGradientTypeSelect;
337
+ private handleGradientTypeChange;
338
+ private handleGradientAngleInput;
225
339
  handleFormatChange(): void;
226
340
  handleOpacityChange(): void;
341
+ /**
342
+ * Parses a swatch list once per change rather than on every render. `render()` used to
343
+ * split and filter these strings itself, which repeated the work on every update — and
344
+ * the gradient tab re-renders on every pointer move while a stop is dragged.
345
+ * @param value - The raw property value, either a delimited string or an array.
346
+ * @returns The individual color strings.
347
+ */
348
+ private parseSwatchList;
349
+ handleSwatchesChange(): void;
350
+ handleCustomSwatchesChange(): void;
351
+ /**
352
+ * Keeps the tab group in step when `mode` is set programmatically (for example by assigning a
353
+ * gradient string to `value`). Without this the panel stays hidden, and a hidden panel has no
354
+ * layout, so the grid and sliders inside it would measure zero.
355
+ */
356
+ handleModeChange(): Promise<void>;
357
+ /** Selects the tab panel matching the current mode. */
358
+ private syncTabToMode;
227
359
  handleValueChange(oldValue: string | undefined, newValue: string): void;
228
360
  /** Sets focus on the color picker. */
229
361
  focus(options?: FocusOptions): void;
@@ -240,6 +372,32 @@ export default class CxColorPicker extends CortexElement implements CortexFormCo
240
372
  /** Sets a custom validation message. Pass an empty string to restore validity. */
241
373
  setCustomValidity(message: string): void;
242
374
  renderSwatches(swatches: string[]): ("" | import('lit').TemplateResult<1>)[];
375
+ /**
376
+ * Renders one gradient type toggle. The type travels on a data attribute so the click
377
+ * handler can stay a bound method rather than a per-render arrow function.
378
+ * @param type - The gradient type this button selects.
379
+ */
380
+ /**
381
+ * Returns a gradient type's user-facing name.
382
+ * @param type - The gradient type to label.
383
+ */
384
+ private getGradientTypeLabel;
385
+ /**
386
+ * Renders the gradient type selector and, for linear gradients, the angle input.
387
+ */
388
+ private renderGradientOptions;
389
+ /**
390
+ * Renders the shared color controls, wrapped in a Solid / Gradient tab group when the
391
+ * gradient tab is enabled. When it is not, the controls render exactly as they always have,
392
+ * so existing consumers see an unchanged DOM.
393
+ */
394
+ private renderTabsOrControls;
395
+ /**
396
+ * Renders the color grid, hue/alpha sliders, and the text inputs. These controls are shared
397
+ * by both tabs: in Solid mode they edit `value` directly, and in Gradient mode they edit the
398
+ * active gradient stop.
399
+ */
400
+ private renderColorControls;
243
401
  render(): import('lit').TemplateResult<1>;
244
402
  }
245
403
  declare global {
@@ -0,0 +1,80 @@
1
+ import { default as CortexElement } from '../../../../../../base/src/cortex-element.ts';
2
+ import { GradientStop } from '../../../../../../types/src/color-picker';
3
+ import { CSSResultGroup } from 'lit';
4
+
5
+ /**
6
+ * @summary Renders a gradient preview bar with draggable stop markers.
7
+ *
8
+ * @description An internal building block for `cx-color-picker`'s gradient tab. The bar is a
9
+ * preview plus a positioning control: markers select and reposition stops, while adding and
10
+ * removing them belongs to the stop list beside it. The component is fully controlled — it
11
+ * renders the `stops` it is given and reports intent through events, and every event carries
12
+ * the complete next set of stops so the owner can assign it straight back to `stops`.
13
+ *
14
+ * @event {{ id: string }} cx-gradient-stop-select - Emitted when a marker becomes the active stop.
15
+ * @event {{ stops: GradientStop[] }} cx-gradient-stop-change - Emitted continuously while a marker is dragged.
16
+ * @event {{ stops: GradientStop[] }} cx-gradient-change - Emitted when a position change is committed.
17
+ * @event {{ id: string }} cx-gradient-stop-remove - Emitted when a stop is removed with the keyboard.
18
+ *
19
+ * @csspart base - The component's base wrapper.
20
+ * @csspart track - The gradient preview bar.
21
+ * @csspart marker - Each individual stop marker.
22
+ *
23
+ * @cssproperty [--gradient-track-height=28px] - The height of the gradient bar.
24
+ * @cssproperty [--gradient-marker-size=20px] - The size of each stop marker.
25
+ * @cssproperty [--gradient-marker-tail=6px] - The size of the marker's pointer tail.
26
+ */
27
+ export default class CxGradientSlider extends CortexElement {
28
+ static readonly styles: CSSResultGroup;
29
+ private readonly localize;
30
+ /** The gradient's color stops. Rendered in sorted order without mutating the input. */
31
+ stops: GradientStop[];
32
+ /** The id of the stop currently being edited. */
33
+ activeStopId: string;
34
+ /** Disables interaction with the markers. */
35
+ disabled: boolean;
36
+ /** The id of the marker being dragged, used only to drive the grabbing cursor. */
37
+ private draggingStopId;
38
+ /** False once the gradient is down to the minimum number of stops. */
39
+ private get canRemoveStop();
40
+ /**
41
+ * Selects a stop, making it the target of the picker's color controls.
42
+ * @param id - The stop to select.
43
+ */
44
+ private selectStop;
45
+ /**
46
+ * Moves a stop to a new position and reports the resulting set of stops.
47
+ * @param id - The stop to move.
48
+ * @param position - The new position, clamped to 0-100.
49
+ * @param commit - Whether this is the final position rather than an intermediate drag frame.
50
+ */
51
+ private moveStop;
52
+ /**
53
+ * Removes a stop, refusing when doing so would leave fewer than the minimum.
54
+ * @param id - The stop to remove.
55
+ */
56
+ private removeStop;
57
+ /**
58
+ * Converts a pointer offset within the bar into a stop position.
59
+ * @param offsetX - The pointer's horizontal offset from the bar's left edge.
60
+ * @param trackWidth - The bar's rendered width.
61
+ * @returns The equivalent position, 0-100.
62
+ */
63
+ private getPositionFromOffset;
64
+ private handleMarkerPointerDown;
65
+ private handleMarkerKeyDown;
66
+ /**
67
+ * Builds the CSS gradient shown on the bar. The preview is always left-to-right regardless
68
+ * of the gradient's real type, because the bar represents the gradient line itself rather
69
+ * than its rendered orientation.
70
+ * @param sortedStops - The stops in ascending position order.
71
+ * @returns A CSS gradient string.
72
+ */
73
+ private getTrackBackground;
74
+ render(): import('lit').TemplateResult<1>;
75
+ }
76
+ declare global {
77
+ interface HTMLElementTagNameMap {
78
+ 'cx-gradient-slider': CxGradientSlider;
79
+ }
80
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: import('lit').CSSResult;
2
+ export default _default;
@@ -0,0 +1,85 @@
1
+ import { default as CortexElement } from '../../../../../../base/src/cortex-element.ts';
2
+ import { GradientStop } from '../../../../../../types/src/color-picker';
3
+ import { CSSResultGroup } from 'lit';
4
+ import { default as CxButton } from '../../../button/button';
5
+ import { default as CxDropdown } from '../../../dropdown/dropdown';
6
+ import { default as CxIcon } from '../../../icon/icon';
7
+ import { default as CxIconButton } from '../../../icon-button/icon-button';
8
+ import { default as CxInput } from '../../../input/input';
9
+
10
+ /**
11
+ * @summary Lists a gradient's color stops as editable rows.
12
+ *
13
+ * @description An internal building block for `cx-color-picker`'s gradient tab. Each row edits
14
+ * one stop's hex, opacity, and position, and can delete it. Like `cx-gradient-slider`, the
15
+ * component is fully controlled and every event carries the complete next set of stops.
16
+ *
17
+ * @event {{ id: string }} cx-gradient-stop-select - Emitted when a row becomes the active stop.
18
+ * @event {{ color: string, position: number }} cx-gradient-stop-add - Emitted when a stop is added.
19
+ * @event {{ id: string }} cx-gradient-stop-remove - Emitted when a stop is deleted.
20
+ * @event {{ stops: GradientStop[] }} cx-gradient-change - Emitted when a row's field is committed.
21
+ *
22
+ * @csspart base - The component's base wrapper.
23
+ * @csspart header - The row holding the title and the add button.
24
+ * @csspart add-button - The button that appends a stop.
25
+ * @csspart row - Each stop's row.
26
+ * @csspart hex-input - A row's hex input.
27
+ * @csspart swatch - A row's color chip.
28
+ * @csspart opacity-input - A row's opacity input.
29
+ * @csspart position-input - A row's position input.
30
+ * @csspart delete-button - A row's delete button.
31
+ *
32
+ * @cssproperty [--stop-swatch-size=28px] - The size of each row's color chip.
33
+ * @cssproperty [--stop-list-max-height=168px] - The height at which the rows start scrolling.
34
+ */
35
+ export default class CxGradientStopList extends CortexElement {
36
+ static readonly styles: CSSResultGroup;
37
+ static readonly dependencies: {
38
+ 'cx-button': typeof CxButton;
39
+ 'cx-dropdown': typeof CxDropdown;
40
+ 'cx-icon': typeof CxIcon;
41
+ 'cx-icon-button': typeof CxIconButton;
42
+ 'cx-input': typeof CxInput;
43
+ };
44
+ private readonly localize;
45
+ /** The gradient's color stops. Rendered in sorted order without mutating the input. */
46
+ stops: GradientStop[];
47
+ /** The id of the stop currently being edited. */
48
+ activeStopId: string;
49
+ /** Disables every control in the list. */
50
+ disabled: boolean;
51
+ /** False once the gradient is down to the minimum number of stops. */
52
+ private get canRemoveStop();
53
+ /**
54
+ * Reads a row's stop id from the element that raised an event.
55
+ * @param event - The event whose `currentTarget` carries the id.
56
+ * @returns The stop id, or an empty string when the attribute is missing.
57
+ */
58
+ private getStopId;
59
+ /**
60
+ * Replaces one stop and reports the resulting set.
61
+ * @param id - The stop to change.
62
+ * @param changes - The fields to overwrite.
63
+ */
64
+ private commitStopChange;
65
+ private handleRowClick;
66
+ private handleAddClick;
67
+ private handleDropdownClick;
68
+ private handlePickerInput;
69
+ private handleDeleteClick;
70
+ private handleHexChange;
71
+ private handleOpacityChange;
72
+ private handlePositionChange;
73
+ /**
74
+ * Renders one stop's row of fields.
75
+ * @param stop - The stop this row edits.
76
+ * @param index - The stop's position in the sorted list, used for labelling.
77
+ */
78
+ private renderRow;
79
+ render(): import('lit').TemplateResult<1>;
80
+ }
81
+ declare global {
82
+ interface HTMLElementTagNameMap {
83
+ 'cx-gradient-stop-list': CxGradientStopList;
84
+ }
85
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: import('lit').CSSResult;
2
+ export default _default;
@@ -21,7 +21,7 @@ import { default as CxIcon } from '../icon/icon';
21
21
  * @event cx-focus - Emitted when the control gains focus.
22
22
  * @event cx-input - Emitted when the control receives input.
23
23
  * @event cx-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
24
- * @event cx-keydown - Emitted when a key is pressed down on the control.
24
+ * @event {{ event: KeyboardEvent; value: string }} cx-keydown - Emitted when a key is pressed down on the control.
25
25
  *
26
26
  * @csspart form-control - The form control that wraps the label, input, and help text.
27
27
  * @csspart form-control-label - The label’s wrapper.
@@ -19,7 +19,7 @@ import { default as CxSpace } from '../space/space';
19
19
  * @csspart suffix - The container that wraps the suffix.
20
20
  *
21
21
  * @cssproperty [--option-color=var(--cx-color-neutral-700)] - The option's color.
22
- * @cssproperty [--option-current-background-color=transparent] - The background color of the option under the keyboard cursor (`aria-activedescendant`). Only one option is current at a time, and it is not necessarily the selected one.
22
+ * @cssproperty [--option-current-background-color=var(--cx-menu-item-background-color-hover)] - The background color of the option under the keyboard cursor (`aria-activedescendant`). Only one option is current at a time, and it is not necessarily the selected one.
23
23
  * @cssproperty [--option-font-weight=var(--cx-font-weight-regular)] - The option's font weight.
24
24
  * @cssproperty [--option-help-text-color=var(--cx-color-neutral-600)] - The option's help text color.
25
25
  * @cssproperty [--option-help-text-font-weight=var(--cx-font-weight-regular)] - The option's help text font weight.
@@ -1,7 +1,7 @@
1
1
  import { default as CortexElement } from '../../../../base/src/cortex-element.ts';
2
2
  import { TreeSelection } from '../../../../types/src/tree';
3
3
  import { ExpandButtonPlacement, TreeItemVariant } from '../../../../types/src/tree-item';
4
- import { CSSResultGroup } from 'lit';
4
+ import { CSSResultGroup, PropertyValues } from 'lit';
5
5
  import { default as Sortable } from 'sortablejs';
6
6
  import { default as CxTreeItem } from '../tree-item/tree-item';
7
7
 
@@ -144,7 +144,7 @@ export default class CxTree extends CortexElement {
144
144
  handleSortableEnd(): void;
145
145
  private initSortable;
146
146
  handleSelectionChange(): Promise<void>;
147
- handleSortableChange(): Promise<void>;
147
+ protected updated(changedProperties: PropertyValues): void;
148
148
  /**
149
149
  * Returns the list of tree items that are selected in the tree.
150
150
  *
@@ -21,7 +21,6 @@ import { VideoJsPlayer } from './videojs/index.js';
21
21
  * @event cx-ended - Emitted when playback reaches the end.
22
22
  * @event cx-seeked - Emitted after a seek operation.
23
23
  * @event cx-loaded-metadata - Emitted when metadata is loaded.
24
- * @event cx-load - Emitted once the media is ready, alongside `cx-loaded-metadata`; pairs with `cx-error` so a consumer can wait for either outcome.
25
24
  * @event cx-error - Emitted when the video fails to load.
26
25
  *
27
26
  * @slot placeholder - The placeholder element, shown while the `src` is not set.
@@ -0,0 +1,10 @@
1
+ import { GradientStop } from '../../types/src/color-picker';
2
+
3
+ export type CxGradientChangeEvent = CustomEvent<{
4
+ stops: GradientStop[];
5
+ }>;
6
+ declare global {
7
+ interface GlobalEventHandlersEventMap {
8
+ 'cx-gradient-change': CxGradientChangeEvent;
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ export type CxGradientStopAddEvent = CustomEvent<{
2
+ color: string;
3
+ position: number;
4
+ }>;
5
+ declare global {
6
+ interface GlobalEventHandlersEventMap {
7
+ 'cx-gradient-stop-add': CxGradientStopAddEvent;
8
+ }
9
+ }
@@ -0,0 +1,10 @@
1
+ import { GradientStop } from '../../types/src/color-picker';
2
+
3
+ export type CxGradientStopChangeEvent = CustomEvent<{
4
+ stops: GradientStop[];
5
+ }>;
6
+ declare global {
7
+ interface GlobalEventHandlersEventMap {
8
+ 'cx-gradient-stop-change': CxGradientStopChangeEvent;
9
+ }
10
+ }
@@ -0,0 +1,8 @@
1
+ export type CxGradientStopRemoveEvent = CustomEvent<{
2
+ id: string;
3
+ }>;
4
+ declare global {
5
+ interface GlobalEventHandlersEventMap {
6
+ 'cx-gradient-stop-remove': CxGradientStopRemoveEvent;
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ export type CxGradientStopSelectEvent = CustomEvent<{
2
+ id: string;
3
+ }>;
4
+ declare global {
5
+ interface GlobalEventHandlersEventMap {
6
+ 'cx-gradient-stop-select': CxGradientStopSelectEvent;
7
+ }
8
+ }
@@ -1,4 +1,7 @@
1
- export type CxKeydownEvent = CustomEvent<Record<PropertyKey, never>>;
1
+ export type CxKeydownEvent = CustomEvent<{
2
+ event: KeyboardEvent;
3
+ value: string;
4
+ }>;
2
5
  declare global {
3
6
  interface GlobalEventHandlersEventMap {
4
7
  'cx-keydown': CxKeydownEvent;
@@ -101,6 +101,11 @@ export * from './cx-gallery-item-open-config';
101
101
  export * from './cx-gallery-item-select';
102
102
  export * from './cx-gallery-lightbox-hide';
103
103
  export * from './cx-gallery-lightbox-show';
104
+ export * from './cx-gradient-change';
105
+ export * from './cx-gradient-stop-add';
106
+ export * from './cx-gradient-stop-change';
107
+ export * from './cx-gradient-stop-remove';
108
+ export * from './cx-gradient-stop-select';
104
109
  export * from './cx-hide';
105
110
  export * from './cx-hover';
106
111
  export * from './cx-hub-connection-disconnected';