@oicl/openbridge-webcomponents-full-bundle 2.1.0 → 2.2.0-next.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 (29) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +59 -16
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +121 -9
  4. package/dist/components/icon-button/icon-button.d.ts +2 -0
  5. package/dist/components/icon-button/icon-button.d.ts.map +1 -1
  6. package/dist/components/icon-button/icon-button.js +4 -0
  7. package/dist/components/icon-button/icon-button.js.map +1 -1
  8. package/dist/components/split-button/split-button.css.js +5 -0
  9. package/dist/components/split-button/split-button.css.js.map +1 -1
  10. package/dist/components/split-button/split-button.d.ts +35 -5
  11. package/dist/components/split-button/split-button.d.ts.map +1 -1
  12. package/dist/components/split-button/split-button.js +23 -5
  13. package/dist/components/split-button/split-button.js.map +1 -1
  14. package/dist/components/top-bar/top-bar.css.js +2 -2
  15. package/dist/components/top-bar/top-bar.css.js.map +1 -1
  16. package/dist/components/top-bar/top-bar.d.ts +23 -8
  17. package/dist/components/top-bar/top-bar.d.ts.map +1 -1
  18. package/dist/components/top-bar/top-bar.js +25 -9
  19. package/dist/components/top-bar/top-bar.js.map +1 -1
  20. package/package.json +1 -1
  21. package/src/components/icon-button/icon-button.ts +5 -0
  22. package/src/components/split-button/split-button.css +7 -0
  23. package/src/components/split-button/split-button.spec.ts +241 -0
  24. package/src/components/split-button/split-button.stories.ts +118 -2
  25. package/src/components/split-button/split-button.ts +53 -9
  26. package/src/components/textarea-field/textarea-field.spec.ts +30 -0
  27. package/src/components/top-bar/top-bar-more-button.spec.ts +60 -0
  28. package/src/components/top-bar/top-bar.css +2 -2
  29. package/src/components/top-bar/top-bar.ts +47 -14
@@ -5412,7 +5412,7 @@
5412
5412
  {
5413
5413
  "kind": "variable",
5414
5414
  "name": "ObcIconButton",
5415
- "default": "class ObcIconButton extends LitElement { constructor(..._args) { super(..._args); this.variant = \"normal\"; this.activated = false; this.cornerLeft = false; this.cornerRight = false; this.activeColor = false; this.wide = false; this.disabled = false; this.progress = void 0; this.hasLabel = false; this.showDivider = true; this.focusable = true; this.ariaLabel = null; } get progressSpinner() { if (this.progress === void 0) return nothing; if (this.progress === 100) return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"#325B9A\" stroke-width=\"4\" fill=\"none\" /> </svg> </div>`; const angleRad = degToRad(this.progress * .95 * 3.6); const x = 20 + 18 * Math.sin(angleRad); const y = 20 - 18 * Math.cos(angleRad); return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"var(--container-backdrop-color)\" stroke-width=\"4\" fill=\"none\" /> <path d=\"M18 2 A18 18 0 ${angleRad > Math.PI ? 1 : 0} 1 ${x} ${y}\" stroke=\"var(--instrument-enhanced-secondary-color)\" stroke-width=\"4\" stroke-linecap=\"round\" /> </svg> </div>`; } render() { return html` <button class=${classMap({ wrapper: true, [\"variant-\" + this.variant]: true, activated: this.activated, \"corner-left\": this.cornerLeft, \"corner-right\": this.cornerRight, \"active-color\": this.activeColor, \"has-label\": this.hasLabel, wide: this.wide, progress: this.progress !== void 0, \"hide-divider\": !this.showDivider })} ?disabled=${this.disabled} aria-label=${ifDefined(this.ariaLabel ?? void 0)} tabindex=${ifDefined(this.focusable ? void 0 : -1)} part=\"wrapper\" > ${this.progress !== void 0 ? this.progressSpinner : nothing} <div class=\"visible-wrapper\" part=\"visible-wrapper\"> <div class=\"icon\" part=\"icon\"> <slot></slot> </div> </div> ${this.hasLabel ? html`<div class=\"label\" part=\"label\"> <slot name=\"label\"></slot> </div>` : nothing} </button> `; } static { this.styles = unsafeCSS(icon_button_default); } }"
5415
+ "default": "class ObcIconButton extends LitElement { constructor(..._args) { super(..._args); this.variant = \"normal\"; this.activated = false; this.cornerLeft = false; this.cornerRight = false; this.activeColor = false; this.wide = false; this.disabled = false; this.progress = void 0; this.hasLabel = false; this.showDivider = true; this.focusable = true; this.ariaLabel = null; } /** Focus lands on the button inside, not on the host. */ focus(options) { this.shadowRoot?.querySelector(\"button\")?.focus(options); } get progressSpinner() { if (this.progress === void 0) return nothing; if (this.progress === 100) return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"#325B9A\" stroke-width=\"4\" fill=\"none\" /> </svg> </div>`; const angleRad = degToRad(this.progress * .95 * 3.6); const x = 20 + 18 * Math.sin(angleRad); const y = 20 - 18 * Math.cos(angleRad); return html`<div class=\"progress-spinner\"> <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <circle cx=\"20\" cy=\"20\" r=\"18\" stroke=\"var(--container-backdrop-color)\" stroke-width=\"4\" fill=\"none\" /> <path d=\"M18 2 A18 18 0 ${angleRad > Math.PI ? 1 : 0} 1 ${x} ${y}\" stroke=\"var(--instrument-enhanced-secondary-color)\" stroke-width=\"4\" stroke-linecap=\"round\" /> </svg> </div>`; } render() { return html` <button class=${classMap({ wrapper: true, [\"variant-\" + this.variant]: true, activated: this.activated, \"corner-left\": this.cornerLeft, \"corner-right\": this.cornerRight, \"active-color\": this.activeColor, \"has-label\": this.hasLabel, wide: this.wide, progress: this.progress !== void 0, \"hide-divider\": !this.showDivider })} ?disabled=${this.disabled} aria-label=${ifDefined(this.ariaLabel ?? void 0)} tabindex=${ifDefined(this.focusable ? void 0 : -1)} part=\"wrapper\" > ${this.progress !== void 0 ? this.progressSpinner : nothing} <div class=\"visible-wrapper\" part=\"visible-wrapper\"> <div class=\"icon\" part=\"icon\"> <slot></slot> </div> </div> ${this.hasLabel ? html`<div class=\"label\" part=\"label\"> <slot name=\"label\"></slot> </div>` : nothing} </button> `; } static { this.styles = unsafeCSS(icon_button_default); } }"
5416
5416
  }
5417
5417
  ],
