@ukic/web-components 3.29.0 → 3.30.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 (65) hide show
  1. package/components/ic-accordion.js +53 -38
  2. package/components/ic-accordion.js.map +1 -1
  3. package/components/ic-menu2.js +274 -35
  4. package/components/ic-menu2.js.map +1 -1
  5. package/components/ic-navigation-button.js +8 -5
  6. package/components/ic-navigation-button.js.map +1 -1
  7. package/components/ic-pagination-bar.js.map +1 -1
  8. package/components/ic-skip-link.js.map +1 -1
  9. package/components/ic-status-tag.js.map +1 -1
  10. package/components/ic-switch.js.map +1 -1
  11. package/dist/cjs/ic-accordion.cjs.entry.js +53 -38
  12. package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
  13. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +274 -35
  16. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  17. package/dist/cjs/ic-navigation-button.cjs.entry.js +8 -5
  18. package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
  20. package/dist/collection/components/ic-accordion/ic-accordion.js +53 -38
  21. package/dist/collection/components/ic-accordion/ic-accordion.js.map +1 -1
  22. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js +8 -5
  23. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
  24. package/dist/components/ic-accordion.js +53 -38
  25. package/dist/components/ic-accordion.js.map +1 -1
  26. package/dist/components/ic-back-to-top.js.map +1 -1
  27. package/dist/components/ic-hero.js.map +1 -1
  28. package/dist/components/ic-menu2.js +274 -35
  29. package/dist/components/ic-menu2.js.map +1 -1
  30. package/dist/components/ic-navigation-button.js +8 -5
  31. package/dist/components/ic-navigation-button.js.map +1 -1
  32. package/dist/components/ic-pagination-bar.js.map +1 -1
  33. package/dist/components/ic-popover-menu.js.map +1 -1
  34. package/dist/components/ic-radio-group.js.map +1 -1
  35. package/dist/components/ic-radio-option.js.map +1 -1
  36. package/dist/components/ic-search-bar.js.map +1 -1
  37. package/dist/components/ic-skip-link.js.map +1 -1
  38. package/dist/components/ic-status-tag.js.map +1 -1
  39. package/dist/components/ic-switch.js.map +1 -1
  40. package/dist/core/core.esm.js +1 -1
  41. package/dist/core/{p-9ced00a7.entry.js → p-41bbdc4c.entry.js} +2 -2
  42. package/dist/core/{p-9ced00a7.entry.js.map → p-41bbdc4c.entry.js.map} +1 -1
  43. package/dist/core/p-8fc5e9f9.entry.js.map +1 -1
  44. package/dist/core/p-98dee727.entry.js.map +1 -1
  45. package/dist/core/{p-fc4b7d2b.entry.js → p-9cf35c23.entry.js} +2 -2
  46. package/dist/core/p-9cf35c23.entry.js.map +1 -0
  47. package/dist/core/p-a8d98164.entry.js.map +1 -1
  48. package/dist/core/p-ccba84b7.entry.js +3 -0
  49. package/dist/core/p-ccba84b7.entry.js.map +1 -0
  50. package/dist/esm/ic-accordion.entry.js +53 -38
  51. package/dist/esm/ic-accordion.entry.js.map +1 -1
  52. package/dist/esm/ic-button_3.entry.js.map +1 -1
  53. package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
  54. package/dist/esm/ic-input-component-container_3.entry.js +274 -35
  55. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  56. package/dist/esm/ic-navigation-button.entry.js +8 -5
  57. package/dist/esm/ic-navigation-button.entry.js.map +1 -1
  58. package/dist/esm/ic-section-container.entry.js.map +1 -1
  59. package/dist/types/components/ic-accordion/ic-accordion.d.ts +2 -0
  60. package/hydrate/index.js +334 -77
  61. package/hydrate/index.mjs +334 -77
  62. package/package.json +1 -1
  63. package/dist/core/p-305d9639.entry.js +0 -3
  64. package/dist/core/p-305d9639.entry.js.map +0 -1
  65. package/dist/core/p-fc4b7d2b.entry.js.map +0 -1
