@govtechsg/sgds-web-component 3.16.1-rc.3 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/components/Accordion/accordion-item.js +1 -1
  2. package/components/Accordion/index.umd.min.js +13 -11
  3. package/components/Accordion/index.umd.min.js.map +1 -1
  4. package/components/Accordion/sgds-accordion-item.d.ts +4 -1
  5. package/components/Accordion/sgds-accordion-item.js +15 -11
  6. package/components/Accordion/sgds-accordion-item.js.map +1 -1
  7. package/components/Accordion/sgds-accordion.d.ts +1 -1
  8. package/components/Accordion/sgds-accordion.js.map +1 -1
  9. package/components/Radio/index.umd.min.js +9 -9
  10. package/components/Radio/index.umd.min.js.map +1 -1
  11. package/components/Radio/sgds-radio-group.d.ts +2 -0
  12. package/components/Radio/sgds-radio-group.js +10 -1
  13. package/components/Radio/sgds-radio-group.js.map +1 -1
  14. package/components/Radio/sgds-radio.d.ts +2 -0
  15. package/components/Radio/sgds-radio.js +6 -1
  16. package/components/Radio/sgds-radio.js.map +1 -1
  17. package/components/Tab/index.umd.min.js +3 -2
  18. package/components/Tab/index.umd.min.js.map +1 -1
  19. package/components/Tab/sgds-tab-group.js +1 -0
  20. package/components/Tab/sgds-tab-group.js.map +1 -1
  21. package/components/Tab/tab-group.js +1 -1
  22. package/components/Tab/tab.js +1 -1
  23. package/components/Toast/index.umd.min.js +1 -1
  24. package/components/Toast/index.umd.min.js.map +1 -1
  25. package/components/Toast/toast.js +1 -1
  26. package/components/index.umd.min.js +16 -13
  27. package/components/index.umd.min.js.map +1 -1
  28. package/custom-elements.json +50 -3
  29. package/index.umd.min.js +16 -13
  30. package/index.umd.min.js.map +1 -1
  31. package/package.json +1 -1
  32. package/react/components/Accordion/accordion-item.cjs.js +1 -1
  33. package/react/components/Accordion/accordion-item.js +1 -1
  34. package/react/components/Accordion/sgds-accordion-item.cjs.js +15 -11
  35. package/react/components/Accordion/sgds-accordion-item.cjs.js.map +1 -1
  36. package/react/components/Accordion/sgds-accordion-item.js +15 -11
  37. package/react/components/Accordion/sgds-accordion-item.js.map +1 -1
  38. package/react/components/Accordion/sgds-accordion.cjs.js.map +1 -1
  39. package/react/components/Accordion/sgds-accordion.js.map +1 -1
  40. package/react/components/Radio/sgds-radio-group.cjs.js +10 -1
  41. package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
  42. package/react/components/Radio/sgds-radio-group.js +10 -1
  43. package/react/components/Radio/sgds-radio-group.js.map +1 -1
  44. package/react/components/Radio/sgds-radio.cjs.js +6 -1
  45. package/react/components/Radio/sgds-radio.cjs.js.map +1 -1
  46. package/react/components/Radio/sgds-radio.js +6 -1
  47. package/react/components/Radio/sgds-radio.js.map +1 -1
  48. package/react/components/Tab/sgds-tab-group.cjs.js +1 -0
  49. package/react/components/Tab/sgds-tab-group.cjs.js.map +1 -1
  50. package/react/components/Tab/sgds-tab-group.js +1 -0
  51. package/react/components/Tab/sgds-tab-group.js.map +1 -1
  52. package/react/components/Tab/tab-group.cjs.js +1 -1
  53. package/react/components/Tab/tab-group.js +1 -1
  54. package/react/components/Tab/tab.cjs.js +1 -1
  55. package/react/components/Tab/tab.js +1 -1
  56. package/react/components/Toast/toast.cjs.js +1 -1
  57. package/react/components/Toast/toast.js +1 -1
  58. package/types/react.d.ts +6 -2
