@ukic/web-components 3.29.0 → 3.31.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.
- package/components/ic-accordion.js +53 -38
- package/components/ic-accordion.js.map +1 -1
- package/components/ic-button2.js +1 -1
- package/components/ic-button2.js.map +1 -1
- package/components/ic-link2.js +1 -1
- package/components/ic-link2.js.map +1 -1
- package/components/ic-menu-item2.js +1 -1
- package/components/ic-menu-item2.js.map +1 -1
- package/components/ic-menu2.js +276 -37
- package/components/ic-menu2.js.map +1 -1
- package/components/ic-navigation-button.js +8 -5
- package/components/ic-navigation-button.js.map +1 -1
- package/components/ic-navigation-group.js +9 -5
- package/components/ic-navigation-group.js.map +1 -1
- package/components/ic-radio-group.js +3 -3
- package/components/ic-radio-group.js.map +1 -1
- package/components/ic-side-navigation.js.map +1 -1
- package/components/ic-switch.js.map +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +53 -38
- package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +276 -37
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +8 -5
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +9 -5
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/collection/components/ic-accordion/ic-accordion.js +53 -38
- package/dist/collection/components/ic-accordion/ic-accordion.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.css +6 -0
- package/dist/collection/components/ic-link/ic-link.css +4 -0
- package/dist/collection/components/ic-menu/ic-menu.css +14 -5
- package/dist/collection/components/ic-menu-item/ic-menu-item.css +13 -6
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js +8 -5
- package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +9 -5
- package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
- package/dist/collection/components/ic-radio-group/ic-radio-group.js +3 -3
- package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
- package/dist/collection/utils/common-helpers.js +1 -1
- package/dist/collection/utils/common-helpers.js.map +1 -1
- package/dist/components/ic-accordion.js +53 -38
- package/dist/components/ic-accordion.js.map +1 -1
- package/dist/components/ic-button2.js +1 -1
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-link2.js +1 -1
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-menu-item2.js +1 -1
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu2.js +276 -37
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-button.js +8 -5
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +9 -5
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-radio-group.js +3 -3
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/{p-9ced00a7.entry.js → p-41bbdc4c.entry.js} +2 -2
- package/dist/core/{p-9ced00a7.entry.js.map → p-41bbdc4c.entry.js.map} +1 -1
- package/dist/core/p-51fc7809.entry.js +2 -0
- package/dist/core/p-51fc7809.entry.js.map +1 -0
- package/dist/core/{p-e5266c19.entry.js → p-67048b2e.entry.js} +2 -2
- package/dist/core/{p-e5266c19.entry.js.map → p-67048b2e.entry.js.map} +1 -1
- package/dist/core/p-756b4cb3.entry.js +2 -0
- package/dist/core/p-756b4cb3.entry.js.map +1 -0
- package/dist/core/p-78e56db1.entry.js +2 -0
- package/dist/core/p-78e56db1.entry.js.map +1 -0
- package/dist/core/{p-1cfaa962.entry.js → p-95849ac2.entry.js} +2 -2
- package/dist/core/p-95849ac2.entry.js.map +1 -0
- package/dist/core/{p-fc4b7d2b.entry.js → p-9cf35c23.entry.js} +2 -2
- package/dist/core/p-9cf35c23.entry.js.map +1 -0
- package/dist/core/p-a8d98164.entry.js.map +1 -1
- package/dist/core/p-e5178830.entry.js +3 -0
- package/dist/core/p-e5178830.entry.js.map +1 -0
- package/dist/esm/ic-accordion.entry.js +53 -38
- package/dist/esm/ic-accordion.entry.js.map +1 -1
- package/dist/esm/ic-button_3.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +276 -37
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js +8 -5
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +9 -5
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +3 -3
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/types/components/ic-accordion/ic-accordion.d.ts +2 -0
- package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +1 -0
- package/hydrate/index.js +351 -90
- package/hydrate/index.mjs +351 -90
- package/package.json +4 -2
- package/dist/core/p-1cfaa962.entry.js.map +0 -1
- package/dist/core/p-305d9639.entry.js +0 -3
- package/dist/core/p-305d9639.entry.js.map +0 -1
- package/dist/core/p-98dee727.entry.js +0 -2
- package/dist/core/p-98dee727.entry.js.map +0 -1
- package/dist/core/p-be8bbed8.entry.js +0 -2
- package/dist/core/p-be8bbed8.entry.js.map +0 -1
- package/dist/core/p-c0b70c08.entry.js +0 -2
- package/dist/core/p-c0b70c08.entry.js.map +0 -1
- package/dist/core/p-fc4b7d2b.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"ic-radio-group.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,eAAe,GAAG,wuIAAwuI,CAAC;AACjwI,2BAAe,eAAe;;MCoCjB,UAAU;IALvB;;;QAQU,mBAAc,GAA0B,IAAI,CAAC;QAC7C,qBAAgB,GAAG,kBAAkB,CAAC;QACtC,qBAAgB,GAAkB,YAAY,CAAC;QAC/C,mBAAc,GAAkB,UAAU,CAAC;QAI1C,iBAAY,GAAW,EAAE,CAAC;QAG1B,kBAAa,GAAW,CAAC,CAAC,CAAC;;;;QAK5B,aAAQ,GAAa,KAAK,CAAC;;;;QAkB3B,cAAS,GAAa,KAAK,CAAC;;;;QAe5B,gBAAW,GAAmB,UAAU,CAAC;;;;QAKzC,aAAQ,GAAa,KAAK,CAAC;;;;QAK3B,SAAI,GAAa,QAAQ,CAAC;;;;QAK1B,uBAAkB,GAAe,QAAQ,CAAC;;;;QAK1C,qBAAgB,GAAgC,EAAE,CAAC;;;;QAKnD,mBAAc,GAAW,EAAE,CAAC;;;;QAW5B,UAAK,GAAiB,SAAS,CAAC;QA8EhC,sBAAiB,GAAG;YAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC;gBACvC,IAAI,CAAC,gBAAgB,EAAE,CAAC;aACzB,CAAC,CAAC;YAEH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,E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AK,EAAE;gBACL,CAAC,kBAAkB,IAAI,EAAE,GAAG,IAAI,KAAK,QAAQ;gBAC7C,CAAC,YAAY,KAAK,EAAE,GAAG,KAAK,KAAK,SAAS;aAC3C,IAEDD,uEACE,IAAI,EAAC,YAAY,EACjB,EAAE,EAAE,IAAI,CAAC,IAAI,mBACE,GAAG,QAAQ,EAAE,IAE3B,CAAC,SAAS,KACTA,uEACEA,6EACE,KAAK,EAAE;gBACL,CAAC,GAAG,gBAAgB,EAAE,GAAG,IAAI;gBAC7B,CAAC,UAAU,GAAG,CAAC,CAAC,QAAQ;aACzB,EACD,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAElBA,mEAAM,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,aAAa,GAAQ,CACpC,CACV,CACV,EACDA,kEACE,KAAK,EAAE;gBACL,yBAAyB,EAAE,IAAI;gBAC/B,UAAU,EAAE,kBAAkB,KAAK,IAAI,CAAC,gBAAgB;aACzD,EACD,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,IAEvCA,oEAAa,CACT,CACG,EACXA,kFACE,KAAK,EAAE;gBACL,iBAAiB,EAAE,cAAc;aAClC,EACD,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,EAAE,EAC9C,OAAO,EAAE,cAAc,GAAG,cAAc,GAAG,EAAE,GACxB,CAClB,EACP;KACH;;;;;;;;;;;;","names":["slotHasContent","removeDisabledFalse","checkResizeObserver","onComponentRequiredPropUndefined","hasValidationStatus","h","Host"],"sources":["src/components/ic-radio-group/ic-radio-group.css?tag=ic-radio-group&encapsulation=shadow","src/components/ic-radio-group/ic-radio-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n\n --ic-input-label-text-color: var(--ic-radio-button-input-field-label);\n --ic-input-label-helper-text-color: var(\n --ic-radio-button-input-field-subtitle\n );\n --ic-input-validation-status-text-color: var(--ic-radio-button-state-text);\n --ic-input-validation-error: var(--ic-radio-button-state-icon-error);\n}\n\n:host ic-input-label.error {\n --ic-input-label-text-color: var(--ic-radio-button-input-field-label-error);\n}\n\n:host ic-input-label.disabled {\n --ic-input-label-text-color: var(\n --ic-radio-button-input-field-label-disabled\n );\n --ic-input-label-helper-text-color: var(\n --ic-radio-button-input-field-subtitle-disabled\n );\n}\n\n:host ic-input-validation.show-validation {\n margin-top: var(--ic-space-sm);\n}\n\n:host(.ic-radio-group-small) ic-input-validation.show-validation {\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-radio-group-large) ic-input-validation.show-validation {\n margin-top: var(--ic-space-md);\n}\n\n:host ic-input-label:not(.with-helper) .ic-typography-label,\n:host ic-input-label .helpertext {\n margin-bottom: var(--ic-space-sm);\n}\n\n:host(.ic-radio-group-small)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-radio-group-small) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-radio-group-large)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-radio-group-large) ic-input-label .helpertext {\n margin-bottom: var(--ic-space-md);\n}\n\n:host ic-input-label .helpertext {\n display: block;\n}\n\n:host .radio-buttons-container {\n display: flex;\n flex-direction: column;\n gap: var(--ic-space-xxs);\n}\n\n:host(.ic-radio-group-small) .radio-buttons-container {\n gap: var(--ic-space-xxxs);\n}\n\n:host(.ic-radio-group-large) .radio-buttons-container {\n gap: var(--ic-space-xs);\n}\n\n:host .radio-buttons-container.horizontal {\n display: flex;\n flex-direction: row;\n gap: calc(var(--ic-space-xl) + var(--ic-space-xs));\n}\n\n:host(.ic-radio-group-small) .radio-buttons-container.horizontal {\n gap: var(--ic-space-xl);\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Listen,\n Element,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\nimport {\n hasValidationStatus,\n slotHasContent,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n checkResizeObserver,\n} from \"../../utils/helpers\";\nimport {\n IcAriaLive,\n IcInformationStatusOrEmpty,\n IcOrientation,\n IcSizes,\n IcThemeMode,\n IcValueEventDetail,\n} from \"../../utils/types\";\nimport { IcChangeEventDetail } from \"./ic-radio-group.types\";\n\n/**\n * @slot helper-text - Content is set as the helper text for the radio group.\n */\n@Component({\n tag: \"ic-radio-group\",\n styleUrl: \"ic-radio-group.css\",\n shadow: true,\n})\nexport class RadioGroup {\n private radioContainer?: HTMLDivElement;\n private radioOptions: HTMLIcRadioOptionElement[];\n private resizeObserver: ResizeObserver | null = null;\n private ADDITIONAL_FIELD = \"additional-field\";\n private RADIO_HORIZONTAL: IcOrientation = \"horizontal\";\n private RADIO_VERTICAL: IcOrientation = \"vertical\";\n\n @Element() el: HTMLIcRadioGroupElement;\n\n @State() checkedValue: string = \"\";\n @State() currentOrientation: IcOrientation;\n @State() initialOrientation: IcOrientation;\n @State() selectedChild: number = -1;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n\n @Watch(\"disabled\")\n watchDisabledHandler(newValue: boolean): void {\n this.radioOptions.forEach(\n (radioOption) => (radioOption.disabled = newValue)\n );\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText?: string;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * The label for the radio group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the radio group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n /**\n * The orientation of the radio buttons in the radio group. If there are more than two radio buttons in a radio group or either of the radio buttons use the `additional-field` slot, then the orientation will always be vertical.\n */\n @Prop() orientation?: IcOrientation = \"vertical\";\n\n /**\n * If `true`, the radio group will require a value.\n */\n @Prop() required?: boolean = false;\n\n /**\n * The size of the radio group component.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * The value of the `aria-live` attribute on the validation message.\n */\n @Prop() validationAriaLive: IcAriaLive = \"polite\";\n\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus?: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The text to display as the validation message.\n */\n @Prop() validationText: string = \"\";\n\n @Watch(\"orientation\")\n orientationChangeHandler(): void {\n this.initialOrientation = this.orientation!;\n this.checkOrientation();\n }\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 @Watch(\"theme\")\n watchThemeHandler(newValue: IcThemeMode): void {\n this.radioOptions.forEach((radioOption) => (radioOption.theme = newValue));\n }\n\n /**\n * Emitted when a user selects a radio.\n */\n @Event() icChange: EventEmitter<IcChangeEventDetail>;\n\n disconnectedCallback(): void {\n this.resizeObserver?.disconnect();\n this.radioContainer?.removeEventListener(\n \"slotchange\",\n this.setRadioOptions\n );\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n\n this.orientationChangeHandler();\n this.currentOrientation = this.initialOrientation;\n }\n\n componentDidLoad(): void {\n this.setRadioOptions();\n checkResizeObserver(this.runResizeObserver);\n this.addSlotChangeListener();\n\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Radio Group\"\n );\n\n this.watchThemeHandler(this.theme!);\n }\n\n @Listen(\"icCheck\")\n selectHandler({ detail, target }: CustomEvent<IcValueEventDetail>): void {\n const selectedOption = target as HTMLIcRadioOptionElement;\n if (selectedOption.parentElement === this.el) {\n this.checkedValue = detail.value as string;\n this.icChange.emit({\n value: this.checkedValue,\n selectedOption: {\n radio: selectedOption,\n textFieldValue: selectedOption?.querySelector(\"ic-text-field\")?.value,\n },\n });\n\n if (this.radioOptions !== undefined) {\n this.radioOptions.forEach((radioOption, index) => {\n radioOption.selected = selectedOption === radioOption;\n if (radioOption.selected) {\n this.selectedChild = index;\n }\n });\n this.setFirstRadioOptionTabIndex(this.selectedChild > 0 ? -1 : 0);\n }\n }\n }\n\n @Listen(\"icSelectedChange\")\n changeHandler(): void {\n const selectedOption = this.radioOptions?.findIndex(\n (radioOption) => radioOption.selected\n );\n if (selectedOption < 0) {\n this.setFirstRadioOptionTabIndex(0);\n this.selectedChild = selectedOption;\n }\n }\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.checkOrientation();\n });\n\n this.resizeObserver.observe(this.el);\n };\n\n private checkOrientation() {\n if (this.initialOrientation === this.RADIO_HORIZONTAL) {\n let totalWidth = 0;\n if (Array.isArray(this.radioOptions) && this.radioOptions.length > 0) {\n this.radioOptions.forEach(({ clientWidth }, i, arr) => {\n totalWidth += clientWidth;\n if (i < arr.length - 1) totalWidth += 40;\n });\n } else {\n totalWidth = 0;\n }\n\n if (this.initialOrientation == this.RADIO_HORIZONTAL) {\n if (\n this.radioOptions !== undefined &&\n (this.radioOptions.length > 2 ||\n (this.radioOptions.length === 2 &&\n (slotHasContent(this.radioOptions[0], this.ADDITIONAL_FIELD) ||\n slotHasContent(this.radioOptions[1], this.ADDITIONAL_FIELD))))\n ) {\n this.currentOrientation = this.RADIO_VERTICAL;\n } else {\n if (this.radioContainer) {\n if (totalWidth >= this.radioContainer.clientWidth) {\n this.currentOrientation = this.RADIO_VERTICAL;\n } else if (totalWidth < this.radioContainer.clientWidth) {\n this.currentOrientation = this.RADIO_HORIZONTAL;\n }\n }\n }\n }\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n const additionalFields = Array.from(\n this.el.querySelectorAll<HTMLElement>(\n 'ic-text-field[slot=\"additional-field\"]'\n )\n );\n const activeEl = document.activeElement;\n if (\n additionalFields.length > 0 &&\n this.radioOptions.map((el) =>\n slotHasContent(el, this.ADDITIONAL_FIELD)\n ) &&\n additionalFields.map((el) => el == activeEl)\n ) {\n return;\n }\n\n event.stopPropagation();\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, true)\n ].click();\n event.preventDefault();\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, false)\n ].click();\n event.preventDefault();\n }\n };\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numRadios = this.radioOptions.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n\n //check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numRadios;\n } else if (nextItem > numRadios) {\n nextItem = 0;\n }\n\n //if next item is disabled then find next\n if (this.radioOptions[nextItem].disabled) {\n nextItem = this.getNextItemToSelect(nextItem, movingDown);\n }\n\n return nextItem;\n };\n\n private addSlotChangeListener = () => {\n this.radioContainer?.addEventListener(\"slotchange\", this.setRadioOptions);\n };\n\n private setFirstRadioOptionTabIndex = (value: number) => {\n this.radioOptions[0].setTabIndex(value);\n };\n\n private setRadioOptions = () => {\n this.selectedChild = -1;\n this.checkedValue = \"\";\n this.radioOptions = Array.from(this.el.children).filter(\n (el) => el.tagName === \"IC-RADIO-OPTION\"\n ) as HTMLIcRadioOptionElement[];\n if (this.radioOptions.length > 0) {\n this.radioOptions.forEach((radioOption, index) => {\n if (!radioOption.selected) {\n radioOption.selected = this.checkedValue === radioOption.value;\n }\n radioOption.name = this.name;\n radioOption.groupLabel = this.label;\n if (radioOption.selected) {\n this.selectedChild = index;\n this.checkedValue = radioOption.value;\n }\n if (this.disabled) {\n radioOption.disabled = true;\n }\n });\n this.setFirstRadioOptionTabIndex(this.selectedChild > 0 ? -1 : 0);\n\n if (\n this.initialOrientation === this.RADIO_HORIZONTAL &&\n this.radioOptions !== undefined &&\n (this.radioOptions.length > 2 ||\n (this.radioOptions.length === 2 &&\n (slotHasContent(this.radioOptions[0], this.ADDITIONAL_FIELD) ||\n slotHasContent(this.radioOptions[1], this.ADDITIONAL_FIELD))))\n ) {\n this.currentOrientation = this.RADIO_VERTICAL;\n }\n }\n };\n\n render() {\n const {\n currentOrientation,\n disabled,\n handleKeyDown,\n helperText,\n hideLabel,\n label,\n required,\n size,\n validationAriaLive,\n validationStatus,\n validationText,\n theme,\n } = this;\n\n const showValidation = hasValidationStatus(validationStatus, disabled);\n\n return (\n <Host\n onKeyDown={handleKeyDown}\n class={{\n [`ic-radio-group-${size}`]: size !== \"medium\",\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n <fieldset\n role=\"radiogroup\"\n id={this.name}\n aria-required={`${required}`}\n >\n {!hideLabel && (\n <legend>\n <ic-input-label\n class={{\n [`${validationStatus}`]: true,\n [\"disabled\"]: !!disabled,\n }}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabled}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n </legend>\n )}\n <div\n class={{\n \"radio-buttons-container\": true,\n horizontal: currentOrientation === this.RADIO_HORIZONTAL,\n }}\n ref={(el) => (this.radioContainer = el)}\n >\n <slot></slot>\n </div>\n </fieldset>\n <ic-input-validation\n class={{\n \"show-validation\": showValidation,\n }}\n ariaLiveMode={validationAriaLive}\n status={showValidation ? validationStatus : \"\"}\n message={showValidation ? validationText : \"\"}\n ></ic-input-validation>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"ic-radio-group.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,eAAe,GAAG,wuIAAwuI,CAAC;AACjwI,2BAAe,eAAe;;MCoCjB,UAAU;IALvB;;;QAQU,mBAAc,GAA0B,IAAI,CAAC;QAC7C,qBAAgB,GAAG,kBAAkB,CAAC;QACtC,qBAAgB,GAAkB,YAAY,CAAC;QAC/C,mBAAc,GAAkB,UAAU,CAAC;QAI1C,iBAAY,G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AkB,KAAK,IAAI,CAAC,gBAAgB;aACzD,EACD,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC,IAEvCA,oEAAa,CACT,CACG,EACXA,kFACE,KAAK,EAAE;gBACL,iBAAiB,EAAE,cAAc;aAClC,EACD,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,EAAE,EAC9C,OAAO,EAAE,cAAc,GAAG,cAAc,GAAG,EAAE,GACxB,CAClB,EACP;KACH;;;;;;;;;;;;","names":["slotHasContent","removeDisabledFalse","checkResizeObserver","onComponentRequiredPropUndefined","hasValidationStatus","h","Host"],"sources":["src/components/ic-radio-group/ic-radio-group.css?tag=ic-radio-group&encapsulation=shadow","src/components/ic-radio-group/ic-radio-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n\n --ic-input-label-text-color: var(--ic-radio-button-input-field-label);\n --ic-input-label-helper-text-color: var(\n --ic-radio-button-input-field-subtitle\n );\n --ic-input-validation-status-text-color: var(--ic-radio-button-state-text);\n --ic-input-validation-error: var(--ic-radio-button-state-icon-error);\n}\n\n:host ic-input-label.error {\n --ic-input-label-text-color: var(--ic-radio-button-input-field-label-error);\n}\n\n:host ic-input-label.disabled {\n --ic-input-label-text-color: var(\n --ic-radio-button-input-field-label-disabled\n );\n --ic-input-label-helper-text-color: var(\n --ic-radio-button-input-field-subtitle-disabled\n );\n}\n\n:host ic-input-validation.show-validation {\n margin-top: var(--ic-space-sm);\n}\n\n:host(.ic-radio-group-small) ic-input-validation.show-validation {\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-radio-group-large) ic-input-validation.show-validation {\n margin-top: var(--ic-space-md);\n}\n\n:host ic-input-label:not(.with-helper) .ic-typography-label,\n:host ic-input-label .helpertext {\n margin-bottom: var(--ic-space-sm);\n}\n\n:host(.ic-radio-group-small)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-radio-group-small) ic-input-label .helpertext {\n margin-bottom: calc(var(--ic-space-sm) / 2);\n}\n\n:host(.ic-radio-group-large)\n ic-input-label:not(.with-helper)\n .ic-typography-label,\n:host(.ic-radio-group-large) ic-input-label .helpertext {\n margin-bottom: var(--ic-space-md);\n}\n\n:host ic-input-label .helpertext {\n display: block;\n}\n\n:host .radio-buttons-container {\n display: flex;\n flex-direction: column;\n gap: var(--ic-space-xxs);\n}\n\n:host(.ic-radio-group-small) .radio-buttons-container {\n gap: var(--ic-space-xxxs);\n}\n\n:host(.ic-radio-group-large) .radio-buttons-container {\n gap: var(--ic-space-xs);\n}\n\n:host .radio-buttons-container.horizontal {\n display: flex;\n flex-direction: row;\n gap: calc(var(--ic-space-xl) + var(--ic-space-xs));\n}\n\n:host(.ic-radio-group-small) .radio-buttons-container.horizontal {\n gap: var(--ic-space-xl);\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Listen,\n Element,\n Event,\n EventEmitter,\n Watch,\n} from \"@stencil/core\";\nimport {\n hasValidationStatus,\n slotHasContent,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n checkResizeObserver,\n} from \"../../utils/helpers\";\nimport {\n IcAriaLive,\n IcInformationStatusOrEmpty,\n IcOrientation,\n IcSizes,\n IcThemeMode,\n IcValueEventDetail,\n} from \"../../utils/types\";\nimport { IcChangeEventDetail } from \"./ic-radio-group.types\";\n\n/**\n * @slot helper-text - Content is set as the helper text for the radio group.\n */\n@Component({\n tag: \"ic-radio-group\",\n styleUrl: \"ic-radio-group.css\",\n shadow: true,\n})\nexport class RadioGroup {\n private radioContainer?: HTMLDivElement;\n private radioOptions: HTMLIcRadioOptionElement[];\n private resizeObserver: ResizeObserver | null = null;\n private ADDITIONAL_FIELD = \"additional-field\";\n private RADIO_HORIZONTAL: IcOrientation = \"horizontal\";\n private RADIO_VERTICAL: IcOrientation = \"vertical\";\n\n @Element() el: HTMLIcRadioGroupElement;\n\n @State() checkedValue: string = \"\";\n @State() currentOrientation: IcOrientation;\n @State() initialOrientation: IcOrientation;\n @State() selectedChild: number = -1;\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n\n @Watch(\"disabled\")\n watchDisabledHandler(newValue: boolean): void {\n this.radioOptions.forEach(\n (radioOption) => (radioOption.disabled = newValue)\n );\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText?: string;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * The label for the radio group to be displayed.\n */\n @Prop() label!: string;\n\n /**\n * The name for the radio group to differentiate from other groups.\n */\n @Prop() name!: string;\n\n /**\n * The orientation of the radio buttons in the radio group. If there are more than two radio buttons in a radio group or either of the radio buttons use the `additional-field` slot, then the orientation will always be vertical.\n */\n @Prop() orientation?: IcOrientation = \"vertical\";\n\n /**\n * If `true`, the radio group will require a value.\n */\n @Prop() required?: boolean = false;\n\n /**\n * The size of the radio group component.\n */\n @Prop() size?: IcSizes = \"medium\";\n\n /**\n * The value of the `aria-live` attribute on the validation message.\n */\n @Prop() validationAriaLive: IcAriaLive = \"polite\";\n\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus?: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The text to display as the validation message.\n */\n @Prop() validationText: string = \"\";\n\n @Watch(\"orientation\")\n orientationChangeHandler(): void {\n this.initialOrientation = this.orientation!;\n this.checkOrientation();\n }\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 @Watch(\"theme\")\n watchThemeHandler(newValue: IcThemeMode): void {\n this.radioOptions.forEach((radioOption) => (radioOption.theme = newValue));\n }\n\n /**\n * Emitted when a user selects a radio.\n */\n @Event() icChange: EventEmitter<IcChangeEventDetail>;\n\n disconnectedCallback(): void {\n this.resizeObserver?.disconnect();\n this.radioContainer?.removeEventListener(\n \"slotchange\",\n this.setRadioOptions\n );\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n\n this.orientationChangeHandler();\n this.currentOrientation = this.initialOrientation;\n }\n\n componentDidLoad(): void {\n this.setRadioOptions();\n checkResizeObserver(this.runResizeObserver);\n this.addSlotChangeListener();\n\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Radio Group\"\n );\n\n this.watchThemeHandler(this.theme!);\n }\n\n @Listen(\"icCheck\")\n selectHandler({ detail, target }: CustomEvent<IcValueEventDetail>): void {\n const selectedOption = target as HTMLIcRadioOptionElement;\n if (selectedOption.parentElement === this.el) {\n this.checkedValue = detail.value as string;\n this.icChange.emit({\n value: this.checkedValue,\n selectedOption: {\n radio: selectedOption,\n textFieldValue: selectedOption?.querySelector(\"ic-text-field\")?.value,\n },\n });\n\n if (this.radioOptions !== undefined) {\n this.radioOptions.forEach((radioOption, index) => {\n radioOption.selected = selectedOption === radioOption;\n if (radioOption.selected) {\n this.selectedChild = index;\n }\n });\n this.setFirstRadioOptionTabIndex(this.selectedChild > 0 ? -1 : 0);\n }\n }\n }\n\n @Listen(\"icSelectedChange\")\n changeHandler(): void {\n const selectedOption = this.radioOptions?.findIndex(\n (radioOption) => radioOption.selected\n );\n if (selectedOption < 0) {\n this.setFirstRadioOptionTabIndex(0);\n this.selectedChild = selectedOption;\n }\n }\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.checkOrientation();\n });\n\n this.resizeObserver.observe(this.el);\n };\n\n private checkOrientation() {\n if (this.initialOrientation === this.RADIO_HORIZONTAL) {\n let totalWidth = 0;\n if (Array.isArray(this.radioOptions) && this.radioOptions.length > 0) {\n this.radioOptions.forEach(({ clientWidth }, i, arr) => {\n totalWidth += clientWidth;\n if (i < arr.length - 1) totalWidth += 40;\n });\n } else {\n totalWidth = 0;\n }\n\n if (this.initialOrientation == this.RADIO_HORIZONTAL) {\n if (\n this.radioOptions !== undefined &&\n (this.radioOptions.length > 2 ||\n (this.radioOptions.length === 2 &&\n (slotHasContent(this.radioOptions[0], this.ADDITIONAL_FIELD) ||\n slotHasContent(this.radioOptions[1], this.ADDITIONAL_FIELD))))\n ) {\n this.currentOrientation = this.RADIO_VERTICAL;\n } else {\n if (this.radioContainer) {\n if (totalWidth >= this.radioContainer.clientWidth) {\n this.currentOrientation = this.RADIO_VERTICAL;\n } else if (totalWidth < this.radioContainer.clientWidth) {\n this.currentOrientation = this.RADIO_HORIZONTAL;\n }\n }\n }\n }\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n const additionalFields = Array.from(\n this.el.querySelectorAll<HTMLElement>(\n 'ic-text-field[slot=\"additional-field\"]'\n )\n );\n const activeEl = document.activeElement;\n if (\n additionalFields.length > 0 &&\n this.radioOptions.map((el) =>\n slotHasContent(el, this.ADDITIONAL_FIELD)\n ) &&\n additionalFields.map((el) => el == activeEl)\n ) {\n return;\n }\n\n event.stopPropagation();\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, true)\n ].click();\n event.preventDefault();\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, false)\n ].click();\n event.preventDefault();\n }\n };\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numRadios = this.radioOptions.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n\n //check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numRadios;\n } else if (nextItem > numRadios) {\n nextItem = 0;\n }\n\n //if next item is disabled then find next\n if (this.radioOptions[nextItem].disabled) {\n nextItem = this.getNextItemToSelect(nextItem, movingDown);\n }\n\n return nextItem;\n };\n\n private addSlotChangeListener = () => {\n this.radioContainer?.addEventListener(\"slotchange\", this.setRadioOptions);\n };\n\n private setFirstRadioOptionTabIndex = (value: number) => {\n this.radioOptions[0].setTabIndex(value);\n };\n\n private setRadioOptions = () => {\n this.selectedChild = -1;\n this.checkedValue = \"\";\n this.radioOptions = Array.from(this.el.children).filter(\n (el) => el.tagName === \"IC-RADIO-OPTION\"\n ) as HTMLIcRadioOptionElement[];\n if (this.radioOptions.length > 0) {\n this.radioOptions.forEach((radioOption, index) => {\n if (!radioOption.selected) {\n radioOption.selected = this.checkedValue === radioOption.value;\n }\n radioOption.name = this.name;\n radioOption.groupLabel = this.label;\n if (radioOption.selected) {\n this.selectedChild = index;\n this.checkedValue = radioOption.value;\n }\n if (this.disabled) {\n radioOption.disabled = true;\n }\n });\n this.setFirstRadioOptionTabIndex(this.selectedChild > 0 ? -1 : 0);\n\n if (\n this.initialOrientation === this.RADIO_HORIZONTAL &&\n this.radioOptions !== undefined &&\n (this.radioOptions.length > 2 ||\n (this.radioOptions.length === 2 &&\n (slotHasContent(this.radioOptions[0], this.ADDITIONAL_FIELD) ||\n slotHasContent(this.radioOptions[1], this.ADDITIONAL_FIELD))))\n ) {\n this.currentOrientation = this.RADIO_VERTICAL;\n }\n }\n };\n\n render() {\n const {\n currentOrientation,\n disabled,\n handleKeyDown,\n helperText,\n hideLabel,\n label,\n required,\n size,\n validationAriaLive,\n validationStatus,\n validationText,\n theme,\n } = this;\n\n const showValidation = hasValidationStatus(validationStatus, disabled);\n\n return (\n <Host\n onKeyDown={handleKeyDown}\n class={{\n [`ic-radio-group-${size}`]: size !== \"medium\",\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n <fieldset\n role=\"radiogroup\"\n id={this.name}\n aria-required={`${required}`}\n aria-label={hideLabel ? label : undefined}\n >\n {!hideLabel && (\n <legend>\n <ic-input-label\n class={{\n [`${validationStatus}`]: true,\n [\"disabled\"]: !!disabled,\n }}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabled}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n </legend>\n )}\n <div\n class={{\n \"radio-buttons-container\": true,\n horizontal: currentOrientation === this.RADIO_HORIZONTAL,\n }}\n ref={(el) => (this.radioContainer = el)}\n >\n <slot></slot>\n </div>\n </fieldset>\n <ic-input-validation\n class={{\n \"show-validation\": showValidation,\n }}\n ariaLiveMode={validationAriaLive}\n status={showValidation ? validationStatus : \"\"}\n message={showValidation ? validationText : \"\"}\n ></ic-input-validation>\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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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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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;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AAI;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 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"]}
|
|
@@ -657,6 +657,12 @@ video {
|
|
|
657
657
|
background-color: var(
|
|
658
658
|
--ic-button-secondary-background-hover-active
|
|
659
659
|
) !important;
|
|
660
|
+
border-color: var(--ic-button-secondary-border-hover) !important;
|
|
661
|
+
color: var(--ic-button-secondary-text-hover-active) !important;
|
|
662
|
+
|
|
663
|
+
--ic-typography-color: var(
|
|
664
|
+
--ic-button-secondary-text-hover-active
|
|
665
|
+
) !important;
|
|
660
666
|
}
|
|
661
667
|
|
|
662
668
|
:host(.ic-button-variant-secondary) .button:active,
|
|
@@ -449,6 +449,10 @@ video {
|
|
|
449
449
|
transition: var(--ic-easing-transition-fast);
|
|
450
450
|
}
|
|
451
451
|
|
|
452
|
+
:host(.ic-link) ::slotted(a) {
|
|
453
|
+
font-weight: var(--ic-font-weight-bold) !important;
|
|
454
|
+
}
|
|
455
|
+
|
|
452
456
|
:host(.ic-link) .link:visited,
|
|
453
457
|
:host(.ic-link) ::slotted(a:visited),
|
|
454
458
|
:host(.ic-link) .link:visited:hover,
|
|
@@ -598,7 +598,8 @@ video {
|
|
|
598
598
|
.option .option-label {
|
|
599
599
|
display: flex;
|
|
600
600
|
flex-direction: row;
|
|
601
|
-
align-items:
|
|
601
|
+
align-items: flex-start;
|
|
602
|
+
gap: var(--ic-space-xs);
|
|
602
603
|
}
|
|
603
604
|
|
|
604
605
|
.option .option-label ic-typography {
|
|
@@ -611,10 +612,18 @@ video {
|
|
|
611
612
|
}
|
|
612
613
|
|
|
613
614
|
.option .option-icon {
|
|
614
|
-
height: var(--ic-space-
|
|
615
|
-
width: var(--ic-space-
|
|
616
|
-
|
|
617
|
-
|
|
615
|
+
height: var(--ic-space-lg);
|
|
616
|
+
width: var(--ic-space-lg);
|
|
617
|
+
min-width: var(--ic-space-lg);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.option .option-icon > svg {
|
|
621
|
+
height: 100%;
|
|
622
|
+
width: 100%;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.option-label:has(.option-icon) + .option-description {
|
|
626
|
+
margin-left: calc(var(--ic-space-lg) + var(--ic-space-xs));
|
|
618
627
|
}
|
|
619
628
|
|
|
620
629
|
.option-text-container {
|
|
@@ -499,6 +499,10 @@ video {
|
|
|
499
499
|
box-shadow: none;
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
+
:host ::part(button):focus-visible {
|
|
503
|
+
outline: none;
|
|
504
|
+
}
|
|
505
|
+
|
|
502
506
|
:host ::part(button):focus,
|
|
503
507
|
:host ::part(button):focus-visible {
|
|
504
508
|
color: var(--ic-popover-menu-item-icon-focused);
|
|
@@ -524,14 +528,15 @@ ic-button:focus-within .menu-item-description {
|
|
|
524
528
|
--ic-typography-color: var(--ic-popover-menu-item-label-disabled) !important;
|
|
525
529
|
}
|
|
526
530
|
|
|
527
|
-
:host ::part(button):active {
|
|
531
|
+
:host(:not(.ic-menu-item-disabled)) ::part(button):active {
|
|
528
532
|
background-color: var(--ic-popover-background-pressed);
|
|
529
533
|
color: var(--ic-popover-menu-item-label) !important;
|
|
530
534
|
|
|
531
535
|
--ic-typography-color: var(--ic-popover-menu-item-label) !important;
|
|
532
536
|
}
|
|
533
537
|
|
|
534
|
-
:host(.ic-menu-item-variant-destructive)
|
|
538
|
+
:host(:not(.ic-menu-item-disabled).ic-menu-item-variant-destructive)
|
|
539
|
+
::part(button):active {
|
|
535
540
|
background-color: var(--ic-popover-background-pressed);
|
|
536
541
|
color: var(--ic-popover-menu-destructive-item-label) !important;
|
|
537
542
|
|
|
@@ -572,19 +577,21 @@ ic-button:focus-within .menu-item-description {
|
|
|
572
577
|
letter-spacing: 0.025em;
|
|
573
578
|
}
|
|
574
579
|
|
|
575
|
-
ic-button:active .menu-item-label {
|
|
580
|
+
:host(:not(.ic-menu-item-disabled)) ic-button:active .menu-item-label {
|
|
576
581
|
--ic-typography-color: var(--ic-popover-menu-item-label);
|
|
577
582
|
}
|
|
578
583
|
|
|
579
|
-
ic-button:active .menu-item-description {
|
|
584
|
+
:host(:not(.ic-menu-item-disabled)) ic-button:active .menu-item-description {
|
|
580
585
|
--ic-typography-color: var(--ic-popover-menu-item-description);
|
|
581
586
|
}
|
|
582
587
|
|
|
583
|
-
ic-button:active .shortcut {
|
|
588
|
+
:host(:not(.ic-menu-item-disabled)) ic-button:active .shortcut {
|
|
584
589
|
--ic-typography-color: var(--ic-popover-menu-item-shortcut);
|
|
585
590
|
}
|
|
586
591
|
|
|
587
|
-
:host(.ic-menu-item-
|
|
592
|
+
:host(:not(.ic-menu-item-disabled).ic-menu-item-variant-destructive)
|
|
593
|
+
ic-button:active
|
|
594
|
+
.menu-item-label {
|
|
588
595
|
--ic-typography-color: var(
|
|
589
596
|
--ic-popover-menu-destructive-item-label
|
|
590
597
|
) !important;
|
|
@@ -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
|
|
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: '
|
|
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: '
|
|
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,qBAAq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AC,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/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AAC,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 && 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"]}
|
|
@@ -27,6 +27,7 @@ export class NavigationGroup {
|
|
|
27
27
|
* 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.
|
|
28
28
|
*/
|
|
29
29
|
this.theme = "inherit";
|
|
30
|
+
this.getGroupedNavigationItemsHeight = () => `${Array.from(this.el.querySelectorAll(IC_NAVIGATION_ITEM)).reduce((childrenHeights, { offsetHeight }) => childrenHeights + offsetHeight, 0)}px`;
|
|
30
31
|
this.sideNavExpandHandler = (event) => {
|
|
31
32
|
this.isSideNavExpanded = event.detail.sideNavExpanded;
|
|
32
33
|
if (!this.linkWrapper || !this.expanded)
|
|
@@ -39,13 +40,15 @@ export class NavigationGroup {
|
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
41
42
|
setTimeout(() => {
|
|
43
|
+
const currentHeight = this.getGroupedNavigationItemsHeight();
|
|
44
|
+
this.allGroupedNavigationItemHeights = currentHeight;
|
|
42
45
|
if (this.isSideNavExpanded) {
|
|
43
|
-
this.expandedNavItemsHeight =
|
|
46
|
+
this.expandedNavItemsHeight = currentHeight;
|
|
44
47
|
}
|
|
45
48
|
else {
|
|
46
|
-
this.collapsedNavItemsHeight =
|
|
49
|
+
this.collapsedNavItemsHeight = currentHeight;
|
|
47
50
|
}
|
|
48
|
-
this.setGroupedLinksElementHeight(
|
|
51
|
+
this.setGroupedLinksElementHeight(currentHeight);
|
|
49
52
|
}, DYNAMIC_GROUPED_LINKS_HEIGHT_MS);
|
|
50
53
|
}
|
|
51
54
|
};
|
|
@@ -192,7 +195,6 @@ export class NavigationGroup {
|
|
|
192
195
|
}
|
|
193
196
|
}
|
|
194
197
|
componentDidLoad() {
|
|
195
|
-
this.allGroupedNavigationItemHeights = `${Array.from(this.el.querySelectorAll(IC_NAVIGATION_ITEM)).reduce((childrenHeights, { offsetHeight }) => childrenHeights + offsetHeight, 0)}px`;
|
|
196
198
|
/**
|
|
197
199
|
* debounce is required as the incorrect height was retrieved instantly after
|
|
198
200
|
* componentDidLoad is invoked.
|
|
@@ -200,6 +202,8 @@ export class NavigationGroup {
|
|
|
200
202
|
setTimeout(() => {
|
|
201
203
|
if (!this.linkWrapper || !this.expanded)
|
|
202
204
|
return;
|
|
205
|
+
this.allGroupedNavigationItemHeights =
|
|
206
|
+
this.getGroupedNavigationItemsHeight();
|
|
203
207
|
if (!this.isSideNavExpanded)
|
|
204
208
|
this.collapsedNavItemsHeight = this.allGroupedNavigationItemHeights;
|
|
205
209
|
else
|
|
@@ -261,7 +265,7 @@ export class NavigationGroup {
|
|
|
261
265
|
const isTopNav = this.navigationType === "top";
|
|
262
266
|
const isTopNavDesktop = !inTopNavSideMenu && isTopNav;
|
|
263
267
|
const ariaExpanded = (isSideNav && expanded) || (isTopNav && dropdownOpen);
|
|
264
|
-
return (h(Host, { key: '
|
|
268
|
+
return (h(Host, { key: '7ebbc34bc82ba009930a18d58c6747ebd7707e27', class: {
|
|
265
269
|
"in-side-menu": inTopNavSideMenu,
|
|
266
270
|
"ic-navigation-group-expandable": expandable,
|
|
267
271
|
"ic-navigation-group-side-nav": isSideNav,
|