@ixfx/components 0.8.1 → 0.8.2

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 (51) hide show
  1. package/bundle/index.d.ts +53 -11
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +74 -17
  4. package/bundle/index.js.map +1 -1
  5. package/dist/ac-text.js +1 -1
  6. package/dist/ac-token.js +1 -1
  7. package/dist/crumbs.js +3 -3
  8. package/dist/data-grid.js +3 -3
  9. package/dist/detail-list.js +1 -1
  10. package/dist/{grid-list-u33vmKzb.d.ts → grid-list-C1T6WlEp.d.ts} +20 -3
  11. package/dist/grid-list-C1T6WlEp.d.ts.map +1 -0
  12. package/dist/{grid-list-nRUQOcEL.js → grid-list-bmBWq6P-.js} +47 -18
  13. package/dist/grid-list-bmBWq6P-.js.map +1 -0
  14. package/dist/grid-list.d.ts +2 -2
  15. package/dist/grid-list.js +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +7 -7
  18. package/dist/{interaction-Cr13azbM.js → interaction-B9AAlsFO.js} +1 -1
  19. package/dist/{menu-Bg90Qr0B.js → menu-BDrTh6oo.js} +3 -3
  20. package/dist/{menu-Bg90Qr0B.js.map → menu-BDrTh6oo.js.map} +1 -1
  21. package/dist/{menu-item-Bx-Fs7jq.js → menu-item-B6pKg2Qq.js} +3 -3
  22. package/dist/{menu-item-Bx-Fs7jq.js.map → menu-item-B6pKg2Qq.js.map} +1 -1
  23. package/dist/menu.js +2 -2
  24. package/dist/miller.d.ts +1 -1
  25. package/dist/miller.js +2 -2
  26. package/dist/narrowed-text.js +2 -2
  27. package/dist/plots.d.ts +2 -2
  28. package/dist/plots.js +1 -1
  29. package/dist/select-horiz.js +2 -2
  30. package/dist/{tickled-controller-Bn3YdQsM.d.ts → tickled-controller-C1ZsHpyg.d.ts} +10 -1
  31. package/dist/tickled-controller-C1ZsHpyg.d.ts.map +1 -0
  32. package/dist/{tickled-controller-C66DgJHl.js → tickled-controller-Dh1Uh_vG.js} +4 -1
  33. package/dist/tickled-controller-Dh1Uh_vG.js.map +1 -0
  34. package/dist/{tree-Chptss7I.js → tree-4Jv28Nig.js} +3 -3
  35. package/dist/{tree-Chptss7I.js.map → tree-4Jv28Nig.js.map} +1 -1
  36. package/dist/tree.d.ts +1 -1
  37. package/dist/tree.js +1 -1
  38. package/dist/vertical-list.js +1 -1
  39. package/dist/{xy-axis-DzM1brBZ.js → xy-axis-CrrVdDFe.js} +28 -3
  40. package/dist/xy-axis-CrrVdDFe.js.map +1 -0
  41. package/dist/{xy-axis-BfP9hKLj.d.ts → xy-axis-DQqd2yXJ.d.ts} +28 -12
  42. package/dist/{xy-axis-BfP9hKLj.d.ts.map → xy-axis-DQqd2yXJ.d.ts.map} +1 -1
  43. package/docs-user/grid-list.md +45 -0
  44. package/docs-user/index.json +2 -2
  45. package/docs-user/infra-tickled.md +2 -0
  46. package/package.json +1 -1
  47. package/dist/grid-list-nRUQOcEL.js.map +0 -1
  48. package/dist/grid-list-u33vmKzb.d.ts.map +0 -1
  49. package/dist/tickled-controller-Bn3YdQsM.d.ts.map +0 -1
  50. package/dist/tickled-controller-C66DgJHl.js.map +0 -1
  51. package/dist/xy-axis-DzM1brBZ.js.map +0 -1
package/bundle/index.js CHANGED
@@ -730,6 +730,7 @@ var TickledController = class TickledController {
730
730
  this.host = host;
731
731
  this.config = config;
732
732
  this._inputMode = config.initialInputMode ?? `mouse`;
733
+ this.hoverDisabled = config.hoverDisabled ?? (() => false);
733
734
  host.addController(this);
734
735
  }