@@ -212,6 +212,7 @@ class SgdsTabGroup extends SgdsElement {
212
212
  <div class="tab-group__nav" role="tablist">
213
213
  <slot name="nav" @slotchange=${this._handleSlotChange}></slot>
214
214
  </div>
215
+
215
216
  <div class="tab-group__content">
216
217
  <slot class="tab-group__body" @slotchange=${this._syncTabsAndPanels}></slot>
217
218
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"sgds-tab-group.js","sources":["../../../src/components/Tab/sgds-tab-group.ts"],"sourcesContent":["import { html, PropertyValues } from \"lit\";\nimport { property, query, queryAssignedElements } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { SgdsTab } from \"./sgds-tab\";\nimport { SgdsTabPanel } from \"./sgds-tab-panel\";\nimport tabGroupStyle from \"./tab-group.css\";\n/**\n * @summary Tab Group organizes content into a container with the syncing of tab and their corresponding panels.\n * Each tab must be slotted into the nav slot and its `panel` must refer to a tab panel of the same name.\n *\n * @slot default - The slot for `sgds-tab-panel`\n * @slot nav - The slot for `sgds-tab`\n *\n * @event sgds-tab-show - Emitted when a tab and its panels are shown. `event.detail.name` contains the active tab's panel name.\n * @event sgds-tab-hide - Emitted when a tab and its panels are hidden. `event.detail.name` contains the hidden tab's panel name.\n *\n */\nexport class SgdsTabGroup extends SgdsElement {\n static styles = [...SgdsElement.styles, tabGroupStyle];\n\n @query(\".tab-group\") private _tabGroup: HTMLElement;\n\n @query(\".tab-group__body\") private _body: HTMLSlotElement;\n\n @query(\".tab-group__nav\") private _nav: HTMLElement;\n\n private _activeTab?: SgdsTab;\n\n private _mutationObserver: MutationObserver;\n\n private _resizeObserver: ResizeObserver;\n\n private _tabs: SgdsTab[] = [];\n\n private _panels: SgdsTabPanel[] = [];\n /** The variant of tabs. Controls the visual styles of all `sgds-tabs` in its slot. It also sets the variant atttribute of `sgds-tab` */\n @property({ type: String, reflect: true }) variant: \"underlined\" | \"solid\" = \"underlined\";\n /** The orientation of tabs. Controls the orientation of all `sgds-tabs` in its slot. It also sets the orientation attribute of `sgds-tab` */\n @property({ type: String, reflect: true }) orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n /** The density of tabs. Controls the density of all `sgds-tabs` in its slot. It also sets the density attribute of `sgds-tab` */\n @property({ type: String, reflect: true }) density: \"compact\" | \"default\" = \"default\";\n\n connectedCallback() {\n const whenAllDefined = Promise.all([\n customElements.whenDefined(\"sgds-tab\"),\n customElements.whenDefined(\"sgds-tab-panel\")\n ]);\n super.connectedCallback();\n this._resizeObserver = new ResizeObserver(() => {\n return;\n });\n\n this._mutationObserver = new MutationObserver(mutations => {\n // Update aria labels when the DOM changes\n if (mutations.some(m => ![\"aria-labelledby\", \"aria-controls\"].includes(m.attributeName))) {\n setTimeout(() => this._setAriaLabels());\n }\n\n // Sync tabs when disabled states change\n if (mutations.some(m => m.attributeName === \"disabled\")) {\n this._syncTabsAndPanels();\n }\n });\n\n this.updateComplete.then(() => {\n this._syncTabsAndPanels();\n this._mutationObserver.observe(this, { attributes: true, childList: true, subtree: true });\n this._resizeObserver.observe(this._nav);\n whenAllDefined.then(() => {\n // Set initial tab state when the tabs first become visible\n const intersectionObserver = new IntersectionObserver((entries, observer) => {\n if (entries[0].intersectionRatio > 0) {\n this._setAriaLabels();\n // this.setTabVariant();\n this._setActiveTab(this._getActiveTab() ?? this._tabs[0], { emitEvents: false });\n observer.unobserve(entries[0].target);\n }\n });\n intersectionObserver.observe(this._tabGroup);\n });\n });\n }\n\n disconnectedCallback() {\n this._mutationObserver.disconnect();\n this._resizeObserver.unobserve(this._nav);\n }\n\n /** Shows the specified tab panel. */\n public show(panel: string) {\n const tab = this._tabs.find(el => el.panel === panel);\n\n if (tab) {\n this._setActiveTab(tab);\n }\n }\n private _getAllTabs(options: { includeDisabled: boolean } = { includeDisabled: true }) {\n const slot = this.shadowRoot.querySelector<HTMLSlotElement>('slot[name=\"nav\"]');\n\n return [...(slot.assignedElements() as SgdsTab[])].filter(el => {\n return options.includeDisabled\n ? el.tagName.toLowerCase() === \"sgds-tab\"\n : el.tagName.toLowerCase() === \"sgds-tab\" && !el.disabled;\n });\n }\n private _getAllPanels() {\n return [...this._body.assignedElements()].filter(el => el.tagName.toLowerCase() === \"sgds-tab-panel\") as [\n SgdsTabPanel\n ];\n }\n private _getActiveTab() {\n return this._tabs.find(el => el.active);\n }\n private _handleClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n const tab = target.closest(\"sgds-tab\") as SgdsTab;\n const tabGroup = tab?.closest(\"sgds-tab-group\");\n\n // Ensure the target tab is in this tab group\n if (tabGroup !== this) {\n return;\n }\n\n if (tab !== null) {\n this._setActiveTab(tab);\n }\n }\n private _handleKeyDown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n const tab = target.closest(\"sgds-tab\") as SgdsTab;\n const tabGroup = tab?.closest(\"sgds-tab-group\");\n\n // Ensure the target tab is in this tab group\n if (tabGroup !== this) {\n return;\n }\n\n // Activate a tab\n if ([\"Enter\", \" \"].includes(event.key)) {\n if (tab !== null) {\n this._setActiveTab(tab);\n event.preventDefault();\n }\n }\n\n // Move focus left or right\n if ([\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)) {\n const activeEl = this._tabs.find(t => t.matches(\":focus\"));\n\n if (activeEl?.tagName.toLowerCase() === \"sgds-tab\") {\n let index = this._tabs.indexOf(activeEl);\n\n if (event.key === \"Home\") {\n index = 0;\n } else if (event.key === \"End\") {\n index = this._tabs.length - 1;\n } else if (event.key === \"ArrowUp\" || event.key === \"ArrowLeft\") {\n index--;\n } else if (event.key === \"ArrowDown\" || event.key === \"ArrowRight\") {\n index++;\n }\n\n if (index < 0) {\n index = this._tabs.length - 1;\n }\n\n if (index > this._tabs.length - 1) {\n index = 0;\n }\n\n this._tabs[index].focus({ preventScroll: true });\n\n this._setActiveTab(this._tabs[index] /** , { scrollBehavior: \"smooth\" }*/);\n\n event.preventDefault();\n }\n }\n }\n private _setActiveTab(tab: SgdsTab, options?: { emitEvents?: boolean }) {\n options = {\n emitEvents: true,\n ...options\n };\n\n if (tab !== this._activeTab && !tab.disabled) {\n const previousTab = this._activeTab;\n this._activeTab = tab;\n\n // Sync active tab and panel\n this._tabs.forEach(el => {\n el.active = el === this._activeTab ? true : false;\n });\n\n this._panels.map(el => (el.active = el.name === this._activeTab?.panel));\n\n // Emit events\n if (options.emitEvents) {\n if (previousTab) {\n this.emit(\"sgds-tab-hide\", { detail: { name: previousTab.panel } });\n }\n\n this.emit(\"sgds-tab-show\", { detail: { name: this._activeTab.panel } });\n }\n }\n }\n private _setAriaLabels() {\n // Link each tab with its corresponding panel\n this._tabs.forEach(tab => {\n const panel = this._panels.find(el => el.name === tab.panel);\n if (panel) {\n tab.setAttribute(\"aria-controls\", panel.getAttribute(\"id\"));\n panel.setAttribute(\"aria-labelledby\", tab.getAttribute(\"id\"));\n }\n });\n }\n\n // This stores tabs and panels so we can refer to a cache instead of calling querySelectorAll() multiple times.\n private _syncTabsAndPanels() {\n this._tabs = this._getAllTabs({ includeDisabled: false });\n this._panels = this._getAllPanels();\n }\n\n @queryAssignedElements({ slot: \"nav\", flatten: true })\n private _navSlot: SgdsTab[];\n\n private _updateTabsAttribute(name: string) {\n if (!this._navSlot) return;\n const tabs = this._navSlot;\n tabs.forEach(tab => {\n tab.setAttribute(name, this[name]);\n });\n }\n\n private _handleSlotChange() {\n this._updateTabsAttribute(\"variant\");\n this._updateTabsAttribute(\"orientation\");\n this._updateTabsAttribute(\"density\");\n this._syncTabsAndPanels();\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n // similar to @watch\n if (_changedProperties.has(\"variant\")) {\n this._updateTabsAttribute(\"variant\");\n }\n if (_changedProperties.has(\"orientation\")) {\n this._updateTabsAttribute(\"orientation\");\n }\n if (_changedProperties.has(\"density\")) {\n this._updateTabsAttribute(\"density\");\n }\n }\n\n render() {\n return html`\n <div class=\"tab-group\" @click=${this._handleClick} @keydown=${this._handleKeyDown}>\n <div class=\"tab-group__nav\" role=\"tablist\">\n <slot name=\"nav\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n <div class=\"tab-group__content\">\n <slot class=\"tab-group__body\" @slotchange=${this._syncTabsAndPanels}></slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTabGroup;\n"],"names":["tabGroupStyle"],"mappings":";;;;;;AAMA;;;;;;;;;;AAUG;AACG,MAAO,YAAa,SAAQ,WAAW,CAAA;AAA7C,IAAA,WAAA,GAAA;;QAeU,IAAK,CAAA,KAAA,GAAc,EAAE,CAAC;QAEtB,IAAO,CAAA,OAAA,GAAmB,EAAE,CAAC;;QAEM,IAAO,CAAA,OAAA,GAA2B,YAAY,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, PropertyValues } from \"lit\";\nimport { property, query, queryAssignedElements } from \"lit/decorators.js\";\nimport SgdsElement from \"../../base/sgds-element\";\nimport { SgdsTab } from \"./sgds-tab\";\nimport { SgdsTabPanel } from \"./sgds-tab-panel\";\nimport tabGroupStyle from \"./tab-group.css\";\n/**\n * @summary Tab Group organizes content into a container with the syncing of tab and their corresponding panels.\n * Each tab must be slotted into the nav slot and its `panel` must refer to a tab panel of the same name.\n *\n * @slot default - The slot for `sgds-tab-panel`\n * @slot nav - The slot for `sgds-tab`\n *\n * @event sgds-tab-show - Emitted when a tab and its panels are shown. `event.detail.name` contains the active tab's panel name.\n * @event sgds-tab-hide - Emitted when a tab and its panels are hidden. `event.detail.name` contains the hidden tab's panel name.\n *\n */\nexport class SgdsTabGroup extends SgdsElement {\n static styles = [...SgdsElement.styles, tabGroupStyle];\n\n @query(\".tab-group\") private _tabGroup: HTMLElement;\n\n @query(\".tab-group__body\") private _body: HTMLSlotElement;\n\n @query(\".tab-group__nav\") private _nav: HTMLElement;\n\n private _activeTab?: SgdsTab;\n\n private _mutationObserver: MutationObserver;\n\n private _resizeObserver: ResizeObserver;\n\n private _tabs: SgdsTab[] = [];\n\n private _panels: SgdsTabPanel[] = [];\n /** The variant of tabs. Controls the visual styles of all `sgds-tabs` in its slot. It also sets the variant atttribute of `sgds-tab` */\n @property({ type: String, reflect: true }) variant: \"underlined\" | \"solid\" = \"underlined\";\n /** The orientation of tabs. Controls the orientation of all `sgds-tabs` in its slot. It also sets the orientation attribute of `sgds-tab` */\n @property({ type: String, reflect: true }) orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n /** The density of tabs. Controls the density of all `sgds-tabs` in its slot. It also sets the density attribute of `sgds-tab` */\n @property({ type: String, reflect: true }) density: \"compact\" | \"default\" = \"default\";\n\n connectedCallback() {\n const whenAllDefined = Promise.all([\n customElements.whenDefined(\"sgds-tab\"),\n customElements.whenDefined(\"sgds-tab-panel\")\n ]);\n super.connectedCallback();\n this._resizeObserver = new ResizeObserver(() => {\n return;\n });\n\n this._mutationObserver = new MutationObserver(mutations => {\n // Update aria labels when the DOM changes\n if (mutations.some(m => ![\"aria-labelledby\", \"aria-controls\"].includes(m.attributeName))) {\n setTimeout(() => this._setAriaLabels());\n }\n\n // Sync tabs when disabled states change\n if (mutations.some(m => m.attributeName === \"disabled\")) {\n this._syncTabsAndPanels();\n }\n });\n\n this.updateComplete.then(() => {\n this._syncTabsAndPanels();\n this._mutationObserver.observe(this, { attributes: true, childList: true, subtree: true });\n this._resizeObserver.observe(this._nav);\n whenAllDefined.then(() => {\n // Set initial tab state when the tabs first become visible\n const intersectionObserver = new IntersectionObserver((entries, observer) => {\n if (entries[0].intersectionRatio > 0) {\n this._setAriaLabels();\n // this.setTabVariant();\n this._setActiveTab(this._getActiveTab() ?? this._tabs[0], { emitEvents: false });\n observer.unobserve(entries[0].target);\n }\n });\n intersectionObserver.observe(this._tabGroup);\n });\n });\n }\n\n disconnectedCallback() {\n this._mutationObserver.disconnect();\n this._resizeObserver.unobserve(this._nav);\n }\n\n /** Shows the specified tab panel. */\n public show(panel: string) {\n const tab = this._tabs.find(el => el.panel === panel);\n\n if (tab) {\n this._setActiveTab(tab);\n }\n }\n private _getAllTabs(options: { includeDisabled: boolean } = { includeDisabled: true }) {\n const slot = this.shadowRoot.querySelector<HTMLSlotElement>('slot[name=\"nav\"]');\n\n return [...(slot.assignedElements() as SgdsTab[])].filter(el => {\n return options.includeDisabled\n ? el.tagName.toLowerCase() === \"sgds-tab\"\n : el.tagName.toLowerCase() === \"sgds-tab\" && !el.disabled;\n });\n }\n private _getAllPanels() {\n return [...this._body.assignedElements()].filter(el => el.tagName.toLowerCase() === \"sgds-tab-panel\") as [\n SgdsTabPanel\n ];\n }\n private _getActiveTab() {\n return this._tabs.find(el => el.active);\n }\n private _handleClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n const tab = target.closest(\"sgds-tab\") as SgdsTab;\n const tabGroup = tab?.closest(\"sgds-tab-group\");\n\n // Ensure the target tab is in this tab group\n if (tabGroup !== this) {\n return;\n }\n\n if (tab !== null) {\n this._setActiveTab(tab);\n }\n }\n private _handleKeyDown(event: KeyboardEvent) {\n const target = event.target as HTMLElement;\n const tab = target.closest(\"sgds-tab\") as SgdsTab;\n const tabGroup = tab?.closest(\"sgds-tab-group\");\n\n // Ensure the target tab is in this tab group\n if (tabGroup !== this) {\n return;\n }\n\n // Activate a tab\n if ([\"Enter\", \" \"].includes(event.key)) {\n if (tab !== null) {\n this._setActiveTab(tab);\n event.preventDefault();\n }\n }\n\n // Move focus left or right\n if ([\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)) {\n const activeEl = this._tabs.find(t => t.matches(\":focus\"));\n\n if (activeEl?.tagName.toLowerCase() === \"sgds-tab\") {\n let index = this._tabs.indexOf(activeEl);\n\n if (event.key === \"Home\") {\n index = 0;\n } else if (event.key === \"End\") {\n index = this._tabs.length - 1;\n } else if (event.key === \"ArrowUp\" || event.key === \"ArrowLeft\") {\n index--;\n } else if (event.key === \"ArrowDown\" || event.key === \"ArrowRight\") {\n index++;\n }\n\n if (index < 0) {\n index = this._tabs.length - 1;\n }\n\n if (index > this._tabs.length - 1) {\n index = 0;\n }\n\n this._tabs[index].focus({ preventScroll: true });\n\n this._setActiveTab(this._tabs[index] /** , { scrollBehavior: \"smooth\" }*/);\n\n event.preventDefault();\n }\n }\n }\n private _setActiveTab(tab: SgdsTab, options?: { emitEvents?: boolean }) {\n options = {\n emitEvents: true,\n ...options\n };\n\n if (tab !== this._activeTab && !tab.disabled) {\n const previousTab = this._activeTab;\n this._activeTab = tab;\n\n // Sync active tab and panel\n this._tabs.forEach(el => {\n el.active = el === this._activeTab ? true : false;\n });\n\n this._panels.map(el => (el.active = el.name === this._activeTab?.panel));\n\n // Emit events\n if (options.emitEvents) {\n if (previousTab) {\n this.emit(\"sgds-tab-hide\", { detail: { name: previousTab.panel } });\n }\n\n this.emit(\"sgds-tab-show\", { detail: { name: this._activeTab.panel } });\n }\n }\n }\n private _setAriaLabels() {\n // Link each tab with its corresponding panel\n this._tabs.forEach(tab => {\n const panel = this._panels.find(el => el.name === tab.panel);\n if (panel) {\n tab.setAttribute(\"aria-controls\", panel.getAttribute(\"id\"));\n panel.setAttribute(\"aria-labelledby\", tab.getAttribute(\"id\"));\n }\n });\n }\n\n // This stores tabs and panels so we can refer to a cache instead of calling querySelectorAll() multiple times.\n private _syncTabsAndPanels() {\n this._tabs = this._getAllTabs({ includeDisabled: false });\n this._panels = this._getAllPanels();\n }\n\n @queryAssignedElements({ slot: \"nav\", flatten: true })\n private _navSlot: SgdsTab[];\n\n private _updateTabsAttribute(name: string) {\n if (!this._navSlot) return;\n const tabs = this._navSlot;\n tabs.forEach(tab => {\n tab.setAttribute(name, this[name]);\n });\n }\n\n private _handleSlotChange() {\n this._updateTabsAttribute(\"variant\");\n this._updateTabsAttribute(\"orientation\");\n this._updateTabsAttribute(\"density\");\n this._syncTabsAndPanels();\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n // similar to @watch\n if (_changedProperties.has(\"variant\")) {\n this._updateTabsAttribute(\"variant\");\n }\n if (_changedProperties.has(\"orientation\")) {\n this._updateTabsAttribute(\"orientation\");\n }\n if (_changedProperties.has(\"density\")) {\n this._updateTabsAttribute(\"density\");\n }\n }\n\n render() {\n return html`\n <div class=\"tab-group\" @click=${this._handleClick} @keydown=${this._handleKeyDown}>\n <div class=\"tab-group__nav\" role=\"tablist\">\n <slot name=\"nav\" @slotchange=${this._handleSlotChange}></slot>\n </div>\n\n <div class=\"tab-group__content\">\n <slot class=\"tab-group__body\" @slotchange=${this._syncTabsAndPanels}></slot>\n </div>\n </div>\n `;\n }\n}\n\nexport default SgdsTabGroup;\n"],"names":["tabGroupStyle"],"mappings":";;;;;;AAMA;;;;;;;;;;AAUG;AACG,MAAO,YAAa,SAAQ,WAAW,CAAA;AAA7C,IAAA,WAAA,GAAA;;QAeU,IAAK,CAAA,KAA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,KAAA,CAAA,CAAA;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { css } from 'lit';
2
2
 
