@ixfx/components 0.5.5 → 0.5.7

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 (60) hide show
  1. package/bundle/index.d.ts +60 -1
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +328 -10
  4. package/bundle/index.js.map +1 -1
  5. package/dist/ac-text.d.ts +4 -1
  6. package/dist/ac-text.d.ts.map +1 -1
  7. package/dist/ac-text.js +34 -5
  8. package/dist/ac-text.js.map +1 -1
  9. package/dist/{button-CTE8crYn.js → button-CU8eLcxB.js} +15 -1
  10. package/dist/button-CU8eLcxB.js.map +1 -0
  11. package/dist/button.d.ts +2 -1
  12. package/dist/button.d.ts.map +1 -1
  13. package/dist/button.js +1 -1
  14. package/dist/{colour-picker-C3Ag4uh-.js → colour-picker-Bb795sjX.js} +2 -2
  15. package/dist/{colour-picker-C3Ag4uh-.js.map → colour-picker-Bb795sjX.js.map} +1 -1
  16. package/dist/colour-picker.d.ts +1 -1
  17. package/dist/colour-picker.js +1 -1
  18. package/dist/crumbs.d.ts +1 -1
  19. package/dist/crumbs.js +1 -1
  20. package/dist/{icon-DpA9x2Ve.d.ts → icon-BUwP1CZ1.d.ts} +2 -2
  21. package/dist/icon-BUwP1CZ1.d.ts.map +1 -0
  22. package/dist/icons.d.ts +2 -2
  23. package/dist/{index-DfEkTGvT.d.ts → index-B1UKcA7l.d.ts} +3 -3
  24. package/dist/{index-DfEkTGvT.d.ts.map → index-B1UKcA7l.d.ts.map} +1 -1
  25. package/dist/{index-D_ftz_IT.d.ts → index-BKAlRgbq.d.ts} +2 -2
  26. package/dist/{index-D_ftz_IT.d.ts.map → index-BKAlRgbq.d.ts.map} +1 -1
  27. package/dist/{index-CoqtMSd9.d.ts → index-BUB5SICW.d.ts} +2 -2
  28. package/dist/{index-CoqtMSd9.d.ts.map → index-BUB5SICW.d.ts.map} +1 -1
  29. package/dist/{index-BtGFYfaK.d.ts → index-RqMh1i-O.d.ts} +2 -2
  30. package/dist/{index-BtGFYfaK.d.ts.map → index-RqMh1i-O.d.ts.map} +1 -1
  31. package/dist/index.d.ts +64 -9
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +279 -6
  34. package/dist/index.js.map +1 -1
  35. package/dist/{labelled-input-base-DiTme1JO.d.ts → labelled-input-base-Dp_9KP0G.d.ts} +2 -2
  36. package/dist/{labelled-input-base-DiTme1JO.d.ts.map → labelled-input-base-Dp_9KP0G.d.ts.map} +1 -1
  37. package/dist/labelled-radial-input.d.ts +2 -2
  38. package/dist/labelled-radial-input.d.ts.map +1 -1
  39. package/dist/labelled-range-input.d.ts +1 -1
  40. package/dist/{menu-xPpzkoiW.js → menu-BYyeCAF7.js} +2 -2
  41. package/dist/{menu-xPpzkoiW.js.map → menu-BYyeCAF7.js.map} +1 -1
  42. package/dist/{menu-item-CFy8e3G_.js → menu-item-BttvL89f.js} +2 -2
  43. package/dist/{menu-item-CFy8e3G_.js.map → menu-item-BttvL89f.js.map} +1 -1
  44. package/dist/{menu-item-DSyf9f_L.d.ts → menu-item-CQ4Qg731.d.ts} +2 -2
  45. package/dist/{menu-item-DSyf9f_L.d.ts.map → menu-item-CQ4Qg731.d.ts.map} +1 -1
  46. package/dist/menu.d.ts +2 -2
  47. package/dist/menu.js +2 -2
  48. package/dist/panel.d.ts +1 -1
  49. package/dist/{popup-DiWMxsWj.js → popup-D80sj2QC.js} +5 -3
  50. package/dist/popup-D80sj2QC.js.map +1 -0
  51. package/dist/{tab-list-BohmbvqF.d.ts → tab-list-VtWT-_FG.d.ts} +2 -2
  52. package/dist/{tab-list-BohmbvqF.d.ts.map → tab-list-VtWT-_FG.d.ts.map} +1 -1
  53. package/dist/tabs.d.ts +1 -1
  54. package/docs-user/README.md +1 -0
  55. package/docs-user/button.md +2 -0
  56. package/docs-user/snackbar.md +94 -0
  57. package/package.json +1 -1
  58. package/dist/button-CTE8crYn.js.map +0 -1
  59. package/dist/icon-DpA9x2Ve.d.ts.map +0 -1
  60. package/dist/popup-DiWMxsWj.js.map +0 -1
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@ import { a as createFuzzySearch, i as createAcCompletionProvider, n as IncrSearc
9
9
  import { i as ICON_CLOSE, n as ICON_CHECK, r as ICON_CHEVRON_DOWN, t as ICON_CARET_RIGHT } from "./defaults-DcE8RQJc.js";
10
10
  import "./icons.js";
11
11
  import { t as prominenceStyles } from "./prominence-DlFShic3.js";
12
- import { n as buttonStyles, t as ButtonElement } from "./button-CTE8crYn.js";
13
- import { t as popupSurfaceStyles } from "./popup-DiWMxsWj.js";
14
- import "./menu-item-CFy8e3G_.js";
12
+ import { n as buttonStyles, t as ButtonElement } from "./button-CU8eLcxB.js";
13
+ import { t as popupSurfaceStyles } from "./popup-D80sj2QC.js";
14
+ import "./menu-item-BttvL89f.js";
15
15
  import { Checkbox } from "./checkbox.js";
16
- import { n as ColourPicker, t as ColourPickerPopup } from "./colour-picker-C3Ag4uh-.js";
16
+ import { n as ColourPicker, t as ColourPickerPopup } from "./colour-picker-Bb795sjX.js";
17
17
  import { LabelledRangeInput } from "./labelled-range-input.js";
18
18
  import { t as collectDataResult } from "./data-provider-35TyWclX.js";
19
19
  import { i as TreeDataModel, n as TreeListElement, r as TreeBaseElement, t as TreeController } from "./tree-BnvzhsAw.js";
@@ -28,7 +28,7 @@ import { t as IxfxHexEditorElement } from "./hex-editor-Bk6rxhfg.js";
28
28
  import { t as RadialInputElement } from "./radial-input-DxCrt_NE.js";
29
29
  import { LabelledRadialInput } from "./labelled-radial-input.js";
30
30
  import { LedElement } from "./led.js";
31
- import { t as menu_exports } from "./menu-xPpzkoiW.js";
31
+ import { t as menu_exports } from "./menu-BYyeCAF7.js";
32
32
  import { MillerBaseElement, MillerListElement, MillerTreeController } from "./miller.js";
33
33
  import { a as TooltipElement, c as computeColour, i as PlotMultiAxis, l as parseColourScaleAttr, n as PlotSingleAxis, o as PlotDataSeries, r as PlotHistogram, s as applyAgeModification, t as PlotXyAxis, u as readBaseColour } from "./xy-axis-CxHC8z5E.js";
34
34
  import { PolarPad } from "./polar-pad.js";
@@ -1524,6 +1524,22 @@ let SplitButton = class SplitButton extends ButtonElement {
1524
1524
  outline-offset: -2px;
1525
1525
  }
1526
1526
 
1527
+ :host([subtle]) button.primary,
1528
+ :host([subtle]) button.caret,
1529
+ :host([subtle]) button.primary:hover:not(:disabled),
1530
+ :host([subtle]) button.caret:hover:not(:disabled) {
1531
+ background: none;
1532
+ }
1533
+
1534
+ :host([subtle]) .split {
1535
+ background: color-mix(in oklch, var(--surface-3, #ccc) 40%, transparent);
1536
+ }
1537
+
1538
+ :host([subtle]) .split:has(button:hover:not(:disabled)),
1539
+ :host([subtle]) .split:has(button:focus-visible:not(:disabled)) {
1540
+ background: color-mix(in oklch, var(--surface-3, #ccc) 70%, transparent);
1541
+ }
1542
+
1527
1543
  ixfx-menu-trigger {
1528
1544
  display: inline-flex;
1529
1545
  align-items: stretch;
@@ -5178,6 +5194,263 @@ __decorate([eventOptions({ capture: true })], RangeMultiElement.prototype, "_onI
5178
5194
  __decorate([eventOptions({ capture: true })], RangeMultiElement.prototype, "_onPointerDown", null);
5179
5195
  RangeMultiElement = __decorate([safeCustomElement(`ixfx-range-multi`)], RangeMultiElement);
5180
5196
  //#endregion
5197
+ //#region src/snackbar/snackbar.ts
5198
+ let _instanceCounter = 0;
5199
+ let SnackbarElement = class SnackbarElement extends LitElement {
5200
+ constructor(..._args) {
5201
+ super(..._args);
5202
+ this.for = ``;
5203
+ this.mode = `explicit`;
5204
+ this.placement = `top`;
5205
+ this.dismiss = `auto`;
5206
+ this.showDelay = 150;
5207
+ this.hideDelay = 500;
5208
+ this._isOpen = false;
5209
+ this._anchorName = `--ixfx-snackbar-anchor-${++_instanceCounter}`;
5210
+ this._addedTabindex = false;
5211
+ this._addedRole = false;
5212
+ this._onTargetClick = () => this.toggle();
5213
+ this._onTargetKeydown = (e) => {
5214
+ if (e.key !== `Enter` && e.key !== ` `) return;
5215
+ e.preventDefault();
5216
+ this.toggle();
5217
+ };
5218
+ this._onTickleIn = () => this._scheduleShow();
5219
+ this._onTickleOut = () => this._scheduleHide();
5220
+ this._onPanelClick = () => {
5221
+ if (this.dismiss === `auto`) this.hide();
5222
+ };
5223
+ this._onToggle = (e) => {
5224
+ const { newState } = e;
5225
+ this._isOpen = newState === `open`;
5226
+ if (newState === `closed` && this.contains(document.activeElement)) this._target?.focus();
5227
+ };
5228
+ this._onBeforeToggle = (e) => {
5229
+ const { newState } = e;
5230
+ this._recentCloseAt = newState === `closed` ? performance.now() : void 0;
5231
+ };
5232
+ }
5233
+ get isOpen() {
5234
+ return this._isOpen;
5235
+ }
5236
+ show() {
5237
+ if (!this.popover) return;
5238
+ try {
5239
+ this.showPopover();
5240
+ } catch {}
5241
+ }
5242
+ hide() {
5243
+ if (!this.popover) return;
5244
+ try {
5245
+ this.hidePopover();
5246
+ } catch {}
5247
+ }
5248
+ toggle() {
5249
+ if (!this.popover) return;
5250
+ if (this._recentCloseAt !== void 0 && performance.now() - this._recentCloseAt < 50) {
5251
+ this._recentCloseAt = void 0;
5252
+ return;
5253
+ }
5254
+ try {
5255
+ this.togglePopover();
5256
+ } catch {}
5257
+ }
5258
+ connectedCallback() {
5259
+ super.connectedCallback();
5260
+ if (!this.hasAttribute(`popover`)) this.popover = `auto`;
5261
+ this.classList.add(`popup-surface`);
5262
+ this.addEventListener(`toggle`, this._onToggle);
5263
+ this.addEventListener(`beforetoggle`, this._onBeforeToggle);
5264
+ this.addEventListener(`click`, this._onPanelClick);
5265
+ this.style.setProperty(`position-anchor`, this._anchorName);
5266
+ this._attachToTarget();
5267
+ }
5268
+ disconnectedCallback() {
5269
+ super.disconnectedCallback();
5270
+ this.removeEventListener(`toggle`, this._onToggle);
5271
+ this.removeEventListener(`beforetoggle`, this._onBeforeToggle);
5272
+ this.removeEventListener(`click`, this._onPanelClick);
5273
+ this._detachFromTarget();
5274
+ this._cancelShow();
5275
+ this._cancelHide();
5276
+ }
5277
+ updated(changed) {
5278
+ super.updated(changed);
5279
+ if (changed.has(`for`) || changed.has(`mode`)) this._attachToTarget();
5280
+ }
5281
+ _resolveTarget() {
5282
+ if (!this.for) return void 0;
5283
+ return this.getRootNode().getElementById(this.for) ?? void 0;
5284
+ }
5285
+ _attachToTarget() {
5286
+ this._detachFromTarget();
5287
+ const target = this._resolveTarget();
5288
+ if (!target) {
5289
+ if (this.for) console.warn(`ixfx-snackbar: no element found with id "${this.for}"`);
5290
+ return;
5291
+ }
5292
+ this._target = target;
5293
+ target.style.setProperty(`anchor-name`, this._anchorName);
5294
+ if (this.mode === `explicit`) {
5295
+ const alreadyFocusable = target.tabIndex >= 0;
5296
+ if (!alreadyFocusable) {
5297
+ target.setAttribute(`tabindex`, `0`);
5298
+ this._addedTabindex = true;
5299
+ }
5300
+ if (!target.hasAttribute(`role`) && !alreadyFocusable) {
5301
+ target.setAttribute(`role`, `button`);
5302
+ this._addedRole = true;
5303
+ }
5304
+ target.setAttribute(`aria-haspopup`, `true`);
5305
+ target.addEventListener(`click`, this._onTargetClick);
5306
+ if (!alreadyFocusable) target.addEventListener(`keydown`, this._onTargetKeydown);
5307
+ } else if (this.mode === `implicit`) {
5308
+ target.addEventListener(`pointerenter`, this._onTickleIn);
5309
+ target.addEventListener(`focus`, this._onTickleIn);
5310
+ target.addEventListener(`pointerleave`, this._onTickleOut);
5311
+ target.addEventListener(`blur`, this._onTickleOut);
5312
+ this.addEventListener(`pointerenter`, this._onTickleIn);
5313
+ this.addEventListener(`focusin`, this._onTickleIn);
5314
+ this.addEventListener(`pointerleave`, this._onTickleOut);
5315
+ this.addEventListener(`focusout`, this._onTickleOut);
5316
+ }
5317
+ }
5318
+ _detachFromTarget() {
5319
+ const target = this._target;
5320
+ if (!target) return;
5321
+ target.style.removeProperty(`anchor-name`);
5322
+ if (this._addedTabindex) {
5323
+ target.removeAttribute(`tabindex`);
5324
+ this._addedTabindex = false;
5325
+ }
5326
+ if (this._addedRole) {
5327
+ target.removeAttribute(`role`);
5328
+ this._addedRole = false;
5329
+ }
5330
+ target.removeAttribute(`aria-haspopup`);
5331
+ target.removeEventListener(`click`, this._onTargetClick);
5332
+ target.removeEventListener(`keydown`, this._onTargetKeydown);
5333
+ target.removeEventListener(`pointerenter`, this._onTickleIn);
5334
+ target.removeEventListener(`focus`, this._onTickleIn);
5335
+ target.removeEventListener(`pointerleave`, this._onTickleOut);
5336
+ target.removeEventListener(`blur`, this._onTickleOut);
5337
+ this.removeEventListener(`pointerenter`, this._onTickleIn);
5338
+ this.removeEventListener(`focusin`, this._onTickleIn);
5339
+ this.removeEventListener(`pointerleave`, this._onTickleOut);
5340
+ this.removeEventListener(`focusout`, this._onTickleOut);
5341
+ this._target = void 0;
5342
+ }
5343
+ _scheduleShow() {
5344
+ this._cancelHide();
5345
+ this._cancelShow();
5346
+ if (this.showDelay <= 0) {
5347
+ this.show();
5348
+ return;
5349
+ }
5350
+ this._showTimeout = window.setTimeout(() => this.show(), this.showDelay);
5351
+ }
5352
+ _scheduleHide() {
5353
+ this._cancelShow();
5354
+ this._cancelHide();
5355
+ if (this.hideDelay <= 0) {
5356
+ this.hide();
5357
+ return;
5358
+ }
5359
+ this._hideTimeout = window.setTimeout(() => this.hide(), this.hideDelay);
5360
+ }
5361
+ _cancelShow() {
5362
+ if (this._showTimeout !== void 0) {
5363
+ window.clearTimeout(this._showTimeout);
5364
+ this._showTimeout = void 0;
5365
+ }
5366
+ }
5367
+ _cancelHide() {
5368
+ if (this._hideTimeout !== void 0) {
5369
+ window.clearTimeout(this._hideTimeout);
5370
+ this._hideTimeout = void 0;
5371
+ }
5372
+ }
5373
+ static {
5374
+ this.styles = [
5375
+ themeFallbacks,
5376
+ popupSurfaceStyles,
5377
+ css`
5378
+ :host {
5379
+ display: flex;
5380
+ align-items: center;
5381
+ gap: var(--space-s);
5382
+ padding: var(--space-s);
5383
+
5384
+ position: fixed;
5385
+ inset: unset;
5386
+ margin: 0;
5387
+ z-index: 100;
5388
+ position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
5389
+
5390
+ opacity: 0;
5391
+ scale: 0.97;
5392
+ pointer-events: none;
5393
+ transition: opacity 0.12s ease-out, scale 0.12s ease-out,
5394
+ display 0.12s allow-discrete, overlay 0.12s allow-discrete;
5395
+ }
5396
+
5397
+ :host(:popover-open) {
5398
+ opacity: 1;
5399
+ scale: 1;
5400
+ pointer-events: auto;
5401
+ }
5402
+
5403
+ @starting-style {
5404
+ :host(:popover-open) {
5405
+ opacity: 0;
5406
+ scale: 0.97;
5407
+ }
5408
+ }
5409
+
5410
+ :host([placement="top"]) {
5411
+ position-area: block-start;
5412
+ margin-block-end: var(--space-s);
5413
+ }
5414
+
5415
+ :host([placement="bottom"]) {
5416
+ position-area: block-end;
5417
+ margin-block-start: var(--space-s);
5418
+ }
5419
+
5420
+ :host([placement="left"]) {
5421
+ position-area: inline-start;
5422
+ margin-inline-end: var(--space-s);
5423
+ }
5424
+
5425
+ :host([placement="right"]) {
5426
+ position-area: inline-end;
5427
+ margin-inline-start: var(--space-s);
5428
+ }
5429
+ `
5430
+ ];
5431
+ }
5432
+ render() {
5433
+ return html`<slot></slot>`;
5434
+ }
5435
+ };
5436
+ __decorate([property({ type: String })], SnackbarElement.prototype, "for", void 0);
5437
+ __decorate([property({ type: String })], SnackbarElement.prototype, "mode", void 0);
5438
+ __decorate([property({
5439
+ type: String,
5440
+ reflect: true
5441
+ })], SnackbarElement.prototype, "placement", void 0);
5442
+ __decorate([property({ type: String })], SnackbarElement.prototype, "dismiss", void 0);
5443
+ __decorate([property({
5444
+ type: Number,
5445
+ attribute: `show-delay`
5446
+ })], SnackbarElement.prototype, "showDelay", void 0);
5447
+ __decorate([property({
5448
+ type: Number,
5449
+ attribute: `hide-delay`
5450
+ })], SnackbarElement.prototype, "hideDelay", void 0);
5451
+ __decorate([state()], SnackbarElement.prototype, "_isOpen", void 0);
5452
+ SnackbarElement = __decorate([safeCustomElement(`ixfx-snackbar`)], SnackbarElement);
5453
+ //#endregion
5181
5454
  //#region src/tabs/tab-list-item.ts
5182
5455
  let TabListItemElement = class TabListItemElement extends LitElement {
5183
5456
  constructor(..._args) {
@@ -6096,6 +6369,6 @@ function init() {
6096
6369
  console.log(`Init`);
6097
6370
  }
6098
6371
  //#endregion
6099
- export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataController, DataDisplayComponent, EditableLabel, EditableNumber, FormElement, FormGroupElement, FormPartElement, GroupedItemListerElement, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, NotificationManager, NotificationPillElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotHistogram, PlotMultiAxis, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SliderInputElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabController, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, collectDataResult, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, createPillRenderer, createTreeListAdapter, createVerticalListAdapter, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
6372
+ export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataController, DataDisplayComponent, EditableLabel, EditableNumber, FormElement, FormGroupElement, FormPartElement, GroupedItemListerElement, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, NotificationManager, NotificationPillElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotHistogram, PlotMultiAxis, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SliderInputElement, SnackbarElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabController, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, collectDataResult, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, createPillRenderer, createTreeListAdapter, createVerticalListAdapter, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
6100
6373
 
6101
6374
  //# sourceMappingURL=index.js.map