@ixfx/components 0.5.5 → 0.5.6

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.
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,253 @@ __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
+ }
5229
+ get isOpen() {
5230
+ return this._isOpen;
5231
+ }
5232
+ show() {
5233
+ if (!this.popover) return;
5234
+ try {
5235
+ this.showPopover();
5236
+ } catch {}
5237
+ }
5238
+ hide() {
5239
+ if (!this.popover) return;
5240
+ try {
5241
+ this.hidePopover();
5242
+ } catch {}
5243
+ }
5244
+ toggle() {
5245
+ if (!this.popover) return;
5246
+ try {
5247
+ this.togglePopover();
5248
+ } catch {}
5249
+ }
5250
+ connectedCallback() {
5251
+ super.connectedCallback();
5252
+ if (!this.hasAttribute(`popover`)) this.popover = `auto`;
5253
+ this.classList.add(`popup-surface`);
5254
+ this.addEventListener(`toggle`, this._onToggle);
5255
+ this.addEventListener(`click`, this._onPanelClick);
5256
+ this.style.setProperty(`position-anchor`, this._anchorName);
5257
+ this._attachToTarget();
5258
+ }
5259
+ disconnectedCallback() {
5260
+ super.disconnectedCallback();
5261
+ this.removeEventListener(`toggle`, this._onToggle);
5262
+ this.removeEventListener(`click`, this._onPanelClick);
5263
+ this._detachFromTarget();
5264
+ this._cancelShow();
5265
+ this._cancelHide();
5266
+ }
5267
+ updated(changed) {
5268
+ super.updated(changed);
5269
+ if (changed.has(`for`) || changed.has(`mode`)) this._attachToTarget();
5270
+ }
5271
+ _resolveTarget() {
5272
+ if (!this.for) return void 0;
5273
+ return this.getRootNode().getElementById(this.for) ?? void 0;
5274
+ }
5275
+ _attachToTarget() {
5276
+ this._detachFromTarget();
5277
+ const target = this._resolveTarget();
5278
+ if (!target) {
5279
+ if (this.for) console.warn(`ixfx-snackbar: no element found with id "${this.for}"`);
5280
+ return;
5281
+ }
5282
+ this._target = target;
5283
+ target.style.setProperty(`anchor-name`, this._anchorName);
5284
+ if (this.mode === `explicit`) {
5285
+ const alreadyFocusable = target.tabIndex >= 0;
5286
+ if (!alreadyFocusable) {
5287
+ target.setAttribute(`tabindex`, `0`);
5288
+ this._addedTabindex = true;
5289
+ }
5290
+ if (!target.hasAttribute(`role`) && !alreadyFocusable) {
5291
+ target.setAttribute(`role`, `button`);
5292
+ this._addedRole = true;
5293
+ }
5294
+ target.setAttribute(`aria-haspopup`, `true`);
5295
+ target.addEventListener(`click`, this._onTargetClick);
5296
+ if (!alreadyFocusable) target.addEventListener(`keydown`, this._onTargetKeydown);
5297
+ } else if (this.mode === `implicit`) {
5298
+ target.addEventListener(`pointerenter`, this._onTickleIn);
5299
+ target.addEventListener(`focus`, this._onTickleIn);
5300
+ target.addEventListener(`pointerleave`, this._onTickleOut);
5301
+ target.addEventListener(`blur`, this._onTickleOut);
5302
+ this.addEventListener(`pointerenter`, this._onTickleIn);
5303
+ this.addEventListener(`focusin`, this._onTickleIn);
5304
+ this.addEventListener(`pointerleave`, this._onTickleOut);
5305
+ this.addEventListener(`focusout`, this._onTickleOut);
5306
+ }
5307
+ }
5308
+ _detachFromTarget() {
5309
+ const target = this._target;
5310
+ if (!target) return;
5311
+ target.style.removeProperty(`anchor-name`);
5312
+ if (this._addedTabindex) {
5313
+ target.removeAttribute(`tabindex`);
5314
+ this._addedTabindex = false;
5315
+ }
5316
+ if (this._addedRole) {
5317
+ target.removeAttribute(`role`);
5318
+ this._addedRole = false;
5319
+ }
5320
+ target.removeAttribute(`aria-haspopup`);
5321
+ target.removeEventListener(`click`, this._onTargetClick);
5322
+ target.removeEventListener(`keydown`, this._onTargetKeydown);
5323
+ target.removeEventListener(`pointerenter`, this._onTickleIn);
5324
+ target.removeEventListener(`focus`, this._onTickleIn);
5325
+ target.removeEventListener(`pointerleave`, this._onTickleOut);
5326
+ target.removeEventListener(`blur`, this._onTickleOut);
5327
+ this.removeEventListener(`pointerenter`, this._onTickleIn);
5328
+ this.removeEventListener(`focusin`, this._onTickleIn);
5329
+ this.removeEventListener(`pointerleave`, this._onTickleOut);
5330
+ this.removeEventListener(`focusout`, this._onTickleOut);
5331
+ this._target = void 0;
5332
+ }
5333
+ _scheduleShow() {
5334
+ this._cancelHide();
5335
+ this._cancelShow();
5336
+ if (this.showDelay <= 0) {
5337
+ this.show();
5338
+ return;
5339
+ }
5340
+ this._showTimeout = window.setTimeout(() => this.show(), this.showDelay);
5341
+ }
5342
+ _scheduleHide() {
5343
+ this._cancelShow();
5344
+ this._cancelHide();
5345
+ if (this.hideDelay <= 0) {
5346
+ this.hide();
5347
+ return;
5348
+ }
5349
+ this._hideTimeout = window.setTimeout(() => this.hide(), this.hideDelay);
5350
+ }
5351
+ _cancelShow() {
5352
+ if (this._showTimeout !== void 0) {
5353
+ window.clearTimeout(this._showTimeout);
5354
+ this._showTimeout = void 0;
5355
+ }
5356
+ }
5357
+ _cancelHide() {
5358
+ if (this._hideTimeout !== void 0) {
5359
+ window.clearTimeout(this._hideTimeout);
5360
+ this._hideTimeout = void 0;
5361
+ }
5362
+ }
5363
+ static {
5364
+ this.styles = [
5365
+ themeFallbacks,
5366
+ popupSurfaceStyles,
5367
+ css`
5368
+ :host {
5369
+ display: flex;
5370
+ align-items: center;
5371
+ gap: var(--space-s);
5372
+ padding: var(--space-s);
5373
+
5374
+ position: fixed;
5375
+ inset: unset;
5376
+ margin: 0;
5377
+ z-index: 100;
5378
+ position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
5379
+
5380
+ opacity: 0;
5381
+ scale: 0.97;
5382
+ pointer-events: none;
5383
+ transition: opacity 0.12s ease-out, scale 0.12s ease-out,
5384
+ display 0.12s allow-discrete, overlay 0.12s allow-discrete;
5385
+ }
5386
+
5387
+ :host(:popover-open) {
5388
+ opacity: 1;
5389
+ scale: 1;
5390
+ pointer-events: auto;
5391
+ }
5392
+
5393
+ @starting-style {
5394
+ :host(:popover-open) {
5395
+ opacity: 0;
5396
+ scale: 0.97;
5397
+ }
5398
+ }
5399
+
5400
+ :host([placement="top"]) {
5401
+ position-area: block-start;
5402
+ margin-block-end: var(--space-s);
5403
+ }
5404
+
5405
+ :host([placement="bottom"]) {
5406
+ position-area: block-end;
5407
+ margin-block-start: var(--space-s);
5408
+ }
5409
+
5410
+ :host([placement="left"]) {
5411
+ position-area: inline-start;
5412
+ margin-inline-end: var(--space-s);
5413
+ }
5414
+
5415
+ :host([placement="right"]) {
5416
+ position-area: inline-end;
5417
+ margin-inline-start: var(--space-s);
5418
+ }
5419
+ `
5420
+ ];
5421
+ }
5422
+ render() {
5423
+ return html`<slot></slot>`;
5424
+ }
5425
+ };
5426
+ __decorate([property({ type: String })], SnackbarElement.prototype, "for", void 0);
5427
+ __decorate([property({ type: String })], SnackbarElement.prototype, "mode", void 0);
5428
+ __decorate([property({
5429
+ type: String,
5430
+ reflect: true
5431
+ })], SnackbarElement.prototype, "placement", void 0);
5432
+ __decorate([property({ type: String })], SnackbarElement.prototype, "dismiss", void 0);
5433
+ __decorate([property({
5434
+ type: Number,
5435
+ attribute: `show-delay`
5436
+ })], SnackbarElement.prototype, "showDelay", void 0);
5437
+ __decorate([property({
5438
+ type: Number,
5439
+ attribute: `hide-delay`
5440
+ })], SnackbarElement.prototype, "hideDelay", void 0);
5441
+ __decorate([state()], SnackbarElement.prototype, "_isOpen", void 0);
5442
+ SnackbarElement = __decorate([safeCustomElement(`ixfx-snackbar`)], SnackbarElement);
5443
+ //#endregion
5181
5444
  //#region src/tabs/tab-list-item.ts
5182
5445
  let TabListItemElement = class TabListItemElement extends LitElement {
5183
5446
  constructor(..._args) {
@@ -6096,6 +6359,6 @@ function init() {
6096
6359
  console.log(`Init`);
6097
6360
  }
6098
6361
  //#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 };
6362
+ 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
6363
 
6101
6364
  //# sourceMappingURL=index.js.map