3
- var css_248z = css`.tab-group{display:flex;flex-direction:column;gap:var(--sgds-gap-xl)}.tab-group__nav{display:flex;flex-direction:row}.tab-group__content{flex:1}:host([orientation=vertical]) .tab-group{flex-direction:row}:host([orientation=vertical]) .tab-group__nav{flex-direction:column}:host([variant=solid]) .tab-group__nav{gap:var(--sgds-gap-xs)}`;
3
+ var css_248z = css`.tab-group{display:flex;flex-direction:column;gap:var(--sgds-gap-xl)}.tab-group__nav{display:flex;flex-direction:row}.tab-group__content{flex:1}:host([orientation=vertical]) .tab-group{flex-direction:row}:host([orientation=vertical]) .tab-group__nav{flex-direction:column}:host([variant=solid]) .tab-group__nav{gap:var(--sgds-gap-xs)}:host([variant=underlined][orientation=horizontal]) .tab-group__nav{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);display:flex;flex-direction:row}:host([variant=underlined][orientation=vertical]) .tab-group__nav{border-right:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}`;
4
4
 
5
5
  export { css_248z as default };
6
6
  //# sourceMappingURL=tab-group.js.map
@@ -1,6 +1,6 @@
1
1
  import { css } from 'lit';
2
2
 
