@ukic/web-components 2.1.0-beta.5 → 2.1.0-beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  3. package/dist/cjs/ic-chip.cjs.entry.js +2 -0
  4. package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
  5. package/dist/cjs/ic-data-row.cjs.entry.js +11 -9
  6. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  7. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  8. package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
  9. package/dist/cjs/ic-link.cjs.entry.js +0 -2
  10. package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
  13. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -2
  14. package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  16. package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/collection/components/ic-card/ic-card.js +1 -1
  19. package/dist/collection/components/ic-card/ic-card.js.map +1 -1
  20. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.test.a11y.js +1 -1
  21. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.test.a11y.js.map +1 -1
  22. package/dist/collection/components/ic-chip/ic-chip.js +20 -1
  23. package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
  24. package/dist/collection/components/ic-data-row/ic-data-row.js +11 -9
  25. package/dist/collection/components/ic-data-row/ic-data-row.js.map +1 -1
  26. package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.test.a11y.js +1 -1
  27. package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.test.a11y.js.map +1 -1
  28. package/dist/collection/components/ic-hero/ic-hero.css +5 -0
  29. package/dist/collection/components/ic-link/ic-link.js +0 -2
  30. package/dist/collection/components/ic-link/ic-link.js.map +1 -1
  31. package/dist/collection/components/ic-page-header/ic-page-header.js +1 -1
  32. package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
  33. package/dist/collection/components/ic-radio-group/ic-radio-group.js +1 -2
  34. package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
  35. package/dist/collection/components/ic-radio-group/ic-radio-group.test.a11y.js +1 -1
  36. package/dist/collection/components/ic-radio-group/ic-radio-group.test.a11y.js.map +1 -1
  37. package/dist/collection/components/ic-tab-context/ic-tab-context.test.a11y.js +1 -1
  38. package/dist/collection/components/ic-tab-context/ic-tab-context.test.a11y.js.map +1 -1
  39. package/dist/collection/components/ic-tab-group/ic-tab-group.js +1 -1
  40. package/dist/collection/components/ic-tab-group/ic-tab-group.js.map +1 -1
  41. package/dist/collection/components/ic-top-navigation/ic-top-navigation.test.a11y.js +1 -1
  42. package/dist/collection/components/ic-top-navigation/ic-top-navigation.test.a11y.js.map +1 -1
  43. package/dist/components/ic-card.js.map +1 -1
  44. package/dist/components/ic-chip.js +3 -1
  45. package/dist/components/ic-chip.js.map +1 -1
  46. package/dist/components/ic-data-row.js +11 -9
  47. package/dist/components/ic-data-row.js.map +1 -1
  48. package/dist/components/ic-hero.js +1 -1
  49. package/dist/components/ic-hero.js.map +1 -1
  50. package/dist/components/ic-link2.js +0 -2
  51. package/dist/components/ic-link2.js.map +1 -1
  52. package/dist/components/ic-page-header.js +2 -2
  53. package/dist/components/ic-page-header.js.map +1 -1
  54. package/dist/components/ic-radio-group.js +1 -2
  55. package/dist/components/ic-radio-group.js.map +1 -1
  56. package/dist/components/ic-tab-group.js +1 -1
  57. package/dist/components/ic-tab-group.js.map +1 -1
  58. package/dist/core/core.esm.js +1 -1
  59. package/dist/core/core.esm.js.map +1 -1
  60. package/dist/core/{p-a5948fc3.entry.js → p-01e8bd4a.entry.js} +2 -2
  61. package/dist/core/p-01e8bd4a.entry.js.map +1 -0
  62. package/dist/core/{p-c1d78a64.entry.js → p-4902b46a.entry.js} +2 -2
  63. package/dist/core/{p-c1d78a64.entry.js.map → p-4902b46a.entry.js.map} +1 -1
  64. package/dist/core/{p-9fbceeb2.entry.js → p-541918c2.entry.js} +2 -2
  65. package/dist/core/{p-9fbceeb2.entry.js.map → p-541918c2.entry.js.map} +1 -1
  66. package/dist/core/{p-2ca96f69.entry.js → p-6cb276c6.entry.js} +2 -2
  67. package/dist/core/p-6cb276c6.entry.js.map +1 -0
  68. package/dist/core/{p-217fa7de.entry.js → p-9020d1ff.entry.js} +2 -2
  69. package/dist/core/p-9020d1ff.entry.js.map +1 -0
  70. package/dist/core/{p-eaea567e.entry.js → p-a38cbb3f.entry.js} +2 -2
  71. package/dist/core/p-a38cbb3f.entry.js.map +1 -0
  72. package/dist/core/{p-23bf0b7a.entry.js → p-c5e453eb.entry.js} +2 -2
  73. package/dist/core/p-c5e453eb.entry.js.map +1 -0
  74. package/dist/core/p-d599cf4f.entry.js.map +1 -1
  75. package/dist/esm/core.js +1 -1
  76. package/dist/esm/ic-card.entry.js.map +1 -1
  77. package/dist/esm/ic-chip.entry.js +2 -0
  78. package/dist/esm/ic-chip.entry.js.map +1 -1
  79. package/dist/esm/ic-data-row.entry.js +11 -9
  80. package/dist/esm/ic-data-row.entry.js.map +1 -1
  81. package/dist/esm/ic-hero.entry.js +1 -1
  82. package/dist/esm/ic-hero.entry.js.map +1 -1
  83. package/dist/esm/ic-link.entry.js +0 -2
  84. package/dist/esm/ic-link.entry.js.map +1 -1
  85. package/dist/esm/ic-page-header.entry.js +2 -2
  86. package/dist/esm/ic-page-header.entry.js.map +1 -1
  87. package/dist/esm/ic-radio-group.entry.js +1 -2
  88. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  89. package/dist/esm/ic-tab-group.entry.js +1 -1
  90. package/dist/esm/ic-tab-group.entry.js.map +1 -1
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/types/components/ic-card/ic-card.d.ts +1 -1
  93. package/dist/types/components/ic-chip/ic-chip.d.ts +5 -1
  94. package/dist/types/components/ic-link/ic-link.d.ts +0 -1
  95. package/dist/types/components.d.ts +7 -3
  96. package/hydrate/index.js +18 -17
  97. package/package.json +3 -3
  98. package/dist/core/p-217fa7de.entry.js.map +0 -1
  99. package/dist/core/p-23bf0b7a.entry.js.map +0 -1
  100. package/dist/core/p-2ca96f69.entry.js.map +0 -1
  101. package/dist/core/p-a5948fc3.entry.js.map +0 -1
  102. package/dist/core/p-eaea567e.entry.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"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"],"names":["icRadioGroupCss","RadioGroup","this","handleKeyDown","event","key","radioOptions","getNextItemToSelect","selectedChild","selected","preventDefault","currentItem","movingDown","numRadios","length","nextItem","disabled","[object Object]","checkedValue","detail","value","icChange","emit","undefined","forEach","radioOption","index","shadowRoot","querySelector","tabIndex","Array","from","host","querySelectorAll","name","groupLabel","label","onComponentRequiredPropUndefined","prop","propName","renderHiddenInput","h","Host","onKeyDown","role","aria-label","required","hideLabel","class","validationStatus","helperText","hasValidationStatus","ariaLiveMode","status","message","validationText"],"mappings":"0IAAA,MAAMA,EAAkB,8+ECwBXC,EAAU,kEA2EbC,KAAAC,cAAiBC,IACvB,OAAQA,EAAMC,KACZ,IAAK,YACL,IAAK,aACHH,KAAKI,aACHJ,KAAKK,oBAAoBL,KAAKM,cAAe,OAC7CC,SAAW,KACbL,EAAMM,iBACN,MACF,IAAK,UACL,IAAK,YACHR,KAAKI,aACHJ,KAAKK,oBAAoBL,KAAKM,cAAe,QAC7CC,SAAW,KACbL,EAAMM,mBAIJR,KAAAK,oBAAsB,CAC5BI,EACAC,KAEA,MAAMC,EAAYX,KAAKI,aAAaQ,OAAS,EAE7C,GAAIH,EAAc,EAAG,CACnBA,EAAc,EAGhB,IAAII,EAAWH,EAAaD,EAAc,EAAIA,EAAc,EAG5D,GAAII,EAAW,EAAG,CAChBA,EAAWF,OACN,GAAIE,EAAWF,EAAW,CAC/BE,EAAW,EAIb,GAAIb,KAAKI,aAAaS,GAAUC,SAAU,CACxCD,EAAWb,KAAKK,oBAAoBQ,EAAUH,GAGhD,OAAOG,0DAnGmB,qBAKC,oBAKD,2CAUH,4BAI8B,uBAItB,qBAID,uBACE,EAQlCE,cAAcb,GACZF,KAAKgB,aAAed,EAAMe,OAAOC,MACjClB,KAAKmB,SAASC,KAAK,CAAEF,MAAOlB,KAAKgB,eAEjC,GAAIhB,KAAKI,eAAiBiB,UAAW,CACnCrB,KAAKI,aAAakB,SAAQ,CAACC,EAAaC,KACtCD,EAAYhB,SAAWP,KAAKgB,eAAiBO,EAAYL,MACzD,GAAIK,EAAYhB,SAAU,CACxBP,KAAKM,cAAgBkB,MAGzBxB,KAAKI,aAAa,GAAGqB,WAAWC,cAAc,SAASC,SACrD3B,KAAKM,cAAgB,GAAK,EAAI,GAiDpCS,mBACEf,KAAKI,aAAewB,MAAMC,KACxB7B,KAAK8B,KAAKC,iBAAiB,oBAG7B/B,KAAKI,aAAakB,SAAQ,CAACC,EAAaC,KACtC,IAAKD,EAAYhB,SAAU,CACzBgB,EAAYhB,SAAWP,KAAKgB,eAAiBO,EAAYL,MAE3DK,EAAYS,KAAOhC,KAAKgC,KACxBT,EAAYU,WAAajC,KAAKkC,MAC9B,GAAIX,EAAYhB,SAAU,CACxBP,KAAKM,cAAgBkB,EACrBxB,KAAKgB,aAAeO,EAAYL,UAGpClB,KAAKI,aAAa,GAAGqB,WAAWC,cAAc,SAASC,SACrD3B,KAAKM,cAAgB,GAAK,EAAI,EAEhC6B,EACE,CACE,CAAEC,KAAMpC,KAAKkC,MAAOG,SAAU,SAC9B,CAAED,KAAMpC,KAAKgC,KAAMK,SAAU,SAE/B,eAIJtB,SACEuB,EACE,KACAtC,KAAK8B,KACL9B,KAAKgC,KACLhC,KAAKgB,aACLhB,KAAKc,UAGP,OACEyB,EAACC,EAAI,CAACC,UAAWzC,KAAKC,eACpBsC,EAAA,MAAA,CACEG,KAAK,aAAYC,aACL,GAAG3C,KAAKkC,QAAQlC,KAAK4C,SAAW,aAAe,OAEzD5C,KAAK6C,WACLN,EAAA,iBAAA,CACEO,MAAO,CAAE/B,CAAC,GAAGf,KAAK+C,oBAAqB,MACvCb,MAAOlC,KAAKkC,MACZc,WAAYhD,KAAKgD,WACjBJ,SAAU5C,KAAK4C,SACf9B,SAAUd,KAAKc,WAGnByB,EAAA,OAAA,OAEDU,EAAoBjD,KAAK+C,iBAAkB/C,KAAKc,WAC/CyB,EAAA,sBAAA,CACEW,aAAa,SACbC,OAAQnD,KAAK+C,iBACbK,QAASpD,KAAKqD","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\nic-input-label.error {\n color: var(--ic-status-error);\n}\n\nic-input-label ic-typography {\n margin-bottom: var(--ic-space-sm);\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Listen,\n Element,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport {\n hasValidationStatus,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n} from \"../../utils/helpers\";\nimport { IcInformationStatusOrEmpty } from \"../../utils/types\";\nimport { IcValueEventDetail } from \"../../interface\";\n\n@Component({\n tag: \"ic-radio-group\",\n styleUrl: \"ic-radio-group.css\",\n shadow: true,\n})\nexport class RadioGroup {\n private radioOptions: HTMLIcRadioOptionElement[];\n\n @Element() host: HTMLIcRadioGroupElement;\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 * If `true`, the radio group will require a value.\n */\n @Prop() required: boolean = false;\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 * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\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 small styling will be applied to the radio group.\n */\n @Prop() small: boolean = false;\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n /**\n * The validation text - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationText: string = \"\";\n /**\n * The checked state.\n */\n @State() checkedValue: string = \"\";\n @State() selectedChild: number = -1;\n\n /**\n * Emitted when a user selects a radio.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n @Listen(\"icCheck\")\n selectHandler(event: CustomEvent<IcValueEventDetail>): void {\n this.checkedValue = event.detail.value;\n this.icChange.emit({ value: this.checkedValue });\n\n if (this.radioOptions !== undefined) {\n this.radioOptions.forEach((radioOption, index) => {\n radioOption.selected = this.checkedValue === radioOption.value;\n if (radioOption.selected) {\n this.selectedChild = index;\n }\n });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, true)\n ].selected = true;\n event.preventDefault();\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n this.radioOptions[\n this.getNextItemToSelect(this.selectedChild, false)\n ].selected = true;\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 componentDidLoad(): void {\n this.radioOptions = Array.from(\n this.host.querySelectorAll(\"ic-radio-option\")\n );\n\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 });\n this.radioOptions[0].shadowRoot.querySelector(\"input\").tabIndex =\n this.selectedChild > 0 ? -1 : 0;\n\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.name, propName: \"name\" },\n ],\n \"Radio Group\"\n );\n }\n\n render() {\n renderHiddenInput(\n true,\n this.host,\n this.name,\n this.checkedValue,\n this.disabled\n );\n\n return (\n <Host onKeyDown={this.handleKeyDown}>\n <div\n role=\"radiogroup\"\n aria-label={`${this.label}${this.required ? \", required\" : \"\"}`}\n >\n {!this.hideLabel && (\n <ic-input-label\n class={{ [`${this.validationStatus}`]: true }}\n label={this.label}\n helperText={this.helperText}\n required={this.required}\n disabled={this.disabled}\n ></ic-input-label>\n )}\n <slot></slot>\n </div>\n {hasValidationStatus(this.validationStatus, this.disabled) && (\n <ic-input-validation\n ariaLiveMode=\"polite\"\n status={this.validationStatus}\n message={this.validationText}\n ></ic-input-validation>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as e,h as t,H as n,g as i}from"./p-f9370be6.js";import{I as o}from"./p-6f57b13c.js";import{k as a,s,a as r}from"./p-a8ac8f72.js";const c='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;background-color:var(--ic-theme-tertiary);color:var(--ic-theme-text);--hero-heading-bottom-margin:var(--ic-space-md)}:host(.dark){background-color:var(--ic-theme-secondary)}:host(.has-background-image){background-repeat:no-repeat;background-position:right -100px;background-size:auto calc(100% + 100px);box-shadow:var(--ic-elevation-inset)}@media (prefers-reduced-motion){:host(.has-background-image){background-position:right -100px !important}}ic-typography.heading-bottom-spacing{margin-bottom:var(--hero-heading-bottom-margin)}.section-container{display:flex;align-items:center;height:100%}.left-container{padding:var(--ic-space-xl) 0}.left-container:not(.left-container-full-width){flex-basis:50%}.left-container-full-width{width:100%}.right-container{flex-basis:50%}.interaction-container{display:flex;gap:var(--ic-space-md);margin-top:var(--ic-space-lg)}.secondary-container{display:flex;flex-direction:column;justify-content:center;border-left:var(--ic-space-xxxs) solid var(--ic-theme-text)}.secondary-subheading{margin-top:var(--ic-space-xxs)}:host([content-aligned="left"]) .left-container,:host([content-aligned="left"]) .interaction-container{justify-content:flex-start;text-align:left}:host([content-aligned="center"]) .left-container,:host([content-aligned="center"]) .interaction-container{justify-content:center;text-align:center}@media (min-width: 992px){.left-container-full-width{width:66.6%}}@media (min-width: 1044px){:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}.left-container:not(.left-container-full-width){flex-basis:66.6%}.left-container{min-height:144px}.right-container{flex-basis:33.3%;margin-left:50px}.secondary-container{min-height:144px}.secondary-heading,.secondary-subheading{margin-left:63px}}@media (min-width: 801px) and (max-width: 1043px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:94.75px}.right-container{margin-left:50px}}@media (min-width: 641px) and (max-width: 800px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:34px}.right-container{margin-left:50px}}@media (min-width: 481px) and (max-width: 640px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:280px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}.right-container{margin-bottom:40px}}@media (max-width: 480px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:192px}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:264px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}}';const h=class{constructor(t){e(this,t);this.heading=undefined;this.subheading=undefined;this.secondaryHeading=undefined;this.secondarySubheading=undefined;this.backgroundImage=undefined;this.disableBackgroundParallax=false;this.aligned="left";this.contentAligned="left";this.small=false;this.rightContent=false;this.scrollFactor="right -100px";this.leftContentFullWidth=!this.rightContent&&this.secondaryHeading===undefined;this.foregroundColor=a()}themeChangeHandler(e){const t=e.detail;this.foregroundColor=t.mode}doScroll(){if(this.disableBackgroundParallax){return}const e=document.scrollingElement.scrollTop;const t=.4;const n=-100+e*t;this.scrollFactor="right "+n+"px"}componentWillLoad(){this.rightContent=s(this.el,"secondary")}componentDidLoad(){r([{prop:this.heading,propName:"heading"}],"Hero")}componentWillRender(){this.rightContent=s(this.el,"secondary")}render(){const{aligned:e,small:i,heading:a,subheading:s,secondaryHeading:r,secondarySubheading:c,foregroundColor:h,backgroundImage:d,scrollFactor:l}=this;let m={};if(d!==undefined){m={"background-image":"url("+d+")","background-position":l}}return t(n,{class:{[o.Dark]:h===o.Dark,["has-background-image"]:d!==undefined},style:m},t("ic-section-container",{aligned:e,fullHeight:true,class:"section-container"},t("div",{class:{["left-container"]:true,["left-container-full-width"]:this.leftContentFullWidth}},t("div",{class:"heading"},t("slot",{name:"heading"},t("ic-typography",{variant:i?"h2":"h1",class:{["heading-bottom-spacing"]:!i}},a))),t("div",{class:"subheading"},t("slot",{name:"subheading"},t("ic-typography",{variant:"body"},s))),t("div",{class:"interaction-container"},t("slot",{name:"interaction"}))),(r!==undefined||this.rightContent)&&t("div",{class:"right-container"},t("slot",{name:"secondary"},r&&t("div",{class:"secondary-container"},t("div",{class:"secondary-heading"},t("ic-typography",{variant:"h4"},r)),t("div",{class:"secondary-subheading"},t("ic-typography",{variant:"subtitle-small"},c)))))))}get el(){return i(this)}};h.style=c;export{h as ic_hero};