@@ -37,12 +37,15 @@ const NavigationButton = class {
37
37
  this.hostMutationCallback = (mutationList) => {
38
38
  let forceComponentUpdate = false;
39
39
  mutationList.forEach(({ attributeName }) => {
40
- if (attributeName) {
40
+ if (attributeName && MUTABLE_ATTRIBUTES.includes(attributeName)) {
41
41
  const attribute = this.el.getAttribute(attributeName);
42
- if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {
42
+ if (attribute) {
43
43
  this.inheritedAttributes[attributeName] = attribute;
44
- forceComponentUpdate = true;
45
44
  }
45
+ else {
46
+ delete this.inheritedAttributes[attributeName];
47
+ }
48
+ forceComponentUpdate = true;
46
49
  }
47
50
  });
48
51
  if (forceComponentUpdate) {
@@ -109,11 +112,11 @@ const NavigationButton = class {
109
112
  target,
110
113
  theme,
111
114
  };
112
- return (index.h(index.Host, { key: '538ea349b1f0791b0cd68898380fe4cfd41b5496', class: {
115
+ return (index.h(index.Host, { key: 'dd30f288d728c8e8dffd4108d05e0a02b782d9ea', class: {
113
116
  "in-side-menu": isMenuMode,
114
117
  [`ic-theme-${theme}`]: theme !== "inherit",
115
118
  dark: parentThemeDark,
116
- } }, index.h("ic-button", Object.assign({ key: 'afee63c46529276cd2b77ef6d7c1c69b47a7ae15', ref: (el) => (this.buttonEl = el), class: { "popout-menu-button": isMenuMode }, "aria-label": !isMenuMode ? label : null, disableTooltip: isMenuMode, fullWidth: isMenuMode, monochrome: !isMenuMode, size: isMenuMode ? "medium" : "large", variant: isMenuMode ? "tertiary" : "icon-tertiary" }, buttonProps, inheritedAttributes), isMenuMode ? label : "", index.h("slot", { key: '8c2a89dfc8f974017cf5384355ce0f881218d038', slot: "left-icon", name: "icon" }), helpers.isSlotUsed(this.el, "badge") && index.h("slot", { key: '7fab4237f3f6745159d584df008e82214ecd3322', name: "badge" }))));
119
+ } }, index.h("ic-button", Object.assign({ key: 'b59e4538abe478aa21617a1ce3347668c3859e40', ref: (el) => (this.buttonEl = el), class: { "popout-menu-button": isMenuMode }, "aria-label": !isMenuMode ? label : null, disableTooltip: isMenuMode, fullWidth: isMenuMode, monochrome: !isMenuMode, size: isMenuMode ? "medium" : "large", variant: isMenuMode ? "tertiary" : "icon-tertiary" }, buttonProps, inheritedAttributes), isMenuMode ? label : "", index.h("slot", { key: '4ca3226dd11288f30f595d8b0fa8484838b527c4', slot: "left-icon", name: "icon" }), helpers.isSlotUsed(this.el, "badge") && index.h("slot", { key: '89408c559f0b62b9f92686bbc14a5312f8e6c2c6', name: "badge" }))));
117
120
  }
118
121
  static get delegatesFocus() { return true; }
119
122
  get el() { return index.getElement(this); }
@@ -1 +1 @@
1
- {"file":"ic-navigation-button.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,qBAAqB,GAAG,mpGAAmpG,CAAC;AAClrG,iCAAe,qBAAqB;;AC2BpC,MAAM,kBAAkB,GAAG,CAAC,GAAGA,2BAAiB,EAAE,OAAO,CAAC,CAAC;MAc9C,gBAAgB;IAP7B;;QASU,wBAAmB,GAA4B,EAAE,CAAC;QAClD,yBAAoB,GAA4B,IAAI,CAAC;;;;QAOpD,SAAI,GAAqB,QAAQ,CAAC;;;;QAKlC,oBAAe,GAAG,KAAK,CAAC;;;;QAKzB,aAAQ,GAAqB,KAAK,CAAC;;;;QAmClB,UAAK,GAAgB,SAAS,CAAC;;;;QA+DhD,yBAAoB,GAAG,CAAC,YAA8B;YAC5D,IAAI,oBAAoB,GAAG,KAAK,CAAC;YACjC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,aAAa,EAAE;gBACrC,IAAI,aAAa,EAAE;oBACjB,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;oBACtD,IAAI,SAAS,IAAI,kBAAkB,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;wBAC3D,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;wBACpD,oBAAoB,GAAG,IAAI,CAAC;qBAC7B;iBACF;aACF,CAAC,CAAC;YACH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AAI,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,GAAQ,EACzCE,kBAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,IAAIF,mEAAM,IAAI,EAAC,OAAO,GAAQ,CACjD,CACP,EACP;KACH;;;;;;;;","names":["IC_INHERITED_ARIA","forceUpdate","inheritAttributes","onComponentRequiredPropUndefined","getElementInheritedTheme","getBrandForegroundAppearance","IcBrandForegroundEnum","h","Host","isSlotUsed"],"sources":["src/components/ic-navigation-button/ic-navigation-button.css?tag=ic-navigation-button&encapsulation=shadow","src/components/ic-navigation-button/ic-navigation-button.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n margin-right: var(--ic-space-xs);\n list-style: none;\n}\n\n:host(.in-side-menu) {\n margin-right: 0;\n}\n\n:host::part(button) {\n height: 100%;\n min-height: 2.5rem;\n}\n\n:host(:not(.in-side-menu)) ::part(button):focus {\n box-shadow: var(--ic-border-focus-light);\n}\n\n:host(:not(.in-side-menu).dark) ::part(button):focus {\n box-shadow: var(--ic-border-focus-dark);\n}\n\n:host(.in-side-menu) ::part(button) {\n color: var(--ic-top-navigation-icon-active);\n}\n\n:host(.in-side-menu) ::part(button):hover {\n color: var(--ic-top-navigation-icon-hover);\n background-color: var(--ic-top-navigation-icon-hover-background);\n}\n\n:host(.in-side-menu) ::part(button):active {\n color: var(--ic-top-navigation-icon-pressed);\n background-color: var(--ic-top-navigation-icon-pressed-background);\n}\n\n:host(.in-side-menu) ::slotted(ic-badge) {\n margin-left: var(--ic-space-xs);\n}\n","import {\n Component,\n Element,\n Host,\n Listen,\n Method,\n Prop,\n State,\n forceUpdate,\n h,\n} from \"@stencil/core\";\n\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n getBrandForegroundAppearance,\n getElementInheritedTheme,\n inheritAttributes,\n isSlotUsed,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport {\n IcBrand,\n IcBrandForeground,\n IcBrandForegroundEnum,\n IcThemeMode,\n} from \"../../utils/types\";\nimport { IcNavButtonModes } from \"./ic-navigation-button.types\";\n\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\n\n/**\n * @slot icon - Content will be placed to the left of the button label.\n * @slot badge - Badge component overlaying the top right of the button.\n */\n\n@Component({\n tag: \"ic-navigation-button\",\n styleUrl: \"ic-navigation-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class NavigationButton {\n private buttonEl?: HTMLIcButtonElement;\n private inheritedAttributes: { [k: string]: string } = {};\n private hostMutationObserver: MutationObserver | null = null;\n\n @Element() el: HTMLIcNavigationButtonElement;\n\n /**\n * The display mode.\n */\n @State() mode: IcNavButtonModes = \"navbar\";\n\n /**\n * The parent theme used to inherit external colour tokens such as focus indicator.\n */\n @State() parentThemeDark = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download: string | boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * The label info to display.\n */\n @Prop() label!: string;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop({ mutable: true }) theme: IcThemeMode = \"inherit\";\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Navigation Button\"\n );\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n });\n }\n\n componentWillRender(): void {\n this.el\n .querySelector(`[slot=\"icon\"]`)\n ?.setAttribute(\"viewBox\", \"0 0 24 24\");\n this.parentThemeChangeHandler();\n }\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n @Listen(\"icNavigationMenuOpened\", { target: \"document\" })\n navBarMenuOpenHandler(): void {\n this.mode = \"menu\";\n this.theme = (this.el.parentElement as HTMLIcTopNavigationElement).theme;\n }\n\n @Listen(\"icNavigationMenuClosed\", { target: \"document\" })\n navBarMenuCloseHandler(): void {\n this.mode = \"navbar\";\n this.updateTheme();\n }\n\n @Listen(\"brandChange\", { target: \"document\" })\n brandChangeHandler({ detail: { mode } }: CustomEvent<IcBrand>): void {\n this.updateTheme(mode);\n }\n\n @Listen(\"icThemeChange\", { target: \"document\" })\n parentThemeChangeHandler(): void {\n this.parentThemeDark = getElementInheritedTheme(this.el) === \"dark\";\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.buttonEl?.setFocus();\n }\n\n /**\n * Triggered when attributes of host element change\n */\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(({ attributeName }) => {\n if (attributeName) {\n const attribute = this.el.getAttribute(attributeName);\n if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {\n this.inheritedAttributes[attributeName] = attribute;\n forceComponentUpdate = true;\n }\n }\n });\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private updateTheme(\n mode: IcBrandForeground = getBrandForegroundAppearance()\n ) {\n this.theme =\n mode === IcBrandForegroundEnum.Light\n ? IcBrandForegroundEnum.Dark\n : IcBrandForegroundEnum.Light;\n }\n\n render() {\n const {\n download,\n href,\n inheritedAttributes,\n label,\n mode,\n parentThemeDark,\n referrerpolicy,\n rel,\n target,\n theme,\n } = this;\n\n const isMenuMode = mode === \"menu\";\n\n const buttonProps = {\n download,\n href,\n referrerpolicy,\n rel,\n target,\n theme,\n };\n\n return (\n <Host\n class={{\n \"in-side-menu\": isMenuMode,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n dark: parentThemeDark,\n }}\n >\n <ic-button\n ref={(el) => (this.buttonEl = el)}\n class={{ \"popout-menu-button\": isMenuMode }}\n aria-label={!isMenuMode ? label : null}\n disableTooltip={isMenuMode}\n fullWidth={isMenuMode}\n monochrome={!isMenuMode}\n size={isMenuMode ? \"medium\" : \"large\"}\n variant={isMenuMode ? \"tertiary\" : \"icon-tertiary\"}\n {...buttonProps}\n {...inheritedAttributes}\n >\n {isMenuMode ? label : \"\"}\n <slot slot=\"left-icon\" name=\"icon\"></slot>\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n </ic-button>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"ic-navigation-button.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,qBAAqB,GAAG,mpGAAmpG,CAAC;AAClrG,iCAAe,qBAAqB;;AC2BpC,MAAM,kBAAkB,GAAG,CAAC,GAAGA,2BAAiB,EAAE,OAAO,CAAC,CAAC;MAc9C,gBAAgB;IAP7B;;QASU,wBAAmB,GAA4B,EAAE,CAAC;QAClD,yBAAoB,GAA4B,IAAI,CAAC;;;;QAOpD,SAAI,GAAqB,QAAQ,CAAC;;;;QAKlC,oBAAe,GAAG,KAAK,CAAC;;;;QAKzB,aAAQ,GAAqB,KAAK,CAAC;;;;QAmClB,UAAK,GAAgB,SAAS,CAAC;;;;QA+DhD,yBAAoB,GAAG,CAAC,YAA8B;YAC5D,IAAI,oBAAoB,GAAG,KAAK,CAAC;YACjC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,aAAa,EAAE;gBACrC,IAAI,aAAa,IAAI,kBAAkB,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;oBAC/D,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;oB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SAAS,EAAE,UAAU,EACrB,UAAU,EAAE,CAAC,UAAU,EACvB,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,EACrC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,eAAe,IAC9C,WAAW,EACX,mBAAmB,GAEtB,UAAU,GAAG,KAAK,GAAG,EAAE,EACxBA,mEAAM,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,GAAQ,EACzCE,kBAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,IAAIF,mEAAM,IAAI,EAAC,OAAO,GAAQ,CACjD,CACP,EACP;KACH;;;;;;;;","names":["IC_INHERITED_ARIA","forceUpdate","inheritAttributes","onComponentRequiredPropUndefined","getElementInheritedTheme","getBrandForegroundAppearance","IcBrandForegroundEnum","h","Host","isSlotUsed"],"sources":["src/components/ic-navigation-button/ic-navigation-button.css?tag=ic-navigation-button&encapsulation=shadow","src/components/ic-navigation-button/ic-navigation-button.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n margin-right: var(--ic-space-xs);\n list-style: none;\n}\n\n:host(.in-side-menu) {\n margin-right: 0;\n}\n\n:host::part(button) {\n height: 100%;\n min-height: 2.5rem;\n}\n\n:host(:not(.in-side-menu)) ::part(button):focus {\n box-shadow: var(--ic-border-focus-light);\n}\n\n:host(:not(.in-side-menu).dark) ::part(button):focus {\n box-shadow: var(--ic-border-focus-dark);\n}\n\n:host(.in-side-menu) ::part(button) {\n color: var(--ic-top-navigation-icon-active);\n}\n\n:host(.in-side-menu) ::part(button):hover {\n color: var(--ic-top-navigation-icon-hover);\n background-color: var(--ic-top-navigation-icon-hover-background);\n}\n\n:host(.in-side-menu) ::part(button):active {\n color: var(--ic-top-navigation-icon-pressed);\n background-color: var(--ic-top-navigation-icon-pressed-background);\n}\n\n:host(.in-side-menu) ::slotted(ic-badge) {\n margin-left: var(--ic-space-xs);\n}\n","import {\n Component,\n Element,\n Host,\n Listen,\n Method,\n Prop,\n State,\n forceUpdate,\n h,\n} from \"@stencil/core\";\n\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n getBrandForegroundAppearance,\n getElementInheritedTheme,\n inheritAttributes,\n isSlotUsed,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport {\n IcBrand,\n IcBrandForeground,\n IcBrandForegroundEnum,\n IcThemeMode,\n} from \"../../utils/types\";\nimport { IcNavButtonModes } from \"./ic-navigation-button.types\";\n\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\n\n/**\n * @slot icon - Content will be placed to the left of the button label.\n * @slot badge - Badge component overlaying the top right of the button.\n */\n\n@Component({\n tag: \"ic-navigation-button\",\n styleUrl: \"ic-navigation-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class NavigationButton {\n private buttonEl?: HTMLIcButtonElement;\n private inheritedAttributes: { [k: string]: string } = {};\n private hostMutationObserver: MutationObserver | null = null;\n\n @Element() el: HTMLIcNavigationButtonElement;\n\n /**\n * The display mode.\n */\n @State() mode: IcNavButtonModes = \"navbar\";\n\n /**\n * The parent theme used to inherit external colour tokens such as focus indicator.\n */\n @State() parentThemeDark = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download: string | boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * The label info to display.\n */\n @Prop() label!: string;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop({ mutable: true }) theme: IcThemeMode = \"inherit\";\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Navigation Button\"\n );\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n });\n }\n\n componentWillRender(): void {\n this.el\n .querySelector(`[slot=\"icon\"]`)\n ?.setAttribute(\"viewBox\", \"0 0 24 24\");\n this.parentThemeChangeHandler();\n }\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n @Listen(\"icNavigationMenuOpened\", { target: \"document\" })\n navBarMenuOpenHandler(): void {\n this.mode = \"menu\";\n this.theme = (this.el.parentElement as HTMLIcTopNavigationElement).theme;\n }\n\n @Listen(\"icNavigationMenuClosed\", { target: \"document\" })\n navBarMenuCloseHandler(): void {\n this.mode = \"navbar\";\n this.updateTheme();\n }\n\n @Listen(\"brandChange\", { target: \"document\" })\n brandChangeHandler({ detail: { mode } }: CustomEvent<IcBrand>): void {\n this.updateTheme(mode);\n }\n\n @Listen(\"icThemeChange\", { target: \"document\" })\n parentThemeChangeHandler(): void {\n this.parentThemeDark = getElementInheritedTheme(this.el) === \"dark\";\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.buttonEl?.setFocus();\n }\n\n /**\n * Triggered when attributes of host element change\n */\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(({ attributeName }) => {\n if (attributeName && MUTABLE_ATTRIBUTES.includes(attributeName)) {\n const attribute = this.el.getAttribute(attributeName);\n if (attribute) {\n this.inheritedAttributes[attributeName] = attribute;\n } else {\n delete this.inheritedAttributes[attributeName];\n }\n forceComponentUpdate = true;\n }\n });\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private updateTheme(\n mode: IcBrandForeground = getBrandForegroundAppearance()\n ) {\n this.theme =\n mode === IcBrandForegroundEnum.Light\n ? IcBrandForegroundEnum.Dark\n : IcBrandForegroundEnum.Light;\n }\n\n render() {\n const {\n download,\n href,\n inheritedAttributes,\n label,\n mode,\n parentThemeDark,\n referrerpolicy,\n rel,\n target,\n theme,\n } = this;\n\n const isMenuMode = mode === \"menu\";\n\n const buttonProps = {\n download,\n href,\n referrerpolicy,\n rel,\n target,\n theme,\n };\n\n return (\n <Host\n class={{\n \"in-side-menu\": isMenuMode,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n dark: parentThemeDark,\n }}\n >\n <ic-button\n ref={(el) => (this.buttonEl = el)}\n class={{ \"popout-menu-button\": isMenuMode }}\n aria-label={!isMenuMode ? label : null}\n disableTooltip={isMenuMode}\n fullWidth={isMenuMode}\n monochrome={!isMenuMode}\n size={isMenuMode ? \"medium\" : \"large\"}\n variant={isMenuMode ? \"tertiary\" : \"icon-tertiary\"}\n {...buttonProps}\n {...inheritedAttributes}\n >\n {isMenuMode ? label : \"\"}\n <slot slot=\"left-icon\" name=\"icon\"></slot>\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n </ic-button>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"ic-section-container.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,qBAAqB,GAAG,+0HAA+0H,CAAC;AAC92H,iCAAe,qBAAqB;;MCOvB,gBAAgB;IAL7B;;;;;QASU,YAAO,GAAiB,MAAM,CAAC;;;;QAK/B,eAAU,GAAa,KAAK,CAAC;KAiBtC;IAfC,MAAM;QACJ,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QACrC,QACEA,QAACC,UAAI,qDACH,KAAK,EAAE;gBACL,CAAC,cAAc,GAAG,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,IAAI;gBACxD,CAAC,gBAAgB,GAAG,OAAO,KAAK,QAAQ;gBACxC,CAAC,oBAAoB,GAAG,OAAO,KAAK,YAAY;gBAChD,CAAC,qBAAqB,GAAG,CAAC,CAAC,UAAU;aACtC,IAEDD,oEAAa,CACR,EACP;KACH;;;;;;","names":["h","Host"],"sources":["src/components/ic-section-container/ic-section-container.css?tag=ic-section-container&encapsulation=shadow","src/components/ic-section-container/ic-section-container.tsx"],"sourcesContent":["/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the `main` element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\nhtml,\nbody,\ndiv,\nspan,\napplet,\nobject,\niframe,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote,\npre,\na,\nabbr,\nacronym,\naddress,\nbig,\ncite,\ncode,\ndel,\ndfn,\nem,\nimg,\nins,\nkbd,\nq,\ns,\nsamp,\nsmall,\nstrike,\nstrong,\nsub,\nsup,\ntt,\nvar,\nb,\nu,\ni,\ncenter,\ndl,\ndt,\ndd,\nol,\nul,\nli,\nfieldset,\nform,\nlabel,\nlegend,\ntable,\ncaption,\ntbody,\ntfoot,\nthead,\ntr,\nth,\ntd,\narticle,\naside,\ncanvas,\ndetails,\nembed,\nfigure,\nfigcaption,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\noutput,\nruby,\nsection,\nsummary,\ntime,\nmark,\naudio,\nvideo {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font-style: inherit;\n vertical-align: baseline;\n}\n\n\n@media only screen and (max-width: 576px) {\n :host {\n --section-container-margin: var(--ic-space-xs);\n --section-container-max-width: var(--ic-breakpoint-sm);\n }\n}\n\n@media only screen and (min-width: 577px) {\n :host {\n --section-container-margin: var(--ic-space-md);\n --section-container-max-width: var(--ic-breakpoint-md);\n }\n}\n\n@media only screen and (min-width: 769px) {\n :host {\n --section-container-margin: var(--ic-space-md);\n --section-container-max-width: var(--ic-breakpoint-lg);\n }\n}\n\n@media only screen and (min-width: 993px) {\n :host {\n --section-container-margin: var(--ic-space-md);\n --section-container-max-width: var(--ic-breakpoint-xl);\n }\n}\n\n@media only screen and (min-width: 1201px) {\n :host {\n --section-container-margin: var(--ic-space-lg);\n --section-container-max-width: var(--ic-breakpoint-xl);\n }\n}\n\n:host {\n display: block;\n padding-top: var(--ic-space-md);\n padding-bottom: var(--ic-space-md);\n box-sizing: border-box;\n}\n\n:host(.aligned-center) {\n max-width: var(--section-container-max-width);\n margin-left: auto;\n margin-right: auto;\n padding-left: var(--section-container-margin);\n padding-right: var(--section-container-margin);\n}\n\n:host(.aligned-left) {\n max-width: var(--section-container-max-width);\n margin-left: var(--section-container-margin);\n margin-right: auto;\n padding-right: var(--section-container-margin);\n}\n\n:host(.aligned-full-width) {\n margin-left: var(--section-container-margin);\n margin-right: var(--section-container-margin);\n}\n\n:host(.vertical-padding) {\n padding-top: var(--ic-space-md);\n padding-bottom: var(--ic-space-md);\n}\n\n:host(.no-vertical-padding) {\n padding-top: 0;\n padding-bottom: 0;\n}\n","import { Component, Prop, Host, h } from \"@stencil/core\";\nimport { IcAlignment } from \"../../utils/types\";\n\n@Component({\n tag: \"ic-section-container\",\n styleUrl: \"ic-section-container.css\",\n shadow: true,\n})\nexport class SectionContainer {\n /**\n * The alignment of the container.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * If `true`, the standard vertical padding from the container will be removed.\n */\n @Prop() fullHeight?: boolean = false;\n\n render() {\n const { aligned, fullHeight } = this;\n return (\n <Host\n class={{\n [\"aligned-left\"]: aligned === \"left\" || aligned === null,\n [\"aligned-center\"]: aligned === \"center\",\n [\"aligned-full-width\"]: aligned === \"full-width\",\n [\"no-vertical-padding\"]: !!fullHeight,\n }}\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"ic-section-container.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,qBAAqB,GAAG,+0HAA+0H,CAAC;AAC92H,iCAAe,qBAAqB;;MCOvB,gBAAgB;IAL7B;;;;;QASU,YAAO,GAAiB,MAAM,CAAC;;;;QAK/B,eAAU,GAAa,KAAK,CAAC;KAiBtC;IAfC,MAAM;QACJ,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QACrC,QACEA,QAACC,UAAI,qDACH,KAAK,EAAE;gBACL,CAAC,cAAc,GAAG,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,IAAI;gBACxD,CAAC,gBAAgB,GAAG,OAAO,KAAK,QAAQ;gBACxC,CAAC,oBAAoB,GAAG,OAAO,KAAK,YAAY;gBAChD,CAAC,qBAAqB,GAAG,CAAC,CAAC,UAAU;aACtC,IAEDD,oEAAa,CACR,EACP;KACH;;;;;;","names":["h","Host"],"sources":["src/components/ic-section-container/ic-section-container.css?tag=ic-section-container&encapsulation=shadow","src/components/ic-section-container/ic-section-container.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n@media only screen and (max-width: 576px) {\n :host {\n --section-container-margin: var(--ic-space-xs);\n --section-container-max-width: var(--ic-breakpoint-sm);\n }\n}\n\n@media only screen and (min-width: 577px) {\n :host {\n --section-container-margin: var(--ic-space-md);\n --section-container-max-width: var(--ic-breakpoint-md);\n }\n}\n\n@media only screen and (min-width: 769px) {\n :host {\n --section-container-margin: var(--ic-space-md);\n --section-container-max-width: var(--ic-breakpoint-lg);\n }\n}\n\n@media only screen and (min-width: 993px) {\n :host {\n --section-container-margin: var(--ic-space-md);\n --section-container-max-width: var(--ic-breakpoint-xl);\n }\n}\n\n@media only screen and (min-width: 1201px) {\n :host {\n --section-container-margin: var(--ic-space-lg);\n --section-container-max-width: var(--ic-breakpoint-xl);\n }\n}\n\n:host {\n display: block;\n padding-top: var(--ic-space-md);\n padding-bottom: var(--ic-space-md);\n box-sizing: border-box;\n}\n\n:host(.aligned-center) {\n max-width: var(--section-container-max-width);\n margin-left: auto;\n margin-right: auto;\n padding-left: var(--section-container-margin);\n padding-right: var(--section-container-margin);\n}\n\n:host(.aligned-left) {\n max-width: var(--section-container-max-width);\n margin-left: var(--section-container-margin);\n margin-right: auto;\n padding-right: var(--section-container-margin);\n}\n\n:host(.aligned-full-width) {\n margin-left: var(--section-container-margin);\n margin-right: var(--section-container-margin);\n}\n\n:host(.vertical-padding) {\n padding-top: var(--ic-space-md);\n padding-bottom: var(--ic-space-md);\n}\n\n:host(.no-vertical-padding) {\n padding-top: 0;\n padding-bottom: 0;\n}\n","import { Component, Prop, Host, h } from \"@stencil/core\";\nimport { IcAlignment } from \"../../utils/types\";\n\n@Component({\n tag: \"ic-section-container\",\n styleUrl: \"ic-section-container.css\",\n shadow: true,\n})\nexport class SectionContainer {\n /**\n * The alignment of the container.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * If `true`, the standard vertical padding from the container will be removed.\n */\n @Prop() fullHeight?: boolean = false;\n\n render() {\n const { aligned, fullHeight } = this;\n return (\n <Host\n class={{\n [\"aligned-left\"]: aligned === \"left\" || aligned === null,\n [\"aligned-center\"]: aligned === \"center\",\n [\"aligned-full-width\"]: aligned === \"full-width\",\n [\"no-vertical-padding\"]: !!fullHeight,\n }}\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -41,16 +41,9 @@ export class Accordion {
41
41
  };
42
42
  // Set accordion animation
43
43
  this.setAccordionAnimation = (el, duration, property, delay) => {
44
- if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
45
- el.style.transitionDuration = `${duration}ms`;
46
- el.style.transitionProperty = property;
47
- el.style.transitionDelay = delay;
48
- }
49
- else {
50
- el.style.transitionDuration = "0ms";
51
- el.style.transitionProperty = "none";
52
- el.style.transitionDelay = "0ms";
53
- }
44
+ el.style.transitionDuration = `${duration}ms`;
45
+ el.style.transitionProperty = property;
46
+ el.style.transitionTimingFunction = delay;
54
47
  };
55
48
  this.setExpandedContentStyle = (ev, expandedContent) => {
56
49
  if (ev.propertyName === "height" && expandedContent.clientHeight > 0) {
@@ -64,30 +57,52 @@ export class Accordion {
64
57
  }
65
58
  };
66
59
  this.animateExpandedContent = () => {
67
- if (this.expandedContentEl) {
68
- const expandedContentEl = this.expandedContentEl;
69
- const elementHeight = expandedContentEl.scrollHeight;
70
- if (elementHeight > 0 && this.expanded) {
71
- expandedContentEl.style.setProperty(this.CONTENT_VISIBILITY_PROPERTY, "visible");
72
- expandedContentEl.style.height = `${elementHeight}px`;
73
- this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-out");
74
- expandedContentEl.addEventListener("transitionend", (e) => {
75
- this.setExpandedContentStyle(e, expandedContentEl);
76
- });
77
- }
78
- else if (!this.expanded) {
79
- const expandedContentEl = this.expandedContentEl;
80
- expandedContentEl.style.height = `${expandedContentEl.scrollHeight}px`;
81
- if (expandedContentEl.scrollHeight > 0 && !this.expanded) {
82
- expandedContentEl.style.height = "0";
83
- this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-in");
84
- expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);
85
- }
86
- expandedContentEl.addEventListener("transitionend", (e) => {
87
- this.hideExpandedContent(e, expandedContentEl);
88
- });
89
- }
60
+ const expandedContentEl = this.expandedContentEl;
61
+ if (!expandedContentEl)
62
+ return;
63
+ const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
64
+ if (this.expanded) {
65
+ this.expandContent(expandedContentEl, prefersReducedMotion);
66
+ return;
67
+ }
68
+ this.collapseContent(expandedContentEl, prefersReducedMotion);
69
+ };
70
+ this.expandContent = (expandedContentEl, prefersReducedMotion) => {
71
+ const elementHeight = expandedContentEl.scrollHeight;
72
+ if (elementHeight <= 0)
73
+ return;
74
+ expandedContentEl.style.setProperty(this.CONTENT_VISIBILITY_PROPERTY, "visible");
75
+ if (prefersReducedMotion) {
76
+ expandedContentEl.classList.add(EXPANDED_CONTENT_OPENED_CLASS);
77
+ expandedContentEl.style.height = "auto";
78
+ return;
79
+ }
80
+ expandedContentEl.style.height = `${elementHeight}px`;
81
+ this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-out");
82
+ expandedContentEl.addEventListener("transitionend", (e) => {
83
+ this.setExpandedContentStyle(e, expandedContentEl);
84
+ }, { once: true });
85
+ };
86
+ this.collapseContent = (expandedContentEl, prefersReducedMotion) => {
87
+ const elementHeight = expandedContentEl.scrollHeight;
88
+ if (elementHeight <= 0)
89
+ return;
90
+ // Set the content panel as pixels from "auto" so it can be animated
91
+ expandedContentEl.style.height = `${elementHeight}px`;
92
+ if (prefersReducedMotion) {
93
+ expandedContentEl.style.height = "0";
94
+ expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);
95
+ expandedContentEl.style.setProperty(this.CONTENT_VISIBILITY_PROPERTY, "hidden");
96
+ return;
90
97
  }
98
+ requestAnimationFrame(() => {
99
+ expandedContentEl.style.height = "0";
100
+ });
101
+ this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-in");
102
+ expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);
103
+ expandedContentEl.addEventListener("transitionend", (e) => {
104
+ this.hideExpandedContent(e, expandedContentEl);
105
+ }, { once: true });
91
106
  };
92
107
  }
93
108
  watchDisabledHandler() {
@@ -124,19 +139,19 @@ export class Accordion {
124
139
  }
125
140
  render() {
126
141
  const { size, disabled, expanded, theme } = this;
127
- return (h(Host, { key: '58ea81b0011f31da3d2d872244720011cb9028c8', id: this.accordionId, class: {
142
+ return (h(Host, { key: '840baa7799dc4c48c232a7dc170937bb563900d5', id: this.accordionId, class: {
128
143
  ["ic-accordion-disabled"]: !!disabled,
129
144
  [`ic-theme-${theme}`]: theme !== "inherit",
130
- }, "aria-disabled": disabled ? "true" : "false" }, h("button", { key: '1a79e3d09955ed9bb07ddac08690ff157d98313d', ref: (el) => (this.accordionBtnHeading = el), id: `${this.accordionId}-button`, disabled: disabled, tabindex: disabled ? -1 : 0, class: {
145
+ }, "aria-disabled": disabled ? "true" : "false" }, h("button", { key: 'dce03cb5ba0f61a1d5b75ab1f648eaa970d5d78e', ref: (el) => (this.accordionBtnHeading = el), id: `${this.accordionId}-button`, disabled: disabled, tabindex: disabled ? -1 : 0, class: {
131
146
  [`${size}`]: true,
132
147
  ["section-button"]: true,
133
148
  ["section-button-open"]: !!expanded && !disabled,
134
- }, "aria-expanded": `${expanded}`, "aria-controls": "expanded-content-area", onClick: this.toggleExpanded }, isSlotUsed(this.el, "icon") && (h("div", { key: 'fc0e123d20dca395b2210f1ee14c7d89bb8e50ad', class: "icon-container" }, h("slot", { key: 'c2185289998b60967ec0a0097a3aad8b4a88f07c', name: "icon" }))), h("ic-typography", { key: '211d4d69f0468dbec907c6d32ec61adea8e6be61', variant: "subtitle-large", class: "section-header" }, isSlotUsed(this.el, "heading") ? (h("slot", { name: "heading" })) : (this.heading)), h("span", { key: 'e9f9ef3f67e85d33d0459c55d7307dcf522f0628', class: {
149
+ }, "aria-expanded": `${expanded}`, "aria-controls": "expanded-content-area", onClick: this.toggleExpanded }, isSlotUsed(this.el, "icon") && (h("div", { key: '3301b5e4526831e7e8a4400d775f55d99ec29d27', class: "icon-container" }, h("slot", { key: 'aa49cdcd343009d6d5b7e68f5c1013cd7fcc7638', name: "icon" }))), h("ic-typography", { key: 'da324db78e29a81f0c5bb7209f870b8832c25d67', variant: "subtitle-large", class: "section-header" }, isSlotUsed(this.el, "heading") ? (h("slot", { name: "heading" })) : (this.heading)), h("span", { key: '9eb1350c8ae3f9c940e1299a17b3b510ccb66ef6', class: {
135
150
  ["expand-chevron"]: true,
136
151
  ["content-expanded-chevron"]: !!expanded && !disabled,
137
- }, "aria-hidden": "true", innerHTML: chevronIcon })), h("div", { key: '1e74fb0c312fc767a7518cbfcce5f55a90fc22a9', class: {
152
+ }, "aria-hidden": "true", innerHTML: chevronIcon })), h("div", { key: '9b04e4a6df4def67189609215cd4849890900146', class: {
138
153
  ["expanded-content"]: true,
139
- }, "aria-labelledby": `${this.accordionId}-button`, role: "region", "aria-hidden": `${!expanded}`, id: "expanded-content-area", ref: (el) => (this.expandedContentEl = el) }, h("div", { key: '04ed5966177cce63233f64e4e2d01bcbecbe10af', class: "expanded-content-inner" }, this.message ? (h("ic-typography", { variant: "body" }, this.message)) : (h("slot", null))))));
154
+ }, "aria-labelledby": `${this.accordionId}-button`, role: "region", "aria-hidden": `${!expanded}`, id: "expanded-content-area", ref: (el) => (this.expandedContentEl = el) }, h("div", { key: '594f88da687634cbbad7e12d8df21a3dc7961a64', class: "expanded-content-inner" }, this.message ? (h("ic-typography", { variant: "body" }, this.message)) : (h("slot", null))))));
140
155
  }
141
156
  static get is() { return "ic-accordion"; }
142
157
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"ic-accordion.js","sourceRoot":"","sources":["../../../src/components/ic-accordion/ic-accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAGxD,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEhE;;;GAGG;AAOH,MAAM,OAAO,SAAS;IALtB;QAMU,gBAAW,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;QAG/C,gCAA2B,GAAG,kCAAkC,CAAC;QAIzE;;WAEG;QACK,aAAQ,GAAa,KAAK,CAAC;QAMnC;;WAEG;QACsB,aAAQ,GAAa,KAAK,CAAC;QAEpD;;WAEG;QACK,YAAO,GAAY,EAAE,CAAC;QAE9B;;WAEG;QACK,YAAO,GAAY,EAAE,CAAC;QAE9B;;WAEG;QACK,SAAI,GAAa,QAAQ,CAAC;QAElC;;WAEG;QACK,UAAK,GAAiB,SAAS,CAAC;QAqDhC,mBAAc,GAAG,GAAS,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACvD,CAAC,CAAC;QAEF,0BAA0B;QA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AAC,CACF,IAAI,CAAC,OAAO,CACb,CACa;gBAChB,6DACE,KAAK,EAAE;wBACL,CAAC,gBAAgB,CAAC,EAAE,IAAI;wBACxB,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC,QAAQ,IAAI,CAAC,QAAQ;qBACtD,iBACW,MAAM,EAClB,SAAS,EAAE,WAAW,GACtB,CACK;YACT,4DACE,KAAK,EAAE;oBACL,CAAC,kBAAkB,CAAC,EAAE,IAAI;iBAC3B,qBACgB,GAAG,IAAI,CAAC,WAAW,SAAS,EAC7C,IAAI,EAAC,QAAQ,iBACA,GAAG,CAAC,QAAQ,EAAE,EAC3B,EAAE,EAAC,uBAAuB,EAC1B,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;gBAE1C,4DAAK,KAAK,EAAC,wBAAwB,IAChC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACd,qBAAe,OAAO,EAAC,MAAM,IAAE,IAAI,CAAC,OAAO,CAAiB,CAC7D,CAAC,CAAC,CAAC,CACF,eAAQ,CACT,CACG,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Host,\n Watch,\n Method,\n} from \"@stencil/core\";\nimport { isSlotUsed, removeDisabledFalse } from \"../../utils/helpers\";\nimport chevronIcon from \"../../assets/chevron-icon.svg\";\nimport { IcSizes, IcThemeMode } from \"../../utils/types\";\n\nlet accordionIds = 0;\nconst EXPANDED_CONTENT_OPENED_CLASS = \"expanded-content-opened\";\n\n/**\n * @slot heading - Content is placed as the accordion heading.\n * @slot icon - Content is placed to the left of the heading.\n */\n\n@Component({\n tag: \"ic-accordion\",\n styleUrl: \"ic-accordion.css\",\n shadow: true,\n})\nexport class Accordion {\n private accordionId = `ic-accordion-${accordionIds++}`;\n private expandedContentEl?: HTMLDivElement;\n private accordionBtnHeading?: HTMLButtonElement;\n private CONTENT_VISIBILITY_PROPERTY = \"--ic-expanded-content-visibility\";\n\n @Element() el: HTMLIcAccordionElement;\n\n /**\n * If `true`, the accordion will be disabled.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the accordion appears expanded.\n */\n @Prop({ mutable: true }) expanded?: boolean = false;\n\n /**\n * The section header outlining section content.\n */\n @Prop() heading?: string = \"\";\n\n /**\n * The main body message of the accordion.\n */\n @Prop() message?: string = \"\";\n\n /**\n * The size of the accordion.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * @internal Emitted when accordion is clicked.\n */\n @Event() accordionClicked: EventEmitter<{ id: string }>;\n\n // Every time expanded is set via toggleExpanded or accordionGroup, animate to open or close\n @Watch(\"expanded\")\n handleExpandedWatch(): void {\n this.animateExpandedContent();\n }\n\n /**\n * Sets focus on accordion heading.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.accordionBtnHeading?.focus();\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n disconnectedCallback(): void {\n const expandedContentEl = this.expandedContentEl;\n if (expandedContentEl) {\n expandedContentEl.removeEventListener(\n \"transitionend\",\n (e) => this.setExpandedContentStyle(e, expandedContentEl),\n true\n );\n expandedContentEl.removeEventListener(\n \"transitionend\",\n (e) => this.hideExpandedContent(e, expandedContentEl),\n true\n );\n }\n }\n\n componentDidLoad(): void {\n // So accordion opens by default if expanded set to true\n if (this.expanded && this.expandedContentEl) {\n this.expandedContentEl.style.height = \"auto\";\n this.expandedContentEl.style.setProperty(\n this.CONTENT_VISIBILITY_PROPERTY,\n \"visible\"\n );\n this.expandedContentEl.classList.add(EXPANDED_CONTENT_OPENED_CLASS);\n }\n }\n\n private toggleExpanded = (): void => {\n this.expanded = !this.expanded;\n this.accordionClicked.emit({ id: this.accordionId });\n };\n\n // Set accordion animation\n private setAccordionAnimation = (\n el: HTMLElement,\n duration: string,\n property: string,\n delay: string\n ) => {\n if (!window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n el.style.transitionDuration = `${duration}ms`;\n el.style.transitionProperty = property;\n el.style.transitionDelay = delay;\n } else {\n el.style.transitionDuration = \"0ms\";\n el.style.transitionProperty = \"none\";\n el.style.transitionDelay = \"0ms\";\n }\n };\n\n private setExpandedContentStyle = (\n ev: TransitionEvent,\n expandedContent: HTMLDivElement\n ) => {\n if (ev.propertyName === \"height\" && expandedContent.clientHeight > 0) {\n expandedContent.classList.add(EXPANDED_CONTENT_OPENED_CLASS);\n expandedContent.style.height = \"auto\";\n }\n };\n\n private hideExpandedContent = (\n ev: TransitionEvent,\n expandedContent: HTMLDivElement\n ) => {\n if (ev.propertyName === \"height\" && expandedContent.clientHeight === 0) {\n expandedContent.style.setProperty(\n this.CONTENT_VISIBILITY_PROPERTY,\n \"hidden\"\n );\n }\n };\n\n private animateExpandedContent = () => {\n if (this.expandedContentEl) {\n const expandedContentEl = this.expandedContentEl;\n const elementHeight = expandedContentEl.scrollHeight;\n if (elementHeight > 0 && this.expanded) {\n expandedContentEl.style.setProperty(\n this.CONTENT_VISIBILITY_PROPERTY,\n \"visible\"\n );\n expandedContentEl.style.height = `${elementHeight}px`;\n this.setAccordionAnimation(\n expandedContentEl,\n \"300\",\n \"height\",\n \"ease-out\"\n );\n\n expandedContentEl.addEventListener(\n \"transitionend\",\n (e: TransitionEvent) => {\n this.setExpandedContentStyle(e, expandedContentEl);\n }\n );\n } else if (!this.expanded) {\n const expandedContentEl = this.expandedContentEl;\n expandedContentEl.style.height = `${expandedContentEl.scrollHeight}px`;\n if (expandedContentEl.scrollHeight > 0 && !this.expanded) {\n expandedContentEl.style.height = \"0\";\n this.setAccordionAnimation(\n expandedContentEl,\n \"300\",\n \"height\",\n \"ease-in\"\n );\n expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);\n }\n expandedContentEl.addEventListener(\"transitionend\", (e) => {\n this.hideExpandedContent(e, expandedContentEl);\n });\n }\n }\n };\n\n render() {\n const { size, disabled, expanded, theme } = this;\n return (\n <Host\n id={this.accordionId}\n class={{\n [\"ic-accordion-disabled\"]: !!disabled,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n aria-disabled={disabled ? \"true\" : \"false\"}\n >\n <button\n ref={(el) => (this.accordionBtnHeading = el)}\n id={`${this.accordionId}-button`}\n disabled={disabled}\n tabindex={disabled ? -1 : 0}\n class={{\n [`${size}`]: true,\n [\"section-button\"]: true,\n [\"section-button-open\"]: !!expanded && !disabled,\n }}\n aria-expanded={`${expanded}`}\n aria-controls=\"expanded-content-area\"\n onClick={this.toggleExpanded}\n >\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography variant=\"subtitle-large\" class=\"section-header\">\n {isSlotUsed(this.el, \"heading\") ? (\n <slot name=\"heading\" />\n ) : (\n this.heading\n )}\n </ic-typography>\n <span\n class={{\n [\"expand-chevron\"]: true,\n [\"content-expanded-chevron\"]: !!expanded && !disabled,\n }}\n aria-hidden=\"true\"\n innerHTML={chevronIcon}\n />\n </button>\n <div\n class={{\n [\"expanded-content\"]: true,\n }}\n aria-labelledby={`${this.accordionId}-button`}\n role=\"region\"\n aria-hidden={`${!expanded}`}\n id=\"expanded-content-area\"\n ref={(el) => (this.expandedContentEl = el)}\n >\n <div class=\"expanded-content-inner\">\n {this.message ? (\n <ic-typography variant=\"body\">{this.message}</ic-typography>\n ) : (\n <slot />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ic-accordion.js","sourceRoot":"","sources":["../../../src/components/ic-accordion/ic-accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,WAAW,MAAM,+BAA+B,CAAC;AAGxD,IAAI,YAAY,GAAG,CAAC,CAAC;AACrB,MAAM,6BAA6B,GAAG,yBAAyB,CAAC;AAEhE;;;GAGG;AAOH,MAAM,OAAO,SAAS;IALtB;QAMU,gBAAW,GAAG,gBAAgB,YAAY,EAAE,EAAE,CAAC;QAG/C,gCAA2B,GAAG,kCAAkC,CAAC;QAIzE;;WAEG;QACK,aAAQ,GAAa,KAAK,CAAC;QAMnC;;WAEG;QACsB,aAAQ,GAAa,KAAK,CAAC;QAEpD;;WAEG;QACK,YAAO,GAAY,EAAE,CAAC;QAE9B;;WAEG;QACK,YAAO,GAAY,EAAE,CAAC;QAE9B;;WAEG;QACK,SAAI,GAAa,QAAQ,CAAC;QAElC;;WAEG;QACK,UAAK,GAAiB,SAAS,CAAC;QAqDhC,mBAAc,GAAG,GAAS,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACvD,CAAC,CAAC;QAEF,0BAA0B;QAClB,0BAAqB,GAAG,CAC9B,EAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,KAAa,EACb,EAAE;YACF,EAAE,CAAC,KAAK,CAAC,kBAAkB,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Host,\n Watch,\n Method,\n} from \"@stencil/core\";\nimport { isSlotUsed, removeDisabledFalse } from \"../../utils/helpers\";\nimport chevronIcon from \"../../assets/chevron-icon.svg\";\nimport { IcSizes, IcThemeMode } from \"../../utils/types\";\n\nlet accordionIds = 0;\nconst EXPANDED_CONTENT_OPENED_CLASS = \"expanded-content-opened\";\n\n/**\n * @slot heading - Content is placed as the accordion heading.\n * @slot icon - Content is placed to the left of the heading.\n */\n\n@Component({\n tag: \"ic-accordion\",\n styleUrl: \"ic-accordion.css\",\n shadow: true,\n})\nexport class Accordion {\n private accordionId = `ic-accordion-${accordionIds++}`;\n private expandedContentEl?: HTMLDivElement;\n private accordionBtnHeading?: HTMLButtonElement;\n private CONTENT_VISIBILITY_PROPERTY = \"--ic-expanded-content-visibility\";\n\n @Element() el: HTMLIcAccordionElement;\n\n /**\n * If `true`, the accordion will be disabled.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the accordion appears expanded.\n */\n @Prop({ mutable: true }) expanded?: boolean = false;\n\n /**\n * The section header outlining section content.\n */\n @Prop() heading?: string = \"\";\n\n /**\n * The main body message of the accordion.\n */\n @Prop() message?: string = \"\";\n\n /**\n * The size of the accordion.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * @internal Emitted when accordion is clicked.\n */\n @Event() accordionClicked: EventEmitter<{ id: string }>;\n\n // Every time expanded is set via toggleExpanded or accordionGroup, animate to open or close\n @Watch(\"expanded\")\n handleExpandedWatch(): void {\n this.animateExpandedContent();\n }\n\n /**\n * Sets focus on accordion heading.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.accordionBtnHeading?.focus();\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n disconnectedCallback(): void {\n const expandedContentEl = this.expandedContentEl;\n if (expandedContentEl) {\n expandedContentEl.removeEventListener(\n \"transitionend\",\n (e) => this.setExpandedContentStyle(e, expandedContentEl),\n true\n );\n expandedContentEl.removeEventListener(\n \"transitionend\",\n (e) => this.hideExpandedContent(e, expandedContentEl),\n true\n );\n }\n }\n\n componentDidLoad(): void {\n // So accordion opens by default if expanded set to true\n if (this.expanded && this.expandedContentEl) {\n this.expandedContentEl.style.height = \"auto\";\n this.expandedContentEl.style.setProperty(\n this.CONTENT_VISIBILITY_PROPERTY,\n \"visible\"\n );\n this.expandedContentEl.classList.add(EXPANDED_CONTENT_OPENED_CLASS);\n }\n }\n\n private toggleExpanded = (): void => {\n this.expanded = !this.expanded;\n this.accordionClicked.emit({ id: this.accordionId });\n };\n\n // Set accordion animation\n private setAccordionAnimation = (\n el: HTMLElement,\n duration: string,\n property: string,\n delay: string\n ) => {\n el.style.transitionDuration = `${duration}ms`;\n el.style.transitionProperty = property;\n el.style.transitionTimingFunction = delay;\n };\n\n private setExpandedContentStyle = (\n ev: TransitionEvent,\n expandedContent: HTMLDivElement\n ) => {\n if (ev.propertyName === \"height\" && expandedContent.clientHeight > 0) {\n expandedContent.classList.add(EXPANDED_CONTENT_OPENED_CLASS);\n expandedContent.style.height = \"auto\";\n }\n };\n\n private hideExpandedContent = (\n ev: TransitionEvent,\n expandedContent: HTMLDivElement\n ) => {\n if (ev.propertyName === \"height\" && expandedContent.clientHeight === 0) {\n expandedContent.style.setProperty(\n this.CONTENT_VISIBILITY_PROPERTY,\n \"hidden\"\n );\n }\n };\n\n private animateExpandedContent = () => {\n const expandedContentEl = this.expandedContentEl;\n if (!expandedContentEl) return;\n\n const prefersReducedMotion = window.matchMedia(\n \"(prefers-reduced-motion: reduce)\"\n ).matches;\n\n if (this.expanded) {\n this.expandContent(expandedContentEl, prefersReducedMotion);\n return;\n }\n\n this.collapseContent(expandedContentEl, prefersReducedMotion);\n };\n\n private expandContent = (\n expandedContentEl: HTMLDivElement,\n prefersReducedMotion: boolean\n ) => {\n const elementHeight = expandedContentEl.scrollHeight;\n if (elementHeight <= 0) return;\n\n expandedContentEl.style.setProperty(\n this.CONTENT_VISIBILITY_PROPERTY,\n \"visible\"\n );\n\n if (prefersReducedMotion) {\n expandedContentEl.classList.add(EXPANDED_CONTENT_OPENED_CLASS);\n expandedContentEl.style.height = \"auto\";\n return;\n }\n\n expandedContentEl.style.height = `${elementHeight}px`;\n\n this.setAccordionAnimation(expandedContentEl, \"300\", \"height\", \"ease-out\");\n\n expandedContentEl.addEventListener(\n \"transitionend\",\n (e: TransitionEvent) => {\n this.setExpandedContentStyle(e, expandedContentEl);\n },\n { once: true }\n );\n };\n\n private collapseContent = (\n expandedContentEl: HTMLDivElement,\n prefersReducedMotion: boolean\n ) => {\n const elementHeight = expandedContentEl.scrollHeight;\n\n if (elementHeight <= 0) return;\n\n // Set the content panel as pixels from \"auto\" so it can be animated\n expandedContentEl.style.height = `${elementHeight}px`;\n\n if (prefersReducedMotion) {\n expandedContentEl.style.height = \"0\";\n expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);\n expandedContentEl.style.setProperty(\n this.CONTENT_VISIBILITY_PROPERTY,\n \"hidden\"\n );\n return;\n }\n\n requestAnimationFrame(() => {\n expandedContentEl.style.height = \"0\";\n });\n\n this.setAccordionAnimation(expandedContentEl, \"300\", \"height\", \"ease-in\");\n expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);\n expandedContentEl.addEventListener(\n \"transitionend\",\n (e) => {\n this.hideExpandedContent(e, expandedContentEl);\n },\n { once: true }\n );\n };\n\n render() {\n const { size, disabled, expanded, theme } = this;\n return (\n <Host\n id={this.accordionId}\n class={{\n [\"ic-accordion-disabled\"]: !!disabled,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n aria-disabled={disabled ? \"true\" : \"false\"}\n >\n <button\n ref={(el) => (this.accordionBtnHeading = el)}\n id={`${this.accordionId}-button`}\n disabled={disabled}\n tabindex={disabled ? -1 : 0}\n class={{\n [`${size}`]: true,\n [\"section-button\"]: true,\n [\"section-button-open\"]: !!expanded && !disabled,\n }}\n aria-expanded={`${expanded}`}\n aria-controls=\"expanded-content-area\"\n onClick={this.toggleExpanded}\n >\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography variant=\"subtitle-large\" class=\"section-header\">\n {isSlotUsed(this.el, \"heading\") ? (\n <slot name=\"heading\" />\n ) : (\n this.heading\n )}\n </ic-typography>\n <span\n class={{\n [\"expand-chevron\"]: true,\n [\"content-expanded-chevron\"]: !!expanded && !disabled,\n }}\n aria-hidden=\"true\"\n innerHTML={chevronIcon}\n />\n </button>\n <div\n class={{\n [\"expanded-content\"]: true,\n }}\n aria-labelledby={`${this.accordionId}-button`}\n role=\"region\"\n aria-hidden={`${!expanded}`}\n id=\"expanded-content-area\"\n ref={(el) => (this.expandedContentEl = el)}\n >\n <div class=\"expanded-content-inner\">\n {this.message ? (\n <ic-typography variant=\"body\">{this.message}</ic-typography>\n ) : (\n <slot />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -33,12 +33,15 @@ export class NavigationButton {
33
33
  this.hostMutationCallback = (mutationList) => {
34
34
  let forceComponentUpdate = false;
35
35
  mutationList.forEach(({ attributeName }) => {
36
- if (attributeName) {
36
+ if (attributeName && MUTABLE_ATTRIBUTES.includes(attributeName)) {
37
37
  const attribute = this.el.getAttribute(attributeName);
38
- if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {
38
+ if (attribute) {
39
39
  this.inheritedAttributes[attributeName] = attribute;
40
- forceComponentUpdate = true;
41
40
  }
41
+ else {
42
+ delete this.inheritedAttributes[attributeName];
43
+ }
44
+ forceComponentUpdate = true;
42
45
  }
43
46
  });
44
47
  if (forceComponentUpdate) {
@@ -105,11 +108,11 @@ export class NavigationButton {
105
108
  target,
106
109
  theme,
107
110
  };
108
- return (h(Host, { key: '538ea349b1f0791b0cd68898380fe4cfd41b5496', class: {
111
+ return (h(Host, { key: 'dd30f288d728c8e8dffd4108d05e0a02b782d9ea', class: {
109
112
  "in-side-menu": isMenuMode,
110
113
  [`ic-theme-${theme}`]: theme !== "inherit",
111
114
  dark: parentThemeDark,
112
- } }, h("ic-button", Object.assign({ key: 'afee63c46529276cd2b77ef6d7c1c69b47a7ae15', ref: (el) => (this.buttonEl = el), class: { "popout-menu-button": isMenuMode }, "aria-label": !isMenuMode ? label : null, disableTooltip: isMenuMode, fullWidth: isMenuMode, monochrome: !isMenuMode, size: isMenuMode ? "medium" : "large", variant: isMenuMode ? "tertiary" : "icon-tertiary" }, buttonProps, inheritedAttributes), isMenuMode ? label : "", h("slot", { key: '8c2a89dfc8f974017cf5384355ce0f881218d038', slot: "left-icon", name: "icon" }), isSlotUsed(this.el, "badge") && h("slot", { key: '7fab4237f3f6745159d584df008e82214ecd3322', name: "badge" }))));
115
+ } }, h("ic-button", Object.assign({ key: 'b59e4538abe478aa21617a1ce3347668c3859e40', ref: (el) => (this.buttonEl = el), class: { "popout-menu-button": isMenuMode }, "aria-label": !isMenuMode ? label : null, disableTooltip: isMenuMode, fullWidth: isMenuMode, monochrome: !isMenuMode, size: isMenuMode ? "medium" : "large", variant: isMenuMode ? "tertiary" : "icon-tertiary" }, buttonProps, inheritedAttributes), isMenuMode ? label : "", h("slot", { key: '4ca3226dd11288f30f595d8b0fa8484838b527c4', slot: "left-icon", name: "icon" }), isSlotUsed(this.el, "badge") && h("slot", { key: '89408c559f0b62b9f92686bbc14a5312f8e6c2c6', name: "badge" }))));
113
116
  }
114
117
  static get is() { return "ic-navigation-button"; }
115
118
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"ic-navigation-button.js","sourceRoot":"","sources":["../../../src/components/ic-navigation-button/ic-navigation-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,WAAW,EACX,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACV,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,qBAAqB,GAEtB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,kBAAkB,GAAG,CAAC,GAAG,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAE3D;;;GAGG;AASH,MAAM,OAAO,gBAAgB;IAP7B;QASU,wBAAmB,GAA4B,EAAE,CAAC;QAClD,yBAAoB,GAA4B,IAAI,CAAC;QAI7D;;WAEG;QACM,SAAI,GAAqB,QAAQ,CAAC;QAE3C;;WAEG;QACM,oBAAe,GAAG,KAAK,CAAC;QAEjC;;WAEG;QACK,aAAQ,GAAqB,KAAK,CAAC;QAgC3C;;WAEG;QACsB,UAAK,GAAgB,SAAS,CAAC;QA4DxD;;WAEG;QACK,yBAAoB,GAAG,CAAC,YAA8B,EAAQ,EAAE;YACtE,IAAI,oBAAoB,GAAG,KAAK,CAAC;YACjC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE;gBACzC,IAAI,aAAa,EAAE,CAAC;oBAClB,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;oBACtD,IAAI,SAAS,IAAI,kBAAkB,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,C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C,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACtC,cAAc,EAAE,UAAU,EAC1B,SAAS,EAAE,UAAU,EACrB,UAAU,EAAE,CAAC,UAAU,EACvB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EACrC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,IAC9C,WAAW,EACX,mBAAmB;gBAEtB,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACxB,6DAAM,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,GAAQ;gBACzC,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACjD,CACP,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Host,\n Listen,\n Method,\n Prop,\n State,\n forceUpdate,\n h,\n} from \"@stencil/core\";\n\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n getBrandForegroundAppearance,\n getElementInheritedTheme,\n inheritAttributes,\n isSlotUsed,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport {\n IcBrand,\n IcBrandForeground,\n IcBrandForegroundEnum,\n IcThemeMode,\n} from \"../../utils/types\";\nimport { IcNavButtonModes } from \"./ic-navigation-button.types\";\n\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\n\n/**\n * @slot icon - Content will be placed to the left of the button label.\n * @slot badge - Badge component overlaying the top right of the button.\n */\n\n@Component({\n tag: \"ic-navigation-button\",\n styleUrl: \"ic-navigation-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class NavigationButton {\n private buttonEl?: HTMLIcButtonElement;\n private inheritedAttributes: { [k: string]: string } = {};\n private hostMutationObserver: MutationObserver | null = null;\n\n @Element() el: HTMLIcNavigationButtonElement;\n\n /**\n * The display mode.\n */\n @State() mode: IcNavButtonModes = \"navbar\";\n\n /**\n * The parent theme used to inherit external colour tokens such as focus indicator.\n */\n @State() parentThemeDark = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download: string | boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * The label info to display.\n */\n @Prop() label!: string;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop({ mutable: true }) theme: IcThemeMode = \"inherit\";\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Navigation Button\"\n );\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n });\n }\n\n componentWillRender(): void {\n this.el\n .querySelector(`[slot=\"icon\"]`)\n ?.setAttribute(\"viewBox\", \"0 0 24 24\");\n this.parentThemeChangeHandler();\n }\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n @Listen(\"icNavigationMenuOpened\", { target: \"document\" })\n navBarMenuOpenHandler(): void {\n this.mode = \"menu\";\n this.theme = (this.el.parentElement as HTMLIcTopNavigationElement).theme;\n }\n\n @Listen(\"icNavigationMenuClosed\", { target: \"document\" })\n navBarMenuCloseHandler(): void {\n this.mode = \"navbar\";\n this.updateTheme();\n }\n\n @Listen(\"brandChange\", { target: \"document\" })\n brandChangeHandler({ detail: { mode } }: CustomEvent<IcBrand>): void {\n this.updateTheme(mode);\n }\n\n @Listen(\"icThemeChange\", { target: \"document\" })\n parentThemeChangeHandler(): void {\n this.parentThemeDark = getElementInheritedTheme(this.el) === \"dark\";\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.buttonEl?.setFocus();\n }\n\n /**\n * Triggered when attributes of host element change\n */\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(({ attributeName }) => {\n if (attributeName) {\n const attribute = this.el.getAttribute(attributeName);\n if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {\n this.inheritedAttributes[attributeName] = attribute;\n forceComponentUpdate = true;\n }\n }\n });\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private updateTheme(\n mode: IcBrandForeground = getBrandForegroundAppearance()\n ) {\n this.theme =\n mode === IcBrandForegroundEnum.Light\n ? IcBrandForegroundEnum.Dark\n : IcBrandForegroundEnum.Light;\n }\n\n render() {\n const {\n download,\n href,\n inheritedAttributes,\n label,\n mode,\n parentThemeDark,\n referrerpolicy,\n rel,\n target,\n theme,\n } = this;\n\n const isMenuMode = mode === \"menu\";\n\n const buttonProps = {\n download,\n href,\n referrerpolicy,\n rel,\n target,\n theme,\n };\n\n return (\n <Host\n class={{\n \"in-side-menu\": isMenuMode,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n dark: parentThemeDark,\n }}\n >\n <ic-button\n ref={(el) => (this.buttonEl = el)}\n class={{ \"popout-menu-button\": isMenuMode }}\n aria-label={!isMenuMode ? label : null}\n disableTooltip={isMenuMode}\n fullWidth={isMenuMode}\n monochrome={!isMenuMode}\n size={isMenuMode ? \"medium\" : \"large\"}\n variant={isMenuMode ? \"tertiary\" : \"icon-tertiary\"}\n {...buttonProps}\n {...inheritedAttributes}\n >\n {isMenuMode ? label : \"\"}\n <slot slot=\"left-icon\" name=\"icon\"></slot>\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n </ic-button>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ic-navigation-button.js","sourceRoot":"","sources":["../../../src/components/ic-navigation-button/ic-navigation-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,WAAW,EACX,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACV,gCAAgC,GACjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,qBAAqB,GAEtB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,kBAAkB,GAAG,CAAC,GAAG,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAE3D;;;GAGG;AASH,MAAM,OAAO,gBAAgB;IAP7B;QASU,wBAAmB,GAA4B,EAAE,CAAC;QAClD,yBAAoB,GAA4B,IAAI,CAAC;QAI7D;;WAEG;QACM,SAAI,GAAqB,QAAQ,CAAC;QAE3C;;WAEG;QACM,oBAAe,GAAG,KAAK,CAAC;QAEjC;;WAEG;QACK,aAAQ,GAAqB,KAAK,CAAC;QAgC3C;;WAEG;QACsB,UAAK,GAAgB,SAAS,CAAC;QA4DxD;;WAEG;QACK,yBAAo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;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Host,\n Listen,\n Method,\n Prop,\n State,\n forceUpdate,\n h,\n} from \"@stencil/core\";\n\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n getBrandForegroundAppearance,\n getElementInheritedTheme,\n inheritAttributes,\n isSlotUsed,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport {\n IcBrand,\n IcBrandForeground,\n IcBrandForegroundEnum,\n IcThemeMode,\n} from \"../../utils/types\";\nimport { IcNavButtonModes } from \"./ic-navigation-button.types\";\n\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\n\n/**\n * @slot icon - Content will be placed to the left of the button label.\n * @slot badge - Badge component overlaying the top right of the button.\n */\n\n@Component({\n tag: \"ic-navigation-button\",\n styleUrl: \"ic-navigation-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class NavigationButton {\n private buttonEl?: HTMLIcButtonElement;\n private inheritedAttributes: { [k: string]: string } = {};\n private hostMutationObserver: MutationObserver | null = null;\n\n @Element() el: HTMLIcNavigationButtonElement;\n\n /**\n * The display mode.\n */\n @State() mode: IcNavButtonModes = \"navbar\";\n\n /**\n * The parent theme used to inherit external colour tokens such as focus indicator.\n */\n @State() parentThemeDark = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download: string | boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * The label info to display.\n */\n @Prop() label!: string;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop({ mutable: true }) theme: IcThemeMode = \"inherit\";\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Navigation Button\"\n );\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n });\n }\n\n componentWillRender(): void {\n this.el\n .querySelector(`[slot=\"icon\"]`)\n ?.setAttribute(\"viewBox\", \"0 0 24 24\");\n this.parentThemeChangeHandler();\n }\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n @Listen(\"icNavigationMenuOpened\", { target: \"document\" })\n navBarMenuOpenHandler(): void {\n this.mode = \"menu\";\n this.theme = (this.el.parentElement as HTMLIcTopNavigationElement).theme;\n }\n\n @Listen(\"icNavigationMenuClosed\", { target: \"document\" })\n navBarMenuCloseHandler(): void {\n this.mode = \"navbar\";\n this.updateTheme();\n }\n\n @Listen(\"brandChange\", { target: \"document\" })\n brandChangeHandler({ detail: { mode } }: CustomEvent<IcBrand>): void {\n this.updateTheme(mode);\n }\n\n @Listen(\"icThemeChange\", { target: \"document\" })\n parentThemeChangeHandler(): void {\n this.parentThemeDark = getElementInheritedTheme(this.el) === \"dark\";\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.buttonEl?.setFocus();\n }\n\n /**\n * Triggered when attributes of host element change\n */\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(({ attributeName }) => {\n if (attributeName && MUTABLE_ATTRIBUTES.includes(attributeName)) {\n const attribute = this.el.getAttribute(attributeName);\n if (attribute) {\n this.inheritedAttributes[attributeName] = attribute;\n } else {\n delete this.inheritedAttributes[attributeName];\n }\n forceComponentUpdate = true;\n }\n });\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private updateTheme(\n mode: IcBrandForeground = getBrandForegroundAppearance()\n ) {\n this.theme =\n mode === IcBrandForegroundEnum.Light\n ? IcBrandForegroundEnum.Dark\n : IcBrandForegroundEnum.Light;\n }\n\n render() {\n const {\n download,\n href,\n inheritedAttributes,\n label,\n mode,\n parentThemeDark,\n referrerpolicy,\n rel,\n target,\n theme,\n } = this;\n\n const isMenuMode = mode === \"menu\";\n\n const buttonProps = {\n download,\n href,\n referrerpolicy,\n rel,\n target,\n theme,\n };\n\n return (\n <Host\n class={{\n \"in-side-menu\": isMenuMode,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n dark: parentThemeDark,\n }}\n >\n <ic-button\n ref={(el) => (this.buttonEl = el)}\n class={{ \"popout-menu-button\": isMenuMode }}\n aria-label={!isMenuMode ? label : null}\n disableTooltip={isMenuMode}\n fullWidth={isMenuMode}\n monochrome={!isMenuMode}\n size={isMenuMode ? \"medium\" : \"large\"}\n variant={isMenuMode ? \"tertiary\" : \"icon-tertiary\"}\n {...buttonProps}\n {...inheritedAttributes}\n >\n {isMenuMode ? label : \"\"}\n <slot slot=\"left-icon\" name=\"icon\"></slot>\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n </ic-button>\n </Host>\n );\n }\n}\n"]}
@@ -46,16 +46,9 @@ const Accordion = /*@__PURE__*/ proxyCustomElement(class Accordion extends HTMLE
46
46
  };
47
47
  // Set accordion animation
48
48
  this.setAccordionAnimation = (el, duration, property, delay) => {
49
- if (!window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
50
- el.style.transitionDuration = `${duration}ms`;
51
- el.style.transitionProperty = property;
52
- el.style.transitionDelay = delay;
53
- }
54
- else {
55
- el.style.transitionDuration = "0ms";
56
- el.style.transitionProperty = "none";
57
- el.style.transitionDelay = "0ms";
58
- }
49
+ el.style.transitionDuration = `${duration}ms`;
50
+ el.style.transitionProperty = property;
51
+ el.style.transitionTimingFunction = delay;
59
52
  };
60
53
  this.setExpandedContentStyle = (ev, expandedContent) => {
61
54
  if (ev.propertyName === "height" && expandedContent.clientHeight > 0) {
@@ -69,30 +62,52 @@ const Accordion = /*@__PURE__*/ proxyCustomElement(class Accordion extends HTMLE
69
62
  }
70
63
  };
71
64
  this.animateExpandedContent = () => {
72
- if (this.expandedContentEl) {
73
- const expandedContentEl = this.expandedContentEl;
74
- const elementHeight = expandedContentEl.scrollHeight;
75
- if (elementHeight > 0 && this.expanded) {
76
- expandedContentEl.style.setProperty(this.CONTENT_VISIBILITY_PROPERTY, "visible");
77
- expandedContentEl.style.height = `${elementHeight}px`;
78
- this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-out");
79
- expandedContentEl.addEventListener("transitionend", (e) => {
80
- this.setExpandedContentStyle(e, expandedContentEl);
81
- });
82
- }
83
- else if (!this.expanded) {
84
- const expandedContentEl = this.expandedContentEl;
85
- expandedContentEl.style.height = `${expandedContentEl.scrollHeight}px`;
86
- if (expandedContentEl.scrollHeight > 0 && !this.expanded) {
87
- expandedContentEl.style.height = "0";
88
- this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-in");
89
- expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);
90
- }
91
- expandedContentEl.addEventListener("transitionend", (e) => {
92
- this.hideExpandedContent(e, expandedContentEl);
93
- });
94
- }
65
+ const expandedContentEl = this.expandedContentEl;
66
+ if (!expandedContentEl)
67
+ return;
68
+ const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
69
+ if (this.expanded) {
70
+ this.expandContent(expandedContentEl, prefersReducedMotion);
71
+ return;
72
+ }
73
+ this.collapseContent(expandedContentEl, prefersReducedMotion);
74
+ };
75
+ this.expandContent = (expandedContentEl, prefersReducedMotion) => {
76
+ const elementHeight = expandedContentEl.scrollHeight;
77
+ if (elementHeight <= 0)
78
+ return;
79
+ expandedContentEl.style.setProperty(this.CONTENT_VISIBILITY_PROPERTY, "visible");
80
+ if (prefersReducedMotion) {
81
+ expandedContentEl.classList.add(EXPANDED_CONTENT_OPENED_CLASS);
82
+ expandedContentEl.style.height = "auto";
83
+ return;
84
+ }
85
+ expandedContentEl.style.height = `${elementHeight}px`;
86
+ this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-out");
87
+ expandedContentEl.addEventListener("transitionend", (e) => {
88
+ this.setExpandedContentStyle(e, expandedContentEl);
89
+ }, { once: true });
90
+ };
91
+ this.collapseContent = (expandedContentEl, prefersReducedMotion) => {
92
+ const elementHeight = expandedContentEl.scrollHeight;
93
+ if (elementHeight <= 0)
94
+ return;
95
+ // Set the content panel as pixels from "auto" so it can be animated
96
+ expandedContentEl.style.height = `${elementHeight}px`;
97
+ if (prefersReducedMotion) {
98
+ expandedContentEl.style.height = "0";
99
+ expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);
100
+ expandedContentEl.style.setProperty(this.CONTENT_VISIBILITY_PROPERTY, "hidden");
101
+ return;
95
102
  }
103
+ requestAnimationFrame(() => {
104
+ expandedContentEl.style.height = "0";
105
+ });
106
+ this.setAccordionAnimation(expandedContentEl, "300", "height", "ease-in");
107
+ expandedContentEl.classList.remove(EXPANDED_CONTENT_OPENED_CLASS);
108
+ expandedContentEl.addEventListener("transitionend", (e) => {
109
+ this.hideExpandedContent(e, expandedContentEl);
110
+ }, { once: true });
96
111
  };
97
112
  }
98
113
  watchDisabledHandler() {
@@ -129,19 +144,19 @@ const Accordion = /*@__PURE__*/ proxyCustomElement(class Accordion extends HTMLE
129
144
  }
130
145
  render() {
131
146
  const { size, disabled, expanded, theme } = this;
132
- return (h(Host, { key: '58ea81b0011f31da3d2d872244720011cb9028c8', id: this.accordionId, class: {
147
+ return (h(Host, { key: '840baa7799dc4c48c232a7dc170937bb563900d5', id: this.accordionId, class: {
133
148
  ["ic-accordion-disabled"]: !!disabled,
134
149
  [`ic-theme-${theme}`]: theme !== "inherit",
135
- }, "aria-disabled": disabled ? "true" : "false" }, h("button", { key: '1a79e3d09955ed9bb07ddac08690ff157d98313d', ref: (el) => (this.accordionBtnHeading = el), id: `${this.accordionId}-button`, disabled: disabled, tabindex: disabled ? -1 : 0, class: {
150
+ }, "aria-disabled": disabled ? "true" : "false" }, h("button", { key: 'dce03cb5ba0f61a1d5b75ab1f648eaa970d5d78e', ref: (el) => (this.accordionBtnHeading = el), id: `${this.accordionId}-button`, disabled: disabled, tabindex: disabled ? -1 : 0, class: {
136
151
  [`${size}`]: true,
137
152
  ["section-button"]: true,
138
153
  ["section-button-open"]: !!expanded && !disabled,
139
- }, "aria-expanded": `${expanded}`, "aria-controls": "expanded-content-area", onClick: this.toggleExpanded }, isSlotUsed(this.el, "icon") && (h("div", { key: 'fc0e123d20dca395b2210f1ee14c7d89bb8e50ad', class: "icon-container" }, h("slot", { key: 'c2185289998b60967ec0a0097a3aad8b4a88f07c', name: "icon" }))), h("ic-typography", { key: '211d4d69f0468dbec907c6d32ec61adea8e6be61', variant: "subtitle-large", class: "section-header" }, isSlotUsed(this.el, "heading") ? (h("slot", { name: "heading" })) : (this.heading)), h("span", { key: 'e9f9ef3f67e85d33d0459c55d7307dcf522f0628', class: {
154
+ }, "aria-expanded": `${expanded}`, "aria-controls": "expanded-content-area", onClick: this.toggleExpanded }, isSlotUsed(this.el, "icon") && (h("div", { key: '3301b5e4526831e7e8a4400d775f55d99ec29d27', class: "icon-container" }, h("slot", { key: 'aa49cdcd343009d6d5b7e68f5c1013cd7fcc7638', name: "icon" }))), h("ic-typography", { key: 'da324db78e29a81f0c5bb7209f870b8832c25d67', variant: "subtitle-large", class: "section-header" }, isSlotUsed(this.el, "heading") ? (h("slot", { name: "heading" })) : (this.heading)), h("span", { key: '9eb1350c8ae3f9c940e1299a17b3b510ccb66ef6', class: {
140
155
  ["expand-chevron"]: true,
141
156
  ["content-expanded-chevron"]: !!expanded && !disabled,
142
- }, "aria-hidden": "true", innerHTML: chevronIcon })), h("div", { key: '1e74fb0c312fc767a7518cbfcce5f55a90fc22a9', class: {
157
+ }, "aria-hidden": "true", innerHTML: chevronIcon })), h("div", { key: '9b04e4a6df4def67189609215cd4849890900146', class: {
143
158
  ["expanded-content"]: true,
144
- }, "aria-labelledby": `${this.accordionId}-button`, role: "region", "aria-hidden": `${!expanded}`, id: "expanded-content-area", ref: (el) => (this.expandedContentEl = el) }, h("div", { key: '04ed5966177cce63233f64e4e2d01bcbecbe10af', class: "expanded-content-inner" }, this.message ? (h("ic-typography", { variant: "body" }, this.message)) : (h("slot", null))))));
159
+ }, "aria-labelledby": `${this.accordionId}-button`, role: "region", "aria-hidden": `${!expanded}`, id: "expanded-content-area", ref: (el) => (this.expandedContentEl = el) }, h("div", { key: '594f88da687634cbbad7e12d8df21a3dc7961a64', class: "expanded-content-inner" }, this.message ? (h("ic-typography", { variant: "body" }, this.message)) : (h("slot", null))))));
145
160
  }
146
161
  get el() { return this; }
147
162
  static get watchers() { return {