@ukic/web-components 2.1.0-beta.13 → 2.1.0-beta.14
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/ic-button_3.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +3 -1
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination.cjs.entry.js.map +1 -1
- package/dist/collection/components/ic-button/ic-button.css +6 -0
- package/dist/collection/components/ic-footer/ic-footer.js +4 -2
- package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
- package/dist/collection/components/ic-pagination/ic-pagination.css +0 -4
- package/dist/components/ic-button2.js +1 -1
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-footer.js +4 -2
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-pagination.js +1 -1
- package/dist/components/ic-pagination.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/p-2e949135.entry.js +2 -0
- package/dist/core/p-2e949135.entry.js.map +1 -0
- package/dist/core/p-4595f48f.entry.js +2 -0
- package/dist/core/p-4595f48f.entry.js.map +1 -0
- package/dist/core/p-a7fdb9a8.entry.js +2 -0
- package/dist/core/p-a7fdb9a8.entry.js.map +1 -0
- package/dist/esm/ic-button_3.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +4 -2
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-pagination.entry.js +1 -1
- package/dist/esm/ic-pagination.entry.js.map +1 -1
- package/hydrate/index.js +5 -3
- package/package.json +3 -3
- package/dist/core/p-864b46bf.entry.js +0 -2
- package/dist/core/p-864b46bf.entry.js.map +0 -1
- package/dist/core/p-db7131b6.entry.js +0 -2
- package/dist/core/p-db7131b6.entry.js.map +0 -1
- package/dist/core/p-ff6583e6.entry.js +0 -2
- package/dist/core/p-ff6583e6.entry.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
2
2
|
import { IC_DEVICE_SIZES } from "../../utils/constants";
|
3
|
-
import { getCurrentDeviceSize, getThemeForegroundColor, checkResizeObserver, hasClassificationBanner, } from "../../utils/helpers";
|
3
|
+
import { getCurrentDeviceSize, getThemeForegroundColor, checkResizeObserver, hasClassificationBanner, isSlotUsed, } from "../../utils/helpers";
|
4
4
|
import { IcThemeForegroundEnum, } from "../../utils/types";
|
5
5
|
/**
|
6
6
|
* @slot description - Content will be rendered at the top of the footer.
|
@@ -70,7 +70,9 @@ export class Footer {
|
|
70
70
|
// Slots will be able to infer their own color
|
71
71
|
[IcThemeForegroundEnum.Dark]: foregroundColor === IcThemeForegroundEnum.Dark,
|
72
72
|
[IcThemeForegroundEnum.Light]: foregroundColor === IcThemeForegroundEnum.Light,
|
73
|
-
} }, h("footer", { ref: (footerEl) => (this.footerEl = footerEl) }, h("div", { class: "footer-description" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-description-inner" }, h("ic-typography", { variant: "body" }, h("slot", { name: "description" }, description))))), h("div", { class: "footer-links" }, groupLinks && small ? (h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))) : (h("ic-section-container", { fullHeight: true, aligned: aligned }, h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))))), h("div", { class: "footer-compliance" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-compliance-inner" }, h("div", { class: "footer-logo" }, h("slot", { name: "logo" })), h("div", { class: "footer-caption" }, h("ic-typography", { variant: this.deviceSize <= IC_DEVICE_SIZES.M
|
73
|
+
} }, h("footer", { ref: (footerEl) => (this.footerEl = footerEl) }, h("div", { class: "footer-description" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-description-inner" }, h("ic-typography", { variant: "body" }, h("slot", { name: "description" }, description))))), h("div", { class: "footer-links" }, groupLinks && small ? (h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))) : (h("ic-section-container", { fullHeight: true, aligned: aligned }, h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))))), h("div", { class: "footer-compliance" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-compliance-inner" }, isSlotUsed(this.el, "logo") && (h("div", { class: "footer-logo" }, h("slot", { name: "logo" }))), (isSlotUsed(this.el, "caption") || caption) && (h("div", { class: "footer-caption" }, h("ic-typography", { variant: this.deviceSize <= IC_DEVICE_SIZES.M
|
74
|
+
? "caption"
|
75
|
+
: "body" }, h("slot", { name: "caption" }, caption)))), copyright && (h("div", { class: {
|
74
76
|
["footer-copyright"]: true,
|
75
77
|
["classification-spacing"]: hasClassificationBanner(),
|
76
78
|
} }, h("ic-typography", { variant: this.deviceSize <= IC_DEVICE_SIZES.M
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ic-footer.js","sourceRoot":"","sources":["../../../src/components/ic-footer/ic-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,CAAC,EACD,IAAI,EACJ,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAG3B;;;;;GAKG;AAOH,MAAM,OAAO,MAAM;;IAmET,2BAAsB,GAAG,CAAC,QAAgB,EAAE,EAAE;MACpD,IAAI,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE;QAChC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;OAC5B;MACD,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC,CAAC;IAEM,sBAAi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AI,EAAC,MAAM,GAAG,CAChB,CACP,CAAC,CAAC,CAAC,CACF,4BAAsB,UAAU,QAAC,OAAO,EAAE,OAAO;UAC/C,WAAK,KAAK,EAAC,oBAAoB;YAC7B,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACe,CACxB,CACG;QAGN,WAAK,KAAK,EAAC,mBAAmB;UAC5B,4BAAsB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI;YACtD,WAAK,KAAK,EAAC,yBAAyB;cAClC,WAAK,KAAK,EAAC,aAAa;gBAEtB,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB;cACN,WAAK,KAAK,EAAC,gBAAgB;gBACzB,qBACE,OAAO,EACL,IAAI,CAAC,UAAU,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;kBAG3D,YAAM,IAAI,EAAC,SAAS,IAAE,OAAO,CAAQ,CACvB,CACZ;cACL,SAAS,IAAI,CACZ,WACE,KAAK,EAAE;kBACL,CAAC,kBAAkB,CAAC,EAAE,IAAI;kBAC1B,CAAC,wBAAwB,CAAC,EAAE,uBAAuB,EAAE;iBACtD;gBAED,qBACE,OAAO,EACL,IAAI,CAAC,UAAU,IAAI,eAAe,CAAC,CAAC;oBAClC,CAAC,CAAC,mBAAmB;oBACrB,CAAC,CAAC,iBAAiB,6BAIT,CACZ,CACP,CACG,CACe,CACnB,CACC,CACJ,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Prop,\n State,\n h,\n Host,\n Listen,\n} from \"@stencil/core\";\nimport { IC_DEVICE_SIZES } from \"../../utils/constants\";\nimport {\n getCurrentDeviceSize,\n getThemeForegroundColor,\n checkResizeObserver,\n hasClassificationBanner,\n} from \"../../utils/helpers\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport { IcFooterBreakpoints } from \"./ic-footer.types\";\n\n/**\n * @slot description - Content will be rendered at the top of the footer.\n * @slot link - Content will be rendered between description and logos.\n * @slot logo - Content will be rendered underneath footer links.\n * @slot caption - Content will be rendered above Crown Copyright.\n */\n\n@Component({\n tag: \"ic-footer\",\n styleUrl: \"ic-footer.css\",\n shadow: true,\n})\nexport class Footer {\n @Element() el: HTMLIcFooterElement;\n\n /**\n * @internal Triggers on page resize and triggers style changes in footer links and link groups\n */\n @Event() footerResized: EventEmitter<void>;\n\n /**\n * The description displayed at the top of the footer.\n */\n @Prop() description: string;\n\n /**\n * The alignment of the section containers used within the footer.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * The screen size breakpoint at which to switch to the small layout.\n */\n @Prop() breakpoint?: IcFooterBreakpoints = \"medium\";\n\n /**\n * If `true`, the footer will be set up to handle link groups instead of standalone links.\n */\n @Prop() groupLinks?: boolean = false;\n\n /**\n * The caption displayed at the bottom of the footer.\n */\n @Prop() caption: string;\n\n /**\n * If `true`, the footer will display the crown copyright at the bottom.\n */\n @Prop() copyright: boolean = true;\n\n @State() deviceSize: number = IC_DEVICE_SIZES.XL;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n private isSmall() {\n const bp = this.breakpoint;\n\n return bp === \"extra small\"\n ? this.deviceSize < IC_DEVICE_SIZES.XS\n : bp === \"small\"\n ? this.deviceSize < IC_DEVICE_SIZES.S\n : bp === \"medium\"\n ? this.deviceSize < IC_DEVICE_SIZES.M\n : bp === \"large\"\n ? this.deviceSize < IC_DEVICE_SIZES.L\n : bp === \"extra large\"\n ? this.deviceSize < IC_DEVICE_SIZES.XL\n : false;\n }\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 private resizeObserver: ResizeObserver;\n private footerEl: HTMLElement;\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n this.footerResized.emit();\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n const currSize = getCurrentDeviceSize();\n this.resizeObserverCallback(currSize);\n });\n\n this.resizeObserver.observe(this.footerEl);\n };\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n aligned,\n caption,\n copyright,\n description,\n groupLinks,\n foregroundColor,\n } = this;\n const small = this.isSmall();\n\n return (\n <Host\n class={{\n footer: true,\n [`footer-${small ? \"small\" : \"sparse\"}`]: true,\n [`footer-${groupLinks ? \"grouped\" : \"ungrouped\"}`]: true,\n [`footer-${foregroundColor}`]: true,\n // Slots will be able to infer their own color\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [IcThemeForegroundEnum.Light]:\n foregroundColor === IcThemeForegroundEnum.Light,\n }}\n >\n <footer ref={(footerEl) => (this.footerEl = footerEl)}>\n {/* Description */}\n <div class=\"footer-description\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-description-inner\">\n <ic-typography variant=\"body\">\n <slot name=\"description\">{description}</slot>\n </ic-typography>\n </div>\n </ic-section-container>\n </div>\n\n {/* Links */}\n <div class=\"footer-links\">\n {groupLinks && small ? (\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n ) : (\n <ic-section-container fullHeight aligned={aligned}>\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n </ic-section-container>\n )}\n </div>\n\n {/* Compliance (logo, caption, copyright) */}\n <div class=\"footer-compliance\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-compliance-inner\">\n <div class=\"footer-logo\">\n {/* Logo */}\n <slot name=\"logo\" />\n </div>\n <div class=\"footer-caption\">\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M ? \"caption\" : \"body\"\n }\n >\n <slot name=\"caption\">{caption}</slot>\n </ic-typography>\n </div>\n {copyright && (\n <div\n class={{\n [\"footer-copyright\"]: true,\n [\"classification-spacing\"]: hasClassificationBanner(),\n }}\n >\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption-uppercase\"\n : \"label-uppercase\"\n }\n >\n © Crown Copyright\n </ic-typography>\n </div>\n )}\n </div>\n </ic-section-container>\n </div>\n </footer>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"ic-footer.js","sourceRoot":"","sources":["../../../src/components/ic-footer/ic-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,KAAK,EACL,CAAC,EACD,IAAI,EACJ,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAG3B;;;;;GAKG;AAOH,MAAM,OAAO,MAAM;;IAmET,2BAAsB,GAAG,CAAC,QAAgB,EAAE,EAAE;MACpD,IAAI,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE;QAChC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;OAC5B;MACD,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC,CAAC;IAEM,sBAAiB,GAAG,GAAG,EAAE;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;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Prop,\n State,\n h,\n Host,\n Listen,\n} from \"@stencil/core\";\nimport { IC_DEVICE_SIZES } from \"../../utils/constants\";\nimport {\n getCurrentDeviceSize,\n getThemeForegroundColor,\n checkResizeObserver,\n hasClassificationBanner,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport { IcFooterBreakpoints } from \"./ic-footer.types\";\n\n/**\n * @slot description - Content will be rendered at the top of the footer.\n * @slot link - Content will be rendered between description and logos.\n * @slot logo - Content will be rendered underneath footer links.\n * @slot caption - Content will be rendered above Crown Copyright.\n */\n\n@Component({\n tag: \"ic-footer\",\n styleUrl: \"ic-footer.css\",\n shadow: true,\n})\nexport class Footer {\n @Element() el: HTMLIcFooterElement;\n\n /**\n * @internal Triggers on page resize and triggers style changes in footer links and link groups\n */\n @Event() footerResized: EventEmitter<void>;\n\n /**\n * The description displayed at the top of the footer.\n */\n @Prop() description: string;\n\n /**\n * The alignment of the section containers used within the footer.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * The screen size breakpoint at which to switch to the small layout.\n */\n @Prop() breakpoint?: IcFooterBreakpoints = \"medium\";\n\n /**\n * If `true`, the footer will be set up to handle link groups instead of standalone links.\n */\n @Prop() groupLinks?: boolean = false;\n\n /**\n * The caption displayed at the bottom of the footer.\n */\n @Prop() caption: string;\n\n /**\n * If `true`, the footer will display the crown copyright at the bottom.\n */\n @Prop() copyright: boolean = true;\n\n @State() deviceSize: number = IC_DEVICE_SIZES.XL;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n private isSmall() {\n const bp = this.breakpoint;\n\n return bp === \"extra small\"\n ? this.deviceSize < IC_DEVICE_SIZES.XS\n : bp === \"small\"\n ? this.deviceSize < IC_DEVICE_SIZES.S\n : bp === \"medium\"\n ? this.deviceSize < IC_DEVICE_SIZES.M\n : bp === \"large\"\n ? this.deviceSize < IC_DEVICE_SIZES.L\n : bp === \"extra large\"\n ? this.deviceSize < IC_DEVICE_SIZES.XL\n : false;\n }\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 private resizeObserver: ResizeObserver;\n private footerEl: HTMLElement;\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n this.footerResized.emit();\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n const currSize = getCurrentDeviceSize();\n this.resizeObserverCallback(currSize);\n });\n\n this.resizeObserver.observe(this.footerEl);\n };\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n aligned,\n caption,\n copyright,\n description,\n groupLinks,\n foregroundColor,\n } = this;\n const small = this.isSmall();\n\n return (\n <Host\n class={{\n footer: true,\n [`footer-${small ? \"small\" : \"sparse\"}`]: true,\n [`footer-${groupLinks ? \"grouped\" : \"ungrouped\"}`]: true,\n [`footer-${foregroundColor}`]: true,\n // Slots will be able to infer their own color\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [IcThemeForegroundEnum.Light]:\n foregroundColor === IcThemeForegroundEnum.Light,\n }}\n >\n <footer ref={(footerEl) => (this.footerEl = footerEl)}>\n {/* Description */}\n <div class=\"footer-description\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-description-inner\">\n <ic-typography variant=\"body\">\n <slot name=\"description\">{description}</slot>\n </ic-typography>\n </div>\n </ic-section-container>\n </div>\n\n {/* Links */}\n <div class=\"footer-links\">\n {groupLinks && small ? (\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n ) : (\n <ic-section-container fullHeight aligned={aligned}>\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n </ic-section-container>\n )}\n </div>\n\n {/* Compliance (logo, caption, copyright) */}\n <div class=\"footer-compliance\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-compliance-inner\">\n {isSlotUsed(this.el, \"logo\") && (\n <div class=\"footer-logo\">\n {/* Logo */}\n <slot name=\"logo\" />\n </div>\n )}\n {(isSlotUsed(this.el, \"caption\") || caption) && (\n <div class=\"footer-caption\">\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption\"\n : \"body\"\n }\n >\n <slot name=\"caption\">{caption}</slot>\n </ic-typography>\n </div>\n )}\n {copyright && (\n <div\n class={{\n [\"footer-copyright\"]: true,\n [\"classification-spacing\"]: hasClassificationBanner(),\n }}\n >\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption-uppercase\"\n : \"label-uppercase\"\n }\n >\n © Crown Copyright\n </ic-typography>\n </div>\n )}\n </div>\n </ic-section-container>\n </div>\n </footer>\n </Host>\n );\n }\n}\n"]}
|
@@ -5,7 +5,7 @@ import { d as defineCustomElement$3 } from './ic-loading-indicator2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './ic-tooltip2.js';
|
6
6
|
import { d as defineCustomElement$1 } from './ic-typography2.js';
|
7
7
|
|
8
|
-
const icButtonCss = "/*! 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;--button-default:var(--ic-action-default);--button-default-hover:var(--ic-action-default-hover);--button-default-active:var(--ic-action-default-active);--button-default-background-hover:var(--ic-action-default-bg-hover);--button-default-background-active:var(--ic-action-default-bg-active);--icon-width:100%;--icon-height:100%}.button{font-family:var(--ic-font-body-family);text-decoration:none;font-weight:600;font-size:0.875rem;transition:var(--ic-easing-transition-fast);border-radius:var(--ic-border-radius);min-width:var(--min-width, 6.25rem);display:inline-flex;gap:var(--ic-space-xs);flex-direction:row;justify-content:center;align-items:center;background:none;border:none;box-sizing:border-box;white-space:nowrap;vertical-align:middle}.button:hover{cursor:pointer}.button:focus,:host .button:focus{box-shadow:var(--ic-border-focus)}:host(.light) .button:focus{box-shadow:var(--ic-border-focus)}.button:focus-visible{outline:var(--ic-hc-focus-outline)}:host(.dark) .button{--button-default:var(--ic-action-dark);--button-default-hover:var(--ic-action-dark);--button-default-active:var(--ic-action-dark);--button-default-background-hover:var(--ic-action-dark-bg-hover);--button-default-background-active:var(--ic-action-dark-bg-active)}:host(.light) .button{--button-default:var(--ic-action-light);--button-default-hover:var(--ic-action-light);--button-default-active:var(--ic-action-light);--button-default-background-hover:var(--ic-action-light-bg-hover);--button-default-background-active:var(--ic-action-light-bg-active)}:host(.button-variant-primary.light) .button{color:var(--ic-color-primary-text);--button-default-hover:var(--ic-action-light-hover);--button-default-active:var(--ic-action-light-active)}:host(.button-variant-primary.dark) .button{--button-default-hover:var(--ic-action-dark-hover);--button-default-active:var(--ic-action-dark-active)}:host(.disabled),:host(.disabled) .button,:host(.loading),:host(.loading) .button{pointer-events:none}:host(.button-variant-primary) .button{color:var(--ic-architectural-white);background-color:var(--button-default)}:host(.button-variant-primary) .button:hover:not(:focus){background-color:var(--button-default-hover)}:host(.button-variant-primary) .button:active:not(:focus),:host(.button-variant-primary.loading) .button{background-color:var(--button-default-active)}:host(.button-variant-primary.disabled) .button{background:var(--ic-architectural-200);color:var(--ic-architectural-300)}:host(.button-variant-primary.light.disabled) .button{background:var(--ic-architectural-600);color:var(--ic-architectural-500)}:host(.button-variant-secondary) .button{border:var(--ic-space-1px) solid var(--button-default);color:var(--button-default)}:host(.button-variant-secondary) .button:hover:not(:focus){background-color:var(--button-default-background-hover);border-color:var(--button-default-hover);color:var(--button-default-hover)}:host(.button-variant-secondary) .button:active:not(:focus){border-color:var(--button-default-active);background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-secondary.loading) .button{border-color:var(--button-default-active);background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-secondary.disabled) .button,:host(.button-variant-secondary.disabled) .button:hover,:host(.button-variant-secondary.disabled) .button:active{border-color:var(--ic-architectural-300);color:var(--ic-architectural-300);background:none}:host(.button-variant-secondary.light.disabled) .button,:host(.button-variant-secondary.light.disabled) .button:hover,:host(.button-variant-secondary.light.disabled) .button:active{border-color:var(--ic-architectural-500);color:var(--ic-architectural-500);background:none}:host(.button-variant-tertiary) .button{color:var(--button-default)}:host(.button-variant-tertiary) .button:hover:not(:focus){background-color:var(--button-default-background-hover);color:var(--button-default-hover)}:host(.button-variant-tertiary) .button:active:not(:focus),:host(.button-variant-tertiary.loading) .button{background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-tertiary.disabled) .button,:host(.button-variant-tertiary.disabled) .button:hover,:host(.button-variant-tertiary.disabled) .button:active{border-color:var(--ic-architectural-300);color:var(--ic-architectural-300);background:none}:host(.button-variant-tertiary.light.disabled) .button,:host(.button-variant-tertiary.light.disabled) .button:hover,:host(.button-variant-tertiary.light.disabled) .button:active{border-color:var(--ic-architectural-500);color:var(--ic-architectural-500);background:none}:host(.button-variant-icon) .button{color:var(--button-default);min-width:0}:host(.button-variant-icon) .button:hover:not(:focus){background-color:var(--button-default-background-hover);color:var(--button-default-hover)}:host(.button-variant-icon) .button:active:not(:focus),:host(.button-variant-icon.loading) .button{background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-icon.disabled) .button,:host(.button-variant-icon.disabled) .button:hover,:host(.button-variant-icon.disabled) .button:active{color:var(--ic-architectural-300);background:none}:host(.button-variant-destructive) .button{color:var(--ic-architectural-white);background-color:var(--ic-action-destructive);text-transform:uppercase}:host(.button-variant-destructive) .button:hover:not(:focus){background-color:var(--ic-action-destructive-hover)}:host(.button-variant-destructive) .button:active:not(:focus),:host(.button-variant-destructive.loading) .button{background-color:var(--ic-action-destructive-active)}:host(.button-variant-destructive.disabled) .button{background:var(--ic-architectural-200);color:var(--ic-architectural-300)}:host(.button-size-default) .button{height:2.5rem;padding:var(--ic-space-xs) var(--ic-space-md)}:host(.button-size-small) .button{height:var(--ic-space-xl);padding:var(--ic-space-xxs) var(--ic-space-md)}:host(.button-size-large) .button{height:var(--ic-space-xxl);padding:var(--ic-space-sm) var(--ic-space-md)}:host(.button-size-default.button-variant-icon) .button{height:var(--ic-space-xl);width:var(--ic-space-xl);padding:0.375rem}:host(.button-size-small.button-variant-icon) .button{height:var(--ic-space-lg);width:var(--ic-space-lg);padding:var(--ic-space-xxs)}:host(.button-size-large.button-variant-icon) .button{height:2.5rem;width:2.5rem;padding:var(--ic-space-xs)}:host(.full-width),:host(.full-width) .button{width:100%}div.loading-container{position:relative;align-items:center;width:100%}ic-loading-indicator{--outer-color:transparent}@keyframes loading-animation{0%{width:0%;left:0%}25%{width:0%;left:0%;opacity:0}50%{width:100%;left:0%;opacity:1}75%{width:0%;left:100%}100%{width:0%;left:100%;opacity:0}}div.icon-container{box-sizing:border-box;width:var(--ic-space-lg);height:var(--ic-space-lg);display:flex;justify-content:center;align-items:center}::slotted(*){width:var(--icon-width) !important;height:var(--icon-height) !important;fill:currentcolor !important;pointer-events:none}:host(.button-variant-icon) .button .icon-container{margin:0;pointer-events:none}:host(.search-submit-button) ::slotted(svg){--icon-height:1.25rem;--icon-width:1.25rem}:host(.search-submit-button-small) ::slotted(svg){--icon-height:1rem;--icon-width:1rem}:host(.clear-button){margin:0 var(--ic-space-xxs)}:host(.clear-button) .button:focus{box-shadow:none}:host(.search-submit-button) .button:focus{box-shadow:none}:host(.search-submit-button) .button:not(:active):focus{box-shadow:none;background-color:var(--ic-action-default-bg-hover)}:host(.search-submit-button){display:flex;align-items:center;margin:0 var(--ic-space-xxs)}:host(.menu-close-button) ::slotted(svg){--icon-height:0.875rem;--icon-width:0.875rem}:host(.popout-menu-button) .button{justify-content:left;border-radius:0;white-space:pre-line;text-align:start}:host(.popout-menu-button) div.icon-container{flex:none}:host(.popout-menu-button) .button:focus{box-shadow:var(--ic-border-focus-inset);border-radius:var(--ic-border-radius-inset)}.ic-button-describedby{display:none}:host .ic-tooltip{display:block}@media (forced-colors: active){.button{border:0.125rem solid transparent}}";
|
8
|
+
const icButtonCss = "/*! 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;--button-default:var(--ic-action-default);--button-default-hover:var(--ic-action-default-hover);--button-default-active:var(--ic-action-default-active);--button-default-background-hover:var(--ic-action-default-bg-hover);--button-default-background-active:var(--ic-action-default-bg-active);--icon-width:100%;--icon-height:100%}.button{font-family:var(--ic-font-body-family);text-decoration:none;font-weight:600;font-size:0.875rem;transition:var(--ic-easing-transition-fast);border-radius:var(--ic-border-radius);min-width:var(--min-width, 6.25rem);display:inline-flex;gap:var(--ic-space-xs);flex-direction:row;justify-content:center;align-items:center;background:none;border:none;box-sizing:border-box;white-space:nowrap;vertical-align:middle}.button:hover{cursor:pointer}.button:focus,:host .button:focus{box-shadow:var(--ic-border-focus)}:host(.light) .button:focus{box-shadow:var(--ic-border-focus)}.button:focus-visible{outline:var(--ic-hc-focus-outline)}:host(.dark) .button{--button-default:var(--ic-action-dark);--button-default-hover:var(--ic-action-dark);--button-default-active:var(--ic-action-dark);--button-default-background-hover:var(--ic-action-dark-bg-hover);--button-default-background-active:var(--ic-action-dark-bg-active)}:host(.light) .button{--button-default:var(--ic-action-light);--button-default-hover:var(--ic-action-light);--button-default-active:var(--ic-action-light);--button-default-background-hover:var(--ic-action-light-bg-hover);--button-default-background-active:var(--ic-action-light-bg-active)}:host(.button-variant-primary.light) .button{color:var(--ic-color-primary-text);--button-default-hover:var(--ic-action-light-hover);--button-default-active:var(--ic-action-light-active)}:host(.button-variant-primary.dark) .button{--button-default-hover:var(--ic-action-dark-hover);--button-default-active:var(--ic-action-dark-active)}:host(.disabled),:host(.disabled) .button,:host(.loading),:host(.loading) .button{pointer-events:none}:host(.button-variant-primary) .button{color:var(--ic-architectural-white);background-color:var(--button-default)}:host(.button-variant-primary) .button:hover:not(:focus){background-color:var(--button-default-hover)}:host(.button-variant-primary) .button:active:not(:focus),:host(.button-variant-primary.loading) .button{background-color:var(--button-default-active)}:host(.button-variant-primary.disabled) .button{background:var(--ic-architectural-200);color:var(--ic-architectural-300)}:host(.button-variant-primary.light.disabled) .button{background:var(--ic-architectural-600);color:var(--ic-architectural-500)}:host(.button-variant-secondary) .button{border:var(--ic-space-1px) solid var(--button-default);color:var(--button-default)}:host(.button-variant-secondary) .button:hover:not(:focus){background-color:var(--button-default-background-hover);border-color:var(--button-default-hover);color:var(--button-default-hover)}:host(.button-variant-secondary) .button:active:not(:focus){border-color:var(--button-default-active);background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-secondary.loading) .button{border-color:var(--button-default-active);background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-secondary.disabled) .button,:host(.button-variant-secondary.disabled) .button:hover,:host(.button-variant-secondary.disabled) .button:active{border-color:var(--ic-architectural-300);color:var(--ic-architectural-300);background:none}:host(.button-variant-secondary.light.disabled) .button,:host(.button-variant-secondary.light.disabled) .button:hover,:host(.button-variant-secondary.light.disabled) .button:active{border-color:var(--ic-architectural-500);color:var(--ic-architectural-500);background:none}:host(.button-variant-tertiary) .button{color:var(--button-default)}:host(.button-variant-tertiary) .button:hover:not(:focus){background-color:var(--button-default-background-hover);color:var(--button-default-hover)}:host(.button-variant-tertiary) .button:active:not(:focus),:host(.button-variant-tertiary.loading) .button{background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-tertiary.disabled) .button,:host(.button-variant-tertiary.disabled) .button:hover,:host(.button-variant-tertiary.disabled) .button:active{border-color:var(--ic-architectural-300);color:var(--ic-architectural-300);background:none}:host(.button-variant-tertiary.light.disabled) .button,:host(.button-variant-tertiary.light.disabled) .button:hover,:host(.button-variant-tertiary.light.disabled) .button:active{border-color:var(--ic-architectural-500);color:var(--ic-architectural-500);background:none}:host(.button-variant-icon) .button{color:var(--button-default);min-width:0}:host(.button-variant-icon) .button:hover:not(:focus){background-color:var(--button-default-background-hover);color:var(--button-default-hover)}:host(.button-variant-icon) .button:active:not(:focus),:host(.button-variant-icon.loading) .button{background-color:var(--button-default-background-active);color:var(--button-default-active)}:host(.button-variant-icon.disabled) .button,:host(.button-variant-icon.disabled) .button:hover,:host(.button-variant-icon.disabled) .button:active{color:var(--ic-architectural-300);background:none}:host(.button-variant-destructive) .button{color:var(--ic-architectural-white);background-color:var(--ic-action-destructive);text-transform:uppercase}:host(.button-variant-destructive) .button:hover:not(:focus){background-color:var(--ic-action-destructive-hover)}:host(.button-variant-destructive) .button:active:not(:focus),:host(.button-variant-destructive.loading) .button{background-color:var(--ic-action-destructive-active)}:host(.button-variant-destructive.disabled) .button{background:var(--ic-architectural-200);color:var(--ic-architectural-300)}:host(.button-size-default) .button{height:2.5rem;padding:var(--ic-space-xs) var(--ic-space-md)}:host(.button-size-small) .button{height:var(--ic-space-xl);padding:var(--ic-space-xxs) var(--ic-space-md)}:host(.button-size-large) .button{height:var(--ic-space-xxl);padding:var(--ic-space-sm) var(--ic-space-md)}:host(.button-size-default.button-variant-icon) .button{height:var(--ic-space-xl);width:var(--ic-space-xl);padding:0.375rem}:host(.button-size-small.button-variant-icon) .button{height:var(--ic-space-lg);width:var(--ic-space-lg);padding:var(--ic-space-xxs)}:host(.button-size-large.button-variant-icon) .button{height:2.5rem;width:2.5rem;padding:var(--ic-space-xs)}:host(.full-width),:host(.full-width) .button{width:100%}div.loading-container{position:relative;align-items:center;width:100%}ic-loading-indicator{--outer-color:transparent}@keyframes loading-animation{0%{width:0%;left:0%}25%{width:0%;left:0%;opacity:0}50%{width:100%;left:0%;opacity:1}75%{width:0%;left:100%}100%{width:0%;left:100%;opacity:0}}div.icon-container{box-sizing:border-box;width:var(--ic-space-lg);height:var(--ic-space-lg);display:flex;justify-content:center;align-items:center}::slotted(*){width:var(--icon-width) !important;height:var(--icon-height) !important;fill:currentcolor !important;pointer-events:none}:host(.button-variant-icon) .button .icon-container{margin:0;pointer-events:none}:host(.search-submit-button) ::slotted(svg){--icon-height:1.25rem;--icon-width:1.25rem}:host(.search-submit-button-small) ::slotted(svg){--icon-height:1rem;--icon-width:1rem}:host(.clear-button){margin:0 var(--ic-space-xxs)}:host(.clear-button) .button:focus{box-shadow:none}:host(.search-submit-button) .button:focus{box-shadow:none}:host(.search-submit-button) .button:not(:active):focus{box-shadow:none;background-color:var(--ic-action-default-bg-hover)}:host(.search-submit-button){display:flex;align-items:center;margin:0 var(--ic-space-xxs)}:host(.menu-close-button) ::slotted(svg){--icon-height:0.875rem;--icon-width:0.875rem}:host(.popout-menu-button) .button{justify-content:left;border-radius:0;white-space:pre-line;text-align:start}:host(.popout-menu-button) div.icon-container{flex:none}:host(.popout-menu-button) .button:focus{box-shadow:var(--ic-border-focus-inset);border-radius:var(--ic-border-radius-inset)}.ic-button-describedby{display:none}:host .ic-tooltip{display:block}@media (forced-colors: active){.button{border:0.125rem solid transparent}}:host(.flip) ::slotted(svg){transform:scaleX(-1)}";
|
9
9
|
|
10
10
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
11
11
|
var t = {};
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-button2.js","mappings":";;;;;;;AAAA,MAAM,WAAW,GAAG,qjVAAqjV;;;;;;;;;;;;;;AC0BzkV,IAAI,SAAS,GAAG,CAAC,CAAC;MAYL,MAAM;;;;;;;IA+FT,wBAAmB,GAA6B,EAAE,CAAC;IAEnD,eAAU,GAAY,KAAK,CAAC;IAC5B,gBAAW,G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M,GAEU,CACpB,KAEN,eAAQ,CACT,CACO,EACV;KACH,CAAC;IAEF,QACE,EAAC,IAAI,IACH,KAAK,EAAE;QACL,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,OAAO;QAC5C,CAAC,kBAAkB,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI;QACxC,CAAC,eAAe,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI;QAClC,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO;QACzB,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,KAAK,qBAAqB,CAAC,IAAI;QACxD,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,KAAK,qBAAqB,CAAC,KAAK;QAC1D,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS;OAC/B,EACD,OAAO,EAAE,IAAI,CAAC,WAAW,IAExB,IAAI,CAAC,UAAU,KACd,kBACE,KAAK,EAAE,EAAE,CAAC,kBAAkB,GAAG,IAAI,CAAC,cAAc,EAAE,EACpD,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,EAClC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,IAAI,CAAC,gBAAgB,IAEhC,EAAC,aAAa,OAAG,CACN,CACd,EAEA,CAAC,IAAI,CAAC,UAAU,IAAI,EAAC,aAAa,OAAG,CACjC,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-button/ic-button.css?tag=ic-button&encapsulation=shadow","./src/components/ic-button/ic-button.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n* @prop --min-width: Minimum width of the button.\n*/\n\n:host {\n display: inline-block;\n\n --button-default: var(--ic-action-default);\n --button-default-hover: var(--ic-action-default-hover);\n --button-default-active: var(--ic-action-default-active);\n --button-default-background-hover: var(--ic-action-default-bg-hover);\n --button-default-background-active: var(--ic-action-default-bg-active);\n --icon-width: 100%;\n --icon-height: 100%;\n}\n\n.button {\n font-family: var(--ic-font-body-family);\n text-decoration: none;\n font-weight: 600;\n font-size: 0.875rem;\n transition: var(--ic-easing-transition-fast);\n border-radius: var(--ic-border-radius);\n min-width: var(--min-width, 6.25rem);\n display: inline-flex;\n gap: var(--ic-space-xs);\n flex-direction: row;\n justify-content: center;\n align-items: center;\n background: none;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n vertical-align: middle;\n}\n\n.button:hover {\n cursor: pointer;\n}\n\n.button:focus,\n:host .button:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n:host(.light) .button:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n.button:focus-visible {\n outline: var(--ic-hc-focus-outline);\n}\n\n:host(.dark) .button {\n --button-default: var(--ic-action-dark);\n --button-default-hover: var(--ic-action-dark);\n --button-default-active: var(--ic-action-dark);\n --button-default-background-hover: var(--ic-action-dark-bg-hover);\n --button-default-background-active: var(--ic-action-dark-bg-active);\n}\n\n:host(.light) .button {\n --button-default: var(--ic-action-light);\n --button-default-hover: var(--ic-action-light);\n --button-default-active: var(--ic-action-light);\n --button-default-background-hover: var(--ic-action-light-bg-hover);\n --button-default-background-active: var(--ic-action-light-bg-active);\n}\n\n:host(.button-variant-primary.light) .button {\n color: var(--ic-color-primary-text);\n\n --button-default-hover: var(--ic-action-light-hover);\n --button-default-active: var(--ic-action-light-active);\n}\n\n:host(.button-variant-primary.dark) .button {\n --button-default-hover: var(--ic-action-dark-hover);\n --button-default-active: var(--ic-action-dark-active);\n}\n\n:host(.disabled),\n:host(.disabled) .button,\n:host(.loading),\n:host(.loading) .button {\n pointer-events: none;\n}\n\n/* Variants */\n\n/* Primary */\n\n:host(.button-variant-primary) .button {\n color: var(--ic-architectural-white);\n background-color: var(--button-default);\n}\n\n:host(.button-variant-primary) .button:hover:not(:focus) {\n background-color: var(--button-default-hover);\n}\n\n:host(.button-variant-primary) .button:active:not(:focus),\n:host(.button-variant-primary.loading) .button {\n background-color: var(--button-default-active);\n}\n\n:host(.button-variant-primary.disabled) .button {\n background: var(--ic-architectural-200);\n color: var(--ic-architectural-300);\n}\n\n:host(.button-variant-primary.light.disabled) .button {\n background: var(--ic-architectural-600);\n color: var(--ic-architectural-500);\n}\n\n/* Secondary */\n\n:host(.button-variant-secondary) .button {\n border: var(--ic-space-1px) solid var(--button-default);\n color: var(--button-default);\n}\n\n:host(.button-variant-secondary) .button:hover:not(:focus) {\n background-color: var(--button-default-background-hover);\n border-color: var(--button-default-hover);\n color: var(--button-default-hover);\n}\n\n:host(.button-variant-secondary) .button:active:not(:focus) {\n border-color: var(--button-default-active);\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-secondary.loading) .button {\n border-color: var(--button-default-active);\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-secondary.disabled) .button,\n:host(.button-variant-secondary.disabled) .button:hover,\n:host(.button-variant-secondary.disabled) .button:active {\n border-color: var(--ic-architectural-300);\n color: var(--ic-architectural-300);\n background: none;\n}\n\n:host(.button-variant-secondary.light.disabled) .button,\n:host(.button-variant-secondary.light.disabled) .button:hover,\n:host(.button-variant-secondary.light.disabled) .button:active {\n border-color: var(--ic-architectural-500);\n color: var(--ic-architectural-500);\n background: none;\n}\n\n/* Tertiary */\n\n:host(.button-variant-tertiary) .button {\n color: var(--button-default);\n}\n\n:host(.button-variant-tertiary) .button:hover:not(:focus) {\n background-color: var(--button-default-background-hover);\n color: var(--button-default-hover);\n}\n\n:host(.button-variant-tertiary) .button:active:not(:focus),\n:host(.button-variant-tertiary.loading) .button {\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-tertiary.disabled) .button,\n:host(.button-variant-tertiary.disabled) .button:hover,\n:host(.button-variant-tertiary.disabled) .button:active {\n border-color: var(--ic-architectural-300);\n color: var(--ic-architectural-300);\n background: none;\n}\n\n:host(.button-variant-tertiary.light.disabled) .button,\n:host(.button-variant-tertiary.light.disabled) .button:hover,\n:host(.button-variant-tertiary.light.disabled) .button:active {\n border-color: var(--ic-architectural-500);\n color: var(--ic-architectural-500);\n background: none;\n}\n\n/* Icon */\n\n:host(.button-variant-icon) .button {\n color: var(--button-default);\n min-width: 0;\n}\n\n:host(.button-variant-icon) .button:hover:not(:focus) {\n background-color: var(--button-default-background-hover);\n color: var(--button-default-hover);\n}\n\n:host(.button-variant-icon) .button:active:not(:focus),\n:host(.button-variant-icon.loading) .button {\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-icon.disabled) .button,\n:host(.button-variant-icon.disabled) .button:hover,\n:host(.button-variant-icon.disabled) .button:active {\n color: var(--ic-architectural-300);\n background: none;\n}\n\n/* Destructive */\n\n:host(.button-variant-destructive) .button {\n color: var(--ic-architectural-white);\n background-color: var(--ic-action-destructive);\n text-transform: uppercase;\n}\n\n:host(.button-variant-destructive) .button:hover:not(:focus) {\n background-color: var(--ic-action-destructive-hover);\n}\n\n:host(.button-variant-destructive) .button:active:not(:focus),\n:host(.button-variant-destructive.loading) .button {\n background-color: var(--ic-action-destructive-active);\n}\n\n:host(.button-variant-destructive.disabled) .button {\n background: var(--ic-architectural-200);\n color: var(--ic-architectural-300);\n}\n\n/* Sizing */\n\n:host(.button-size-default) .button {\n height: 2.5rem;\n padding: var(--ic-space-xs) var(--ic-space-md);\n}\n\n:host(.button-size-small) .button {\n height: var(--ic-space-xl);\n padding: var(--ic-space-xxs) var(--ic-space-md);\n}\n\n:host(.button-size-large) .button {\n height: var(--ic-space-xxl);\n padding: var(--ic-space-sm) var(--ic-space-md);\n}\n\n:host(.button-size-default.button-variant-icon) .button {\n height: var(--ic-space-xl);\n width: var(--ic-space-xl);\n padding: 0.375rem;\n}\n\n:host(.button-size-small.button-variant-icon) .button {\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n padding: var(--ic-space-xxs);\n}\n\n:host(.button-size-large.button-variant-icon) .button {\n height: 2.5rem;\n width: 2.5rem;\n padding: var(--ic-space-xs);\n}\n\n/* Width */\n:host(.full-width),\n:host(.full-width) .button {\n width: 100%;\n}\n\n/* Loading */\n\ndiv.loading-container {\n position: relative;\n align-items: center;\n width: 100%;\n}\n\nic-loading-indicator {\n --outer-color: transparent;\n}\n\n@keyframes loading-animation {\n 0% {\n width: 0%;\n left: 0%;\n }\n\n 25% {\n width: 0%;\n left: 0%;\n opacity: 0;\n }\n\n 50% {\n width: 100%;\n left: 0%;\n opacity: 1;\n }\n\n 75% {\n width: 0%;\n left: 100%;\n }\n\n 100% {\n width: 0%;\n left: 100%;\n opacity: 0;\n }\n}\n\n/* Icons */\n\ndiv.icon-container {\n box-sizing: border-box;\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n::slotted(*) {\n width: var(--icon-width) !important;\n height: var(--icon-height) !important;\n fill: currentcolor !important;\n pointer-events: none;\n}\n\n:host(.button-variant-icon) .button .icon-container {\n margin: 0;\n pointer-events: none;\n}\n\n/** SEARCH **/\n\n:host(.search-submit-button) ::slotted(svg) {\n --icon-height: 1.25rem;\n --icon-width: 1.25rem;\n}\n\n:host(.search-submit-button-small) ::slotted(svg) {\n --icon-height: 1rem;\n --icon-width: 1rem;\n}\n\n:host(.clear-button) {\n margin: 0 var(--ic-space-xxs);\n}\n\n:host(.clear-button) .button:focus {\n box-shadow: none;\n}\n\n:host(.search-submit-button) .button:focus {\n box-shadow: none;\n}\n\n:host(.search-submit-button) .button:not(:active):focus {\n box-shadow: none;\n background-color: var(--ic-action-default-bg-hover);\n}\n\n:host(.search-submit-button) {\n display: flex;\n align-items: center;\n margin: 0 var(--ic-space-xxs);\n}\n\n:host(.menu-close-button) ::slotted(svg) {\n --icon-height: 0.875rem;\n --icon-width: 0.875rem;\n}\n\n:host(.popout-menu-button) .button {\n justify-content: left;\n border-radius: 0;\n white-space: pre-line;\n text-align: start;\n}\n\n:host(.popout-menu-button) div.icon-container {\n flex: none;\n}\n\n:host(.popout-menu-button) .button:focus {\n box-shadow: var(--ic-border-focus-inset);\n border-radius: var(--ic-border-radius-inset);\n}\n\n.ic-button-describedby {\n display: none;\n}\n\n:host .ic-tooltip {\n display: block;\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n .button {\n border: 0.125rem solid transparent;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n h,\n} from \"@stencil/core\";\n\nimport { getThemeFromContext, inheritAttributes } from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonSizes,\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Content will be placed to the left of the button label.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n @Element() el: HTMLIcButtonElement;\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n /**\n * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n /**\n * 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 * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\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 * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n /**\n * The size of the button to be displayed.\n */\n @Prop() size?: IcButtonSizes = \"default\";\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n /**\n * The position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n private inheritedAttributes: { [k: string]: unknown } = {};\n private buttonEl: HTMLElement;\n private hasTooltip: boolean = false;\n private buttonIdNum = buttonIds++;\n private tooltipEl: HTMLIcTooltipElement;\n private id: string;\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n }\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 /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n /**\n * @internal Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change.\n */\n @Method()\n async updateAriaLabel(newValue: string): Promise<void> {\n if (this.hasTooltip) {\n this.tooltipEl.label = newValue;\n this.buttonEl.setAttribute(\"aria-label\", newValue);\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n if (iconEl != null) {\n return true;\n }\n return false;\n }\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"aria-expanded\",\n \"title\",\n ]);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.hasTooltip = this.variant === \"icon\";\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n }\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = this.inheritedAttributes;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n const newTitle = title && (title as string);\n const titleAttr = this.hasTooltip ? {} : { title: newTitle };\n let tooltipText = \"\";\n if (this.hasTooltip) {\n if (newTitle !== undefined) {\n tooltipText = newTitle;\n } else if (ariaLabel !== null) {\n tooltipText = ariaLabel as string;\n }\n }\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy = `ic-tooltip-${buttonId}`;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...restInheritedAttributes}\n {...titleAttr}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n id={buttonId}\n aria-describedby={describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n }}\n onClick={this.handleClick}\n >\n {this.hasTooltip && (\n <ic-tooltip\n class={{ [\"tooltip-disabled\"]: this.disableTooltip }}\n ref={(el) => (this.tooltipEl = el)}\n label={tooltipText}\n target={buttonId}\n placement={this.tooltipPlacement}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n\n {!this.hasTooltip && <ButtonContent />}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-button2.js","mappings":";;;;;;;AAAA,MAAM,WAAW,GAAG,smVAAsmV;;;;;;;;;;;;;;AC0B1nV,IAAI,SAAS,GAAG,CAAC,CAAC;MAYL,MAAM;;;;;;;IA+FT,wBAAmB,GAA6B,EAAE,CAAC;IAEnD,eAAU,GAAY,KAAK,CAAC;IAC5B,gBAAW,GAAG,SAAS,EAAE,CAAC;IA0D1B,gBAAW,GAAG;MACpB,IACE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,OAAO;QACtD,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EACzB;QACA,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;OAC3D;KACF,CAAC;IAEM,YAAO,GAAG;MAChB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;KACrB,CAAC;IAEM,WAAM,GAAG;MACf,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KACpB,CAAC;oBAtK2B,KAAK;mBAIN,KAAK;gBAIF,QAAQ;;;;oBAgBD,KAAK;;;mBAYN,SAAS;gBAIf,SAAS;qBAIV,KAAK;0BAIA,KAAK;4BAIc,QAAQ;sBAIJ,SAAS;;;;;;;;EA0CnE,eAAe,CAAC,KAAY;IAC1B,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAA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AAK,EAAE,WAAW,EAClB,MAAM,EAAE,QAAQ,EAChB,SAAS,EAAE,IAAI,CAAC,gBAAgB,IAEhC,EAAC,aAAa,OAAG,CACN,CACd,EAEA,CAAC,IAAI,CAAC,UAAU,IAAI,EAAC,aAAa,OAAG,CACjC,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-button/ic-button.css?tag=ic-button&encapsulation=shadow","./src/components/ic-button/ic-button.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n* @prop --min-width: Minimum width of the button.\n*/\n\n:host {\n display: inline-block;\n\n --button-default: var(--ic-action-default);\n --button-default-hover: var(--ic-action-default-hover);\n --button-default-active: var(--ic-action-default-active);\n --button-default-background-hover: var(--ic-action-default-bg-hover);\n --button-default-background-active: var(--ic-action-default-bg-active);\n --icon-width: 100%;\n --icon-height: 100%;\n}\n\n.button {\n font-family: var(--ic-font-body-family);\n text-decoration: none;\n font-weight: 600;\n font-size: 0.875rem;\n transition: var(--ic-easing-transition-fast);\n border-radius: var(--ic-border-radius);\n min-width: var(--min-width, 6.25rem);\n display: inline-flex;\n gap: var(--ic-space-xs);\n flex-direction: row;\n justify-content: center;\n align-items: center;\n background: none;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n vertical-align: middle;\n}\n\n.button:hover {\n cursor: pointer;\n}\n\n.button:focus,\n:host .button:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n:host(.light) .button:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n.button:focus-visible {\n outline: var(--ic-hc-focus-outline);\n}\n\n:host(.dark) .button {\n --button-default: var(--ic-action-dark);\n --button-default-hover: var(--ic-action-dark);\n --button-default-active: var(--ic-action-dark);\n --button-default-background-hover: var(--ic-action-dark-bg-hover);\n --button-default-background-active: var(--ic-action-dark-bg-active);\n}\n\n:host(.light) .button {\n --button-default: var(--ic-action-light);\n --button-default-hover: var(--ic-action-light);\n --button-default-active: var(--ic-action-light);\n --button-default-background-hover: var(--ic-action-light-bg-hover);\n --button-default-background-active: var(--ic-action-light-bg-active);\n}\n\n:host(.button-variant-primary.light) .button {\n color: var(--ic-color-primary-text);\n\n --button-default-hover: var(--ic-action-light-hover);\n --button-default-active: var(--ic-action-light-active);\n}\n\n:host(.button-variant-primary.dark) .button {\n --button-default-hover: var(--ic-action-dark-hover);\n --button-default-active: var(--ic-action-dark-active);\n}\n\n:host(.disabled),\n:host(.disabled) .button,\n:host(.loading),\n:host(.loading) .button {\n pointer-events: none;\n}\n\n/* Variants */\n\n/* Primary */\n\n:host(.button-variant-primary) .button {\n color: var(--ic-architectural-white);\n background-color: var(--button-default);\n}\n\n:host(.button-variant-primary) .button:hover:not(:focus) {\n background-color: var(--button-default-hover);\n}\n\n:host(.button-variant-primary) .button:active:not(:focus),\n:host(.button-variant-primary.loading) .button {\n background-color: var(--button-default-active);\n}\n\n:host(.button-variant-primary.disabled) .button {\n background: var(--ic-architectural-200);\n color: var(--ic-architectural-300);\n}\n\n:host(.button-variant-primary.light.disabled) .button {\n background: var(--ic-architectural-600);\n color: var(--ic-architectural-500);\n}\n\n/* Secondary */\n\n:host(.button-variant-secondary) .button {\n border: var(--ic-space-1px) solid var(--button-default);\n color: var(--button-default);\n}\n\n:host(.button-variant-secondary) .button:hover:not(:focus) {\n background-color: var(--button-default-background-hover);\n border-color: var(--button-default-hover);\n color: var(--button-default-hover);\n}\n\n:host(.button-variant-secondary) .button:active:not(:focus) {\n border-color: var(--button-default-active);\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-secondary.loading) .button {\n border-color: var(--button-default-active);\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-secondary.disabled) .button,\n:host(.button-variant-secondary.disabled) .button:hover,\n:host(.button-variant-secondary.disabled) .button:active {\n border-color: var(--ic-architectural-300);\n color: var(--ic-architectural-300);\n background: none;\n}\n\n:host(.button-variant-secondary.light.disabled) .button,\n:host(.button-variant-secondary.light.disabled) .button:hover,\n:host(.button-variant-secondary.light.disabled) .button:active {\n border-color: var(--ic-architectural-500);\n color: var(--ic-architectural-500);\n background: none;\n}\n\n/* Tertiary */\n\n:host(.button-variant-tertiary) .button {\n color: var(--button-default);\n}\n\n:host(.button-variant-tertiary) .button:hover:not(:focus) {\n background-color: var(--button-default-background-hover);\n color: var(--button-default-hover);\n}\n\n:host(.button-variant-tertiary) .button:active:not(:focus),\n:host(.button-variant-tertiary.loading) .button {\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-tertiary.disabled) .button,\n:host(.button-variant-tertiary.disabled) .button:hover,\n:host(.button-variant-tertiary.disabled) .button:active {\n border-color: var(--ic-architectural-300);\n color: var(--ic-architectural-300);\n background: none;\n}\n\n:host(.button-variant-tertiary.light.disabled) .button,\n:host(.button-variant-tertiary.light.disabled) .button:hover,\n:host(.button-variant-tertiary.light.disabled) .button:active {\n border-color: var(--ic-architectural-500);\n color: var(--ic-architectural-500);\n background: none;\n}\n\n/* Icon */\n\n:host(.button-variant-icon) .button {\n color: var(--button-default);\n min-width: 0;\n}\n\n:host(.button-variant-icon) .button:hover:not(:focus) {\n background-color: var(--button-default-background-hover);\n color: var(--button-default-hover);\n}\n\n:host(.button-variant-icon) .button:active:not(:focus),\n:host(.button-variant-icon.loading) .button {\n background-color: var(--button-default-background-active);\n color: var(--button-default-active);\n}\n\n:host(.button-variant-icon.disabled) .button,\n:host(.button-variant-icon.disabled) .button:hover,\n:host(.button-variant-icon.disabled) .button:active {\n color: var(--ic-architectural-300);\n background: none;\n}\n\n/* Destructive */\n\n:host(.button-variant-destructive) .button {\n color: var(--ic-architectural-white);\n background-color: var(--ic-action-destructive);\n text-transform: uppercase;\n}\n\n:host(.button-variant-destructive) .button:hover:not(:focus) {\n background-color: var(--ic-action-destructive-hover);\n}\n\n:host(.button-variant-destructive) .button:active:not(:focus),\n:host(.button-variant-destructive.loading) .button {\n background-color: var(--ic-action-destructive-active);\n}\n\n:host(.button-variant-destructive.disabled) .button {\n background: var(--ic-architectural-200);\n color: var(--ic-architectural-300);\n}\n\n/* Sizing */\n\n:host(.button-size-default) .button {\n height: 2.5rem;\n padding: var(--ic-space-xs) var(--ic-space-md);\n}\n\n:host(.button-size-small) .button {\n height: var(--ic-space-xl);\n padding: var(--ic-space-xxs) var(--ic-space-md);\n}\n\n:host(.button-size-large) .button {\n height: var(--ic-space-xxl);\n padding: var(--ic-space-sm) var(--ic-space-md);\n}\n\n:host(.button-size-default.button-variant-icon) .button {\n height: var(--ic-space-xl);\n width: var(--ic-space-xl);\n padding: 0.375rem;\n}\n\n:host(.button-size-small.button-variant-icon) .button {\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n padding: var(--ic-space-xxs);\n}\n\n:host(.button-size-large.button-variant-icon) .button {\n height: 2.5rem;\n width: 2.5rem;\n padding: var(--ic-space-xs);\n}\n\n/* Width */\n:host(.full-width),\n:host(.full-width) .button {\n width: 100%;\n}\n\n/* Loading */\n\ndiv.loading-container {\n position: relative;\n align-items: center;\n width: 100%;\n}\n\nic-loading-indicator {\n --outer-color: transparent;\n}\n\n@keyframes loading-animation {\n 0% {\n width: 0%;\n left: 0%;\n }\n\n 25% {\n width: 0%;\n left: 0%;\n opacity: 0;\n }\n\n 50% {\n width: 100%;\n left: 0%;\n opacity: 1;\n }\n\n 75% {\n width: 0%;\n left: 100%;\n }\n\n 100% {\n width: 0%;\n left: 100%;\n opacity: 0;\n }\n}\n\n/* Icons */\n\ndiv.icon-container {\n box-sizing: border-box;\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n::slotted(*) {\n width: var(--icon-width) !important;\n height: var(--icon-height) !important;\n fill: currentcolor !important;\n pointer-events: none;\n}\n\n:host(.button-variant-icon) .button .icon-container {\n margin: 0;\n pointer-events: none;\n}\n\n/** SEARCH **/\n\n:host(.search-submit-button) ::slotted(svg) {\n --icon-height: 1.25rem;\n --icon-width: 1.25rem;\n}\n\n:host(.search-submit-button-small) ::slotted(svg) {\n --icon-height: 1rem;\n --icon-width: 1rem;\n}\n\n:host(.clear-button) {\n margin: 0 var(--ic-space-xxs);\n}\n\n:host(.clear-button) .button:focus {\n box-shadow: none;\n}\n\n:host(.search-submit-button) .button:focus {\n box-shadow: none;\n}\n\n:host(.search-submit-button) .button:not(:active):focus {\n box-shadow: none;\n background-color: var(--ic-action-default-bg-hover);\n}\n\n:host(.search-submit-button) {\n display: flex;\n align-items: center;\n margin: 0 var(--ic-space-xxs);\n}\n\n:host(.menu-close-button) ::slotted(svg) {\n --icon-height: 0.875rem;\n --icon-width: 0.875rem;\n}\n\n:host(.popout-menu-button) .button {\n justify-content: left;\n border-radius: 0;\n white-space: pre-line;\n text-align: start;\n}\n\n:host(.popout-menu-button) div.icon-container {\n flex: none;\n}\n\n:host(.popout-menu-button) .button:focus {\n box-shadow: var(--ic-border-focus-inset);\n border-radius: var(--ic-border-radius-inset);\n}\n\n.ic-button-describedby {\n display: none;\n}\n\n:host .ic-tooltip {\n display: block;\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n .button {\n border: 0.125rem solid transparent;\n }\n}\n\n/** Pagination **/\n\n:host(.flip) ::slotted(svg) {\n transform: scaleX(-1);\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n h,\n} from \"@stencil/core\";\n\nimport { getThemeFromContext, inheritAttributes } from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonSizes,\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Content will be placed to the left of the button label.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n @Element() el: HTMLIcButtonElement;\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n /**\n * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n /**\n * 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 * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\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 * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n /**\n * The size of the button to be displayed.\n */\n @Prop() size?: IcButtonSizes = \"default\";\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n /**\n * The position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n private inheritedAttributes: { [k: string]: unknown } = {};\n private buttonEl: HTMLElement;\n private hasTooltip: boolean = false;\n private buttonIdNum = buttonIds++;\n private tooltipEl: HTMLIcTooltipElement;\n private id: string;\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n }\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 /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n /**\n * @internal Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change.\n */\n @Method()\n async updateAriaLabel(newValue: string): Promise<void> {\n if (this.hasTooltip) {\n this.tooltipEl.label = newValue;\n this.buttonEl.setAttribute(\"aria-label\", newValue);\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n if (iconEl != null) {\n return true;\n }\n return false;\n }\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"aria-expanded\",\n \"title\",\n ]);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.hasTooltip = this.variant === \"icon\";\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n }\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = this.inheritedAttributes;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n const newTitle = title && (title as string);\n const titleAttr = this.hasTooltip ? {} : { title: newTitle };\n let tooltipText = \"\";\n if (this.hasTooltip) {\n if (newTitle !== undefined) {\n tooltipText = newTitle;\n } else if (ariaLabel !== null) {\n tooltipText = ariaLabel as string;\n }\n }\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy = `ic-tooltip-${buttonId}`;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...restInheritedAttributes}\n {...titleAttr}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n id={buttonId}\n aria-describedby={describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n }}\n onClick={this.handleClick}\n >\n {this.hasTooltip && (\n <ic-tooltip\n class={{ [\"tooltip-disabled\"]: this.disableTooltip }}\n ref={(el) => (this.tooltipEl = el)}\n label={tooltipText}\n target={buttonId}\n placement={this.tooltipPlacement}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n\n {!this.hasTooltip && <ButtonContent />}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import { g as getCurrentDeviceSize, I as IC_DEVICE_SIZES, k as getThemeForegroundColor, c as checkResizeObserver, l as hasClassificationBanner } from './helpers.js';
|
2
|
+
import { g as getCurrentDeviceSize, I as IC_DEVICE_SIZES, k as getThemeForegroundColor, c as checkResizeObserver, i as isSlotUsed, l as hasClassificationBanner } from './helpers.js';
|
3
3
|
import { I as IcThemeForegroundEnum } from './types.js';
|
4
4
|
import { d as defineCustomElement$3 } from './ic-section-container2.js';
|
5
5
|
import { d as defineCustomElement$2 } from './ic-typography2.js';
|
@@ -72,7 +72,9 @@ const Footer = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
72
72
|
// Slots will be able to infer their own color
|
73
73
|
[IcThemeForegroundEnum.Dark]: foregroundColor === IcThemeForegroundEnum.Dark,
|
74
74
|
[IcThemeForegroundEnum.Light]: foregroundColor === IcThemeForegroundEnum.Light,
|
75
|
-
} }, h("footer", { ref: (footerEl) => (this.footerEl = footerEl) }, h("div", { class: "footer-description" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-description-inner" }, h("ic-typography", { variant: "body" }, h("slot", { name: "description" }, description))))), h("div", { class: "footer-links" }, groupLinks && small ? (h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))) : (h("ic-section-container", { fullHeight: true, aligned: aligned }, h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))))), h("div", { class: "footer-compliance" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-compliance-inner" }, h("div", { class: "footer-logo" }, h("slot", { name: "logo" })), h("div", { class: "footer-caption" }, h("ic-typography", { variant: this.deviceSize <= IC_DEVICE_SIZES.M
|
75
|
+
} }, h("footer", { ref: (footerEl) => (this.footerEl = footerEl) }, h("div", { class: "footer-description" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-description-inner" }, h("ic-typography", { variant: "body" }, h("slot", { name: "description" }, description))))), h("div", { class: "footer-links" }, groupLinks && small ? (h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))) : (h("ic-section-container", { fullHeight: true, aligned: aligned }, h("div", { class: "footer-links-inner" }, h("slot", { name: "link" }))))), h("div", { class: "footer-compliance" }, h("ic-section-container", { aligned: aligned, fullHeight: true }, h("div", { class: "footer-compliance-inner" }, isSlotUsed(this.el, "logo") && (h("div", { class: "footer-logo" }, h("slot", { name: "logo" }))), (isSlotUsed(this.el, "caption") || caption) && (h("div", { class: "footer-caption" }, h("ic-typography", { variant: this.deviceSize <= IC_DEVICE_SIZES.M
|
76
|
+
? "caption"
|
77
|
+
: "body" }, h("slot", { name: "caption" }, caption)))), copyright && (h("div", { class: {
|
76
78
|
["footer-copyright"]: true,
|
77
79
|
["classification-spacing"]: hasClassificationBanner(),
|
78
80
|
} }, h("ic-typography", { variant: this.deviceSize <= IC_DEVICE_SIZES.M
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-footer.js","mappings":";;;;;;AAAA,MAAM,WAAW,GAAG,skIAAskI;;MCsC7kI,MAAM;;;;;;IAmET,2BAAsB,GAAG,CAAC,QAAgB;MAChD,IAAI,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE;QAChC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;OAC5B;MACD,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;KAC3B,CAAC;IAEM,sBAAiB,GAAG;MAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC;QACvC,MAAM,QAAQ,GAAG,oBAAoB,EAAE,CAAC;QACxC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;OACvC,CAAC,CAAC;MAEH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAC5C,CAAC;;mBAjE8B,MAAM;sBAKK,QAAQ;sBAKpB,KAAK;;qBAUP,IAAI;sBAEH,eAAe,CAAC,EAAE;2BAEF,uBAAuB,EAAE;;EAE/D,OAAO;IACb,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;IAE3B,OAAO,EAAE,KAAK,aAAa;QACvB,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC,EAAE;QACpC,EAAE,KAAK,OAAO;UACd,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC,CAAC;UACnC,EAAE,KAAK,QAAQ;YACf,IAAI,CAAC,UAAU,GAAG,eAAe,CAAC,CAAC;YACnC,EAAE,KAAK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tD,WAAK,KAAK,EAAC,0BAA0B,IACnC,qBAAe,OAAO,EAAC,MAAM,IAC3B,YAAM,IAAI,EAAC,aAAa,IAAE,WAAW,CAAQ,CAC/B,CACZ,CACe,CACnB,EAGN,WAAK,KAAK,EAAC,cAAc,IACtB,UAAU,IAAI,KAAK,IAClB,WAAK,KAAK,EAAC,oBAAoB,IAC7B,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,KAEN,4BAAsB,UAAU,QAAC,OAAO,EAAE,OAAO,IAC/C,WAAK,KAAK,EAAC,oBAAoB,IAC7B,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACe,CACxB,CACG,EAGN,WAAK,KAAK,EAAC,mBAAmB,IAC5B,4BAAsB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,IACtD,WAAK,KAAK,EAAC,yBAAyB,IAClC,WAAK,KAAK,EAAC,aAAa,IAEtB,YAAM,IAAI,EAAC,MAAM,GAAG,CAChB,EACN,WAAK,KAAK,EAAC,gBAAgB,IACzB,qBACE,OAAO,EACL,IAAI,CAAC,UAAU,IAAI,eAAe,CAAC,CAAC,GAAG,SAAS,GAAG,MAAM,IAG3D,YAAM,IAAI,EAAC,SAAS,IAAE,OAAO,CAAQ,CACvB,CACZ,EACL,SAAS,KACR,WACE,KAAK,EAAE;QACL,CAAC,kBAAkB,GAAG,IAAI;QAC1B,CAAC,wBAAwB,GAAG,uBAAuB,EAAE;OACtD,IAED,qBACE,OAAO,EACL,IAAI,CAAC,UAAU,IAAI,eAAe,CAAC,CAAC;UAChC,mBAAmB;UACnB,iBAAiB,6BAIT,CACZ,CACP,CACG,CACe,CACnB,CACC,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-footer/ic-footer.css?tag=ic-footer&encapsulation=shadow","./src/components/ic-footer/ic-footer.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\n:host(.footer-sparse) {\n --footer-links-padding: 1.5rem 0;\n --footer-compliance-padding: 1.5rem 0 0.5rem 0;\n --footer-logo-margin-bottom: var(--ic-space-lg);\n --footer-link-inner-flex-direction: row;\n}\n\n:host(.footer-small) {\n --footer-links-padding: 0 0;\n --footer-compliance-padding: 1rem 0 0.5rem;\n --footer-logo-margin-bottom: var(--ic-space-md);\n --footer-link-inner-flex-direction: column;\n}\n\n:host(.footer-light) {\n --footer-theme-secondary: var(--ic-theme-secondary);\n --footer-theme-tertiary: var(--ic-theme-tertiary);\n --footer-keyline: var(--ic-keyline-lighten);\n}\n\n:host(.footer-dark) {\n --footer-theme-secondary: var(--ic-theme-secondary-light);\n --footer-theme-tertiary: var(--ic-theme-tertiary-light);\n --footer-keyline: var(--ic-keyline-darken);\n}\n\n:host(.footer-small.footer-ungrouped) {\n --footer-links-padding: var(--ic-space-md) 0 0 0;\n}\n\n/* Main inner footer element */\nfooter {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n/* Description */\n\n.footer-description {\n background-color: var(--footer-theme-secondary);\n color: var(--ic-theme-text);\n border-bottom: var(--footer-keyline);\n}\n\n.footer-description-inner {\n padding: 1rem 0;\n}\n\n/* Links */\n\n.footer-links {\n padding: var(--footer-links-padding);\n background-color: var(--footer-theme-secondary);\n color: var(--ic-theme-text);\n}\n\n.footer-links-inner {\n display: flex;\n flex-direction: var(--footer-link-inner-flex-direction);\n}\n\n/* Compliance */\n\n.footer-compliance {\n background-color: var(--footer-theme-tertiary);\n color: var(--ic-theme-text);\n}\n\n.footer-compliance-inner {\n padding: var(--footer-compliance-padding);\n}\n\n.footer-logo {\n margin-bottom: var(--footer-logo-margin-bottom);\n display: flex;\n gap: var(--ic-space-xxl);\n}\n\n.footer-logo > ::slotted() {\n margin-right: var(--ic-space-md);\n}\n\n.footer-caption {\n margin-bottom: var(--ic-space-md);\n}\n\n.classification-spacing {\n margin-bottom: var(--ic-space-lg);\n}\n\n@media (forced-colors: active) {\n footer {\n border-top: var(--ic-hc-border);\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Prop,\n State,\n h,\n Host,\n Listen,\n} from \"@stencil/core\";\nimport { IC_DEVICE_SIZES } from \"../../utils/constants\";\nimport {\n getCurrentDeviceSize,\n getThemeForegroundColor,\n checkResizeObserver,\n hasClassificationBanner,\n} from \"../../utils/helpers\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport { IcFooterBreakpoints } from \"./ic-footer.types\";\n\n/**\n * @slot description - Content will be rendered at the top of the footer.\n * @slot link - Content will be rendered between description and logos.\n * @slot logo - Content will be rendered underneath footer links.\n * @slot caption - Content will be rendered above Crown Copyright.\n */\n\n@Component({\n tag: \"ic-footer\",\n styleUrl: \"ic-footer.css\",\n shadow: true,\n})\nexport class Footer {\n @Element() el: HTMLIcFooterElement;\n\n /**\n * @internal Triggers on page resize and triggers style changes in footer links and link groups\n */\n @Event() footerResized: EventEmitter<void>;\n\n /**\n * The description displayed at the top of the footer.\n */\n @Prop() description: string;\n\n /**\n * The alignment of the section containers used within the footer.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * The screen size breakpoint at which to switch to the small layout.\n */\n @Prop() breakpoint?: IcFooterBreakpoints = \"medium\";\n\n /**\n * If `true`, the footer will be set up to handle link groups instead of standalone links.\n */\n @Prop() groupLinks?: boolean = false;\n\n /**\n * The caption displayed at the bottom of the footer.\n */\n @Prop() caption: string;\n\n /**\n * If `true`, the footer will display the crown copyright at the bottom.\n */\n @Prop() copyright: boolean = true;\n\n @State() deviceSize: number = IC_DEVICE_SIZES.XL;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n private isSmall() {\n const bp = this.breakpoint;\n\n return bp === \"extra small\"\n ? this.deviceSize < IC_DEVICE_SIZES.XS\n : bp === \"small\"\n ? this.deviceSize < IC_DEVICE_SIZES.S\n : bp === \"medium\"\n ? this.deviceSize < IC_DEVICE_SIZES.M\n : bp === \"large\"\n ? this.deviceSize < IC_DEVICE_SIZES.L\n : bp === \"extra large\"\n ? this.deviceSize < IC_DEVICE_SIZES.XL\n : false;\n }\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 private resizeObserver: ResizeObserver;\n private footerEl: HTMLElement;\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n this.footerResized.emit();\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n const currSize = getCurrentDeviceSize();\n this.resizeObserverCallback(currSize);\n });\n\n this.resizeObserver.observe(this.footerEl);\n };\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n aligned,\n caption,\n copyright,\n description,\n groupLinks,\n foregroundColor,\n } = this;\n const small = this.isSmall();\n\n return (\n <Host\n class={{\n footer: true,\n [`footer-${small ? \"small\" : \"sparse\"}`]: true,\n [`footer-${groupLinks ? \"grouped\" : \"ungrouped\"}`]: true,\n [`footer-${foregroundColor}`]: true,\n // Slots will be able to infer their own color\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [IcThemeForegroundEnum.Light]:\n foregroundColor === IcThemeForegroundEnum.Light,\n }}\n >\n <footer ref={(footerEl) => (this.footerEl = footerEl)}>\n {/* Description */}\n <div class=\"footer-description\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-description-inner\">\n <ic-typography variant=\"body\">\n <slot name=\"description\">{description}</slot>\n </ic-typography>\n </div>\n </ic-section-container>\n </div>\n\n {/* Links */}\n <div class=\"footer-links\">\n {groupLinks && small ? (\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n ) : (\n <ic-section-container fullHeight aligned={aligned}>\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n </ic-section-container>\n )}\n </div>\n\n {/* Compliance (logo, caption, copyright) */}\n <div class=\"footer-compliance\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-compliance-inner\">\n <div class=\"footer-logo\">\n {/* Logo */}\n <slot name=\"logo\" />\n </div>\n <div class=\"footer-caption\">\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M ? \"caption\" : \"body\"\n }\n >\n <slot name=\"caption\">{caption}</slot>\n </ic-typography>\n </div>\n {copyright && (\n <div\n class={{\n [\"footer-copyright\"]: true,\n [\"classification-spacing\"]: hasClassificationBanner(),\n }}\n >\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption-uppercase\"\n : \"label-uppercase\"\n }\n >\n © Crown Copyright\n </ic-typography>\n </div>\n )}\n </div>\n </ic-section-container>\n </div>\n </footer>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-footer.js","mappings":";;;;;;AAAA,MAAM,WAAW,GAAG,skIAAskI;;MCuC7kI,MAAM;;;;;;IAmET,2BAAsB,GAAG,CAAC,QAAgB;MAChD,IAAI,QAAQ,KAAK,IAAI,CAAC,UAAU,EAAE;QAChC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;OAC5B;MACD,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;KAC3B,CAAC;IAEM,sBAAiB,GAAG;MAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC;QACvC,MAAM,QAAQ,GAAG,oBAAoB,EAAE,CAAC;QACxC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;OACvC,CAAC,CAAC;MAEH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAC5C,CAAC;;mBAjE8B,MAA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;UACT,MAAM,IAGZ,YAAM,IAAI,EAAC,SAAS,IAAE,OAAO,CAAQ,CACvB,CACZ,CACP,EACA,SAAS,KACR,WACE,KAAK,EAAE;QACL,CAAC,kBAAkB,GAAG,IAAI;QAC1B,CAAC,wBAAwB,GAAG,uBAAuB,EAAE;OACtD,IAED,qBACE,OAAO,EACL,IAAI,CAAC,UAAU,IAAI,eAAe,CAAC,CAAC;UAChC,mBAAmB;UACnB,iBAAiB,6BAIT,CACZ,CACP,CACG,CACe,CACnB,CACC,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-footer/ic-footer.css?tag=ic-footer&encapsulation=shadow","./src/components/ic-footer/ic-footer.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\n:host(.footer-sparse) {\n --footer-links-padding: 1.5rem 0;\n --footer-compliance-padding: 1.5rem 0 0.5rem 0;\n --footer-logo-margin-bottom: var(--ic-space-lg);\n --footer-link-inner-flex-direction: row;\n}\n\n:host(.footer-small) {\n --footer-links-padding: 0 0;\n --footer-compliance-padding: 1rem 0 0.5rem;\n --footer-logo-margin-bottom: var(--ic-space-md);\n --footer-link-inner-flex-direction: column;\n}\n\n:host(.footer-light) {\n --footer-theme-secondary: var(--ic-theme-secondary);\n --footer-theme-tertiary: var(--ic-theme-tertiary);\n --footer-keyline: var(--ic-keyline-lighten);\n}\n\n:host(.footer-dark) {\n --footer-theme-secondary: var(--ic-theme-secondary-light);\n --footer-theme-tertiary: var(--ic-theme-tertiary-light);\n --footer-keyline: var(--ic-keyline-darken);\n}\n\n:host(.footer-small.footer-ungrouped) {\n --footer-links-padding: var(--ic-space-md) 0 0 0;\n}\n\n/* Main inner footer element */\nfooter {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n/* Description */\n\n.footer-description {\n background-color: var(--footer-theme-secondary);\n color: var(--ic-theme-text);\n border-bottom: var(--footer-keyline);\n}\n\n.footer-description-inner {\n padding: 1rem 0;\n}\n\n/* Links */\n\n.footer-links {\n padding: var(--footer-links-padding);\n background-color: var(--footer-theme-secondary);\n color: var(--ic-theme-text);\n}\n\n.footer-links-inner {\n display: flex;\n flex-direction: var(--footer-link-inner-flex-direction);\n}\n\n/* Compliance */\n\n.footer-compliance {\n background-color: var(--footer-theme-tertiary);\n color: var(--ic-theme-text);\n}\n\n.footer-compliance-inner {\n padding: var(--footer-compliance-padding);\n}\n\n.footer-logo {\n margin-bottom: var(--footer-logo-margin-bottom);\n display: flex;\n gap: var(--ic-space-xxl);\n}\n\n.footer-logo > ::slotted() {\n margin-right: var(--ic-space-md);\n}\n\n.footer-caption {\n margin-bottom: var(--ic-space-md);\n}\n\n.classification-spacing {\n margin-bottom: var(--ic-space-lg);\n}\n\n@media (forced-colors: active) {\n footer {\n border-top: var(--ic-hc-border);\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Prop,\n State,\n h,\n Host,\n Listen,\n} from \"@stencil/core\";\nimport { IC_DEVICE_SIZES } from \"../../utils/constants\";\nimport {\n getCurrentDeviceSize,\n getThemeForegroundColor,\n checkResizeObserver,\n hasClassificationBanner,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport { IcFooterBreakpoints } from \"./ic-footer.types\";\n\n/**\n * @slot description - Content will be rendered at the top of the footer.\n * @slot link - Content will be rendered between description and logos.\n * @slot logo - Content will be rendered underneath footer links.\n * @slot caption - Content will be rendered above Crown Copyright.\n */\n\n@Component({\n tag: \"ic-footer\",\n styleUrl: \"ic-footer.css\",\n shadow: true,\n})\nexport class Footer {\n @Element() el: HTMLIcFooterElement;\n\n /**\n * @internal Triggers on page resize and triggers style changes in footer links and link groups\n */\n @Event() footerResized: EventEmitter<void>;\n\n /**\n * The description displayed at the top of the footer.\n */\n @Prop() description: string;\n\n /**\n * The alignment of the section containers used within the footer.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * The screen size breakpoint at which to switch to the small layout.\n */\n @Prop() breakpoint?: IcFooterBreakpoints = \"medium\";\n\n /**\n * If `true`, the footer will be set up to handle link groups instead of standalone links.\n */\n @Prop() groupLinks?: boolean = false;\n\n /**\n * The caption displayed at the bottom of the footer.\n */\n @Prop() caption: string;\n\n /**\n * If `true`, the footer will display the crown copyright at the bottom.\n */\n @Prop() copyright: boolean = true;\n\n @State() deviceSize: number = IC_DEVICE_SIZES.XL;\n\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n private isSmall() {\n const bp = this.breakpoint;\n\n return bp === \"extra small\"\n ? this.deviceSize < IC_DEVICE_SIZES.XS\n : bp === \"small\"\n ? this.deviceSize < IC_DEVICE_SIZES.S\n : bp === \"medium\"\n ? this.deviceSize < IC_DEVICE_SIZES.M\n : bp === \"large\"\n ? this.deviceSize < IC_DEVICE_SIZES.L\n : bp === \"extra large\"\n ? this.deviceSize < IC_DEVICE_SIZES.XL\n : false;\n }\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 private resizeObserver: ResizeObserver;\n private footerEl: HTMLElement;\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n this.footerResized.emit();\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n const currSize = getCurrentDeviceSize();\n this.resizeObserverCallback(currSize);\n });\n\n this.resizeObserver.observe(this.footerEl);\n };\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n this.resizeObserver.disconnect();\n }\n\n render() {\n const {\n aligned,\n caption,\n copyright,\n description,\n groupLinks,\n foregroundColor,\n } = this;\n const small = this.isSmall();\n\n return (\n <Host\n class={{\n footer: true,\n [`footer-${small ? \"small\" : \"sparse\"}`]: true,\n [`footer-${groupLinks ? \"grouped\" : \"ungrouped\"}`]: true,\n [`footer-${foregroundColor}`]: true,\n // Slots will be able to infer their own color\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [IcThemeForegroundEnum.Light]:\n foregroundColor === IcThemeForegroundEnum.Light,\n }}\n >\n <footer ref={(footerEl) => (this.footerEl = footerEl)}>\n {/* Description */}\n <div class=\"footer-description\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-description-inner\">\n <ic-typography variant=\"body\">\n <slot name=\"description\">{description}</slot>\n </ic-typography>\n </div>\n </ic-section-container>\n </div>\n\n {/* Links */}\n <div class=\"footer-links\">\n {groupLinks && small ? (\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n ) : (\n <ic-section-container fullHeight aligned={aligned}>\n <div class=\"footer-links-inner\">\n <slot name=\"link\" />\n </div>\n </ic-section-container>\n )}\n </div>\n\n {/* Compliance (logo, caption, copyright) */}\n <div class=\"footer-compliance\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-compliance-inner\">\n {isSlotUsed(this.el, \"logo\") && (\n <div class=\"footer-logo\">\n {/* Logo */}\n <slot name=\"logo\" />\n </div>\n )}\n {(isSlotUsed(this.el, \"caption\") || caption) && (\n <div class=\"footer-caption\">\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption\"\n : \"body\"\n }\n >\n <slot name=\"caption\">{caption}</slot>\n </ic-typography>\n </div>\n )}\n {copyright && (\n <div\n class={{\n [\"footer-copyright\"]: true,\n [\"classification-spacing\"]: hasClassificationBanner(),\n }}\n >\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption-uppercase\"\n : \"label-uppercase\"\n }\n >\n © Crown Copyright\n </ic-typography>\n </div>\n )}\n </div>\n </ic-section-container>\n </div>\n </footer>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -15,7 +15,7 @@ const paginationFirstLast = `<svg width="12" height="10" viewBox="0 0 12 10" fil
|
|
15
15
|
<path d="M11.1709 8.825L7.34589 5L11.1709 1.175L9.99589 0L4.99589 5L9.99589 10L11.1709 8.825ZM0.829224 0H2.49589V10H0.829224V0Z" fill="currentColour"/>
|
16
16
|
</svg>`;
|
17
17
|
|
18
|
-
const icPaginationCss = "/*! 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{box-sizing:border-box;width:100%;display:flex;justify-content:center}nav{width:100%;display:flex;flex-flow:row wrap;justify-content:flex-start;align-items:center}ic-button{cursor:pointer}ic-button.next-previous{--icon-width:var(--ic-space-xs);--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs));padding:0 var(--ic-space-xxs) 0 var(--ic-space-xxxs)}ic-button.first-last{--icon-width:calc(var(--ic-space-sm) + var(--ic-space-xxxs));--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs))}.disabled{color:var(--ic-architectural-200);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}
|
18
|
+
const icPaginationCss = "/*! 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{box-sizing:border-box;width:100%;display:flex;justify-content:center}nav{width:100%;display:flex;flex-flow:row wrap;justify-content:flex-start;align-items:center}ic-button{cursor:pointer}ic-button.next-previous{--icon-width:var(--ic-space-xs);--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs));padding:0 var(--ic-space-xxs) 0 var(--ic-space-xxxs)}ic-button.first-last{--icon-width:calc(var(--ic-space-sm) + var(--ic-space-xxxs));--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs))}.disabled{color:var(--ic-architectural-200);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.hide-current-page{display:none}";
|
19
19
|
|
20
20
|
const Pagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
21
21
|
constructor() {
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ic-pagination.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,6kGAA6kG;;MCuBxlG,UAAU;;;;;;IAsKb,qBAAgB,GAAG;MACzB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;MACrB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;IAEM,wBAAmB,GAAG;MAC5B,IAAI,CAAC,WAAW,EAAE,CAAC;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;IAEM,oBAAe,GAAG;MACxB,IAAI,CAAC,WAAW,EAAE,CAAC;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;IAEM,oBAAe,GAAG;MACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC;MAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;;IAGM,gBAAW,GAAG;MACpB,QACE,iBACE,EAAE,EAAC,mBAAmB,gBACX,kBAAkB,EAC7B,cAAc,EAAE,IAAI,EACpB,UAAU,EAAE,IAAI,C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c,EAAE,EACrB,IAAI,CAAC,gBAAgB,EAAE,EACvB,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,mBAAmB,EAAE,EAChD,IAAI,CAAC,iBAAiB,EAAE,EACxB,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAC5C,IAAI,CAAC,cAAc,EAAE,EACrB,IAAI,CAAC,UAAU,EAAE,EACjB,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAClD,CACP,CACI,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-pagination/ic-pagination.css?tag=ic-pagination&encapsulation=shadow","./src/components/ic-pagination/ic-pagination.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n justify-content: center;\n}\n\nnav {\n width: 100%;\n display: flex;\n flex-flow: row wrap;\n justify-content: flex-start;\n align-items: center;\n}\n\nic-button {\n cursor: pointer;\n}\n\nic-button.next-previous {\n --icon-width: var(--ic-space-xs);\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n\n padding: 0 var(--ic-space-xxs) 0 var(--ic-space-xxxs);\n}\n\nic-button.first-last {\n --icon-width: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n}\n\n.disabled {\n color: var(--ic-architectural-200);\n pointer-events: none;\n cursor: none;\n user-select: none;\n}\n\nic-button.flip {\n transform: scaleX(-1);\n}\n\n.hide-current-page {\n display: none;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n Listen,\n State,\n Watch,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport paginationNextPrevious from \"../../assets/pagination-next-previous.svg\";\nimport paginationFirstLast from \"../../assets/pagination-first-last.svg\";\nimport { IcThemeForeground } from \"../../interface\";\nimport { IcPaginationTypes, IcChangeEventDetail } from \"./ic-pagination.types\";\nimport { onComponentRequiredPropUndefined } from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-pagination\",\n styleUrl: \"ic-pagination.css\",\n shadow: true,\n})\nexport class Pagination {\n @Element() el: HTMLIcPaginationElement;\n\n /**\n * The total number of pages.\n */\n @Prop() pages!: number;\n /**\n * The type of pagination to be used.\n */\n @Prop() type: IcPaginationTypes = \"simple\";\n /**\n * The default page to display.\n */\n @Prop() defaultPage: number = 1;\n /**\n * The number of pages displayed adjacent to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) adjacentCount: number = 1;\n /**\n * The number of pages displayed as boundary items to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) boundaryCount: number = 1;\n /**\n * If `true`, the first and last page buttons will not be displayed.\n */\n @Prop() hideFirstAndLastPageButton: boolean = false;\n /**\n * If `true`, the current page of the simple pagination will not be displayed.\n */\n @Prop() hideCurrentPage: boolean = false;\n /**\n * If `true`, the pagination will not allow interaction.\n */\n @Prop() disabled: boolean = false;\n /**\n * The appearance of the pagination, e.g. dark, light or the default.\n */\n @Prop() appearance: IcThemeForeground = \"default\";\n /**\n * The label for the pagination item (applicable when simple pagination is being used).\n */\n @Prop() label: string = \"Page\";\n\n @State() currentPage: number = this.defaultPage;\n @State() startEllipsis: boolean = false;\n @State() endEllipsis: boolean = false;\n @State() startItems: number[] = [];\n @State() endItems: number[] = [];\n @State() midItems: number[] = [];\n\n /**\n * Emitted when a page is selected.\n */\n @Event() icPageChange: EventEmitter<IcChangeEventDetail>;\n\n @Listen(\"paginationItemClick\")\n paginationItemClickHandler(ev: CustomEvent) {\n const page = ev.detail.page;\n this.currentPage = page;\n this.icPageChange.emit({ value: this.currentPage });\n }\n\n @Watch(\"currentPage\")\n watchPageChangeHandler(): void {\n if (this.type === \"simple\") {\n return;\n }\n\n const startItems = [];\n let startItemCount = 0;\n const endItems = [];\n let endStart = this.pages;\n const midItems = [];\n let midStart;\n let midEnd;\n let startEllipsis = false;\n let endEllipsis = false;\n\n if (this.pages <= this.boundaryCount * 2 + this.adjacentCount * 2 + 3) {\n this.startEllipsis = false;\n this.endEllipsis = false;\n for (let i = 1; i <= this.pages; i++) {\n startItems.push(i);\n }\n this.startItems = startItems;\n return;\n }\n\n startItemCount = this.boundaryCount === 0 ? 1 : this.boundaryCount;\n endStart =\n this.boundaryCount === 0\n ? this.pages\n : this.pages - this.boundaryCount + 1;\n\n if (this.currentPage <= this.adjacentCount + this.boundaryCount + 2) {\n startEllipsis = false;\n endEllipsis = true;\n\n let numItems = 2 * this.adjacentCount + 1;\n if (this.boundaryCount === 0) {\n numItems--;\n }\n midStart = startItemCount + 1;\n midEnd = midStart + numItems;\n } else {\n startEllipsis = true;\n if (\n this.currentPage >\n this.pages - (this.adjacentCount + this.boundaryCount + 2)\n ) {\n let numItems = 2 * this.adjacentCount + 1;\n if (this.boundaryCount === 0) {\n numItems--;\n }\n midEnd =\n this.boundaryCount === 0\n ? this.pages - 1\n : this.pages - this.boundaryCount;\n midStart = midEnd - numItems;\n } else {\n endEllipsis = true;\n midStart = this.currentPage - this.adjacentCount;\n midEnd = this.currentPage + this.adjacentCount;\n }\n }\n\n //create array of start items\n if (\n this.boundaryCount > 0 ||\n (this.boundaryCount === 0 && startEllipsis === false)\n ) {\n for (let i = 1; i <= startItemCount; i++) {\n startItems.push(i);\n }\n }\n\n //create array of end items\n if (\n this.boundaryCount > 0 ||\n (this.boundaryCount === 0 && endEllipsis === false)\n ) {\n for (let i = endStart; i <= this.pages; i++) {\n endItems.push(i);\n }\n }\n\n //create array of mid items\n for (let i = midStart; i <= midEnd; i++) {\n midItems.push(i);\n }\n\n this.startEllipsis = startEllipsis;\n this.endEllipsis = endEllipsis;\n this.startItems = startItems;\n this.endItems = endItems;\n this.midItems = midItems;\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.pages, propName: \"pages\" }],\n \"Pagination\"\n );\n }\n\n private handleClickFirst = () => {\n this.currentPage = 1;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickPrevious = (): void => {\n this.currentPage--;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickNext = (): void => {\n this.currentPage++;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickLast = (): void => {\n this.currentPage = this.pages;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n // button rendering abstracted from component render methods for clarity\n private firstButton = () => {\n return (\n <ic-button\n id=\"first-page-button\"\n aria-label=\"Go to first page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickFirst}\n class=\"page-button first-last\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon\"\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private previousButton = () => {\n return (\n <ic-button\n id=\"previous-page-button\"\n aria-label=\"Go to previous page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickPrevious}\n class=\"page-button next-previous flip\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon\"\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private nextButton = () => {\n return (\n <ic-button\n id=\"next-page-button\"\n aria-label=\"Go to next page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickNext}\n class=\"page-button next-previous\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon\"\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private lastButton = () => {\n return (\n <ic-button\n id=\"last-page-button\"\n aria-label=\"Go to last page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickLast}\n class=\"page-button first-last flip\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon\"\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private renderStartEllipsis = () => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n type=\"ellipsis\"\n id=\"start-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderEndEllipsis = () => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n type=\"ellipsis\"\n id=\"end-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderStartItems = () => {\n return this.startItems.map((page: number) => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderEndItems = () => {\n return this.endItems.map((page: number) => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderMiddleItems = () => {\n return this.midItems.map((page: number) => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n componentWillLoad(): void {\n this.watchPageChangeHandler();\n if (this.boundaryCount > 2) {\n this.boundaryCount = 2;\n }\n if (this.adjacentCount > 2) {\n this.adjacentCount = 2;\n }\n }\n\n render() {\n const {\n type,\n pages,\n currentPage,\n hideCurrentPage,\n disabled,\n hideFirstAndLastPageButton,\n label,\n } = this;\n\n return (\n <Host>\n {type === \"simple\" && (\n <nav\n class={{\n [\"disabled\"]: disabled,\n }}\n role=\"navigation\"\n aria-label=\"Pagination Navigation\"\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n <ic-pagination-item\n pages={pages}\n appearance={this.appearance}\n type=\"simple-current\"\n page={currentPage}\n label={label}\n class={{ [\"hide-current-page\"]: hideCurrentPage }}\n />\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n {type === \"complex\" && (\n <nav\n class={{\n [\"disabled\"]: disabled,\n }}\n role=\"navigation\"\n aria-label=\"Pagination Navigation\"\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n {this.renderStartItems()}\n {this.startEllipsis && this.renderStartEllipsis()}\n {this.renderMiddleItems()}\n {this.endEllipsis && this.renderEndEllipsis()}\n {this.renderEndItems()}\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"ic-pagination.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,yiGAAyiG;;MCuBpjG,UAAU;;;;;;IAsKb,qBAAgB,GAAG;MACzB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;MACrB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;IAEM,wBAAmB,GAAG;MAC5B,IAAI,CAAC,WAAW,EAAE,CAAC;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;IAEM,oBAAe,GAAG;MACxB,IAAI,CAAC,WAAW,EAAE,CAAC;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;IAEM,oBAAe,GAAG;MACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC;MAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;KACrD,CAAC;;IAGM,gBAAW,GAAG;MACpB,QACE,iBACE,EAAE,EAAC,mBAAmB,gBACX,kBAAkB,EAC7B,cAAc,EAAE,IAAI,EACpB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,KAAK,EAAC,wBAAwB,EAC9B,QAAQ,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AAE,EAChD,IAAI,CAAC,iBAAiB,EAAE,EACxB,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAC5C,IAAI,CAAC,cAAc,EAAE,EACrB,IAAI,CAAC,UAAU,EAAE,EACjB,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAClD,CACP,CACI,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/ic-pagination/ic-pagination.css?tag=ic-pagination&encapsulation=shadow","./src/components/ic-pagination/ic-pagination.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n justify-content: center;\n}\n\nnav {\n width: 100%;\n display: flex;\n flex-flow: row wrap;\n justify-content: flex-start;\n align-items: center;\n}\n\nic-button {\n cursor: pointer;\n}\n\nic-button.next-previous {\n --icon-width: var(--ic-space-xs);\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n\n padding: 0 var(--ic-space-xxs) 0 var(--ic-space-xxxs);\n}\n\nic-button.first-last {\n --icon-width: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n}\n\n.disabled {\n color: var(--ic-architectural-200);\n pointer-events: none;\n cursor: none;\n user-select: none;\n}\n\n.hide-current-page {\n display: none;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n Listen,\n State,\n Watch,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport paginationNextPrevious from \"../../assets/pagination-next-previous.svg\";\nimport paginationFirstLast from \"../../assets/pagination-first-last.svg\";\nimport { IcThemeForeground } from \"../../interface\";\nimport { IcPaginationTypes, IcChangeEventDetail } from \"./ic-pagination.types\";\nimport { onComponentRequiredPropUndefined } from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-pagination\",\n styleUrl: \"ic-pagination.css\",\n shadow: true,\n})\nexport class Pagination {\n @Element() el: HTMLIcPaginationElement;\n\n /**\n * The total number of pages.\n */\n @Prop() pages!: number;\n /**\n * The type of pagination to be used.\n */\n @Prop() type: IcPaginationTypes = \"simple\";\n /**\n * The default page to display.\n */\n @Prop() defaultPage: number = 1;\n /**\n * The number of pages displayed adjacent to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) adjacentCount: number = 1;\n /**\n * The number of pages displayed as boundary items to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) boundaryCount: number = 1;\n /**\n * If `true`, the first and last page buttons will not be displayed.\n */\n @Prop() hideFirstAndLastPageButton: boolean = false;\n /**\n * If `true`, the current page of the simple pagination will not be displayed.\n */\n @Prop() hideCurrentPage: boolean = false;\n /**\n * If `true`, the pagination will not allow interaction.\n */\n @Prop() disabled: boolean = false;\n /**\n * The appearance of the pagination, e.g. dark, light or the default.\n */\n @Prop() appearance: IcThemeForeground = \"default\";\n /**\n * The label for the pagination item (applicable when simple pagination is being used).\n */\n @Prop() label: string = \"Page\";\n\n @State() currentPage: number = this.defaultPage;\n @State() startEllipsis: boolean = false;\n @State() endEllipsis: boolean = false;\n @State() startItems: number[] = [];\n @State() endItems: number[] = [];\n @State() midItems: number[] = [];\n\n /**\n * Emitted when a page is selected.\n */\n @Event() icPageChange: EventEmitter<IcChangeEventDetail>;\n\n @Listen(\"paginationItemClick\")\n paginationItemClickHandler(ev: CustomEvent) {\n const page = ev.detail.page;\n this.currentPage = page;\n this.icPageChange.emit({ value: this.currentPage });\n }\n\n @Watch(\"currentPage\")\n watchPageChangeHandler(): void {\n if (this.type === \"simple\") {\n return;\n }\n\n const startItems = [];\n let startItemCount = 0;\n const endItems = [];\n let endStart = this.pages;\n const midItems = [];\n let midStart;\n let midEnd;\n let startEllipsis = false;\n let endEllipsis = false;\n\n if (this.pages <= this.boundaryCount * 2 + this.adjacentCount * 2 + 3) {\n this.startEllipsis = false;\n this.endEllipsis = false;\n for (let i = 1; i <= this.pages; i++) {\n startItems.push(i);\n }\n this.startItems = startItems;\n return;\n }\n\n startItemCount = this.boundaryCount === 0 ? 1 : this.boundaryCount;\n endStart =\n this.boundaryCount === 0\n ? this.pages\n : this.pages - this.boundaryCount + 1;\n\n if (this.currentPage <= this.adjacentCount + this.boundaryCount + 2) {\n startEllipsis = false;\n endEllipsis = true;\n\n let numItems = 2 * this.adjacentCount + 1;\n if (this.boundaryCount === 0) {\n numItems--;\n }\n midStart = startItemCount + 1;\n midEnd = midStart + numItems;\n } else {\n startEllipsis = true;\n if (\n this.currentPage >\n this.pages - (this.adjacentCount + this.boundaryCount + 2)\n ) {\n let numItems = 2 * this.adjacentCount + 1;\n if (this.boundaryCount === 0) {\n numItems--;\n }\n midEnd =\n this.boundaryCount === 0\n ? this.pages - 1\n : this.pages - this.boundaryCount;\n midStart = midEnd - numItems;\n } else {\n endEllipsis = true;\n midStart = this.currentPage - this.adjacentCount;\n midEnd = this.currentPage + this.adjacentCount;\n }\n }\n\n //create array of start items\n if (\n this.boundaryCount > 0 ||\n (this.boundaryCount === 0 && startEllipsis === false)\n ) {\n for (let i = 1; i <= startItemCount; i++) {\n startItems.push(i);\n }\n }\n\n //create array of end items\n if (\n this.boundaryCount > 0 ||\n (this.boundaryCount === 0 && endEllipsis === false)\n ) {\n for (let i = endStart; i <= this.pages; i++) {\n endItems.push(i);\n }\n }\n\n //create array of mid items\n for (let i = midStart; i <= midEnd; i++) {\n midItems.push(i);\n }\n\n this.startEllipsis = startEllipsis;\n this.endEllipsis = endEllipsis;\n this.startItems = startItems;\n this.endItems = endItems;\n this.midItems = midItems;\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.pages, propName: \"pages\" }],\n \"Pagination\"\n );\n }\n\n private handleClickFirst = () => {\n this.currentPage = 1;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickPrevious = (): void => {\n this.currentPage--;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickNext = (): void => {\n this.currentPage++;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickLast = (): void => {\n this.currentPage = this.pages;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n // button rendering abstracted from component render methods for clarity\n private firstButton = () => {\n return (\n <ic-button\n id=\"first-page-button\"\n aria-label=\"Go to first page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickFirst}\n class=\"page-button first-last\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon\"\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private previousButton = () => {\n return (\n <ic-button\n id=\"previous-page-button\"\n aria-label=\"Go to previous page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickPrevious}\n class=\"page-button next-previous flip\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon\"\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private nextButton = () => {\n return (\n <ic-button\n id=\"next-page-button\"\n aria-label=\"Go to next page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickNext}\n class=\"page-button next-previous\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon\"\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private lastButton = () => {\n return (\n <ic-button\n id=\"last-page-button\"\n aria-label=\"Go to last page\"\n disableTooltip={true}\n appearance={this.appearance}\n onClick={this.handleClickLast}\n class=\"page-button first-last flip\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon\"\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private renderStartEllipsis = () => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n type=\"ellipsis\"\n id=\"start-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderEndEllipsis = () => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n type=\"ellipsis\"\n id=\"end-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderStartItems = () => {\n return this.startItems.map((page: number) => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderEndItems = () => {\n return this.endItems.map((page: number) => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderMiddleItems = () => {\n return this.midItems.map((page: number) => {\n return (\n <ic-pagination-item\n appearance={this.appearance}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n componentWillLoad(): void {\n this.watchPageChangeHandler();\n if (this.boundaryCount > 2) {\n this.boundaryCount = 2;\n }\n if (this.adjacentCount > 2) {\n this.adjacentCount = 2;\n }\n }\n\n render() {\n const {\n type,\n pages,\n currentPage,\n hideCurrentPage,\n disabled,\n hideFirstAndLastPageButton,\n label,\n } = this;\n\n return (\n <Host>\n {type === \"simple\" && (\n <nav\n class={{\n [\"disabled\"]: disabled,\n }}\n role=\"navigation\"\n aria-label=\"Pagination Navigation\"\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n <ic-pagination-item\n pages={pages}\n appearance={this.appearance}\n type=\"simple-current\"\n page={currentPage}\n label={label}\n class={{ [\"hide-current-page\"]: hideCurrentPage }}\n />\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n {type === \"complex\" && (\n <nav\n class={{\n [\"disabled\"]: disabled,\n }}\n role=\"navigation\"\n aria-label=\"Pagination Navigation\"\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n {this.renderStartItems()}\n {this.startEllipsis && this.renderStartEllipsis()}\n {this.renderMiddleItems()}\n {this.endEllipsis && this.renderEndEllipsis()}\n {this.renderEndItems()}\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|