3
- var css_248z = css`:host([density=compact]) .tab{font-size:var(--sgds-font-size-14);padding:var(--sgds-spacer-3) var(--sgds-spacer-5)}:host(:not([active])) .tab{cursor:pointer}:host([variant=solid]) .tab{background-color:var(--sgds-bg-translucent-subtle);border-radius:var(--sgds-border-radius-md)}:host([variant=solid][active]) .tab{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}:host([variant=solid]:not([active]):not([disabled])) .tab:focus,:host([variant=solid]:not([active]):not([disabled])) .tab:focus-visible{background-color:var(--sgds-bg-translucent)}:host([variant=solid]:not([active]):not([disabled])) .tab:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host([variant=solid]:not([active]):not([disabled])) .tab:hover{background-color:var(--sgds-bg-translucent)}:host([disabled]) .tab{cursor:not-allowed;opacity:var(--sgds-opacity-50)}:host([variant=underlined][active]) .tab{color:var(--sgds-primary-color-default)}:host([variant=underlined][orientation=vertical]) .tab{border-right:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}:host([variant=underlined][orientation=vertical][active]) .tab:after{background-color:var(--sgds-primary-surface-default);bottom:0;content:"";height:100%;position:absolute;right:-1px;width:var(--sgds-border-width-4)}:host([variant=underlined][orientation=horizontal]) .tab{border-bottom:var(--sgds-border-width-1) solid var(--sgds-border-color-muted)}:host([variant=underlined][orientation=horizontal][active]) .tab:after{background-color:var(--sgds-primary-surface-default);bottom:-1px;content:"";height:var(--sgds-border-width-4);left:0;position:absolute;width:100%}:host([variant=underlined]:not([active]):not([disabled])) .tab:focus,:host([variant=underlined]:not([active]):not([disabled])) .tab:focus-visible{background-color:var(--sgds-bg-translucent-subtle);outline:0}:host([variant=underlined]:not([active]):not([disabled])) .tab:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host([variant=underlined]:not([active]):not([disabled])) .tab:hover{background-color:var(--sgds-bg-translucent-subtle)}.tab{align-items:center;color:var(--sgds-color-default);display:flex;gap:var(--sgds-spacer-3);padding:var(--sgds-spacer-4) var(--sgds-spacer-5);position:relative}.tab:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;
3
+ var css_248z = css`:host([density=compact]) .tab{font-size:var(--sgds-font-size-14);padding:var(--sgds-spacer-3) var(--sgds-spacer-5)}:host(:not([active])) .tab{cursor:pointer}:host([variant=solid]) .tab{background-color:var(--sgds-bg-translucent-subtle);border-radius:var(--sgds-border-radius-md)}:host([variant=solid][active]) .tab{background-color:var(--sgds-primary-surface-default);color:var(--sgds-color-fixed-light)}:host([variant=solid]:not([active]):not([disabled])) .tab:focus,:host([variant=solid]:not([active]):not([disabled])) .tab:focus-visible{background-color:var(--sgds-bg-translucent)}:host([variant=solid]:not([active]):not([disabled])) .tab:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host([variant=solid]:not([active]):not([disabled])) .tab:hover{background-color:var(--sgds-bg-translucent)}:host([disabled]) .tab{cursor:not-allowed;opacity:var(--sgds-opacity-50)}:host([variant=underlined][active]) .tab{color:var(--sgds-primary-color-default)}:host([variant=underlined][orientation=vertical][active]) .tab:after{background-color:var(--sgds-primary-surface-default);bottom:0;content:"";height:100%;position:absolute;right:-1px;width:var(--sgds-border-width-4)}:host([variant=underlined][orientation=horizontal][active]) .tab:after{background-color:var(--sgds-primary-surface-default);bottom:-1px;content:"";height:var(--sgds-border-width-4);left:0;position:absolute;width:100%}:host([variant=underlined]:not([active]):not([disabled])) .tab:focus,:host([variant=underlined]:not([active]):not([disabled])) .tab:focus-visible{background-color:var(--sgds-bg-translucent-subtle);outline:0}:host([variant=underlined]:not([active]):not([disabled])) .tab:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}:host([variant=underlined]:not([active]):not([disabled])) .tab:hover{background-color:var(--sgds-bg-translucent-subtle)}.tab{align-items:center;color:var(--sgds-color-default);display:flex;gap:var(--sgds-spacer-3);padding:var(--sgds-spacer-4) var(--sgds-spacer-5);position:relative}.tab:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;
4
4
 