5418
5418
  "exports": [
@@ -6634,7 +6634,7 @@
6634
6634
  {
6635
6635
  "kind": "variable",
6636
6636
  "name": "ObcSplitButton",
6637
- "default": "class ObcSplitButton extends LitElement { constructor(..._args) { super(..._args); this.label = \"Split Button\"; this.hasIcon = false; this.options = []; this.selectedValues = []; this.menuType = ContextMenuType.Regular; this.itemsPerColumn = 5; this.hasTitleBar = false; this.menuTitle = \"\"; this.dropdownLabel = \"More options\"; this.fullWidth = false; this.disabled = false; this.openTop = false; this.columnGroups = []; this.isDropdownOpen = false; this.restoreFocusOnClose = false; this.menuFocusStrategy = \"selected\"; this.handlePrimaryClick = (e) => { e.stopPropagation(); this.dispatchEvent(new CustomEvent(\"click\", { detail: { action: \"primary\" } })); }; this.handleDropdownClick = (e) => { e.stopPropagation(); this.isDropdownOpen = !this.isDropdownOpen; this.dispatchEvent(new CustomEvent(\"click\", { detail: { action: \"dropdown\" } })); if (this.isDropdownOpen) { window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else window.removeEventListener(\"pointerdown\", this.closeOnOutside); }; this.handleDropdownKeydown = (event) => { if (this.disabled) return; switch (event.key) { case \"ArrowDown\": event.preventDefault(); this.menuFocusStrategy = \"first\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusFirstItem(); break; case \"ArrowUp\": event.preventDefault(); this.menuFocusStrategy = \"last\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusLastItem(); break; case \"Home\": event.preventDefault(); this.menuFocusStrategy = \"first\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusFirstItem(); break; case \"End\": event.preventDefault(); this.menuFocusStrategy = \"last\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusLastItem(); } }; this.closeOnOutside = (e) => { if (!this.contains(e.target)) { this.isDropdownOpen = false; window.removeEventListener(\"pointerdown\", this.closeOnOutside); } }; this.handleMenuItemClick = (e) => { const { option } = e.detail; if (this.menuType === ContextMenuType.Flyout && option.children && option.children.length) return; this.handleMenuClose(); }; this.handleMenuClose = () => { this.restoreFocusOnClose = true; this.isDropdownOpen = false; window.removeEventListener(\"pointerdown\", this.closeOnOutside); queueMicrotask(() => { if (this.restoreFocusOnClose) { this.restoreFocusOnClose = false; this.dropdownButton?.focus(); } }); }; } async focusMenuAfterOpen() { await this.updateComplete; if (!this.isDropdownOpen) return; if (this.menuFocusStrategy === \"last\") this.menu?.focusLastItem(); else if (this.menuFocusStrategy === \"first\") this.menu?.focusFirstItem(); else this.menu?.focusSelectedItem(); this.menuFocusStrategy = \"selected\"; } get isMultiSelect() { if (this.multiSelect !== void 0) return this.multiSelect; return [ ContextMenuType.Checkboxes, ContextMenuType.NestedCheckboxes, ContextMenuType.Multi, ContextMenuType.MultiWithSubtitles ].includes(this.menuType); } handleMenuChange(e) { this.selectedValues = e.detail.selectedValues; this.dispatchEvent(new CustomEvent(\"change\", { detail: e.detail })); this.handleMenuClose(); } disconnectedCallback() { window.removeEventListener(\"pointerdown\", this.closeOnOutside); super.disconnectedCallback(); } render() { return html` <div class=${classMap({ wrapper: true, \"full-width\": this.fullWidth, \"is-open\": this.isDropdownOpen, \"open-top\": this.openTop })} > <obc-button class=\"primary-button\" .variant=${\"normal\"} .segmentPosition=${segmentPosition.start} .showLeadingIcon=${this.hasIcon} .disabled=${this.disabled} @click=${this.handlePrimaryClick} .fullWidth=${this.fullWidth} > ${this.hasIcon ? html`<slot name=\"icon\" slot=\"leading-icon\"></slot>` : nothing} ${this.label} </obc-button> <obc-icon-button class=\"dropdown-button\" .variant=${\"normal\"} .cornerRight=${true} .disabled=${this.disabled} .activated=${this.isDropdownOpen} aria-label=${this.dropdownLabel} @click=${this.handleDropdownClick} @keydown=${this.handleDropdownKeydown} aria-expanded=${this.isDropdownOpen} aria-haspopup=\"menu\" > <obi-arrow-flyout-google></obi-arrow-flyout-google> </obc-icon-button> <!-- Context Menu --> ${this.isDropdownOpen && this.options.length > 0 ? html` <obc-context-menu-input class=\"positioned-menu\" .options=${this.options} .selectedValues=${this.selectedValues} .type=${this.menuType} .multiSelect=${this.isMultiSelect} .selectPerGroup=${true} .hasTitleBar=${this.hasTitleBar} .title=${this.menuTitle} .columnGroups=${this.columnGroups} .itemsPerColumn=${this.itemsPerColumn} @change=${this.handleMenuChange} @close=${this.handleMenuClose} @item-click=${this.handleMenuItemClick} /></obc-context-menu-input> ` : nothing} </div> `; } static { this.styles = unsafeCSS(split_button_default); } }"
6637
+ "default": "class ObcSplitButton extends LitElement { constructor(..._args) { super(..._args); this.label = \"Split Button\"; this.hasIcon = false; this.options = []; this.selectedValues = []; this.menuType = ContextMenuType.Regular; this.itemsPerColumn = 5; this.hasTitleBar = false; this.menuTitle = \"\"; this.dropdownLabel = \"More options\"; this.fullWidth = false; this.disabled = false; this.primaryDisabled = false; this.dropdownDisabled = false; this.openTop = false; this.openLeft = false; this.columnGroups = []; this.isDropdownOpen = false; this.restoreFocusOnClose = false; this.menuFocusStrategy = \"selected\"; this.handlePrimaryClick = (e) => { e.stopPropagation(); this.dispatchEvent(new CustomEvent(\"click\", { detail: { action: \"primary\" } })); }; this.handleDropdownClick = (e) => { e.stopPropagation(); this.isDropdownOpen = !this.isDropdownOpen; this.dispatchEvent(new CustomEvent(\"click\", { detail: { action: \"dropdown\" } })); if (this.isDropdownOpen) { window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else window.removeEventListener(\"pointerdown\", this.closeOnOutside); }; this.handleDropdownKeydown = (event) => { if (this.isDropdownDisabled) return; switch (event.key) { case \"ArrowDown\": event.preventDefault(); this.menuFocusStrategy = \"first\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusFirstItem(); break; case \"ArrowUp\": event.preventDefault(); this.menuFocusStrategy = \"last\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusLastItem(); break; case \"Home\": event.preventDefault(); this.menuFocusStrategy = \"first\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusFirstItem(); break; case \"End\": event.preventDefault(); this.menuFocusStrategy = \"last\"; if (!this.isDropdownOpen) { this.isDropdownOpen = true; window.addEventListener(\"pointerdown\", this.closeOnOutside); this.focusMenuAfterOpen(); } else this.menu?.focusLastItem(); } }; this.closeOnOutside = (e) => { if (!this.contains(e.target)) { this.isDropdownOpen = false; window.removeEventListener(\"pointerdown\", this.closeOnOutside); } }; this.handleMenuItemClick = (e) => { const { option } = e.detail; if (this.menuType === ContextMenuType.Flyout && option.children && option.children.length) return; this.handleMenuClose(); }; this.handleMenuClose = () => { this.restoreFocusOnClose = true; this.isDropdownOpen = false; window.removeEventListener(\"pointerdown\", this.closeOnOutside); queueMicrotask(() => { if (this.restoreFocusOnClose) { this.restoreFocusOnClose = false; this.dropdownButton?.focus(); } }); }; } get isPrimaryDisabled() { return this.disabled || this.primaryDisabled; } get isDropdownDisabled() { return this.disabled || this.dropdownDisabled; } async focusMenuAfterOpen() { await this.updateComplete; await this.menu?.updateComplete; if (!this.isDropdownOpen) return; if (this.menuFocusStrategy === \"last\") this.menu?.focusLastItem(); else if (this.menuFocusStrategy === \"first\") this.menu?.focusFirstItem(); else this.menu?.focusSelectedItem(); this.menuFocusStrategy = \"selected\"; } get isMultiSelect() { if (this.multiSelect !== void 0) return this.multiSelect; return [ ContextMenuType.Checkboxes, ContextMenuType.NestedCheckboxes, ContextMenuType.Multi, ContextMenuType.MultiWithSubtitles ].includes(this.menuType); } handleMenuChange(e) { this.selectedValues = e.detail.selectedValues; this.dispatchEvent(new CustomEvent(\"change\", { detail: e.detail })); this.handleMenuClose(); } disconnectedCallback() { window.removeEventListener(\"pointerdown\", this.closeOnOutside); super.disconnectedCallback(); } render() { return html` <div class=${classMap({ wrapper: true, \"full-width\": this.fullWidth, \"is-open\": this.isDropdownOpen, \"open-top\": this.openTop, \"open-left\": this.openLeft })} > <obc-button class=\"primary-button\" .variant=${\"normal\"} .segmentPosition=${segmentPosition.start} .showLeadingIcon=${this.hasIcon} .disabled=${this.isPrimaryDisabled} @click=${this.handlePrimaryClick} .fullWidth=${this.fullWidth} > ${this.hasIcon ? html`<slot name=\"icon\" slot=\"leading-icon\"></slot>` : nothing} ${this.label} </obc-button> <obc-icon-button class=\"dropdown-button\" .variant=${\"normal\"} .cornerRight=${true} .disabled=${this.isDropdownDisabled} .activated=${this.isDropdownOpen} aria-label=${this.dropdownLabel} @click=${this.handleDropdownClick} @keydown=${this.handleDropdownKeydown} aria-expanded=${this.isDropdownOpen} aria-haspopup=\"menu\" > <slot name=\"dropdown-icon\"> <obi-arrow-flyout-google aria-hidden=\"true\" ></obi-arrow-flyout-google> </slot> </obc-icon-button> <!-- Context Menu --> ${this.isDropdownOpen && this.options.length > 0 ? html` <obc-context-menu-input class=\"positioned-menu\" .options=${this.options} .selectedValues=${this.selectedValues} .type=${this.menuType} .multiSelect=${this.isMultiSelect} .selectPerGroup=${true} .hasTitleBar=${this.hasTitleBar} .title=${this.menuTitle} .columnGroups=${this.columnGroups} .itemsPerColumn=${this.itemsPerColumn} @change=${this.handleMenuChange} @close=${this.handleMenuClose} @item-click=${this.handleMenuItemClick} /></obc-context-menu-input> ` : nothing} </div> `; } static { this.styles = unsafeCSS(split_button_default); } }"
6638
6638
  }
6639
6639
  ],