2
- //# sourceMappingURL=p-c1d78a64.entry.js.map
1
+ import{r as e,h as t,H as n,g as i}from"./p-f9370be6.js";import{I as o}from"./p-6f57b13c.js";import{k as a,s,a as r}from"./p-a8ac8f72.js";const c='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;background-color:var(--ic-theme-tertiary);color:var(--ic-theme-text);--hero-heading-bottom-margin:var(--ic-space-md)}:host(.dark){background-color:var(--ic-theme-secondary)}:host(.has-background-image){background-repeat:no-repeat;background-position:right -100px;background-size:auto calc(100% + 100px);box-shadow:var(--ic-elevation-inset)}@media (prefers-reduced-motion){:host(.has-background-image){background-position:right -100px !important}}ic-typography.heading-bottom-spacing{margin-bottom:var(--hero-heading-bottom-margin)}.section-container{display:flex;align-items:center;height:100%}.left-container{padding:var(--ic-space-xl) 0}.left-container:not(.left-container-full-width){flex-basis:50%}.left-container-full-width{width:100%}.right-container{flex-basis:50%}.interaction-container{display:flex;gap:var(--ic-space-md);margin-top:var(--ic-space-lg)}.secondary-container{display:flex;flex-direction:column;justify-content:center;border-left:var(--ic-space-xxxs) solid var(--ic-theme-text)}.secondary-subheading{margin-top:var(--ic-space-xxs)}:host([content-aligned="left"]) .left-container,:host([content-aligned="left"]) .interaction-container{justify-content:flex-start;text-align:left}:host([content-aligned="center"]) .left-container,:host([content-aligned="center"]) .interaction-container{justify-content:center;text-align:center}@media (min-width: 992px){.left-container-full-width{width:66.6%}}@media (min-width: 1044px){:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}.left-container:not(.left-container-full-width){flex-basis:66.6%}.left-container{min-height:144px}.right-container{flex-basis:33.3%;margin-left:50px}.secondary-container{min-height:144px}.secondary-heading,.secondary-subheading{margin-left:63px}}@media (min-width: 801px) and (max-width: 1043px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:94.75px}.right-container{margin-left:50px}}@media (min-width: 641px) and (max-width: 800px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:256px}:host([small]),:host([small]) .section-container{min-height:240px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:224px}.left-container{min-height:160px}.secondary-container{min-height:160px}.secondary-heading,.secondary-subheading{margin-left:34px}.right-container{margin-left:50px}}@media (min-width: 481px) and (max-width: 640px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:208px}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:280px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}.right-container{margin-bottom:40px}}@media (max-width: 480px){:host(.has-background-image){background-image:none !important}:host,.section-container{min-height:192px}:host,.right-container{margin-bottom:var(--ic-space-md)}:host([small]),:host([small]) .section-container{min-height:173px}:host([secondary-heading]),:host([secondary-heading]) .section-container{min-height:264px}:host([secondary-heading]) .section-container,:host([small]) .section-container,.section-container{flex-direction:column;align-items:flex-start}.left-container{height:-moz-fit-content;height:fit-content}.secondary-container{height:-moz-fit-content;height:fit-content;border:none}}';const h=class{constructor(t){e(this,t);this.heading=undefined;this.subheading=undefined;this.secondaryHeading=undefined;this.secondarySubheading=undefined;this.backgroundImage=undefined;this.disableBackgroundParallax=false;this.aligned="left";this.contentAligned="left";this.small=false;this.rightContent=false;this.scrollFactor="right -100px";this.leftContentFullWidth=!this.rightContent&&this.secondaryHeading===undefined;this.foregroundColor=a()}themeChangeHandler(e){const t=e.detail;this.foregroundColor=t.mode}doScroll(){if(this.disableBackgroundParallax){return}const e=document.scrollingElement.scrollTop;const t=.4;const n=-100+e*t;this.scrollFactor="right "+n+"px"}componentWillLoad(){this.rightContent=s(this.el,"secondary")}componentDidLoad(){r([{prop:this.heading,propName:"heading"}],"Hero")}componentWillRender(){this.rightContent=s(this.el,"secondary")}render(){const{aligned:e,small:i,heading:a,subheading:s,secondaryHeading:r,secondarySubheading:c,foregroundColor:h,backgroundImage:d,scrollFactor:l}=this;let m={};if(d!==undefined){m={"background-image":"url("+d+")","background-position":l}}return t(n,{class:{[o.Dark]:h===o.Dark,["has-background-image"]:d!==undefined},style:m},t("ic-section-container",{aligned:e,fullHeight:true,class:"section-container"},t("div",{class:{["left-container"]:true,["left-container-full-width"]:this.leftContentFullWidth}},t("div",{class:"heading"},t("slot",{name:"heading"},t("ic-typography",{variant:i?"h2":"h1",class:{["heading-bottom-spacing"]:!i}},a))),t("div",{class:"subheading"},t("slot",{name:"subheading"},t("ic-typography",{variant:"body"},s))),t("div",{class:"interaction-container"},t("slot",{name:"interaction"}))),(r!==undefined||this.rightContent)&&t("div",{class:"right-container"},t("slot",{name:"secondary"},r&&t("div",{class:"secondary-container"},t("div",{class:"secondary-heading"},t("ic-typography",{variant:"h4"},r)),t("div",{class:"secondary-subheading"},t("ic-typography",{variant:"subtitle-small"},c)))))))}get el(){return i(this)}};h.style=c;export{h as ic_hero};
2
+ //# sourceMappingURL=p-4902b46a.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/ic-hero/ic-hero.css?tag=ic-hero&encapsulation=shadow","src/components/ic-hero/ic-hero.tsx"],"names":["icHeroCss","Hero","this","rightContent","secondaryHeading","undefined","getThemeForegroundColor","[object Object]","ev","theme","detail","foregroundColor","mode","disableBackgroundParallax","scrolltotop","document","scrollingElement","scrollTop","factor","y","scrollFactor","slotHasContent","el","onComponentRequiredPropUndefined","prop","heading","propName","aligned","small","subheading","secondarySubheading","backgroundImage","style","background-image","background-position","h","Host","class","IcThemeForegroundEnum","Dark","fullHeight","leftContentFullWidth","name","variant"],"mappings":"0IAAA,MAAMA,EAAY,6tMCkCLC,EAAI,iNA+B+B,mBAKf,2BAKmB,kBAKzB,wBAEQ,wBAED,0CAG7BC,KAAKC,cAAgBD,KAAKE,mBAAqBC,+BAEJC,IAG9CC,mBAAmBC,GACjB,MAAMC,EAAiBD,EAAGE,OAC1BR,KAAKS,gBAAkBF,EAAMG,KAI/BL,WACE,GAAIL,KAAKW,0BAA2B,CAClC,OAGF,MAAMC,EAAcC,SAASC,iBAAiBC,UAC9C,MAAMC,EAAS,GACf,MAAMC,GAAK,IAAML,EAAcI,EAC/BhB,KAAKkB,aAAe,SAAWD,EAAI,KAGrCZ,oBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,mBACEgB,EACE,CAAC,CAAEC,KAAMtB,KAAKuB,QAASC,SAAU,YACjC,QAIJnB,sBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,SACE,MAAMoB,QACJA,EAAOC,MACPA,EAAKH,QACLA,EAAOI,WACPA,EAAUzB,iBACVA,EAAgB0B,oBAChBA,EAAmBnB,gBACnBA,EAAeoB,gBACfA,EAAeX,aACfA,GACElB,KAEJ,IAAI8B,EAAQ,GAEZ,GAAID,IAAoB1B,UAAW,CACjC2B,EAAQ,CACNC,mBAAoB,OAASF,EAAkB,IAC/CG,sBAAuBd,GAI3B,OACEe,EAACC,EAAI,CACHC,MAAO,CACL9B,CAAC+B,EAAsBC,MACrB5B,IAAoB2B,EAAsBC,KAC5ChC,CAAC,wBAAyBwB,IAAoB1B,WAEhD2B,MAAOA,GAEPG,EAAA,uBAAA,CACER,QAASA,EACTa,WAAU,KACVH,MAAM,qBAENF,EAAA,MAAA,CACEE,MAAO,CACL9B,CAAC,kBAAmB,KACpBA,CAAC,6BAA8BL,KAAKuC,uBAGtCN,EAAA,MAAA,CAAKE,MAAM,WACTF,EAAA,OAAA,CAAMO,KAAK,WACTP,EAAA,gBAAA,CACEQ,QAASf,EAAQ,KAAO,KACxBS,MAAO,CAAE9B,CAAC,2BAA4BqB,IAErCH,KAIPU,EAAA,MAAA,CAAKE,MAAM,cACTF,EAAA,OAAA,CAAMO,KAAK,cACTP,EAAA,gBAAA,CAAeQ,QAAQ,QAAQd,KAGnCM,EAAA,MAAA,CAAKE,MAAM,yBACTF,EAAA,OAAA,CAAMO,KAAK,mBAGbtC,IAAqBC,WAAaH,KAAKC,eACvCgC,EAAA,MAAA,CAAKE,MAAM,mBACTF,EAAA,OAAA,CAAMO,KAAK,aACRtC,GACC+B,EAAA,MAAA,CAAKE,MAAM,uBACTF,EAAA,MAAA,CAAKE,MAAM,qBACTF,EAAA,gBAAA,CAAeQ,QAAQ,MACpBvC,IAGL+B,EAAA,MAAA,CAAKE,MAAM,wBACTF,EAAA,gBAAA,CAAeQ,QAAQ,kBACpBb","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n background-color: var(--ic-theme-tertiary);\n color: var(--ic-theme-text);\n\n --hero-heading-bottom-margin: var(--ic-space-md);\n}\n\n:host(.dark) {\n background-color: var(--ic-theme-secondary);\n}\n\n:host(.has-background-image) {\n background-repeat: no-repeat;\n background-position: right -100px;\n background-size: auto calc(100% + 100px);\n box-shadow: var(--ic-elevation-inset);\n}\n\n@media (prefers-reduced-motion) {\n :host(.has-background-image) {\n background-position: right -100px !important;\n }\n}\n\nic-typography.heading-bottom-spacing {\n margin-bottom: var(--hero-heading-bottom-margin);\n}\n\n.section-container {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.left-container {\n padding: var(--ic-space-xl) 0;\n}\n\n.left-container:not(.left-container-full-width) {\n flex-basis: 50%;\n}\n\n.left-container-full-width {\n width: 100%;\n}\n\n.right-container {\n flex-basis: 50%;\n}\n\n.interaction-container {\n display: flex;\n gap: var(--ic-space-md);\n margin-top: var(--ic-space-lg);\n}\n\n.secondary-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n border-left: var(--ic-space-xxxs) solid var(--ic-theme-text);\n}\n\n.secondary-subheading {\n margin-top: var(--ic-space-xxs);\n}\n\n:host([content-aligned=\"left\"]) .left-container,\n:host([content-aligned=\"left\"]) .interaction-container {\n justify-content: flex-start;\n text-align: left;\n}\n\n:host([content-aligned=\"center\"]) .left-container,\n:host([content-aligned=\"center\"]) .interaction-container {\n justify-content: center;\n text-align: center;\n}\n\n@media (min-width: 992px) {\n .left-container-full-width {\n width: 66.6%;\n }\n}\n\n@media (min-width: 1044px) {\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n .left-container:not(.left-container-full-width) {\n flex-basis: 66.6%;\n }\n\n .left-container {\n min-height: 144px;\n }\n\n .right-container {\n flex-basis: 33.3%;\n margin-left: 50px;\n }\n\n .secondary-container {\n min-height: 144px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 63px;\n }\n}\n\n@media (min-width: 801px) and (max-width: 1043px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 94.75px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 641px) and (max-width: 800px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 34px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 481px) and (max-width: 640px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 280px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n\n .right-container {\n margin-bottom: 40px;\n }\n}\n\n@media (max-width: 480px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 192px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 264px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Listen,\n} from \"@stencil/core\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport {\n slotHasContent,\n getThemeForegroundColor,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcHeroContentAlignments } from \"./ic-hero.types\";\n\n/**\n * @slot heading - Content will be rendered in the title area, in place of the heading.\n * @slot subheading - Content will be rendered in the title area, in place of the subheading.\n * @slot interaction - Content will be rendered in the interaction area, adjacent to the title area.\n * @slot secondary - Content will be rendered in the secondary content area.\n */\n\n@Component({\n tag: \"ic-hero\",\n styleUrl: \"ic-hero.css\",\n shadow: true,\n})\nexport class Hero {\n @Element() el: HTMLIcHeroElement;\n\n /**\n * The heading of the hero.\n */\n @Prop() heading!: string;\n\n /**\n * The description for the hero.\n */\n @Prop() subheading?: string;\n\n /**\n * The optional secondary heading, replaced by slotted right content.\n */\n @Prop() secondaryHeading?: string;\n\n /**\n * The optional secondary subheading, replaced by slotted right content.\n */\n @Prop() secondarySubheading?: string;\n\n /**\n * The optional background image.\n */\n @Prop() backgroundImage?: string;\n\n /**\n * If `true`, the background image (if set) will not scroll using a parallax effect.\n */\n @Prop() disableBackgroundParallax?: boolean = false;\n\n /**\n * The alignment of the hero.\n */\n @Prop() aligned: IcAlignment = \"left\";\n\n /**\n * The alignment of the hero content.\n */\n @Prop() contentAligned: IcHeroContentAlignments = \"left\";\n\n /**\n * If `true`, the small styling will be applied to the hero.\n */\n @Prop() small: boolean = false;\n\n @State() rightContent: boolean = false;\n\n @State() scrollFactor: string = \"right -100px\";\n\n @State() leftContentFullWidth: boolean =\n !this.rightContent && this.secondaryHeading === undefined;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.foregroundColor = theme.mode;\n }\n\n @Listen(\"scroll\", { target: \"document\" })\n doScroll(): void {\n if (this.disableBackgroundParallax) {\n return;\n }\n\n const scrolltotop = document.scrollingElement.scrollTop;\n const factor = 0.4;\n const y = -100 + scrolltotop * factor;\n this.scrollFactor = \"right \" + y + \"px\";\n }\n\n componentWillLoad(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Hero\"\n );\n }\n\n componentWillRender(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n render() {\n const {\n aligned,\n small,\n heading,\n subheading,\n secondaryHeading,\n secondarySubheading,\n foregroundColor,\n backgroundImage,\n scrollFactor,\n } = this;\n\n let style = {};\n\n if (backgroundImage !== undefined) {\n style = {\n \"background-image\": \"url(\" + backgroundImage + \")\",\n \"background-position\": scrollFactor,\n };\n }\n\n return (\n <Host\n class={{\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [\"has-background-image\"]: backgroundImage !== undefined,\n }}\n style={style}\n >\n <ic-section-container\n aligned={aligned}\n fullHeight\n class=\"section-container\"\n >\n <div\n class={{\n [\"left-container\"]: true,\n [\"left-container-full-width\"]: this.leftContentFullWidth,\n }}\n >\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography\n variant={small ? \"h2\" : \"h1\"}\n class={{ [\"heading-bottom-spacing\"]: !small }}\n >\n {heading}\n </ic-typography>\n </slot>\n </div>\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"body\">{subheading}</ic-typography>\n </slot>\n </div>\n <div class=\"interaction-container\">\n <slot name=\"interaction\"></slot>\n </div>\n </div>\n {(secondaryHeading !== undefined || this.rightContent) && (\n <div class=\"right-container\">\n <slot name=\"secondary\">\n {secondaryHeading && (\n <div class=\"secondary-container\">\n <div class=\"secondary-heading\">\n <ic-typography variant=\"h4\">\n {secondaryHeading}\n </ic-typography>\n </div>\n <div class=\"secondary-subheading\">\n <ic-typography variant=\"subtitle-small\">\n {secondarySubheading}\n </ic-typography>\n </div>\n </div>\n )}\n </slot>\n </div>\n )}\n </ic-section-container>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["src/components/ic-hero/ic-hero.css?tag=ic-hero&encapsulation=shadow","src/components/ic-hero/ic-hero.tsx"],"names":["icHeroCss","Hero","this","rightContent","secondaryHeading","undefined","getThemeForegroundColor","[object Object]","ev","theme","detail","foregroundColor","mode","disableBackgroundParallax","scrolltotop","document","scrollingElement","scrollTop","factor","y","scrollFactor","slotHasContent","el","onComponentRequiredPropUndefined","prop","heading","propName","aligned","small","subheading","secondarySubheading","backgroundImage","style","background-image","background-position","h","Host","class","IcThemeForegroundEnum","Dark","fullHeight","leftContentFullWidth","name","variant"],"mappings":"0IAAA,MAAMA,EAAY,qxMCkCLC,EAAI,iNA+B+B,mBAKf,2BAKmB,kBAKzB,wBAEQ,wBAED,0CAG7BC,KAAKC,cAAgBD,KAAKE,mBAAqBC,+BAEJC,IAG9CC,mBAAmBC,GACjB,MAAMC,EAAiBD,EAAGE,OAC1BR,KAAKS,gBAAkBF,EAAMG,KAI/BL,WACE,GAAIL,KAAKW,0BAA2B,CAClC,OAGF,MAAMC,EAAcC,SAASC,iBAAiBC,UAC9C,MAAMC,EAAS,GACf,MAAMC,GAAK,IAAML,EAAcI,EAC/BhB,KAAKkB,aAAe,SAAWD,EAAI,KAGrCZ,oBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,mBACEgB,EACE,CAAC,CAAEC,KAAMtB,KAAKuB,QAASC,SAAU,YACjC,QAIJnB,sBACEL,KAAKC,aAAekB,EAAenB,KAAKoB,GAAI,aAG9Cf,SACE,MAAMoB,QACJA,EAAOC,MACPA,EAAKH,QACLA,EAAOI,WACPA,EAAUzB,iBACVA,EAAgB0B,oBAChBA,EAAmBnB,gBACnBA,EAAeoB,gBACfA,EAAeX,aACfA,GACElB,KAEJ,IAAI8B,EAAQ,GAEZ,GAAID,IAAoB1B,UAAW,CACjC2B,EAAQ,CACNC,mBAAoB,OAASF,EAAkB,IAC/CG,sBAAuBd,GAI3B,OACEe,EAACC,EAAI,CACHC,MAAO,CACL9B,CAAC+B,EAAsBC,MACrB5B,IAAoB2B,EAAsBC,KAC5ChC,CAAC,wBAAyBwB,IAAoB1B,WAEhD2B,MAAOA,GAEPG,EAAA,uBAAA,CACER,QAASA,EACTa,WAAU,KACVH,MAAM,qBAENF,EAAA,MAAA,CACEE,MAAO,CACL9B,CAAC,kBAAmB,KACpBA,CAAC,6BAA8BL,KAAKuC,uBAGtCN,EAAA,MAAA,CAAKE,MAAM,WACTF,EAAA,OAAA,CAAMO,KAAK,WACTP,EAAA,gBAAA,CACEQ,QAASf,EAAQ,KAAO,KACxBS,MAAO,CAAE9B,CAAC,2BAA4BqB,IAErCH,KAIPU,EAAA,MAAA,CAAKE,MAAM,cACTF,EAAA,OAAA,CAAMO,KAAK,cACTP,EAAA,gBAAA,CAAeQ,QAAQ,QAAQd,KAGnCM,EAAA,MAAA,CAAKE,MAAM,yBACTF,EAAA,OAAA,CAAMO,KAAK,mBAGbtC,IAAqBC,WAAaH,KAAKC,eACvCgC,EAAA,MAAA,CAAKE,MAAM,mBACTF,EAAA,OAAA,CAAMO,KAAK,aACRtC,GACC+B,EAAA,MAAA,CAAKE,MAAM,uBACTF,EAAA,MAAA,CAAKE,MAAM,qBACTF,EAAA,gBAAA,CAAeQ,QAAQ,MACpBvC,IAGL+B,EAAA,MAAA,CAAKE,MAAM,wBACTF,EAAA,gBAAA,CAAeQ,QAAQ,kBACpBb","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n background-color: var(--ic-theme-tertiary);\n color: var(--ic-theme-text);\n\n --hero-heading-bottom-margin: var(--ic-space-md);\n}\n\n:host(.dark) {\n background-color: var(--ic-theme-secondary);\n}\n\n:host(.has-background-image) {\n background-repeat: no-repeat;\n background-position: right -100px;\n background-size: auto calc(100% + 100px);\n box-shadow: var(--ic-elevation-inset);\n}\n\n@media (prefers-reduced-motion) {\n :host(.has-background-image) {\n background-position: right -100px !important;\n }\n}\n\nic-typography.heading-bottom-spacing {\n margin-bottom: var(--hero-heading-bottom-margin);\n}\n\n.section-container {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.left-container {\n padding: var(--ic-space-xl) 0;\n}\n\n.left-container:not(.left-container-full-width) {\n flex-basis: 50%;\n}\n\n.left-container-full-width {\n width: 100%;\n}\n\n.right-container {\n flex-basis: 50%;\n}\n\n.interaction-container {\n display: flex;\n gap: var(--ic-space-md);\n margin-top: var(--ic-space-lg);\n}\n\n.secondary-container {\n display: flex;\n flex-direction: column;\n justify-content: center;\n border-left: var(--ic-space-xxxs) solid var(--ic-theme-text);\n}\n\n.secondary-subheading {\n margin-top: var(--ic-space-xxs);\n}\n\n:host([content-aligned=\"left\"]) .left-container,\n:host([content-aligned=\"left\"]) .interaction-container {\n justify-content: flex-start;\n text-align: left;\n}\n\n:host([content-aligned=\"center\"]) .left-container,\n:host([content-aligned=\"center\"]) .interaction-container {\n justify-content: center;\n text-align: center;\n}\n\n@media (min-width: 992px) {\n .left-container-full-width {\n width: 66.6%;\n }\n}\n\n@media (min-width: 1044px) {\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n .left-container:not(.left-container-full-width) {\n flex-basis: 66.6%;\n }\n\n .left-container {\n min-height: 144px;\n }\n\n .right-container {\n flex-basis: 33.3%;\n margin-left: 50px;\n }\n\n .secondary-container {\n min-height: 144px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 63px;\n }\n}\n\n@media (min-width: 801px) and (max-width: 1043px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 94.75px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 641px) and (max-width: 800px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 256px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 240px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 224px;\n }\n\n .left-container {\n min-height: 160px;\n }\n\n .secondary-container {\n min-height: 160px;\n }\n\n .secondary-heading,\n .secondary-subheading {\n margin-left: 34px;\n }\n\n .right-container {\n margin-left: 50px;\n }\n}\n\n@media (min-width: 481px) and (max-width: 640px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 208px;\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 280px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n\n .right-container {\n margin-bottom: 40px;\n }\n}\n\n@media (max-width: 480px) {\n :host(.has-background-image) {\n background-image: none !important;\n }\n\n :host,\n .section-container {\n min-height: 192px;\n }\n\n :host,\n .right-container {\n margin-bottom: var(--ic-space-md);\n }\n\n :host([small]),\n :host([small]) .section-container {\n min-height: 173px;\n }\n\n :host([secondary-heading]),\n :host([secondary-heading]) .section-container {\n min-height: 264px;\n }\n\n :host([secondary-heading]) .section-container,\n :host([small]) .section-container,\n .section-container {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .left-container {\n height: fit-content;\n }\n\n .secondary-container {\n height: fit-content;\n border: none;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Listen,\n} from \"@stencil/core\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport {\n slotHasContent,\n getThemeForegroundColor,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcHeroContentAlignments } from \"./ic-hero.types\";\n\n/**\n * @slot heading - Content will be rendered in the title area, in place of the heading.\n * @slot subheading - Content will be rendered in the title area, in place of the subheading.\n * @slot interaction - Content will be rendered in the interaction area, adjacent to the title area.\n * @slot secondary - Content will be rendered in the secondary content area.\n */\n\n@Component({\n tag: \"ic-hero\",\n styleUrl: \"ic-hero.css\",\n shadow: true,\n})\nexport class Hero {\n @Element() el: HTMLIcHeroElement;\n\n /**\n * The heading of the hero.\n */\n @Prop() heading!: string;\n\n /**\n * The description for the hero.\n */\n @Prop() subheading?: string;\n\n /**\n * The optional secondary heading, replaced by slotted right content.\n */\n @Prop() secondaryHeading?: string;\n\n /**\n * The optional secondary subheading, replaced by slotted right content.\n */\n @Prop() secondarySubheading?: string;\n\n /**\n * The optional background image.\n */\n @Prop() backgroundImage?: string;\n\n /**\n * If `true`, the background image (if set) will not scroll using a parallax effect.\n */\n @Prop() disableBackgroundParallax?: boolean = false;\n\n /**\n * The alignment of the hero.\n */\n @Prop() aligned: IcAlignment = \"left\";\n\n /**\n * The alignment of the hero content.\n */\n @Prop() contentAligned: IcHeroContentAlignments = \"left\";\n\n /**\n * If `true`, the small styling will be applied to the hero.\n */\n @Prop() small: boolean = false;\n\n @State() rightContent: boolean = false;\n\n @State() scrollFactor: string = \"right -100px\";\n\n @State() leftContentFullWidth: boolean =\n !this.rightContent && this.secondaryHeading === undefined;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.foregroundColor = theme.mode;\n }\n\n @Listen(\"scroll\", { target: \"document\" })\n doScroll(): void {\n if (this.disableBackgroundParallax) {\n return;\n }\n\n const scrolltotop = document.scrollingElement.scrollTop;\n const factor = 0.4;\n const y = -100 + scrolltotop * factor;\n this.scrollFactor = \"right \" + y + \"px\";\n }\n\n componentWillLoad(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.heading, propName: \"heading\" }],\n \"Hero\"\n );\n }\n\n componentWillRender(): void {\n this.rightContent = slotHasContent(this.el, \"secondary\");\n }\n\n render() {\n const {\n aligned,\n small,\n heading,\n subheading,\n secondaryHeading,\n secondarySubheading,\n foregroundColor,\n backgroundImage,\n scrollFactor,\n } = this;\n\n let style = {};\n\n if (backgroundImage !== undefined) {\n style = {\n \"background-image\": \"url(\" + backgroundImage + \")\",\n \"background-position\": scrollFactor,\n };\n }\n\n return (\n <Host\n class={{\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [\"has-background-image\"]: backgroundImage !== undefined,\n }}\n style={style}\n >\n <ic-section-container\n aligned={aligned}\n fullHeight\n class=\"section-container\"\n >\n <div\n class={{\n [\"left-container\"]: true,\n [\"left-container-full-width\"]: this.leftContentFullWidth,\n }}\n >\n <div class=\"heading\">\n <slot name=\"heading\">\n <ic-typography\n variant={small ? \"h2\" : \"h1\"}\n class={{ [\"heading-bottom-spacing\"]: !small }}\n >\n {heading}\n </ic-typography>\n </slot>\n </div>\n <div class=\"subheading\">\n <slot name=\"subheading\">\n <ic-typography variant=\"body\">{subheading}</ic-typography>\n </slot>\n </div>\n <div class=\"interaction-container\">\n <slot name=\"interaction\"></slot>\n </div>\n </div>\n {(secondaryHeading !== undefined || this.rightContent) && (\n <div class=\"right-container\">\n <slot name=\"secondary\">\n {secondaryHeading && (\n <div class=\"secondary-container\">\n <div class=\"secondary-heading\">\n <ic-typography variant=\"h4\">\n {secondaryHeading}\n </ic-typography>\n </div>\n <div class=\"secondary-subheading\">\n <ic-typography variant=\"subtitle-small\">\n {secondarySubheading}\n </ic-typography>\n </div>\n </div>\n )}\n </slot>\n </div>\n )}\n </ic-section-container>\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as t,h as i,H as s,g as r}from"./p-f9370be6.js";import{z as l,c as a,a as o}from"./p-a8ac8f72.js";import{I as e}from"./p-6f57b13c.js";const c=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.0876 1.175L5.9126 0L0.912598 5L5.9126 10L7.0876 8.825L3.27093 5L7.0876 1.175Z"/>\n</svg>`;const n=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.0876 0L0.912598 1.175L4.72926 5L0.912598 8.825L2.0876 10L7.0876 5L2.0876 0Z"/>\n</svg>\n`;const h=":host{--border-bottom-color:var(--ic-architectural-300);--splitter-color:var(--ic-architectural-100);--tab-scroll-focus:var(--ic-border-focus);--tab-scroll-fill:var(--ic-action-default);--tab-scroll-disabled-fill:var(--ic-architectural-300);--tab-scroll-hover:var(--ic-action-default-bg-hover);--tab-scroll-active:var(--ic-action-default-bg-active);display:block;margin-bottom:var(--ic-space-md);margin-left:calc(-1 * var(--ic-space-xs))}:host(.light){--splitter-color:var(--ic-architectural-white);--tab-scroll-focus:var(--ic-border-focus-dark);--tab-scroll-fill:var(--ic-action-light);--tab-scroll-disabled-fill:var(--ic-architectural-500);--tab-scroll-hover:var(--ic-action-dark-bg-hover);--tab-scroll-active:var(--ic-action-dark-bg-active)}:host([inline]){margin-bottom:0}.tabs-container{display:flex;flex-direction:row;overflow-y:hidden;overflow-x:scroll;height:100%;align-items:center;padding:var(--ic-space-xs);scroll-behavior:smooth;-ms-overflow-style:none;scrollbar-width:none;margin:calc(-1 * var(--ic-space-xs)) 0}.tabs-container::-webkit-scrollbar{display:none}.ic-tab-group-container{display:flex;align-items:center}:host(.light.ic-tab-group-not-inline){--border-bottom-color:var(--ic-architectural-white)}.scroll-container{display:flex}.scroll-container.hidden{display:none}.scroll-container:first-child{margin-left:var(--ic-space-xs)}.scroll-arrow{display:flex;width:36px;height:36px;margin:var(--ic-space-xxs) var(--ic-space-xxxs);align-items:center;justify-content:center;fill:var(--tab-scroll-fill);cursor:pointer}.scroll-arrow:focus{outline:var(--ic-hc-focus-outline)}.scroll-arrow:hover{background-color:var(--tab-scroll-hover)}.scroll-arrow:active{background-color:var(--tab-scroll-active)}.scroll-container.disabled .scroll-arrow{fill:var(--tab-scroll-disabled-fill);cursor:default}.scroll-container.disabled .scroll-arrow:hover,.scroll-container.disabled .scroll-arrow:active,.scroll-container.disabled .scroll-arrow:focus{background-color:unset;box-shadow:none}.scroll-container.disabled .ic-tooltip-container{display:none !important}.scroll-splitter-left,.scroll-splitter-right{display:flex;height:var(--ic-space-lg);width:1px;margin-top:10px;background-color:var(--splitter-color)}.scroll-splitter-left{margin-left:var(--ic-space-xxxs)}.scroll-splitter-right{margin-right:var(--ic-space-xxxs)}.scroll-container.disabled .scroll-splitter-left,.scroll-container.disabled .scroll-splitter-right{display:none}.ic-tab-splitter{display:block;background-color:var(--border-bottom-color);height:1px;right:0;left:0;margin-left:var(--ic-space-xs)}.ic-tab-splitter.hidden{height:0}";const d=200;const b=class{constructor(i){t(this,i);this.buttonStateSet=false;this.resizeObserverCallback=()=>{if(this.tabGroupEl===null||this.tabGroupEl===undefined){this.tabGroupEl=this.host.shadowRoot.querySelector(".tabs-container")}this.tabOverflow=l(this.tabGroupEl);if(this.tabOverflow){this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.splitterEl)};this.scrollLeft=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()-1)};this.scrollRight=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()+1)};this.longScrollRight=()=>{this.scrollRight();this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.longScrollLeft=()=>{this.scrollLeft();this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.leftArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.rightArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.arrowMouseUpHandler=()=>{window.clearTimeout(this.scrollDelay)};this.getCurrentLeftTab=()=>{const t=this.tabOffsets.findIndex((t=>t>this.tabGroupEl.scrollLeft));return t<0?0:t};this.scrollHandler=()=>{window.clearTimeout(this.isScrolling);this.isScrolling=window.setTimeout(this.scrollStopped,50)};this.scrollStopped=()=>{if(this.buttonStateSet===false){this.firstTabVisible=this.tabGroupEl.scrollLeft===0;this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}this.buttonStateSet=false};this.contextId="default";this.inline=false;this.label=undefined;this.appearance="dark";this.firstTabVisible=true;this.lastTabVisible=false;this.tabOverflow=false}async scrollTabIntoView(t){this.firstTabVisible=t<=0;const i=t<=0?0:this.tabOffsets[t-1];this.lastTabVisible=this.tabGroupEl.offsetWidth+i>=this.tabGroupEl.scrollWidth;this.buttonStateSet=true;this.tabGroupEl.scrollLeft=i}tabFocusHandler(t){if(this.tabOverflow){this.scrollTabIntoView(t.detail.position)}}componentDidLoad(){this.tabs=Array.from(this.host.querySelectorAll("ic-tab"));let t=0;this.tabOffsets=this.tabs.map((i=>{t+=i.offsetWidth;return t}));a(this.runResizeObserver);o([{prop:this.label,propName:"label"}],"Tab List")}disconnectedCallback(){this.resizeObserver.disconnect()}render(){const{inline:t,appearance:r,label:l,firstTabVisible:a,lastTabVisible:o,tabOverflow:h}=this;return i(s,{role:"tablist","aria-label":l,class:{["light"]:r===e.Light,["ic-tab-group-not-inline"]:!t}},i("div",{class:"ic-tab-group-container"},this.tabOverflow&&i("div",{"aria-hidden":"true",id:"scroll-container-left",class:{["scroll-container"]:true,["hidden"]:!h,["disabled"]:a}},i("ic-tooltip",{placement:"bottom-start",label:"Scroll left",target:"left-arrow"},i("span",{id:"left-arrow",class:"scroll-arrow",innerHTML:c,onClick:this.scrollLeft,onMouseDown:this.leftArrowMouseDownHandler,onMouseUp:this.arrowMouseUpHandler})),i("span",{class:"scroll-splitter-left"})),i("div",{class:"tabs-container",ref:t=>this.tabGroupEl=t,onScroll:this.scrollHandler},i("slot",null)),this.tabOverflow&&i("div",{"aria-hidden":"true",id:"scroll-container-right",class:{["scroll-container"]:true,["hidden"]:!h,["disabled"]:o}},i("span",{class:"scroll-splitter-right"}),i("ic-tooltip",{placement:"bottom-start",label:"Scroll right",target:"right-arrow"},i("span",{id:"right-arrow",class:"scroll-arrow",innerHTML:n,onClick:this.scrollRight,onMouseDown:this.rightArrowMouseDownHandler,onMouseUp:this.arrowMouseUpHandler})))),i("div",{"aria-hidden":"true",class:{["ic-tab-splitter"]:true,["hidden"]:t},ref:t=>this.splitterEl=t}))}get host(){return r(this)}};b.style=h;export{b as ic_tab_group};
2
- //# sourceMappingURL=p-9fbceeb2.entry.js.map
1
+ import{r as t,h as i,H as s,g as r}from"./p-f9370be6.js";import{z as l,c as a,a as o}from"./p-a8ac8f72.js";import{I as e}from"./p-6f57b13c.js";const c=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.0876 1.175L5.9126 0L0.912598 5L5.9126 10L7.0876 8.825L3.27093 5L7.0876 1.175Z"/>\n</svg>`;const n=`<svg width="8" height="10" viewBox="0 0 8 10" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.0876 0L0.912598 1.175L4.72926 5L0.912598 8.825L2.0876 10L7.0876 5L2.0876 0Z"/>\n</svg>\n`;const h=":host{--border-bottom-color:var(--ic-architectural-300);--splitter-color:var(--ic-architectural-100);--tab-scroll-focus:var(--ic-border-focus);--tab-scroll-fill:var(--ic-action-default);--tab-scroll-disabled-fill:var(--ic-architectural-300);--tab-scroll-hover:var(--ic-action-default-bg-hover);--tab-scroll-active:var(--ic-action-default-bg-active);display:block;margin-bottom:var(--ic-space-md);margin-left:calc(-1 * var(--ic-space-xs))}:host(.light){--splitter-color:var(--ic-architectural-white);--tab-scroll-focus:var(--ic-border-focus-dark);--tab-scroll-fill:var(--ic-action-light);--tab-scroll-disabled-fill:var(--ic-architectural-500);--tab-scroll-hover:var(--ic-action-dark-bg-hover);--tab-scroll-active:var(--ic-action-dark-bg-active)}:host([inline]){margin-bottom:0}.tabs-container{display:flex;flex-direction:row;overflow-y:hidden;overflow-x:scroll;height:100%;align-items:center;padding:var(--ic-space-xs);scroll-behavior:smooth;-ms-overflow-style:none;scrollbar-width:none;margin:calc(-1 * var(--ic-space-xs)) 0}.tabs-container::-webkit-scrollbar{display:none}.ic-tab-group-container{display:flex;align-items:center}:host(.light.ic-tab-group-not-inline){--border-bottom-color:var(--ic-architectural-white)}.scroll-container{display:flex}.scroll-container.hidden{display:none}.scroll-container:first-child{margin-left:var(--ic-space-xs)}.scroll-arrow{display:flex;width:36px;height:36px;margin:var(--ic-space-xxs) var(--ic-space-xxxs);align-items:center;justify-content:center;fill:var(--tab-scroll-fill);cursor:pointer}.scroll-arrow:focus{outline:var(--ic-hc-focus-outline)}.scroll-arrow:hover{background-color:var(--tab-scroll-hover)}.scroll-arrow:active{background-color:var(--tab-scroll-active)}.scroll-container.disabled .scroll-arrow{fill:var(--tab-scroll-disabled-fill);cursor:default}.scroll-container.disabled .scroll-arrow:hover,.scroll-container.disabled .scroll-arrow:active,.scroll-container.disabled .scroll-arrow:focus{background-color:unset;box-shadow:none}.scroll-container.disabled .ic-tooltip-container{display:none !important}.scroll-splitter-left,.scroll-splitter-right{display:flex;height:var(--ic-space-lg);width:1px;margin-top:10px;background-color:var(--splitter-color)}.scroll-splitter-left{margin-left:var(--ic-space-xxxs)}.scroll-splitter-right{margin-right:var(--ic-space-xxxs)}.scroll-container.disabled .scroll-splitter-left,.scroll-container.disabled .scroll-splitter-right{display:none}.ic-tab-splitter{display:block;background-color:var(--border-bottom-color);height:1px;right:0;left:0;margin-left:var(--ic-space-xs)}.ic-tab-splitter.hidden{height:0}";const d=200;const b=class{constructor(i){t(this,i);this.buttonStateSet=false;this.resizeObserverCallback=()=>{if(this.tabGroupEl===null||this.tabGroupEl===undefined){this.tabGroupEl=this.host.shadowRoot.querySelector(".tabs-container")}this.tabOverflow=l(this.tabGroupEl);if(this.tabOverflow){this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.splitterEl)};this.scrollLeft=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()-1)};this.scrollRight=()=>{this.scrollTabIntoView(this.getCurrentLeftTab()+1)};this.longScrollRight=()=>{this.scrollRight();this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.longScrollLeft=()=>{this.scrollLeft();this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.leftArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollLeft,d)};this.rightArrowMouseDownHandler=()=>{this.scrollDelay=window.setTimeout(this.longScrollRight,d)};this.arrowMouseUpHandler=()=>{window.clearTimeout(this.scrollDelay)};this.getCurrentLeftTab=()=>{const t=this.tabOffsets.findIndex((t=>t>this.tabGroupEl.scrollLeft));return t<0?0:t};this.scrollHandler=()=>{window.clearTimeout(this.isScrolling);this.isScrolling=window.setTimeout(this.scrollStopped,50)};this.scrollStopped=()=>{if(this.buttonStateSet===false){this.firstTabVisible=this.tabGroupEl.scrollLeft===0;this.lastTabVisible=this.tabGroupEl.offsetWidth+this.tabGroupEl.scrollLeft>=this.tabGroupEl.scrollWidth}this.buttonStateSet=false};this.contextId="default";this.inline=false;this.label=undefined;this.appearance="dark";this.firstTabVisible=true;this.lastTabVisible=false;this.tabOverflow=false}async scrollTabIntoView(t){this.firstTabVisible=t<=0;const i=t<=0?0:this.tabOffsets[t-1];this.lastTabVisible=this.tabGroupEl.offsetWidth+i>=this.tabGroupEl.scrollWidth;this.buttonStateSet=true;this.tabGroupEl.scrollLeft=i}tabFocusHandler(t){if(this.tabOverflow){this.scrollTabIntoView(t.detail.position)}}componentDidLoad(){this.tabs=Array.from(this.host.querySelectorAll("ic-tab"));let t=0;this.tabOffsets=this.tabs.map((i=>{t+=i.offsetWidth;return t}));a(this.runResizeObserver);o([{prop:this.label,propName:"label"}],"Tab Group")}disconnectedCallback(){this.resizeObserver.disconnect()}render(){const{inline:t,appearance:r,label:l,firstTabVisible:a,lastTabVisible:o,tabOverflow:h}=this;return i(s,{role:"tablist","aria-label":l,class:{["light"]:r===e.Light,["ic-tab-group-not-inline"]:!t}},i("div",{class:"ic-tab-group-container"},this.tabOverflow&&i("div",{"aria-hidden":"true",id:"scroll-container-left",class:{["scroll-container"]:true,["hidden"]:!h,["disabled"]:a}},i("ic-tooltip",{placement:"bottom-start",label:"Scroll left",target:"left-arrow"},i("span",{id:"left-arrow",class:"scroll-arrow",innerHTML:c,onClick:this.scrollLeft,onMouseDown:this.leftArrowMouseDownHandler,onMouseUp:this.arrowMouseUpHandler})),i("span",{class:"scroll-splitter-left"})),i("div",{class:"tabs-container",ref:t=>this.tabGroupEl=t,onScroll:this.scrollHandler},i("slot",null)),this.tabOverflow&&i("div",{"aria-hidden":"true",id:"scroll-container-right",class:{["scroll-container"]:true,["hidden"]:!h,["disabled"]:o}},i("span",{class:"scroll-splitter-right"}),i("ic-tooltip",{placement:"bottom-start",label:"Scroll right",target:"right-arrow"},i("span",{id:"right-arrow",class:"scroll-arrow",innerHTML:n,onClick:this.scrollRight,onMouseDown:this.rightArrowMouseDownHandler,onMouseUp:this.arrowMouseUpHandler})))),i("div",{"aria-hidden":"true",class:{["ic-tab-splitter"]:true,["hidden"]:t},ref:t=>this.splitterEl=t}))}get host(){return r(this)}};b.style=h;export{b as ic_tab_group};
2
+ //# sourceMappingURL=p-541918c2.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/ic-tab-group/ic-tab-group.css?tag=ic-tab-group&encapsulation=shadow","src/components/ic-tab-group/ic-tab-group.tsx"],"names":["icTabGroupCss","SCROLL_DELAY_MS","TabGroup","this","buttonStateSet","resizeObserverCallback","tabGroupEl","undefined","host","shadowRoot","querySelector","tabOverflow","elementOverflowsX","lastTabVisible","offsetWidth","scrollLeft","scrollWidth","runResizeObserver","resizeObserver","ResizeObserver","observe","splitterEl","scrollTabIntoView","getCurrentLeftTab","scrollRight","longScrollRight","scrollDelay","window","setTimeout","longScrollLeft","leftArrowMouseDownHandler","rightArrowMouseDownHandler","arrowMouseUpHandler","clearTimeout","index","tabOffsets","findIndex","el","scrollHandler","isScrolling","scrollStopped","firstTabVisible","[object Object]","tabNumber","newScrollPos","event","detail","position","tabs","Array","from","querySelectorAll","runningTotal","map","tab","checkResizeObserver","onComponentRequiredPropUndefined","prop","label","propName","disconnect","inline","appearance","h","Host","role","aria-label","class","IcThemeForegroundEnum","Light","aria-hidden","id","placement","target","innerHTML","LeftArrow","onClick","onMouseDown","onMouseUp","ref","onScroll","RightArrow"],"mappings":"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","sourcesContent":[":host {\n --border-bottom-color: var(--ic-architectural-300);\n --splitter-color: var(--ic-architectural-100);\n --tab-scroll-focus: var(--ic-border-focus);\n --tab-scroll-fill: var(--ic-action-default);\n --tab-scroll-disabled-fill: var(--ic-architectural-300);\n --tab-scroll-hover: var(--ic-action-default-bg-hover);\n --tab-scroll-active: var(--ic-action-default-bg-active);\n\n display: block;\n margin-bottom: var(--ic-space-md);\n margin-left: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.light) {\n --splitter-color: var(--ic-architectural-white);\n --tab-scroll-focus: var(--ic-border-focus-dark);\n --tab-scroll-fill: var(--ic-action-light);\n --tab-scroll-disabled-fill: var(--ic-architectural-500);\n --tab-scroll-hover: var(--ic-action-dark-bg-hover);\n --tab-scroll-active: var(--ic-action-dark-bg-active);\n}\n\n:host([inline]) {\n margin-bottom: 0;\n}\n\n.tabs-container {\n display: flex;\n flex-direction: row;\n overflow-y: hidden;\n overflow-x: scroll;\n height: 100%;\n align-items: center;\n padding: var(--ic-space-xs);\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n margin: calc(-1 * var(--ic-space-xs)) 0;\n}\n\n.tabs-container::-webkit-scrollbar {\n display: none;\n}\n\n.ic-tab-group-container {\n display: flex;\n align-items: center;\n}\n\n:host(.light.ic-tab-group-not-inline) {\n --border-bottom-color: var(--ic-architectural-white);\n}\n\n.scroll-container {\n display: flex;\n}\n\n.scroll-container.hidden {\n display: none;\n}\n\n.scroll-container:first-child {\n margin-left: var(--ic-space-xs);\n}\n\n.scroll-arrow {\n display: flex;\n width: 36px;\n height: 36px;\n margin: var(--ic-space-xxs) var(--ic-space-xxxs);\n align-items: center;\n justify-content: center;\n fill: var(--tab-scroll-fill);\n cursor: pointer;\n}\n\n.scroll-arrow:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.scroll-arrow:hover {\n background-color: var(--tab-scroll-hover);\n}\n\n.scroll-arrow:active {\n background-color: var(--tab-scroll-active);\n}\n\n.scroll-container.disabled .scroll-arrow {\n fill: var(--tab-scroll-disabled-fill);\n cursor: default;\n}\n\n.scroll-container.disabled .scroll-arrow:hover,\n.scroll-container.disabled .scroll-arrow:active,\n.scroll-container.disabled .scroll-arrow:focus {\n background-color: unset;\n box-shadow: none;\n}\n\n.scroll-container.disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.scroll-splitter-left,\n.scroll-splitter-right {\n display: flex;\n height: var(--ic-space-lg);\n width: 1px;\n margin-top: 10px;\n background-color: var(--splitter-color);\n}\n\n.scroll-splitter-left {\n margin-left: var(--ic-space-xxxs);\n}\n\n.scroll-splitter-right {\n margin-right: var(--ic-space-xxxs);\n}\n\n.scroll-container.disabled .scroll-splitter-left,\n.scroll-container.disabled .scroll-splitter-right {\n display: none;\n}\n\n.ic-tab-splitter {\n display: block;\n background-color: var(--border-bottom-color);\n height: 1px;\n right: 0;\n left: 0;\n margin-left: var(--ic-space-xs);\n}\n\n.ic-tab-splitter.hidden {\n height: 0;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Method,\n Listen,\n} from \"@stencil/core\";\n\nimport LeftArrow from \"./assets/left-arrow.svg\";\nimport RightArrow from \"./assets/right-arrow.svg\";\n\nimport {\n checkResizeObserver,\n elementOverflowsX,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcTabClickEventDetail } from \"../ic-tab/ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nconst SCROLL_DELAY_MS = 200;\n\n@Component({\n tag: \"ic-tab-group\",\n styleUrl: \"ic-tab-group.css\",\n shadow: true,\n})\nexport class TabGroup {\n @Element() host: HTMLIcTabGroupElement;\n\n /**\n * The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * If `true`, the tabs and tab panels will be positioned separately.\n */\n @Prop({ reflect: true }) inline?: boolean = false;\n\n /**\n * The label to describe the purpose of the set of tabs to screen reader users.\n */\n @Prop() label!: string;\n\n /** @internal The appearance of the tab group, e.g dark, or light. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n @State() firstTabVisible: boolean = true;\n @State() lastTabVisible: boolean = false;\n @State() tabOverflow: boolean = false;\n\n private tabs: HTMLIcTabElement[];\n private tabOffsets: number[];\n private tabGroupEl: HTMLElement;\n private splitterEl: HTMLElement;\n private resizeObserver: ResizeObserver;\n private isScrolling: number;\n private scrollDelay: number;\n private buttonStateSet: boolean = false;\n\n /**\n * @internal if tab side scrolling enabled, scrolls the specified tab into view\n */\n @Method()\n async scrollTabIntoView(tabNumber: number): Promise<void> {\n this.firstTabVisible = tabNumber <= 0;\n const newScrollPos = tabNumber <= 0 ? 0 : this.tabOffsets[tabNumber - 1];\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + newScrollPos >= this.tabGroupEl.scrollWidth;\n this.buttonStateSet = true;\n this.tabGroupEl.scrollLeft = newScrollPos;\n }\n\n @Listen(\"tabFocus\")\n tabFocusHandler(event: CustomEvent<IcTabClickEventDetail>): void {\n if (this.tabOverflow) {\n this.scrollTabIntoView(event.detail.position);\n }\n }\n\n private resizeObserverCallback = () => {\n if (this.tabGroupEl === null || this.tabGroupEl === undefined) {\n this.tabGroupEl = this.host.shadowRoot.querySelector(\".tabs-container\");\n }\n this.tabOverflow = elementOverflowsX(this.tabGroupEl);\n if (this.tabOverflow) {\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.splitterEl);\n };\n\n private scrollLeft = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() - 1);\n };\n\n private scrollRight = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() + 1);\n };\n\n private longScrollRight = () => {\n this.scrollRight();\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private longScrollLeft = () => {\n this.scrollLeft();\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private leftArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private rightArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private arrowMouseUpHandler = () => {\n window.clearTimeout(this.scrollDelay);\n };\n\n private getCurrentLeftTab = (): number => {\n const index = this.tabOffsets.findIndex(\n (el) => el > this.tabGroupEl.scrollLeft\n );\n return index < 0 ? 0 : index;\n };\n\n private scrollHandler = () => {\n window.clearTimeout(this.isScrolling);\n // Set a timeout to run after scrolling ends\n this.isScrolling = window.setTimeout(this.scrollStopped, 50);\n };\n\n private scrollStopped = () => {\n // if scrollTabIntoView has been called, the button states will already be set\n // can't just handle it here as it causes strange jumping behaviour in positioning\n if (this.buttonStateSet === false) {\n this.firstTabVisible = this.tabGroupEl.scrollLeft === 0;\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n this.buttonStateSet = false;\n };\n\n componentDidLoad(): void {\n this.tabs = Array.from(this.host.querySelectorAll(\"ic-tab\"));\n let runningTotal = 0;\n this.tabOffsets = this.tabs.map((tab) => {\n runningTotal += tab.offsetWidth;\n return runningTotal;\n });\n checkResizeObserver(this.runResizeObserver);\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tab List\"\n );\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n inline,\n appearance,\n label,\n firstTabVisible,\n lastTabVisible,\n tabOverflow,\n } = this;\n\n return (\n <Host\n role=\"tablist\"\n aria-label={label}\n class={{\n [\"light\"]: appearance === IcThemeForegroundEnum.Light,\n [\"ic-tab-group-not-inline\"]: !inline,\n }}\n >\n <div class=\"ic-tab-group-container\">\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-left\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: firstTabVisible,\n }}\n >\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll left\"\n target=\"left-arrow\"\n >\n <span\n id=\"left-arrow\"\n class=\"scroll-arrow\"\n innerHTML={LeftArrow}\n onClick={this.scrollLeft}\n onMouseDown={this.leftArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n <span class=\"scroll-splitter-left\"></span>\n </div>\n )}\n <div\n class=\"tabs-container\"\n ref={(el) => (this.tabGroupEl = el)}\n onScroll={this.scrollHandler}\n >\n <slot></slot>\n </div>\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-right\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: lastTabVisible,\n }}\n >\n <span class=\"scroll-splitter-right\"></span>\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll right\"\n target=\"right-arrow\"\n >\n <span\n id=\"right-arrow\"\n class=\"scroll-arrow\"\n innerHTML={RightArrow}\n onClick={this.scrollRight}\n onMouseDown={this.rightArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n </div>\n )}\n </div>\n\n <div\n aria-hidden=\"true\"\n class={{\n [\"ic-tab-splitter\"]: true,\n [\"hidden\"]: inline,\n }}\n ref={(el) => (this.splitterEl = el)}\n ></div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["src/components/ic-tab-group/ic-tab-group.css?tag=ic-tab-group&encapsulation=shadow","src/components/ic-tab-group/ic-tab-group.tsx"],"names":["icTabGroupCss","SCROLL_DELAY_MS","TabGroup","this","buttonStateSet","resizeObserverCallback","tabGroupEl","undefined","host","shadowRoot","querySelector","tabOverflow","elementOverflowsX","lastTabVisible","offsetWidth","scrollLeft","scrollWidth","runResizeObserver","resizeObserver","ResizeObserver","observe","splitterEl","scrollTabIntoView","getCurrentLeftTab","scrollRight","longScrollRight","scrollDelay","window","setTimeout","longScrollLeft","leftArrowMouseDownHandler","rightArrowMouseDownHandler","arrowMouseUpHandler","clearTimeout","index","tabOffsets","findIndex","el","scrollHandler","isScrolling","scrollStopped","firstTabVisible","[object Object]","tabNumber","newScrollPos","event","detail","position","tabs","Array","from","querySelectorAll","runningTotal","map","tab","checkResizeObserver","onComponentRequiredPropUndefined","prop","label","propName","disconnect","inline","appearance","h","Host","role","aria-label","class","IcThemeForegroundEnum","Light","aria-hidden","id","placement","target","innerHTML","LeftArrow","onClick","onMouseDown","onMouseUp","ref","onScroll","RightArrow"],"mappings":"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","sourcesContent":[":host {\n --border-bottom-color: var(--ic-architectural-300);\n --splitter-color: var(--ic-architectural-100);\n --tab-scroll-focus: var(--ic-border-focus);\n --tab-scroll-fill: var(--ic-action-default);\n --tab-scroll-disabled-fill: var(--ic-architectural-300);\n --tab-scroll-hover: var(--ic-action-default-bg-hover);\n --tab-scroll-active: var(--ic-action-default-bg-active);\n\n display: block;\n margin-bottom: var(--ic-space-md);\n margin-left: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.light) {\n --splitter-color: var(--ic-architectural-white);\n --tab-scroll-focus: var(--ic-border-focus-dark);\n --tab-scroll-fill: var(--ic-action-light);\n --tab-scroll-disabled-fill: var(--ic-architectural-500);\n --tab-scroll-hover: var(--ic-action-dark-bg-hover);\n --tab-scroll-active: var(--ic-action-dark-bg-active);\n}\n\n:host([inline]) {\n margin-bottom: 0;\n}\n\n.tabs-container {\n display: flex;\n flex-direction: row;\n overflow-y: hidden;\n overflow-x: scroll;\n height: 100%;\n align-items: center;\n padding: var(--ic-space-xs);\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n margin: calc(-1 * var(--ic-space-xs)) 0;\n}\n\n.tabs-container::-webkit-scrollbar {\n display: none;\n}\n\n.ic-tab-group-container {\n display: flex;\n align-items: center;\n}\n\n:host(.light.ic-tab-group-not-inline) {\n --border-bottom-color: var(--ic-architectural-white);\n}\n\n.scroll-container {\n display: flex;\n}\n\n.scroll-container.hidden {\n display: none;\n}\n\n.scroll-container:first-child {\n margin-left: var(--ic-space-xs);\n}\n\n.scroll-arrow {\n display: flex;\n width: 36px;\n height: 36px;\n margin: var(--ic-space-xxs) var(--ic-space-xxxs);\n align-items: center;\n justify-content: center;\n fill: var(--tab-scroll-fill);\n cursor: pointer;\n}\n\n.scroll-arrow:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.scroll-arrow:hover {\n background-color: var(--tab-scroll-hover);\n}\n\n.scroll-arrow:active {\n background-color: var(--tab-scroll-active);\n}\n\n.scroll-container.disabled .scroll-arrow {\n fill: var(--tab-scroll-disabled-fill);\n cursor: default;\n}\n\n.scroll-container.disabled .scroll-arrow:hover,\n.scroll-container.disabled .scroll-arrow:active,\n.scroll-container.disabled .scroll-arrow:focus {\n background-color: unset;\n box-shadow: none;\n}\n\n.scroll-container.disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.scroll-splitter-left,\n.scroll-splitter-right {\n display: flex;\n height: var(--ic-space-lg);\n width: 1px;\n margin-top: 10px;\n background-color: var(--splitter-color);\n}\n\n.scroll-splitter-left {\n margin-left: var(--ic-space-xxxs);\n}\n\n.scroll-splitter-right {\n margin-right: var(--ic-space-xxxs);\n}\n\n.scroll-container.disabled .scroll-splitter-left,\n.scroll-container.disabled .scroll-splitter-right {\n display: none;\n}\n\n.ic-tab-splitter {\n display: block;\n background-color: var(--border-bottom-color);\n height: 1px;\n right: 0;\n left: 0;\n margin-left: var(--ic-space-xs);\n}\n\n.ic-tab-splitter.hidden {\n height: 0;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n State,\n Method,\n Listen,\n} from \"@stencil/core\";\n\nimport LeftArrow from \"./assets/left-arrow.svg\";\nimport RightArrow from \"./assets/right-arrow.svg\";\n\nimport {\n checkResizeObserver,\n elementOverflowsX,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\nimport { IcTabClickEventDetail } from \"../ic-tab/ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nconst SCROLL_DELAY_MS = 200;\n\n@Component({\n tag: \"ic-tab-group\",\n styleUrl: \"ic-tab-group.css\",\n shadow: true,\n})\nexport class TabGroup {\n @Element() host: HTMLIcTabGroupElement;\n\n /**\n * The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * If `true`, the tabs and tab panels will be positioned separately.\n */\n @Prop({ reflect: true }) inline?: boolean = false;\n\n /**\n * The label to describe the purpose of the set of tabs to screen reader users.\n */\n @Prop() label!: string;\n\n /** @internal The appearance of the tab group, e.g dark, or light. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n @State() firstTabVisible: boolean = true;\n @State() lastTabVisible: boolean = false;\n @State() tabOverflow: boolean = false;\n\n private tabs: HTMLIcTabElement[];\n private tabOffsets: number[];\n private tabGroupEl: HTMLElement;\n private splitterEl: HTMLElement;\n private resizeObserver: ResizeObserver;\n private isScrolling: number;\n private scrollDelay: number;\n private buttonStateSet: boolean = false;\n\n /**\n * @internal if tab side scrolling enabled, scrolls the specified tab into view\n */\n @Method()\n async scrollTabIntoView(tabNumber: number): Promise<void> {\n this.firstTabVisible = tabNumber <= 0;\n const newScrollPos = tabNumber <= 0 ? 0 : this.tabOffsets[tabNumber - 1];\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + newScrollPos >= this.tabGroupEl.scrollWidth;\n this.buttonStateSet = true;\n this.tabGroupEl.scrollLeft = newScrollPos;\n }\n\n @Listen(\"tabFocus\")\n tabFocusHandler(event: CustomEvent<IcTabClickEventDetail>): void {\n if (this.tabOverflow) {\n this.scrollTabIntoView(event.detail.position);\n }\n }\n\n private resizeObserverCallback = () => {\n if (this.tabGroupEl === null || this.tabGroupEl === undefined) {\n this.tabGroupEl = this.host.shadowRoot.querySelector(\".tabs-container\");\n }\n this.tabOverflow = elementOverflowsX(this.tabGroupEl);\n if (this.tabOverflow) {\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.splitterEl);\n };\n\n private scrollLeft = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() - 1);\n };\n\n private scrollRight = () => {\n this.scrollTabIntoView(this.getCurrentLeftTab() + 1);\n };\n\n private longScrollRight = () => {\n this.scrollRight();\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private longScrollLeft = () => {\n this.scrollLeft();\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private leftArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollLeft, SCROLL_DELAY_MS);\n };\n\n private rightArrowMouseDownHandler = () => {\n this.scrollDelay = window.setTimeout(this.longScrollRight, SCROLL_DELAY_MS);\n };\n\n private arrowMouseUpHandler = () => {\n window.clearTimeout(this.scrollDelay);\n };\n\n private getCurrentLeftTab = (): number => {\n const index = this.tabOffsets.findIndex(\n (el) => el > this.tabGroupEl.scrollLeft\n );\n return index < 0 ? 0 : index;\n };\n\n private scrollHandler = () => {\n window.clearTimeout(this.isScrolling);\n // Set a timeout to run after scrolling ends\n this.isScrolling = window.setTimeout(this.scrollStopped, 50);\n };\n\n private scrollStopped = () => {\n // if scrollTabIntoView has been called, the button states will already be set\n // can't just handle it here as it causes strange jumping behaviour in positioning\n if (this.buttonStateSet === false) {\n this.firstTabVisible = this.tabGroupEl.scrollLeft === 0;\n this.lastTabVisible =\n this.tabGroupEl.offsetWidth + this.tabGroupEl.scrollLeft >=\n this.tabGroupEl.scrollWidth;\n }\n this.buttonStateSet = false;\n };\n\n componentDidLoad(): void {\n this.tabs = Array.from(this.host.querySelectorAll(\"ic-tab\"));\n let runningTotal = 0;\n this.tabOffsets = this.tabs.map((tab) => {\n runningTotal += tab.offsetWidth;\n return runningTotal;\n });\n checkResizeObserver(this.runResizeObserver);\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tab Group\"\n );\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n inline,\n appearance,\n label,\n firstTabVisible,\n lastTabVisible,\n tabOverflow,\n } = this;\n\n return (\n <Host\n role=\"tablist\"\n aria-label={label}\n class={{\n [\"light\"]: appearance === IcThemeForegroundEnum.Light,\n [\"ic-tab-group-not-inline\"]: !inline,\n }}\n >\n <div class=\"ic-tab-group-container\">\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-left\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: firstTabVisible,\n }}\n >\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll left\"\n target=\"left-arrow\"\n >\n <span\n id=\"left-arrow\"\n class=\"scroll-arrow\"\n innerHTML={LeftArrow}\n onClick={this.scrollLeft}\n onMouseDown={this.leftArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n <span class=\"scroll-splitter-left\"></span>\n </div>\n )}\n <div\n class=\"tabs-container\"\n ref={(el) => (this.tabGroupEl = el)}\n onScroll={this.scrollHandler}\n >\n <slot></slot>\n </div>\n {this.tabOverflow && (\n <div\n aria-hidden=\"true\"\n id=\"scroll-container-right\"\n class={{\n [\"scroll-container\"]: true,\n [\"hidden\"]: !tabOverflow,\n [\"disabled\"]: lastTabVisible,\n }}\n >\n <span class=\"scroll-splitter-right\"></span>\n <ic-tooltip\n placement=\"bottom-start\"\n label=\"Scroll right\"\n target=\"right-arrow\"\n >\n <span\n id=\"right-arrow\"\n class=\"scroll-arrow\"\n innerHTML={RightArrow}\n onClick={this.scrollRight}\n onMouseDown={this.rightArrowMouseDownHandler}\n onMouseUp={this.arrowMouseUpHandler}\n ></span>\n </ic-tooltip>\n </div>\n )}\n </div>\n\n <div\n aria-hidden=\"true\"\n class={{\n [\"ic-tab-splitter\"]: true,\n [\"hidden\"]: inline,\n }}\n ref={(el) => (this.splitterEl = el)}\n ></div>\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as i,c as e,h as t,g as o}from"./p-f9370be6.js";import{a,i as s}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const n=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59L13.59 5L15 6.41L11.41 10L15 13.59Z" fill="currentColor"/>\n</svg>\n`;const r='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:inline-block}.chip{display:flex;padding:var(--ic-space-xxs);font-size:14px;border-radius:80px;text-align:center;align-items:center;text-decoration:none;transition:var(--ic-easing-transition-fast);position:relative}.chip.small{padding:var(--ic-space-xxxs)}.chip.large{padding:var(--ic-space-xs)}.label{padding:0 var(--ic-space-xs)}.chip.hovered:not(:focus-within){background-color:var(--ic-architectural-300)}.chip:focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);z-index:1}.chip.outline.hovered:not(:focus-within){background-color:var(--ic-action-dark-bg-hover)}ic-tooltip:focus-within{z-index:1}.filled{background-color:var(--ic-architectural-200);color:black;border:none}.filled.disabled{background-color:var(--ic-architectural-100)}.outline{color:var(--ic-architectural-900);border:1px solid var(--ic-architectural-900);padding:calc(var(--ic-space-xxs) - 1px)}.outline.small{padding:calc(var(--ic-space-xxxs) - 1px)}.outline.large{padding:calc(var(--ic-space-xs) - 1px)}.outline.disabled{border:var(--ic-border-disabled);background:none}.chip.disabled ic-typography{color:var(--ic-architectural-200)}.dismiss-icon{border:none;border-radius:50%;padding:0;background:none;cursor:pointer;margin:var(--ic-space-xxxs);height:20px}.dismiss-icon:focus{outline:var(--ic-hc-focus-outline)}.dismiss-icon[disabled]{pointer-events:none;color:var(--ic-architectural-200)}.icon{padding:var(--ic-space-xxxs);box-sizing:border-box}.icon,ic-tooltip{width:var(--ic-space-lg);height:var(--ic-space-lg)}.chip.disabled path,.chip.disabled ::slotted(svg){fill:var(--ic-architectural-200)}@media (forced-colors: active){.chip{border:var(--ic-hc-border)}.filled.small{padding:calc(var(--ic-space-xxxs) - 1px)}.filled{padding:calc(var(--ic-space-xxxs) + 1px)}.filled.large{padding:calc(var(--ic-space-xs) - 1px)}.chip.disabled{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.chip.disabled ic-typography{color:GrayText}.chip.disabled path,.chip.disabled ::slotted(svg){fill:GrayText}.chip:focus-within{outline:none;border-color:Highlight}}';const c=class{constructor(t){i(this,t);this.dismiss=e(this,"dismiss",7);this.dismissAction=()=>{this.dismiss.emit()};this.mouseEnterHandler=()=>{this.isHovered=true};this.mouseLeaveHandler=()=>{this.isHovered=false};this.label=undefined;this.appearance="filled";this.size="default";this.dismissible=false;this.disabled=false;this.visible=true;this.isHovered=false}handleClick(){this.visible=!this.visible}componentDidLoad(){var i;this.dismissible&&((i=this.el.shadowRoot.querySelector("span.ic-tooltip-label"))===null||i===void 0?void 0:i.setAttribute("aria-hidden","true"));a([{prop:this.label,propName:"label"}],"Chip")}render(){const{label:i,appearance:e,size:o,dismissible:a,visible:r,disabled:c,isHovered:l}=this;return r&&t("div",{class:{["chip"]:true,[`${e}`]:true,[`${o}`]:true,["disabled"]:c,["dismissible"]:a,["hovered"]:l}},s(this.el,"icon")&&t("div",{class:"icon"},t("slot",{name:"icon"})),t("ic-typography",{variant:"label","apply-vertical-margins":false,class:"label"},t("span",null,i)),a&&t("ic-tooltip",{label:"Dismiss",target:"dismiss-icon",class:{["tooltip-disabled"]:c}},t("button",{id:"dismiss-icon",class:{["dismiss-icon"]:true},"aria-label":`Dismiss ${i} chip`,disabled:c,tabindex:c?-1:0,onClick:this.dismissAction,onMouseEnter:this.mouseEnterHandler,onMouseLeave:this.mouseLeaveHandler,innerHTML:n})))}get el(){return o(this)}};c.style=r;export{c as ic_chip};
2
- //# sourceMappingURL=p-2ca96f69.entry.js.map
1
+ import{r as i,c as e,h as t,g as o}from"./p-f9370be6.js";import{a,i as s}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const n=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59L13.59 5L15 6.41L11.41 10L15 13.59Z" fill="currentColor"/>\n</svg>\n`;const r='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:inline-block}.chip{display:flex;padding:var(--ic-space-xxs);font-size:14px;border-radius:80px;text-align:center;align-items:center;text-decoration:none;transition:var(--ic-easing-transition-fast);position:relative}.chip.small{padding:var(--ic-space-xxxs)}.chip.large{padding:var(--ic-space-xs)}.label{padding:0 var(--ic-space-xs)}.chip.hovered:not(:focus-within){background-color:var(--ic-architectural-300)}.chip:focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);z-index:1}.chip.outline.hovered:not(:focus-within){background-color:var(--ic-action-dark-bg-hover)}ic-tooltip:focus-within{z-index:1}.filled{background-color:var(--ic-architectural-200);color:black;border:none}.filled.disabled{background-color:var(--ic-architectural-100)}.outline{color:var(--ic-architectural-900);border:1px solid var(--ic-architectural-900);padding:calc(var(--ic-space-xxs) - 1px)}.outline.small{padding:calc(var(--ic-space-xxxs) - 1px)}.outline.large{padding:calc(var(--ic-space-xs) - 1px)}.outline.disabled{border:var(--ic-border-disabled);background:none}.chip.disabled ic-typography{color:var(--ic-architectural-200)}.dismiss-icon{border:none;border-radius:50%;padding:0;background:none;cursor:pointer;margin:var(--ic-space-xxxs);height:20px}.dismiss-icon:focus{outline:var(--ic-hc-focus-outline)}.dismiss-icon[disabled]{pointer-events:none;color:var(--ic-architectural-200)}.icon{padding:var(--ic-space-xxxs);box-sizing:border-box}.icon,ic-tooltip{width:var(--ic-space-lg);height:var(--ic-space-lg)}.chip.disabled path,.chip.disabled ::slotted(svg){fill:var(--ic-architectural-200)}@media (forced-colors: active){.chip{border:var(--ic-hc-border)}.filled.small{padding:calc(var(--ic-space-xxxs) - 1px)}.filled{padding:calc(var(--ic-space-xxxs) + 1px)}.filled.large{padding:calc(var(--ic-space-xs) - 1px)}.chip.disabled{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.chip.disabled ic-typography{color:GrayText}.chip.disabled path,.chip.disabled ::slotted(svg){fill:GrayText}.chip:focus-within{outline:none;border-color:Highlight}}';const c=class{constructor(t){i(this,t);this.dismiss=e(this,"dismiss",7);this.icDismiss=e(this,"icDismiss",7);this.dismissAction=()=>{this.dismiss.emit();this.icDismiss.emit()};this.mouseEnterHandler=()=>{this.isHovered=true};this.mouseLeaveHandler=()=>{this.isHovered=false};this.label=undefined;this.appearance="filled";this.size="default";this.dismissible=false;this.disabled=false;this.visible=true;this.isHovered=false}handleClick(){this.visible=!this.visible}componentDidLoad(){var i;this.dismissible&&((i=this.el.shadowRoot.querySelector("span.ic-tooltip-label"))===null||i===void 0?void 0:i.setAttribute("aria-hidden","true"));a([{prop:this.label,propName:"label"}],"Chip")}render(){const{label:i,appearance:e,size:o,dismissible:a,visible:r,disabled:c,isHovered:l}=this;return r&&t("div",{class:{["chip"]:true,[`${e}`]:true,[`${o}`]:true,["disabled"]:c,["dismissible"]:a,["hovered"]:l}},s(this.el,"icon")&&t("div",{class:"icon"},t("slot",{name:"icon"})),t("ic-typography",{variant:"label","apply-vertical-margins":false,class:"label"},t("span",null,i)),a&&t("ic-tooltip",{label:"Dismiss",target:"dismiss-icon",class:{["tooltip-disabled"]:c}},t("button",{id:"dismiss-icon",class:{["dismiss-icon"]:true},"aria-label":`Dismiss ${i} chip`,disabled:c,tabindex:c?-1:0,onClick:this.dismissAction,onMouseEnter:this.mouseEnterHandler,onMouseLeave:this.mouseLeaveHandler,innerHTML:n})))}get el(){return o(this)}};c.style=r;export{c as ic_chip};
2
+ //# sourceMappingURL=p-6cb276c6.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["src/components/ic-chip/ic-chip.css?tag=ic-chip&encapsulation=shadow","src/components/ic-chip/ic-chip.tsx"],"names":["icChipCss","Chip","this","dismissAction","dismiss","emit","icDismiss","mouseEnterHandler","isHovered","mouseLeaveHandler","[object Object]","visible","dismissible","_a","el","shadowRoot","querySelector","setAttribute","onComponentRequiredPropUndefined","prop","label","propName","appearance","size","disabled","h","class","isSlotUsed","name","variant","apply-vertical-margins","target","id","aria-label","tabindex","onClick","onMouseEnter","onMouseLeave","innerHTML","dismissIcon"],"mappings":"qdAAA,MAAMA,EAAY,65ICyBLC,EAAI,qGA2CPC,KAAAC,cAAgB,KACtBD,KAAKE,QAAQC,OACbH,KAAKI,UAAUD,QAGTH,KAAAK,kBAAoB,KAC1BL,KAAKM,UAAY,MAGXN,KAAAO,kBAAoB,KAC1BP,KAAKM,UAAY,4CA3CqB,mBAIX,2BAIG,oBAIH,mBAED,oBAEE,MAG9BE,cACER,KAAKS,SAAWT,KAAKS,QA0BvBD,yBACER,KAAKU,eACHC,EAAAX,KAAKY,GAAGC,WACLC,cAAc,4BAAwB,MAAAH,SAAA,OAAA,EAAAA,EACrCI,aAAa,cAAe,SAClCC,EACE,CAAC,CAAEC,KAAMjB,KAAKkB,MAAOC,SAAU,UAC/B,QAIJX,SACE,MAAMU,MACJA,EAAKE,WACLA,EAAUC,KACVA,EAAIX,YACJA,EAAWD,QACXA,EAAOa,SACPA,EAAQhB,UACRA,GACEN,KAEJ,OACES,GACEc,EAAA,MAAA,CACEC,MAAO,CACLhB,CAAC,QAAS,KACVA,CAAC,GAAGY,KAAe,KACnBZ,CAAC,GAAGa,KAAS,KACbb,CAAC,YAAac,EACdd,CAAC,eAAgBE,EACjBF,CAAC,WAAYF,IAGdmB,EAAWzB,KAAKY,GAAI,SACnBW,EAAA,MAAA,CAAKC,MAAM,QACTD,EAAA,OAAA,CAAMG,KAAK,UAGfH,EAAA,gBAAA,CACEI,QAAQ,QAAOC,yBACS,MACxBJ,MAAM,SAEND,EAAA,OAAA,KAAOL,IAERR,GACCa,EAAA,aAAA,CACEL,MAAM,UACNW,OAAO,eACPL,MAAO,CAAEhB,CAAC,oBAAqBc,IAE/BC,EAAA,SAAA,CACEO,GAAG,eACHN,MAAO,CACLhB,CAAC,gBAAiB,MACnBuB,aACW,WAAWb,SACvBI,SAAUA,EACVU,SAAUV,GAAY,EAAI,EAC1BW,QAASjC,KAAKC,cACdiC,aAAclC,KAAKK,kBACnB8B,aAAcnC,KAAKO,kBACnB6B,UAAWC","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: inline-block;\n}\n\n.chip {\n display: flex;\n padding: var(--ic-space-xxs);\n font-size: 14px;\n border-radius: 80px;\n text-align: center;\n align-items: center;\n text-decoration: none;\n transition: var(--ic-easing-transition-fast);\n position: relative;\n}\n\n.chip.small {\n padding: var(--ic-space-xxxs);\n}\n\n.chip.large {\n padding: var(--ic-space-xs);\n}\n\n.label {\n padding: 0 var(--ic-space-xs);\n}\n\n.chip.hovered:not(:focus-within) {\n background-color: var(--ic-architectural-300);\n}\n\n.chip:focus-within {\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n z-index: 1;\n}\n\n.chip.outline.hovered:not(:focus-within) {\n background-color: var(--ic-action-dark-bg-hover);\n}\n\nic-tooltip:focus-within {\n z-index: 1;\n}\n\n.filled {\n background-color: var(--ic-architectural-200);\n color: black;\n border: none;\n}\n\n.filled.disabled {\n background-color: var(--ic-architectural-100);\n}\n\n.outline {\n color: var(--ic-architectural-900);\n border: 1px solid var(--ic-architectural-900);\n padding: calc(var(--ic-space-xxs) - 1px);\n}\n\n.outline.small {\n padding: calc(var(--ic-space-xxxs) - 1px);\n}\n\n.outline.large {\n padding: calc(var(--ic-space-xs) - 1px);\n}\n\n.outline.disabled {\n border: var(--ic-border-disabled);\n background: none;\n}\n\n.chip.disabled ic-typography {\n color: var(--ic-architectural-200);\n}\n\n.dismiss-icon {\n border: none;\n border-radius: 50%;\n padding: 0;\n background: none;\n cursor: pointer;\n margin: var(--ic-space-xxxs);\n height: 20px;\n}\n\n.dismiss-icon:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.dismiss-icon[disabled] {\n pointer-events: none;\n color: var(--ic-architectural-200);\n}\n\n.icon {\n padding: var(--ic-space-xxxs);\n box-sizing: border-box;\n}\n\n.icon,\nic-tooltip {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n.chip.disabled path,\n.chip.disabled ::slotted(svg) {\n fill: var(--ic-architectural-200);\n}\n\n@media (forced-colors: active) {\n .chip {\n border: var(--ic-hc-border);\n }\n\n .filled.small {\n padding: calc(var(--ic-space-xxxs) - 1px);\n }\n\n .filled {\n padding: calc(var(--ic-space-xxxs) + 1px);\n }\n\n .filled.large {\n padding: calc(var(--ic-space-xs) - 1px);\n }\n\n .chip.disabled {\n appearance: none;\n border-color: GrayText;\n }\n\n .chip.disabled ic-typography {\n color: GrayText;\n }\n\n .chip.disabled path,\n .chip.disabled ::slotted(svg) {\n fill: GrayText;\n }\n\n .chip:focus-within {\n outline: none;\n border-color: Highlight;\n }\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Element,\n} from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport { IcChipAppearance, IcChipSizes } from \"./ic-chip.types\";\nimport dismissIcon from \"../../assets/dismiss-icon.svg\";\n\n/**\n * @slot icon - Content will be rendered at the start of the chip.\n */\n@Component({\n tag: \"ic-chip\",\n styleUrl: \"ic-chip.css\",\n shadow: true,\n})\nexport class Chip {\n @Element() el: HTMLIcChipElement;\n\n /**\n * The text rendered within the chip.\n */\n @Prop() label!: string;\n /**\n * The emphasis of the chip.\n */\n @Prop() appearance?: IcChipAppearance = \"filled\";\n /**\n * The size of the chip.\n */\n @Prop() size?: IcChipSizes = \"default\";\n /**\n * If `true`, the chip will have a close button at the end to dismiss it.\n */\n @Prop() dismissible?: boolean = false;\n /**\n * If `true`, the chip will appear disabled.\n */\n @Prop() disabled?: boolean = false;\n\n @State() visible: boolean = true;\n\n @State() isHovered: boolean = false;\n\n @Listen(\"icDismiss\", { capture: true })\n handleClick(): void {\n this.visible = !this.visible;\n }\n\n /**\n * @deprecated This event should not be used anymore. Use icDismiss instead.\n */\n @Event() dismiss: EventEmitter<void>;\n\n /**\n * Is emitted when the user dismisses the chip.\n */\n @Event() icDismiss: EventEmitter<void>;\n\n private dismissAction = (): void => {\n this.dismiss.emit();\n this.icDismiss.emit();\n };\n\n private mouseEnterHandler = (): void => {\n this.isHovered = true;\n };\n\n private mouseLeaveHandler = (): void => {\n this.isHovered = false;\n };\n\n componentDidLoad(): void {\n this.dismissible &&\n this.el.shadowRoot\n .querySelector(\"span.ic-tooltip-label\")\n ?.setAttribute(\"aria-hidden\", \"true\");\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Chip\"\n );\n }\n\n render() {\n const {\n label,\n appearance,\n size,\n dismissible,\n visible,\n disabled,\n isHovered,\n } = this;\n\n return (\n visible && (\n <div\n class={{\n [\"chip\"]: true,\n [`${appearance}`]: true,\n [`${size}`]: true,\n [\"disabled\"]: disabled,\n [\"dismissible\"]: dismissible,\n [\"hovered\"]: isHovered,\n }}\n >\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography\n variant=\"label\"\n apply-vertical-margins={false}\n class=\"label\"\n >\n <span>{label}</span>\n </ic-typography>\n {dismissible && (\n <ic-tooltip\n label=\"Dismiss\"\n target=\"dismiss-icon\"\n class={{ [\"tooltip-disabled\"]: disabled }}\n >\n <button\n id=\"dismiss-icon\"\n class={{\n [\"dismiss-icon\"]: true,\n }}\n aria-label={`Dismiss ${label} chip`}\n disabled={disabled}\n tabindex={disabled ? -1 : 0}\n onClick={this.dismissAction}\n onMouseEnter={this.mouseEnterHandler}\n onMouseLeave={this.mouseLeaveHandler}\n innerHTML={dismissIcon}\n ></button>\n </ic-tooltip>\n )}\n </div>\n )\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as t,h as e,H as i,g as a}from"./p-f9370be6.js";import{g as s,D as n,c as o,i as r}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const l='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}:host(.sticky){position:sticky;top:0;box-shadow:var(--ic-elevation-overlay)}header{background-color:var(--ic-architectural-40)}header.border-bottom{border-bottom:1px solid var(--ic-architectural-300)}header.tabs{padding-top:var(--ic-space-md)}.breadcrumb-area{margin-bottom:var(--ic-space-md)}.main-content{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"title-area action-area"\n "input-area action-area";-moz-column-gap:var(--ic-space-md);column-gap:var(--ic-space-md);justify-content:space-between;width:100%}.title-area{display:flex;flex-direction:column;flex:1;min-width:304px;grid-area:title-area}.header-content{display:flex;align-items:center;width:100%;flex-wrap:wrap;row-gap:var(--ic-space-xs);-moz-column-gap:var(--ic-space-md);column-gap:var(--ic-space-md)}.heading{display:inline-block;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}.subheading.small{margin-top:var(--ic-space-xs)}.action-area{display:flex;gap:var(--ic-space-md);flex-flow:row wrap;justify-self:end;justify-content:flex-end;height:-moz-fit-content;height:fit-content;grid-area:action-area}.input-area,.navigation-area{margin-top:var(--ic-space-md);width:100%}.tabs-slot{display:flex;overflow-x:auto;padding:8px;margin:-8px}.input-area{grid-area:input-area}@media screen and (max-width: 576px){::slotted(ic-text-field){--input-width:100%;max-width:320px}.main-content{grid-template-areas:"title-area"\n "action-area"\n "input-area";justify-content:flex-start}.title-area{min-width:0}.action-area{min-width:100%;margin-top:var(--ic-space-md);justify-content:start}}@media screen and (min-width: 992px){:host(.sticky-desktop){position:sticky;top:0;box-shadow:var(--ic-elevation-overlay)}}';const d=class{constructor(e){t(this,e);this.resizeObserver=null;this.resizeObserverCallback=()=>{if(this.reverseOrder){this.applyReverseOrder()}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.el)};this.applyReverseOrder=()=>{const t=s();if(t!==this.deviceSize){this.deviceSize=t}const e=this.el.shadowRoot.querySelector("div.action-area");const i=[];for(let t=0;t<this.actionContent.length;t++){const e=this.actionContent[t];let a=e.offsetHeight;if(a===undefined){a=0}i.push(a)}const a=Math.max(...i);let o=e.offsetHeight;if(o===undefined){o=0}if(this.deviceSize>n.S&&o<=a&&!this.areButtonsReversed){this.actionContent=this.actionContent.reverse();this.actionContent.forEach((t=>{this.el.append(t)}));this.areButtonsReversed=!this.areButtonsReversed}else if((this.deviceSize>n.S&&o>a||this.deviceSize<=n.S)&&this.areButtonsReversed){this.actionContent=this.actionContent.reverse();this.actionContent.forEach((t=>{this.el.append(t)}));this.areButtonsReversed=!this.areButtonsReversed}};this.heading=undefined;this.subheading=undefined;this.aligned="left";this.small=false;this.border=true;this.sticky=false;this.stickyDesktopOnly=false;this.reverseOrder=false;this.deviceSize=n.XL;this.areButtonsReversed=false;this.actionContent=undefined}componentWillLoad(){this.actionContent=Array.from(this.el.querySelectorAll(`[slot="actions"]`))}componentDidLoad(){o(this.runResizeObserver)}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}render(){const{small:t,border:a,heading:s,subheading:n,aligned:o,sticky:l,stickyDesktopOnly:d}=this;return e(i,{class:{["sticky"]:l,["sticky-desktop"]:!l&&d}},e("header",{class:{["border-bottom"]:a,["tabs"]:r(this.el,"tabs")}},e("ic-section-container",{aligned:o,fullHeight:r(this.el,"tabs")},r(this.el,"breadcrumbs")&&e("div",{class:"breadcrumb-area"},e("slot",{name:"breadcrumbs"})),e("div",{class:"main-content"},e("div",{class:"title-area"},e("div",{class:"header-content"},e("slot",{name:"heading"},e("ic-typography",{variant:t?"h4":"h2",class:"heading"},e("h2",null,s))),e("slot",{name:"heading-adornment"})),e("div",null,e("slot",{name:"subheading"},n&&e("ic-typography",{variant:"body",class:{["subheading"]:true,["small"]:t}},n)))),r(this.el,"actions")&&e("div",{class:"action-area"},e("slot",{name:"actions"})),r(this.el,"input")&&e("div",{class:"input-area"},e("slot",{name:"input"}))),(r(this.el,"stepper")||r(this.el,"tabs"))&&e("div",{class:"navigation-area"},r(this.el,"stepper")&&!r(this.el,"tabs")&&e("slot",{name:"stepper"}),r(this.el,"tabs")&&e("nav",{class:"tabs-slot","aria-label":"navigation-landmark-page-header"},e("slot",{name:"tabs"}))))))}get el(){return a(this)}};d.style=l;export{d as ic_page_header};
2
- //# sourceMappingURL=p-217fa7de.entry.js.map
1
+ import{r as t,h as e,H as i,g as a}from"./p-f9370be6.js";import{i as s,g as n,D as o,c as r}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const l='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}:host(.sticky){position:sticky;top:0;box-shadow:var(--ic-elevation-overlay)}header{background-color:var(--ic-architectural-40)}header.border-bottom{border-bottom:1px solid var(--ic-architectural-300)}header.tabs{padding-top:var(--ic-space-md)}.breadcrumb-area{margin-bottom:var(--ic-space-md)}.main-content{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"title-area action-area"\n "input-area action-area";-moz-column-gap:var(--ic-space-md);column-gap:var(--ic-space-md);justify-content:space-between;width:100%}.title-area{display:flex;flex-direction:column;flex:1;min-width:304px;grid-area:title-area}.header-content{display:flex;align-items:center;width:100%;flex-wrap:wrap;row-gap:var(--ic-space-xs);-moz-column-gap:var(--ic-space-md);column-gap:var(--ic-space-md)}.heading{display:inline-block;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}.subheading.small{margin-top:var(--ic-space-xs)}.action-area{display:flex;gap:var(--ic-space-md);flex-flow:row wrap;justify-self:end;justify-content:flex-end;height:-moz-fit-content;height:fit-content;grid-area:action-area}.input-area,.navigation-area{margin-top:var(--ic-space-md);width:100%}.tabs-slot{display:flex;overflow-x:auto;padding:8px;margin:-8px}.input-area{grid-area:input-area}@media screen and (max-width: 576px){::slotted(ic-text-field){--input-width:100%;max-width:320px}.main-content{grid-template-areas:"title-area"\n "action-area"\n "input-area";justify-content:flex-start}.title-area{min-width:0}.action-area{min-width:100%;margin-top:var(--ic-space-md);justify-content:start}}@media screen and (min-width: 992px){:host(.sticky-desktop){position:sticky;top:0;box-shadow:var(--ic-elevation-overlay)}}';const d=class{constructor(e){t(this,e);this.resizeObserver=null;this.resizeObserverCallback=()=>{if(this.reverseOrder&&s(this.el,"actions")){this.applyReverseOrder()}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.resizeObserverCallback()}));this.resizeObserver.observe(this.el)};this.applyReverseOrder=()=>{const t=n();if(t!==this.deviceSize){this.deviceSize=t}const e=this.el.shadowRoot.querySelector("div.action-area");const i=[];for(let t=0;t<this.actionContent.length;t++){const e=this.actionContent[t];let a=e.offsetHeight;if(a===undefined){a=0}i.push(a)}const a=Math.max(...i);let s=e.offsetHeight;if(s===undefined){s=0}if(this.deviceSize>o.S&&s<=a&&!this.areButtonsReversed){this.actionContent=this.actionContent.reverse();this.actionContent.forEach((t=>{this.el.append(t)}));this.areButtonsReversed=!this.areButtonsReversed}else if((this.deviceSize>o.S&&s>a||this.deviceSize<=o.S)&&this.areButtonsReversed){this.actionContent=this.actionContent.reverse();this.actionContent.forEach((t=>{this.el.append(t)}));this.areButtonsReversed=!this.areButtonsReversed}};this.heading=undefined;this.subheading=undefined;this.aligned="left";this.small=false;this.border=true;this.sticky=false;this.stickyDesktopOnly=false;this.reverseOrder=false;this.deviceSize=o.XL;this.areButtonsReversed=false;this.actionContent=undefined}componentWillLoad(){this.actionContent=Array.from(this.el.querySelectorAll(`[slot="actions"]`))}componentDidLoad(){r(this.runResizeObserver)}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}render(){const{small:t,border:a,heading:n,subheading:o,aligned:r,sticky:l,stickyDesktopOnly:d}=this;return e(i,{class:{["sticky"]:l,["sticky-desktop"]:!l&&d}},e("header",{class:{["border-bottom"]:a,["tabs"]:s(this.el,"tabs")}},e("ic-section-container",{aligned:r,fullHeight:s(this.el,"tabs")},s(this.el,"breadcrumbs")&&e("div",{class:"breadcrumb-area"},e("slot",{name:"breadcrumbs"})),e("div",{class:"main-content"},e("div",{class:"title-area"},e("div",{class:"header-content"},e("slot",{name:"heading"},e("ic-typography",{variant:t?"h4":"h2",class:"heading"},e("h2",null,n))),e("slot",{name:"heading-adornment"})),e("div",null,e("slot",{name:"subheading"},o&&e("ic-typography",{variant:"body",class:{["subheading"]:true,["small"]:t}},o)))),s(this.el,"actions")&&e("div",{class:"action-area"},e("slot",{name:"actions"})),s(this.el,"input")&&e("div",{class:"input-area"},e("slot",{name:"input"}))),(s(this.el,"stepper")||s(this.el,"tabs"))&&e("div",{class:"navigation-area"},s(this.el,"stepper")&&!s(this.el,"tabs")&&e("slot",{name:"stepper"}),s(this.el,"tabs")&&e("nav",{class:"tabs-slot","aria-label":"navigation-landmark-page-header"},e("slot",{name:"tabs"}))))))}get el(){return a(this)}};d.style=l;export{d as ic_page_header};
2
+ //# sourceMappingURL=p-9020d1ff.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["src/components/ic-page-header/ic-page-header.css?tag=ic-page-header&encapsulation=shadow","src/components/ic-page-header/ic-page-header.tsx"],"names":["icPageHeaderCss","PageHeader","this","resizeObserver","resizeObserverCallback","reverseOrder","isSlotUsed","el","applyReverseOrder","runResizeObserver","ResizeObserver","observe","currSize","getCurrentDeviceSize","deviceSize","actionArea","shadowRoot","querySelector","actionHeights","i","actionContent","length","action","actionHeight","offsetHeight","undefined","push","max","Math","actionAreaHeight","DEVICE_SIZES","S","areButtonsReversed","reverse","forEach","btn","append","XL","[object Object]","Array","from","querySelectorAll","checkResizeObserver","disconnect","small","border","heading","subheading","aligned","sticky","stickyDesktopOnly","h","Host","class","fullHeight","name","variant","aria-label"],"mappings":"0IAAA,MAAMA,EAAkB,yiIC2BXC,EAAU,+BAyCbC,KAAAC,eAAiC,KAEjCD,KAAAE,uBAAyB,KAC/B,GAAIF,KAAKG,cAAgBC,EAAWJ,KAAKK,GAAI,WAAY,CACvDL,KAAKM,sBAIDN,KAAAO,kBAAoB,KAC1BP,KAAKC,eAAiB,IAAIO,gBAAe,KACvCR,KAAKE,4BAEPF,KAAKC,eAAeQ,QAAQT,KAAKK,KAG3BL,KAAAM,kBAAoB,KAC1B,MAAMI,EAAWC,IACjB,GAAID,IAAaV,KAAKY,WAAY,CAChCZ,KAAKY,WAAaF,EAGpB,MAAMG,EAAab,KAAKK,GAAGS,WAAWC,cACpC,mBAEF,MAAMC,EAA0B,GAGhC,IAAK,IAAIC,EAAI,EAAGA,EAAIjB,KAAKkB,cAAcC,OAAQF,IAAK,CAClD,MAAMG,EAASpB,KAAKkB,cAAcD,GAClC,IAAII,EAAeD,EAAOE,aAC1B,GAAID,IAAiBE,UAAW,CAC9BF,EAAe,EAEjBL,EAAcQ,KAAKH,GAGrB,MAAMI,EAAMC,KAAKD,OAAOT,GAGxB,IAAIW,EAAmBd,EAAWS,aAElC,GAAIK,IAAqBJ,UAAW,CAClCI,EAAmB,EAGrB,GACE3B,KAAKY,WAAagB,EAAaC,GAC/BF,GAAoBF,IACnBzB,KAAK8B,mBACN,CACA9B,KAAKkB,cAAgBlB,KAAKkB,cAAca,UACxC/B,KAAKkB,cAAcc,SAASC,IAC1BjC,KAAKK,GAAG6B,OAAOD,MAEjBjC,KAAK8B,oBAAsB9B,KAAK8B,wBAC3B,IACH9B,KAAKY,WAAagB,EAAaC,GAAKF,EAAmBF,GACvDzB,KAAKY,YAAcgB,EAAaC,IAClC7B,KAAK8B,mBACL,CACA9B,KAAKkB,cAAgBlB,KAAKkB,cAAca,UACxC/B,KAAKkB,cAAcc,SAASC,IAC1BjC,KAAKK,GAAG6B,OAAOD,MAEjBjC,KAAK8B,oBAAsB9B,KAAK8B,mFA5FJ,kBAIN,kBAIC,iBAIA,6BAIW,wBAIL,sBAEHF,EAAaO,2BAEJ,mCAwEvCC,oBACEpC,KAAKkB,cAAgBmB,MAAMC,KACzBtC,KAAKK,GAAGkC,iBAAiB,qBAI7BH,mBACEI,EAAoBxC,KAAKO,mBAG3B6B,uBACE,GAAIpC,KAAKC,iBAAmB,KAAM,CAChCD,KAAKC,eAAewC,cAIxBL,SACE,MAAMM,MACJA,EAAKC,OACLA,EAAMC,QACNA,EAAOC,WACPA,EAAUC,QACVA,EAAOC,OACPA,EAAMC,kBACNA,GACEhD,KAEJ,OACEiD,EAACC,EAAI,CACHC,MAAO,CACLf,CAAC,UAAWW,EACZX,CAAC,mBAAoBW,GAAUC,IAGjCC,EAAA,SAAA,CACEE,MAAO,CACLf,CAAC,iBAAkBO,EACnBP,CAAC,QAAShC,EAAWJ,KAAKK,GAAI,UAGhC4C,EAAA,uBAAA,CACEH,QAASA,EACTM,WAAYhD,EAAWJ,KAAKK,GAAI,SAE/BD,EAAWJ,KAAKK,GAAI,gBACnB4C,EAAA,MAAA,CAAKE,MAAM,mBACTF,EAAA,OAAA,CAAMI,KAAK,iBAGfJ,EAAA,MAAA,CAAKE,MAAM,gBACTF,EAAA,MAAA,CAAKE,MAAM,cACTF,EAAA,MAAA,CAAKE,MAAM,kBACTF,EAAA,OAAA,CAAMI,KAAK,WACTJ,EAAA,gBAAA,CACEK,QAASZ,EAAQ,KAAO,KACxBS,MAAM,WAENF,EAAA,KAAA,KAAKL,KAGTK,EAAA,OAAA,CAAMI,KAAK,uBAEbJ,EAAA,MAAA,KACEA,EAAA,OAAA,CAAMI,KAAK,cACRR,GACCI,EAAA,gBAAA,CACEK,QAAQ,OACRH,MAAO,CAAEf,CAAC,cAAe,KAAMA,CAAC,SAAUM,IAEzCG,MAMVzC,EAAWJ,KAAKK,GAAI,YACnB4C,EAAA,MAAA,CAAKE,MAAM,eACTF,EAAA,OAAA,CAAMI,KAAK,aAGdjD,EAAWJ,KAAKK,GAAI,UACnB4C,EAAA,MAAA,CAAKE,MAAM,cACTF,EAAA,OAAA,CAAMI,KAAK,aAKfjD,EAAWJ,KAAKK,GAAI,YACpBD,EAAWJ,KAAKK,GAAI,UACpB4C,EAAA,MAAA,CAAKE,MAAM,mBACR/C,EAAWJ,KAAKK,GAAI,aAClBD,EAAWJ,KAAKK,GAAI,SAAW4C,EAAA,OAAA,CAAMI,KAAK,YAC5CjD,EAAWJ,KAAKK,GAAI,SACnB4C,EAAA,MAAA,CACEE,MAAM,YAAWI,aACN,mCAEXN,EAAA,OAAA,CAAMI,KAAK","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\n:host(.sticky) {\n position: sticky;\n top: 0;\n box-shadow: var(--ic-elevation-overlay);\n}\n\nheader {\n background-color: var(--ic-architectural-40);\n}\n\nheader.border-bottom {\n border-bottom: 1px solid var(--ic-architectural-300);\n}\n\nheader.tabs {\n padding-top: var(--ic-space-md);\n}\n\n.breadcrumb-area {\n margin-bottom: var(--ic-space-md);\n}\n\n.main-content {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-areas:\n \"title-area action-area\"\n \"input-area action-area\";\n column-gap: var(--ic-space-md);\n justify-content: space-between;\n width: 100%;\n}\n\n.title-area {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 304px;\n grid-area: title-area;\n}\n\n.header-content {\n display: flex;\n align-items: center;\n width: 100%;\n flex-wrap: wrap;\n row-gap: var(--ic-space-xs);\n column-gap: var(--ic-space-md);\n}\n\n.heading {\n display: inline-block;\n overflow-wrap: break-word;\n hyphens: auto;\n}\n\n.subheading.small {\n margin-top: var(--ic-space-xs);\n}\n\n.action-area {\n display: flex;\n gap: var(--ic-space-md);\n flex-flow: row wrap;\n justify-self: end;\n justify-content: flex-end;\n height: fit-content;\n grid-area: action-area;\n}\n\n.input-area,\n.navigation-area {\n margin-top: var(--ic-space-md);\n width: 100%;\n}\n\n.tabs-slot {\n display: flex;\n overflow-x: auto;\n padding: 8px;\n margin: -8px;\n}\n\n.input-area {\n grid-area: input-area;\n}\n\n@media screen and (max-width: 576px) {\n ::slotted(ic-text-field) {\n --input-width: 100%;\n\n max-width: 320px;\n }\n\n .main-content {\n grid-template-areas:\n \"title-area\"\n \"action-area\"\n \"input-area\";\n justify-content: flex-start;\n }\n\n .title-area {\n min-width: 0;\n }\n\n .action-area {\n min-width: 100%;\n margin-top: var(--ic-space-md);\n justify-content: start;\n }\n}\n\n@media screen and (min-width: 992px) {\n :host(.sticky-desktop) {\n position: sticky;\n top: 0;\n box-shadow: var(--ic-elevation-overlay);\n }\n}\n","import { Component, Host, h, Prop, Element, State } from \"@stencil/core\";\n\nimport { IcAlignment } from \"../../utils/types\";\n\nimport {\n isSlotUsed,\n DEVICE_SIZES,\n getCurrentDeviceSize,\n checkResizeObserver,\n} from \"../../utils/helpers\";\n\n/**\n * @slot breadcrumbs - Content will be rendered in the breadcrumb area, above the title and action areas.\n * @slot heading - Content will be rendered in the title area, in place of the heading.\n * @slot subheading - Content will be rendered in the title area, in place of the subheading.\n * @slot heading-adornment - Content will be rendered in the title area, adjacent to the heading.\n * @slot actions - Content will be rendered in the action area, adjacent to the title area.\n * @slot input - Content will be rendered in the input area, below the title area and adjacent to the action area.\n * @slot stepper - Content will be rendered in the navigation area, below the title and action areas. Note: stepper slot cannot be used when the tabs slot is being used.\n * @slot tabs - Content will be rendered in the navigation area, below the title and action areas. Note: the stepper slot cannot be used when the tabs slot is being used.\n */\n\n@Component({\n tag: \"ic-page-header\",\n styleUrl: \"ic-page-header.css\",\n shadow: true,\n})\nexport class PageHeader {\n @Element() el: HTMLIcPageHeaderElement;\n /**\n * The title to render on the page header.\n */\n @Prop() heading?: string;\n /**\n * The subtitle to render on the page header.\n */\n @Prop() subheading?: string;\n /**\n * The alignment of the page header.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n /**\n * If `true`, the small styling will be applied to the page header.\n */\n @Prop() small?: boolean = false;\n /**\n * If `true`, a border will be displayed along the bottom of the page header.\n */\n @Prop() border?: boolean = true;\n /**\n * If `true`, the page header will be sticky at all breakpoints.\n */\n @Prop() sticky?: boolean = false;\n /**\n * If `true`, the page header will only be sticky for viewport widths of 992px and above.\n */\n @Prop() stickyDesktopOnly?: boolean = false;\n /**\n * If `true`, the reading pattern and tab order will change in the action area for viewport widths of above 576px and when actions have not wrapped.\n */\n @Prop() reverseOrder?: boolean = false;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n\n @State() areButtonsReversed: boolean = false;\n\n @State() actionContent: Node[];\n\n private resizeObserver: ResizeObserver = null;\n\n private resizeObserverCallback = () => {\n if (this.reverseOrder && isSlotUsed(this.el, \"actions\")) {\n this.applyReverseOrder();\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.el);\n };\n\n private applyReverseOrder = (): void => {\n const currSize = getCurrentDeviceSize();\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n\n const actionArea = this.el.shadowRoot.querySelector(\n \"div.action-area\"\n ) as HTMLElement;\n const actionHeights: number[] = [];\n\n /* For each button in the actions slot, check the height of the button and push this number into the actionHeights array and then find the greatest number in this array (i.e. find the height of the tallest button) */\n for (let i = 0; i < this.actionContent.length; i++) {\n const action = this.actionContent[i] as HTMLElement;\n let actionHeight = action.offsetHeight;\n if (actionHeight === undefined) {\n actionHeight = 0;\n }\n actionHeights.push(actionHeight);\n }\n\n const max = Math.max(...actionHeights);\n\n /* The smallest breakpoint displays buttons in the same order the user has slotted them in. When the device size is larger than the small breakpoiint then the order of the button reverses due to best practice for reading patterns. If the device size is larger than the small breakpoint and the buttons have started to wrap then they follow the order the user has slotted them in. This logic is programmed based on the height of the action-area div that wraps the actions slot. If the height of the action-area div is taller than the height of the tallest button, then it is assumed that the taller height is caused by the buttons wrapping */\n let actionAreaHeight = actionArea.offsetHeight;\n\n if (actionAreaHeight === undefined) {\n actionAreaHeight = 0;\n }\n\n if (\n this.deviceSize > DEVICE_SIZES.S &&\n actionAreaHeight <= max &&\n !this.areButtonsReversed\n ) {\n this.actionContent = this.actionContent.reverse();\n this.actionContent.forEach((btn: string | Node) => {\n this.el.append(btn);\n });\n this.areButtonsReversed = !this.areButtonsReversed;\n } else if (\n ((this.deviceSize > DEVICE_SIZES.S && actionAreaHeight > max) ||\n this.deviceSize <= DEVICE_SIZES.S) &&\n this.areButtonsReversed\n ) {\n this.actionContent = this.actionContent.reverse();\n this.actionContent.forEach((btn: string | Node) => {\n this.el.append(btn);\n });\n this.areButtonsReversed = !this.areButtonsReversed;\n }\n };\n\n componentWillLoad(): void {\n this.actionContent = Array.from(\n this.el.querySelectorAll(`[slot=\"actions\"]`)\n );\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n const {\n small,\n border,\n heading,\n subheading,\n aligned,\n sticky,\n stickyDesktopOnly,\n } = this;\n\n return (\n <Host\n class={{\n [\"sticky\"]: sticky,\n [\"sticky-desktop\"]: !sticky && stickyDesktopOnly,\n }}\n >\n <header\n class={{\n [\"border-bottom\"]: border,\n [\"tabs\"]: isSlotUsed(this.el, \"tabs\"),\n }}\n >\n <ic-section-container\n aligned={aligned}\n fullHeight={isSlotUsed(this.el, \"tabs\")}\n >\n {isSlotUsed(this.el, \"breadcrumbs\") && (\n <div class=\"breadcrumb-area\">\n <slot name=\"breadcrumbs\" />\n </div>\n )}\n <div class=\"main-content\">\n <div class=\"title-area\">\n <div class=\"header-content\">\n <slot name=\"heading\">\n <ic-typography\n variant={small ? \"h4\" : \"h2\"}\n class=\"heading\"\n >\n <h2>{heading}</h2>\n </ic-typography>\n </slot>\n <slot name=\"heading-adornment\" />\n </div>\n <div>\n <slot name=\"subheading\">\n {subheading && (\n <ic-typography\n variant=\"body\"\n class={{ [\"subheading\"]: true, [\"small\"]: small }}\n >\n {subheading}\n </ic-typography>\n )}\n </slot>\n </div>\n </div>\n {isSlotUsed(this.el, \"actions\") && (\n <div class=\"action-area\">\n <slot name=\"actions\" />\n </div>\n )}\n {isSlotUsed(this.el, \"input\") && (\n <div class=\"input-area\">\n <slot name=\"input\" />\n </div>\n )}\n </div>\n\n {(isSlotUsed(this.el, \"stepper\") ||\n isSlotUsed(this.el, \"tabs\")) && (\n <div class=\"navigation-area\">\n {isSlotUsed(this.el, \"stepper\") &&\n !isSlotUsed(this.el, \"tabs\") && <slot name=\"stepper\" />}\n {isSlotUsed(this.el, \"tabs\") && (\n <nav\n class=\"tabs-slot\"\n aria-label=\"navigation-landmark-page-header\"\n >\n <slot name=\"tabs\" />\n </nav>\n )}\n </div>\n )}\n </ic-section-container>\n </header>\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as e,h as t,H as i,g as o}from"./p-f9370be6.js";import{D as a,g as n,s,c as l}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const r='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:relative;display:block}.data{display:flex;align-items:center}.text-cells{display:flex;flex-grow:1;min-width:0}.label{width:200px;min-width:200px;margin-right:var(--ic-space-md);color:var(--ic-color-tertiary-text)}.value{flex-grow:1}slot[name="value"]::slotted(ic-text-field[readonly][hide-label]){margin-top:calc(var(--ic-space-xs) * -1)}slot[name="value"]::slotted(ic-text-field[small][readonly][hide-label]){margin-top:calc(var(--ic-space-xxs) * -1)}slot[name="value"]::slotted(ic-text-field[readonly][hide-label][rows]){margin-top:calc(var(--ic-space-xxs) * -1 - var(--ic-space-xxxs))}.end-component{width:-moz-fit-content;width:fit-content;margin-left:56px}.divider{margin-top:var(--ic-space-md);height:1px;background-color:var(--ic-architectural-300)}:host(.small) .divider{margin-top:var(--ic-space-xs)}:host(.breakpoint-medium) .label{width:160px;min-width:160px}:host(.breakpoint-xs) .text-cells{flex-direction:column}:host(.breakpoint-xs) .label{width:128px;margin-bottom:var(--ic-space-xs)}:host(.breakpoint-xs) .value{max-width:95%}:host(.breakpoint-xs) .end-component{margin-left:0}@media (forced-colors: active){.divider{background-color:canvastext}}';const d=class{constructor(t){e(this,t);this.resizeObserver=null;this.hasEndComponent=false;this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.checkLabelAbove()}));this.resizeObserver.observe(this.el)};this.label=undefined;this.value=undefined;this.small=false;this.deviceSize=a.XL;this.entitySize=undefined}checkLabelAbove(){var e;const t=(e=this.el.shadowRoot.querySelector(".data"))===null||e===void 0?void 0:e.clientWidth;if(t+46<a.S){this.entitySize="xs"}else if(t+46<a.M){this.entitySize="m"}else{this.entitySize="xl"}}labelEndComponent(){const e=this.el.shadowRoot.querySelectorAll("slot[name=end-component]");e.forEach((e=>e.setAttribute("aria-label","for "+this.label+" row")))}componentWillLoad(){this.deviceSize=n();this.hasEndComponent=s(this.el,"end-component")}componentDidLoad(){l(this.runResizeObserver);this.checkLabelAbove();if(this.hasEndComponent){this.labelEndComponent()}}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}render(){const{label:e,value:o,small:a}=this;return t(i,{class:{["small"]:a,["breakpoint-medium"]:this.entitySize==="m",["breakpoint-xs"]:this.entitySize==="xs"},role:"listitem"},t("div",{class:"data"},t("div",{class:"text-cells"},t("div",{class:"label"},t("slot",{name:"label"},t("ic-typography",{variant:this.entitySize==="xs"?"label":"subtitle-large"},e))),t("div",{class:"value"},t("slot",{name:"value"},t("ic-typography",{variant:"body"},o)))),this.hasEndComponent&&t("div",{class:"end-component"},t("div",{role:"cell"},t("slot",{name:"end-component"})))),t("div",{class:"divider"}))}get el(){return o(this)}};d.style=r;export{d as ic_data_row};
2
- //# sourceMappingURL=p-eaea567e.entry.js.map
1
+ import{r as e,h as t,H as i,g as o}from"./p-f9370be6.js";import{D as a,g as n,s,c as l}from"./p-a8ac8f72.js";import"./p-6f57b13c.js";const r='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:relative;display:block}.data{display:flex;align-items:center}.text-cells{display:flex;flex-grow:1;min-width:0}.label{width:200px;min-width:200px;margin-right:var(--ic-space-md);color:var(--ic-color-tertiary-text)}.value{flex-grow:1}slot[name="value"]::slotted(ic-text-field[readonly][hide-label]){margin-top:calc(var(--ic-space-xs) * -1)}slot[name="value"]::slotted(ic-text-field[small][readonly][hide-label]){margin-top:calc(var(--ic-space-xxs) * -1)}slot[name="value"]::slotted(ic-text-field[readonly][hide-label][rows]){margin-top:calc(var(--ic-space-xxs) * -1 - var(--ic-space-xxxs))}.end-component{width:-moz-fit-content;width:fit-content;margin-left:56px}.divider{margin-top:var(--ic-space-md);height:1px;background-color:var(--ic-architectural-300)}:host(.small) .divider{margin-top:var(--ic-space-xs)}:host(.breakpoint-medium) .label{width:160px;min-width:160px}:host(.breakpoint-xs) .text-cells{flex-direction:column}:host(.breakpoint-xs) .label{width:128px;margin-bottom:var(--ic-space-xs)}:host(.breakpoint-xs) .value{max-width:95%}:host(.breakpoint-xs) .end-component{margin-left:0}@media (forced-colors: active){.divider{background-color:canvastext}}';const d=class{constructor(t){e(this,t);this.resizeObserver=null;this.hasEndComponent=false;this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.checkLabelAbove()}));this.resizeObserver.observe(this.el)};this.label=undefined;this.value=undefined;this.small=false;this.deviceSize=a.XL;this.entitySize=undefined}checkLabelAbove(){var e;const t=(e=this.el.shadowRoot.querySelector(".data"))===null||e===void 0?void 0:e.clientWidth;if(t){if(t+46<a.S){this.entitySize="xs"}else if(t+46<a.M){this.entitySize="m"}else{this.entitySize="xl"}}}labelEndComponent(){const e=this.el.shadowRoot.querySelectorAll("slot[name=end-component]");e.forEach((e=>e.setAttribute("aria-label","for "+this.label+" row")))}componentWillLoad(){this.deviceSize=n();this.hasEndComponent=s(this.el,"end-component");this.checkLabelAbove()}componentDidLoad(){l(this.runResizeObserver);if(this.hasEndComponent){this.labelEndComponent()}}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}render(){const{label:e,value:o,small:a}=this;return t(i,{class:{["small"]:a,["breakpoint-medium"]:this.entitySize==="m",["breakpoint-xs"]:this.entitySize==="xs"},role:"listitem"},t("div",{class:"data"},t("div",{class:"text-cells"},t("div",{class:"label"},t("slot",{name:"label"},t("ic-typography",{variant:this.entitySize==="xs"?"label":"subtitle-large"},e))),t("div",{class:"value"},t("slot",{name:"value"},t("ic-typography",{variant:"body"},o)))),this.hasEndComponent&&t("div",{class:"end-component"},t("div",{role:"cell"},t("slot",{name:"end-component"})))),t("div",{class:"divider"}))}get el(){return o(this)}};d.style=r;export{d as ic_data_row};
2
+ //# sourceMappingURL=p-a38cbb3f.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["src/components/ic-data-row/ic-data-row.css?tag=ic-data-row&encapsulation=shadow","src/components/ic-data-row/ic-data-row.tsx"],"names":["icDataRowCss","DataRow","this","resizeObserver","hasEndComponent","runResizeObserver","ResizeObserver","checkLabelAbove","observe","el","DEVICE_SIZES","XL","[object Object]","rowSize","_a","shadowRoot","querySelector","clientWidth","S","entitySize","M","component","querySelectorAll","forEach","child","setAttribute","label","deviceSize","getCurrentDeviceSize","slotHasContent","checkResizeObserver","labelEndComponent","disconnect","value","small","h","Host","class","role","name","variant"],"mappings":"qIAAA,MAAMA,EAAe,ogHCkBRC,EAAO,+BAsBVC,KAAAC,eAAiC,KAEjCD,KAAAE,gBAA2B,MAE3BF,KAAAG,kBAAoB,KAC1BH,KAAKC,eAAiB,IAAIG,gBAAe,KACvCJ,KAAKK,qBAGPL,KAAKC,eAAeK,QAAQN,KAAKO,0DAfV,sBAEKC,EAAaC,6BAgBnCC,wBACN,MAAMC,GAAUC,EAAAZ,KAAKO,GAAGM,WAAWC,cAAc,YAAQ,MAAAF,SAAA,OAAA,EAAAA,EAAEG,YAC3D,GAAIJ,EAAS,CACX,GAAIA,EAAU,GAAKH,EAAaQ,EAAG,CACjChB,KAAKiB,WAAa,UACb,GAAIN,EAAU,GAAKH,EAAaU,EAAG,CACxClB,KAAKiB,WAAa,QACb,CACLjB,KAAKiB,WAAa,OAKhBP,oBACN,MAAMS,EAAYnB,KAAKO,GAAGM,WAAWO,iBACnC,4BAGFD,EAAUE,SAASC,GACjBA,EAAMC,aAAa,aAAc,OAASvB,KAAKwB,MAAQ,UAI3Dd,oBACEV,KAAKyB,WAAaC,IAClB1B,KAAKE,gBAAkByB,EAAe3B,KAAKO,GAAI,iBAC/CP,KAAKK,kBAGPK,mBACEkB,EAAoB5B,KAAKG,mBACzB,GAAIH,KAAKE,gBAAiB,CACxBF,KAAK6B,qBAITnB,uBACE,GAAIV,KAAKC,iBAAmB,KAAM,CAChCD,KAAKC,eAAe6B,cAIxBpB,SACE,MAAMc,MAAEA,EAAKO,MAAEA,EAAKC,MAAEA,GAAUhC,KAEhC,OACEiC,EAACC,EAAI,CACHC,MAAO,CACLzB,CAAC,SAAUsB,EACXtB,CAAC,qBAAsBV,KAAKiB,aAAe,IAC3CP,CAAC,iBAAkBV,KAAKiB,aAAe,MAEzCmB,KAAK,YAELH,EAAA,MAAA,CAAKE,MAAM,QACTF,EAAA,MAAA,CAAKE,MAAM,cACTF,EAAA,MAAA,CAAKE,MAAM,SACTF,EAAA,OAAA,CAAMI,KAAK,SACTJ,EAAA,gBAAA,CACEK,QACEtC,KAAKiB,aAAe,KAAO,QAAU,kBAGtCO,KAIPS,EAAA,MAAA,CAAKE,MAAM,SACTF,EAAA,OAAA,CAAMI,KAAK,SACTJ,EAAA,gBAAA,CAAeK,QAAQ,QAAQP,MAIpC/B,KAAKE,iBACJ+B,EAAA,MAAA,CAAKE,MAAM,iBACTF,EAAA,MAAA,CAAKG,KAAK,QACRH,EAAA,OAAA,CAAMI,KAAK,qBAKnBJ,EAAA,MAAA,CAAKE,MAAM","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n position: relative;\n display: block;\n}\n\n.data {\n display: flex;\n align-items: center;\n}\n\n.text-cells {\n display: flex;\n flex-grow: 1;\n min-width: 0;\n}\n\n.label {\n width: 200px;\n min-width: 200px;\n margin-right: var(--ic-space-md);\n color: var(--ic-color-tertiary-text);\n}\n\n.value {\n flex-grow: 1;\n}\n\nslot[name=\"value\"]::slotted(ic-text-field[readonly][hide-label]) {\n margin-top: calc(var(--ic-space-xs) * -1);\n}\n\nslot[name=\"value\"]::slotted(ic-text-field[small][readonly][hide-label]) {\n margin-top: calc(var(--ic-space-xxs) * -1);\n}\n\nslot[name=\"value\"]::slotted(ic-text-field[readonly][hide-label][rows]) {\n margin-top: calc(var(--ic-space-xxs) * -1 - var(--ic-space-xxxs));\n}\n\n.end-component {\n width: fit-content;\n margin-left: 56px;\n}\n\n.divider {\n margin-top: var(--ic-space-md);\n height: 1px;\n background-color: var(--ic-architectural-300);\n}\n\n:host(.small) .divider {\n margin-top: var(--ic-space-xs);\n}\n\n:host(.breakpoint-medium) .label {\n width: 160px;\n min-width: 160px;\n}\n\n:host(.breakpoint-xs) .text-cells {\n flex-direction: column;\n}\n\n:host(.breakpoint-xs) .label {\n width: 128px;\n margin-bottom: var(--ic-space-xs);\n}\n\n:host(.breakpoint-xs) .value {\n max-width: 95%;\n}\n\n:host(.breakpoint-xs) .end-component {\n margin-left: 0;\n}\n\n@media (forced-colors: active) {\n .divider {\n background-color: canvastext;\n }\n}\n","import { Component, Element, Host, Prop, h, State } from \"@stencil/core\";\nimport {\n checkResizeObserver,\n DEVICE_SIZES,\n getCurrentDeviceSize,\n slotHasContent,\n} from \"../../utils/helpers\";\n\n/**\n * @slot label - Content will be rendered in the leftmost cell.\n * @slot value - Content will be rendered to the right of the label.\n * @slot end-component - Content will be displayed in the rightmost cell.\n */\n@Component({\n tag: \"ic-data-row\",\n styleUrl: \"ic-data-row.css\",\n shadow: true,\n})\nexport class DataRow {\n @Element() el: HTMLIcDataRowElement;\n\n /**\n * The label in the leftmost cell of the row.\n */\n @Prop() label: string;\n\n /**\n * The value of the middle (right if no end-component supplied) cell of the row.\n */\n @Prop() value: string;\n\n /**\n * If `true`, the small styling will be applied to the row. This is automatically applied if small is set on the parent data heading.\n */\n @Prop() small: boolean = false;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n\n @State() entitySize: \"xl\" | \"m\" | \"xs\";\n\n private resizeObserver: ResizeObserver = null;\n\n private hasEndComponent: boolean = false;\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.checkLabelAbove();\n });\n\n this.resizeObserver.observe(this.el);\n };\n\n private checkLabelAbove() {\n const rowSize = this.el.shadowRoot.querySelector(\".data\")?.clientWidth;\n if (rowSize) {\n if (rowSize + 46 < DEVICE_SIZES.S) {\n this.entitySize = \"xs\";\n } else if (rowSize + 46 < DEVICE_SIZES.M) {\n this.entitySize = \"m\";\n } else {\n this.entitySize = \"xl\";\n }\n }\n }\n\n private labelEndComponent(): void {\n const component = this.el.shadowRoot.querySelectorAll(\n \"slot[name=end-component]\"\n );\n\n component.forEach((child: HTMLElement) =>\n child.setAttribute(\"aria-label\", \"for \" + this.label + \" row\")\n );\n }\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n this.hasEndComponent = slotHasContent(this.el, \"end-component\");\n this.checkLabelAbove();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n if (this.hasEndComponent) {\n this.labelEndComponent();\n }\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n const { label, value, small } = this;\n\n return (\n <Host\n class={{\n [\"small\"]: small,\n [\"breakpoint-medium\"]: this.entitySize === \"m\",\n [\"breakpoint-xs\"]: this.entitySize === \"xs\",\n }}\n role=\"listitem\"\n >\n <div class=\"data\">\n <div class=\"text-cells\">\n <div class=\"label\">\n <slot name=\"label\">\n <ic-typography\n variant={\n this.entitySize === \"xs\" ? \"label\" : \"subtitle-large\"\n }\n >\n {label}\n </ic-typography>\n </slot>\n </div>\n <div class=\"value\">\n <slot name=\"value\">\n <ic-typography variant=\"body\">{value}</ic-typography>\n </slot>\n </div>\n </div>\n {this.hasEndComponent && (\n <div class=\"end-component\">\n <div role=\"cell\">\n <slot name=\"end-component\"></slot>\n </div>\n </div>\n )}\n </div>\n <div class=\"divider\" />\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as e,h as i,H as t,g as n}from"./p-f9370be6.js";import{b as o,m as l,n as r}from"./p-a8ac8f72.js";import{I as s}from"./p-6f57b13c.js";const a=`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/></svg>`;const c='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host(.link) .ic-link,:host(.link) ::slotted(a){color:var(--ic-hyperlink);text-decoration:underline;font-weight:var(--ic-font-weight-bold);transition:var(--ic-easing-transition-fast)}:host(.link.dark) .ic-link.dark,:host(.link.dark) ::slotted(a){color:var(--ic-color-primary-text)}:host(.link.light) .ic-link.light,:host(.link.light) ::slotted(a){color:var(--ic-color-white-text)}:host(.link) .ic-link:visited,:host(.link) ::slotted(a:visited){color:var(--ic-hyperlink-visited)}:host(.link) .ic-link:hover,:host(.link) .ic-link:focus,:host(.link) ::slotted(a:hover),:host(.link) ::slotted(a:focus){text-decoration-line:underline;text-decoration-thickness:25%;text-underline-offset:25%}:host(.link) .ic-link:hover,:host(.link) ::slotted(a:hover){outline:none}:host(.link) .ic-link:focus,:host(.link) ::slotted(a:focus){outline:var(--ic-hc-focus-outline)}:host(.link) .ic-link:active,:host(.link) .ic-link:focus:active,:host(.link) .ic-link:visited:active,:host(.link) ::slotted(a:active),:host(.link) ::slotted(a:focus:active),:host(.link) ::slotted(a:visited:active){text-decoration:none}.ic-link-open-in-new-icon{vertical-align:middle;margin-left:var(--ic-space-xxs)}.ic-link>.ic-link-open-in-new-icon{fill:var(--ic-hyperlink)}.ic-link.dark>.ic-link-open-in-new-icon{fill:var(--ic-color-primary-text)}.ic-link.light>.ic-link-open-in-new-icon{fill:var(--ic-color-white-text)}.ic-link-open-in-new-icon>svg{width:var(--ic-space-md);height:var(--ic-space-md);fill:currentcolor}.ic-link:visited>.ic-link-open-in-new-icon{fill:var(--ic-hyperlink-visited)}.ic-link.light:visited>.ic-link-open-in-new-icon{fill:var(--ic-hyperlink-contrast-visited)}:host(.breadcrumb-link) .ic-link{display:var(--breadcrumb-link-display);align-items:var(--breadcrumb-link-align-items);gap:var(--breadcrumb-link-gap)}:host(.breadcrumb-link) .ic-link ::slotted(.back-icon){height:var(--ic-space-lg);width:var(--ic-space-lg)}:host(.breadcrumb-link.current-page) a,:host(.breadcrumb-link.current-page) ::slotted(a){font-weight:normal;color:inherit;text-decoration:none;display:flex;align-items:center}:host(.breadcrumb-link.current-page) .ic-link,:host(.breadcrumb-link.current-page) ::slotted(a:focus){outline:var(--ic-hc-focus-outline);text-decoration:none}:host(.breadcrumb-link.current-page) .ic-link:visited{color:var(--ic-color-primary-text)}';const d=class{constructor(i){e(this,i);this.inheritedAttributes={};this.download=false;this.href=null;this.hreflang=undefined;this.referrerpolicy=undefined;this.rel=undefined;this.target=undefined;this.showIcon=undefined;this.appearance="default"}themeChangeHandler(e){const i=e.detail;this.updateTheme(i.mode)}updateTheme(e=null){const i=o(this.el,e||null);switch(i){case s.Light:this.appearance=s.Light;break;case s.Dark:this.appearance=s.Dark;break}}componentWillLoad(){this.inheritedAttributes=l(this.el,[...r,"aria-expanded"])}componentDidLoad(){this.updateTheme()}hasRouterSlot(){this.routerSlot=this.el.querySelector('[slot="router-item"]');if(this.routerSlot){this.routerSlot.ariaLabel=this.routerSlot.textContent}return!!this.routerSlot}render(){const{download:e,href:n,hreflang:o,referrerpolicy:l,rel:r,target:s,showIcon:c,appearance:d}=this;return i(t,{class:{["link"]:true,[`${d}`]:true}},this.hasRouterSlot()?i("slot",{name:"router-item"}):i("a",Object.assign({class:{["ic-link"]:n!==null,[`${d}`]:n!==null},download:e!==false?e:null,href:n,hrefLang:o,referrerPolicy:l,rel:r,target:s,tabindex:n!==null?"0":"-1"},this.inheritedAttributes),i("slot",null),c&&i("span",{class:"ic-link-open-in-new-icon",innerHTML:a})))}get el(){return n(this)}};d.style=c;export{d as ic_link};
2
- //# sourceMappingURL=p-23bf0b7a.entry.js.map
1
+ import{r as e,h as i,H as t,g as n}from"./p-f9370be6.js";import{b as o,m as l,n as r}from"./p-a8ac8f72.js";import{I as s}from"./p-6f57b13c.js";const a=`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/></svg>`;const c='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host(.link) .ic-link,:host(.link) ::slotted(a){color:var(--ic-hyperlink);text-decoration:underline;font-weight:var(--ic-font-weight-bold);transition:var(--ic-easing-transition-fast)}:host(.link.dark) .ic-link.dark,:host(.link.dark) ::slotted(a){color:var(--ic-color-primary-text)}:host(.link.light) .ic-link.light,:host(.link.light) ::slotted(a){color:var(--ic-color-white-text)}:host(.link) .ic-link:visited,:host(.link) ::slotted(a:visited){color:var(--ic-hyperlink-visited)}:host(.link) .ic-link:hover,:host(.link) .ic-link:focus,:host(.link) ::slotted(a:hover),:host(.link) ::slotted(a:focus){text-decoration-line:underline;text-decoration-thickness:25%;text-underline-offset:25%}:host(.link) .ic-link:hover,:host(.link) ::slotted(a:hover){outline:none}:host(.link) .ic-link:focus,:host(.link) ::slotted(a:focus){outline:var(--ic-hc-focus-outline)}:host(.link) .ic-link:active,:host(.link) .ic-link:focus:active,:host(.link) .ic-link:visited:active,:host(.link) ::slotted(a:active),:host(.link) ::slotted(a:focus:active),:host(.link) ::slotted(a:visited:active){text-decoration:none}.ic-link-open-in-new-icon{vertical-align:middle;margin-left:var(--ic-space-xxs)}.ic-link>.ic-link-open-in-new-icon{fill:var(--ic-hyperlink)}.ic-link.dark>.ic-link-open-in-new-icon{fill:var(--ic-color-primary-text)}.ic-link.light>.ic-link-open-in-new-icon{fill:var(--ic-color-white-text)}.ic-link-open-in-new-icon>svg{width:var(--ic-space-md);height:var(--ic-space-md);fill:currentcolor}.ic-link:visited>.ic-link-open-in-new-icon{fill:var(--ic-hyperlink-visited)}.ic-link.light:visited>.ic-link-open-in-new-icon{fill:var(--ic-hyperlink-contrast-visited)}:host(.breadcrumb-link) .ic-link{display:var(--breadcrumb-link-display);align-items:var(--breadcrumb-link-align-items);gap:var(--breadcrumb-link-gap)}:host(.breadcrumb-link) .ic-link ::slotted(.back-icon){height:var(--ic-space-lg);width:var(--ic-space-lg)}:host(.breadcrumb-link.current-page) a,:host(.breadcrumb-link.current-page) ::slotted(a){font-weight:normal;color:inherit;text-decoration:none;display:flex;align-items:center}:host(.breadcrumb-link.current-page) .ic-link,:host(.breadcrumb-link.current-page) ::slotted(a:focus){outline:var(--ic-hc-focus-outline);text-decoration:none}:host(.breadcrumb-link.current-page) .ic-link:visited{color:var(--ic-color-primary-text)}';const d=class{constructor(i){e(this,i);this.inheritedAttributes={};this.download=false;this.href=null;this.hreflang=undefined;this.referrerpolicy=undefined;this.rel=undefined;this.target=undefined;this.showIcon=undefined;this.appearance="default"}themeChangeHandler(e){const i=e.detail;this.updateTheme(i.mode)}updateTheme(e=null){const i=o(this.el,e||null);switch(i){case s.Light:this.appearance=s.Light;break;case s.Dark:this.appearance=s.Dark;break}}componentWillLoad(){this.inheritedAttributes=l(this.el,[...r,"aria-expanded"]);this.updateTheme()}hasRouterSlot(){this.routerSlot=this.el.querySelector('[slot="router-item"]');if(this.routerSlot){this.routerSlot.ariaLabel=this.routerSlot.textContent}return!!this.routerSlot}render(){const{download:e,href:n,hreflang:o,referrerpolicy:l,rel:r,target:s,showIcon:c,appearance:d}=this;return i(t,{class:{["link"]:true,[`${d}`]:true}},this.hasRouterSlot()?i("slot",{name:"router-item"}):i("a",Object.assign({class:{["ic-link"]:n!==null,[`${d}`]:n!==null},download:e!==false?e:null,href:n,hrefLang:o,referrerPolicy:l,rel:r,target:s,tabindex:n!==null?"0":"-1"},this.inheritedAttributes),i("slot",null),c&&i("span",{class:"ic-link-open-in-new-icon",innerHTML:a})))}get el(){return n(this)}};d.style=c;export{d as ic_link};
2
+ //# sourceMappingURL=p-c5e453eb.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["src/components/ic-link/ic-link.css?tag=ic-link&encapsulation=shadow","src/components/ic-link/ic-link.tsx"],"names":["icLinkCss","Link","this","inheritedAttributes","[object Object]","ev","theme","detail","updateTheme","mode","newTheme","getThemeFromContext","el","IcThemeForegroundEnum","Light","appearance","Dark","inheritAttributes","IC_INHERITED_ARIA","routerSlot","querySelector","ariaLabel","textContent","download","href","hreflang","referrerpolicy","rel","target","showIcon","h","Host","class","hasRouterSlot","name","Object","assign","hrefLang","referrerPolicy","tabindex","innerHTML","OpenInNew"],"mappings":"0aAAA,MAAMA,EAAY,ynJCoBLC,EAAI,+BACPC,KAAAC,oBAAgD,iBAQlB,gBAKd,4IA8BkC,UAG1DC,mBAAmBC,GACjB,MAAMC,EAAiBD,EAAGE,OAC1BL,KAAKM,YAAYF,EAAMG,MAGjBL,YAAYM,EAA8B,MAChD,MAAMJ,EAAQK,EAAoBT,KAAKU,GAAIF,GAAY,MAEvD,OAAQJ,GACN,KAAKO,EAAsBC,MACzBZ,KAAKa,WAAaF,EAAsBC,MACxC,MACF,KAAKD,EAAsBG,KACzBd,KAAKa,WAAaF,EAAsBG,KACxC,OAINZ,oBACEF,KAAKC,oBAAsBc,EAAkBf,KAAKU,GAAI,IACjDM,EACH,kBAGFhB,KAAKM,cAGCJ,gBACNF,KAAKiB,WAAajB,KAAKU,GAAGQ,cAAc,wBACxC,GAAIlB,KAAKiB,WAAY,CACnBjB,KAAKiB,WAAWE,UAAYnB,KAAKiB,WAAWG,YAE9C,QAASpB,KAAKiB,WAGhBf,SACE,MAAMmB,SACJA,EAAQC,KACRA,EAAIC,SACJA,EAAQC,eACRA,EAAcC,IACdA,EAAGC,OACHA,EAAMC,SACNA,EAAQd,WACRA,GACEb,KAEJ,OACE4B,EAACC,EAAI,CAACC,MAAO,CAAE5B,CAAC,QAAS,KAAMA,CAAC,GAAGW,KAAe,OAC/Cb,KAAK+B,gBACJH,EAAA,OAAA,CAAMI,KAAK,gBAEXJ,EAAA,IAAAK,OAAAC,OAAA,CACEJ,MAAO,CACL5B,CAAC,WAAYoB,IAAS,KACtBpB,CAAC,GAAGW,KAAeS,IAAS,MAE9BD,SAAUA,IAAa,MAAQA,EAAW,KAC1CC,KAAMA,EACNa,SAAUZ,EACVa,eAAgBZ,EAChBC,IAAKA,EACLC,OAAQA,EACRW,SAAUf,IAAS,KAAO,IAAM,MAC5BtB,KAAKC,qBAET2B,EAAA,OAAA,MACCD,GACCC,EAAA,OAAA,CAAME,MAAM,2BAA2BQ,UAAWC","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host(.link) .ic-link,\n:host(.link) ::slotted(a) {\n color: var(--ic-hyperlink);\n text-decoration: underline;\n font-weight: var(--ic-font-weight-bold);\n transition: var(--ic-easing-transition-fast);\n}\n\n:host(.link.dark) .ic-link.dark,\n:host(.link.dark) ::slotted(a) {\n color: var(--ic-color-primary-text);\n}\n\n:host(.link.light) .ic-link.light,\n:host(.link.light) ::slotted(a) {\n color: var(--ic-color-white-text);\n}\n\n:host(.link) .ic-link:visited,\n:host(.link) ::slotted(a:visited) {\n color: var(--ic-hyperlink-visited);\n}\n\n:host(.link) .ic-link:hover,\n:host(.link) .ic-link:focus,\n:host(.link) ::slotted(a:hover),\n:host(.link) ::slotted(a:focus) {\n text-decoration-line: underline;\n text-decoration-thickness: 25%;\n text-underline-offset: 25%;\n}\n\n:host(.link) .ic-link:hover,\n:host(.link) ::slotted(a:hover) {\n outline: none;\n}\n\n:host(.link) .ic-link:focus,\n:host(.link) ::slotted(a:focus) {\n outline: var(--ic-hc-focus-outline);\n}\n\n:host(.link) .ic-link:active,\n:host(.link) .ic-link:focus:active,\n:host(.link) .ic-link:visited:active,\n:host(.link) ::slotted(a:active),\n:host(.link) ::slotted(a:focus:active),\n:host(.link) ::slotted(a:visited:active) {\n text-decoration: none;\n}\n\n.ic-link-open-in-new-icon {\n vertical-align: middle;\n margin-left: var(--ic-space-xxs);\n}\n\n.ic-link > .ic-link-open-in-new-icon {\n fill: var(--ic-hyperlink);\n}\n\n.ic-link.dark > .ic-link-open-in-new-icon {\n fill: var(--ic-color-primary-text);\n}\n\n.ic-link.light > .ic-link-open-in-new-icon {\n fill: var(--ic-color-white-text);\n}\n\n.ic-link-open-in-new-icon > svg {\n width: var(--ic-space-md);\n height: var(--ic-space-md);\n fill: currentcolor;\n}\n\n.ic-link:visited > .ic-link-open-in-new-icon {\n fill: var(--ic-hyperlink-visited);\n}\n\n.ic-link.light:visited > .ic-link-open-in-new-icon {\n fill: var(--ic-hyperlink-contrast-visited);\n}\n\n:host(.breadcrumb-link) .ic-link {\n display: var(--breadcrumb-link-display);\n align-items: var(--breadcrumb-link-align-items);\n gap: var(--breadcrumb-link-gap);\n}\n\n:host(.breadcrumb-link) .ic-link ::slotted(.back-icon) {\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n}\n\n:host(.breadcrumb-link.current-page) a,\n:host(.breadcrumb-link.current-page) ::slotted(a) {\n font-weight: normal;\n color: inherit;\n text-decoration: none;\n display: flex;\n align-items: center;\n}\n\n:host(.breadcrumb-link.current-page) .ic-link,\n:host(.breadcrumb-link.current-page) ::slotted(a:focus) {\n outline: var(--ic-hc-focus-outline);\n text-decoration: none;\n}\n\n:host(.breadcrumb-link.current-page) .ic-link:visited {\n color: var(--ic-color-primary-text);\n}\n","import { Component, Element, Prop, h, Host, Listen } from \"@stencil/core\";\n\nimport OpenInNew from \"./assets/OpenInNew.svg\";\nimport { getThemeFromContext, inheritAttributes } from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\n/**\n * @slot router-item - Handle routing by nesting your routes in this slot.\n */\n\n@Component({\n tag: \"ic-link\",\n styleUrl: \"ic-link.css\",\n shadow: true,\n})\nexport class Link {\n private inheritedAttributes: { [k: string]: unknown } = {};\n private routerSlot: HTMLElement;\n\n @Element() el: HTMLIcLinkElement;\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.\n */\n @Prop() href?: string = null;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: 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 * If `true`, the 'open in new tab/window' icon will be displayed.\n */\n @Prop() showIcon?: boolean;\n\n /**\n * The appearance of the link, e.g. dark, light, or default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const theme = getThemeFromContext(this.el, newTheme || null);\n\n switch (theme) {\n case IcThemeForegroundEnum.Light:\n this.appearance = IcThemeForegroundEnum.Light;\n break;\n case IcThemeForegroundEnum.Dark:\n this.appearance = IcThemeForegroundEnum.Dark;\n break;\n }\n }\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"aria-expanded\",\n ]);\n\n this.updateTheme();\n }\n\n private hasRouterSlot(): boolean {\n this.routerSlot = this.el.querySelector('[slot=\"router-item\"]');\n if (this.routerSlot) {\n this.routerSlot.ariaLabel = this.routerSlot.textContent;\n }\n return !!this.routerSlot;\n }\n\n render() {\n const {\n download,\n href,\n hreflang,\n referrerpolicy,\n rel,\n target,\n showIcon,\n appearance,\n } = this;\n\n return (\n <Host class={{ [\"link\"]: true, [`${appearance}`]: true }}>\n {this.hasRouterSlot() ? (\n <slot name=\"router-item\"></slot>\n ) : (\n <a\n class={{\n [\"ic-link\"]: href !== null,\n [`${appearance}`]: href !== null,\n }}\n download={download !== false ? download : null}\n href={href}\n hrefLang={hreflang}\n referrerPolicy={referrerpolicy}\n rel={rel}\n target={target}\n tabindex={href !== null ? \"0\" : \"-1\"}\n {...this.inheritedAttributes}\n >\n <slot />\n {showIcon && (\n <span class=\"ic-link-open-in-new-icon\" innerHTML={OpenInNew} />\n )}\n </a>\n )}\n </Host>\n );\n }\n}\n"]}