@tmorrow/cre8-wc 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/cre8-wc.esm.js +3384 -3344
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +774 -770
- package/cdn/cre8-wc.min.js.map +1 -1
- package/lib/components/alert/alert.d.ts.map +1 -1
- package/lib/components/alert/alert.js +2 -2
- package/lib/components/alert/alert.js.map +1 -1
- package/lib/components/alert/alert.styles.js +1 -1
- package/lib/components/alert/alert.styles.js.map +1 -1
- package/lib/components/button/button.d.ts.map +1 -1
- package/lib/components/button/button.js +0 -7
- package/lib/components/button/button.js.map +1 -1
- package/lib/components/contexts/form-internals-context.d.ts +5 -0
- package/lib/components/contexts/form-internals-context.d.ts.map +1 -1
- package/lib/components/contexts/form-internals-context.js.map +1 -1
- package/lib/components/cre8-field.js +1 -1
- package/lib/components/date-picker/date-picker.d.ts +5 -2
- package/lib/components/date-picker/date-picker.d.ts.map +1 -1
- package/lib/components/date-picker/date-picker.js +21 -17
- package/lib/components/date-picker/date-picker.js.map +1 -1
- package/lib/components/dropdown/dropdown.styles.js +1 -1
- package/lib/components/dropdown/dropdown.styles.js.map +1 -1
- package/lib/components/modal/modal.d.ts +0 -1
- package/lib/components/modal/modal.d.ts.map +1 -1
- package/lib/components/modal/modal.js +2 -4
- package/lib/components/modal/modal.js.map +1 -1
- package/lib/components/multi-select/multi-select.js +3 -3
- package/lib/components/multi-select/multi-select.js.map +1 -1
- package/lib/components/multi-select/multi-select.styles.js +1 -1
- package/lib/components/multi-select/multi-select.styles.js.map +1 -1
- package/lib/components/pagination/pagination.d.ts.map +1 -1
- package/lib/components/pagination/pagination.js +13 -10
- package/lib/components/pagination/pagination.js.map +1 -1
- package/lib/components/progress-steps/progress-steps.d.ts +32 -2
- package/lib/components/progress-steps/progress-steps.d.ts.map +1 -1
- package/lib/components/progress-steps/progress-steps.js +37 -16
- package/lib/components/progress-steps/progress-steps.js.map +1 -1
- package/lib/components/progress-steps/progress-steps.styles.d.ts.map +1 -1
- package/lib/components/progress-steps/progress-steps.styles.js +4 -0
- package/lib/components/progress-steps/progress-steps.styles.js.map +1 -1
- package/lib/components/select-tile/select-tile.d.ts.map +1 -1
- package/lib/components/select-tile/select-tile.js +3 -1
- package/lib/components/select-tile/select-tile.js.map +1 -1
- package/lib/cre8-form-element-7TQ7UIBX.js +247 -0
- package/lib/design-tokens/brands/notion/tokens_notion.module.d.ts +3 -0
- package/lib/design-tokens/brands/notion/tokens_notion.module.d.ts.map +1 -0
- package/lib/design-tokens/brands/notion/tokens_notion.module.js +91 -0
- package/lib/design-tokens/brands/notion/tokens_notion.module.js.map +1 -0
- package/mcp-manifest.json +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../components/pagination/pagination.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAiD;AACjD,wCAAwC;AACxC,OAAO,EACH,IAAI,EAAsB,OAAO,GACpC,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,YAAY,MAAM,wGAAwG,CAAC;AAClI,OAAO,YAAY,MAAM,+GAA+G,CAAC;AACzI,OAAO,WAAW,MAAM,gHAAgH,CAAC;AACzI,OAAO,aAAa,MAAM,yGAAyG,CAAC;AACpI,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,6BAA6B,CAAC;AACrC,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C;;;;;;;;;;;;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AC,CAAC;AAC7D,CAAC","sourcesContent":["/* eslint-disable import/prefer-default-export */\n/* eslint-disable lit/no-template-map */\nimport {\n html, HTMLTemplateResult, nothing,\n} from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property, queryAll, state } from 'lit/decorators.js';\nimport svgCaretLeft from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Left.svg?raw';\nimport svgFirstPage from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Double_Left.svg?raw';\nimport svgLastPage from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Double_Right.svg?raw';\nimport svgCaretRight from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Right.svg?raw';\nimport { Cre8Element } from '../cre8-element';\nimport {Cre8Button} from '../button/button';\nimport { isMobile, screenSizes } from '../../utilities/is-mobile';\nimport './page-counter/page-counter';\nimport styles from './pagination.styles.js';\n\n/**\n * The Pagination component is used to split up a large amount of results\n * by showing only a certain amount on each page. You can cycle through\n * the pages using Page Numbers, Next and Previous Buttons, or optional\n * First Page and Last Page Buttons. This component is also used by Table\n * to cycle through rows of results. Pagination has 3 display options:\n *\n * **default**: Can contain up to seven Page Numbers (ellipses included)\n * at a time flanked by Next and Previous Buttons. When there are more than\n * seven pages, numbers start getting replaced by ellipses. Use this option\n * when you have a lot of horizontal space in a layout. It should not be used\n * for mobile web layouts since its buttons are smaller than the minimum touch target of 44px.\n * The component has built in responsivity to mobile page size so you dont have tohandle this\n * seperately\n *\n *\n * **compact** : Best used as a summary of where you are among pages or table rows flanked by\n * Previous and Next Buttons. Use this option when you have limited horizontal space but still\n * need to show where users are among results. Great for mobile layouts.\n *\n *\n * **icon-only** : Use this option in very tight spaces when it’s not required to show users\n * where they are among results. Great for mobile layouts.\n *\n *\n * ## HOW TO USE\n *\n * Select an option from the “display” dropdown depending on layout width\n * Select where your current page is from the “Page” dropdown\n * To show less pages when using Full Numbers, use the \"visiblePages” toggles\n * To hide the First Page and Last Page Buttons, turn on the “hideFirstLastButton” toggle\n * To change the states of page numbers or buttons, interact with the buttond to invoke each “State”\n * When using Compact Numbers, you can choose between “compact” and “icon-only” formats\n *\n *\n * ## ACCESSIBILITY NOTE\n *\n * To best orient people using screen readers, push focus to the top of\n * the list of results after any of the pagination buttons have been triggered,\n * **except for the currently selected one**. Focus target could be a visual results heading,\n * or the top heading of the results container of the page selected\n * via a programmatic selector, e.g. < section id=“results” aria-label=\"results-section\" > or\n * < div role= “group” aria-label=“results” >.\n *\n * @dependency cre8-button, cre8-icon, cre8-pagination-counter\n * @csspart icon - distinguishes the page buttons from the icon buttons\n * @cssproperty \"--pagination-display\" - controls the display css property\n * @cssproperty \"--pagination-justify-content\" - controls horizontal alignment of pagination\n * @cssproperty \"--pagination-align-items\" - controls vertical alignment of pagination\n */\n\nexport class Cre8Pagination extends Cre8Element {\n static styles = [styles];\n\n static elementDefinitions = {\n 'cre8-button': Cre8Button,\n };\n\n @state()\n _currentPage: number = 99;\n\n /**\n * Input the total number of elements are returned from consuming app e.g. search results\n * @attr number\n * @required\n */\n @property({ reflect: true, type: Number })\n totalResults!: number;\n\n\n /**\n * how many elements will displayVariant per page, indicated by business to typically be 20\n * @attr number\n */\n @property({ type: Number, reflect: true })\n get pageSize() {\n return this._pageSize;\n }\n\n set pageSize(newSize: number) {\n const oldSize = this._pageSize;\n this._pageSize = newSize;\n this.requestUpdate('pageSize', oldSize);\n }\n\n @state()\n _pageSize = 10;\n\n\n /**\n * Controls how many page buttons are displayVarianted on the page\n * at once, if container size permits. recommended max = 5 pages\n *\n * @attr number\n */\n @property({ reflect: true, type: Number })\n visiblePages?: number = 5;\n\n /**\n * (optional) prop that allows for a compact and icon-only variant both\n * for mobile screen-sizes and for use in certain contexts as guided by design,\n * the component size will show 'default' in the absence of a value on desktop and\n * 'compact' on smaller views.\n *\n * @attr 'compact' | 'icon-only' | 'default'\n * @optional\n */\n @property({ type: String, reflect: true })\n display?: 'compact' | 'icon-only'| 'default';\n\n /**\n *\n *@state watches the width of the window and responds to show the accessibility approved variant.\n */\n @state()\n windowWidth!: number;\n\n @queryAll('cre8-button')\n buttons: typeof Cre8Button[];\n\n /**\n *\n * @optional\n */\n @property({ type: Boolean, reflect: true })\n hideLastAndFirstButtons?: boolean;\n\n @property({ reflect: true, type: Number })\n get currentPage() {\n return this._currentPage;\n }\n\n set currentPage(newPage: number) {\n const oldPage = this._currentPage;\n this._currentPage = newPage;\n this.requestUpdate('currentPage', oldPage);\n }\n\n connectedCallBack() {\n super.connectedCallback();\n }\n\n get maxVisiblePages() {\n const allowedVisiblePages = {\n md: 5,\n };\n\n // lg and up\n\n if (!isMobile(screenSizes.lg.toString())) {\n return this.visiblePages;\n }\n\n if (!isMobile(screenSizes.md.toString())) {\n return Math.min(allowedVisiblePages.md, this.visiblePages);\n }\n return 0;\n }\n\n\n private get totalPages(): number {\n return Math.ceil(this.totalResults / this.pageSize);\n }\n\n private get hasNoPreviousPage() {\n return this._currentPage <= 1;\n }\n\n private get hasNoNextPage() {\n return this._currentPage >= this.totalPages;\n }\n\n private _onHandleResize() {\n this.requestUpdate();\n }\n\n handleResize() {\n this._onHandleResize.bind(this);\n }\n\n // get range of pages to display [3, 4, 5], [2, 3, 4, 5]\n protected get pageRange():number[] {\n const left = Math.floor(this.maxVisiblePages / 2);\n let startPage = this.currentPage - left;\n startPage = Math.min(startPage, this.totalPages - this.maxVisiblePages + 1);\n startPage = Math.max(startPage, 1);\n const endPage = Math.min(startPage + this.maxVisiblePages - 1, this.totalPages);\n return [...Array(this.totalPages)].map((_, index) => index + 1).slice(startPage - 1, endPage);\n }\n\n protected async firstUpdated() {\n await this.updateComplete;\n if (this._pageSize !== this.pageSize) {\n const old = this._pageSize;\n this._pageSize = this.pageSize;\n this.requestUpdate('pageSize', old);\n }\n this.windowWidth = window.innerWidth;\n window.addEventListener('resize', () => {\n if (this.windowWidth !== window.innerWidth) {\n const oldWidth = this.windowWidth;\n this.windowWidth = window.innerWidth;\n this.handleResize();\n this.requestUpdate('isResponsive', oldWidth);\n }\n });\n if (this._currentPage !== this.currentPage) {\n const old = this._currentPage;\n this._currentPage = this.currentPage;\n this.requestUpdate('currentPage', old);\n }\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n super.disconnectedCallback();\n }\n\n displayTypes(): HTMLTemplateResult {\n return html`<cre8-page-counter\n currentPage=${this.currentPage}\n style=\"display:${this.display === 'compact' ? 'flex' : 'none'};\"\n totalResults=${this.totalResults}\n pageSize=${this._pageSize}\n display=${this.display}>\n </cre8-page-counter>`;\n }\n\n private _handleKeydown = (page: number, _buttonName?: string) => (e: KeyboardEvent) => {\n if (e.code === 'Enter') {\n this._goToPage(page, _buttonName); /* 2 */\n }\n };\n\n private _goToPage = (page: number, _buttonName?: string) => () => {\n const old = this._currentPage;\n let focusButton: Cre8Button;\n this.buttons.forEach((_: typeof Cre8Button) => {\n const b = new Cre8Button();\n if (b.hideText && (b.text === _buttonName)) {\n focusButton = b;\n (focusButton.shadowRoot!.querySelector('.cre8-c-button') as HTMLButtonElement).blur();\n }\n return null;\n });\n this._currentPage = page;\n this.currentPage = this._currentPage;\n this.requestUpdate('currentPage', old);\n this.dispatchEvent(new CustomEvent(\n 'pagination.click',\n { detail: { buttonName: _buttonName ?? this.currentPage.toString(), value: this.currentPage } }\n ));\n };\n\n public goToPage(page: number, buttonName?: string) {\n return this._goToPage(page, buttonName).bind(this);\n }\n\n public handleKeydown(page: number, buttonName?: string) {\n return this._handleKeydown(page, buttonName);\n }\n\n render() {\n const classNames = this.componentClassNames('cre8-c-pagination', {\n 'cre8-c-pagination--compact': this.display !== undefined && this.display === 'compact',\n 'cre8-c-pagination--icon-only': this.display !== undefined && this.display === 'icon-only',\n });\n\n\n return html`<nav\n aria-label=\"pagination\"\n class=${classNames}>\n <slot></slot>\n ${!this.hideLastAndFirstButtons ? html` <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n text=\"\"\n hideText\n part=\"icon\"\n aria-disabled=\"${ifDefined(this.hasNoPreviousPage)}\"\n ?disabled=${this.hasNoPreviousPage}\n @click=${this.goToPage(1, 'First Page')}\n @keydown=${this.handleKeydown(1, 'First Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n className=\"cre8-c-pagination__icon\"\n aria-label=\"First Page\"\n svg=${svgFirstPage}\n size=\"24\">\n </cre8-icon>\n </span>\n </cre8-button>` : nothing}\n <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n hideText\n text=\"\"\n part=\"icon\"\n aria-disabled=\"${ifDefined(this.hasNoPreviousPage)}\"\n ?disabled=${this.hasNoPreviousPage}\n @click=${this.goToPage(this._currentPage - 1, 'Previous Page')}\n @keydown=${this.handleKeydown(this.currentPage - 1, 'Previous Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n className=\"cre8-c-pagination__icon\"\n aria-label=\"Previous Page\"\n slot=\"before\"\n svg=${svgCaretLeft}\n size=\"24\"\n\n >\n </cre8-icon>\n </span>\n </cre8-button>\n\n ${this.displayTypes()}\n ${!this.display || this.display === 'default'\n ? html`${this.pageRange[this.pageRange.length - 1] > 1 && this.pageRange[0] !== 1\n ? html`<cre8-button hideText iconName=\"ellipsis\" variant=\"tertiary\" size=\"sm\" aria-disabled=\"true\" inert></cre8-button>`\n : nothing}\n ${this.pageRange.map((page) => (page === this.currentPage\n ? html`<cre8-button variant=\"tertiary\" tab-index=\"-1\" text=\"${page}\" class=\"icon-only\" size=\"sm\" id=\"current\"></cre8-button>`\n : html`<cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n text=\"${page}\"\n class=\"icon-only\"\n id=\"${page}\"\n @click=${this.goToPage(page, page.toString())}\n @keydown=${this.handleKeydown(page, page.toString())}>\n </cre8-button>`\n ))}\n ${this.pageRange[this.pageRange.length - 1] < this.totalPages\n ? html`<cre8-button\n hideText\n iconName=\"ellipsis\"\n text=\"ellipsis\"\n variant=\"tertiary\"\n size=\"sm\"\n aria-disabled=\"true\"\n inert>\n </cre8-button>`\n : nothing}`\n : nothing}\n <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n part=\"icon\"\n hideText\n text=\"\"\n aria-disabled=\"${ifDefined(this.hasNoNextPage)}\"\n ?disabled=${this.hasNoNextPage}\n @click=${this.goToPage(this.currentPage + 1, 'Next Page')}\n @keydown=${this.handleKeydown(this.currentPage + 1, 'Next Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n aria-label=\"Next Page\"\n className=\"cre8-c-pagination__icon\"\n slot=\"before\" svg=${svgCaretRight}\n size=\"24\">\n </cre8-icon>\n </span>\n </cre8-button>\n\n ${!this.hideLastAndFirstButtons\n ? html` <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n hideText\n text=\"\"\n part=\"icon\"\n aria-disabled=\"${ifDefined(this.hasNoNextPage)}\"\n ?disabled=${this.hasNoNextPage}\n @click=${this.goToPage(this.totalPages, 'Last Page')}\n @keydown=${this.handleKeydown(this.totalPages, 'Last Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n aria-label=\"Last Page\"\n className=\"cre8-c-pagination__icon\"\n slot=\"before\"\n svg=${svgLastPage}\n size=\"24\"\n >\n </cre8-icon>\n </span>\n </cre8-button>`\n : nothing}\n\n </nav>`;\n }\n}\n\nif (customElements.get('cre8-pagination') === undefined) {\n customElements.define('cre8-pagination', Cre8Pagination);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-pagination': Cre8Pagination;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../components/pagination/pagination.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAiD;AACjD,wCAAwC;AACxC,OAAO,EACH,IAAI,EAAsB,OAAO,GACpC,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK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AChB;AAY1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACI;AAO9C;IADC,KAAK,EAAE;mDACa;AAGrB;IADC,QAAQ,CAAC,aAAa,CAAC;+CACK;AAO7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+DACT;AAGlC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAGzC;AAgRL,IAAI,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,SAAS,EAAE,CAAC;IACtD,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["/* eslint-disable import/prefer-default-export */\n/* eslint-disable lit/no-template-map */\nimport {\n html, HTMLTemplateResult, nothing,\n} from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property, queryAll, state } from 'lit/decorators.js';\nimport svgCaretLeft from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Left.svg?raw';\nimport svgFirstPage from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Double_Left.svg?raw';\nimport svgLastPage from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Double_Right.svg?raw';\nimport svgCaretRight from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Caret_Right.svg?raw';\nimport svgEllipsis from '/Users/tylersmbp/Projects/cre8-web-components/packages/cre8-wc/icons/System/Regular/Ellipsis.svg?raw';\nimport { Cre8Element } from '../cre8-element';\nimport { Cre8Button } from '../button/button';\nimport { isMobile, screenSizes } from '../../utilities/is-mobile';\nimport './page-counter/page-counter';\nimport styles from './pagination.styles.js';\n\n/**\n * The Pagination component is used to split up a large amount of results\n * by showing only a certain amount on each page. You can cycle through\n * the pages using Page Numbers, Next and Previous Buttons, or optional\n * First Page and Last Page Buttons. This component is also used by Table\n * to cycle through rows of results. Pagination has 3 display options:\n *\n * **default**: Can contain up to seven Page Numbers (ellipses included)\n * at a time flanked by Next and Previous Buttons. When there are more than\n * seven pages, numbers start getting replaced by ellipses. Use this option\n * when you have a lot of horizontal space in a layout. It should not be used\n * for mobile web layouts since its buttons are smaller than the minimum touch target of 44px.\n * The component has built in responsivity to mobile page size so you dont have tohandle this\n * seperately\n *\n *\n * **compact** : Best used as a summary of where you are among pages or table rows flanked by\n * Previous and Next Buttons. Use this option when you have limited horizontal space but still\n * need to show where users are among results. Great for mobile layouts.\n *\n *\n * **icon-only** : Use this option in very tight spaces when it’s not required to show users\n * where they are among results. Great for mobile layouts.\n *\n *\n * ## HOW TO USE\n *\n * Select an option from the “display” dropdown depending on layout width\n * Select where your current page is from the “Page” dropdown\n * To show less pages when using Full Numbers, use the \"visiblePages” toggles\n * To hide the First Page and Last Page Buttons, turn on the “hideFirstLastButton” toggle\n * To change the states of page numbers or buttons, interact with the buttond to invoke each “State”\n * When using Compact Numbers, you can choose between “compact” and “icon-only” formats\n *\n *\n * ## ACCESSIBILITY NOTE\n *\n * To best orient people using screen readers, push focus to the top of\n * the list of results after any of the pagination buttons have been triggered,\n * **except for the currently selected one**. Focus target could be a visual results heading,\n * or the top heading of the results container of the page selected\n * via a programmatic selector, e.g. < section id=“results” aria-label=\"results-section\" > or\n * < div role= “group” aria-label=“results” >.\n *\n * @dependency cre8-button, cre8-icon, cre8-pagination-counter\n * @csspart icon - distinguishes the page buttons from the icon buttons\n * @cssproperty \"--pagination-display\" - controls the display css property\n * @cssproperty \"--pagination-justify-content\" - controls horizontal alignment of pagination\n * @cssproperty \"--pagination-align-items\" - controls vertical alignment of pagination\n */\n\nexport class Cre8Pagination extends Cre8Element {\n static styles = [styles];\n\n static elementDefinitions = {\n 'cre8-button': Cre8Button,\n };\n\n @state()\n _currentPage: number = 99;\n\n /**\n * Input the total number of elements are returned from consuming app e.g. search results\n * @attr number\n * @required\n */\n @property({ reflect: true, type: Number })\n totalResults!: number;\n\n\n /**\n * how many elements will displayVariant per page, indicated by business to typically be 20\n * @attr number\n */\n @property({ type: Number, reflect: true })\n get pageSize() {\n return this._pageSize;\n }\n\n set pageSize(newSize: number) {\n const oldSize = this._pageSize;\n this._pageSize = newSize;\n this.requestUpdate('pageSize', oldSize);\n }\n\n @state()\n _pageSize = 10;\n\n\n /**\n * Controls how many page buttons are displayVarianted on the page\n * at once, if container size permits. recommended max = 5 pages\n *\n * @attr number\n */\n @property({ reflect: true, type: Number })\n visiblePages?: number = 5;\n\n /**\n * (optional) prop that allows for a compact and icon-only variant both\n * for mobile screen-sizes and for use in certain contexts as guided by design,\n * the component size will show 'default' in the absence of a value on desktop and\n * 'compact' on smaller views.\n *\n * @attr 'compact' | 'icon-only' | 'default'\n * @optional\n */\n @property({ type: String, reflect: true })\n display?: 'compact' | 'icon-only' | 'default';\n\n /**\n *\n *@state watches the width of the window and responds to show the accessibility approved variant.\n */\n @state()\n windowWidth!: number;\n\n @queryAll('cre8-button')\n buttons: typeof Cre8Button[];\n\n /**\n *\n * @optional\n */\n @property({ type: Boolean, reflect: true })\n hideLastAndFirstButtons?: boolean;\n\n @property({ reflect: true, type: Number })\n get currentPage() {\n return this._currentPage;\n }\n\n set currentPage(newPage: number) {\n const oldPage = this._currentPage;\n this._currentPage = newPage;\n this.requestUpdate('currentPage', oldPage);\n }\n\n connectedCallBack() {\n super.connectedCallback();\n }\n\n get maxVisiblePages() {\n const allowedVisiblePages = {\n md: 5,\n };\n\n // lg and up\n\n if (!isMobile(screenSizes.lg.toString())) {\n return this.visiblePages;\n }\n\n if (!isMobile(screenSizes.md.toString())) {\n return Math.min(allowedVisiblePages.md, this.visiblePages);\n }\n return 0;\n }\n\n\n private get totalPages(): number {\n return Math.ceil(this.totalResults / this.pageSize);\n }\n\n private get hasNoPreviousPage() {\n return this._currentPage <= 1;\n }\n\n private get hasNoNextPage() {\n return this._currentPage >= this.totalPages;\n }\n\n private _onHandleResize() {\n this.requestUpdate();\n }\n\n handleResize() {\n this._onHandleResize.bind(this);\n }\n\n // get range of pages to display [3, 4, 5], [2, 3, 4, 5]\n protected get pageRange(): number[] {\n const left = Math.floor(this.maxVisiblePages / 2);\n let startPage = this.currentPage - left;\n startPage = Math.min(startPage, this.totalPages - this.maxVisiblePages + 1);\n startPage = Math.max(startPage, 1);\n const endPage = Math.min(startPage + this.maxVisiblePages - 1, this.totalPages);\n return [...Array(this.totalPages)].map((_, index) => index + 1).slice(startPage - 1, endPage);\n }\n\n protected async firstUpdated() {\n await this.updateComplete;\n if (this._pageSize !== this.pageSize) {\n const old = this._pageSize;\n this._pageSize = this.pageSize;\n this.requestUpdate('pageSize', old);\n }\n this.windowWidth = window.innerWidth;\n window.addEventListener('resize', () => {\n if (this.windowWidth !== window.innerWidth) {\n const oldWidth = this.windowWidth;\n this.windowWidth = window.innerWidth;\n this.handleResize();\n this.requestUpdate('isResponsive', oldWidth);\n }\n });\n if (this._currentPage !== this.currentPage) {\n const old = this._currentPage;\n this._currentPage = this.currentPage;\n this.requestUpdate('currentPage', old);\n }\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n super.disconnectedCallback();\n }\n\n displayTypes(): HTMLTemplateResult {\n return html`<cre8-page-counter\n currentPage=${this.currentPage}\n style=\"display:${this.display === 'compact' ? 'flex' : 'none'};\"\n totalResults=${this.totalResults}\n pageSize=${this._pageSize}\n display=${this.display}>\n </cre8-page-counter>`;\n }\n\n private _handleKeydown = (page: number, _buttonName?: string) => (e: KeyboardEvent) => {\n if (e.code === 'Enter') {\n this._goToPage(page, _buttonName); /* 2 */\n }\n };\n\n private _goToPage = (page: number, _buttonName?: string) => () => {\n const old = this._currentPage;\n let focusButton: Cre8Button;\n this.buttons.forEach((_: typeof Cre8Button) => {\n const b = new Cre8Button();\n if (b.hideText && (b.text === _buttonName)) {\n focusButton = b;\n (focusButton.shadowRoot!.querySelector('.cre8-c-button') as HTMLButtonElement).blur();\n }\n return null;\n });\n this._currentPage = page;\n this.currentPage = this._currentPage;\n this.requestUpdate('currentPage', old);\n this.dispatchEvent(new CustomEvent(\n 'pagination.click',\n { detail: { buttonName: _buttonName ?? this.currentPage.toString(), value: this.currentPage } }\n ));\n };\n\n public goToPage(page: number, buttonName?: string) {\n return this._goToPage(page, buttonName).bind(this);\n }\n\n public handleKeydown(page: number, buttonName?: string) {\n return this._handleKeydown(page, buttonName);\n }\n\n render() {\n const classNames = this.componentClassNames('cre8-c-pagination', {\n 'cre8-c-pagination--compact': this.display !== undefined && this.display === 'compact',\n 'cre8-c-pagination--icon-only': this.display !== undefined && this.display === 'icon-only',\n });\n\n\n return html`<nav\n aria-label=\"pagination\"\n class=${classNames}>\n <slot></slot>\n ${!this.hideLastAndFirstButtons ? html` <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n text=\"\"\n hideText\n part=\"icon\"\n aria-disabled=\"${ifDefined(this.hasNoPreviousPage)}\"\n ?disabled=${this.hasNoPreviousPage}\n @click=${this.goToPage(1, 'First Page')}\n @keydown=${this.handleKeydown(1, 'First Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n className=\"cre8-c-pagination__icon\"\n aria-label=\"First Page\"\n svg=${svgFirstPage}\n size=\"24\">\n </cre8-icon>\n </span>\n </cre8-button>` : nothing}\n <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n hideText\n text=\"\"\n part=\"icon\"\n aria-disabled=\"${ifDefined(this.hasNoPreviousPage)}\"\n ?disabled=${this.hasNoPreviousPage}\n @click=${this.goToPage(this._currentPage - 1, 'Previous Page')}\n @keydown=${this.handleKeydown(this.currentPage - 1, 'Previous Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n className=\"cre8-c-pagination__icon\"\n aria-label=\"Previous Page\"\n slot=\"before\"\n svg=${svgCaretLeft}\n size=\"24\"\n\n >\n </cre8-icon>\n </span>\n </cre8-button>\n\n ${this.displayTypes()}\n ${!this.display || this.display === 'default'\n ? html`${this.pageRange[this.pageRange.length - 1] > 1 && this.pageRange[0] !== 1\n ? html` <cre8-icon\n aria-label=\"ellipsis\"\n className=\"cre8-c-pagination__icon\"\n slot=\"before\" svg=${svgEllipsis}\n size=\"24\">\n </cre8-icon>`\n : nothing}\n ${this.pageRange.map((page) => (page === this.currentPage\n ? html`<cre8-button variant=\"tertiary\" tab-index=\"-1\" text=\"${page}\" class=\"icon-only\" size=\"sm\" id=\"current\"></cre8-button>`\n : html`<cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n text=\"${page}\"\n class=\"icon-only\"\n id=\"${page}\"\n @click=${this.goToPage(page, page.toString())}\n @keydown=${this.handleKeydown(page, page.toString())}>\n </cre8-button>`\n ))}\n ${this.pageRange[this.pageRange.length - 1] < this.totalPages\n ? html` <cre8-icon\n aria-label=\"ellipsis\"\n className=\"cre8-c-pagination__icon\"\n slot=\"before\" svg=${svgEllipsis}\n size=\"24\">\n </cre8-icon>`\n : nothing}`\n : nothing}\n <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n part=\"icon\"\n hideText\n text=\"\"\n aria-disabled=\"${ifDefined(this.hasNoNextPage)}\"\n ?disabled=${this.hasNoNextPage}\n @click=${this.goToPage(this.currentPage + 1, 'Next Page')}\n @keydown=${this.handleKeydown(this.currentPage + 1, 'Next Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n aria-label=\"Next Page\"\n className=\"cre8-c-pagination__icon\"\n slot=\"before\" svg=${svgCaretRight}\n size=\"24\">\n </cre8-icon>\n </span>\n </cre8-button>\n\n ${!this.hideLastAndFirstButtons\n ? html` <cre8-button\n variant=\"tertiary\"\n size=\"sm\"\n hideText\n text=\"\"\n part=\"icon\"\n aria-disabled=\"${ifDefined(this.hasNoNextPage)}\"\n ?disabled=${this.hasNoNextPage}\n @click=${this.goToPage(this.totalPages, 'Last Page')}\n @keydown=${this.handleKeydown(this.totalPages, 'Last Page')}\n\n >\n <span slot=\"before\">\n <cre8-icon\n aria-label=\"Last Page\"\n className=\"cre8-c-pagination__icon\"\n slot=\"before\"\n svg=${svgLastPage}\n size=\"24\"\n >\n </cre8-icon>\n </span>\n </cre8-button>`\n : nothing}\n\n </nav>`;\n }\n}\n\nif (customElements.get('cre8-pagination') === undefined) {\n customElements.define('cre8-pagination', Cre8Pagination);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-pagination': Cre8Pagination;\n }\n}\n"]}
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Cre8Element } from '../cre8-element';
|
|
2
|
+
/**
|
|
3
|
+
* The Progress Steps component is used to display where a user is in a multistep process.
|
|
4
|
+
* It clearly indicates the total number of steps, which steps are complete and incomplete,
|
|
5
|
+
* and which step you’re currently on. They help users estimate how long a task will take and can be
|
|
6
|
+
* used to track status on orders.
|
|
7
|
+
*
|
|
8
|
+
* The Progress Steps component should be used as a parent component for `cre8-progress-steps-item` components.
|
|
9
|
+
* These Components serve a contextual purpose and don't provide any functionality.
|
|
10
|
+
*
|
|
11
|
+
* # How to Use
|
|
12
|
+
*
|
|
13
|
+
* Progress Steps is used when there is ample horizontal space and two to six steps. It displays each step by name
|
|
14
|
+
* and number to help users understand exactly where they are in a process. It is the preferred option for desktop.
|
|
15
|
+
* Progress Steps should change to Compact Steps on mobile web to conserve space.
|
|
16
|
+
*
|
|
17
|
+
* Progress Steps can also be used to track order status. It provides a quick visual of how an order is progressing
|
|
18
|
+
* with options to alert users of any problems along the way. When used for order status, Progress Steps should
|
|
19
|
+
* change to Vertical Steps on mobile web to conserve space while allowing alerts and messages to remain visible.
|
|
20
|
+
*
|
|
21
|
+
* @slot - The Progress Steps Item components that represent the steps in the multistep process.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Cre8ProgressSteps extends Cre8Element {
|
|
24
|
+
static get styles(): import("lit").CSSResult;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
'cre8-progress-steps': Cre8ProgressSteps;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export default Cre8ProgressSteps;
|
|
3
33
|
//# sourceMappingURL=progress-steps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-steps.d.ts","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"progress-steps.d.ts","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,MAAM,KAAK,MAAM,4BAEhB;IAED,MAAM;CAOP;AAMD,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,qBAAqB;QAAG,qBAAqB,EAAE,iBAAiB,CAAC;KAAE;CAAE;AAEhG,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,19 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { html, unsafeCSS } from 'lit';
|
|
2
|
+
import { Cre8Element } from '../cre8-element';
|
|
3
|
+
import styles from './progress-steps.styles.js';
|
|
4
|
+
/**
|
|
5
|
+
* The Progress Steps component is used to display where a user is in a multistep process.
|
|
6
|
+
* It clearly indicates the total number of steps, which steps are complete and incomplete,
|
|
7
|
+
* and which step you’re currently on. They help users estimate how long a task will take and can be
|
|
8
|
+
* used to track status on orders.
|
|
9
|
+
*
|
|
10
|
+
* The Progress Steps component should be used as a parent component for `cre8-progress-steps-item` components.
|
|
11
|
+
* These Components serve a contextual purpose and don't provide any functionality.
|
|
12
|
+
*
|
|
13
|
+
* # How to Use
|
|
14
|
+
*
|
|
15
|
+
* Progress Steps is used when there is ample horizontal space and two to six steps. It displays each step by name
|
|
16
|
+
* and number to help users understand exactly where they are in a process. It is the preferred option for desktop.
|
|
17
|
+
* Progress Steps should change to Compact Steps on mobile web to conserve space.
|
|
18
|
+
*
|
|
19
|
+
* Progress Steps can also be used to track order status. It provides a quick visual of how an order is progressing
|
|
20
|
+
* with options to alert users of any problems along the way. When used for order status, Progress Steps should
|
|
21
|
+
* change to Vertical Steps on mobile web to conserve space while allowing alerts and messages to remain visible.
|
|
22
|
+
*
|
|
23
|
+
* @slot - The Progress Steps Item components that represent the steps in the multistep process.
|
|
24
|
+
*/
|
|
25
|
+
export class Cre8ProgressSteps extends Cre8Element {
|
|
26
|
+
static get styles() {
|
|
27
|
+
return unsafeCSS(styles.toString());
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const componentClassNames = this.componentClassNames('cre8-c-progress-steps');
|
|
31
|
+
return html `<div class='${componentClassNames}'>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</div>`;
|
|
34
|
+
}
|
|
6
35
|
}
|
|
7
|
-
|
|
8
|
-
.cre8-
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: row;
|
|
11
|
-
margin: var(--cre8-spacing-24);
|
|
12
|
-
|
|
13
|
-
@media (max-width: component.$cre8-breakpoint-md) {
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
}
|
|
36
|
+
if (customElements.get('cre8-progress-steps') === undefined) {
|
|
37
|
+
customElements.define('cre8-progress-steps', Cre8ProgressSteps);
|
|
16
38
|
}
|
|
17
|
-
|
|
18
|
-
export default styles;
|
|
39
|
+
export default Cre8ProgressSteps;
|
|
19
40
|
//# sourceMappingURL=progress-steps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-steps.js","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"progress-steps.js","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD,MAAM,KAAK,MAAM;QACf,OAAO,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,MAAM;QACJ,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC;QAE9E,OAAO,IAAI,CAAA,eAAe,mBAAmB;;eAElC,CAAC;IACd,CAAC;CACF;AAED,IAAI,cAAc,CAAC,GAAG,CAAC,qBAAqB,CAAC,KAAK,SAAS,EAAE,CAAC;IAC5D,cAAc,CAAC,MAAM,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC;AAID,eAAe,iBAAiB,CAAC","sourcesContent":["import { html, unsafeCSS } from 'lit';\nimport { Cre8Element } from '../cre8-element';\nimport styles from './progress-steps.styles.js';\n\n/**\n * The Progress Steps component is used to display where a user is in a multistep process.\n * It clearly indicates the total number of steps, which steps are complete and incomplete,\n * and which step you’re currently on. They help users estimate how long a task will take and can be\n * used to track status on orders.\n *\n * The Progress Steps component should be used as a parent component for `cre8-progress-steps-item` components.\n * These Components serve a contextual purpose and don't provide any functionality.\n *\n * # How to Use\n *\n * Progress Steps is used when there is ample horizontal space and two to six steps. It displays each step by name\n * and number to help users understand exactly where they are in a process. It is the preferred option for desktop.\n * Progress Steps should change to Compact Steps on mobile web to conserve space.\n *\n * Progress Steps can also be used to track order status. It provides a quick visual of how an order is progressing\n * with options to alert users of any problems along the way. When used for order status, Progress Steps should\n * change to Vertical Steps on mobile web to conserve space while allowing alerts and messages to remain visible.\n *\n * @slot - The Progress Steps Item components that represent the steps in the multistep process.\n */\nexport class Cre8ProgressSteps extends Cre8Element {\n static get styles() {\n return unsafeCSS(styles.toString());\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-progress-steps');\n\n return html`<div class='${componentClassNames}'>\n <slot></slot>\n </div>`;\n }\n}\n\nif (customElements.get('cre8-progress-steps') === undefined) {\n customElements.define('cre8-progress-steps', Cre8ProgressSteps);\n}\n\ndeclare global { interface HTMLElementTagNameMap { 'cre8-progress-steps': Cre8ProgressSteps; } }\n\nexport default Cre8ProgressSteps;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-steps.styles.d.ts","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.styles.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"progress-steps.styles.d.ts","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.styles.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM,yBAwlBV,CAAC;AACH,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-steps.styles.js","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAolBhB,CAAC;AACH,eAAe,MAAM,CAAC","sourcesContent":["import { css } from 'lit';\nconst styles = css`.cre8-u-content-knockout-brand {\n color: var(----cre8-color-content-knockout-brand);\n}\n\n.cre8-u-is-hidden {\n display: none !important;\n visibility: hidden !important;\n}\n\n.cre8-u-is-vishidden {\n position: absolute !important;\n overflow: hidden;\n width: 1px;\n height: 1px;\n padding: 0;\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n}\n\n@media all and (min-width: 23.4375rem) {\n .cre8-u-hide-sm {\n display: none !important;\n }\n}\n@media all and (min-width: 35rem) {\n .cre8-u-hide-sm-2 {\n display: none !important;\n }\n}\n@media all and (min-width: 48rem) {\n .cre8-u-hide-md {\n display: none !important;\n }\n}\n@media all and (min-width: 60rem) {\n .cre8-u-hide-lg {\n display: none !important;\n }\n}\n@media all and (min-width: 75rem) {\n .cre8-u-hide-xl {\n display: none !important;\n }\n}\n@media all and (max-width: 23.4375rem) {\n .cre8-u-show-sm {\n display: none !important;\n }\n}\n@media all and (max-width: 35rem) {\n .cre8-u-show-sm-2 {\n display: none !important;\n }\n}\n@media all and (max-width: 48rem) {\n .cre8-u-show-md {\n display: none !important;\n }\n}\n@media all and (max-width: 60rem) {\n .cre8-u-show-lg {\n display: none !important;\n }\n}\n@media all and (max-width: 75rem) {\n .cre8-u-show-xl {\n display: none !important;\n }\n}\n.cre8-u-margin-none {\n margin: 0 !important;\n}\n\n.cre8-u-margin-sm {\n margin: size(1) !important;\n}\n\n.cre8-u-margin-md {\n margin: size(2) !important;\n}\n\n.cre8-u-margin-lg {\n margin: size(3) !important;\n}\n\n.cre8-u-margin-xl {\n margin: size(4) !important;\n}\n\n.cre8-u-margin-xxl {\n margin: size(8) !important;\n}\n\n.cre8-u-margin-top-none {\n margin-top: 0 !important;\n}\n\n.cre8-u-margin-top-sm {\n margin-top: size(1) !important;\n}\n\n.cre8-u-margin-top-md {\n margin-top: size(2) !important;\n}\n\n.cre8-u-margin-top-lg {\n margin-top: size(3) !important;\n}\n\n.cre8-u-margin-top-xl {\n margin-top: size(4) !important;\n}\n\n.cre8-u-margin-top-xxl {\n margin-top: size(8) !important;\n}\n\n.cre8-u-margin-right-none {\n margin-right: 0 !important;\n}\n\n.cre8-u-margin-right-sm {\n margin-right: size(1) !important;\n}\n\n.cre8-u-margin-right-md {\n margin-right: size(2) !important;\n}\n\n.cre8-u-margin-right-lg {\n margin-right: size(3) !important;\n}\n\n.cre8-u-margin-right-xl {\n margin-right: size(4) !important;\n}\n\n.cre8-u-margin-right-xxl {\n margin-right: size(8) !important;\n}\n\n.cre8-u-margin-bottom-none {\n margin-bottom: 0 !important;\n}\n\n.cre8-u-margin-bottom-sm {\n margin-bottom: size(1) !important;\n}\n\n.cre8-u-margin-bottom-md {\n margin-bottom: size(2) !important;\n}\n\n.cre8-u-margin-bottom-lg {\n margin-bottom: size(3) !important;\n}\n\n.cre8-u-margin-bottom-xl {\n margin-bottom: size(4) !important;\n}\n\n.cre8-u-margin-bottom-xxl {\n margin-bottom: size(8) !important;\n}\n\n.cre8-u-margin-bottom-xl-xxl {\n margin-bottom: size(4) !important;\n}\n\n@media all and (min-width: 768px) {\n .cre8-u-margin-bottom-xl-xxl {\n margin-bottom: size(8) !important;\n }\n}\n.cre8-u-margin-left-none {\n margin-left: 0 !important;\n}\n\n.cre8-u-margin-left-sm {\n margin-left: size(1) !important;\n}\n\n.cre8-u-margin-left-md {\n margin-left: size(2) !important;\n}\n\n.cre8-u-margin-left-lg {\n margin-left: size(3) !important;\n}\n\n.cre8-u-margin-left-xl {\n margin-left: size(4) !important;\n}\n\n.cre8-u-margin-left-xxl {\n margin-left: size(8) !important;\n}\n\n.cre8-u-padding-none {\n padding: 0 !important;\n}\n\n.cre8-u-padding-sm {\n padding: size(1) !important;\n}\n\n.cre8-u-padding-md {\n padding: size(2) !important;\n}\n\n.cre8-u-padding-lg {\n padding: size(3) !important;\n}\n\n.cre8-u-padding-xl {\n padding: size(4) !important;\n}\n\n.cre8-u-padding-xxl {\n padding: size(8) !important;\n}\n\n.cre8-u-padding-top-none {\n padding-top: 0 !important;\n}\n\n.cre8-u-padding-top-sm {\n padding-top: size(1) !important;\n}\n\n.cre8-u-padding-top-md {\n padding-top: size(2) !important;\n}\n\n.cre8-u-padding-top-lg {\n padding-top: size(3) !important;\n}\n\n.cre8-u-padding-top-xl {\n padding-top: size(4) !important;\n}\n\n.cre8-u-padding-top-xxl {\n padding-top: size(8) !important;\n}\n\n.cre8-u-padding-right-none {\n padding-right: 0 !important;\n}\n\n.cre8-u-padding-right-sm {\n padding-right: size(1) !important;\n}\n\n.cre8-u-padding-right-md {\n padding-right: size(2) !important;\n}\n\n.cre8-u-padding-right-lg {\n padding-right: size(3) !important;\n}\n\n.cre8-u-padding-right-xl {\n padding-right: size(4) !important;\n}\n\n.cre8-u-padding-right-xxl {\n padding-right: size(8) !important;\n}\n\n.cre8-u-padding-bottom-none {\n padding-bottom: 0 !important;\n}\n\n.cre8-u-padding-bottom-sm {\n padding-bottom: size(1) !important;\n}\n\n.cre8-u-padding-bottom-md {\n padding-bottom: size(2) !important;\n}\n\n.cre8-u-padding-bottom-lg {\n padding-bottom: size(3) !important;\n}\n\n.cre8-u-padding-bottom-xl {\n padding-bottom: size(4) !important;\n}\n\n.cre8-u-padding-bottom-xxl {\n padding-bottom: size(8) !important;\n}\n\n.cre8-u-padding-left-none {\n padding-left: 0 !important;\n}\n\n.cre8-u-padding-left-sm {\n padding-left: size(1) !important;\n}\n\n.cre8-u-padding-left-md {\n padding-left: size(2) !important;\n}\n\n.cre8-u-padding-left-lg {\n padding-left: size(3) !important;\n}\n\n.cre8-u-padding-left-xl {\n padding-left: size(4) !important;\n}\n\n.cre8-u-padding-left-xxl {\n padding-left: size(8) !important;\n}\n\n.cre8-u-display-flex {\n display: flex !important;\n}\n\n.cre8-u-display-block {\n display: block !important;\n}\n\nbody {\n font-family: var(--cre8-typography-body-default-font-family);\n font-size: var(--cre8-typography-body-default-font-size);\n font-weight: var(--cre8-typography-body-default-font-weight);\n line-height: var(--cre8-typography-body-default-line-height);\n -webkit-text-decoration: var(--cre8-typography-body-default-text-decoration);\n text-decoration: var(--cre8-typography-body-default-text-decoration);\n text-transform: var(--cre8-typography-body-default-text-transform);\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n color: var(--cre8-color-content-default);\n background: var(--background-default);\n}\n\n@media all and (min-width: 60rem) {\n .page-container {\n background: linear-gradient(90deg, #fff 0, #fff 66.66%, #f8f8f9 0, #f8f8f9 0);\n }\n}\n.band__inner {\n margin-left: 2rem;\n margin-right: 2rem;\n}\n\n@media all and (min-width: 60rem) {\n .band__inner {\n margin-right: 0;\n }\n}\nimg {\n max-width: 100%;\n height: auto;\n}\n\n/**\n * Border-Box http:/paulirish.com/2012/box-sizing-border-box-ftw/\n */\n*,\n::slotted(*),\n*:before,\n*:after {\n box-sizing: border-box;\n}\n\n:root {\n --size-base-unit: 0.5rem;\n}\n\n/**\n * RTL support for values logical properties can't automatically adjust for\n * 1) Percentage based horizontal translate values need to be flipped\n * 2) Background gradients using \"to-right\" or \"to-left\" need to be switched to using deg values.\n * 3) Inverse items that have 45degs\n */\n[dir=rtl] {\n --rtlTranslateX: 50%;\n /* 1 */\n --rtlGradientToRight: 270deg;\n /* 2 */\n --rtlRotate45Inverse: -45deg;\n /* 3 */\n}\n\n/**\n * Visible focus outline for elements on a light background\n */\n/**\n * Visible focus outline for elements with an error status\n */\n/**\n * Visible focus outline for elements on a dark background\n */\n/**\n* Focus state for themes that need a dashed outline for focus\n* state\n**/\n/**\n * Invisible focus outline for elements that need a more visible\n * focus state for high-contrast mode\n */\n/**\n * Visually hidden from display\n */\n/*\n=======\nAnimations\n=======\n*/\n:host {\n --cre8-z-index-1: 1;\n --cre8-z-index-50: 50;\n --cre8-z-index-100: 100;\n --cre8-z-index-200: 200;\n --cre8-z-index-1030: 1030;\n --cre8-anim-fade-quick: 0.35s;\n --cre8-anim-ease: ease;\n}\n\n@keyframes fadeIn {\n 100% {\n opacity: 1;\n }\n}\n@keyframes slideIn {\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes slideInFwd {\n 100% {\n width: 272px;\n height: 272px;\n }\n}\n@keyframes slideOutRight {\n 100% {\n width: 272px;\n height: 272px;\n }\n}\n@keyframes slideUp {\n 100% {\n transform: translateY(0);\n }\n}\n@media (width >= 481px) {\n @keyframes slideInFwd {\n 100% {\n width: 417px;\n height: 417px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 417px;\n height: 417px;\n }\n }\n}\n@media (width >= 48rem) {\n @keyframes slideInFwd {\n 100% {\n width: 330px;\n height: 330px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 330px;\n height: 330px;\n transform: translateX(calc(100vw - 45px));\n }\n }\n}\n@media (width >= 60rem) {\n @keyframes slideInFwd {\n 100% {\n width: 460px;\n height: 460px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 460px;\n height: 460px;\n transform: translateX(calc(100vw - 45px));\n }\n }\n}\n@media (width >= 75rem) {\n @keyframes slideInFwd {\n 100% {\n width: 592px;\n height: 591px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 592px;\n height: 591px;\n transform: translateX(calc(100vw - 45px));\n }\n }\n}\n@media (width >= 87.5rem) {\n @keyframes slideOutRight {\n 100% {\n width: 592px;\n height: 591px;\n transform: translateX(calc(100vw - 120px));\n }\n }\n}\n@media (width >= 2200px) {\n @keyframes slideOutRight {\n 100% {\n width: 592px;\n height: 591px;\n transform: translateX(calc(100vw - 592px));\n }\n }\n}\nspan.ripple {\n position: absolute;\n border-radius: 50%;\n transform: scale(0);\n animation: ripple 600ms linear;\n background-color: var(--ripple-bg-color);\n}\n\n@keyframes ripple {\n to {\n transform: scale(4);\n opacity: 1;\n }\n}\n:root {\n --size-base-unit: 0.5rem;\n}\n\n/**\n * RTL support for values logical properties can't automatically adjust for\n * 1) Percentage based horizontal translate values need to be flipped\n * 2) Background gradients using \"to-right\" or \"to-left\" need to be switched to using deg values.\n * 3) Inverse items that have 45degs\n */\n[dir=rtl] {\n --rtlTranslateX: 50%;\n /* 1 */\n --rtlGradientToRight: 270deg;\n /* 2 */\n --rtlRotate45Inverse: -45deg;\n /* 3 */\n}\n\n/**\n * Visible focus outline for elements on a light background\n */\n/**\n * Visible focus outline for elements with an error status\n */\n/**\n * Visible focus outline for elements on a dark background\n */\n/**\n* Focus state for themes that need a dashed outline for focus\n* state\n**/\n/**\n * Invisible focus outline for elements that need a more visible\n * focus state for high-contrast mode\n */\n/**\n * Visually hidden from display\n */\n::slotted(*) {\n flex: 1;\n}\n\n.cre8-c-progress-steps {\n display: flex;\n flex-direction: row;\n margin: var(--cre8-spacing-24);\n}\n@media (max-width: 768px) {\n .cre8-c-progress-steps {\n flex-direction: column;\n }\n}`;\nexport default styles;\n"]}
|
|
1
|
+
{"version":3,"file":"progress-steps.styles.js","sourceRoot":"","sources":["../../../components/progress-steps/progress-steps.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwlBhB,CAAC;AACH,eAAe,MAAM,CAAC","sourcesContent":["import { css } from 'lit';\nconst styles = css`.cre8-u-content-knockout-brand {\n color: var(----cre8-color-content-knockout-brand);\n}\n\n.cre8-u-is-hidden {\n display: none !important;\n visibility: hidden !important;\n}\n\n.cre8-u-is-vishidden {\n position: absolute !important;\n overflow: hidden;\n width: 1px;\n height: 1px;\n padding: 0;\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n}\n\n@media all and (min-width: 23.4375rem) {\n .cre8-u-hide-sm {\n display: none !important;\n }\n}\n@media all and (min-width: 35rem) {\n .cre8-u-hide-sm-2 {\n display: none !important;\n }\n}\n@media all and (min-width: 48rem) {\n .cre8-u-hide-md {\n display: none !important;\n }\n}\n@media all and (min-width: 60rem) {\n .cre8-u-hide-lg {\n display: none !important;\n }\n}\n@media all and (min-width: 75rem) {\n .cre8-u-hide-xl {\n display: none !important;\n }\n}\n@media all and (max-width: 23.4375rem) {\n .cre8-u-show-sm {\n display: none !important;\n }\n}\n@media all and (max-width: 35rem) {\n .cre8-u-show-sm-2 {\n display: none !important;\n }\n}\n@media all and (max-width: 48rem) {\n .cre8-u-show-md {\n display: none !important;\n }\n}\n@media all and (max-width: 60rem) {\n .cre8-u-show-lg {\n display: none !important;\n }\n}\n@media all and (max-width: 75rem) {\n .cre8-u-show-xl {\n display: none !important;\n }\n}\n.cre8-u-margin-none {\n margin: 0 !important;\n}\n\n.cre8-u-margin-sm {\n margin: size(1) !important;\n}\n\n.cre8-u-margin-md {\n margin: size(2) !important;\n}\n\n.cre8-u-margin-lg {\n margin: size(3) !important;\n}\n\n.cre8-u-margin-xl {\n margin: size(4) !important;\n}\n\n.cre8-u-margin-xxl {\n margin: size(8) !important;\n}\n\n.cre8-u-margin-top-none {\n margin-top: 0 !important;\n}\n\n.cre8-u-margin-top-sm {\n margin-top: size(1) !important;\n}\n\n.cre8-u-margin-top-md {\n margin-top: size(2) !important;\n}\n\n.cre8-u-margin-top-lg {\n margin-top: size(3) !important;\n}\n\n.cre8-u-margin-top-xl {\n margin-top: size(4) !important;\n}\n\n.cre8-u-margin-top-xxl {\n margin-top: size(8) !important;\n}\n\n.cre8-u-margin-right-none {\n margin-right: 0 !important;\n}\n\n.cre8-u-margin-right-sm {\n margin-right: size(1) !important;\n}\n\n.cre8-u-margin-right-md {\n margin-right: size(2) !important;\n}\n\n.cre8-u-margin-right-lg {\n margin-right: size(3) !important;\n}\n\n.cre8-u-margin-right-xl {\n margin-right: size(4) !important;\n}\n\n.cre8-u-margin-right-xxl {\n margin-right: size(8) !important;\n}\n\n.cre8-u-margin-bottom-none {\n margin-bottom: 0 !important;\n}\n\n.cre8-u-margin-bottom-sm {\n margin-bottom: size(1) !important;\n}\n\n.cre8-u-margin-bottom-md {\n margin-bottom: size(2) !important;\n}\n\n.cre8-u-margin-bottom-lg {\n margin-bottom: size(3) !important;\n}\n\n.cre8-u-margin-bottom-xl {\n margin-bottom: size(4) !important;\n}\n\n.cre8-u-margin-bottom-xxl {\n margin-bottom: size(8) !important;\n}\n\n.cre8-u-margin-bottom-xl-xxl {\n margin-bottom: size(4) !important;\n}\n\n@media all and (min-width: 768px) {\n .cre8-u-margin-bottom-xl-xxl {\n margin-bottom: size(8) !important;\n }\n}\n.cre8-u-margin-left-none {\n margin-left: 0 !important;\n}\n\n.cre8-u-margin-left-sm {\n margin-left: size(1) !important;\n}\n\n.cre8-u-margin-left-md {\n margin-left: size(2) !important;\n}\n\n.cre8-u-margin-left-lg {\n margin-left: size(3) !important;\n}\n\n.cre8-u-margin-left-xl {\n margin-left: size(4) !important;\n}\n\n.cre8-u-margin-left-xxl {\n margin-left: size(8) !important;\n}\n\n.cre8-u-padding-none {\n padding: 0 !important;\n}\n\n.cre8-u-padding-sm {\n padding: size(1) !important;\n}\n\n.cre8-u-padding-md {\n padding: size(2) !important;\n}\n\n.cre8-u-padding-lg {\n padding: size(3) !important;\n}\n\n.cre8-u-padding-xl {\n padding: size(4) !important;\n}\n\n.cre8-u-padding-xxl {\n padding: size(8) !important;\n}\n\n.cre8-u-padding-top-none {\n padding-top: 0 !important;\n}\n\n.cre8-u-padding-top-sm {\n padding-top: size(1) !important;\n}\n\n.cre8-u-padding-top-md {\n padding-top: size(2) !important;\n}\n\n.cre8-u-padding-top-lg {\n padding-top: size(3) !important;\n}\n\n.cre8-u-padding-top-xl {\n padding-top: size(4) !important;\n}\n\n.cre8-u-padding-top-xxl {\n padding-top: size(8) !important;\n}\n\n.cre8-u-padding-right-none {\n padding-right: 0 !important;\n}\n\n.cre8-u-padding-right-sm {\n padding-right: size(1) !important;\n}\n\n.cre8-u-padding-right-md {\n padding-right: size(2) !important;\n}\n\n.cre8-u-padding-right-lg {\n padding-right: size(3) !important;\n}\n\n.cre8-u-padding-right-xl {\n padding-right: size(4) !important;\n}\n\n.cre8-u-padding-right-xxl {\n padding-right: size(8) !important;\n}\n\n.cre8-u-padding-bottom-none {\n padding-bottom: 0 !important;\n}\n\n.cre8-u-padding-bottom-sm {\n padding-bottom: size(1) !important;\n}\n\n.cre8-u-padding-bottom-md {\n padding-bottom: size(2) !important;\n}\n\n.cre8-u-padding-bottom-lg {\n padding-bottom: size(3) !important;\n}\n\n.cre8-u-padding-bottom-xl {\n padding-bottom: size(4) !important;\n}\n\n.cre8-u-padding-bottom-xxl {\n padding-bottom: size(8) !important;\n}\n\n.cre8-u-padding-left-none {\n padding-left: 0 !important;\n}\n\n.cre8-u-padding-left-sm {\n padding-left: size(1) !important;\n}\n\n.cre8-u-padding-left-md {\n padding-left: size(2) !important;\n}\n\n.cre8-u-padding-left-lg {\n padding-left: size(3) !important;\n}\n\n.cre8-u-padding-left-xl {\n padding-left: size(4) !important;\n}\n\n.cre8-u-padding-left-xxl {\n padding-left: size(8) !important;\n}\n\n.cre8-u-display-flex {\n display: flex !important;\n}\n\n.cre8-u-display-block {\n display: block !important;\n}\n\nbody {\n font-family: var(--cre8-typography-body-default-font-family);\n font-size: var(--cre8-typography-body-default-font-size);\n font-weight: var(--cre8-typography-body-default-font-weight);\n line-height: var(--cre8-typography-body-default-line-height);\n -webkit-text-decoration: var(--cre8-typography-body-default-text-decoration);\n text-decoration: var(--cre8-typography-body-default-text-decoration);\n text-transform: var(--cre8-typography-body-default-text-transform);\n display: flex;\n flex-direction: column;\n padding: 0;\n margin: 0;\n color: var(--cre8-color-content-default);\n background: var(--background-default);\n}\n\n@media all and (min-width: 60rem) {\n .page-container {\n background: linear-gradient(90deg, #fff 0, #fff 66.66%, #f8f8f9 0, #f8f8f9 0);\n }\n}\n.band__inner {\n margin-left: 2rem;\n margin-right: 2rem;\n}\n\n@media all and (min-width: 60rem) {\n .band__inner {\n margin-right: 0;\n }\n}\nimg {\n max-width: 100%;\n height: auto;\n}\n\n/**\n * Border-Box http:/paulirish.com/2012/box-sizing-border-box-ftw/\n */\n*,\n::slotted(*),\n*:before,\n*:after {\n box-sizing: border-box;\n}\n\n:root {\n --size-base-unit: 0.5rem;\n}\n\n/**\n * RTL support for values logical properties can't automatically adjust for\n * 1) Percentage based horizontal translate values need to be flipped\n * 2) Background gradients using \"to-right\" or \"to-left\" need to be switched to using deg values.\n * 3) Inverse items that have 45degs\n */\n[dir=rtl] {\n --rtlTranslateX: 50%;\n /* 1 */\n --rtlGradientToRight: 270deg;\n /* 2 */\n --rtlRotate45Inverse: -45deg;\n /* 3 */\n}\n\n/**\n * Visible focus outline for elements on a light background\n */\n/**\n * Visible focus outline for elements with an error status\n */\n/**\n * Visible focus outline for elements on a dark background\n */\n/**\n* Focus state for themes that need a dashed outline for focus\n* state\n**/\n/**\n * Invisible focus outline for elements that need a more visible\n * focus state for high-contrast mode\n */\n/**\n * Visually hidden from display\n */\n/*\n=======\nAnimations\n=======\n*/\n:host {\n --cre8-z-index-1: 1;\n --cre8-z-index-50: 50;\n --cre8-z-index-100: 100;\n --cre8-z-index-200: 200;\n --cre8-z-index-1030: 1030;\n --cre8-anim-fade-quick: 0.35s;\n --cre8-anim-ease: ease;\n}\n\n@keyframes fadeIn {\n 100% {\n opacity: 1;\n }\n}\n@keyframes slideIn {\n 100% {\n transform: translateX(0);\n }\n}\n@keyframes slideInFwd {\n 100% {\n width: 272px;\n height: 272px;\n }\n}\n@keyframes slideOutRight {\n 100% {\n width: 272px;\n height: 272px;\n }\n}\n@keyframes slideUp {\n 100% {\n transform: translateY(0);\n }\n}\n@media (width >= 481px) {\n @keyframes slideInFwd {\n 100% {\n width: 417px;\n height: 417px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 417px;\n height: 417px;\n }\n }\n}\n@media (width >= 48rem) {\n @keyframes slideInFwd {\n 100% {\n width: 330px;\n height: 330px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 330px;\n height: 330px;\n transform: translateX(calc(100vw - 45px));\n }\n }\n}\n@media (width >= 60rem) {\n @keyframes slideInFwd {\n 100% {\n width: 460px;\n height: 460px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 460px;\n height: 460px;\n transform: translateX(calc(100vw - 45px));\n }\n }\n}\n@media (width >= 75rem) {\n @keyframes slideInFwd {\n 100% {\n width: 592px;\n height: 591px;\n }\n }\n @keyframes slideOutRight {\n 100% {\n width: 592px;\n height: 591px;\n transform: translateX(calc(100vw - 45px));\n }\n }\n}\n@media (width >= 87.5rem) {\n @keyframes slideOutRight {\n 100% {\n width: 592px;\n height: 591px;\n transform: translateX(calc(100vw - 120px));\n }\n }\n}\n@media (width >= 2200px) {\n @keyframes slideOutRight {\n 100% {\n width: 592px;\n height: 591px;\n transform: translateX(calc(100vw - 592px));\n }\n }\n}\nspan.ripple {\n position: absolute;\n border-radius: 50%;\n transform: scale(0);\n animation: ripple 600ms linear;\n background-color: var(--ripple-bg-color);\n}\n\n@keyframes ripple {\n to {\n transform: scale(4);\n opacity: 1;\n }\n}\n:root {\n --size-base-unit: 0.5rem;\n}\n\n/**\n * RTL support for values logical properties can't automatically adjust for\n * 1) Percentage based horizontal translate values need to be flipped\n * 2) Background gradients using \"to-right\" or \"to-left\" need to be switched to using deg values.\n * 3) Inverse items that have 45degs\n */\n[dir=rtl] {\n --rtlTranslateX: 50%;\n /* 1 */\n --rtlGradientToRight: 270deg;\n /* 2 */\n --rtlRotate45Inverse: -45deg;\n /* 3 */\n}\n\n/**\n * Visible focus outline for elements on a light background\n */\n/**\n * Visible focus outline for elements with an error status\n */\n/**\n * Visible focus outline for elements on a dark background\n */\n/**\n* Focus state for themes that need a dashed outline for focus\n* state\n**/\n/**\n * Invisible focus outline for elements that need a more visible\n * focus state for high-contrast mode\n */\n/**\n * Visually hidden from display\n */\n:host {\n display: flex;\n}\n\n::slotted(*) {\n flex: 1;\n}\n\n.cre8-c-progress-steps {\n display: flex;\n flex-direction: row;\n margin: var(--cre8-spacing-24);\n}\n@media (max-width: 768px) {\n .cre8-c-progress-steps {\n flex-direction: column;\n }\n}`;\nexport default styles;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-tile.d.ts","sourceRoot":"","sources":["../../../components/select-tile/select-tile.ts"],"names":[],"mappings":"AACA,OAAO,EACS,cAAc,EAC7B,MAAM,KAAK,CAAC;AAKb,OAAO,EAAE,eAAe,EAA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EAAE,MAAM,CAAC;IAEjB;;OAEG;IAEH,OAAO,CAAC,eAAe,CAAC,CAAS;IAEjC;;OAEG;IAEH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,IAAI,IAAI,oBAEP;IAED;;;;OAIG;IACH,iBAAiB;IAWjB;;;;;OAKG;IACH,iBAAiB,IAAI,IAAI;IAMzB;;;;OAIG;IACH,OAAO,CAAC,YAAY,EAAE,cAAc;IAwBpC,WAAW;IAgBX,kBAAkB;IASlB,MAAM;CAgET;AAMD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,kBAAkB,EAAE,cAAc,CAAC;KACtC;CACJ;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -178,6 +178,7 @@ export class Cre8SelectTile extends Cre8FormElement {
|
|
|
178
178
|
});
|
|
179
179
|
const labelTabIndex = this.disabled ? undefined : '0';
|
|
180
180
|
return html `
|
|
181
|
+
<div class="cre8-c-select-tile__container" part="container">
|
|
181
182
|
${this.renderInput()}
|
|
182
183
|
<label class="${componentClassNames}" part="select-tile" for=${this.fieldId} tabindex=${labelTabIndex}>
|
|
183
184
|
${this.slotNotEmpty('header') && html `
|
|
@@ -207,7 +208,8 @@ export class Cre8SelectTile extends Cre8FormElement {
|
|
|
207
208
|
<cre8-icon svg="${svgCheck}" class="cre8-c-select-tile__icon"></cre8-icon>
|
|
208
209
|
</div>
|
|
209
210
|
</div>
|
|
210
|
-
</label
|
|
211
|
+
</label>
|
|
212
|
+
</div>`;
|
|
211
213
|
}
|
|
212
214
|
}
|
|
213
215
|
Cre8SelectTile.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-tile.js","sourceRoot":"","sources":["../../../components/select-tile/select-tile.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAQ,MAAM,0CAA0C,CAAC;AAChE,OAAO,EACH,UAAU,EAAkB,IAAI,GAC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AO,EAAE,IAAI,EAAE,CAAC;qDACyC;AAMjE;IADH,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDACc;AAWtC;IADH,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACP;AAMjB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACrB;AAMlB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDACpB;AAMnB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDACpB;AAQnB;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACrB;AASlB;IADH,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDACrC;AAMxB;IADH,QAAQ,EAAE;+CACU;AAMb;IADP,QAAQ,EAAE;uDACsB;AAM7B;IADH,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACnB;AA6J5B,IAAI,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,SAAS,EAAE,CAAC;IACvD,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;AAC9D,CAAC;AAQD,eAAe,cAAc,CAAC","sourcesContent":["import svgCheck from '../../icons/System/Regular/Check.svg?raw';\nimport {\n LitElement, PropertyValues, html,\n} from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit-html/directives/if-defined.js';\nimport { nanoid } from 'nanoid';\n\nimport { Cre8FormElement } from '../cre8-form-element';\nimport '../icon/icon';\n\nimport styles from './select-tile.styles.js';\nimport { SelectTileRadioController } from './select-tile-radio-controller';\nimport { SelectTileCheckboxController } from './select-tile-checkbox-controller';\n\n /**\n * The Select Tile component is a short block of content inside a visual\n * container that can be used in place of checkboxes, radio buttons, and\n * links. It allows you to add more descriptive and visually appealing\n * content for these actions while letting you compare different choices\n * either side-by-side or on top of each other.\n *\n * Typically you could use the \"header\" slot for an icon, and the \"title\"\n * and \"body\" slots for a content title and body text below it.\n *\n * The css parts are shown here wrapped in ::part() because otherwise Storybook\n * won't render them and the slots if they have the same name.\n * See https://developer.mozilla.org/en-US/docs/Web/CSS/::part\n *\n * @fires change\n * @fires input\n * @slot \"\" - The default slot goes into the center, main part of the Select Tile.\n * Consider using title and body instead.\n * @slot \"header\" - The top or left part of the Select Tile\n * @slot footer - The bottom or right part of the Select Tile\n * @slot title - The title part of the Select Tile, use with body slot and\n * instead of the default slot for appropriate typography.\n * @slot \"body\" - The \"body\" part of the Select Tile, which appears under\n * the title slot and receives apporpriate typography.\n *\n * @csspart ::part(select-tile) - The main wrapping element\n * @csspart ::part(header) - The header element wrapping the left or top element\n * @csspart ::part(footer) - The footer element wrapping the right element\n * @csspart ::part(body) - The main body of the select-tile, wrapper around the default slot\n * @csspart ::part(body-title) - The element that wraps the \"title\" slot\n * @csspart ::part(body-body) - The element that wraps the \"body\" slot\n *\n */\nexport class Cre8SelectTile extends Cre8FormElement {\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n private _controller: SelectTileRadioController | SelectTileCheckboxController | undefined = undefined;\n\n /**\n * Should this Select Tile behave as a radio button or a checkbox?\n */\n @property({ reflect: true })\n type: 'radio' | 'checkbox' = 'radio';\n\n /**\n * Get the radio field item input\n */\n @query('input')\n field!: HTMLInputElement;\n\n static styles = [styles];\n\n /**\n * Style variants\n * - **bare** renders a select-tile without a border and without padding around the content\n * - **horizontal** renders a select-tile with header, body, footer oriented in a row rather than a column\n * - **horizontal-bare** renders a select-tile with header, body, footer\n * oriented in a row rather than a column without a border and without padding around the content\n */\n @property({ reflect: true })\n variant?: 'bare' | 'horizontal' | 'horizontal-bare';\n\n /**\n * Which breakpoint, if any, to switch to verticial.\n * Only useful for horizontal variants. Defaults to 'sm'.\n */\n @property({ reflect: true })\n variantBreakToVertical: 'sm' | 'sm-2' | 'md' | 'lg' | 'xl' | 'xxl' | 'none' = 'sm';\n\n /**\n * Where does the checkmark or radio button go?\n * It disappears on 'none'. Only top-right is supported for vertical variants.\n */\n @property({ reflect: true })\n checkPosition: 'left' | 'right' | 'top-right' | 'none' = 'right';\n\n /**\n * In radio mode, whether to use the circle with the dot, or the rounded check.\n */\n @property({ reflect: true })\n radioVariant: 'dot' | 'check' = 'dot';\n\n /**\n * Align variants\n * <cre8-text-passage size=\"sm\">\n * <ul>\n * <li>**center** renders a select-tile that has center aligned content/text</li>\n * </ul>\n * </cre8-text-passage>\n */\n @property({ reflect: true })\n align?: 'center';\n\n /**\n * Error State\n */\n @property({ type: Boolean, reflect: true })\n isError?: boolean;\n\n /**\n * Disabled State\n */\n @property({ type: Boolean, reflect: true })\n disabled?: boolean;\n\n /**\n * Required attribute\n */\n @property({ type: Boolean, reflect: true })\n required?: boolean;\n\n /**\n * Checked State.\n * Note: the `checked` attribute sets the `defaultChecked` property, as well\n * as sets the initial value for the `checked` property.\n */\n @property({ type: Boolean, reflect: true })\n checked?: boolean;\n\n /**\n * The default checked state when the element first renders or is reset.\n *\n * Note: the attribute is named `checked` and the property is\n * named `defaultChecked`. This is the same as a regular radio button.\n */\n @property({ attribute: 'checked', type: Boolean, reflect: true })\n defaultChecked: boolean;\n\n /**\n * Select Tile FieldId\n */\n @property()\n fieldId?: string;\n\n /**\n * Radio item fieldnote aria describe by\n */\n @property()\n private ariaDescribedBy?: string;\n\n /**\n * Radio item fieldnote isSuccess\n */\n @property({ type: Boolean, reflect: true })\n isSuccess?: boolean;\n\n /**\n * The form associated with this field\n *\n * TOOD: maybe this goes on Cre8FormElement\n */\n get form() {\n return this._internals.form;\n }\n\n /**\n * Connected callback lifecycle\n * 1) Auto-generate the fieldId if a user doesn't provided so that the form field is accessible\n * 2) Initialize the correct controller\n */\n connectedCallback() {\n super.connectedCallback();\n this.fieldId = this.fieldId || nanoid(); /* 1 */\n this._controller = this.type === 'radio'\n ? new SelectTileRadioController(this)\n : new SelectTileCheckboxController(this);\n if (this.disabled) {\n this._internals.ariaDisabled = 'true';\n }\n }\n\n /**\n * Reset form callback\n * 1) Remove the checked state from all radio elements\n * 2) Set the checked state to the initial checked state\n * 3) Set the radio field input checked attribute to the initial checked state\n */\n formResetCallback(): void {\n this.checked = this.defaultChecked;\n this.field.checked = this.defaultChecked;\n }\n\n\n /**\n * Whenever the \"checked\" property changes, update our form value, aria-checked,\n * and the checked property of `this.field`.\n *\n */\n updated(changedProps: PropertyValues) {\n super.updated(changedProps);\n\n if (changedProps.has('checked')) {\n // this.field.checked = this.checked;\n // this.field.checked ? this._internals.setFormValue(this.value || 'on') : this._internals.setFormValue(null);\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n }\n if (changedProps.has('type')) {\n this._controller.hostDisconnected();\n this._controller = this.type === 'radio'\n ? new SelectTileRadioController(this)\n : new SelectTileCheckboxController(this);\n }\n if (changedProps.has('disabled')) {\n if (this.disabled) {\n this._internals.ariaDisabled = 'true';\n } else {\n this._internals.ariaDisabled = 'false';\n }\n }\n }\n\n\n renderInput() {\n return html`\n <input\n class=\"cre8-c-select-tile__input\"\n type=${this.type}\n id=${this.fieldId}\n aria-describedby=\"${ifDefined(this.ariaDescribedBy)}\"\n ?required=${this.required}\n name=${this.name}\n .value=${this.value}\n ?disabled=\"${this.disabled}\"\n .checked=\"${this.checked}\"\n />\n `;\n }\n\n renderCheckboxIcon() {\n if (this.type === 'checkbox') {\n return html`\n <cre8-icon svg=\"${svgCheck}\" class=\"cre8-c-select-tile__icon\" aria-hidden=\"${!this.checked}\"></cre8-icon>\n `;\n }\n return null;\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-select-tile', {\n 'cre8-c-select-tile--bare': this.variant === 'bare',\n 'cre8-c-select-tile--horizontal': this.variant === 'horizontal',\n 'cre8-c-select-tile--horizontal-bare': this.variant === 'horizontal-bare',\n 'cre8-c-select-tile--vertical-at-sm': this.variantBreakToVertical === 'sm',\n 'cre8-c-select-tile--vertical-at-sm-2': this.variantBreakToVertical === 'sm-2',\n 'cre8-c-select-tile--vertical-at-md': this.variantBreakToVertical === 'md',\n 'cre8-c-select-tile--vertical-at-lg': this.variantBreakToVertical === 'lg',\n 'cre8-c-select-tile--vertical-at-xl': this.variantBreakToVertical === 'xl',\n 'cre8-c-select-tile--vertical-at-xxl': this.variantBreakToVertical === 'xxl',\n 'cre8-c-select-tile--align-center': this.align === 'center',\n 'cre8-c-select-tile--error': this.isError,\n 'cre8-c-select-tile--success': this.isSuccess,\n 'cre8-c-select-tile--disabled': this.disabled,\n });\n\n const checkboxClassNames = this.componentClassNames(\n this.type === 'radio' ? 'cre8-c-select-tile__custom-radio' : 'cre8-c-select-tile__custom-checkbox',\n {\n 'cre8-c-select-tile__custom-radio-top-right': !this.variant\n || this.variant === 'bare' || this.checkPosition === 'top-right',\n 'cre8-c-select-tile__custom-radio-left': this.checkPosition === 'left',\n 'cre8-c-select-tile__custom-radio-none': this.checkPosition === 'none',\n 'cre8-c-select-tile__custom-radio-check': this.radioVariant === 'check',\n }\n );\n\n const labelTabIndex = this.disabled ? undefined : '0';\n\n return html`\n ${this.renderInput()}\n <label class=\"${componentClassNames}\" part=\"select-tile\" for=${this.fieldId} tabindex=${labelTabIndex}>\n ${this.slotNotEmpty('header') && html`\n <div class=\"cre8-c-select-tile__header\" part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n `}\n <div part=\"body\" class=\"cre8-c-select-tile__body\">\n <slot></slot>\n ${this.slotNotEmpty('title') && html`\n <div part=\"body-title\" class=\"cre8-c-select-tile__body_title\">\n <slot name=\"title\"></slot>\n </div>\n `}\n ${this.slotNotEmpty('body') && html`\n <div part=\"body-body\" class=\"cre8-c-select-tile__body_body\">\n <slot name=\"body\"></slot>\n </div>\n `}\n </div>\n <div part=\"footer\" class=\"cre8-c-select-tile__footer\">\n <slot name=\"footer\"></slot>\n </div>\n <div class=\"${checkboxClassNames}\">\n ${this.renderCheckboxIcon()}\n <div class=\"cre8-c-select-tile__inner-circle\">\n <cre8-icon svg=\"${svgCheck}\" class=\"cre8-c-select-tile__icon\"></cre8-icon>\n </div>\n </div>\n </label>`;\n }\n}\n\nif (customElements.get('cre8-select-tile') === undefined) {\n customElements.define('cre8-select-tile', Cre8SelectTile);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-select-tile': Cre8SelectTile;\n }\n}\n\nexport default Cre8SelectTile;\n"]}
|
|
1
|
+
{"version":3,"file":"select-tile.js","sourceRoot":"","sources":["../../../components/select-tile/select-tile.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAQ,MAAM,0CAA0C,CAAC;AAChE,OAAO,EACH,UAAU,EAAkB,IAAI,GACnC,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,cAAc,CAAC;AAEtB,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCE;AACF,MAAM,OAAO,cAAe,SAAQ,eAAe;IAAnD;;QAGY,gBAAW,GAAyE,SAAS,CAAC;QAEtG;;WAEG;QAEH,SAAI,GAAyB,OAAO,CAAC;QAoBrC;;;WAGG;QAEH,2BAAsB,GAAwD,IAAI,CAAC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AAI,EAAE,CAAC;sDACzC;AAMxB;IADC,QAAQ,EAAE;+CACM;AAMT;IADP,QAAQ,EAAE;uDACsB;AAMjC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACvB;AA+JxB,IAAI,cAAc,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,SAAS,EAAE,CAAC;IACvD,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,cAAc,CAAC,CAAC;AAC9D,CAAC;AAQD,eAAe,cAAc,CAAC","sourcesContent":["import svgCheck from '../../icons/System/Regular/Check.svg?raw';\nimport {\n LitElement, PropertyValues, html,\n} from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit-html/directives/if-defined.js';\nimport { nanoid } from 'nanoid';\n\nimport { Cre8FormElement } from '../cre8-form-element';\nimport '../icon/icon';\n\nimport styles from './select-tile.styles.js';\nimport { SelectTileRadioController } from './select-tile-radio-controller';\nimport { SelectTileCheckboxController } from './select-tile-checkbox-controller';\n\n/**\n * The Select Tile component is a short block of content inside a visual\n * container that can be used in place of checkboxes, radio buttons, and\n * links. It allows you to add more descriptive and visually appealing\n * content for these actions while letting you compare different choices\n * either side-by-side or on top of each other.\n *\n * Typically you could use the \"header\" slot for an icon, and the \"title\"\n * and \"body\" slots for a content title and body text below it.\n *\n * The css parts are shown here wrapped in ::part() because otherwise Storybook\n * won't render them and the slots if they have the same name.\n * See https://developer.mozilla.org/en-US/docs/Web/CSS/::part\n *\n * @fires change\n * @fires input\n * @slot \"\" - The default slot goes into the center, main part of the Select Tile.\n * Consider using title and body instead.\n * @slot \"header\" - The top or left part of the Select Tile\n * @slot footer - The bottom or right part of the Select Tile\n * @slot title - The title part of the Select Tile, use with body slot and\n * instead of the default slot for appropriate typography.\n * @slot \"body\" - The \"body\" part of the Select Tile, which appears under\n * the title slot and receives apporpriate typography.\n *\n * @csspart ::part(select-tile) - The main wrapping element\n * @csspart ::part(header) - The header element wrapping the left or top element\n * @csspart ::part(footer) - The footer element wrapping the right element\n * @csspart ::part(body) - The main body of the select-tile, wrapper around the default slot\n * @csspart ::part(body-title) - The element that wraps the \"title\" slot\n * @csspart ::part(body-body) - The element that wraps the \"body\" slot\n *\n*/\nexport class Cre8SelectTile extends Cre8FormElement {\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n private _controller: SelectTileRadioController | SelectTileCheckboxController | undefined = undefined;\n\n /**\n * Should this Select Tile behave as a radio button or a checkbox?\n */\n @property({ reflect: true })\n type: 'radio' | 'checkbox' = 'radio';\n\n /**\n * Get the radio field item input\n */\n @query('input')\n field!: HTMLInputElement;\n\n static styles = [styles];\n\n /**\n * Style variants\n * - **bare** renders a select-tile without a border and without padding around the content\n * - **horizontal** renders a select-tile with header, body, footer oriented in a row rather than a column\n * - **horizontal-bare** renders a select-tile with header, body, footer\n * oriented in a row rather than a column without a border and without padding around the content\n */\n @property({ reflect: true })\n variant?: 'bare' | 'horizontal' | 'horizontal-bare';\n\n /**\n * Which breakpoint, if any, to switch to verticial.\n * Only useful for horizontal variants. Defaults to 'sm'.\n */\n @property({ reflect: true })\n variantBreakToVertical: 'sm' | 'sm-2' | 'md' | 'lg' | 'xl' | 'xxl' | 'none' = 'sm';\n\n /**\n * Where does the checkmark or radio button go?\n * It disappears on 'none'. Only top-right is supported for vertical variants.\n */\n @property({ reflect: true })\n checkPosition: 'left' | 'right' | 'top-right' | 'none' = 'right';\n\n /**\n * In radio mode, whether to use the circle with the dot, or the rounded check.\n */\n @property({ reflect: true })\n radioVariant: 'dot' | 'check' = 'dot';\n\n /**\n * Align variants\n * <cre8-text-passage size=\"sm\">\n * <ul>\n * <li>**center** renders a select-tile that has center aligned content/text</li>\n * </ul>\n * </cre8-text-passage>\n */\n @property({ reflect: true })\n align?: 'center';\n\n /**\n * Error State\n */\n @property({ type: Boolean, reflect: true })\n isError?: boolean;\n\n /**\n * Disabled State\n */\n @property({ type: Boolean, reflect: true })\n disabled?: boolean;\n\n /**\n * Required attribute\n */\n @property({ type: Boolean, reflect: true })\n required?: boolean;\n\n /**\n * Checked State.\n * Note: the `checked` attribute sets the `defaultChecked` property, as well\n * as sets the initial value for the `checked` property.\n */\n @property({ type: Boolean, reflect: true })\n checked?: boolean;\n\n /**\n * The default checked state when the element first renders or is reset.\n *\n * Note: the attribute is named `checked` and the property is\n * named `defaultChecked`. This is the same as a regular radio button.\n */\n @property({ attribute: 'checked', type: Boolean, reflect: true })\n defaultChecked: boolean;\n\n /**\n * Select Tile FieldId\n */\n @property()\n fieldId?: string;\n\n /**\n * Radio item fieldnote aria describe by\n */\n @property()\n private ariaDescribedBy?: string;\n\n /**\n * Radio item fieldnote isSuccess\n */\n @property({ type: Boolean, reflect: true })\n isSuccess?: boolean;\n\n /**\n * The form associated with this field\n *\n * TOOD: maybe this goes on Cre8FormElement\n */\n get form() {\n return this._internals.form;\n }\n\n /**\n * Connected callback lifecycle\n * 1) Auto-generate the fieldId if a user doesn't provided so that the form field is accessible\n * 2) Initialize the correct controller\n */\n connectedCallback() {\n super.connectedCallback();\n this.fieldId = this.fieldId || nanoid(); /* 1 */\n this._controller = this.type === 'radio'\n ? new SelectTileRadioController(this)\n : new SelectTileCheckboxController(this);\n if (this.disabled) {\n this._internals.ariaDisabled = 'true';\n }\n }\n\n /**\n * Reset form callback\n * 1) Remove the checked state from all radio elements\n * 2) Set the checked state to the initial checked state\n * 3) Set the radio field input checked attribute to the initial checked state\n */\n formResetCallback(): void {\n this.checked = this.defaultChecked;\n this.field.checked = this.defaultChecked;\n }\n\n\n /**\n * Whenever the \"checked\" property changes, update our form value, aria-checked,\n * and the checked property of `this.field`.\n *\n */\n updated(changedProps: PropertyValues) {\n super.updated(changedProps);\n\n if (changedProps.has('checked')) {\n // this.field.checked = this.checked;\n // this.field.checked ? this._internals.setFormValue(this.value || 'on') : this._internals.setFormValue(null);\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n }\n if (changedProps.has('type')) {\n this._controller.hostDisconnected();\n this._controller = this.type === 'radio'\n ? new SelectTileRadioController(this)\n : new SelectTileCheckboxController(this);\n }\n if (changedProps.has('disabled')) {\n if (this.disabled) {\n this._internals.ariaDisabled = 'true';\n } else {\n this._internals.ariaDisabled = 'false';\n }\n }\n }\n\n\n renderInput() {\n return html`\n <input\n class=\"cre8-c-select-tile__input\"\n type=${this.type}\n id=${this.fieldId}\n aria-describedby=\"${ifDefined(this.ariaDescribedBy)}\"\n ?required=${this.required}\n name=${this.name}\n .value=${this.value}\n ?disabled=\"${this.disabled}\"\n .checked=\"${this.checked}\"\n />\n `;\n }\n\n renderCheckboxIcon() {\n if (this.type === 'checkbox') {\n return html`\n <cre8-icon svg=\"${svgCheck}\" class=\"cre8-c-select-tile__icon\" aria-hidden=\"${!this.checked}\"></cre8-icon>\n `;\n }\n return null;\n }\n\n render() {\n const componentClassNames = this.componentClassNames('cre8-c-select-tile', {\n 'cre8-c-select-tile--bare': this.variant === 'bare',\n 'cre8-c-select-tile--horizontal': this.variant === 'horizontal',\n 'cre8-c-select-tile--horizontal-bare': this.variant === 'horizontal-bare',\n 'cre8-c-select-tile--vertical-at-sm': this.variantBreakToVertical === 'sm',\n 'cre8-c-select-tile--vertical-at-sm-2': this.variantBreakToVertical === 'sm-2',\n 'cre8-c-select-tile--vertical-at-md': this.variantBreakToVertical === 'md',\n 'cre8-c-select-tile--vertical-at-lg': this.variantBreakToVertical === 'lg',\n 'cre8-c-select-tile--vertical-at-xl': this.variantBreakToVertical === 'xl',\n 'cre8-c-select-tile--vertical-at-xxl': this.variantBreakToVertical === 'xxl',\n 'cre8-c-select-tile--align-center': this.align === 'center',\n 'cre8-c-select-tile--error': this.isError,\n 'cre8-c-select-tile--success': this.isSuccess,\n 'cre8-c-select-tile--disabled': this.disabled,\n });\n\n const checkboxClassNames = this.componentClassNames(\n this.type === 'radio' ? 'cre8-c-select-tile__custom-radio' : 'cre8-c-select-tile__custom-checkbox',\n {\n 'cre8-c-select-tile__custom-radio-top-right': !this.variant\n || this.variant === 'bare' || this.checkPosition === 'top-right',\n 'cre8-c-select-tile__custom-radio-left': this.checkPosition === 'left',\n 'cre8-c-select-tile__custom-radio-none': this.checkPosition === 'none',\n 'cre8-c-select-tile__custom-radio-check': this.radioVariant === 'check',\n }\n );\n\n const labelTabIndex = this.disabled ? undefined : '0';\n\n return html`\n <div class=\"cre8-c-select-tile__container\" part=\"container\">\n ${this.renderInput()}\n <label class=\"${componentClassNames}\" part=\"select-tile\" for=${this.fieldId} tabindex=${labelTabIndex}>\n ${this.slotNotEmpty('header') && html`\n <div class=\"cre8-c-select-tile__header\" part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n `}\n <div part=\"body\" class=\"cre8-c-select-tile__body\">\n <slot></slot>\n ${this.slotNotEmpty('title') && html`\n <div part=\"body-title\" class=\"cre8-c-select-tile__body_title\">\n <slot name=\"title\"></slot>\n </div>\n `}\n ${this.slotNotEmpty('body') && html`\n <div part=\"body-body\" class=\"cre8-c-select-tile__body_body\">\n <slot name=\"body\"></slot>\n </div>\n `}\n </div>\n <div part=\"footer\" class=\"cre8-c-select-tile__footer\">\n <slot name=\"footer\"></slot>\n </div>\n <div class=\"${checkboxClassNames}\">\n ${this.renderCheckboxIcon()}\n <div class=\"cre8-c-select-tile__inner-circle\">\n <cre8-icon svg=\"${svgCheck}\" class=\"cre8-c-select-tile__icon\"></cre8-icon>\n </div>\n </div>\n </label>\n </div>`;\n }\n}\n\nif (customElements.get('cre8-select-tile') === undefined) {\n customElements.define('cre8-select-tile', Cre8SelectTile);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cre8-select-tile': Cre8SelectTile;\n }\n}\n\nexport default Cre8SelectTile;\n"]}
|