6640
6640
  "exports": [
@@ -7455,7 +7455,7 @@
7455
7455
  {
7456
7456
  "kind": "variable",
7457
7457
  "name": "ObcTopBar",
7458
- "default": "class ObcTopBar extends LitElement { constructor(..._args) { super(..._args); this.appTitle = \"App\"; this.pageName = \"Page\"; this.menuButtonIcon = \"menu\"; this.menuButtonActivated = false; this.dimmingButtonActivated = false; this.appsButtonActivated = false; this.leftMoreButtonActivated = false; this.userButtonActivated = false; this.userButtonDisabled = false; this.tall = false; this.wideMenuButton = false; this.showAppsButton = false; this.showDimmingButton = false; this.showUserButton = false; this.showClock = false; this.showDate = false; this.showAppIcon = false; this.inactive = false; this.appButtonBreakpointPx = 500; this.dimmingButtonBreakpointPx = 500; this.appTitleBreakpointPx = 500; this.userButtonBreakpointPx = 500; this.appIconBreakpointPx = 500; this.settings = false; this.breadcrumbItems = []; this.leftButtonEvent = null; this.leftButtonTimeout = null; this.isLeftButtonDown = false; this.isEmergencyBrightness = false; } dimmingButtonClicked() { /** * Fired when the dimming (day/night) button is clicked. * @event dimming-button-clicked */ this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\")); } appsButtonClicked() { /** * Fired when the apps button is clicked. * @event apps-button-clicked */ this.dispatchEvent(new CustomEvent(\"apps-button-clicked\")); } leftMoreButtonClicked() { /** * Fired when the left more button is clicked. * @event left-more-button-clicked */ this.dispatchEvent(new CustomEvent(\"left-more-button-clicked\")); } userButtonClicked() { /** * Fired when the user/profile button is clicked. * @event user-button-clicked */ this.dispatchEvent(new CustomEvent(\"user-button-clicked\")); } leftButtonDown(event) { this.leftButtonEvent = event; this.isLeftButtonDown = true; this.leftButtonTimeout = setTimeout(() => { this.leftButtonEvent = null; this.dispatchEvent(new CustomEvent(\"emergency-brightness-start\")); this.isEmergencyBrightness = true; }, 500); } /** * Ends a hold. The event a short press stands for is dispatched from the * `click` that follows, not here: a menu opened while the pointer is still * going up gets closed again by that same click in current browsers, which * see it as a click outside a popover that has just opened. */ leftButtonUp() { if (this.leftButtonTimeout) { clearTimeout(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } /** * Sends the event a press of the hold button stands for. * * Enter, Space and a screen reader's activate command arrive as a `click` * with `detail` 0 and no pointer press before it, so they get the event * directly. A pointer click arrives with `detail` 1 after the press: the * event stored on the way down is sent now, unless the press ran long * enough to start emergency brightness, which used it up. */ leftButtonActivate(event, type) { if (event.detail === 0) { this.dispatchEvent(new CustomEvent(type)); return; } if (!this.leftButtonEvent) return; this.dispatchEvent(this.leftButtonEvent); this.leftButtonEvent = null; } leftButtonLeave() { if (!this.isLeftButtonDown) return; if (this.leftButtonTimeout) { clearInterval(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } render() { const leftGroup = []; if (this.settings) { leftGroup.push(html`<div class=\"menu-button\"> <obc-icon-button variant=\"flat\" aria-label=${msg(\"Close\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"close\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"close\")} > <obi-close-google></obi-close-google> </obc-icon-button> </div>`); leftGroup.push(html`<obc-icon-button variant=\"flat\" aria-label=${msg(\"Back\")} @click=${() => this.dispatchEvent(new CustomEvent(\"back\"))} > <obi-arrow-left-google></obi-arrow-left-google> </obc-icon-button>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<obc-breadcrumb .items=${this.breadcrumbItems} @breadcrumb-click=${(e) => this.dispatchEvent(new CustomEvent(\"breadcrumb-click\", { detail: e.detail }))} ></obc-breadcrumb>`); } else { if (!this.inactive) leftGroup.push(html`<div class=\"menu-button ${this.wideMenuButton ? \"wide\" : null}\"> <obc-icon-button variant=\"flat\" aria-label=${this.menuButtonIcon === \"menu\" ? msg(\"Menu\") : msg(\"Home\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"menu-button-clicked\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"menu-button-clicked\")} ?activated=${this.menuButtonActivated} > ${this.menuButtonIcon === \"menu\" ? html`<obi-menu-iec></obi-menu-iec>` : html`<obi-home></obi-home>`} </obc-icon-button> </div>`); if (this.showAppIcon) leftGroup.push(html`<div class=\"app-icon\"><slot name=\"app-icon\"></slot></div>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`); leftGroup.push(html`<slot name=\"command-button\"></slot>`); } const breakpointMoreButton = Math.max(this.appButtonBreakpointPx, this.dimmingButtonBreakpointPx); return html` <style> @media (max-width: ${breakpointMoreButton}px) { .left-more-button { display: revert !important; } .group.left > * { margin-right: 4px; margin-left: 4px; } } @media (max-width: ${this.appButtonBreakpointPx}px) { .apps-button { display: none; } } @media (max-width: ${this.dimmingButtonBreakpointPx}px) { .dimming-button { display: none; } } @media (max-width: ${this.appTitleBreakpointPx}px) { .title { display: none !important; /* the stylesheet's display wins over this inline rule otherwise */ } } @media (max-width: ${this.userButtonBreakpointPx}px) { .user-button { display: none; } } @media (max-width: ${this.appIconBreakpointPx}px) { .app-icon { display: none; } } </style> <nav class=${classMap({ wrapper: true, inactive: this.inactive, settings: this.settings, tall: this.tall })} > <div class=\"left group\">${leftGroup}</div> <div class=\"right group\"> <div class=\"alert-container\"> <slot name=\"alerts\"></slot> </div> ${this.showDimmingButton && !this.inactive ? html`<obc-icon-button class=\"dimming-button\" part=\"dimming-button\" variant=\"flat\" aria-label=${msg(\"Dimming\")} @click=${this.dimmingButtonClicked} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton && !this.inactive ? html`<obc-icon-button class=\"user-button\" variant=\"flat\" part=\"user-button\" aria-label=${msg(\"User\")} @click=${this.userButtonClicked} ?activated=${this.userButtonActivated} ?disabled=${this.userButtonDisabled} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showAppsButton && !this.inactive ? html`<obc-icon-button class=\"apps-button\" variant=\"flat\" part=\"apps-button\" aria-label=${msg(\"Apps\")} @click=${this.appsButtonClicked} ?activated=${this.appsButtonActivated} > <obi-applications></obi-applications> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} ${!this.inactive ? html`<obc-icon-button class=\"left-more-button\" part=\"left-more-button\" variant=\"flat\" aria-label=${msg(\"More\")} @click=${this.leftMoreButtonClicked} ?activated=${this.leftMoreButtonActivated} > <obi-more-vertical-google></obi-more-vertical-google> </obc-icon-button>` : null} </div> </nav> `; } static { this.styles = unsafeCSS(top_bar_default); } }"
7458
+ "default": "class ObcTopBar extends LitElement { constructor(..._args) { super(..._args); this.appTitle = \"App\"; this.pageName = \"Page\"; this.menuButtonIcon = \"menu\"; this.menuButtonActivated = false; this.dimmingButtonActivated = false; this.appsButtonActivated = false; this.moreButtonActivated = false; this.userButtonActivated = false; this.userButtonDisabled = false; this.tall = false; this.wideMenuButton = false; this.showAppsButton = false; this.showDimmingButton = false; this.showUserButton = false; this.showClock = false; this.showDate = false; this.showAppIcon = false; this.inactive = false; this.appButtonBreakpointPx = 500; this.dimmingButtonBreakpointPx = 500; this.appTitleBreakpointPx = 500; this.userButtonBreakpointPx = 500; this.appIconBreakpointPx = 500; this.settings = false; this.breadcrumbItems = []; this.leftButtonEvent = null; this.leftButtonTimeout = null; this.isLeftButtonDown = false; this.isEmergencyBrightness = false; } dimmingButtonClicked() { /** * Fired when the dimming (day/night) button is clicked. * @event dimming-button-clicked */ this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\")); } appsButtonClicked() { /** * Fired when the apps button is clicked. * @event apps-button-clicked */ this.dispatchEvent(new CustomEvent(\"apps-button-clicked\")); } /** * Copies the deprecated `leftMoreButtonActivated` into * `moreButtonActivated`. A plain field rather than a getter/setter alias: * the Vue wrapper writes every prop back on its second render, and a getter * would then write `false` over the new property. */ willUpdate(changed) { super.willUpdate(changed); if (changed.has(\"leftMoreButtonActivated\") && this.leftMoreButtonActivated !== void 0) this.moreButtonActivated = this.leftMoreButtonActivated; } moreButtonClicked() { /** * Fired when the more button is clicked. * @event more-button-clicked */ this.dispatchEvent(new CustomEvent(\"more-button-clicked\")); /** * Deprecated alias of `more-button-clicked`; removed in 4.0.0. * @event left-more-button-clicked */ this.dispatchEvent(new CustomEvent(\"left-more-button-clicked\")); } userButtonClicked() { /** * Fired when the user/profile button is clicked. * @event user-button-clicked */ this.dispatchEvent(new CustomEvent(\"user-button-clicked\")); } leftButtonDown(event) { this.leftButtonEvent = event; this.isLeftButtonDown = true; this.leftButtonTimeout = setTimeout(() => { this.leftButtonEvent = null; this.dispatchEvent(new CustomEvent(\"emergency-brightness-start\")); this.isEmergencyBrightness = true; }, 500); } /** * Ends a hold. The event a short press stands for is dispatched from the * `click` that follows, not here: a menu opened while the pointer is still * going up gets closed again by that same click in current browsers, which * see it as a click outside a popover that has just opened. */ leftButtonUp() { if (this.leftButtonTimeout) { clearTimeout(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } /** * Sends the event a press of the hold button stands for. * * Enter, Space and a screen reader's activate command arrive as a `click` * with `detail` 0 and no pointer press before it, so they get the event * directly. A pointer click arrives with `detail` 1 after the press: the * event stored on the way down is sent now, unless the press ran long * enough to start emergency brightness, which used it up. */ leftButtonActivate(event, type) { if (event.detail === 0) { this.dispatchEvent(new CustomEvent(type)); return; } if (!this.leftButtonEvent) return; this.dispatchEvent(this.leftButtonEvent); this.leftButtonEvent = null; } leftButtonLeave() { if (!this.isLeftButtonDown) return; if (this.leftButtonTimeout) { clearInterval(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } render() { const leftGroup = []; if (this.settings) { leftGroup.push(html`<div class=\"menu-button\"> <obc-icon-button variant=\"flat\" aria-label=${msg(\"Close\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"close\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"close\")} > <obi-close-google></obi-close-google> </obc-icon-button> </div>`); leftGroup.push(html`<obc-icon-button variant=\"flat\" aria-label=${msg(\"Back\")} @click=${() => this.dispatchEvent(new CustomEvent(\"back\"))} > <obi-arrow-left-google></obi-arrow-left-google> </obc-icon-button>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<obc-breadcrumb .items=${this.breadcrumbItems} @breadcrumb-click=${(e) => this.dispatchEvent(new CustomEvent(\"breadcrumb-click\", { detail: e.detail }))} ></obc-breadcrumb>`); } else { if (!this.inactive) leftGroup.push(html`<div class=\"menu-button ${this.wideMenuButton ? \"wide\" : null}\"> <obc-icon-button variant=\"flat\" aria-label=${this.menuButtonIcon === \"menu\" ? msg(\"Menu\") : msg(\"Home\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"menu-button-clicked\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"menu-button-clicked\")} ?activated=${this.menuButtonActivated} > ${this.menuButtonIcon === \"menu\" ? html`<obi-menu-iec></obi-menu-iec>` : html`<obi-home></obi-home>`} </obc-icon-button> </div>`); if (this.showAppIcon) leftGroup.push(html`<div class=\"app-icon\"><slot name=\"app-icon\"></slot></div>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`); leftGroup.push(html`<slot name=\"command-button\"></slot>`); } const breakpointMoreButton = Math.max(this.appButtonBreakpointPx, this.dimmingButtonBreakpointPx, this.userButtonBreakpointPx, this.appIconBreakpointPx); return html` <style> @media (max-width: ${breakpointMoreButton}px) { .more-button { display: revert !important; } .group.left > * { margin-right: 4px; margin-left: 4px; } } @media (max-width: ${this.appButtonBreakpointPx}px) { .apps-button { display: none; } } @media (max-width: ${this.dimmingButtonBreakpointPx}px) { .dimming-button { display: none; } } @media (max-width: ${this.appTitleBreakpointPx}px) { .title { display: none !important; /* the stylesheet's display wins over this inline rule otherwise */ } } @media (max-width: ${this.userButtonBreakpointPx}px) { .user-button { display: none; } } @media (max-width: ${this.appIconBreakpointPx}px) { .app-icon { display: none; } } </style> <nav class=${classMap({ wrapper: true, inactive: this.inactive, settings: this.settings, tall: this.tall })} > <div class=\"left group\">${leftGroup}</div> <div class=\"right group\"> <div class=\"alert-container\"> <slot name=\"alerts\"></slot> </div> ${this.showDimmingButton && !this.inactive ? html`<obc-icon-button class=\"dimming-button\" part=\"dimming-button\" variant=\"flat\" aria-label=${msg(\"Dimming\")} @click=${this.dimmingButtonClicked} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton && !this.inactive ? html`<obc-icon-button class=\"user-button\" variant=\"flat\" part=\"user-button\" aria-label=${msg(\"User\")} @click=${this.userButtonClicked} ?activated=${this.userButtonActivated} ?disabled=${this.userButtonDisabled} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showAppsButton && !this.inactive ? html`<obc-icon-button class=\"apps-button\" variant=\"flat\" part=\"apps-button\" aria-label=${msg(\"Apps\")} @click=${this.appsButtonClicked} ?activated=${this.appsButtonActivated} > <obi-applications></obi-applications> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} ${!this.inactive ? html`<obc-icon-button class=\"more-button\" part=\"more-button left-more-button\" variant=\"flat\" aria-label=${msg(\"More\")} @click=${this.moreButtonClicked} ?activated=${this.moreButtonActivated} > <obi-more-vertical-google></obi-more-vertical-google> </obc-icon-button>` : null} </div> </nav> `; } static { this.styles = unsafeCSS(top_bar_default); } }"
7459
7459
  }
7460
7460
  ],
7461
7461
  "exports": [
@@ -60543,6 +60543,26 @@
60543
60543
  "default": "null",
60544
60544
  "description": "Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary."
60545
60545
  },
