@nanoporetech-digital/components 4.10.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/cjs/{form-control-2e900f54.js → form-control-443e90bf.js} +2 -3
- package/dist/cjs/form-control-443e90bf.js.map +1 -0
- package/dist/cjs/index-71f899a7.js +6 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +2 -2
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-grid-item.cjs.entry.js +29 -0
- package/dist/cjs/nano-grid-item.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-grid_2.cjs.entry.js +436 -0
- package/dist/cjs/nano-grid_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-hero.cjs.entry.js +4 -10
- package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button_2.cjs.entry.js +2 -2
- package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-input.cjs.entry.js +2 -2
- package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +1 -1
- package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +1 -0
- package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-ff33dc43.js → nano-table-11052a34.js} +37 -30
- package/dist/cjs/nano-table-11052a34.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-0a6bc962.js → table.worker-83433a8b.js} +2 -2
- package/dist/cjs/table.worker-83433a8b.js.map +1 -0
- package/dist/collection/components/form-control/form-control.js +1 -2
- package/dist/collection/components/form-control/form-control.js.map +1 -1
- package/dist/collection/components/grid/grid-item.js +11 -136
- package/dist/collection/components/grid/grid-item.js.map +1 -1
- package/dist/collection/components/grid/grid.css +9 -242
- package/dist/collection/components/grid/grid.js +248 -240
- package/dist/collection/components/grid/grid.js.map +1 -1
- package/dist/collection/components/hero/hero.css +42 -89
- package/dist/collection/components/hero/hero.js +4 -11
- package/dist/collection/components/hero/hero.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.css +12 -0
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js.map +1 -1
- package/dist/collection/components/input/input.css +8 -9
- package/dist/collection/components/range/range.css +0 -3
- package/dist/collection/components/select/select.css +8 -9
- package/dist/collection/components/sortable/sortable.js +2 -1
- package/dist/collection/components/sortable/sortable.js.map +1 -1
- package/dist/collection/components/table/table.css +6 -0
- package/dist/collection/components/table/table.js +25 -18
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.row.js +7 -7
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/utils/constructible-style.js +129 -0
- package/dist/collection/utils/constructible-style.js.map +1 -0
- package/dist/components/form-control.js +1 -2
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/grid.js +268 -183
- package/dist/components/grid.js.map +1 -1
- package/dist/components/icon-button.js +2 -2
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/nano-grid-item.js +33 -1
- package/dist/components/nano-grid-item.js.map +1 -1
- package/dist/components/nano-hero.js +6 -19
- package/dist/components/nano-hero.js.map +1 -1
- package/dist/components/nano-range.js +1 -1
- package/dist/components/nano-range.js.map +1 -1
- package/dist/components/nano-sortable.js +1 -0
- package/dist/components/nano-sortable.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/table.js +36 -29
- package/dist/components/table.js.map +1 -1
- package/dist/esm/{form-control-269ba84f.js → form-control-e8739b2e.js} +2 -3
- package/dist/esm/form-control-e8739b2e.js.map +1 -0
- package/dist/esm/index-dad5627b.js +6 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +2 -2
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-grid-item.entry.js +25 -0
- package/dist/esm/nano-grid-item.entry.js.map +1 -0
- package/dist/esm/nano-grid_2.entry.js +431 -0
- package/dist/esm/nano-grid_2.entry.js.map +1 -0
- package/dist/esm/nano-hero.entry.js +4 -10
- package/dist/esm/nano-hero.entry.js.map +1 -1
- package/dist/esm/nano-icon-button_2.entry.js +2 -2
- package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
- package/dist/esm/nano-input.entry.js +2 -2
- package/dist/esm/nano-input.entry.js.map +1 -1
- package/dist/esm/nano-range.entry.js +1 -1
- package/dist/esm/nano-range.entry.js.map +1 -1
- package/dist/esm/nano-sortable.entry.js +1 -0
- package/dist/esm/nano-sortable.entry.js.map +1 -1
- package/dist/esm/{nano-table-ec980076.js → nano-table-ba637f26.js} +37 -30
- package/dist/esm/nano-table-ba637f26.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/{table.worker-b53db58e.js → table.worker-1cae39c9.js} +2 -2
- package/dist/esm/table.worker-1cae39c9.js.map +1 -0
- package/dist/nano-components/nano-components.css +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/p-00cf8021.entry.js +5 -0
- package/dist/nano-components/p-00cf8021.entry.js.map +1 -0
- package/dist/nano-components/{p-f591400b.entry.js → p-158c73b0.entry.js} +2 -2
- package/dist/nano-components/p-365c997a.js +5 -0
- package/dist/nano-components/p-553acf24.entry.js +5 -0
- package/dist/nano-components/{p-58b53239.entry.js.map → p-553acf24.entry.js.map} +1 -1
- package/dist/nano-components/p-6975f110.entry.js +5 -0
- package/dist/nano-components/p-6975f110.entry.js.map +1 -0
- package/dist/nano-components/p-71057181.js +5 -0
- package/dist/nano-components/p-71057181.js.map +1 -0
- package/dist/nano-components/p-ad6209ec.entry.js +5 -0
- package/dist/nano-components/p-ad6209ec.entry.js.map +1 -0
- package/dist/nano-components/p-bdef618c.entry.js +5 -0
- package/dist/nano-components/p-bdef618c.entry.js.map +1 -0
- package/dist/nano-components/{p-241baff8.entry.js → p-d79c6862.entry.js} +2 -2
- package/dist/nano-components/p-d79c6862.entry.js.map +1 -0
- package/dist/nano-components/p-deb0799c.entry.js +5 -0
- package/dist/nano-components/{p-6a3a29c6.entry.js.map → p-deb0799c.entry.js.map} +1 -1
- package/dist/nano-components/p-ebb98a9e.entry.js +5 -0
- package/dist/nano-components/p-ebb98a9e.entry.js.map +1 -0
- package/dist/nano-components/p-fc585ea2.js +5 -0
- package/dist/nano-components/p-fc585ea2.js.map +1 -0
- package/dist/types/components/grid/grid-item.d.ts +3 -11
- package/dist/types/components/grid/grid.d.ts +44 -68
- package/dist/types/components/hero/hero.d.ts +1 -3
- package/dist/types/components/table/table.d.ts +5 -0
- package/dist/types/components.d.ts +85 -61
- package/dist/types/utils/constructible-style.d.ts +31 -0
- package/docs-json.json +147 -88
- package/docs-vscode.json +28 -21
- package/hydrate/index.js +340 -306
- package/package.json +2 -2
- package/dist/cjs/form-control-2e900f54.js.map +0 -1
- package/dist/cjs/nano-grid_3.cjs.entry.js +0 -431
- package/dist/cjs/nano-grid_3.cjs.entry.js.map +0 -1
- package/dist/cjs/nano-table-ff33dc43.js.map +0 -1
- package/dist/cjs/table.worker-0a6bc962.js.map +0 -1
- package/dist/collection/components/grid/grid-item.css +0 -15
- package/dist/components/grid-item.js +0 -107
- package/dist/components/grid-item.js.map +0 -1
- package/dist/esm/form-control-269ba84f.js.map +0 -1
- package/dist/esm/nano-grid_3.entry.js +0 -425
- package/dist/esm/nano-grid_3.entry.js.map +0 -1
- package/dist/esm/nano-table-ec980076.js.map +0 -1
- package/dist/esm/table.worker-b53db58e.js.map +0 -1
- package/dist/nano-components/p-064af7d0.js +0 -5
- package/dist/nano-components/p-064af7d0.js.map +0 -1
- package/dist/nano-components/p-107d4549.entry.js +0 -5
- package/dist/nano-components/p-107d4549.entry.js.map +0 -1
- package/dist/nano-components/p-239d343a.entry.js +0 -5
- package/dist/nano-components/p-239d343a.entry.js.map +0 -1
- package/dist/nano-components/p-241baff8.entry.js.map +0 -1
- package/dist/nano-components/p-58b53239.entry.js +0 -5
- package/dist/nano-components/p-5ac74848.js +0 -5
- package/dist/nano-components/p-5ac74848.js.map +0 -1
- package/dist/nano-components/p-6a3a29c6.entry.js +0 -5
- package/dist/nano-components/p-806bcd46.js +0 -5
- package/dist/nano-components/p-d3de231c.entry.js +0 -5
- package/dist/nano-components/p-d3de231c.entry.js.map +0 -1
- package/dist/nano-components/p-d792f692.entry.js +0 -5
- package/dist/nano-components/p-d792f692.entry.js.map +0 -1
- /package/dist/nano-components/{p-806bcd46.js.map → p-158c73b0.entry.js.map} +0 -0
- /package/dist/nano-components/{p-f591400b.entry.js.map → p-365c997a.js.map} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../src/components/grid/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,GAEN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAErE;;;GAGG;AAMH,MAAM,OAAO,IAAI;EAQf;IALQ,mBAAc,GAAkB,CAAC,EAAE,CAAC,CAAC;IACrC,cAAS,GAAW,IAAI,CAAC;IACzB,YAAO,GAAgB,CAAC,IAAI,CAAC,CAAC;iBAOZ,KAAK;mBACZ,KAAK;oBACJ,K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5B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI;OACvB;MAED,WACE,KAAK,EAAE;UACL,IAAI,EAAE,IAAI;SACX;QAED,eAAQ,CACJ,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n h,\n Prop,\n Element,\n Host,\n State,\n Watch,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { debounce } from '../../utils/throttle';\nimport type { GridSizes } from '../../interface';\n\nconst STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];\n\n/**\n * A context-aware CSS grid implementation.\n * Uses it's own width to choose column number - not screen width.\n */\n@Component({\n tag: 'nano-grid',\n styleUrl: 'grid.scss',\n shadow: true,\n})\nexport class Grid {\n @Element() private el: HTMLNanoGridElement;\n private ro: ResizeObserver;\n private generalClasses: Array<string> = [''];\n private gridClass: string = null;\n private isSizes: GridSizes[] = [null];\n private currentWidth: number;\n\n constructor() {\n this.stateChange = debounce(this.stateChange.bind(this), 100);\n }\n\n @State() ready: boolean = false;\n @State() isSmall = false;\n @State() isMedium = false;\n @State() isLarge = false;\n @State() isXL = false;\n @State() isXXL = false;\n\n /**\n * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() sSize: number = 300;\n\n /**\n * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() mSize: number = 550;\n\n /**\n * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() lSize: number = 800;\n\n /**\n * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() xlSize: number = 1000;\n\n /**\n * the number of columns the grid has at the small breakpoint.\n */\n @Prop() sCols: number;\n\n /**\n * the number of columns the grid has at the medium breakpoint.\n */\n @Prop() mCols: number;\n\n /**\n * the number of columns the grid has at the large breakpoint.\n */\n @Prop() lCols: number;\n\n /**\n * the number of columns the grid has at the xl breakpoint.\n */\n @Prop() xlCols: number;\n\n /**\n * the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint)\n */\n @Prop() xxlCols: number;\n\n /**\n * shows a grid helper to visualise where columns are\n */\n @Prop({ reflect: true }) showHelper: boolean = false;\n\n /**\n * shortcut for a traditional website like grid (requires more than one row). The second row will auto expand to fill the grid height. The first row and > 2nd row will be the size of their content. e.g. header, body and footer.\n */\n @Prop({ reflect: true }) contentPanel: boolean = false;\n\n /**\n * Helper to make grid items expand to full height in IE11\n */\n @Prop({ reflect: true }) fullHeight: boolean = false;\n\n /**\n * Emitted when the `nano-grid` changes breakpoint\n */\n @Event() nanoBpChange: EventEmitter<string[]>;\n\n @Watch('sSize')\n @Watch('mSize')\n @Watch('lSize')\n @Watch('xlSize')\n @Watch('sCols')\n @Watch('mCols')\n @Watch('lCols')\n @Watch('xlCols')\n @Watch('xxlCols')\n propChanged() {\n this.applySizeClasses();\n }\n\n private applySizeClasses() {\n const size = this.currentWidth;\n\n this.isSmall = false;\n this.isMedium = false;\n this.isLarge = false;\n this.isXL = false;\n this.isXXL = false;\n\n this.generalClasses = [];\n this.gridClass = null;\n this.isSizes = [null];\n\n this.isSmall = true;\n this.generalClasses.push('is-small');\n if (this.sCols) this.gridClass = `nano-grid-${this.sCols}`;\n this.isSizes.push({ size: 's', active: true });\n\n if (size > this.sSize) {\n this.isMedium = true;\n this.generalClasses.push('is-medium');\n if (this.mCols) this.gridClass = `nano-grid-${this.mCols}`;\n this.isSizes.push({ size: 'm', active: true });\n }\n\n if (size > this.mSize) {\n this.isLarge = true;\n this.generalClasses.push('is-large');\n if (this.lCols) this.gridClass = `nano-grid-${this.lCols}`;\n this.isSizes.push({ size: 'l', active: true });\n }\n\n if (size > this.lSize) {\n this.isXL = true;\n this.generalClasses.push('is-xl');\n if (this.xlCols) this.gridClass = `nano-grid-${this.xlCols}`;\n this.isSizes.push({ size: 'xl', active: true });\n }\n\n if (size > this.xlSize) {\n this.isXXL = true;\n this.generalClasses.push('is-xxl');\n if (this.xxlCols) this.gridClass = `nano-grid-${this.xxlCols}`;\n this.isSizes.push({ size: 'xxl', active: true });\n }\n\n this.el.style.setProperty(\n '--current-grid-size',\n `'grid size: ${this.isSizes.slice().pop().size}'`\n );\n this.applyChildrenClasses();\n setTimeout(() => (this.ready = true), 0);\n }\n\n @Watch('isSmall')\n @Watch('isMedium')\n @Watch('isLarge')\n @Watch('isXL')\n @Watch('isXXL')\n stateChange() {\n this.nanoBpChange.emit(this.generalClasses);\n }\n\n private applyChildrenClasses() {\n const gridItems = this.el.querySelectorAll('nano-grid-item');\n if (gridItems.length) {\n gridItems.forEach((gridItem: HTMLNanoGridItemElement) => {\n gridItem.changeBP(this.isSizes);\n });\n return;\n }\n\n // this logic has been put into grid-item. Keep here for legacy for now\n let stateArr: Array<string> = [''];\n let itemState: string = '';\n let found: any;\n let classes: Array<string>;\n\n const ctx = this.el;\n\n // item states come in 4 possible flavours at every breakpoint. E.g.\n // xl-col-span-2\n // xl-col-start-2\n // xl-row-span-2\n // xl-row-start-2\n\n // loop through all grid items with states.\n [].map.call(ctx.children, (gItem: HTMLElement) => {\n if (!gItem.hasAttribute('grid-states')) return;\n\n // gridItems.forEach(gItem => {\n\n // clear all previous grid state classnames\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.startsWith('nano-grid-'));\n gItem.className = classes.join(' ').trim();\n\n // get all potential states this element can have\n const itemStates = gItem.getAttribute('grid-states').split(' ');\n\n // loop through all potential state options: col & row span & start\n STATEOPTS.forEach((stateOpt) => {\n // reset found flag\n found = false;\n\n // loop through all the current valid breakpoints / sizes backwards because\n // we only care about the item's state at the largest current breakpoint.\n this.isSizes\n .slice()\n .reverse()\n .forEach(function (size) {\n if (found || !size) return;\n found = itemStates.find(\n (state) => state.indexOf(`${size.size}-${stateOpt}`) === 0\n );\n\n // found a state at this current size. apply class.\n if (found) {\n // clear previous grid state classname\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.includes('nano-grid-${stateOpt}'));\n gItem.className = classes.join(' ').trim();\n\n stateArr = found.split('-');\n\n // remove the size of the state\n stateArr.shift();\n itemState = stateArr.join('-');\n\n // add new class\n gItem.classList.add(`nano-grid-${itemState}`);\n }\n });\n });\n });\n }\n\n componentWillLoad() {\n const ctx = this.el;\n [].map.call(ctx.children, (ele: HTMLElement) =>\n ele.classList.add('nano-griditem')\n );\n }\n\n componentDidLoad() {\n if (!window['ResizeObserver']) return;\n\n this.ro = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!entry.contentRect.width) return;\n this.currentWidth = entry.contentRect.width;\n this.applySizeClasses();\n }\n });\n this.ro.observe(this.el);\n }\n\n disconnectedCallback() {\n if (this.ro) this.ro.disconnect();\n }\n\n render() {\n return (\n <Host\n class={{\n [this.generalClasses.join(' ')]: true,\n 'has-grid': !!this.gridClass,\n ready: this.ready,\n [this.gridClass]: true,\n }}\n >\n <div\n class={{\n grid: true,\n }}\n >\n <slot />\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../src/components/grid/grid.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;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B,EAAE,UAAU,EAAE,CAAC;;oCAwDjD","sourcesContent":["import { Component, h, Prop, Host, State, Watch } from '@stencil/core';\nimport { ConstructibleStyle } from '../../utils/constructible-style';\n\n/**\n * A lightweight, context-aware CSS grid implementation.\n *\n * - Define multiple grids templates at different breakpoints\n * - Uses `@container` queries to select the correct grid depending on the current dimensions\n * - Use `grid-states=\"...\"` on direct descendants for `column` / `row` - `start` / `end`\n * - SSR optimised\n\n * @part grid - the main grid element.\n * Use this to set css such as `justify-items|content` / `align-items|content` / `place-content`\n * @part helper - a replica grid showed when `show-helper` is true\n *\n * @slot - default slot. Use this to place grid items. Use `grid-states=\"...\"` attribute to opt-out of auto / sequential placement.\n */\n@Component({\n tag: 'nano-grid',\n styleUrl: 'grid.scss',\n shadow: true,\n})\nexport class Grid {\n private grids: {\n cols: number;\n breakpoint: number | string;\n name: string;\n template?: string;\n }[] = [];\n @State() cacheKey: string;\n\n /** the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() sSize: number | string = 300;\n\n /** the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() mSize: number | string = 550;\n\n /** the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() lSize: number | string = 800;\n\n /** the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() xlSize: number | string = 1000;\n\n /** the number of columns the grid has at the small breakpoint. */\n @Prop() sCols: number;\n\n /** the number of columns the grid has at the medium breakpoint. */\n @Prop() mCols: number;\n\n /** the number of columns the grid has at the large breakpoint. */\n @Prop() lCols: number;\n\n /** the number of columns the grid has at the xl breakpoint. */\n @Prop() xlCols: number;\n\n /** the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint) */\n @Prop() xxlCols: number;\n\n /** Optional small `grid-template`. *Note* - you must set `sCols` for this to take affect */\n @Prop() sTpl?: string;\n\n /** Optional medium `grid-template`. *Note* - you must set `mCols` for this to take affect */\n @Prop() mTpl?: string;\n\n /** Optional large `grid-template`. *Note* - you must set `lCols` for this to take affect */\n @Prop() lTpl?: string;\n\n /** Optional xl `grid-template`. *Note* - you must set `xlCols` for this to take affect */\n @Prop() xlTpl?: string;\n\n /** Optional xxl `grid-template`. *Note* - you must set `xxlCols` for this to take affect */\n @Prop() xxlTpl?: string;\n\n /** shows a grid helper to visualise where columns are */\n @Prop({ reflect: true }) showHelper: boolean = false;\n\n @Watch('sTpl')\n @Watch('mTpl')\n @Watch('lTpl')\n @Watch('xlTpl')\n @Watch('xxlTpl')\n @Watch('sSize')\n @Watch('mSize')\n @Watch('lSize')\n @Watch('xlSize')\n @Watch('sCols')\n @Watch('mCols')\n @Watch('lCols')\n @Watch('xlCols')\n @Watch('xxlCols')\n @Watch('showHelper')\n constructSizeArray() {\n this.grids = [];\n\n if (this.sCols)\n this.grids.push({\n cols: this.sCols,\n breakpoint: 0,\n name: 's',\n template: this.sTpl,\n });\n if (this.mCols)\n this.grids.push({\n cols: this.mCols,\n breakpoint: this.sSize,\n name: 'm',\n template: this.mTpl,\n });\n if (this.lSize)\n this.grids.push({\n cols: this.lCols,\n breakpoint: this.mSize,\n name: 'l',\n template: this.lTpl,\n });\n if (this.xlCols)\n this.grids.push({\n cols: this.xlCols,\n breakpoint: this.lSize,\n name: 'xl',\n template: this.xlTpl,\n });\n if (this.xxlCols)\n this.grids.push({\n cols: this.xxlCols,\n breakpoint: this.xlSize,\n name: 'xxl',\n template: this.xxlTpl,\n });\n\n this.cacheKey =\n this.grids\n .map((bp) => `${bp.cols}-${bp.breakpoint}-${bp.template || ''}`)\n .join('') +\n '-helper-' +\n this.showHelper;\n }\n\n @ConstructibleStyle({ cacheKeyProperty: 'cacheKey' }) protected styles =\n () => {\n const css = /* css */ `\n ${this.grids\n .map(\n (bp) => /* css */ `\n @container (min-width: ${\n typeof bp.breakpoint === 'number'\n ? bp.breakpoint + 1 + 'px'\n : bp.breakpoint\n }) {\n .grid {\n --current-grid-size: \"grid size: ${bp.name}\";\n ${\n bp.template\n ? `grid-template: ${bp.template};`\n : `grid-template-columns: repeat(${bp.cols}, 1fr);`\n }\n }\n ${[...Array(bp.cols)]\n .map((_, i) => {\n const gItm = i + 1;\n return /* css */ `\n .grid > [grid-states~=\"${bp.name}-col-start-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-col-start-${gItm}\"]) {\n grid-column-start: ${gItm} !important;\n }\n .grid > [grid-states~=\"${bp.name}-row-start-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-row-start-${gItm}\"]) {\n grid-row-start: ${gItm} !important;\n }\n .grid > [grid-states~=\"${bp.name}-col-span-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-col-span-${gItm}\"]) {\n grid-column-end: span ${gItm} !important;\n }\n .grid > [grid-states~=\"${bp.name}-row-span-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-row-span-${gItm}\"]) {\n grid-row-end: span ${gItm} !important;\n }\n `;\n })\n .join('')}\n ${\n this.showHelper &&\n /* css */ `\n .grid--helper :nth-child(-n+${bp.cols}) {\n display: block !important;\n }\n `\n }\n }\n `\n )\n .join('')}\n `;\n return css;\n };\n\n componentWillLoad() {\n this.constructSizeArray();\n }\n\n render() {\n return (\n <Host>\n <div part=\"grid\" class=\"grid\">\n <slot />\n </div>\n {this.showHelper && (\n <div class=\"grid grid--helper\" part=\"helper\">\n {[...Array(24)].map(() => (\n <div class=\"grid__helper-item\" />\n ))}\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
|
@@ -25,7 +25,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
25
25
|
* @prop --scrim-opacity-to: Final opactiy of the gradient covering the background. Default depends on `theme`;
|
26
26
|
* @prop --quote-size: Font size of the quote. Defaults to 1.3em and grows to 3rem on the xl breakpoint;
|
27
27
|
*/
|
28
|
-
display: block;
|
29
28
|
--nano-loader-base: #4a4a4a;
|
30
29
|
--nano-loader-tint: #7d7d7d;
|
31
30
|
--theme-color: #fff;
|
@@ -37,10 +36,8 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
37
36
|
--padding: 0;
|
38
37
|
--quote-size: 1.3rem;
|
39
38
|
color: var(--theme-color);
|
40
|
-
|
41
|
-
|
42
|
-
:host(.is-xl) {
|
43
|
-
--quote-size: 3rem;
|
39
|
+
display: block;
|
40
|
+
container-type: inline-size;
|
44
41
|
}
|
45
42
|
|
46
43
|
:host([theme=light]) {
|
@@ -60,6 +57,11 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
60
57
|
.hero {
|
61
58
|
position: relative;
|
62
59
|
}
|
60
|
+
@container (min-width: 800px) {
|
61
|
+
.hero {
|
62
|
+
--quote-size: 3rem;
|
63
|
+
}
|
64
|
+
}
|
63
65
|
.hero--rtl {
|
64
66
|
--scrim-direction: 270deg;
|
65
67
|
}
|
@@ -103,7 +105,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
103
105
|
}
|
104
106
|
.hero__img {
|
105
107
|
display: block;
|
106
|
-
container-type: inline-size;
|
107
108
|
--padding: inherit;
|
108
109
|
}
|
109
110
|
.hero__breadcrumbs {
|
@@ -115,11 +116,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
115
116
|
.hero--breadcrumb .hero__breadcrumbs {
|
116
117
|
display: block;
|
117
118
|
}
|
118
|
-
.is-xl .hero__breadcrumbs {
|
119
|
-
margin-block: 0;
|
120
|
-
margin-inline: 50px;
|
121
|
-
max-inline-size: 50%;
|
122
|
-
}
|
123
119
|
@container (min-width: 800px) {
|
124
120
|
.hero__breadcrumbs {
|
125
121
|
margin-block: 0;
|
@@ -127,10 +123,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
127
123
|
max-inline-size: 50%;
|
128
124
|
}
|
129
125
|
}
|
130
|
-
.is-xxl .hero__breadcrumbs {
|
131
|
-
margin-block: 0;
|
132
|
-
margin-inline: 83px;
|
133
|
-
}
|
134
126
|
@container (min-width: 900px) {
|
135
127
|
.hero__breadcrumbs {
|
136
128
|
margin-block: 0;
|
@@ -180,22 +172,12 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
180
172
|
margin-inline: auto;
|
181
173
|
position: relative;
|
182
174
|
}
|
183
|
-
.hero__content.is-xl {
|
184
|
-
-webkit-margin-before: 50px;
|
185
|
-
margin-block-start: 50px;
|
186
|
-
max-inline-size: 1540px;
|
187
|
-
}
|
188
175
|
@container (min-width: 800px) {
|
189
176
|
.hero__content {
|
190
177
|
margin-block: 50px 0 !important;
|
191
178
|
max-inline-size: 1540px !important;
|
192
179
|
}
|
193
180
|
}
|
194
|
-
.hero__content.is-xxl {
|
195
|
-
-webkit-margin-before: 83px;
|
196
|
-
margin-block-start: 83px;
|
197
|
-
max-inline-size: 1606px;
|
198
|
-
}
|
199
181
|
@container (min-width: 900px) {
|
200
182
|
.hero__content {
|
201
183
|
margin-block: 83px 0 !important;
|
@@ -216,14 +198,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
216
198
|
.hero__primary ::slotted(nano-icon-button[slot=back-btn]) {
|
217
199
|
font-size: 2rem;
|
218
200
|
}
|
219
|
-
.is-xl .hero__primary {
|
220
|
-
margin-block: 0 50px;
|
221
|
-
margin-inline: 50px 0;
|
222
|
-
}
|
223
|
-
.is-xl .hero__primary ::slotted(nano-icon-button[slot=back-btn]) {
|
224
|
-
margin-block: 0;
|
225
|
-
margin-inline: -3rem 0;
|
226
|
-
}
|
227
201
|
@container (min-width: 800px) {
|
228
202
|
.hero__primary {
|
229
203
|
margin-block: 0 50px !important;
|
@@ -234,10 +208,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
234
208
|
margin-inline: -3rem 0 !important;
|
235
209
|
}
|
236
210
|
}
|
237
|
-
.is-xxl .hero__primary {
|
238
|
-
margin-block: 0 83px !important;
|
239
|
-
margin-inline: 83px 0 !important;
|
240
|
-
}
|
241
211
|
@container (min-width: 900px) {
|
242
212
|
.hero__primary {
|
243
213
|
margin-block: 0 83px !important;
|
@@ -258,15 +228,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
258
228
|
margin-block: 0 18px !important;
|
259
229
|
font-size: 2rem !important;
|
260
230
|
}
|
261
|
-
.is-xl .hero__primary-content ::slotted(h1[slot=primary-content]) {
|
262
|
-
line-height: 31px !important;
|
263
|
-
-webkit-margin-after: 30px !important;
|
264
|
-
margin-block-end: 30px !important;
|
265
|
-
}
|
266
|
-
.is-xl .hero__primary-content ::slotted(.button[slot=primary-content]) {
|
267
|
-
-webkit-margin-before: 20px !important;
|
268
|
-
margin-block-start: 20px !important;
|
269
|
-
}
|
270
231
|
@container (min-width: 800px) {
|
271
232
|
.hero__primary-content ::slotted(h1[slot=primary-content]) {
|
272
233
|
line-height: 31px !important;
|
@@ -288,11 +249,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
288
249
|
display: flex;
|
289
250
|
align-items: center;
|
290
251
|
}
|
291
|
-
.is-xl .hero__secondary {
|
292
|
-
padding-block: 0 50px;
|
293
|
-
padding-inline: 50px;
|
294
|
-
justify-content: flex-end;
|
295
|
-
}
|
296
252
|
@container (min-width: 800px) {
|
297
253
|
.hero__secondary {
|
298
254
|
padding-block: 0 50px;
|
@@ -300,10 +256,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
300
256
|
justify-content: flex-end;
|
301
257
|
}
|
302
258
|
}
|
303
|
-
.is-xxl .hero__secondary {
|
304
|
-
padding-block: 0 83px;
|
305
|
-
padding-inline: 83px;
|
306
|
-
}
|
307
259
|
@container (min-width: 900px) {
|
308
260
|
.hero__secondary {
|
309
261
|
padding-block: 0 83px;
|
@@ -320,9 +272,11 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
320
272
|
flex-direction: column;
|
321
273
|
color: white;
|
322
274
|
}
|
323
|
-
|
324
|
-
|
325
|
-
|
275
|
+
@container (min-width: 800px) {
|
276
|
+
.hero__icon-box {
|
277
|
+
max-inline-size: 410px;
|
278
|
+
flex: 0 1 410px;
|
279
|
+
}
|
326
280
|
}
|
327
281
|
.hero__icon-box ::slotted([slot=icon-box-item]) {
|
328
282
|
--nano-color-base: var(--theme-tint-color);
|
@@ -344,11 +298,6 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
344
298
|
text-align: center;
|
345
299
|
inline-size: 100%;
|
346
300
|
}
|
347
|
-
.is-xl .hero__quote-content {
|
348
|
-
max-inline-size: 500px;
|
349
|
-
flex: 0 1 500px;
|
350
|
-
text-align: initial;
|
351
|
-
}
|
352
301
|
@container (min-width: 800px) {
|
353
302
|
.hero__quote-content {
|
354
303
|
max-inline-size: 500px;
|
@@ -377,31 +326,35 @@ TODO - as soon as container queries hits everywhere, strip out reliance on nano-
|
|
377
326
|
font-size: 1rem;
|
378
327
|
opacity: 0.8;
|
379
328
|
}
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
margin-block: 0 40px;
|
402
|
-
margin-inline: 83px 0;
|
329
|
+
@container (min-width: 800px) {
|
330
|
+
.hero--sub .hero__content {
|
331
|
+
-webkit-margin-before: 40px;
|
332
|
+
margin-block-start: 40px;
|
333
|
+
}
|
334
|
+
.hero--sub .hero__content .hero__primary {
|
335
|
+
margin-block: 0 40px;
|
336
|
+
margin-inline: 50px 0;
|
337
|
+
}
|
338
|
+
.hero--sub .hero__content .hero__secondary {
|
339
|
+
padding-block: 0 50px;
|
340
|
+
padding-inline: 40px 50px;
|
341
|
+
}
|
342
|
+
.hero--sub .hero__content ::slotted(.button[slot=primary-content]) {
|
343
|
+
-webkit-margin-before: 8px !important;
|
344
|
+
margin-block-start: 8px !important;
|
345
|
+
}
|
346
|
+
.hero--sub .hero__content ::slotted(h1[slot=primary-content]) {
|
347
|
+
-webkit-margin-after: 18px !important;
|
348
|
+
margin-block-end: 18px !important;
|
349
|
+
}
|
403
350
|
}
|
404
|
-
|
405
|
-
|
406
|
-
|
351
|
+
@container (min-width: 900px) {
|
352
|
+
.hero--sub .hero__content .hero__primary {
|
353
|
+
margin-block: 0 40px;
|
354
|
+
margin-inline: 83px 0;
|
355
|
+
}
|
356
|
+
.hero--sub .hero__content .hero__secondary {
|
357
|
+
padding-block: 0 83px;
|
358
|
+
padding-inline: 40px 83px;
|
359
|
+
}
|
407
360
|
}
|
@@ -18,19 +18,15 @@ import { h, Host, } from '@stencil/core';
|
|
18
18
|
*/
|
19
19
|
export class Hero {
|
20
20
|
constructor() {
|
21
|
-
this.handleGridChange = (e) => {
|
22
|
-
this.gridSizes = e.detail;
|
23
|
-
};
|
24
21
|
this.HeroContent = () => {
|
25
22
|
return [
|
26
23
|
!this.hasIconBox && this.hasCtas ? (h("div", { class: "hero__ctas" }, h("slot", { name: "secondary-ctas" }))) : (''),
|
27
24
|
h("div", { class: "hero__scrim" }, h("slot", { name: "scrim" })),
|
28
|
-
h("nano-grid", {
|
25
|
+
h("nano-grid", { class: "hero__content", xlCols: 2, xlSize: this.largeScreenBP }, h("div", { "grid-states": "xl-col-span-2" }, h("div", { class: "hero__breadcrumbs" }, h("slot", { name: "breadcrumb" }))), h("div", { "grid-states": this.hasSecondaryContent
|
29
26
|
? 'xl-col-span-1 xl-col-start-1 xl-row-start-2'
|
30
|
-
: 'xl-col-span-2 xl-col-start-1 xl-row-start-2' }, h("div", { class: "hero__primary" }, h("div", { class: "hero__primary-content" }, h("slot", { name: "back-btn" }), h("div", null, h("slot", { name: "primary-content" }))))), this.hasSecondaryContent && (h("
|
27
|
+
: 'xl-col-span-2 xl-col-start-1 xl-row-start-2' }, h("div", { class: "hero__primary" }, h("div", { class: "hero__primary-content" }, h("slot", { name: "back-btn" }), h("div", null, h("slot", { name: "primary-content" }))))), this.hasSecondaryContent && (h("div", { "grid-states": "xl-col-span-1 xl-col-start-2 xl-row-start-2" }, h("div", { class: "hero__secondary" }, h("slot", { name: "secondary-content" }), this.hasIconBox && (h("div", { class: "hero__icon-box" }, h("slot", { name: "icon-box" }), h("slot", { name: "icon-box-item" }))), this.hasQuote && (h("div", { class: "hero__quote-content" }, h("span", { class: "hero__quote" }, h("slot", { name: "quote" })), h("div", { class: "hero__quote-author" }, h("slot", { name: "quote-author" })))))))),
|
31
28
|
];
|
32
29
|
};
|
33
|
-
this.gridSizes = [];
|
34
30
|
this.hasIconBox = undefined;
|
35
31
|
this.hasScrim = undefined;
|
36
32
|
this.hasSecondaryContent = undefined;
|
@@ -102,9 +98,7 @@ export class Hero {
|
|
102
98
|
render() {
|
103
99
|
const rtl = this.host.dir === 'rtl' ||
|
104
100
|
this.host.ownerDocument.dir === 'rtl';
|
105
|
-
return (h(Host, { class: {
|
106
|
-
[this.gridSizes.join(' ')]: true,
|
107
|
-
} }, h("div", { class: {
|
101
|
+
return (h(Host, null, h("div", { class: {
|
108
102
|
hero: true,
|
109
103
|
'hero--light': this.theme === 'light',
|
110
104
|
'hero--secondary': this.hasSecondaryContent,
|
@@ -146,7 +140,7 @@ export class Hero {
|
|
146
140
|
"optional": true,
|
147
141
|
"docs": {
|
148
142
|
"tags": [],
|
149
|
-
"text": "src for
|
143
|
+
"text": "src for background image. For more control use the `background` slot instead."
|
150
144
|
},
|
151
145
|
"getter": false,
|
152
146
|
"setter": false,
|
@@ -237,7 +231,6 @@ export class Hero {
|
|
237
231
|
}
|
238
232
|
static get states() {
|
239
233
|
return {
|
240
|
-
"gridSizes": {},
|
241
234
|
"hasIconBox": {},
|
242
235
|
"hasScrim": {},
|
243
236
|
"hasSecondaryContent": {},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":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,mBAAmB;UAC3C,eAAe,EAAE,IAAI,CAAC,UAAU;UAChC,WAAW,EAAE,GAAG;UAChB,aAAa,EAAE,IAAI,CAAC,QAAQ;UAC5B,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM;UAC7C,aAAa,EAAE,IAAI,CAAC,KAAK;UACzB,eAAe,EAAE,IAAI,CAAC,UAAU;UAChC,WAAW,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK;SAClC;QAED,WAAK,KAAK,EAAC,eAAe;UACvB,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAChB,gBACE,KAAK,EAAC,WAAW,EACjB,IAAI,EAAE,KAAK,EACX,UAAU,QACV,MAAM,EAAE,IAAI,CAAC,SAAS,EACtB,GAAG,EAAE,IAAI,CAAC,MAAM;YAEhB,EAAC,IAAI,CAAC,WAAW,OAAG,CACX,CACZ;UACA,CAAC,IAAI,CAAC,MAAM,IAAI;YACf,WAAK,KAAK,EAAC,eAAe;cACxB,YAAM,IAAI,EAAC,YAAY,GAAG,CACtB;YACN,EAAC,IAAI,CAAC,WAAW,OAAG;WACrB,CACG,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n h,\n ComponentInterface,\n VNode,\n State,\n Element,\n Watch,\n Host,\n} from '@stencil/core';\n/**\n * Hero components are designed to be used once per content page to add visual impact to the introductory section of a page.\n * @slot primary-content - title, leading paragraph and CTA\n * @slot breadcrumb - each individual bread crumb should be assigned seperately\n * @slot secondary-content - free form secondary content.\n * @slot icon-box - free form icon box container\n * @slot icon-box-item - seperate icon box items. Designed to contain 1 icon and 1 text element.\n * @slot secondary-ctas - CTAs. each individual button should be assigned seperately\n * @slot quote - quote content\n * @slot quote-author - quote author\n * @slot scrim - optional background overlay (e.g. faded colour or gradient)\n * @slot background - custom background. Only active when img-src is empty\n * @slot back-btn - a back button.\n */\n@Component({\n tag: 'nano-hero',\n styleUrl: 'hero.scss',\n shadow: true,\n})\nexport class Hero implements ComponentInterface {\n private mo?: MutationObserver;\n\n @Element() host: HTMLNanoHeroElement;\n\n @State() gridSizes: string[] = [];\n @State() hasIconBox: boolean;\n @State() hasScrim: boolean;\n @State() hasSecondaryContent: boolean;\n @State() hasQuote: boolean;\n @State() hasBg: boolean;\n @State() hasBackBtn: boolean;\n @State() hasCtas: boolean;\n @State() breadCrumbs: Element[];\n @Watch('breadCrumbs')\n breadCrumbChange() {\n // safari doesn't support ::slotted()::after ... so this :/\n this.breadCrumbs\n .filter(\n (crumb) =>\n crumb.tagName === 'A' &&\n !crumb.nextElementSibling.classList.contains('slash')\n )\n .forEach((crumb) => {\n crumb.insertAdjacentHTML(\n 'afterend',\n '<span slot=\"breadcrumb\" class=\"slash\">/</span>'\n );\n });\n }\n @State() iconBoxItems: Element[];\n @Watch('iconBoxItems')\n iconBoxItemChange() {\n this.iconBoxItems.forEach((item) => item.classList.remove('last'));\n if (\n this.iconBoxItems[this.iconBoxItems.length - 1] &&\n this.iconBoxItems[this.iconBoxItems.length - 1].classList\n )\n this.iconBoxItems[this.iconBoxItems.length - 1].classList.add('last');\n }\n\n /** src for backgronund image. For more control use the `background` slot instead. */\n @Prop() imgSrc?: string;\n\n /** Optional list string providing media sizes with corresponding image srcs.\n * i.e. show img-x at 300px wide. Format `srcSet=\"200w src/imgSmall.jpg, 500h src/imgMed.png\"` */\n @Prop() imgSrcSet?: string = null;\n\n /** The Break Point width that the hero component will change to the large view. Defaults to the XL grid size (900px) */\n @Prop() largeScreenBP: number = 900;\n\n /** Base style for the hero. Either 'light' (white bg / dark text), or 'dark' (dark bg / white text) */\n @Prop() theme: 'dark' | 'light' = 'dark';\n\n /** Set the content structure level of the hero. Defaults to 'top' */\n @Prop() level: 'top' | 'sub' = 'top';\n\n private slotChangeObserver() {\n if (!window['MutationObserver']) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.host, { childList: true });\n }\n\n // Event handlers\n\n private processSlottedContent() {\n this.hasCtas = !!this.host.querySelector('[slot=\"secondary-ctas\"]');\n this.iconBoxItems = Array.from(\n this.host.querySelectorAll('[slot=\"icon-box-item\"]')\n );\n this.hasIconBox =\n !!this.host.querySelector('[slot=\"icon-box\"]') ||\n !!this.iconBoxItems.length;\n this.hasScrim = !!this.host.querySelector('[slot=\"scrim\"]');\n this.breadCrumbs = Array.from(\n this.host.querySelectorAll('[slot=\"breadcrumb\"]')\n );\n this.hasSecondaryContent =\n !!this.host.querySelector('[slot=\"icon-box\"]') ||\n !!this.host.querySelector('[slot=\"quote\"]') ||\n !!this.host.querySelector('[slot=\"icon-box-item\"]') ||\n !!this.host.querySelector('[slot=\"secondary-content\"]');\n this.hasBg =\n !!this.host.querySelector('[slot=\"background\"]') || !!this.imgSrc;\n this.hasBackBtn = !!this.host.querySelector('[slot=\"back-btn\"]');\n this.hasQuote = !!this.host.querySelector('[slot=\"quote\"]');\n }\n\n private handleGridChange = (e: CustomEvent & { detail: string[] }) => {\n this.gridSizes = e.detail;\n };\n\n // Component lifecycle\n\n disconnectedCallback() {\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n private HeroContent = (): VNode[] => {\n return [\n !this.hasIconBox && this.hasCtas ? (\n <div class=\"hero__ctas\">\n <slot name=\"secondary-ctas\" />\n </div>\n ) : (\n ''\n ),\n <div class=\"hero__scrim\">\n <slot name=\"scrim\" />\n </div>,\n <nano-grid\n onNanoBpChange={this.handleGridChange}\n class=\"hero__content\"\n xlCols={2}\n xlSize={this.largeScreenBP}\n >\n <nano-grid-item gridStates=\"xl-col-span-2\">\n <div class=\"hero__breadcrumbs\">\n <slot name=\"breadcrumb\" />\n </div>\n </nano-grid-item>\n <nano-grid-item\n gridStates={\n this.hasSecondaryContent\n ? 'xl-col-span-1 xl-col-start-1 xl-row-start-2'\n : 'xl-col-span-2 xl-col-start-1 xl-row-start-2'\n }\n >\n <div class=\"hero__primary\">\n <div class=\"hero__primary-content\">\n <slot name=\"back-btn\" />\n <div>\n <slot name=\"primary-content\" />\n </div>\n </div>\n </div>\n </nano-grid-item>\n {this.hasSecondaryContent && (\n <nano-grid-item gridStates=\"xl-col-span-1 xl-col-start-2 xl-row-start-2\">\n <div class=\"hero__secondary\">\n <slot name=\"secondary-content\" />\n {this.hasIconBox && (\n <div class=\"hero__icon-box\">\n <slot name=\"icon-box\" />\n <slot name=\"icon-box-item\" />\n </div>\n )}\n {this.hasQuote && (\n <div class=\"hero__quote-content\">\n <span class=\"hero__quote\">\n <slot name=\"quote\" />\n </span>\n <div class=\"hero__quote-author\">\n <slot name=\"quote-author\" />\n </div>\n </div>\n )}\n </div>\n </nano-grid-item>\n )}\n </nano-grid>,\n ];\n };\n\n render() {\n const rtl =\n this.host.dir === 'rtl' ||\n (this.host.ownerDocument as Document).dir === 'rtl';\n\n return (\n <Host\n class={{\n [this.gridSizes.join(' ')]: true,\n }}\n >\n <div\n class={{\n hero: true,\n 'hero--light': this.theme === 'light',\n 'hero--secondary': this.hasSecondaryContent,\n 'hero--iconbox': this.hasIconBox,\n 'hero--rtl': rtl,\n 'hero--scrim': this.hasScrim,\n 'hero--breadcrumb': !!this.breadCrumbs.length,\n 'hero--hasbg': this.hasBg,\n 'hero--backbtn': this.hasBackBtn,\n 'hero--sub': this.level === 'sub',\n }}\n >\n <div class=\"hero__bg-wrap\">\n {!!this.imgSrc && (\n <nano-img\n class=\"hero__img\"\n lazy={false}\n background\n srcSet={this.imgSrcSet}\n src={this.imgSrc}\n >\n <this.HeroContent />\n </nano-img>\n )}\n {!this.imgSrc && [\n <div class=\"hero__bg-slot\">\n <slot name=\"background\" />\n </div>,\n <this.HeroContent />,\n ]}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"hero.js","sourceRoot":"","sources":["../../../src/components/hero/hero.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EAGD,KAAK,EACL,OAAO,EACP,KAAK,EACL,IAAI,GACL,MAAM,eAAe,CAAC;AACvB;;;;;;;;;;;;;GAaG;AAMH,MAAM,OAAO,IAAI;;IAyGP,gBAAW,GAAG,GAAY,EAAE;MAClC,OAAO;QACL,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACjC,WAAK,KAAK,EAAC,YAAY;UACrB,YAAM,IAAI,EAAC,gBAAgB,GAAG,CAC1B,CACP,CAAC,CAAC,CAAC,CACF,EAAE,CACH;QACD,WAAK,KAAK,EAAC,aAAa;UACtB,YAAM,IAAI,EAAC,OAAO,GAAG,CACjB;QACN,iBAAW,KAAK,EAAC,eAAe,EAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa;UACpE,0BAAiB,eAAe;YAC9B,WAAK,KAAK,EAAC,mBAAmB;cAC5B,YAAM,IAAI,EAAC,YAAY,GAAG,CACtB,CACF;UACN,0BAEI,IAAI,CAAC,mBAAmB;cACtB,CAAC,CAAC,6CAA6C;cAC/C,CAAC,CAAC,6CAA6C;YAGnD,WAAK,KAAK,EAAC,eAAe;cACxB,WAAK,KAAK,EAAC,uBAAuB;gBAChC,YAAM,IAAI,EAAC,UAAU,GAAG;gBACxB;kBACE,YAAM,IAAI,EAAC,iBAAiB,GAAG,CAC3B,CACF,CACF,CACF;UACL,IAAI,CAAC,mBAAmB,IAAI,CAC3B,0BAAiB,6CAA6C;YAC5D,WAAK,KAAK,EAAC,iBAAiB;cAC1B,YAAM,IAAI,EAAC,mBAAmB,GAAG;cAChC,IAAI,CAAC,UAAU,IAAI,CAClB,WAAK,KA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,IAAI,CAAC,UAAU;UAChC,WAAW,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK;SAClC;QAED,WAAK,KAAK,EAAC,eAAe;UACvB,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAChB,gBACE,KAAK,EAAC,WAAW,EACjB,IAAI,EAAE,KAAK,EACX,UAAU,QACV,MAAM,EAAE,IAAI,CAAC,SAAS,EACtB,GAAG,EAAE,IAAI,CAAC,MAAM;YAEhB,EAAC,IAAI,CAAC,WAAW,OAAG,CACX,CACZ;UACA,CAAC,IAAI,CAAC,MAAM,IAAI;YACf,WAAK,KAAK,EAAC,eAAe;cACxB,YAAM,IAAI,EAAC,YAAY,GAAG,CACtB;YACN,EAAC,IAAI,CAAC,WAAW,OAAG;WACrB,CACG,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n h,\n ComponentInterface,\n VNode,\n State,\n Element,\n Watch,\n Host,\n} from '@stencil/core';\n/**\n * Hero components are designed to be used once per content page to add visual impact to the introductory section of a page.\n * @slot primary-content - title, leading paragraph and CTA\n * @slot breadcrumb - each individual bread crumb should be assigned seperately\n * @slot secondary-content - free form secondary content.\n * @slot icon-box - free form icon box container\n * @slot icon-box-item - seperate icon box items. Designed to contain 1 icon and 1 text element.\n * @slot secondary-ctas - CTAs. each individual button should be assigned seperately\n * @slot quote - quote content\n * @slot quote-author - quote author\n * @slot scrim - optional background overlay (e.g. faded colour or gradient)\n * @slot background - custom background. Only active when img-src is empty\n * @slot back-btn - a back button.\n */\n@Component({\n tag: 'nano-hero',\n styleUrl: 'hero.scss',\n shadow: true,\n})\nexport class Hero implements ComponentInterface {\n private mo?: MutationObserver;\n\n @Element() host: HTMLNanoHeroElement;\n\n @State() hasIconBox: boolean;\n @State() hasScrim: boolean;\n @State() hasSecondaryContent: boolean;\n @State() hasQuote: boolean;\n @State() hasBg: boolean;\n @State() hasBackBtn: boolean;\n @State() hasCtas: boolean;\n @State() breadCrumbs: Element[];\n @Watch('breadCrumbs')\n breadCrumbChange() {\n // safari doesn't support ::slotted()::after ... so this :/\n this.breadCrumbs\n .filter(\n (crumb) =>\n crumb.tagName === 'A' &&\n !crumb.nextElementSibling.classList.contains('slash')\n )\n .forEach((crumb) => {\n crumb.insertAdjacentHTML(\n 'afterend',\n '<span slot=\"breadcrumb\" class=\"slash\">/</span>'\n );\n });\n }\n @State() iconBoxItems: Element[];\n @Watch('iconBoxItems')\n iconBoxItemChange() {\n this.iconBoxItems.forEach((item) => item.classList.remove('last'));\n if (\n this.iconBoxItems[this.iconBoxItems.length - 1] &&\n this.iconBoxItems[this.iconBoxItems.length - 1].classList\n )\n this.iconBoxItems[this.iconBoxItems.length - 1].classList.add('last');\n }\n\n /** src for background image. For more control use the `background` slot instead. */\n @Prop() imgSrc?: string;\n\n /** Optional list string providing media sizes with corresponding image srcs.\n * i.e. show img-x at 300px wide. Format `srcSet=\"200w src/imgSmall.jpg, 500h src/imgMed.png\"` */\n @Prop() imgSrcSet?: string = null;\n\n /** The Break Point width that the hero component will change to the large view. Defaults to the XL grid size (900px) */\n @Prop() largeScreenBP: number = 900;\n\n /** Base style for the hero. Either 'light' (white bg / dark text), or 'dark' (dark bg / white text) */\n @Prop() theme: 'dark' | 'light' = 'dark';\n\n /** Set the content structure level of the hero. Defaults to 'top' */\n @Prop() level: 'top' | 'sub' = 'top';\n\n private slotChangeObserver() {\n if (!window['MutationObserver']) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.host, { childList: true });\n }\n\n // Event handlers\n\n private processSlottedContent() {\n this.hasCtas = !!this.host.querySelector('[slot=\"secondary-ctas\"]');\n this.iconBoxItems = Array.from(\n this.host.querySelectorAll('[slot=\"icon-box-item\"]')\n );\n this.hasIconBox =\n !!this.host.querySelector('[slot=\"icon-box\"]') ||\n !!this.iconBoxItems.length;\n this.hasScrim = !!this.host.querySelector('[slot=\"scrim\"]');\n this.breadCrumbs = Array.from(\n this.host.querySelectorAll('[slot=\"breadcrumb\"]')\n );\n this.hasSecondaryContent =\n !!this.host.querySelector('[slot=\"icon-box\"]') ||\n !!this.host.querySelector('[slot=\"quote\"]') ||\n !!this.host.querySelector('[slot=\"icon-box-item\"]') ||\n !!this.host.querySelector('[slot=\"secondary-content\"]');\n this.hasBg =\n !!this.host.querySelector('[slot=\"background\"]') || !!this.imgSrc;\n this.hasBackBtn = !!this.host.querySelector('[slot=\"back-btn\"]');\n this.hasQuote = !!this.host.querySelector('[slot=\"quote\"]');\n }\n\n // Component lifecycle\n\n disconnectedCallback() {\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n private HeroContent = (): VNode[] => {\n return [\n !this.hasIconBox && this.hasCtas ? (\n <div class=\"hero__ctas\">\n <slot name=\"secondary-ctas\" />\n </div>\n ) : (\n ''\n ),\n <div class=\"hero__scrim\">\n <slot name=\"scrim\" />\n </div>,\n <nano-grid class=\"hero__content\" xlCols={2} xlSize={this.largeScreenBP}>\n <div grid-states=\"xl-col-span-2\">\n <div class=\"hero__breadcrumbs\">\n <slot name=\"breadcrumb\" />\n </div>\n </div>\n <div\n grid-states={\n this.hasSecondaryContent\n ? 'xl-col-span-1 xl-col-start-1 xl-row-start-2'\n : 'xl-col-span-2 xl-col-start-1 xl-row-start-2'\n }\n >\n <div class=\"hero__primary\">\n <div class=\"hero__primary-content\">\n <slot name=\"back-btn\" />\n <div>\n <slot name=\"primary-content\" />\n </div>\n </div>\n </div>\n </div>\n {this.hasSecondaryContent && (\n <div grid-states=\"xl-col-span-1 xl-col-start-2 xl-row-start-2\">\n <div class=\"hero__secondary\">\n <slot name=\"secondary-content\" />\n {this.hasIconBox && (\n <div class=\"hero__icon-box\">\n <slot name=\"icon-box\" />\n <slot name=\"icon-box-item\" />\n </div>\n )}\n {this.hasQuote && (\n <div class=\"hero__quote-content\">\n <span class=\"hero__quote\">\n <slot name=\"quote\" />\n </span>\n <div class=\"hero__quote-author\">\n <slot name=\"quote-author\" />\n </div>\n </div>\n )}\n </div>\n </div>\n )}\n </nano-grid>,\n ];\n };\n\n render() {\n const rtl =\n this.host.dir === 'rtl' ||\n (this.host.ownerDocument as Document).dir === 'rtl';\n\n return (\n <Host>\n <div\n class={{\n hero: true,\n 'hero--light': this.theme === 'light',\n 'hero--secondary': this.hasSecondaryContent,\n 'hero--iconbox': this.hasIconBox,\n 'hero--rtl': rtl,\n 'hero--scrim': this.hasScrim,\n 'hero--breadcrumb': !!this.breadCrumbs.length,\n 'hero--hasbg': this.hasBg,\n 'hero--backbtn': this.hasBackBtn,\n 'hero--sub': this.level === 'sub',\n }}\n >\n <div class=\"hero__bg-wrap\">\n {!!this.imgSrc && (\n <nano-img\n class=\"hero__img\"\n lazy={false}\n background\n srcSet={this.imgSrcSet}\n src={this.imgSrc}\n >\n <this.HeroContent />\n </nano-img>\n )}\n {!this.imgSrc && [\n <div class=\"hero__bg-slot\">\n <slot name=\"background\" />\n </div>,\n <this.HeroContent />,\n ]}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -58,6 +58,18 @@
|
|
58
58
|
outline: none;
|
59
59
|
}
|
60
60
|
|
61
|
+
.icon-button__label {
|
62
|
+
clip: rect(1px, 1px, 1px, 1px);
|
63
|
+
-webkit-clip-path: inset(50%);
|
64
|
+
clip-path: inset(50%);
|
65
|
+
block-size: 1px;
|
66
|
+
inline-size: 1px;
|
67
|
+
margin: -1px;
|
68
|
+
overflow: hidden;
|
69
|
+
padding: 0;
|
70
|
+
position: absolute;
|
71
|
+
}
|
72
|
+
|
61
73
|
.icon-button--disabled {
|
62
74
|
opacity: 0.5;
|
63
75
|
cursor: not-allowed;
|
@@ -76,7 +76,7 @@ export class IconButton {
|
|
76
76
|
return (h(Host, { "aria-disabled": this.disabled ? 'true' : null }, h(TagType, { onClick: this.handleClick, part: "base", ref: (el) => (this.button = el), class: {
|
77
77
|
'icon-button': true,
|
78
78
|
'icon-button--disabled': this.disabled,
|
79
|
-
},
|
79
|
+
}, name: this.name, value: this.value, href: this.href || undefined, target: this.href && this.target ? this.target : undefined, rel: this.rel || undefined, type: !this.href && this.type ? this.type : undefined }, h("span", { class: "icon-button__label" }, this.label), h("nano-icon", { name: this.iconName, src: this.iconSrc, "aria-hidden": "true", lazy: false, part: "icon" }))));
|
80
80
|
}
|
81
81
|
render() {
|
82
82
|
if (this.showTooltip) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../../src/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EAED,MAAM,EACN,OAAO,EACP,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;GAIG;AAMH,MAAM,OAAO,UAAU;;IAyEb,gBAAW,GAAG,CAAC,EAAS,EAAE,EAAE;MAClC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO;MACnC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;MAE/B,IAAI,MAAM,EAAE;QACV,EAAE,CAAC,cAAc,EAAE,CAAC;QAEpB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACpD,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC5B,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QAClC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC/B,UAAU,CAAC,KAAK,EAAE,CAAC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B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,SAAS,EAC5B,MAAM,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC1D,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,SAAS,EAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAErD,YAAM,KAAK,EAAC,oBAAoB,IAAE,IAAI,CAAC,KAAK,CAAQ;QACpD,iBACE,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,GAAG,EAAE,IAAI,CAAC,OAAO,iBACL,MAAM,EAClB,IAAI,EAAE,KAAK,EACX,IAAI,EAAC,MAAM,GACX,CACM,CACL,CACR,CAAC;EACJ,CAAC;EAED,MAAM;IACJ,IAAI,IAAI,CAAC,WAAW,EAAE;MACpB,OAAO,oBAAc,OAAO,EAAE,IAAI,CAAC,KAAK,IAAG,IAAI,CAAC,OAAO,EAAE,CAAgB,CAAC;KAC3E;IACD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;EACxB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Method,\n Element,\n Host,\n} from '@stencil/core';\nimport { focusVisible } from '../../utils/focus-visible';\n\n/** Icons buttons are simple, icon-only buttons that can be used for actions and in toolbars.\n *\n * @part base - the main control (either `<a />` or `<button />`)\n * @part icon - a `<nano-icon />` component\n */\n@Component({\n tag: 'nano-icon-button',\n styleUrl: 'icon-button.scss',\n shadow: true,\n})\nexport class IconButton implements ComponentInterface {\n private button: HTMLButtonElement;\n\n @Element() host: HTMLNanoIconButtonElement;\n\n /** The name of the icon to draw. */\n @Prop() iconName?: string;\n\n /** An external URL of an SVG file. */\n @Prop() iconSrc?: string;\n\n /** The default behavior of the button. */\n @Prop({ reflect: true }) type: 'submit' | 'reset' | 'button' = 'button';\n\n /** The name of the button, submitted as a pair with the button’s value as part of the form data. */\n @Prop({ reflect: true }) name?: string;\n\n /** Defines the value associated with the button’s name when it’s submitted with the form data. */\n @Prop({ reflect: true }) value?: string;\n\n /** A description that gets read by screen readers and other assistive devices. For optimal accessibility, you should\n * always include a label that describes what the icon button does. */\n @Prop() label!: string;\n\n /** display the label as a `<nano-tooltip />` */\n @Prop() showTooltip: boolean = false;\n\n /** Set to true to disable the button. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Contains a URL or a URL fragment that the hyperlink points to.\n * If this property is set, an anchor tag will be rendered. */\n @Prop() href: string | undefined;\n\n /** Specifies the relationship of the target object to the link object.\n * The value is a space-separated list of [link types](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types) */\n @Prop() rel: string | undefined;\n\n /** Specifies where to display the linked URL. Only applies when an `href` is provided.\n * Special keywords: `\"_blank\"`, `\"_self\"`, `\"_parent\"`, `\"_top\"`. */\n @Prop() target: string | undefined;\n\n /** The HTML form element or form element id.\n * Used to submit a form when the button is not a child of the form. */\n @Prop() form: HTMLFormElement | string;\n\n /** Sets focus on the internal button */\n @Method()\n async setFocus() {\n this.button.focus();\n }\n\n /**\n * Finds the form element based on the provided `form` selector\n * or element reference provided.\n * @returns the found form element (if found)\n */\n private findForm(): HTMLFormElement | null {\n const { form, host } = this;\n if (!form) return host.closest('form');\n\n if (form instanceof HTMLFormElement) {\n return form;\n }\n if (typeof form === 'string') {\n const el = document.getElementById(form);\n if (el instanceof HTMLFormElement) {\n return el;\n }\n }\n return null;\n }\n\n private handleClick = (ev: Event) => {\n if (this.type === 'button') return;\n const formEl = this.findForm();\n\n if (formEl) {\n ev.preventDefault();\n\n const fakeButton = document.createElement('button');\n fakeButton.type = this.type;\n fakeButton.style.display = 'none';\n formEl.appendChild(fakeButton);\n fakeButton.click();\n fakeButton.remove();\n }\n };\n\n componentDidLoad() {\n focusVisible.observe(this.button);\n }\n\n connectedCallback() {\n if (this.button) focusVisible.observe(this.button);\n }\n\n disconnectedCallback() {\n focusVisible.unobserve(this.button);\n }\n\n private content() {\n const TagType: 'a' | 'button' = this.href === undefined ? 'button' : 'a';\n\n return (\n <Host aria-disabled={this.disabled ? 'true' : null}>\n <TagType\n onClick={this.handleClick}\n part=\"base\"\n ref={(el) => (this.button = el)}\n class={{\n 'icon-button': true,\n 'icon-button--disabled': this.disabled,\n }}\n name={this.name}\n value={this.value}\n href={this.href || undefined}\n target={this.href && this.target ? this.target : undefined}\n rel={this.rel || undefined}\n type={!this.href && this.type ? this.type : undefined}\n >\n <span class=\"icon-button__label\">{this.label}</span>\n <nano-icon\n name={this.iconName}\n src={this.iconSrc}\n aria-hidden=\"true\"\n lazy={false}\n part=\"icon\"\n />\n </TagType>\n </Host>\n );\n }\n\n render() {\n if (this.showTooltip) {\n return <nano-tooltip content={this.label}>{this.content()}</nano-tooltip>;\n }\n return this.content();\n }\n}\n"]}
|
@@ -15,16 +15,13 @@
|
|
15
15
|
}
|
16
16
|
|
17
17
|
.form-ctrl {
|
18
|
+
container-type: inline-size;
|
18
19
|
min-inline-size: 100%;
|
19
20
|
display: block;
|
20
21
|
}
|
21
22
|
.form-ctrl.has-helper-end {
|
22
23
|
display: flex;
|
23
24
|
gap: 1rem;
|
24
|
-
opacity: 0;
|
25
|
-
}
|
26
|
-
.form-ctrl.has-helper-end.is-ready {
|
27
|
-
opacity: 1;
|
28
25
|
}
|
29
26
|
.form-ctrl.has-helper-end .form-ctrl__wrapper {
|
30
27
|
flex: 1 1 100%;
|
@@ -32,11 +29,13 @@
|
|
32
29
|
.form-ctrl.has-helper-end .form-ctrl__helper-end {
|
33
30
|
display: none;
|
34
31
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
@container (min-width: 350px) {
|
33
|
+
.form-ctrl.has-helper-end .form-ctrl__helper-end {
|
34
|
+
display: block !important;
|
35
|
+
}
|
36
|
+
.form-ctrl.has-helper-end .form-ctrl__helper {
|
37
|
+
display: none !important;
|
38
|
+
}
|
40
39
|
}
|
41
40
|
|
42
41
|
.form-ctrl__wrapper {
|
@@ -15,16 +15,13 @@
|
|
15
15
|
}
|
16
16
|
|
17
17
|
.form-ctrl {
|
18
|
+
container-type: inline-size;
|
18
19
|
min-inline-size: 100%;
|
19
20
|
display: block;
|
20
21
|
}
|
21
22
|
.form-ctrl.has-helper-end {
|
22
23
|
display: flex;
|
23
24
|
gap: 1rem;
|
24
|
-
opacity: 0;
|
25
|
-
}
|
26
|
-
.form-ctrl.has-helper-end.is-ready {
|
27
|
-
opacity: 1;
|
28
25
|
}
|
29
26
|
.form-ctrl.has-helper-end .form-ctrl__wrapper {
|
30
27
|
flex: 1 1 100%;
|
@@ -32,11 +29,13 @@
|
|
32
29
|
.form-ctrl.has-helper-end .form-ctrl__helper-end {
|
33
30
|
display: none;
|
34
31
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
@container (min-width: 350px) {
|
33
|
+
.form-ctrl.has-helper-end .form-ctrl__helper-end {
|
34
|
+
display: block !important;
|
35
|
+
}
|
36
|
+
.form-ctrl.has-helper-end .form-ctrl__helper {
|
37
|
+
display: none !important;
|
38
|
+
}
|
40
39
|
}
|
41
40
|
|
42
41
|
.form-ctrl__wrapper {
|
@@ -596,6 +596,7 @@ export class Sortable {
|
|
596
596
|
slot="end"
|
597
597
|
icon-name="light/arrows"
|
598
598
|
class="nano-sortable__keyboard-handle visually-hidden"
|
599
|
+
label="Re-order this item"
|
599
600
|
></nano-icon-button>`;
|
600
601
|
const div = globalThis.document.createElement('div');
|
601
602
|
div.innerHTML = handleTpl;
|
@@ -887,7 +888,7 @@ export class Sortable {
|
|
887
888
|
},
|
888
889
|
"getter": false,
|
889
890
|
"setter": false,
|
890
|
-
"defaultValue": "(_number: number, _element: Element) => {\n const handleTpl = /* html */ `\n <nano-icon-button\n slot=\"end\"\n icon-name=\"light/arrows\"\n class=\"nano-sortable__keyboard-handle visually-hidden\"\n ></nano-icon-button>`;\n const div = globalThis.document.createElement('div');\n div.innerHTML = handleTpl;\n\n const handle = div.children[0] as HTMLElement;\n _element.append(handle);\n return handle;\n }"
|
891
|
+
"defaultValue": "(_number: number, _element: Element) => {\n const handleTpl = /* html */ `\n <nano-icon-button\n slot=\"end\"\n icon-name=\"light/arrows\"\n class=\"nano-sortable__keyboard-handle visually-hidden\"\n label=\"Re-order this item\"\n ></nano-icon-button>`;\n const div = globalThis.document.createElement('div');\n div.innerHTML = handleTpl;\n\n const handle = div.children[0] as HTMLElement;\n _element.append(handle);\n return handle;\n }"
|
891
892
|
},
|
892
893
|
"sortableHostElement": {
|
893
894
|
"type": "unknown",
|