5
5
  export { css_248z as default };
6
6
  //# sourceMappingURL=tab.js.map
@@ -36,7 +36,7 @@ let St;$t?.({LitElement:yt}),(_t.litElementVersions??=[]).push("4.2.2"),_t.litEl
36
36
  <button class="btn-close" aria-label="Close button" @click=${this._handleClick}>
37
37
  <sgds-icon name="cross" size=${this.size}></sgds-icon>
38
38
  </button>
39
- `}}function Vt(t,e,s){return new Promise(i=>{if((null==s?void 0:s.duration)===1/0)throw new Error("Promise-based animations must be finite.");const o=t.animate(e,Object.assign(Object.assign({},s),{duration:Lt()?0:null==s?void 0:s.duration}));o.addEventListener("cancel",i,{once:!0}),o.addEventListener("finish",i,{once:!0})})}function Lt(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}Mt.styles=[...Nt.styles,Ut],t([kt({type:String,reflect:!0})],Mt.prototype,"size",void 0),t([kt({type:String,reflect:!0})],Mt.prototype,"tone",void 0);const Rt=new Map,At=new WeakMap;function Wt(t,e){const s=At.get(t);if(null==s?void 0:s[e])return s[e];const i=Rt.get(e);return i||{keyframes:[],options:{duration:0}}}function It(t,e){Rt.set(t,function(t){return null!=t?t:{keyframes:[],options:{duration:0}}}(e))}function Dt(t,e){return new Promise(s=>{t.addEventListener(e,function i(o){o.target===t&&(t.removeEventListener(e,i),s())})})}var jt,qt,Ht,Bt=r`:host([variant=info]) slot[name=icon]::slotted(*){color:var(--sgds-primary-color-default)}:host([variant=success]) slot[name=icon]::slotted(*){color:var(--sgds-success-color-default)}:host([variant=danger]) slot[name=icon]::slotted(*){color:var(--sgds-danger-color-default)}:host([variant=warning]) slot[name=icon]::slotted(*){color:var(--sgds-warning-color-fixed-light)}.toast{align-items:flex-start;background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);flex-direction:row;max-width:var(--sgds-dimension-480);min-width:var(--sgds-dimension-320);padding:var(--sgds-padding-md);pointer-events:auto;width:320px}.toast,.toast-content{display:flex;gap:var(--sgds-gap-sm)}.toast-content{word-wrap:break-word;flex-direction:column}.toast-body{display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs)}.toast-body__title{font-size:var(--sgds-font-size-subtitle-sm);font-weight:var(--sgds-font-weight-semibold);margin:0}.toast-body__message,.toast-body__title{line-height:var(--sgds-line-height-2-xs)}.toast-body__message{color:var(--sgds-color-subtle,#525252);font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular)}.toast-action{word-wrap:break-word;color:var(--sgds-link-color-default)}.toast-header strong{margin-right:auto;word-break:break-all}.close-btn{position:absolute;right:10px;top:10px}.d-none{display:none}`;class Ft extends Nt{constructor(){super(...arguments),this.show=!1,this.title="Title",this.noAnimation=!1,this.autohide=!1,this.delay=5e3,this.variant="info",this.dismissible=!1}async showToast(){if(!this.show)return this.show=!0,Dt(this,"sgds-after-show")}async hideToast(){if(this.show)return this.show=!1,Dt(this,"sgds-after-hide")}handleCloseClick(){this.show=!1,this.emit("sgds-close")}async handleShowChange(){if(this.show){this.emit("sgds-show"),this.toast.classList.remove("d-none");const t=Wt(this,"toast.show");this.noAnimation||await Vt(this.toast,t.keyframes,t.options),this.emit("sgds-after-show")}else{this.emit("sgds-hide");const t=Wt(this,"toast.hide");this.noAnimation||await Vt(this.toast,t.keyframes,t.options),this.toast.classList.add("d-none"),this.emit("sgds-after-hide")}}firstUpdated(t){var e;if(super.firstUpdated(t),this.show||this.toast.classList.add("d-none"),0===this._actionNodes.length)return null===(e=this.shadowRoot.querySelector("slot[name='action']"))||void 0===e?void 0:e.classList.add("d-none")}render(){return this.autohide&&this.show&&setTimeout(()=>{this.show=!1},this.delay),Q`
39
+ `}}function Vt(t,e,s){return new Promise(i=>{if((null==s?void 0:s.duration)===1/0)throw new Error("Promise-based animations must be finite.");const o=t.animate(e,Object.assign(Object.assign({},s),{duration:Lt()?0:null==s?void 0:s.duration}));o.addEventListener("cancel",i,{once:!0}),o.addEventListener("finish",i,{once:!0})})}function Lt(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}Mt.styles=[...Nt.styles,Ut],t([kt({type:String,reflect:!0})],Mt.prototype,"size",void 0),t([kt({type:String,reflect:!0})],Mt.prototype,"tone",void 0);const Rt=new Map,At=new WeakMap;function Wt(t,e){const s=At.get(t);if(null==s?void 0:s[e])return s[e];const i=Rt.get(e);return i||{keyframes:[],options:{duration:0}}}function It(t,e){Rt.set(t,function(t){return null!=t?t:{keyframes:[],options:{duration:0}}}(e))}function Dt(t,e){return new Promise(s=>{t.addEventListener(e,function i(o){o.target===t&&(t.removeEventListener(e,i),s())})})}var jt,qt,Ht,Bt=r`:host([variant=info]) slot[name=icon]::slotted(*){color:var(--sgds-primary-color-default)}:host([variant=success]) slot[name=icon]::slotted(*){color:var(--sgds-success-color-default)}:host([variant=danger]) slot[name=icon]::slotted(*){color:var(--sgds-danger-color-default)}:host([variant=warning]) slot[name=icon]::slotted(*){color:var(--sgds-warning-color-fixed-light)}.toast{align-items:flex-start;background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);display:inline-flex;flex-direction:row;gap:var(--sgds-gap-sm);max-width:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);padding:var(--sgds-padding-md);pointer-events:auto;position:relative}.toast-content{word-wrap:break-word;gap:var(--sgds-gap-sm);padding-right:var(--sgds-padding-xl)}.toast-body,.toast-content{display:flex;flex-direction:column}.toast-body{gap:var(--sgds-gap-2-xs)}.toast-body__title{font-size:var(--sgds-font-size-subtitle-sm);font-weight:var(--sgds-font-weight-semibold);margin:0}.toast-body__message,.toast-body__title{line-height:var(--sgds-line-height-2-xs)}.toast-body__message{color:var(--sgds-color-subtle,#525252);font-size:var(--sgds-font-size-label-sm);font-weight:var(--sgds-font-weight-regular)}.toast-action{word-wrap:break-word;color:var(--sgds-link-color-default)}.toast-header strong{margin-right:auto;word-break:break-all}.close-btn{position:absolute;right:10px;top:10px}.d-none{display:none}`;class Ft extends Nt{constructor(){super(...arguments),this.show=!1,this.title="Title",this.noAnimation=!1,this.autohide=!1,this.delay=5e3,this.variant="info",this.dismissible=!1}async showToast(){if(!this.show)return this.show=!0,Dt(this,"sgds-after-show")}async hideToast(){if(this.show)return this.show=!1,Dt(this,"sgds-after-hide")}handleCloseClick(){this.show=!1,this.emit("sgds-close")}async handleShowChange(){if(this.show){this.emit("sgds-show"),this.toast.classList.remove("d-none");const t=Wt(this,"toast.show");this.noAnimation||await Vt(this.toast,t.keyframes,t.options),this.emit("sgds-after-show")}else{this.emit("sgds-hide");const t=Wt(this,"toast.hide");this.noAnimation||await Vt(this.toast,t.keyframes,t.options),this.toast.classList.add("d-none"),this.emit("sgds-after-hide")}}firstUpdated(t){var e;if(super.firstUpdated(t),this.show||this.toast.classList.add("d-none"),0===this._actionNodes.length)return null===(e=this.shadowRoot.querySelector("slot[name='action']"))||void 0===e?void 0:e.classList.add("d-none")}render(){return this.autohide&&this.show&&setTimeout(()=>{this.show=!1},this.delay),Q`
40
40
  <div
41
41
  class="toast"
42
42
  role="alert"