60546
+ {
60547
+ "kind": "method",
60548
+ "name": "focus",
60549
+ "privacy": "public",
60550
+ "return": {
60551
+ "type": {
60552
+ "text": "void"
60553
+ }
60554
+ },
60555
+ "parameters": [
60556
+ {
60557
+ "name": "options",
60558
+ "optional": true,
60559
+ "type": {
60560
+ "text": "FocusOptions"
60561
+ }
60562
+ }
60563
+ ],
60564
+ "description": "Focus lands on the button inside, not on the host."
60565
+ },
60546
60566
  {
60547
60567
  "kind": "field",
60548
60568
  "name": "progressSpinner",
@@ -68482,12 +68502,16 @@
68482
68502
  "declarations": [
68483
68503
  {
68484
68504
  "kind": "class",
68485
- "description": "`<obc-split-button>` – A composite button component combining a primary action and a dropdown menu for additional actions or selections. Also known as a split button, segmented button, or action menu button.\n\nProvides a main button for a default/primary action and a secondary dropdown button that reveals a context menu with configurable options. This pattern allows users to quickly trigger a common action or select from a list of related actions or filters, improving workflow efficiency and reducing UI clutter.\n\n### Features\n- **Dual-action layout:** Combines a primary button (for the main action) and a dropdown button (for menu access) in a single horizontal control.\n- **Configurable dropdown menu:** Supports multiple menu types via `menuType` (regular, checkboxes, flyout, multi-column, etc.) for different selection and grouping needs.\n- **Multi-select and group selection:** Allows single or multiple selections in the dropdown, with optional grouping and per-group selection logic.\n- **Customizable menu content:** Accepts an array of options or column groups, supports icons, subtitles, and multi-column layouts for complex menus.\n- **Optional icon in primary button:** Add a leading icon to the main button using the `hasIcon` property and `icon` slot.\n- **Title bar and menu title:** Optionally display a title bar with close button and custom title text in the dropdown.\n- **Full width mode:** Can stretch to fill its container using the `fullWidth` property.\n- **Disabled state:** Disables both the primary and dropdown buttons when `disabled` is true.\n- **Dropdown positioning:** Menu can open above or below the button (`openTop`).\n- **Selection persistence:** Optionally keeps the selected state visually persistent in the menu.\n- **Keyboard and pointer accessibility:** Follows standard button and menu accessibility patterns.\n\n### Variants (Menu Types)\n- **Regular:** Standard single-selection dropdown menu.\n- **Checkboxes:** Menu with checkboxes for multi-selection.\n- **Flyout:** Hierarchical/flyout menu for nested actions.\n- **Multi:** Multi-column menu for large sets of options.\n- **MultiWithSubtitles:** Multi-column menu with grouped options and subtitles.\n- See `ContextMenuType` enum for all supported menu types.\n\n### Usage Guidelines\nUse `obc-split-button` when you want to provide a primary action alongside a set of related secondary actions or filters, without overwhelming the main UI. Ideal for toolbars, filter bars, or any context where a default action is common but alternatives should be easily accessible. For example, use it for \"Save\" (primary) with \"Save As...\" and \"Export\" (dropdown), or for filter controls with quick presets.\n\n- Prefer this component over a standalone dropdown when a default action is expected to be used frequently.\n- For menus with many options, use multi-column or grouped variants for better organization.\n- If only a single action is needed, use a standard `<obc-button>` instead.\n- For persistent or always-visible lists of actions, consider a toolbar or action list.\n- **TODO(designer):** Confirm best practices for when to use multi-select vs. single-select, and any recommended limits on number of options or columns.\n\n### Slots\n| Slot Name | Renders When... | Purpose |\n|-------------|---------------------|-----------------------------------------------------|\n| `icon` | `hasIcon` is true | Leading icon in the primary button (e.g., `<obi-placeholder></obi-placeholder>`) |\n\n### Events\n- `click` – Fired when either the primary or dropdown button is clicked. The event detail includes `{action: 'primary' | 'dropdown'}` to distinguish which part was activated.\n- `change` – Fired when the menu selection changes. The event detail includes `{selectedValues, selectedOptions}`.\n\n### Best Practices & Constraints\n- Only use multi-select when the menu type and use case require it; otherwise, prefer single selection for clarity.\n- Keep the primary action clear and distinct from dropdown actions.\n- For accessibility, ensure all menu options have clear labels and, if using icons, provide appropriate alt text or aria-labels.\n- Avoid overloading the dropdown with too many options; group or paginate if necessary.\n- The dropdown menu closes automatically when an option is selected (unless it is a group/flyout parent).\n- The component manages focus and pointer events to ensure proper menu closing when clicking outside.\n- **TODO(designer):** Specify recommended icon usage, menu title conventions, and any animation/timing guidelines for menu opening/closing.\n\n### Example:\n```html\n<obc-split-button\n label=\"Save\"\n .options=${[\n {value: 'save-as', label: 'Save As...'},\n {value: 'export', label: 'Export'},\n ]}\n hasIcon\n>\n <obi-placeholder slot=\"icon\"></obi-placeholder>\n</obc-split-button>\n```\nIn this example, the split button shows a \"Save\" action with a leading icon, and a dropdown menu with \"Save As...\" and \"Export\" options.",
68505
+ "description": "`<obc-split-button>` – A composite button component combining a primary action and a dropdown menu for additional actions or selections. Also known as a split button, segmented button, or action menu button.\n\nProvides a main button for a default/primary action and a secondary dropdown button that reveals a context menu with configurable options. This pattern allows users to quickly trigger a common action or select from a list of related actions or filters, improving workflow efficiency and reducing UI clutter.\n\n### Features\n- **Dual-action layout:** Combines a primary button (for the main action) and a dropdown button (for menu access) in a single horizontal control.\n- **Configurable dropdown menu:** Supports multiple menu types via `menuType` (regular, checkboxes, flyout, multi-column, etc.) for different selection and grouping needs.\n- **Multi-select and group selection:** Allows single or multiple selections in the dropdown, with optional grouping and per-group selection logic.\n- **Customizable menu content:** Accepts an array of options or column groups, supports icons, subtitles, and multi-column layouts for complex menus.\n- **Optional icon in primary button:** Add a leading icon to the main button using the `hasIcon` property and `icon` slot.\n- **Replaceable dropdown icon:** The dropdown button shows a chevron; fill the `dropdown-icon` slot to show another symbol, for example one that says what the menu holds.\n- **Title bar and menu title:** Optionally display a title bar with close button and custom title text in the dropdown.\n- **Full width mode:** Can stretch to fill its container using the `fullWidth` property.\n- **Disabled state:** `disabled` disables both halves; `primaryDisabled` and `dropdownDisabled` disable one half each, so the primary action can be unavailable while the menu stays in use.\n- **Dropdown positioning:** The menu opens below the button and extends to the right. `openTop` opens it above and `openLeft` extends it to the left, for a button near the bottom or the right edge of its container.\n- **Selection persistence:** Optionally keeps the selected state visually persistent in the menu.\n- **Keyboard and pointer accessibility:** Follows standard button and menu accessibility patterns.\n\n### Variants (Menu Types)\n- **Regular:** Standard single-selection dropdown menu.\n- **Checkboxes:** Menu with checkboxes for multi-selection.\n- **Flyout:** Hierarchical/flyout menu for nested actions.\n- **Multi:** Multi-column menu for large sets of options.\n- **MultiWithSubtitles:** Multi-column menu with grouped options and subtitles.\n- See `ContextMenuType` enum for all supported menu types.\n\n### Usage Guidelines\nUse `obc-split-button` when you want to provide a primary action alongside a set of related secondary actions or filters, without overwhelming the main UI. Ideal for toolbars, filter bars, or any context where a default action is common but alternatives should be easily accessible. For example, use it for \"Save\" (primary) with \"Save As...\" and \"Export\" (dropdown), or for filter controls with quick presets.\n\n- Prefer this component over a standalone dropdown when a default action is expected to be used frequently.\n- For menus with many options, use multi-column or grouped variants for better organization.\n- If only a single action is needed, use a standard `<obc-button>` instead.\n- For persistent or always-visible lists of actions, consider a toolbar or action list.\n- **TODO(designer):** Confirm best practices for when to use multi-select vs. single-select, and any recommended limits on number of options or columns.\n\n### Slots\n| Slot Name | Renders When... | Purpose |\n|-----------------|---------------------|-----------------------------------------------------|\n| `icon` | `hasIcon` is true | Leading icon in the primary button (e.g., `<obi-placeholder></obi-placeholder>`) |\n| `dropdown-icon` | Always | Icon of the dropdown button; the chevron when empty |\n\n### Events\n- `click` – Fired when either the primary or dropdown button is clicked. The event detail includes `{action: 'primary' | 'dropdown'}` to distinguish which part was activated.\n- `change` – Fired when the menu selection changes. The event detail includes `{selectedValues, selectedOptions}`.\n\n### Keyboard\nThe primary half is a plain button. The dropdown half follows the\n[APG Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/):\n`Enter` and `Space` open the menu, `ArrowDown` and `Home` open it on the\nfirst item, `ArrowUp` and `End` on the last, and `Escape` closes it and\nreturns focus to the dropdown half. The menu is `obc-context-menu-input`.\n\nLeft out: `Enter` and `Space` land on the selected item rather than the\nfirst, so a reopened selection menu starts where the user left it.\n\n### Best Practices & Constraints\n- Only use multi-select when the menu type and use case require it; otherwise, prefer single selection for clarity.\n- Keep the primary action clear and distinct from dropdown actions.\n- For accessibility, ensure all menu options have clear labels and, if using icons, provide appropriate alt text or aria-labels.\n- Avoid overloading the dropdown with too many options; group or paginate if necessary.\n- The dropdown menu closes automatically when an option is selected (unless it is a group/flyout parent).\n- The component manages focus and pointer events to ensure proper menu closing when clicking outside.\n- **TODO(designer):** Specify recommended icon usage, menu title conventions, and any animation/timing guidelines for menu opening/closing.\n\n### Example:\n```html\n<obc-split-button\n label=\"Save\"\n .options=${[\n {value: 'save-as', label: 'Save As...'},\n {value: 'export', label: 'Export'},\n ]}\n hasIcon\n>\n <obi-placeholder slot=\"icon\"></obi-placeholder>\n</obc-split-button>\n```\nIn this example, the split button shows a \"Save\" action with a leading icon, and a dropdown menu with \"Save As...\" and \"Export\" options.",
68486
68506
  "name": "ObcSplitButton",
68487
68507
  "slots": [
68488
68508
  {
68489
68509
  "description": "Leading icon for the primary button (shown when `hasIcon` is true)",
68490
68510
  "name": "icon"
68511
+ },
68512
+ {
68513
+ "description": "Icon of the dropdown button; the chevron when empty.",
68514
+ "name": "dropdown-icon"
68491
68515
  }
68492
68516
  ],
68493
68517
  "members": [
@@ -68605,6 +68629,24 @@
68605
68629
  "default": "false",
68606
68630
  "description": "Whether both parts of the button are disabled. When true, disables both the primary and dropdown buttons."
68607
68631
  },
68632
+ {
68633
+ "kind": "field",
68634
+ "name": "primaryDisabled",
68635
+ "type": {
68636
+ "text": "boolean"
68637
+ },
68638
+ "default": "false",
68639
+ "description": "Disables the primary button alone, for an action the user cannot take right now while the menu stays in use, for example to ask for the access the action needs."
68640
+ },
68641
+ {
68642
+ "kind": "field",
68643
+ "name": "dropdownDisabled",
68644
+ "type": {
68645
+ "text": "boolean"
68646
+ },
68647
+ "default": "false",
68648
+ "description": "Disables the dropdown button alone, leaving the primary action."
68649
+ },
68608
68650
  {
68609
68651
  "kind": "field",
68610
68652
  "name": "openTop",
@@ -68614,6 +68656,15 @@
68614
68656
  "default": "false",
68615
68657
  "description": "Open context menu dropdown above (`true`) or below (`false`) the button. Useful for placement near the bottom of the viewport."
68616
68658
  },
68659
+ {
68660
+ "kind": "field",
68661
+ "name": "openLeft",
68662
+ "type": {
68663
+ "text": "boolean"
68664
+ },
68665
+ "default": "false",
68666
+ "description": "Extend the menu to the left of the dropdown button (`true`), its right edge on the button's right edge, instead of to the right. For a button near the right edge of its container; combines with `openTop`."
68667
+ },
68617
68668
  {
68618
68669
  "kind": "field",
68619
68670
  "name": "columnGroups",
@@ -68666,6 +68717,24 @@
68666
68717
  },
68667
68718
  "privacy": "private"
68668
68719
  },
68720
+ {
68721
+ "kind": "field",
68722
+ "name": "isPrimaryDisabled",
68723
+ "type": {
68724
+ "text": "boolean"
68725
+ },
68726
+ "privacy": "private",
68727
+ "readonly": true
68728
+ },
68729
+ {
68730
+ "kind": "field",
68731
+ "name": "isDropdownDisabled",
68732
+ "type": {
68733
+ "text": "boolean"
68734
+ },
68735
+ "privacy": "private",
68736
+ "readonly": true
68737
+ },
68669
68738
  {
68670
68739
  "kind": "field",
68671
68740
  "name": "handlePrimaryClick",
@@ -74758,8 +74827,18 @@
74758
74827
  "declarations": [
74759
74828
  {
74760
74829
  "kind": "class",
74761
- "description": "`<obc-top-bar>` – A responsive top navigation bar component for application layouts.\n\nProvides a flexible, highly configurable top bar for application interfaces, supporting navigation, context display, quick actions, and status indicators. The top bar adapts to screen size and can show or hide elements such as menu, app icon, breadcrumbs, user/profile, clock, and alert notifications.\n\nAppears at the top of the UI, organizing primary navigation and contextual actions in a single, persistent region. Designed for use as the main app bar or header in multi-pane or dashboard-style layouts.\n\n## Features\n- **Configurable Sections:** Supports left and right-aligned groups for navigation, context, and actions.\n- **Menu Button:** Optional menu button for opening navigation drawers or sidebars; can be styled as wide or regular.\n- **App Icon Slot:** Customizable slot for displaying an application or brand icon.\n- **App Title & Page Name:** Displays the current application and page context.\n- **Breadcrumbs:** Optional breadcrumb navigation for hierarchical context (in settings mode).\n- **Command Button Slot:** Slot for inserting a primary command/action button.\n- **Alert/Notification Area:** Slot for alert indicators, notification badges, or custom alert components.\n- **Dimming Button:** Optional button for toggling display modes (e.g., day/night).\n- **User/Profile Button:** Optional user icon for profile/account actions.\n- **Apps Button:** Optional button for accessing additional applications or modules.\n- **Clock & Date:** Optional digital clock and date display, responsive to screen size.\n- **Responsive Layout:** Multiple breakpoint properties to control visibility and layout of elements based on viewport width.\n- **Settings Mode:** Special mode with close, back, and forward navigation, breadcrumbs, and app title.\n- **Tall Variant:** Optional increased height for touch or accessibility needs.\n- **Inactive State:** Disables interactive elements and visually de-emphasizes the bar.\n\n## Variants\n- **Regular:** Standard top bar with menu, app icon, title, page name, and action slots.\n- **Settings:** Shows close, back, forward buttons, breadcrumbs, and app title for configuration or settings screens.\n- **Inactive:** Visually muted and disables interaction (e.g., when the app is locked or in a modal state).\n- **Tall:** Increases the height of the bar for improved touch targets.\n\n## Usage Guidelines\nUse `<obc-top-bar>` as the persistent header for your application, providing navigation, context, and quick access to key actions or status. Configure which elements appear via boolean properties and slots. Adjust breakpoint properties to control responsive behavior for each section.\n\n- Place navigation, branding, and context (title, breadcrumbs) on the left; actions, alerts, and status (clock, user, apps) on the right.\n- Use the `settings` property for configuration or setup screens to enable close/back/forward navigation and breadcrumbs.\n- Use the `inactive` property to visually disable the bar and its actions when the app is not interactive.\n- Insert custom icons or buttons using the `app-icon` and `command-button` slots.\n- Use the `alerts` slot to display alert indicators, notification badges, or custom alert components.\n\n**TODO(designer):** Clarify recommended combinations of visible elements for different app contexts (e.g., when to show both user and apps buttons, or best practices for alert placement).\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|------------------|---------------------------------|----------------------------------------------------------------|\n| `app-icon` | `showAppIcon` is true | Custom icon representing the application or brand. |\n| `command-button` | Always (if provided) | Primary command or action button for the current context. |\n| `alerts` | Always (if provided) | Area for alert indicators, notification badges, or alert items.|\n| `clock` | Always (if provided) | Clock component for displaying the current time. |\n\n## Events\n- `menu-button-clicked` – Fired when the menu button is clicked.\n- `dimming-button-clicked` – Fired when the dimming (day/night) button is clicked.\n- `apps-button-clicked` – Fired when the apps button is clicked.\n- `left-more-button-clicked` – Fired when the left more button is clicked.\n- `user-button-clicked` – Fired when the user/profile button is clicked.\n- `close` – Fired in settings mode when the close button is clicked.\n- `back` – Fired in settings mode when the back button is clicked.\n- `forward` – Fired in settings mode when the forward button is clicked.\n- `emergency-brightness-start` – Fired when the menu button is held for 500ms. This should increase the brightness of the screen slowly. Used when the screen is too dark.\n- `emergency-brightness-stop` – Fired when the menu button is released.\n\n## Keyboard\nEvery control in the bar is its own tab stop and activates on `Enter` and\n`Space`. The bar is a navigation landmark, not an APG toolbar: its controls\nare separate components and slotted consumer content, so a roving tabindex\nacross them is deliberately not implemented. The emergency-brightness hold\nis a pointer gesture only; from the keyboard the menu button opens the menu.\n\n## Best Practices and Constraints\n- Only show interactive elements relevant to the current context to avoid clutter.\n- Use the `alerts` slot for transient or critical notifications; persistent alerts may require a different component.\n- For accessibility, give all interactive elements labels and focus handling.\n- Adjust breakpoint properties to optimize the layout for different device sizes.\n- In settings mode, use breadcrumbs to provide clear navigation context.\n\n## Example\n\n```html\n<obc-top-bar\n appTitle=\"My App\"\n pageName=\"Dashboard\"\n showAppsButton\n showDimmingButton\n showClock\n showUserButton\n showAppIcon\n>\n <obi-placeholder slot=\"app-icon\"></obi-placeholder>\n <obc-command-button slot=\"command-button\"></obc-command-button>\n <obc-topbar-message-item slot=\"alerts\"></obc-topbar-message-item>\n <obc-clock slot=\"clock\"></obc-clock>\n</obc-top-bar>\n```",
74830
+ "description": "`<obc-top-bar>` – A responsive top navigation bar component for application layouts.\n\nProvides a flexible, highly configurable top bar for application interfaces, supporting navigation, context display, quick actions, and status indicators. The top bar adapts to screen size and can show or hide elements such as menu, app icon, breadcrumbs, user/profile, clock, and alert notifications.\n\nAppears at the top of the UI, organizing primary navigation and contextual actions in a single, persistent region. Designed for use as the main app bar or header in multi-pane or dashboard-style layouts.\n\n## Features\n- **Configurable Sections:** Supports left and right-aligned groups for navigation, context, and actions.\n- **Menu Button:** Optional menu button for opening navigation drawers or sidebars; can be styled as wide or regular.\n- **App Icon Slot:** Customizable slot for displaying an application or brand icon.\n- **App Title & Page Name:** Displays the current application and page context.\n- **Breadcrumbs:** Optional breadcrumb navigation for hierarchical context (in settings mode).\n- **Command Button Slot:** Slot for inserting a primary command/action button.\n- **Alert/Notification Area:** Slot for alert indicators, notification badges, or custom alert components.\n- **Dimming Button:** Optional button for toggling display modes (e.g., day/night).\n- **User/Profile Button:** Optional user icon for profile/account actions.\n- **Apps Button:** Optional button for accessing additional applications or modules.\n- **Clock & Date:** Optional digital clock and date display, responsive to screen size.\n- **Responsive Layout:** Multiple breakpoint properties to control visibility and layout of elements based on viewport width.\n- **Settings Mode:** Special mode with close, back, and forward navigation, breadcrumbs, and app title.\n- **Tall Variant:** Optional increased height for touch or accessibility needs.\n- **Inactive State:** Disables interactive elements and visually de-emphasizes the bar.\n\n## Variants\n- **Regular:** Standard top bar with menu, app icon, title, page name, and action slots.\n- **Settings:** Shows close, back, forward buttons, breadcrumbs, and app title for configuration or settings screens.\n- **Inactive:** Visually muted and disables interaction (e.g., when the app is locked or in a modal state).\n- **Tall:** Increases the height of the bar for improved touch targets.\n\n## Usage Guidelines\nUse `<obc-top-bar>` as the persistent header for your application, providing navigation, context, and quick access to key actions or status. Configure which elements appear via boolean properties and slots. Adjust breakpoint properties to control responsive behavior for each section.\n\n- Place navigation, branding, and context (title, breadcrumbs) on the left; actions, alerts, and status (clock, user, apps) on the right.\n- Use the `settings` property for configuration or setup screens to enable close/back/forward navigation and breadcrumbs.\n- Use the `inactive` property to visually disable the bar and its actions when the app is not interactive.\n- Insert custom icons or buttons using the `app-icon` and `command-button` slots.\n- Use the `alerts` slot to display alert indicators, notification badges, or custom alert components.\n\n**TODO(designer):** Clarify recommended combinations of visible elements for different app contexts (e.g., when to show both user and apps buttons, or best practices for alert placement).\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|------------------|---------------------------------|----------------------------------------------------------------|\n| `app-icon` | `showAppIcon` is true | Custom icon representing the application or brand. |\n| `command-button` | Always (if provided) | Primary command or action button for the current context. |\n| `alerts` | Always (if provided) | Area for alert indicators, notification badges, or alert items.|\n| `clock` | Always (if provided) | Clock component for displaying the current time. |\n\n## Events\n- `menu-button-clicked` – Fired when the menu button is clicked.\n- `dimming-button-clicked` – Fired when the dimming (day/night) button is clicked.\n- `apps-button-clicked` – Fired when the apps button is clicked.\n- `more-button-clicked` – Fired when the more button is clicked.\n- `left-more-button-clicked` – Deprecated alias of `more-button-clicked`, fired with it; removed in 4.0.0.\n- `user-button-clicked` – Fired when the user/profile button is clicked.\n- `close` – Fired in settings mode when the close button is clicked.\n- `back` – Fired in settings mode when the back button is clicked.\n- `forward` – Fired in settings mode when the forward button is clicked.\n- `emergency-brightness-start` – Fired when the menu button is held for 500ms. This should increase the brightness of the screen slowly. Used when the screen is too dark.\n- `emergency-brightness-stop` – Fired when the menu button is released.\n\n## Keyboard\nEvery control in the bar is its own tab stop and activates on `Enter` and\n`Space`. The bar is a navigation landmark, not an APG toolbar: its controls\nare separate components and slotted consumer content, so a roving tabindex\nacross them is deliberately not implemented. The emergency-brightness hold\nis a pointer gesture only; from the keyboard the menu button opens the menu.\n\n## Best Practices and Constraints\n- Only show interactive elements relevant to the current context to avoid clutter.\n- Use the `alerts` slot for transient or critical notifications; persistent alerts may require a different component.\n- For accessibility, give all interactive elements labels and focus handling.\n- Adjust breakpoint properties to optimize the layout for different device sizes.\n- In settings mode, use breadcrumbs to provide clear navigation context.\n\n## Example\n\n```html\n<obc-top-bar\n appTitle=\"My App\"\n pageName=\"Dashboard\"\n showAppsButton\n showDimmingButton\n showClock\n showUserButton\n showAppIcon\n>\n <obi-placeholder slot=\"app-icon\"></obi-placeholder>\n <obc-command-button slot=\"command-button\"></obc-command-button>\n <obc-topbar-message-item slot=\"alerts\"></obc-topbar-message-item>\n <obc-clock slot=\"clock\"></obc-clock>\n</obc-top-bar>\n```",
74762
74831
  "name": "ObcTopBar",
74832
+ "cssParts": [
74833
+ {
74834
+ "description": "The more button shown below the breakpoints.",
74835
+ "name": "more-button"
74836
+ },
74837
+ {
74838
+ "description": "Deprecated alias of the `more-button` part; removed in 4.0.0.",
74839
+ "name": "left-more-button"
74840
+ }
74841
+ ],
74763
74842
  "slots": [
74764
74843
  {
74765
74844
  "description": "Custom icon representing the application or brand (shown when `showAppIcon` is true)",
@@ -74830,12 +74909,20 @@
74830
74909
  },
74831
74910
  {
74832
74911
  "kind": "field",
74833
- "name": "leftMoreButtonActivated",
74912
+ "name": "moreButtonActivated",
74834
74913
  "type": {
74835
74914
  "text": "boolean"
74836
74915
  },
74837
74916
  "default": "false",
74838
- "description": "Highlights the left more button as active."
74917
+ "description": "Highlights the more button as active."
74918
+ },
74919
+ {
74920
+ "kind": "field",
74921
+ "name": "leftMoreButtonActivated",
74922
+ "type": {
74923
+ "text": "boolean | undefined"
74924
+ },
74925
+ "deprecated": "Use `moreButtonActivated`. Removed in 4.0.0."
74839
74926
  },
74840
74927
  {
74841
74928
  "kind": "field",
@@ -75011,7 +75098,25 @@
75011
75098
  },
75012
75099
  {
75013
75100
  "kind": "method",
75014
- "name": "leftMoreButtonClicked",
75101
+ "name": "willUpdate",
75102
+ "return": {
75103
+ "type": {
75104
+ "text": "void"
75105
+ }
75106
+ },
75107
+ "parameters": [
75108
+ {
75109
+ "name": "changed",
75110
+ "type": {
75111
+ "text": "PropertyValues<this>"
75112
+ }
75113
+ }
75114
+ ],
75115
+ "description": "Copies the deprecated `leftMoreButtonActivated` into\n`moreButtonActivated`. A plain field rather than a getter/setter alias:\nthe Vue wrapper writes every prop back on its second render, and a getter\nwould then write `false` over the new property."
75116
+ },
75117
+ {
75118
+ "kind": "method",
75119
+ "name": "moreButtonClicked",
75015
75120
  "privacy": "private"
75016
75121
  },
75017
75122
  {
@@ -75124,12 +75229,19 @@
75124
75229
  },
75125
75230
  "description": "Fired when the apps button is clicked"
75126
75231
  },
75232
+ {
75233
+ "name": "more-button-clicked",
75234
+ "type": {
75235
+ "text": "CustomEvent"
75236
+ },
75237
+ "description": "Fired when the more button is clicked"
75238
+ },
75127
75239
  {
75128
75240
  "name": "left-more-button-clicked",
75129
75241
  "type": {
75130
75242
  "text": "CustomEvent"
75131
75243
  },
75132
- "description": "Fired when the left more button is clicked"
75244
+ "description": "Deprecated: listen to `more-button-clicked` instead. Fired together with it; removed in 4.0.0."
75133
75245
  },
75134
75246
  {
75135
75247
  "name": "user-button-clicked",
@@ -124,6 +124,8 @@ export declare class ObcIconButton extends LitElement {
124
124
  focusable: boolean;
125
125
  /** Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary. */
126
126
  ariaLabel: string | null;
127
+ /** Focus lands on the button inside, not on the host. */
128
+ focus(options?: FocusOptions): void;
127
129
  get progressSpinner(): import('lit-html').TemplateResult<1> | typeof nothing;
128
130
  render(): import('lit-html').TemplateResult<1>;
129
131
  static styles: import('lit').CSSResult;
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAQzD;;;;;;GAMG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,WAAW,gBAAgB;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,qBACa,aAAc,SAAQ,UAAU;IACjB,OAAO,EAAE,iBAAiB,CACzB;IAEA,SAAS,UAAS;IAElB,UAA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,MAAM;IAqCf,OAAgB,MAAM,0BAAwB;CAC/C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
@@ -37,6 +37,10 @@ var ObcIconButton = class ObcIconButton extends LitElement {
37
37
  this.focusable = true;
38
38
  this.ariaLabel = null;
39
39
  }
40
+ /** Focus lands on the button inside, not on the host. */
41
+ focus(options) {
42
+ this.shadowRoot?.querySelector("button")?.focus(options);
43
+ }
40
44
  get progressSpinner() {
41
45
  if (this.progress === void 0) return nothing;
42
46
  if (this.progress === 100) return html`<div class="progress-spinner">
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.js","names":[],"sources":["../../../src/components/icon-button/icon-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport iconStyle from './icon-button.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {customElement} from '../../decorator.js';\nimport {degToRad} from '../../svghelpers/math.js';\n\n/**\n * The available visual variants for `<obc-icon-button>`.\n * - `normal`: Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n */\nexport enum IconButtonVariant {\n normal = 'normal',\n raised = 'raised',\n flat = 'flat',\n integration = 'integration',\n}\n\n/**\n * `<obc-icon-button>` – An icon-only or icon-with-label button for quick actions.\n *\n * Provides a compact, visually prominent button that displays an icon (and optionally a label) for triggering actions. Commonly used for toolbars, navigation, or contextual actions where space is limited and a recognizable icon can represent the function.\n *\n * Appears as a circular or rounded button with configurable visual styles, supporting progress indication and various layout adaptations.\n *\n * ## Features\n * - **Variants:**\n * - `normal` (default): Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n * - **Progress Indicator:**\n * - Shows a circular progress spinner overlay when the `progress` property is set (0–100). Useful for indicating loading or ongoing actions.\n * - **Label Support:**\n * - Optionally displays a text label below the icon when `hasLabel` is true and content is provided in the `label` slot.\n * - **Corner Alignment:**\n * - `cornerLeft` and `cornerRight` adjust the button's border radius and alignment for flush placement at the start or end of a container.\n * - **Active State:**\n * - `activated` visually highlights the button as selected or toggled.\n * - `activeColor` applies an accent color for emphasis.\n * - **Wide Mode:**\n * - `wide` increases the button's width for easier touch targets or visual balance.\n * - **Disabled State:**\n * - `disabled` prevents interaction and visually dims the button.\n *\n * ## Usage Guidelines\n * - Use `obc-icon-button` for actions represented by icons, such as toolbars, navigation, or quick-access commands.\n * - Add a label (with `hasLabel` and the `label` slot) when clarity is needed or when icons alone may not be universally understood.\n * - Use the progress indicator for actions that take time, such as uploads or background processes.\n * - Prefer the `normal` variant for most cases; use `raised` to draw attention, and `flat` for less prominent or inline actions.\n * - For grouped or edge-aligned layouts, use `cornerLeft` or `cornerRight` to visually merge with container edges.\n * - Avoid using icon buttons for destructive or critical actions unless paired with clear feedback.\n * - **TODO(designer):** Clarify recommended icon sizes and when to use label vs. icon-only.\n *\n * ## Slots\n * | Slot Name | Renders When... | Purpose |\n * |-----------|---------------------|----------------------------------------------|\n * | (default) | Always | The icon to display (e.g., `<obi-search>`) |\n * | label | If `hasLabel` is set | Optional label text below the icon |\n *\n * ## Events\n * - Emits a standard `click` event (`onClick` handler in framework wrappers) when activated.\n *\n * ## Best Practices\n * - Ensure icons are clear and universally recognizable.\n * - For accessibility, provide an `aria-label` or descriptive label for the button's action.\n * - When using the progress indicator, avoid showing it for very short actions to prevent visual flicker.\n *\n * ## Example:\n * ```\n * <obc-icon-button variant=\"normal\">\n * <obi-search></obi-search>\n * </obc-icon-button>\n *\n * <obc-icon-button variant=\"normal\" hasLabel>\n * <obi-arrow></obi-arrow>\n * <span slot=\"label\">Next</span>\n * </obc-icon-button>\n * ```\n *\n * @property activated - Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n * @property cornerLeft - If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property cornerRight - If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property activeColor - Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n * @property wide - Increases the button's width for larger touch targets or visual balance.\n * @property disabled - Disables the button, preventing user interaction and dimming its appearance.\n * @property progress - Shows a circular progress indicator overlay when set (0–100).\n * Use to indicate ongoing actions or loading states.\n * If undefined, no progress indicator is shown.\n * @property hasLabel - If true, displays a label below the icon using the `label` slot.\n * @property showDivider - If false, and cornerLeft or cornerRight is true, the divider is not shown.\n * @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.\n * @property focusable - Whether the button is in the tab sequence. Turn it off for a button inside a\n * composite widget that owns the tab stop, and give the widget a key for the action.\n * @property variant - Visual style: `normal` (default) is the standard appearance, `raised` adds\n * a shadow, `flat` drops the background.\n * @slot - Icon slot (default): Place an icon such as <obi-search> here.\n * @slot label - Optional label shown below the icon when `hasLabel` is true.\n * @fires click - Fired when the button is clicked (if not disabled).\n * @stable\n */\n@customElement('obc-icon-button')\nexport class ObcIconButton extends LitElement {\n @property({type: String}) variant: IconButtonVariant =\n IconButtonVariant.normal;\n\n @property({type: Boolean}) activated = false;\n\n @property({type: Boolean}) cornerLeft = false;\n\n @property({type: Boolean}) cornerRight = false;\n\n @property({type: Boolean}) activeColor = false;\n\n @property({type: Boolean}) wide = false;\n\n @property({type: Boolean}) disabled = false;\n\n @property({type: Number}) progress: undefined | number = undefined;\n\n @property({type: Boolean}) hasLabel: boolean = false;\n\n @property({type: Boolean, attribute: false}) showDivider = true;\n\n @property({type: Boolean, attribute: false}) focusable = true;\n\n // Reactive so a consumer swapping the name (Play → Pause) re-renders the shadow button.\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel: string | null = null;\n\n get progressSpinner() {\n if (this.progress === undefined) {\n return nothing;\n }\n if (this.progress === 100) {\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"#325B9A\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n </svg>\n </div>`;\n }\n const angleRad = degToRad(this.progress * 0.95 * 3.6);\n const x = 20 + 18 * Math.sin(angleRad);\n const y = 20 - 18 * Math.cos(angleRad);\n const largeArcFlag = angleRad > Math.PI ? 1 : 0;\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"var(--container-backdrop-color)\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n <path\n d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>`;\n }\n\n override render() {\n return html`\n <button\n class=${classMap({\n wrapper: true,\n ['variant-' + this.variant]: true,\n activated: this.activated,\n 'corner-left': this.cornerLeft,\n 'corner-right': this.cornerRight,\n 'active-color': this.activeColor,\n 'has-label': this.hasLabel,\n wide: this.wide,\n progress: this.progress !== undefined,\n 'hide-divider': !this.showDivider,\n })}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.ariaLabel ?? undefined)}\n tabindex=${ifDefined(this.focusable ? undefined : -1)}\n part=\"wrapper\"\n >\n ${this.progress !== undefined ? this.progressSpinner : nothing}\n <div class=\"visible-wrapper\" part=\"visible-wrapper\">\n <div class=\"icon\" part=\"icon\">\n <slot></slot>\n </div>\n </div>\n ${\n this.hasLabel\n ? html`<div class=\"label\" part=\"label\">\n <slot name=\"label\"></slot>\n </div>`\n : nothing\n }\n </button>\n `;\n }\n\n static override styles = unsafeCSS(iconStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-icon-button': ObcIconButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,YAAA;CACA,kBAAA,YAAA;CACA,kBAAA,UAAA;CACA,kBAAA,iBAAA;;AACF,EAAA,CAAA,CAAA;AA0FO,IAAM,gBAAN,MAAM,sBAAsB,WAAW;;;;EAIL,KAAA,YAAA;EAEC,KAAA,aAAA;EAEC,KAAA,cAAA;EAEA,KAAA,cAAA;EAEP,KAAA,OAAA;EAEI,KAAA,WAAA;EAEmB,KAAA,WAAA,KAAA;EAEV,KAAA,WAAA;EAEY,KAAA,cAAA;EAEF,KAAA,YAAA;EAIrB,KAAA,YAAA;;CAEpC,IAAI,kBAAkB;EACpB,IAAI,KAAK,aAAa,KAAA,GACpB,OAAO;EAET,IAAI,KAAK,aAAa,KACpB,OAAO,IAAI;;;;;;;;;;;;;;;;;;EAmBb,MAAM,WAAW,SAAS,KAAK,WAAW,MAAO,GAAG;EACpD,MAAM,IAAI,KAAK,KAAK,KAAK,IAAI,QAAQ;EACrC,MAAM,IAAI,KAAK,KAAK,KAAK,IAAI,QAAQ;EAErC,OAAO,IAAI;;;;;;;;;;;;;;;;;8BADU,WAAW,KAAK,KAAK,IAAI,EAkBP,KAAK,EAAE,GAAG,EAAE;;;;;;;CAOrD;CAEA,SAAkB;EAChB,OAAO,IAAI;;gBAEC,SAAS;GACf,SAAS;IACR,aAAa,KAAK,UAAU;GAC7B,WAAW,KAAK;GAChB,eAAe,KAAK;GACpB,gBAAgB,KAAK;GACrB,gBAAgB,KAAK;GACrB,aAAa,KAAK;GAClB,MAAM,KAAK;GACX,UAAU,KAAK,aAAa,KAAA;GAC5B,gBAAgB,CAAC,KAAK;EACxB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S,WAAW;AAAK,CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AAG1C,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AA1BlD,gBAAA,WAAA,CAAA,cAAc,iBAAiB,CAAA,GAAA,aAAA"}
1
+ {"version":3,"file":"icon-button.js","names":[],"sources":["../../../src/components/icon-button/icon-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport iconStyle from './icon-button.css?inline';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport {customElement} from '../../decorator.js';\nimport {degToRad} from '../../svghelpers/math.js';\n\n/**\n * The available visual variants for `<obc-icon-button>`.\n * - `normal`: Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n */\nexport enum IconButtonVariant {\n normal = 'normal',\n raised = 'raised',\n flat = 'flat',\n integration = 'integration',\n}\n\n/**\n * `<obc-icon-button>` – An icon-only or icon-with-label button for quick actions.\n *\n * Provides a compact, visually prominent button that displays an icon (and optionally a label) for triggering actions. Commonly used for toolbars, navigation, or contextual actions where space is limited and a recognizable icon can represent the function.\n *\n * Appears as a circular or rounded button with configurable visual styles, supporting progress indication and various layout adaptations.\n *\n * ## Features\n * - **Variants:**\n * - `normal` (default): Standard appearance for most use cases.\n * - `raised`: Adds elevation/shadow for prominence.\n * - `flat`: Minimal, backgroundless style for subtle actions.\n * - `integration`: For use in Integration Bar components\n * - **Progress Indicator:**\n * - Shows a circular progress spinner overlay when the `progress` property is set (0–100). Useful for indicating loading or ongoing actions.\n * - **Label Support:**\n * - Optionally displays a text label below the icon when `hasLabel` is true and content is provided in the `label` slot.\n * - **Corner Alignment:**\n * - `cornerLeft` and `cornerRight` adjust the button's border radius and alignment for flush placement at the start or end of a container.\n * - **Active State:**\n * - `activated` visually highlights the button as selected or toggled.\n * - `activeColor` applies an accent color for emphasis.\n * - **Wide Mode:**\n * - `wide` increases the button's width for easier touch targets or visual balance.\n * - **Disabled State:**\n * - `disabled` prevents interaction and visually dims the button.\n *\n * ## Usage Guidelines\n * - Use `obc-icon-button` for actions represented by icons, such as toolbars, navigation, or quick-access commands.\n * - Add a label (with `hasLabel` and the `label` slot) when clarity is needed or when icons alone may not be universally understood.\n * - Use the progress indicator for actions that take time, such as uploads or background processes.\n * - Prefer the `normal` variant for most cases; use `raised` to draw attention, and `flat` for less prominent or inline actions.\n * - For grouped or edge-aligned layouts, use `cornerLeft` or `cornerRight` to visually merge with container edges.\n * - Avoid using icon buttons for destructive or critical actions unless paired with clear feedback.\n * - **TODO(designer):** Clarify recommended icon sizes and when to use label vs. icon-only.\n *\n * ## Slots\n * | Slot Name | Renders When... | Purpose |\n * |-----------|---------------------|----------------------------------------------|\n * | (default) | Always | The icon to display (e.g., `<obi-search>`) |\n * | label | If `hasLabel` is set | Optional label text below the icon |\n *\n * ## Events\n * - Emits a standard `click` event (`onClick` handler in framework wrappers) when activated.\n *\n * ## Best Practices\n * - Ensure icons are clear and universally recognizable.\n * - For accessibility, provide an `aria-label` or descriptive label for the button's action.\n * - When using the progress indicator, avoid showing it for very short actions to prevent visual flicker.\n *\n * ## Example:\n * ```\n * <obc-icon-button variant=\"normal\">\n * <obi-search></obi-search>\n * </obc-icon-button>\n *\n * <obc-icon-button variant=\"normal\" hasLabel>\n * <obi-arrow></obi-arrow>\n * <span slot=\"label\">Next</span>\n * </obc-icon-button>\n * ```\n *\n * @property activated - Whether the button is in an activated (selected/toggled) state.\n * Visually highlights the button to indicate selection.\n * @property cornerLeft - If true, aligns the button to the left edge and removes left border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property cornerRight - If true, aligns the button to the right edge and removes right border radius.\n * Useful for grouping or edge-aligned layouts.\n * @property activeColor - Applies an accent color to the button for emphasis.\n * Used to visually distinguish active or important actions.\n * @property wide - Increases the button's width for larger touch targets or visual balance.\n * @property disabled - Disables the button, preventing user interaction and dimming its appearance.\n * @property progress - Shows a circular progress indicator overlay when set (0–100).\n * Use to indicate ongoing actions or loading states.\n * If undefined, no progress indicator is shown.\n * @property hasLabel - If true, displays a label below the icon using the `label` slot.\n * @property showDivider - If false, and cornerLeft or cornerRight is true, the divider is not shown.\n * @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.\n * @property focusable - Whether the button is in the tab sequence. Turn it off for a button inside a\n * composite widget that owns the tab stop, and give the widget a key for the action.\n * @property variant - Visual style: `normal` (default) is the standard appearance, `raised` adds\n * a shadow, `flat` drops the background.\n * @slot - Icon slot (default): Place an icon such as <obi-search> here.\n * @slot label - Optional label shown below the icon when `hasLabel` is true.\n * @fires click - Fired when the button is clicked (if not disabled).\n * @stable\n */\n@customElement('obc-icon-button')\nexport class ObcIconButton extends LitElement {\n @property({type: String}) variant: IconButtonVariant =\n IconButtonVariant.normal;\n\n @property({type: Boolean}) activated = false;\n\n @property({type: Boolean}) cornerLeft = false;\n\n @property({type: Boolean}) cornerRight = false;\n\n @property({type: Boolean}) activeColor = false;\n\n @property({type: Boolean}) wide = false;\n\n @property({type: Boolean}) disabled = false;\n\n @property({type: Number}) progress: undefined | number = undefined;\n\n @property({type: Boolean}) hasLabel: boolean = false;\n\n @property({type: Boolean, attribute: false}) showDivider = true;\n\n @property({type: Boolean, attribute: false}) focusable = true;\n\n // Reactive so a consumer swapping the name (Play → Pause) re-renders the shadow button.\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel: string | null = null;\n\n /** Focus lands on the button inside, not on the host. */\n public override focus(options?: FocusOptions): void {\n this.shadowRoot?.querySelector('button')?.focus(options);\n }\n\n get progressSpinner() {\n if (this.progress === undefined) {\n return nothing;\n }\n if (this.progress === 100) {\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"#325B9A\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n </svg>\n </div>`;\n }\n const angleRad = degToRad(this.progress * 0.95 * 3.6);\n const x = 20 + 18 * Math.sin(angleRad);\n const y = 20 - 18 * Math.cos(angleRad);\n const largeArcFlag = angleRad > Math.PI ? 1 : 0;\n return html`<div class=\"progress-spinner\">\n <svg\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 40 40\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n cx=\"20\"\n cy=\"20\"\n r=\"18\"\n stroke=\"var(--container-backdrop-color)\"\n stroke-width=\"4\"\n fill=\"none\"\n />\n <path\n d=\"M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}\"\n stroke=\"var(--instrument-enhanced-secondary-color)\"\n stroke-width=\"4\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>`;\n }\n\n override render() {\n return html`\n <button\n class=${classMap({\n wrapper: true,\n ['variant-' + this.variant]: true,\n activated: this.activated,\n 'corner-left': this.cornerLeft,\n 'corner-right': this.cornerRight,\n 'active-color': this.activeColor,\n 'has-label': this.hasLabel,\n wide: this.wide,\n progress: this.progress !== undefined,\n 'hide-divider': !this.showDivider,\n })}\n ?disabled=${this.disabled}\n aria-label=${ifDefined(this.ariaLabel ?? undefined)}\n tabindex=${ifDefined(this.focusable ? undefined : -1)}\n part=\"wrapper\"\n >\n ${this.progress !== undefined ? this.progressSpinner : nothing}\n <div class=\"visible-wrapper\" part=\"visible-wrapper\">\n <div class=\"icon\" part=\"icon\">\n <slot></slot>\n </div>\n </div>\n ${\n this.hasLabel\n ? html`<div class=\"label\" part=\"label\">\n <slot name=\"label\"></slot>\n </div>`\n : nothing\n }\n </button>\n `;\n }\n\n static override styles = unsafe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CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AAG1C,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,cAAA,WAAA,aAAA,KAAA,CAAA;AA1BlD,gBAAA,WAAA,CAAA,cAAc,iBAAiB,CAAA,GAAA,aAAA"}
@@ -45,6 +45,11 @@ var split_button_default = css`* {
45
45
  top: unset;
46
46
  }
47
47
 
48
+ .wrapper.open-left .positioned-menu {
49
+ right: anchor(right);
50
+ left: unset;
51
+ }
52
+
48
53
  .dropdown-button::part(visible-wrapper) {
49
54
  box-sizing: border-box;
50
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"split-button.css.js","names":[],"sources":["../../../src/components/split-button/split-button.css?inline"],"sourcesContent":[".wrapper {\n position: relative;\n display: flex;\n align-items: stretch;\n width: fit-content;\n\n anchor-name: --split-button-anchor;\n\n &.full-width {\n width: 100%;\n }\n}\n\n.primary-button {\n flex: 1;\n}\n\n.primary-button::part(visible-wrapper) {\n border-right: none;\n flex: 1;\n}\n\n.primary-button::part(wrapper) {\n padding-left: var(--split-button-padding-left, 8px);\n display: flex;\n flex-grow: 1;\n}\n\n/* Context menu positioning */\n.positioned-menu {\n position: fixed;\n position-anchor: --split-button-anchor;\n left: calc(anchor(right) - var(--ui-components-button-touch-target-size));\n top: anchor(bottom);\n}\n\n.wrapper.open-top {\n .positioned-menu {\n bottom: anchor(top);\n top: unset;\n }\n}\n\n.dropdown-button::part(visible-wrapper) {\n box-sizing: border-box;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"split-button.css.js","names":[],"sources":["../../../src/components/split-button/split-button.css?inline"],"sourcesContent":[".wrapper {\n position: relative;\n display: flex;\n align-items: stretch;\n width: fit-content;\n\n anchor-name: --split-button-anchor;\n\n &.full-width {\n width: 100%;\n }\n}\n\n.primary-button {\n flex: 1;\n}\n\n.primary-button::part(visible-wrapper) {\n border-right: none;\n flex: 1;\n}\n\n.primary-button::part(wrapper) {\n padding-left: var(--split-button-padding-left, 8px);\n display: flex;\n flex-grow: 1;\n}\n\n/* Context menu positioning */\n.positioned-menu {\n position: fixed;\n position-anchor: --split-button-anchor;\n left: calc(anchor(right) - var(--ui-components-button-touch-target-size));\n top: anchor(bottom);\n}\n\n.wrapper.open-top {\n .positioned-menu {\n bottom: anchor(top);\n top: unset;\n }\n}\n\n.wrapper.open-left {\n .positioned-menu {\n right: anchor(right);\n left: unset;\n }\n}\n\n.dropdown-button::part(visible-wrapper) {\n box-sizing: border-box;\n}\n"],"mappings":""}
@@ -24,10 +24,11 @@ export type ObcSplitButtonChangeEvent = CustomEvent<{
24
24
  * - **Multi-select and group selection:** Allows single or multiple selections in the dropdown, with optional grouping and per-group selection logic.
25
25
  * - **Customizable menu content:** Accepts an array of options or column groups, supports icons, subtitles, and multi-column layouts for complex menus.
26
26
  * - **Optional icon in primary button:** Add a leading icon to the main button using the `hasIcon` property and `icon` slot.
27
+ * - **Replaceable dropdown icon:** The dropdown button shows a chevron; fill the `dropdown-icon` slot to show another symbol, for example one that says what the menu holds.
27
28
  * - **Title bar and menu title:** Optionally display a title bar with close button and custom title text in the dropdown.
28
29
  * - **Full width mode:** Can stretch to fill its container using the `fullWidth` property.
29
- * - **Disabled state:** Disables both the primary and dropdown buttons when `disabled` is true.
30
- * - **Dropdown positioning:** Menu can open above or below the button (`openTop`).
30
+ * - **Disabled state:** `disabled` disables both halves; `primaryDisabled` and `dropdownDisabled` disable one half each, so the primary action can be unavailable while the menu stays in use.
31
+ * - **Dropdown positioning:** The menu opens below the button and extends to the right. `openTop` opens it above and `openLeft` extends it to the left, for a button near the bottom or the right edge of its container.
31
32
  * - **Selection persistence:** Optionally keeps the selected state visually persistent in the menu.
32
33
  * - **Keyboard and pointer accessibility:** Follows standard button and menu accessibility patterns.
33
34
  *
@@ -49,14 +50,25 @@ export type ObcSplitButtonChangeEvent = CustomEvent<{
49
50
  * - **TODO(designer):** Confirm best practices for when to use multi-select vs. single-select, and any recommended limits on number of options or columns.
50
51
  *
51
52
  * ### Slots
52
- * | Slot Name | Renders When... | Purpose |
53
- * |-------------|---------------------|-----------------------------------------------------|
54
- * | `icon` | `hasIcon` is true | Leading icon in the primary button (e.g., `<obi-placeholder></obi-placeholder>`) |
53
+ * | Slot Name | Renders When... | Purpose |
54
+ * |-----------------|---------------------|-----------------------------------------------------|
55
+ * | `icon` | `hasIcon` is true | Leading icon in the primary button (e.g., `<obi-placeholder></obi-placeholder>`) |
56
+ * | `dropdown-icon` | Always | Icon of the dropdown button; the chevron when empty |
55
57
  *
56
58
  * ### Events
57
59
  * - `click` – Fired when either the primary or dropdown button is clicked. The event detail includes `{action: 'primary' | 'dropdown'}` to distinguish which part was activated.
58
60
  * - `change` – Fired when the menu selection changes. The event detail includes `{selectedValues, selectedOptions}`.
59
61
  *
62
+ * ### Keyboard
63
+ * The primary half is a plain button. The dropdown half follows the
64
+ * [APG Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/):
65
+ * `Enter` and `Space` open the menu, `ArrowDown` and `Home` open it on the
66
+ * first item, `ArrowUp` and `End` on the last, and `Escape` closes it and
67
+ * returns focus to the dropdown half. The menu is `obc-context-menu-input`.
68
+ *
69
+ * Left out: `Enter` and `Space` land on the selected item rather than the
70
+ * first, so a reopened selection menu starts where the user left it.
71
+ *
60
72
  * ### Best Practices & Constraints
61
73
  * - Only use multi-select when the menu type and use case require it; otherwise, prefer single selection for clarity.
62
74
  * - Keep the primary action clear and distinct from dropdown actions.
@@ -107,13 +119,23 @@ export type ObcSplitButtonChangeEvent = CustomEvent<{
107
119
  * When true, the component stretches horizontally.
108
120
  * @property disabled - Whether both parts of the button are disabled.
109
121
  * When true, disables both the primary and dropdown buttons.
122
+ * @property primaryDisabled - Disables the primary button alone, for an action the user
123
+ * cannot take right now while the menu stays in use, for example to ask for the access
124
+ * the action needs.
125
+ * @availableWhen primaryDisabled disabled==false
126
+ * @property dropdownDisabled - Disables the dropdown button alone, leaving the primary action.
127
+ * @availableWhen dropdownDisabled disabled==false
110
128
  * @property openTop - Open context menu dropdown above (`true`) or below (`false`) the button.
111
129
  * Useful for placement near the bottom of the viewport.
130
+ * @property openLeft - Extend the menu to the left of the dropdown button (`true`), its right
131
+ * edge on the button's right edge, instead of to the right. For a button near the right
132
+ * edge of its container; combines with `openTop`.
112
133
  * @property columnGroups - Array of column group definitions for multi-column/grouped menus.
113
134
  * Use instead of `options` for grouped or subtitle layouts.
114
135
  * @availableWhen columnGroups menuType==MultiWithSubtitles
115
136
  * @property dropdownLabel - Accessible name of the dropdown button; the chevron carries none.
116
137
  * @slot icon - Leading icon for the primary button (shown when `hasIcon` is true)
138
+ * @slot dropdown-icon - Icon of the dropdown button; the chevron when empty.
117
139
  * @fires {ObcSplitButtonClickEvent} click - Fired when the primary or dropdown button is clicked.
118
140
  * @fires {ObcSplitButtonChangeEvent} change - Fired when the dropdown menu selection changes.
119
141
  * @beta
@@ -145,8 +167,14 @@ export declare class ObcSplitButton extends LitElement {
145
167
  fullWidth: boolean;
146
168
  /** Whether both parts of the button are disabled. When true, disables both the primary and dropdown buttons. */
147
169
  disabled: boolean;
170
+ /** Disables the primary button alone, for an action the user cannot take right now while the menu stays in use, for example to ask for the access the action needs. */
171
+ primaryDisabled: boolean;
172
+ /** Disables the dropdown button alone, leaving the primary action. */
173
+ dropdownDisabled: boolean;
148
174
  /** Open context menu dropdown above (`true`) or below (`false`) the button. Useful for placement near the bottom of the viewport. */
149
175
  openTop: boolean;
176
+ /** Extend the menu to the left of the dropdown button (`true`), its right edge on the button's right edge, instead of to the right. For a button near the right edge of its container; combines with `openTop`. */
177
+ openLeft: boolean;
150
178
  /** Array of column group definitions for multi-column/grouped menus. Use instead of `options` for grouped or subtitle layouts. */
151
179
  columnGroups: ColumnGroup[];
152
180
  private isDropdownOpen;
@@ -154,6 +182,8 @@ export declare class ObcSplitButton extends LitElement {
154
182
  private menuFocusStrategy;
155
183
  private menu?;
156
184
  private dropdownButton?;
185
+ private get isPrimaryDisabled();
186
+ private get isDropdownDisabled();
157
187
  private handlePrimaryClick;
158
188
  private handleDropdownClick;
159
189
  private focusMenuAfterOpen;
@@ -1 +1 @@
1
- {"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../src/components/split-button/split-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,yCAAyC,CAAC;AACjD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,WAAW,EACZ,MAAM,6CAA6C,CAAC;AAGrD,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC;IACjD,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC;IAClD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;CAC3C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AACH,qBACa,cAAe,SAAQ,UAAU;IAClB,KAAK,SAAkB;IAEtB,OAAO,UAAS;IAElB,OAAO,EAAE,iBAAiB,EAAE,CAAM;IAElC,cAAc,EAAE,MAAM,EAAE,CAAM;IAE7B,QAAQ,EAAE,eAAe,CAA2B;IAEnD,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,cAAc,CAAC,EAAE,OAAO,CAAC;IAE1B,cAAc,EAAE,MAAM,CAAK;IAE1B,WAAW,UAAS;IAErB,SAAS,SAAM;IAEf,aAAa,SAAkB;IAE9B,SAAS,UAAS;IAElB,QAAQ,UAAS;IAEjB,OAAO,UAAS;IAElB,YAAY,EAAE,WAAW,EAAE,CAAM;IAEjD,OAAO,CAAC,cAAc,CAAS;IAExC,OAAO,CAAC,mBAAmB,CAAS;IAEpC,OAAO,CAAC,iBAAiB,CAA6C;IAErC,OAAO,CAAC,IAAI,CAAC,CAAsB;IAEzC,OAAO,CAAC,cAAc,CAAC,CAAc;IAEhE,OAAO,CAAC,kBAAkB,CAOxB;IAEF,OAAO,CAAC,mBAAmB,CAczB;YAEY,kBAAkB;IAehC,OAAO,CAAC,qBAAqB,CAmD3B;IAEF,OAAO,CAAC,cAAc,CAKpB;IAEF,OAAO,CAAC,mBAAmB,CAYzB;IAEF,OAAO,KAAK,aAAa,GAQxB;IAED,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,eAAe,CAUrB;IAEO,oBAAoB;IAKpB,MAAM;IAoEf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
1
+ {"version":3,"file":"split-button.d.ts","sourceRoot":"","sources":["../../../src/components/split-button/split-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,yCAAyC,CAAC;AACjD,OAAO,qBAAqB,CAAC;AAC7B,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,WAAW,EACZ,MAAM,6CAA6C,CAAC;AAGrD,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC;IACjD,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC;IAClD,cAAc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