735
736
  hostConnected() {
@@ -798,6 +799,7 @@ var TickledController = class TickledController {
798
799
  * Switches to mouse mode and tickles the item.
799
800
  */
800
801
  handlePointerEnter(id) {
802
+ if (this.hoverDisabled()) return;
801
803
  if (!TickledController._mouseMovedSinceKeyboard) return;
802
804
  const item = this.config.getItems().find((item) => item.id === id);
803
805
  if (item && item.enabled === false) return;
@@ -815,6 +817,7 @@ var TickledController = class TickledController {
815
817
  * @param _e The pointer event (not used, but kept for API compatibility)
816
818
  */
817
819
  handlePointerLeave(_e) {
820
+ if (this.hoverDisabled()) return;
818
821
  if (TickledController._mouseMovedSinceKeyboard) this.clearTickled();
819
822
  }
820
823
  /**
@@ -20483,6 +20486,7 @@ let GridListElement = class GridListElement extends i {
20483
20486
  super(..._args);
20484
20487
  this.selectionMode = `single`;
20485
20488
  this.interactionMode = `standard`;
20489
+ this.disableHoverTickle = false;
20486
20490
  this.itemSize = 160;
20487
20491
  this.gap = 8;
20488
20492
  this.orientation = `grid`;
@@ -20531,7 +20535,8 @@ let GridListElement = class GridListElement extends i {
20531
20535
  if (k !== void 0) this.#emitItemEvent(`list-tickle`, k);
20532
20536
  },
20533
20537
  onStateChange: () => this._syncItemStates(),
20534
- itemWrap: this.#itemWrap
20538
+ itemWrap: this.#itemWrap,
20539
+ hoverDisabled: () => this.disableHoverTickle
20535
20540
  });
20536
20541
  this.#selectedSnapshot = /* @__PURE__ */ new Set();
20537
20542
  this.#onScroll = (e) => {
@@ -20680,7 +20685,18 @@ let GridListElement = class GridListElement extends i {
20680
20685
  border-radius: var(--grid-list-radius);
20681
20686
  }
20682
20687
 
20683
- /* The square that holds the slotted content. */
20688
+ /* The square that holds the slotted content — the "image well". Its
20689
+ background is a set of consumer-settable variables so a Finder-style
20690
+ look is possible: on selection the caption takes the accent colouring
20691
+ while the well takes a tint of the surface colour. Each variable is
20692
+ unset by default, so the fallback (today's look) applies until a
20693
+ consumer opts in.
20694
+ --grid-list-thumb-bg idle well background
20695
+ --grid-list-thumb-bg-tickled under the cursor
20696
+ --grid-list-thumb-bg-selected when the cell is selected
20697
+ --grid-list-thumb-bg-selected-tickled selected + under the cursor
20698
+ --grid-list-thumb-selection-wash colour of the box-mode wash (default: --accent)
20699
+ --grid-list-thumb-selection-wash-opacity strength of that wash (default: 0.18; set 0 to drop it) */
20684
20700
  .thumb {
20685
20701
  position: relative;
20686
20702
  flex: 1;
@@ -20690,7 +20706,7 @@ let GridListElement = class GridListElement extends i {
20690
20706
  box-sizing: border-box;
20691
20707
  overflow: hidden;
20692
20708
  border-radius: 0;
20693
- background: transparent;
20709
+ background: var(--grid-list-thumb-bg, transparent);
20694
20710
  border: 1px solid transparent;
20695
20711
  transition: background var(--transition), border-color var(--transition);
20696
20712
  }
@@ -20714,19 +20730,27 @@ let GridListElement = class GridListElement extends i {
20714
20730
  }
20715
20731
 
20716
20732
  /* Selection / cursor wash — sits over the slotted content so it reads
20717
- on photos and arbitrary DOM alike. */
20733
+ on photos and arbitrary DOM alike. Set
20734
+ --grid-list-thumb-selection-wash-opacity: 0 to drop it in favour of a
20735
+ --grid-list-thumb-bg-selected tint. */
20718
20736
  .thumb::after {
20719
20737
  content: "";
20720
20738
  position: absolute;
20721
20739
  inset: 0;
20722
20740
  pointer-events: none;
20723
20741
  border-radius: inherit;
20724
- background: var(--accent);
20742
+ background: var(--grid-list-thumb-selection-wash, var(--accent));
20725
20743
  opacity: 0;
20726
20744
  transition: opacity var(--transition, 0.1s ease-out);
20727
20745
  }
20728
20746
  .cell.selected .thumb::after {
20729
- opacity: 0.18;
20747
+ opacity: var(--grid-list-thumb-selection-wash-opacity, 0.18);
20748
+ }
20749
+ :host(:not([caption-style="separate"])) .cell.selected .thumb {
20750
+ background: var(--grid-list-thumb-bg-selected, var(--grid-list-thumb-bg, transparent));
20751
+ }
20752
+ :host(:not([caption-style="separate"])) .cell.selected.tickled .thumb {
20753
+ background: var(--grid-list-thumb-bg-selected-tickled, var(--grid-list-thumb-bg-selected, var(--grid-list-thumb-bg, transparent)));
20730
20754
  }
20731
20755
 
20732
20756
  /* ---- Caption (base) ---- */
@@ -20753,8 +20777,8 @@ let GridListElement = class GridListElement extends i {
20753
20777
  overflow: hidden;
20754
20778
  transition: background var(--transition), border-color var(--transition);
20755
20779
  }
20756
- :host(:not([caption-style="separate"])) .cell:hover,
20757
- :host(:not([caption-style="separate"])) .cell.tickled {
20780
+ :host(:not([caption-style="separate"])) .cell.tickled,
20781
+ :host(:not([caption-style="separate"]):not([disable-hover-tickle])) .cell:hover {
20758
20782
  background: var(--item-bg-tickled);
20759
20783
  border: var(--item-border-tickled);
20760
20784
  }
@@ -20821,12 +20845,12 @@ let GridListElement = class GridListElement extends i {
20821
20845
  :host([caption-style="separate"]) .thumb {
20822
20846
  flex: none;
20823
20847
  border-radius: var(--grid-list-radius);
20824
- background: var(--grid-list-item-bg);
20848
+ background: var(--grid-list-thumb-bg, var(--grid-list-item-bg));
20825
20849
  border: 1px solid transparent;
20826
20850
  }
20827
- :host([caption-style="separate"]) .cell:hover .thumb,
20828
- :host([caption-style="separate"]) .cell.tickled .thumb {
20829
- background: var(--item-bg-tickled);
20851
+ :host([caption-style="separate"]) .cell.tickled .thumb,
20852
+ :host([caption-style="separate"]:not([disable-hover-tickle])) .cell:hover .thumb {
20853
+ background: var(--grid-list-thumb-bg-tickled, var(--item-bg-tickled));
20830
20854
  border: var(--item-border-tickled);
20831
20855
  }
20832
20856
  :host([caption-style="separate"]) .caption {
@@ -20839,14 +20863,17 @@ let GridListElement = class GridListElement extends i {
20839
20863
  }
20840
20864
  :host([caption-style="separate"][caption-align="left"]) .caption { align-self: flex-start; }
20841
20865
  :host([caption-style="separate"][caption-align="right"]) .caption { align-self: flex-end; }
20866
+ /* Inset the selection ring (negative offset) so it is never clipped by the
20867
+ scroll viewport's overflow when the cell sits against an edge. */
20842
20868
  :host([caption-style="separate"]) .cell.selected .thumb {
20869
+ background: var(--grid-list-thumb-bg-selected, var(--grid-list-thumb-bg, var(--grid-list-item-bg)));
20843
20870
  outline: 2px solid var(--accent);
20844
- outline-offset: 2px;
20871
+ outline-offset: -2px;
20845
20872
  }
20846
20873
  :host([caption-style="separate"]) .cell.selected.tickled .thumb {
20847
- background: var(--item-bg-selected-tickled);
20874
+ background: var(--grid-list-thumb-bg-selected-tickled, var(--item-bg-selected-tickled));
20848
20875
  outline: 2px dashed var(--surface-3);
20849
- outline-offset: 2px;
20876
+ outline-offset: -2px;
20850
20877
  }
20851
20878
  :host([caption-style="separate"]) .cell.selected .caption {
20852
20879
  background: var(--accent);
@@ -21646,6 +21673,11 @@ __decorate([property({
21646
21673
  type: String,
21647
21674
  attribute: `interaction-mode`
21648
21675
  })], GridListElement.prototype, "interactionMode", void 0);
21676
+ __decorate([property({
21677
+ type: Boolean,
21678
+ attribute: `disable-hover-tickle`,
21679
+ reflect: true
21680
+ })], GridListElement.prototype, "disableHoverTickle", void 0);
21649
21681
  __decorate([property({
21650
21682
  type: Number,
21651
21683
  attribute: `item-size`
@@ -32115,6 +32147,7 @@ let PlotHistogram = class PlotHistogram extends i {
32115
32147
  this.#onPointerMove = (e) => {
32116
32148
  if (this.interactionMode === `select` && this._isDragging) {
32117
32149
  const index = this.#bucketIndexFromPosition(e.clientX, e.clientY);
32150
+ if (index === this._selectionEnd) return;
32118
32151
  this._selectionEnd = index;
32119
32152
  const start = Math.min(this._selectionStart, this._selectionEnd);
32120
32153
  const end = Math.max(this._selectionStart, this._selectionEnd);
@@ -32126,6 +32159,7 @@ let PlotHistogram = class PlotHistogram extends i {
32126
32159
  this._selectionOverlayText = `Select: ${startBar.valueMin.toFixed(2)} – ${endBar.valueMax.toFixed(2)}`;
32127
32160
  }
32128
32161
  this.requestUpdate();
32162
+ this.#emitSelectionChange(false);
32129
32163
  return;
32130
32164
  }
32131
32165
  if (this.interactionMode === `select`) return;
@@ -32141,6 +32175,7 @@ let PlotHistogram = class PlotHistogram extends i {
32141
32175
  this._isDragging = false;
32142
32176
  this._selectionOverlayText = null;
32143
32177
  this.requestUpdate();
32178
+ this.#emitSelectionChange(true);
32144
32179
  }
32145
32180
  return;
32146
32181
  }
@@ -32160,9 +32195,13 @@ let PlotHistogram = class PlotHistogram extends i {
32160
32195
  this.setColoredRange(startBar.valueMin, endBar.valueMax);
32161
32196
  this._selectionOverlayText = `Select: ${startBar.valueMin.toFixed(2)} – ${endBar.valueMax.toFixed(2)}`;
32162
32197
  this.requestUpdate();
32198
+ this.#emitSelectionChange(false);
32163
32199
  };
32164
32200
  this.#onPointerUp = () => {
32165
- if (this.interactionMode === `select`) this._isDragging = false;
32201
+ if (this.interactionMode === `select` && this._isDragging) {
32202
+ this._isDragging = false;
32203
+ this.#emitSelectionChange(true);
32204
+ }
32166
32205
  };
32167
32206
  }
32168
32207
  #series;
@@ -32211,11 +32250,14 @@ let PlotHistogram = class PlotHistogram extends i {
32211
32250
  this.setColoredRange(startBar.valueMin, endBar.valueMax);
32212
32251
  }
32213
32252
  this.requestUpdate();
32253
+ this.#emitSelectionChange(true);
32214
32254
  }
32215
32255
  clearSelection() {
32256
+ const had = this._selectionStart !== null || this._selectionEnd !== null;
32216
32257
  this._selectionStart = null;
32217
32258
  this._selectionEnd = null;
32218
32259
  this.requestUpdate();
32260
+ if (had) this.#emitSelectionChange(true);
32219
32261
  }
32220
32262
  getSelectedRange() {
32221
32263
  if (this._selectionStart === null || this._selectionEnd === null) return {
@@ -32300,6 +32342,21 @@ let PlotHistogram = class PlotHistogram extends i {
32300
32342
  composed: true
32301
32343
  }));
32302
32344
  }
32345
+ /**
32346
+ * Fire `plot-selection-change` with the current bar-range selection (indices +
32347
+ * data span). `committed` is `false` mid-drag, `true` on release / programmatic
32348
+ * change.
32349
+ */
32350
+ #emitSelectionChange(committed) {
32351
+ this.dispatchEvent(new CustomEvent(`plot-selection-change`, {
32352
+ detail: {
32353
+ ...this.getSelectedRange(),
32354
+ committed
32355
+ },
32356
+ bubbles: true,
32357
+ composed: true
32358
+ }));
32359
+ }
32303
32360
  /** Bucket layout + counts, shared by render() and pointer hit-testing. */
32304
32361
  #computeGeometry() {
32305
32362
  const { values, range } = this.#series;
@@ -32387,7 +32444,7 @@ let PlotHistogram = class PlotHistogram extends i {
32387
32444
  }
32388
32445
  /** Gets bucket index from position, clamping to valid range (0 to bucketCount-1). */
32389
32446
  #bucketIndexFromPosition(clientX, clientY) {
32390
- const { w, h, isHorizontal, padding, dataMin, dataSpan, bucketCount, availableMain } = this.#computeGeometry();
32447
+ const { isHorizontal, padding, bucketCount, availableMain } = this.#computeGeometry();
32391
32448
  const rect = this.getBoundingClientRect();
32392
32449
  const x = clientX - rect.left;
32393
32450
  const y = clientY - rect.top;