@pine-ds/core 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/index2.js +1 -1
- package/components/index2.js.map +1 -1
- package/components/pds-button2.js +31 -5
- package/components/pds-button2.js.map +1 -1
- package/components/pds-checkbox2.js +9 -3
- package/components/pds-checkbox2.js.map +1 -1
- package/components/pds-copytext.js +1 -1
- package/components/pds-copytext.js.map +1 -1
- package/components/pds-icon2.js +104 -8
- package/components/pds-icon2.js.map +1 -1
- package/components/pds-link.js +1 -1
- package/components/pds-link.js.map +1 -1
- package/components/pds-switch.js +8 -3
- package/components/pds-switch.js.map +1 -1
- package/dist/cjs/{index-xqJkQM0c.js → index-CG2Rr2io.js} +3 -3
- package/dist/cjs/index-CG2Rr2io.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
- package/dist/cjs/pds-avatar.cjs.entry.js +1 -1
- package/dist/cjs/pds-button.cjs.entry.js +32 -6
- package/dist/cjs/pds-button.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-button.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-checkbox.cjs.entry.js +10 -4
- package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-checkbox.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-chip.cjs.entry.js +1 -1
- package/dist/cjs/pds-copytext.cjs.entry.js +2 -2
- package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-copytext.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-icon.cjs.entry.js +103 -8
- package/dist/cjs/pds-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-input.cjs.entry.js +1 -1
- package/dist/cjs/pds-link.cjs.entry.js +2 -2
- package/dist/cjs/pds-link.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-link.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-radio.cjs.entry.js +1 -1
- package/dist/cjs/pds-select.cjs.entry.js +1 -1
- package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
- package/dist/cjs/pds-switch.cjs.entry.js +9 -4
- package/dist/cjs/pds-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/pds-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-table-head-cell.cjs.entry.js +1 -1
- package/dist/cjs/pds-textarea.cjs.entry.js +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/collection/components/pds-button/pds-button.css +7 -11
- package/dist/collection/components/pds-button/pds-button.js +37 -5
- package/dist/collection/components/pds-button/pds-button.js.map +1 -1
- package/dist/collection/components/pds-button/stories/pds-button.stories.js +46 -11
- package/dist/collection/components/pds-checkbox/pds-checkbox.js +9 -3
- package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -1
- package/dist/collection/components/pds-copytext/pds-copytext.css +1 -1
- package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +1 -1
- package/dist/collection/components/pds-link/pds-link.css +3 -8
- package/dist/collection/components/pds-popover/stories/pds-popover.stories.js +4 -5
- package/dist/collection/components/pds-switch/pds-switch.js +8 -3
- package/dist/collection/components/pds-switch/pds-switch.js.map +1 -1
- package/dist/docs.json +33 -3
- package/dist/esm/{index-DgttLLHX.js → index-_4gljHh-.js} +3 -3
- package/dist/esm/index-_4gljHh-.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pds-accordion.entry.js +1 -1
- package/dist/esm/pds-avatar.entry.js +1 -1
- package/dist/esm/pds-button.entry.js +32 -6
- package/dist/esm/pds-button.entry.js.map +1 -1
- package/dist/esm/pds-checkbox.entry.js +11 -5
- package/dist/esm/pds-checkbox.entry.js.map +1 -1
- package/dist/esm/pds-chip.entry.js +1 -1
- package/dist/esm/pds-copytext.entry.js +2 -2
- package/dist/esm/pds-copytext.entry.js.map +1 -1
- package/dist/esm/pds-icon.entry.js +103 -8
- package/dist/esm/pds-icon.entry.js.map +1 -1
- package/dist/esm/pds-input.entry.js +1 -1
- package/dist/esm/pds-link.entry.js +2 -2
- package/dist/esm/pds-link.entry.js.map +1 -1
- package/dist/esm/pds-radio.entry.js +1 -1
- package/dist/esm/pds-select.entry.js +1 -1
- package/dist/esm/pds-sortable-item.entry.js +1 -1
- package/dist/esm/pds-switch.entry.js +9 -4
- package/dist/esm/pds-switch.entry.js.map +1 -1
- package/dist/esm/pds-table-head-cell.entry.js +1 -1
- package/dist/esm/pds-textarea.entry.js +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm-es5/{index-DgttLLHX.js → index-_4gljHh-.js} +1 -1
- package/dist/esm-es5/index-_4gljHh-.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-avatar.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js +1 -1
- package/dist/esm-es5/pds-button.entry.js.map +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js +1 -1
- package/dist/esm-es5/pds-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/pds-chip.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js +1 -1
- package/dist/esm-es5/pds-copytext.entry.js.map +1 -1
- package/dist/esm-es5/pds-icon.entry.js +1 -1
- package/dist/esm-es5/pds-icon.entry.js.map +1 -1
- package/dist/esm-es5/pds-input.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js +1 -1
- package/dist/esm-es5/pds-link.entry.js.map +1 -1
- package/dist/esm-es5/pds-radio.entry.js +1 -1
- package/dist/esm-es5/pds-select.entry.js +1 -1
- package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js +1 -1
- package/dist/esm-es5/pds-switch.entry.js.map +1 -1
- package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
- package/dist/esm-es5/pds-textarea.entry.js +1 -1
- package/dist/esm-es5/pine-core.js +1 -1
- package/dist/pine-core/p-103b62a1.system.entry.js +2 -0
- package/dist/pine-core/p-103b62a1.system.entry.js.map +1 -0
- package/dist/pine-core/{p-729b2f4b.entry.js → p-1b81a8ec.entry.js} +2 -2
- package/dist/pine-core/p-38246e2f.entry.js +2 -0
- package/dist/pine-core/p-38246e2f.entry.js.map +1 -0
- package/dist/pine-core/{p-7c092a4a.system.entry.js → p-38d2498e.system.entry.js} +2 -2
- package/dist/pine-core/p-3ce8eb9f.entry.js +2 -0
- package/dist/pine-core/p-3ce8eb9f.entry.js.map +1 -0
- package/dist/pine-core/p-3e91dccd.entry.js +2 -0
- package/dist/pine-core/p-3e91dccd.entry.js.map +1 -0
- package/dist/pine-core/{p-d7a50e5f.entry.js → p-4ccd2d5e.entry.js} +2 -2
- package/dist/pine-core/{p-cf10370e.entry.js → p-4e7ca704.entry.js} +2 -2
- package/dist/pine-core/{p-f5e00dd7.entry.js → p-4ff0838c.entry.js} +2 -2
- package/dist/pine-core/p-5763df39.system.entry.js +2 -0
- package/dist/pine-core/p-5763df39.system.entry.js.map +1 -0
- package/dist/pine-core/{p-07ba78e2.system.entry.js → p-596e0292.system.entry.js} +2 -2
- package/dist/pine-core/p-5acda4ac.system.entry.js +2 -0
- package/dist/pine-core/p-5acda4ac.system.entry.js.map +1 -0
- package/dist/pine-core/{p-c5064695.system.entry.js → p-6260135d.system.entry.js} +2 -2
- package/dist/pine-core/{p-cb7bd3d0.entry.js → p-6a716bff.entry.js} +2 -2
- package/dist/pine-core/{p-e1017124.entry.js → p-6ad460a7.entry.js} +2 -2
- package/dist/pine-core/p-6ad460a7.entry.js.map +1 -0
- package/dist/pine-core/p-82151ac5.entry.js +2 -0
- package/dist/pine-core/p-82151ac5.entry.js.map +1 -0
- package/dist/pine-core/{p-4e1da43b.entry.js → p-82e05dcf.entry.js} +2 -2
- package/dist/pine-core/{p-30fb8edc.entry.js → p-8337c77c.entry.js} +2 -2
- package/dist/pine-core/{p-BkHsli73.system.js.map → p-9niWVsdd.system.js.map} +1 -1
- package/dist/pine-core/{p-76G4-EJX.system.js → p-B4W0_y2p.system.js} +1 -1
- package/dist/pine-core/p-B4W0_y2p.system.js.map +1 -0
- package/dist/pine-core/p-BJyPFOn0.system.js.map +1 -0
- package/dist/pine-core/p-BsL2GDnH.system.js +1 -1
- package/dist/pine-core/{p-dbsIUsdW.system.js.map → p-Bu94kuQa.system.js.map} +1 -1
- package/dist/pine-core/p-C3ud771n.system.js.map +1 -0
- package/dist/pine-core/{p-CyVHE8Oy.system.js.map → p-Cg0JSYH5.system.js.map} +1 -1
- package/dist/pine-core/p-CnoLHUtr.system.js.map +1 -0
- package/dist/pine-core/{p-Bi_6EftO.system.js.map → p-Cz3zRtiB.system.js.map} +1 -1
- package/dist/pine-core/{p-SwAZL0Lv.system.js.map → p-D8WAvG2e.system.js.map} +1 -1
- package/dist/pine-core/{p-Cgglu7hD.system.js.map → p-DEsea81X.system.js.map} +1 -1
- package/dist/pine-core/{p-DnNFlcGO.system.js.map → p-DFmUOrRG.system.js.map} +1 -1
- package/dist/pine-core/p-DkJgkLjR.system.js.map +1 -0
- package/dist/pine-core/p-Dv_jWtcr.system.js.map +1 -0
- package/dist/pine-core/{p-DkBw9sE6.system.js.map → p-Dz6toWDZ.system.js.map} +1 -1
- package/dist/pine-core/p-IK9NvSRG.system.js.map +1 -0
- package/dist/pine-core/{p-Buxo5g02.system.js.map → p-YuC61pNM.system.js.map} +1 -1
- package/dist/pine-core/{p-DgttLLHX.js → p-_4gljHh-.js} +1 -1
- package/dist/pine-core/p-_4gljHh-.js.map +1 -0
- package/dist/pine-core/{p-f057d838.system.entry.js → p-a952d40c.system.entry.js} +2 -2
- package/dist/pine-core/p-b390c427.entry.js +2 -0
- package/dist/pine-core/p-b390c427.entry.js.map +1 -0
- package/dist/pine-core/{p-2f7a6973.system.entry.js → p-c7d4f436.system.entry.js} +2 -2
- package/dist/pine-core/{p-32a2829d.system.entry.js → p-c838b6ef.system.entry.js} +2 -2
- package/dist/pine-core/{p-21460848.system.entry.js → p-ca09f86a.system.entry.js} +2 -2
- package/dist/pine-core/{p-d669d90f.system.entry.js → p-ceb48b05.system.entry.js} +2 -2
- package/dist/pine-core/p-d3ab594c.system.entry.js +2 -0
- package/dist/pine-core/p-d3ab594c.system.entry.js.map +1 -0
- package/dist/pine-core/p-d78bec50.system.entry.js +2 -0
- package/dist/pine-core/p-d78bec50.system.entry.js.map +1 -0
- package/dist/pine-core/{p-a591d223.system.entry.js → p-d8e02aa9.system.entry.js} +2 -2
- package/dist/pine-core/{p-80dfca39.entry.js → p-e88d58f4.entry.js} +2 -2
- package/dist/pine-core/{p-6ad2a6f6.entry.js → p-f94703c9.entry.js} +2 -2
- package/dist/pine-core/{p-f23cd1cb.system.entry.js → p-fd9aa739.system.entry.js} +2 -2
- package/dist/pine-core/p-fd9aa739.system.entry.js.map +1 -0
- package/dist/pine-core/pds-button.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-checkbox.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-copytext.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-icon.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-link.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-switch.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-button/pds-button.d.ts +8 -1
- package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +3 -0
- package/dist/types/components/pds-switch/pds-switch.d.ts +2 -0
- package/dist/types/components.d.ts +4 -2
- package/hydrate/index.js +238 -105
- package/hydrate/index.mjs +238 -105
- package/package.json +2 -2
- package/dist/cjs/index-xqJkQM0c.js.map +0 -1
- package/dist/esm/index-DgttLLHX.js.map +0 -1
- package/dist/esm-es5/index-DgttLLHX.js.map +0 -1
- package/dist/pine-core/p-0823ed6b.entry.js +0 -2
- package/dist/pine-core/p-0823ed6b.entry.js.map +0 -1
- package/dist/pine-core/p-1f2becfa.entry.js +0 -2
- package/dist/pine-core/p-1f2becfa.entry.js.map +0 -1
- package/dist/pine-core/p-2426b230.system.entry.js +0 -2
- package/dist/pine-core/p-2426b230.system.entry.js.map +0 -1
- package/dist/pine-core/p-5ed3c4c1.entry.js +0 -2
- package/dist/pine-core/p-5ed3c4c1.entry.js.map +0 -1
- package/dist/pine-core/p-76G4-EJX.system.js.map +0 -1
- package/dist/pine-core/p-7b76c724.entry.js +0 -2
- package/dist/pine-core/p-7b76c724.entry.js.map +0 -1
- package/dist/pine-core/p-83bcd5ef.system.entry.js +0 -2
- package/dist/pine-core/p-83bcd5ef.system.entry.js.map +0 -1
- package/dist/pine-core/p-8d1978dd.entry.js +0 -2
- package/dist/pine-core/p-8d1978dd.entry.js.map +0 -1
- package/dist/pine-core/p-BC4T-VGa.system.js.map +0 -1
- package/dist/pine-core/p-BGpLq4ka.system.js.map +0 -1
- package/dist/pine-core/p-Cw5kzsDv.system.js.map +0 -1
- package/dist/pine-core/p-DF-AOrOZ.system.js.map +0 -1
- package/dist/pine-core/p-DgttLLHX.js.map +0 -1
- package/dist/pine-core/p-d1bbaa71.system.entry.js +0 -2
- package/dist/pine-core/p-d1bbaa71.system.entry.js.map +0 -1
- package/dist/pine-core/p-d2a6a116.system.entry.js +0 -2
- package/dist/pine-core/p-d2a6a116.system.entry.js.map +0 -1
- package/dist/pine-core/p-d61116ab.system.entry.js +0 -2
- package/dist/pine-core/p-d61116ab.system.entry.js.map +0 -1
- package/dist/pine-core/p-e1017124.entry.js.map +0 -1
- package/dist/pine-core/p-f23cd1cb.system.entry.js.map +0 -1
- package/dist/pine-core/p-h7erfdzU.system.js.map +0 -1
- package/dist/pine-core/p-udA_47qE.system.js.map +0 -1
- /package/dist/pine-core/{p-729b2f4b.entry.js.map → p-1b81a8ec.entry.js.map} +0 -0
- /package/dist/pine-core/{p-7c092a4a.system.entry.js.map → p-38d2498e.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d7a50e5f.entry.js.map → p-4ccd2d5e.entry.js.map} +0 -0
- /package/dist/pine-core/{p-cf10370e.entry.js.map → p-4e7ca704.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f5e00dd7.entry.js.map → p-4ff0838c.entry.js.map} +0 -0
- /package/dist/pine-core/{p-07ba78e2.system.entry.js.map → p-596e0292.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-c5064695.system.entry.js.map → p-6260135d.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-cb7bd3d0.entry.js.map → p-6a716bff.entry.js.map} +0 -0
- /package/dist/pine-core/{p-4e1da43b.entry.js.map → p-82e05dcf.entry.js.map} +0 -0
- /package/dist/pine-core/{p-30fb8edc.entry.js.map → p-8337c77c.entry.js.map} +0 -0
- /package/dist/pine-core/{p-f057d838.system.entry.js.map → p-a952d40c.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-2f7a6973.system.entry.js.map → p-c7d4f436.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-32a2829d.system.entry.js.map → p-c838b6ef.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-21460848.system.entry.js.map → p-ca09f86a.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-d669d90f.system.entry.js.map → p-ceb48b05.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-a591d223.system.entry.js.map → p-d8e02aa9.system.entry.js.map} +0 -0
- /package/dist/pine-core/{p-80dfca39.entry.js.map → p-e88d58f4.entry.js.map} +0 -0
- /package/dist/pine-core/{p-6ad2a6f6.entry.js.map → p-f94703c9.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-icon.entry.js","sources":["../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/assetPath.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/utils.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/validate.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/request.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/pds-icon.css?tag=pds-icon&encapsulation=shadow","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/pds-icon.js"],"sourcesContent":["import { Build } from \"@stencil/core\";\nlet missingAssetPathWarning = false;\n/**\n *\n * Reads the component asset path config from meta tag or a global variable.\n * This is a temporary workaround until these issues have been addressed:\n *\n * https://github.com/ionic-team/stencil/issues/2826/\n * https://github.com/ionic-team/stencil/issues/3470\n * https://github.com/ionic-team/stencil-ds-output-targets/issues/186\n */\nexport const getAssetPath = (path) => {\n var _a;\n const metaPineAssetPath = (_a = document.head.querySelector('meta[data-pine-asset-path]')) === null || _a === void 0 ? void 0 : _a.dataset.pineAssetPath;\n // Get the asset path from the window object if available\n const windowAssetPath = window.__PINE_ASSET_PATH__;\n // Set the CDN Asset path using the latest version\n const cdnAssetPath = 'https://cdn.jsdelivr.net/npm/@pine-ds/icons/dist/pds-icons/';\n const assetBasePath = Build.isTesting ? '/dist/pds-icons' : metaPineAssetPath || windowAssetPath || cdnAssetPath || '/';\n // Display a warning if the assets are fetched from the CDN.\n if (assetBasePath.startsWith('https://cdn.jsdelivr.net/npm/') && !missingAssetPathWarning) {\n missingAssetPathWarning = true;\n console.warn(`\n Fetching Pine assets from jsDelivr CDN.\\n\\n It's recommended that you bundle Pine Assets with your application and set the path accordingly.\\n\\nFor more information, read the documentation: \\nhttps://pine-design-system.netlify.app/?path=/docs/resources-assets--docs\n `);\n }\n let assetPath = path;\n if (path.startsWith('./')) {\n assetPath = path.substring(2);\n }\n if (!assetBasePath.endsWith('/')) {\n assetPath = '/' + assetPath;\n }\n return assetBasePath + assetPath;\n};\n//# sourceMappingURL=assetPath.js.map\n","import { getAssetPath } from \"./assetPath\";\nlet CACHED_MAP;\nexport const addIcons = (icons) => {\n const map = getIconMap();\n Object.keys(icons).forEach(name => map.set(name, icons[name]));\n};\nexport const getIconMap = () => {\n if (typeof window === 'undefined') {\n return new Map();\n }\n else {\n if (!CACHED_MAP) {\n const win = window; // eslint-disable-line @typescript-eslint/no-explicit-any\n win.PdsIcons = win.PdsIcons || {};\n CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();\n }\n return CACHED_MAP;\n }\n};\nexport const getName = (iconName, icon) => {\n if (!iconName && icon && !isSrc(icon)) {\n iconName = icon;\n }\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n const invalidChars = iconName.replace(/[a-z]|-|\\d/gi, '');\n if (invalidChars != '') {\n return null;\n }\n return iconName;\n};\nconst getNamedUrl = (iconName) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n return getAssetPath(`svg/${iconName}.svg`);\n};\nexport const getSrc = (src) => {\n if (isStr(src)) {\n src = src.trim();\n if (isSrc(src)) {\n return src;\n }\n }\n return null;\n};\nexport const getUrl = (pdsIcon) => {\n let url = getSrc(pdsIcon.src);\n if (url) {\n return url;\n }\n url = getName(pdsIcon.name, pdsIcon.icon);\n if (url) {\n return getNamedUrl(url);\n }\n if (pdsIcon.icon) {\n url = getSrc(pdsIcon.icon);\n if (url) {\n return url;\n }\n }\n return null;\n};\nexport const isSrc = (str) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const toLower = (val) => val.toLowerCase();\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `pds-input` should inherit\n * the `title` attribute that developers set directly on `pds-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (el, attributes = []) => {\n const attributeObject = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n return attributeObject;\n};\n//# sourceMappingURL=utils.js.map\n","import { isStr } from \"./utils\";\nexport const validateContent = (svgContent) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm)) {\n return div.innerHTML;\n }\n }\n return '';\n};\nexport const isValid = (elm) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i])) {\n return false;\n }\n }\n }\n return true;\n};\nexport const isSvgDataUrl = (url) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url) => url.indexOf(';utf8,') !== -1;\n//# sourceMappingURL=validate.js.map\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from \"./validate\";\nexport const pdsIconContent = new Map();\nconst requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any\nlet parser;\nexport const getSvgContent = (url, sanitize = false) => {\n let req = requests.get(url);\n if (!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n }\n return Promise.resolve();\n }\n else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n svgContent = validateContent(svgContent);\n }\n pdsIconContent.set(url, svgContent || '');\n });\n }\n pdsIconContent.set(url, '');\n });\n requests.set(url, req);\n }\n }\n else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n return req;\n};\n//# sourceMappingURL=request.js.map\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n}\n:host .pdsicon {\n fill: var(--color-icon-fill);\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}","import { Build, Host, h } from \"@stencil/core\";\nimport { getSvgContent, pdsIconContent } from \"./request\";\nimport { getName, getUrl, inheritAttributes } from \"./utils\";\nexport class PdsIcon {\n constructor() {\n this.inheritedAttributes = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n this.isVisible = false;\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', large, or a\n * custom value (40px, 1rem, etc)\n *\n */\n this.size = 'regular';\n this.hasAriaHidden = () => {\n const { el } = this;\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n };\n }\n iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n };\n if (sizes[this.size]) {\n return sizes[this.size];\n }\n else {\n return this.size;\n }\n }\n componentDidLoad() {\n this.setCSSVariables();\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n connectedCallback() {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n updateStyles() {\n this.setCSSVariables();\n }\n loadIcon() {\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n }\n else {\n getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));\n }\n }\n }\n const label = getName(this.name, this.icon);\n if (label) {\n this.ariaLabel = label.replace(/\\-/g, ' ');\n }\n }\n render() {\n const { ariaLabel, inheritedAttributes } = this;\n return (h(Host, Object.assign({ key: '4bbc232e2530d43e8b5afefb754486d94ea6538b', \"aria-label\": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: \"\", role: \"img\", class: Object.assign({}, createColorClasses(this.color)) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h(\"div\", { class: \"icon-inner\", innerHTML: this.svgContent })) : (h(\"div\", { class: \"icon-inner\" }))));\n }\n /*****\n * Private Methods\n ****/\n waitUntilVisible(el, rootMargin, cb) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver((data) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n }, { rootMargin }));\n io.observe(el);\n }\n else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n static get is() { return \"pds-icon\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() {\n return {\n \"$\": [\"pds-icon.scss\"]\n };\n }\n static get styleUrls() {\n return {\n \"$\": [\"pds-icon.css\"]\n };\n }\n static get assetsDirs() { return [\"svg\"]; }\n static get properties() {\n return {\n \"color\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\\nThe color of the icon\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"color\",\n \"reflect\": false\n },\n \"icon\": {\n \"type\": \"any\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"This a combination of both `name` and `src`. If a `src` url is detected\\nit will set the `src` property. Otherwise it assumes it's a built-in named\\nSVG and set the `name` property.\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"icon\",\n \"reflect\": false\n },\n \"name\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The name of the icon to use from\\nthe built-in set.\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"name\",\n \"reflect\": true\n },\n \"size\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"| 'small' // 12px\\n | 'regular' // 16px\\n | 'medium' // 20px\\n | 'large' // 24px\\n | 'auto'\\n | string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The size of the icon. This can be\\n'small', 'regular', 'medium', large, or a\\ncustom value (40px, 1rem, etc)\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"size\",\n \"reflect\": true,\n \"defaultValue\": \"'regular'\"\n },\n \"src\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\\nSpecifies the exact `src` of an SVG file to use.\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"src\",\n \"reflect\": false\n }\n };\n }\n static get states() {\n return {\n \"ariaLabel\": {},\n \"isVisible\": {},\n \"svgContent\": {}\n };\n }\n static get elementRef() { return \"el\"; }\n static get watchers() {\n return [{\n \"propName\": \"size\",\n \"methodName\": \"updateStyles\"\n }, {\n \"propName\": \"color\",\n \"methodName\": \"updateStyles\"\n }, {\n \"propName\": \"name\",\n \"methodName\": \"loadIcon\"\n }, {\n \"propName\": \"src\",\n \"methodName\": \"loadIcon\"\n }, {\n \"propName\": \"icon\",\n \"methodName\": \"loadIcon\"\n }];\n }\n}\nconst createColorClasses = (color) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n};\n//# sourceMappingURL=pds-icon.js.map\n"],"names":[],"mappings":";;AACA,IAAI,uBAAuB,GAAG,KAAK;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,IAAI,IAAI,EAAE;AACV,IAAI,MAAM,iBAAiB,GAAG,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,4BAA4B,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,aAAa;AAC5J;AACA,IAAI,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB;AACtD;AACA,IAAI,MAAM,YAAY,GAAG,6DAA6D;AACtF,IAAI,MAAM,aAAa,GAAyC,iBAAiB,IAAI,eAAe,IAAI,YAAmB;AAC3H;AACA,IAAI,IAAI,aAAa,CAAC,UAAU,CAAC,+BAA+B,CAAC,IAAI,CAAC,uBAAuB,EAAE;AAC/F,QAAQ,uBAAuB,GAAG,IAAI;AACtC,QAAQ,OAAO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UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;;AAE3Z;;AAEM;AACN,IAAA,gBAAgB,CAAC,EAAE,EAAE,UAAU,EAAE,EAAE,EAAA;AAC/B,QAAA,IAAuB,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,EAAE,oBAAoB,EAAE;AACnF,YAAA,MAAM,EAAE,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,IAAI,KAAI;AAC7D,gBAAA,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE;oBACxB,EAAE,CAAC,UAAU,EAAE;AACf,oBAAA,IAAI,CAAC,EAAE,GAAG,SAAS;AACnB,oBAAA,EAAE,EAAE;;AAEZ,aAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AACnB,YAAA,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;aAEb;;;AAGD,YAAA,EAAE,EAAE;;;IAeZ,WAAW,UAAU,GAAK,EAAA,OAAO,CAAC,KAAK,CAAC,CAAC;;;;;;;;;;AAgI7C,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAI;AACjC,IAAA,OAAO;AACH,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC/B;UACC,IAAI;AACd,CAAC;;;;;","x_google_ignoreList":[0,1,2,3,4,5]}
|
|
1
|
+
{"version":3,"file":"pds-icon.entry.js","sources":["../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/assetPath.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/utils.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/validate.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/request.js","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/pds-icon.css?tag=pds-icon&encapsulation=shadow","../../node_modules/@pine-ds/icons/dist/collection/components/pds-icon/pds-icon.js"],"sourcesContent":["import { Build } from \"@stencil/core\";\nlet missingAssetPathWarning = false;\n/**\n *\n * Reads the component asset path config from meta tag or a global variable.\n * This is a temporary workaround until these issues have been addressed:\n *\n * https://github.com/ionic-team/stencil/issues/2826/\n * https://github.com/ionic-team/stencil/issues/3470\n * https://github.com/ionic-team/stencil-ds-output-targets/issues/186\n */\nexport const getAssetPath = (path) => {\n var _a;\n const metaPineAssetPath = (_a = document.head.querySelector('meta[data-pine-asset-path]')) === null || _a === void 0 ? void 0 : _a.dataset.pineAssetPath;\n // Get the asset path from the window object if available\n const windowAssetPath = window.__PINE_ASSET_PATH__;\n // Set the CDN Asset path using the latest version\n const cdnAssetPath = 'https://cdn.jsdelivr.net/npm/@pine-ds/icons/dist/';\n const assetBasePath = Build.isTesting ? '/dist/pds-icons' : metaPineAssetPath || windowAssetPath || cdnAssetPath || '/';\n // Display a warning if the assets are fetched from the CDN.\n if (assetBasePath.startsWith('https://cdn.jsdelivr.net/npm/') && !missingAssetPathWarning) {\n missingAssetPathWarning = true;\n console.warn(`\n Fetching Pine assets from jsDelivr CDN.\\n\\n It's recommended that you bundle Pine Assets with your application and set the path accordingly.\\n\\nFor more information, read the documentation: \\nhttps://pine-design-system.netlify.app/?path=/docs/resources-assets--docs\n `);\n }\n let assetPath = path;\n if (path.startsWith('./')) {\n assetPath = path.substring(2);\n }\n if (!assetBasePath.endsWith('/')) {\n assetPath = '/' + assetPath;\n }\n return assetBasePath + assetPath;\n};\n//# sourceMappingURL=assetPath.js.map\n","import { getAssetPath } from \"./assetPath\";\nlet CACHED_MAP;\nexport const addIcons = (icons) => {\n const map = getIconMap();\n Object.keys(icons).forEach(name => map.set(name, icons[name]));\n};\nexport const getIconMap = () => {\n if (typeof window === 'undefined') {\n return new Map();\n }\n else {\n if (!CACHED_MAP) {\n const win = window; // eslint-disable-line @typescript-eslint/no-explicit-any\n win.PdsIcons = win.PdsIcons || {};\n CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();\n }\n return CACHED_MAP;\n }\n};\nexport const getName = (iconName, icon) => {\n if (!iconName && icon && !isSrc(icon)) {\n iconName = icon;\n }\n if (isStr(iconName)) {\n iconName = toLower(iconName);\n }\n if (!isStr(iconName) || iconName.trim() === '') {\n return null;\n }\n const invalidChars = iconName.replace(/[a-z]|-|\\d/gi, '');\n if (invalidChars != '') {\n return null;\n }\n return iconName;\n};\nconst getNamedUrl = (iconName) => {\n const url = getIconMap().get(iconName);\n if (url) {\n return url;\n }\n return getAssetPath(`svg/${iconName}.svg`);\n};\nexport const getSrc = (src) => {\n if (isStr(src)) {\n src = src.trim();\n if (isSrc(src)) {\n return src;\n }\n }\n return null;\n};\nexport const getUrl = (pdsIcon) => {\n let url = getSrc(pdsIcon.src);\n if (url) {\n return url;\n }\n url = getName(pdsIcon.name, pdsIcon.icon);\n if (url) {\n return getNamedUrl(url);\n }\n if (pdsIcon.icon) {\n url = getSrc(pdsIcon.icon);\n if (url) {\n return url;\n }\n }\n return null;\n};\n/**\n * Returns `true` if the document or host element\n * has a `dir` set to `rtl`. The host value will always\n * take priority over the root document value.\n */\nexport const isRTL = (hostEl) => {\n if (hostEl) {\n if (hostEl.dir !== '') {\n return hostEl.dir.toLowerCase() === 'rtl';\n }\n }\n return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';\n};\nexport const isSrc = (str) => str.length > 0 && /(\\/|\\.)/.test(str);\nexport const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const toLower = (val) => val.toLowerCase();\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `pds-input` should inherit\n * the `title` attribute that developers set directly on `pds-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (el, attributes = []) => {\n const attributeObject = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n attributes.forEach(attr => {\n if (el.hasAttribute(attr)) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n el.removeAttribute(attr);\n }\n });\n return attributeObject;\n};\n/**\n * Determines if an icon should be flipped when RTL is enabled\n * @param iconName - The name of the icon to check\n * @param hostEl - Optional host element to check for RTL direction\n * @returns {boolean} - True if the icon should be flipped in RTL mode, false otherwise\n */\nexport const shouldRtlFlipIcon = (iconName, hostEl) => {\n // First check if we're in RTL mode\n const rtlEnabled = isRTL(hostEl);\n // Only flip if we're in RTL mode and the icon is in the flip list\n return rtlEnabled && ICONS_TO_FLIP.includes(iconName);\n};\n/**\n * Array of available icon names\n */\nexport const ICONS_TO_FLIP = [\n 'align-horizontal-bottom',\n 'align-horizontal-center',\n 'align-horizontal-top',\n 'align-left',\n 'align-right',\n 'align-vertical-left',\n 'align-vertical-right',\n 'arrow-corner',\n 'arrow-left',\n 'arrow-right',\n 'calendar-schedule',\n 'caret-left',\n 'caret-right',\n 'cart',\n 'cart-add',\n 'comment',\n 'comment-no',\n 'conversation',\n 'copy',\n 'copy-07',\n 'delete-key',\n 'delete-x',\n 'downsell',\n 'drawer-collapse',\n 'drawer-expand',\n 'duplicate',\n 'feedback',\n 'file-lock',\n 'file-search',\n 'form-field',\n 'form-filled',\n 'left-small',\n 'launch',\n 'list-bullet',\n 'list-numbers',\n 'margin-left',\n 'margin-right',\n 'move-left',\n 'move-right',\n 'newsletter-2',\n 'one-off-session',\n 'quote',\n 'redo',\n 'reset-password',\n 'right-small',\n 'send-message',\n 'share',\n 'super-admin',\n 'tablet-landscape',\n 'undo',\n 'user-star',\n 'user-star-filled',\n 'users',\n 'users-filled',\n 'users-tone'\n];\n//# sourceMappingURL=utils.js.map\n","import { isStr } from \"./utils\";\nexport const validateContent = (svgContent) => {\n const div = document.createElement('div');\n div.innerHTML = svgContent;\n // setup this way to ensure it works on our buddy IE\n for (let i = div.childNodes.length - 1; i >= 0; i--) {\n if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {\n div.removeChild(div.childNodes[i]);\n }\n }\n // must only have 1 root element\n const svgElm = div.firstElementChild;\n if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {\n const svgClass = svgElm.getAttribute('class') || '';\n svgElm.setAttribute('class', (svgClass + ' s-pds-icon').trim());\n // root element must be an svg\n // lets double check we've got valid elements\n // do not allow scripts\n if (isValid(svgElm)) {\n return div.innerHTML;\n }\n }\n return '';\n};\nexport const isValid = (elm) => {\n if (elm.nodeType === 1) {\n if (elm.nodeName.toLowerCase() === 'script') {\n return false;\n }\n for (let i = 0; i < elm.attributes.length; i++) {\n const name = elm.attributes[i].name;\n if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {\n return false;\n }\n }\n for (let i = 0; i < elm.childNodes.length; i++) {\n if (!isValid(elm.childNodes[i])) {\n return false;\n }\n }\n }\n return true;\n};\nexport const isSvgDataUrl = (url) => url.startsWith('data:image/svg+xml');\nexport const isEncodedDataUrl = (url) => url.indexOf(';utf8,') !== -1;\n//# sourceMappingURL=validate.js.map\n","import { isEncodedDataUrl, isSvgDataUrl, validateContent } from \"./validate\";\nexport const pdsIconContent = new Map();\nconst requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any\nlet parser;\nexport const getSvgContent = (url, sanitize = false) => {\n let req = requests.get(url);\n if (!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\n if (isSvgDataUrl(url) && isEncodedDataUrl(url)) {\n if (!parser) {\n parser = new DOMParser();\n }\n const doc = parser.parseFromString(url, 'text/html');\n const svg = doc.querySelector('svg');\n if (svg) {\n pdsIconContent.set(url, svg.outerHTML);\n }\n return Promise.resolve();\n }\n else {\n // we don't have a request\n req = fetch(url).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n if (svgContent && sanitize !== false) {\n svgContent = validateContent(svgContent);\n }\n pdsIconContent.set(url, svgContent || '');\n });\n }\n pdsIconContent.set(url, '');\n });\n requests.set(url, req);\n }\n }\n else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n return req;\n};\n//# sourceMappingURL=request.js.map\n",":host {\n --dimension-icon-height: 16px;\n --dimension-icon-width: 16px;\n --color-icon-fill: currentColor;\n contain: strict;\n display: inline-block;\n fill: var(--color-icon-fill);\n flex-shrink: 0;\n height: var(--dimension-icon-height);\n width: var(--dimension-icon-width);\n}\n:host .pdsicon {\n fill: var(--color-icon-fill);\n}\n\n.pds-icon-fill-none {\n fill: none;\n}\n\n.icon-inner,\n.pds-icon,\nsvg {\n display: block;\n height: 100%;\n width: 100%;\n}\n\n/* :host-context is supported in chromium; :dir is supported in safari & firefox */\n:host(.flip-rtl):host-context([dir=rtl]) .icon-inner {\n transform: scaleX(-1);\n}\n\n:host(.flip-rtl:dir(rtl)) .icon-inner {\n transform: scaleX(-1);\n}\n\n/**\n * This is needed for WebKit otherwise the fallback\n * will always cause the icon to be flipped if the document\n * loads in RTL.\n */\n:host(.flip-rtl:dir(ltr)) .icon-inner {\n transform: scaleX(1);\n}","import { Build, Host, h } from \"@stencil/core\";\nimport { getSvgContent, pdsIconContent } from \"./request\";\nimport { getName, getUrl, inheritAttributes, isRTL, shouldRtlFlipIcon } from \"./utils\";\nexport class PdsIcon {\n constructor() {\n this.didLoadIcon = false;\n this.iconName = null;\n this.inheritedAttributes = {}; // eslint-disable-line @typescript-eslint/no-explicit-any\n this.isVisible = false;\n /**\n * The size of the icon. This can be\n * 'small', 'regular', 'medium', 'large', or a\n * custom value (40px, 1rem, etc)\n *\n */\n this.size = 'regular';\n this.hasAriaHidden = () => {\n const { el } = this;\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n };\n }\n iconSize() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const sizes = {\n small: '12px',\n regular: '16px',\n medium: '20px',\n large: '24px',\n };\n if (sizes[this.size]) {\n return sizes[this.size];\n }\n else {\n return this.size;\n }\n }\n componentDidLoad() {\n this.setCSSVariables();\n if (!this.didLoadIcon) {\n this.loadIcon();\n }\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\n this.setCSSVariables();\n }\n setCSSVariables() {\n this.el.style.setProperty(`--dimension-icon-height`, this.iconSize());\n this.el.style.setProperty(`--dimension-icon-width`, this.iconSize());\n this.el.style.setProperty(`--color-icon-fill`, typeof this.color !== 'undefined' ? this.color : 'currentColor');\n }\n connectedCallback() {\n this.waitUntilVisible(this.el, '50px', () => {\n this.isVisible = true;\n this.loadIcon();\n });\n }\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n updateStyles() {\n this.setCSSVariables();\n }\n loadIcon() {\n if (Build.isBrowser && this.isVisible) {\n const url = getUrl(this);\n if (url) {\n if (pdsIconContent.has(url)) {\n this.svgContent = pdsIconContent.get(url);\n }\n else {\n getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));\n }\n this.didLoadIcon = true;\n }\n }\n this.iconName = getName(this.name, this.icon);\n if (this.iconName) {\n this.ariaLabel = this.iconName.replace(/\\-/g, ' ');\n }\n }\n render() {\n const { ariaLabel, flipRtl, iconName, inheritedAttributes } = this;\n const shouldIconAutoFlip = iconName\n ? shouldRtlFlipIcon(iconName, this.el) && flipRtl !== false\n : false;\n const shouldFlip = flipRtl || shouldIconAutoFlip;\n return (h(Host, Object.assign({ key: 'bc8e46daa75df27a8039e0e767bdb43164ad7d4c', \"aria-label\": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, alt: \"\", role: \"img\", class: Object.assign(Object.assign({}, createColorClasses(this.color)), { 'flip-rtl': shouldFlip, 'icon-rtl': shouldFlip && isRTL(this.el) }) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h(\"div\", { class: \"icon-inner\", innerHTML: this.svgContent })) : (h(\"div\", { class: \"icon-inner\" }))));\n }\n /*****\n * Private Methods\n ****/\n waitUntilVisible(el, rootMargin, cb) {\n if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {\n const io = (this.io = new (window).IntersectionObserver((data) => {\n if (data[0].isIntersecting) {\n io.disconnect();\n this.io = undefined;\n cb();\n }\n }, { rootMargin }));\n io.observe(el);\n }\n else {\n // browser doesn't support IntersectionObserver\n // so just fallback to always show it\n cb();\n }\n }\n static get is() { return \"pds-icon\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() {\n return {\n \"$\": [\"pds-icon.scss\"]\n };\n }\n static get styleUrls() {\n return {\n \"$\": [\"pds-icon.css\"]\n };\n }\n static get assetsDirs() { return [\"svg\"]; }\n static get properties() {\n return {\n \"color\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\\nThe color of the icon\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"color\",\n \"reflect\": false\n },\n \"flipRtl\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Determines if the icon should be flipped when the `dir` is right-to-left (`\\\"rtl\\\"`).\\nThis is automatically enabled for icons that are in the `ICONS_TO_FLIP` list and\\nwhen the `dir` is `\\\"rtl\\\"`. If `flipRtl` is set to `false`, the icon will not be flipped\\neven if the `dir` is `\\\"rtl\\\"`.\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"flip-rtl\",\n \"reflect\": false\n },\n \"icon\": {\n \"type\": \"any\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"any\",\n \"resolved\": \"any\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"This is a combination of both `name` and `src`. If a `src` URL is detected,\\nit will set the `src` property. Otherwise it assumes it's a built-in named\\nSVG and sets the `name` property.\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"icon\",\n \"reflect\": false\n },\n \"name\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The name of the icon to use from\\nthe built-in set.\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"name\",\n \"reflect\": true\n },\n \"size\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"| 'small' // 12px\\n | 'regular' // 16px\\n | 'medium' // 20px\\n | 'large' // 24px\\n | 'auto'\\n | string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The size of the icon. This can be\\n'small', 'regular', 'medium', 'large', or a\\ncustom value (40px, 1rem, etc)\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"size\",\n \"reflect\": true,\n \"defaultValue\": \"'regular'\"\n },\n \"src\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"\\nSpecifies the exact `src` of an SVG file to use.\"\n },\n \"getter\": false,\n \"setter\": false,\n \"attribute\": \"src\",\n \"reflect\": false\n }\n };\n }\n static get states() {\n return {\n \"ariaLabel\": {},\n \"isVisible\": {},\n \"svgContent\": {}\n };\n }\n static get elementRef() { return \"el\"; }\n static get watchers() {\n return [{\n \"propName\": \"size\",\n \"methodName\": \"updateStyles\"\n }, {\n \"propName\": \"color\",\n \"methodName\": \"updateStyles\"\n }, {\n \"propName\": \"name\",\n \"methodName\": \"loadIcon\"\n }, {\n \"propName\": \"src\",\n \"methodName\": \"loadIcon\"\n }, {\n \"propName\": \"icon\",\n \"methodName\": \"loadIcon\"\n }];\n }\n}\nconst createColorClasses = (color) => {\n return color\n ? {\n 'pds-color': true,\n [`pds-color-${color}`]: true,\n }\n : null;\n};\n//# sourceMappingURL=pds-icon.js.map\n"],"names":[],"mappings":";;AACA,IAAI,uBAAuB,GAAG,KAAK;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,IAAI,IAAI,EAAE;AACV,IAAI,MAAM,iBAAiB,GAAG,CAAC,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,4BAA4B,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,aAAa;AAC5J;AACA,IAAI,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB;AACtD;AACA,IAAI,MAAM,YAAY,GAAG,mDAAmD;AAC5E,IAAI,MAAM,aAAa,GAAyC,iBAAiB,IAAI,eAAe,IAAI,YAAmB;AAC3H;AACA,IAAI,IAAI,aAAa,CAAC,UAAU,CAAC,+BAA+B,CAAC,IAAI,CAAC,uBAAuB,EAAE;AAC/F,QAAQ,uBAAuB,GAAG,IAAI;AACtC,QAAQ,OAAO,CAAC,IAAI,CAAC;AACrB;AACA,IAAI,CAAC,CAAC;AACN;AACA,IAAI,IAAI,SAAS,GAAG,IAAI;AACxB,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC/B,QAAQ,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AACrC;AACA,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtC,QAAQ,SAAS,GAAG,GAAG,GAAG,SAAS;AACnC;AACA,IAAI,OAAO,aAAa,GAAG,SAAS;A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AE,CAAC,OAAO,CAAC,EAAE,CAAC;;aAEb;;;AAGD,YAAA,EAAE,EAAE;;;IAeZ,WAAW,UAAU,GAAK,EAAA,OAAO,CAAC,KAAK,CAAC,CAAC;;;;;;;;;;AAmJ7C,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAI;AACjC,IAAA,OAAO;AACH,UAAE;AACE,YAAA,WAAW,EAAE,IAAI;AACjB,YAAA,CAAC,CAAa,UAAA,EAAA,KAAK,CAAE,CAAA,GAAG,IAAI;AAC/B;UACC,IAAI;AACd,CAAC;;;;;","x_google_ignoreList":[0,1,2,3,4,5]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{a as assignDescription,m as messageId}from"./form-DTL_39D_.js";import{f as danger}from"./index-
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{a as assignDescription,m as messageId}from"./form-DTL_39D_.js";import{f as danger}from"./index-_4gljHh-.js";import{d as debounceEvent}from"./utils-Dw9B1JDC.js";import{i as inheritAriaAttributes}from"./attributes-C0M1gTKv.js";var pdsInputTokensCss=":host{--pine-input-color-background-danger:var(--pine-color-red-050)}";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsInputCss=":host{display:inline}:host([aria-readonly=true]) input{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-readonly)}.pds-input{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.pds-input__label{-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}.pds-input__field{background:var(--pine-color-background-container);border:1px solid var(--pine-color-border);border-radius:var(--pine-dimension-125);color:var(--pine-color-text-active);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);padding:var(--pine-dimension-xs) var(--pine-dimension-sm);}.pds-input__field:hover:not(:disabled,.is-invalid){border:var(--pine-border-hover)}.pds-input__field:disabled{background-color:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed;}.pds-input__field:disabled::-webkit-input-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-input__field:disabled::-moz-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-input__field:disabled::-moz-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-input__field:disabled:-ms-input-placeholder{color:var(--pine-color-text-placeholder-disabled)}.pds-input__field:hover{border-color:var(--pine-color-border-hover)}.pds-input__field:focus-visible{border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-input__field::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-input__field::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-input__field::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-input__field:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-input__field.is-invalid{background-color:var(--pine-input-color-background-danger);border-color:var(--pine-color-border-danger)}.pds-input__field.is-invalid:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.pds-input__error-message,.pds-input__helper-message{font:var(--pine-typography-body-sm-medium);-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-input__error-message{-ms-flex-align:center;align-items:center;color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}";var PdsInput=function(){function e(e){var i=this;registerInstance(this,e);this.pdsBlur=createEvent(this,"pdsBlur");this.pdsChange=createEvent(this,"pdsChange");this.pdsFocus=createEvent(this,"pdsFocus");this.pdsInput=createEvent(this,"pdsInput");this.inheritedAttributes={};this.isComposing=false;this.type="text";this.value="";this.hasFocus=false;this.onInputEvent=function(e){var r=e.target;if(r){i.value=r.value||""}i.emitInputChange(e)};this.onChangeEvent=function(e){i.emitValueChange(e)};this.onBlurEvent=function(e){i.hasFocus=false;if(i.focusedValue!==i.value){i.emitValueChange(e)}i.pdsBlur.emit(e)};this.onFocusEvent=function(e){i.hasFocus=true;i.focusedValue=i.value;i.pdsFocus.emit(e)};this.onCompositionStart=function(){i.isComposing=true};this.onCompositionEnd=function(){i.isComposing=false}}e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.nativeInput){this.nativeInput.focus()}return[2]}))}))};e.prototype.debounceChanged=function(){var e=this,i=e.pdsInput,r=e.debounce,t=e.originalPdsInput;this.pdsInput=r===undefined?t!==null&&t!==void 0?t:i:debounceEvent(i,r)};e.prototype.valueChanged=function(){var e=this.nativeInput;var i=this.getValue();if(e&&e.value!==i&&!this.isComposing){e.value=i}};e.prototype.getValue=function(){return typeof this.value==="number"?this.value.toString():(this.value||"").toString()};e.prototype.emitValueChange=function(e){var i=this.value;var r=i==null?i:i.toString();this.focusedValue=r;this.pdsChange.emit({value:r,event:e})};e.prototype.emitInputChange=function(e){var i=this.value;var r=i==null?i:i.toString();this.pdsInput.emit({value:r,event:e})};e.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign({},inheritAriaAttributes(this.el))};e.prototype.componentDidLoad=function(){this.debounceChanged()};e.prototype.inputClassNames=function(){var e=["pds-input__field"];if(this.invalid&&this.invalid===true){e.push("is-invalid")}return e.join(" ")};e.prototype.render=function(){var e=this;return h(Host,{key:"6e4e04c4db43e707c0681e878c1b1f73deee86ae","aria-disabled":this.disabled?"true":null,"aria-readonly":this.readonly?"true":null},h("div",{key:"6610ccb16fb657e6d97aca89b21ff2e2bc0e3fe1",class:"pds-input"},this.label&&h("label",{key:"d85cdc84dcd35abcd592e6374e1e3d080f97ab8c",class:"pds-input__label",htmlFor:this.componentId},this.label),h("input",Object.assign({key:"de33a9a5ca6901c9c745fcef9475557cfec1cf91",class:this.inputClassNames(),ref:function(i){return e.nativeInput=i},"aria-describedby":assignDescription(this.componentId,this.invalid,this.helperMessage),"aria-invalid":this.invalid?"true":undefined,autocomplete:this.autocomplete,disabled:this.disabled,id:this.componentId,name:this.name,placeholder:this.placeholder,readOnly:this.readonly,required:this.required,type:this.type,value:this.value,onInput:this.onInputEvent,onChange:this.onChangeEvent,onBlur:this.onBlurEvent,onFocus:this.onFocusEvent,onCompositionstart:this.onCompositionStart,onCompositionend:this.onCompositionEnd},this.inheritedAttributes)),this.helperMessage&&h("p",{key:"0721204043319effd9ce7ee3fd42a81570ffbdcc",class:"pds-input__helper-message",id:messageId(this.componentId,"helper")},this.helperMessage),this.errorMessage&&h("p",{key:"68e71598657e55cb3ca4ad25a23b673bafe1eefb",class:"pds-input__error-message",id:messageId(this.componentId,"error"),"aria-live":"assertive"},h("pds-icon",{key:"9d3969d79ecd3ab4bd2a83ff775409b00f8eb3c9",icon:danger,size:"small"}),this.errorMessage)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{debounce:["debounceChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return e}();PdsInput.style=pdsInputTokensCss+(labelCss+pdsInputCss);export{PdsInput as pds_input};
|
|
2
2
|
//# sourceMappingURL=pds-input.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,h}from"./index-Uh5ntVcq.js";import{l as launch}from"./index-
|
|
1
|
+
import{r as registerInstance,h}from"./index-Uh5ntVcq.js";import{l as launch}from"./index-_4gljHh-.js";var pdsLinkCss=":host{display:inline}:host pds-icon{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs)}.pds-link{-ms-flex-align:center;align-items:center;color:var(--pine-color-text);display:-ms-inline-flexbox;display:inline-flex;font-weight:var(--pine-font-weight-medium)}.pds-link:focus-visible{border-radius:var(--pine-dimension-2xs);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width-thick);position:relative}.pds-link:hover{text-decoration:none}.pds-link--sm{font-size:var(--pine-font-size-body-xs)}.pds-link--sm pds-icon{height:var(--pine-dimension-xs);width:var(--pine-dimension-xs)}.pds-link--md{font-size:var(--pine-font-size-body-sm)}.pds-link--md pds-icon{height:var(--pine-dimension-xs);width:var(--pine-dimension-xs)}.pds-link--lg{font-size:var(--pine-font-size-body-md)}.pds-link--lg pds-icon{height:var(--pine-dimension-sm);width:var(--pine-dimension-sm)}.pds-link--plain{text-decoration:none}.pds-link--plain:hover{color:var(--pine-color-text-hover);text-decoration:underline}";var PdsLink=function(){function i(i){registerInstance(this,i);this.external=false;this.variant="inline";this.fontSize="lg"}i.prototype.classNames=function(){var i=["pds-link"];if(this.fontSize){i.push("pds-link--"+this.fontSize)}if(this.variant){i.push("pds-link--"+this.variant)}return i.join(" ")};i.prototype.render=function(){return h("a",{key:"7ac75452091305e238c20ef1fc2055fe2f34fb04",class:this.classNames(),href:this.href,id:this.componentId,target:this.external?"_blank":undefined,part:"link"},h("slot",{key:"8f21b34931f85867b91e7c6c3fcc1952b9c430cd"},this.href),this.external&&h("pds-icon",{key:"60f1d607df5bf4cac7a9786f1560702719e73ff5",icon:launch,size:this.fontSize}))};return i}();PdsLink.style=pdsLinkCss;export{PdsLink as pds_link};
|
|
2
2
|
//# sourceMappingURL=pds-link.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-link.entry.js","sources":["src/components/pds-link/pds-link.scss?tag=pds-link&encapsulation=shadow","src/components/pds-link/pds-link.tsx"],"sourcesContent":[":host {\n display: inline;\n\n pds-icon {\n margin-inline-start: var(--pine-dimension-2xs);\n }\n}\n\n.pds-link {\n align-items: center;\n color: var(--pine-color-text);\n display: inline-flex;\n font-weight: var(--pine-font-weight-medium);\n\n &:focus-visible {\n border-radius: var(--pine-dimension-2xs);\n outline: var(--pine-outline-focus);\n outline-offset: var(--pine-border-width-thick);\n position: relative;\n }\n}\n\n// We have a small consensus stating that\n// fonts will be REMs, box-model will be\n// discussed later px or (r)em's\n.pds-link--sm {\n font-size: var(--pine-font-size-body-xs);\n\n pds-icon {\n height: var(--pine-dimension-xs);\n width: var(--pine-dimension-xs);\n }\n}\n\n.pds-link--md {\n font-size: var(--pine-font-size-body-sm);\n\n pds-icon {\n height: var(--pine-dimension-xs);\n width: var(--pine-dimension-xs);\n }\n}\n\n.pds-link--lg {\n font-size: var(--pine-font-size-body-md);\n\n pds-icon {\n height: var(--pine-dimension-sm);\n width: var(--pine-dimension-sm);\n }\n}\n\n.pds-link--plain {\n text-decoration: none;\n\n &:hover {\n color: var(--pine-color-text-hover);\n text-decoration: underline;\n }\n}\n
|
|
1
|
+
{"version":3,"file":"pds-link.entry.js","sources":["src/components/pds-link/pds-link.scss?tag=pds-link&encapsulation=shadow","src/components/pds-link/pds-link.tsx"],"sourcesContent":[":host {\n display: inline;\n\n pds-icon {\n margin-inline-start: var(--pine-dimension-2xs);\n }\n}\n\n.pds-link {\n align-items: center;\n color: var(--pine-color-text);\n display: inline-flex;\n font-weight: var(--pine-font-weight-medium);\n\n &:focus-visible {\n border-radius: var(--pine-dimension-2xs);\n outline: var(--pine-outline-focus);\n outline-offset: var(--pine-border-width-thick);\n position: relative;\n }\n\n &:hover {\n text-decoration: none;\n }\n}\n\n// We have a small consensus stating that\n// fonts will be REMs, box-model will be\n// discussed later px or (r)em's\n.pds-link--sm {\n font-size: var(--pine-font-size-body-xs);\n\n pds-icon {\n height: var(--pine-dimension-xs);\n width: var(--pine-dimension-xs);\n }\n}\n\n.pds-link--md {\n font-size: var(--pine-font-size-body-sm);\n\n pds-icon {\n height: var(--pine-dimension-xs);\n width: var(--pine-dimension-xs);\n }\n}\n\n.pds-link--lg {\n font-size: var(--pine-font-size-body-md);\n\n pds-icon {\n height: var(--pine-dimension-sm);\n width: var(--pine-dimension-sm);\n }\n}\n\n.pds-link--plain {\n text-decoration: none;\n\n &:hover {\n color: var(--pine-color-text-hover);\n text-decoration: underline;\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\n\nimport { launch } from '@pine-ds/icons/icons';\n\n/**\n * @part link - Link element styles.\n * @slot (default) - Text content placed between the opening and closing tags. If no text is provided, the **href** will be used as a fallback.\n */\n@Component({\n tag: 'pds-link',\n styleUrls: ['pds-link.scss'],\n shadow: true,\n})\nexport class PdsLink {\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether the link should open in a new tab.\n * @defaultValue false\n */\n @Prop() external = false;\n\n /**\n * Sets the link variant styles.\n * @defaultValue inline\n */\n @Prop() variant: 'inline' | 'plain' = 'inline';\n\n /**\n * The font size of the link's text.\n * @defaultValue lg\n */\n @Prop() fontSize: 'sm' | 'md' | 'lg' = 'lg';\n\n /**\n * The hyperlink's destination URL. If no text is provided in the custom slot, the href will be used.\n */\n @Prop() href!: string;\n\n private classNames() {\n const classNames = ['pds-link'];\n\n if (this.fontSize) {\n classNames.push('pds-link--' + this.fontSize);\n }\n\n if (this.variant) {\n classNames.push('pds-link--' + this.variant);\n }\n\n return classNames.join(' ');\n }\n\n render() {\n\n return (\n <a\n class={this.classNames()}\n href={this.href}\n id={this.componentId}\n target={this.external ? '_blank' : undefined}\n part=\"link\"\n >\n <slot>{this.href}</slot>\n {this.external &&\n <pds-icon icon={launch} size={this.fontSize}></pds-icon>\n }\n </a>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,UAAU,GAAG,khCAAkhC;;MCaxhC,OAAO,GAAA,MAAA;AALpB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAWE;;;AAGG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;;AAGG;AACK,QAAA,IAAO,CAAA,OAAA,GAAuB,QAAQ;AAE9C;;;AAGG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAuB,IAAI;AAsC5C;IA/BS,UAAU,GAAA;AAChB,QAAA,MAAM,UAAU,GAAG,CAAC,UAAU,CAAC;AAE/B,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,UAAU,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;;AAG/C,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,UAAU,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC;;AAG9C,QAAA,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;;IAG7B,MAAM,GAAA;AAEJ,QAAA,QACE,CACE,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,MAAM,EAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,SAAS,EAC5C,IAAI,EAAC,MAAM,EAAA,EAEX,CAAO,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAA,IAAI,CAAC,IAAI,CAAQ,EACvB,IAAI,CAAC,QAAQ;YACZ,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAA,CAAa,CAExD;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-Uh5ntVcq.js";import{m as messageId,a as assignDescription}from"./form-DTL_39D_.js";import{f as danger}from"./index-
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-Uh5ntVcq.js";import{m as messageId,a as assignDescription}from"./form-DTL_39D_.js";import{f as danger}from"./index-_4gljHh-.js";var labelCss=".sc-pds-radio-h{display:inline-block}[aria-disabled=true].sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text-label-disabled)}[aria-readonly=true].sc-pds-radio-h label.sc-pds-radio{color:var(--pine-color-text-label-readonly)}label.sc-pds-radio{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsRadioCss='.sc-pds-radio-h{--sizing-check-size:6px;--sizing-input-size:var(--pine-dimension-sm);--sizing-margin-block-start:6px;-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.is-invalid.sc-pds-radio-h input.sc-pds-radio{border-color:var(--pine-color-border-danger)}.is-invalid.sc-pds-radio-h input.sc-pds-radio:checked{background:var(--pine-color-border-danger)}.is-invalid.sc-pds-radio-h input.sc-pds-radio:checked:hover{background:var(--pine-color-border-danger-hover);border-color:var(--pine-color-border-danger-hover)}.is-invalid.sc-pds-radio-h input.sc-pds-radio:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.is-invalid.sc-pds-radio-h label.sc-pds-radio,.is-invalid.sc-pds-radio-h .pds-radio__message--error.sc-pds-radio{color:var(--pine-color-text-message-danger)}input.sc-pds-radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-border-radius-full);-ms-flex:none;flex:none;height:var(--sizing-input-size);margin:0;-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025);position:relative;width:var(--sizing-input-size)}input.sc-pds-radio:hover{background:var(--pine-color-background-container-hover);border:var(--pine-border-hover)}input.sc-pds-radio:checked{background:var(--pine-color-accent);border-color:var(--pine-color-accent)}input.sc-pds-radio:checked:hover{background:var(--pine-color-accent-hover);border-color:var(--pine-color-accent-hover)}input.sc-pds-radio:checked::after{background:var(--pine-color-background-container);border-radius:var(--pine-border-radius-full);content:"";display:block;height:var(--sizing-check-size);left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:var(--sizing-check-size)}input.sc-pds-radio:disabled{background:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);cursor:not-allowed}input.sc-pds-radio:disabled:checked{background-color:var(--pine-color-accent-disabled);border-color:var(--pine-color-border-disabled)}input.sc-pds-radio:disabled:checked::after{border-color:var(--pine-color-border-disabled)}input.sc-pds-radio:disabled+label.sc-pds-radio{cursor:not-allowed}input.sc-pds-radio:disabled~.pds-radio__message.sc-pds-radio{color:var(--pine-color-text-message-disabled)}input.sc-pds-radio:focus-visible{outline:var(--pine-outline-focus)}label.sc-pds-radio{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-xs)}.visually-hidden.sc-pds-radio{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-radio__message.sc-pds-radio{color:var(--pine-color-text-message);-webkit-margin-before:var(--sizing-margin-block-start);margin-block-start:var(--sizing-margin-block-start);-webkit-margin-start:var(--pine-dimension-md);margin-inline-start:var(--pine-dimension-md);width:100%}.pds-radio__message--error.sc-pds-radio{display:-ms-flexbox;display:flex;font-size:var(--pine-font-size-body-sm);gap:var(--pine-dimension-2xs)}.pds-radio__message--error.sc-pds-radio pds-icon.sc-pds-radio{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}';var PdsRadio=function(){function i(i){var e=this;registerInstance(this,i);this.pdsRadioChange=createEvent(this,"pdsRadioChange");this.checked=false;this.disabled=false;this.invalid=false;this.required=false;this.handleRadioChange=function(i){if(e.disabled){return}var r=i.target;var a=r.checked;e.pdsRadioChange.emit(a)}}i.prototype.classNames=function(){var i=[];if(this.invalid){i.push("is-invalid")}if(this.disabled){i.push("is-disabled")}return i.join(" ")};i.prototype.render=function(){return h(Host,{key:"7366c979970c03d9c6b26d355ba2f14c2e040907",class:this.classNames()},h("label",{key:"c48405dc725f4d7b0a027e66c3b0b04e72843445",htmlFor:this.componentId},h("input",{key:"cd38a200a73572d2f07ada9bc1ec08cae0863044","aria-describedby":assignDescription(this.componentId,this.invalid,this.helperMessage),"aria-invalid":this.invalid?"true":undefined,type:"radio",id:this.componentId,name:this.name,value:this.value,checked:this.checked,required:this.required,disabled:this.disabled,onChange:this.handleRadioChange}),h("span",{key:"a21fb68b4326afb2bf25b08cf6022cd26f3c83ba",class:this.hideLabel?"visually-hidden":""},this.label)),this.helperMessage&&h("div",{key:"b4c201465e085096ac5fac05e43b01cee045310e",class:"pds-radio__message",id:messageId(this.componentId,"helper")},this.helperMessage),this.errorMessage&&h("div",{key:"2c0475efbe1ebedd762de9d432864f5dab8f0448",class:"pds-radio__message pds-radio__message--error",id:messageId(this.componentId,"error"),"aria-live":"assertive"},h("pds-icon",{key:"40ece3a429d9475c17f262d772cdb7332a7089b2",icon:danger,size:"small"}),this.errorMessage))};return i}();PdsRadio.style=labelCss+pdsRadioCss;export{PdsRadio as pds_radio};
|
|
2
2
|
//# sourceMappingURL=pds-radio.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-Uh5ntVcq.js";import{m as messageId}from"./form-DTL_39D_.js";import{f as danger,g as enlarge}from"./index-
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-Uh5ntVcq.js";import{m as messageId}from"./form-DTL_39D_.js";import{f as danger,g as enlarge}from"./index-_4gljHh-.js";var pdsSelectTokensCss=":host{--pine-select-color-background-danger:var(--pine-color-red-050)}";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsSelectCss=':host .hidden,:host :host([hidden]){display:none}.pds-select{display:grid;-ms-flex-direction:column;flex-direction:column;grid-template-areas:"label label" "field field" "message message";grid-template-columns:1fr minmax(2rem, -webkit-min-content);grid-template-columns:1fr minmax(2rem, min-content);grid-template-rows:-webkit-min-content -webkit-min-content -webkit-min-content;grid-template-rows:min-content min-content min-content;position:relative;width:100%}label{grid-area:label;-webkit-margin-after:var(--pine-dimension-2xs);margin-block-end:var(--pine-dimension-2xs)}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-background-container);border:var(--pine-border);border-radius:var(--pine-dimension-125);font:var(--pine-typography-body);grid-area:field;letter-spacing:var(--pine-letter-spacing);padding:var(--pine-dimension-xs) var(--pine-dimension-150);-webkit-padding-end:var(--pine-dimension-450);padding-inline-end:var(--pine-dimension-450);position:relative}select:hover{border-color:var(--pine-color-border-hover);cursor:pointer}select:focus-visible{border-color:var(--pine-color-border-active);outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}select:disabled{background-color:var(--pine-color-background-container-disabled);border-color:var(--pine-color-border-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}select:has(~.pds-select__message .pds-select__error-message){background-color:var(--pine-select-color-background-danger);border-color:var(--pine-color-border-danger)}select:has(~.pds-select__message .pds-select__error-message):focus-visible{outline-color:var(--pine-color-focus-ring-danger)}:host(.is-invalid) select{background-color:var(--pine-select-color-background-danger);border-color:var(--pine-color-border-danger)}:host(.is-invalid) select:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.pds-select__error-message,.pds-select__helper-message{font:var(--pine-typography-body-sm-medium);-webkit-margin-after:0;margin-block-end:0;-webkit-margin-before:var(--pine-dimension-2xs);margin-block-start:var(--pine-dimension-2xs)}.pds-select__error-message{-ms-flex-align:center;align-items:center;color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-select__message{grid-area:message}.pds-select__select-icon{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;grid-column:-1/-2;grid-row:2/3;height:2.5rem;pointer-events:none;position:relative;z-index:1}';var PdsSelect=function(){function e(e){var r=this;registerInstance(this,e);this.pdsSelectChange=createEvent(this,"pdsSelectChange");this.disabled=false;this.multiple=false;this.required=false;this.onSelectUpdate=function(e){var i=e.target;var s=Array.from(i.options).filter((function(e){return e.selected})).map((function(e){return e.value}));if(s.length===1&&!r.multiple){r.value=s[0]}else{r.value=s}r.pdsSelectChange.emit(e)};this.handleSlotChange=function(){var e=r.slotContainer.querySelector("slot");r.selectEl.innerHTML="";var i=e.assignedElements({flatten:true});i.forEach((function(e){if(["OPTION","OPTGROUP"].includes(e.tagName)){var i=e.cloneNode(true);if(i.tagName==="OPTION"&&i.value===r.value){i.selected=true}r.selectEl.appendChild(i)}}));r.updateSelectedOption()}}e.prototype.valueChanged=function(){this.updateSelectedOption()};e.prototype.componentWillLoad=function(){this.updateSelectedOption()};e.prototype.updateSelectedOption=function(){var e=this;if(this.selectEl){var r=this.selectEl.options;Array.from(r).map((function(r){if(Array.isArray(e.value)){r.selected=e.value.includes(r.value)}else{r.selected=e.value===r.value}}))}};e.prototype.getHelperMessage=function(){return this.helperMessage&&h("p",{class:"pds-select__helper-message",id:messageId(this.componentId,"helper")},this.helperMessage)};e.prototype.getErrorMessage=function(){return this.errorMessage&&h("p",{class:"pds-select__error-message",id:messageId(this.componentId,"error"),"aria-live":"assertive"},h("pds-icon",{icon:danger,size:"small"}),this.errorMessage)};e.prototype.renderMessages=function(){if(!this.helperMessage&&!this.errorMessage)return null;return h("div",{class:"pds-select__message"},this.getHelperMessage(),this.getErrorMessage())};e.prototype.classNames=function(){var e=[];if(this.invalid){e.push("is-invalid")}if(this.disabled){e.push("is-disabled")}return e.join(" ")};e.prototype.render=function(){var e=this;return h(Host,{key:"6eea9a5492e4b7e415922bce0aa8f2295792a9e4","aria-disabled":this.disabled?"true":null,class:this.classNames()},h("div",{key:"3180e1eff494f846f395d9db6730926d86d1e54a",class:"pds-select"},this.label&&h("label",{key:"90dc521ef10b81a9f58a0f0a2cfa4bc685312119",htmlFor:this.componentId},this.label),h("select",{key:"d6576d25601de6c41893568927b64e530bf9f266",autocomplete:this.autocomplete||undefined,class:"pds-select__field",disabled:this.disabled,id:this.componentId,multiple:this.multiple,name:this.name,onChange:this.onSelectUpdate,required:this.required,ref:function(r){return e.selectEl=r}}),h("div",{key:"87c53bb7bf315e170f60e5b58afcbf623d1aa65c","aria-hidden":"true",class:"hidden",ref:function(r){return e.slotContainer=r}},h("slot",{key:"8cafbc8cc8e23de0ab69b9d6b7d23c896df530b6",onSlotchange:this.handleSlotChange})),this.renderMessages(),!this.multiple&&h("pds-icon",{key:"48758d321edbd38ff6bd31ddd1902627202e196e",class:"pds-select__select-icon",icon:enlarge})))};Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return e}();PdsSelect.style=pdsSelectTokensCss+(labelCss+pdsSelectCss);export{PdsSelect as pds_select};
|
|
2
2
|
//# sourceMappingURL=pds-select.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{h as handle}from"./index-
|
|
1
|
+
import{r as registerInstance,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{h as handle}from"./index-_4gljHh-.js";var pdsSortableItemCss=".pds-sortable-item.sc-pds-sortable-item-h{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;padding-block:var(--pine-dimension-xs);padding-inline:var(--pine-dimension-md)}.pds-sortable-item.sc-pds-sortable-item-h .pds-sortable-item__actions.sc-pds-sortable-item{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-padding-start:var(--pine-dimension-md);padding-inline-start:var(--pine-dimension-md)}.pds-sortable-item.sc-pds-sortable-item-h .pds-sortable-item__handle.sc-pds-sortable-item{line-height:1;-webkit-margin-end:var(--pine-dimension-md);margin-inline-end:var(--pine-dimension-md)}.pds-sortable--bordered .pds-sortable-item.sc-pds-sortable-item-h:first-child{border-start-end-radius:calc(var(--pine-dimension-xs) * 1.25);border-start-start-radius:calc(var(--pine-dimension-xs) * 1.25)}.pds-sortable--bordered .pds-sortable-item.sc-pds-sortable-item-h:last-child{border-end-end-radius:calc(var(--pine-dimension-xs) * 1.25);border-end-start-radius:calc(var(--pine-dimension-xs) * 1.25)}.pds-sortable--divided .pds-sortable-item.sc-pds-sortable-item-h{-webkit-border-after:var(--pine-border);border-block-end:var(--pine-border)}.pds-sortable--divided .pds-sortable-item.sc-pds-sortable-item-h:last-child{-webkit-border-after:0;border-block-end:0}.pds-sortable--handle-type-row .pds-sortable-item.sc-pds-sortable-item-h{cursor:-webkit-grab;cursor:grab}.pds-sortable--handle-type-handle .pds-sortable-item.sc-pds-sortable-item-h .pds-sortable-item__handle.sc-pds-sortable-item{cursor:-webkit-grab;cursor:grab}.pds-sortable-item.sc-pds-sortable-item-h:hover{background-color:var(--pine-color-background-container-hover)}.pds-sortable-item.sc-pds-sortable-item-h:hover pds-icon.sc-pds-sortable-item{color:var(--pine-color-info)}.pds-sortable-item--drag.sc-pds-sortable-item-h{background-color:var(--pine-color-background-container);border-radius:0;-webkit-box-shadow:var(--pine-box-shadow-400);box-shadow:var(--pine-box-shadow-400);opacity:1}.pds-sortable-item--ghost.sc-pds-sortable-item-h{background-color:var(--pine-color-background-container-hover);border-radius:0}";var PdsSortableItem=function(){function e(e){registerInstance(this,e);this.enableActions=false;this.showHandle=false}e.prototype.componentWillRender=function(){this.sortableRef=this.el.closest("pds-sortable");if(this.sortableRef&&this.sortableRef.handleType==="handle"){this.showHandle=true}};e.prototype.render=function(){return h(Host,{key:"1a5e7d46d027bf6aa95b9d688e390ab42a40cc8d",class:"pds-sortable-item",id:this.componentId},this.showHandle&&h("div",{key:"a6653d963a7a8f39937507dd94042943b4627686",class:"pds-sortable-item__handle"},h("pds-icon",{key:"a5c340eaf2f3f4d3fb4a0cc66371444d8844b078",icon:handle})),h("slot",{key:"647f24778a2450c040596c6bea279236b0148e0f"}),this.enableActions&&h("div",{key:"7b8c76b0519c21fe0bd29cb5ef3f213296f30ef4",class:"pds-sortable-item__actions"},h("slot",{key:"636480cd939b04ed739a2e6a7dbc489680a18a57",name:"sortable-item-actions"})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsSortableItem.style=pdsSortableItemCss;export{PdsSortableItem as pds_sortable_item};
|
|
2
2
|
//# sourceMappingURL=pds-sortable-item.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{m as messageId,a as assignDescription}from"./form-DTL_39D_.js";import{f as danger}from"./index-
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{m as messageId,a as assignDescription}from"./form-DTL_39D_.js";import{f as danger}from"./index-_4gljHh-.js";import{i as inheritAriaAttributes}from"./attributes-C0M1gTKv.js";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsSwitchCss=':host{--sizing-input-toggle-size:calc(var(--pine-dimension-250) - (var(--pine-dimension-025) * 2));--pine-dimension-025:2px;--spacing-message-inline:calc(var(--pine-dimension-450) + var(--pine-dimension-150));--number-transition-timing:0.15s ease-out;-ms-flex-align:start;align-items:flex-start;color:var(--pine-color-text);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-flow:row wrap;flex-flow:row wrap;position:relative}:host(.pds-switch--error){color:var(--pine-color-text-message-danger)}:host(.pds-switch--error) input,:host(.pds-switch--error) input:checked,:host(.pds-switch--error) input:hover:not(:disabled):not(:checked){background-color:var(--pine-color-danger)}:host(.pds-switch--error) input:focus-visible:not(:disabled):not(:checked){outline-color:var(--pine-color-focus-ring-danger)}:host(.pds-switch--error) label{color:var(--color-text-error)}input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-neutral);border:0;border-radius:var(--pine-dimension-sm);cursor:pointer;display:inline-block;-ms-flex-negative:0;flex-shrink:0;height:var(--pine-dimension-250);margin:0;padding:0;position:relative;-webkit-transition:var(--number-transition-timing);transition:var(--number-transition-timing);-webkit-transition-property:background, border, color;transition-property:background, border, color;width:var(--pine-dimension-450)}input::after{background:var(--pine-color-secondary);border-radius:var(--pine-border-radius-full);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);content:"";display:block;height:var(--sizing-input-toggle-size);inset-block-start:50%;inset-inline-start:50%;position:absolute;-webkit-transform:translate3d(-100%, -50%, 0);transform:translate3d(-100%, -50%, 0);-webkit-transition:-webkit-transform var(--number-transition-timing);transition:-webkit-transform var(--number-transition-timing);transition:transform var(--number-transition-timing);transition:transform var(--number-transition-timing), -webkit-transform var(--number-transition-timing);width:var(--sizing-input-toggle-size)}label{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-150)}.pds-switch--error label{color:inherit}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-switch__message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-xs);margin-block-start:var(--pine-dimension-xs);-webkit-margin-start:var(--spacing-message-inline);margin-inline-start:var(--spacing-message-inline);width:100%}.pds-switch__message+.pds-switch__message{-webkit-margin-before:var(--spacing-message-inline);margin-block-start:var(--spacing-message-inline)}.pds-switch__message--error{color:inherit;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-switch__message--error pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}input:disabled{background-color:var(--pine-color-neutral-disabled);cursor:not-allowed}input:disabled~label{cursor:initial}input:disabled:hover::after{background-color:var(--pine-color-background-container-disabled)}input:disabled .pds-switch__message{color:initial}input:hover:not(:disabled){background-color:var(--pine-color-neutral-hover)}input:focus-visible:not(:disabled){outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}input:checked::after{-webkit-transform:translate3d(0, -50%, 0);transform:translate3d(0, -50%, 0)}input:checked:not(:disabled){background-color:currentColor;color:var(--pine-color-accent)}input:checked:not(:disabled):hover{border-color:currentColor;color:var(--pine-color-accent-hover)}';var PdsSwitch=function(){function e(e){var i=this;registerInstance(this,e);this.pdsSwitchChange=createEvent(this,"pdsSwitchChange");this.inheritedAttributes={};this.checked=false;this.disabled=false;this.invalid=false;this.required=false;this.onSwitchUpdate=function(e){if(i.disabled)return;var r=e.target;i.checked=r.checked;i.pdsSwitchChange.emit(e)};this.switchClassNames=function(){var e="pds-switch";if(i.invalid===true){e+=" pds-switch--error"}if(i.helperMessage!==undefined){e+=" pds-switch--message"}return e}}e.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign({},inheritAriaAttributes(this.el))};e.prototype.render=function(){return h(Host,{key:"1ccbfafc2087558aae2fe82c9a97c640a9c3ab66",class:this.switchClassNames(),"aria-disabled":this.disabled?"true":null},h("label",{key:"9cd218cace5c432f57f03514c91c27ba32eeb97f",htmlFor:this.componentId},h("input",Object.assign({key:"ce995e0706a576dd36a4f1b31ca862ae614f7e2d","aria-describedby":assignDescription(this.componentId,this.invalid,this.errorMessage||this.helperMessage),"aria-invalid":this.invalid?"true":undefined,checked:this.checked,class:"pds-switch__input",disabled:this.disabled,id:this.componentId,name:this.name?this.name:this.componentId,onChange:this.onSwitchUpdate,required:this.required,type:"checkbox",value:this.value},this.inheritedAttributes)),h("span",{key:"ea20d65944a429e24b8bd0ae58dafd7ece29e9a7",class:this.hideLabel?"visually-hidden":""},this.label)),this.helperMessage&&h("div",{key:"45656b263c5169d0c6b60dd19e8537e0f12df342",class:"pds-switch__message",id:messageId(this.componentId,"helper")},this.helperMessage),this.errorMessage&&h("div",{key:"53ca563b419ce20ff4f4c81c90eee8f687e355b8",class:"pds-switch__message pds-switch__message--error",id:messageId(this.componentId,"error"),"aria-live":"assertive"},h("pds-icon",{key:"b8e38204aea3e9e1c542d5c945f57d389d800b66",icon:danger,size:"small"}),this.errorMessage))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsSwitch.style=labelCss+pdsSwitchCss;export{PdsSwitch as pds_switch};
|
|
2
2
|
//# sourceMappingURL=pds-switch.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-switch.entry.js","sources":["src/global/styles/utils/label.scss?tag=pds-switch&encapsulation=shadow","src/components/pds-switch/pds-switch.scss?tag=pds-switch&encapsulation=shadow","src/components/pds-switch/pds-switch.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n:host([aria-disabled=\"true\"]) label {\n color: var(--pine-color-text-label-disabled);\n}\n\n:host([aria-readonly=\"true\"]) {\n label {\n color: var(--pine-color-text-label-readonly);\n }\n}\n\nlabel {\n color: var(--pine-color-text-label);\n font: var(--pine-typography-body-medium);\n letter-spacing: var(--pine-letter-spacing);\n}\n",":host {\n// Need discussions\n --sizing-input-toggle-size: calc(var(--pine-dimension-250) - (var(--pine-dimension-025) * 2));\n --pine-dimension-025: 2px;\n --spacing-message-inline: calc(var(--pine-dimension-450) + var(--pine-dimension-150));\n --number-transition-timing: 0.15s ease-out;\n\n align-items: flex-start;\n color: var(--pine-color-text);\n display: inline-flex;\n flex-flow: row wrap;\n position: relative;\n}\n\n:host(.pds-switch--error) {\n color: var(--pine-color-text-message-danger);\n\n input,\n input:checked,\n input:hover:not(:disabled):not(:checked) {\n background-color: var(--pine-color-danger);\n }\n\n input:focus-visible:not(:disabled):not(:checked) {\n outline-color: var(--pine-color-focus-ring-danger);\n }\n\n label {\n color: var(--color-text-error);\n }\n}\n\n// switch container\ninput {\n appearance: none;\n background: var(--pine-color-neutral);\n border: 0;\n border-radius: var(--pine-dimension-sm);\n cursor: pointer;\n display: inline-block;\n flex-shrink: 0;\n height: var(--pine-dimension-250);\n margin: 0;\n padding: 0;\n position: relative;\n transition: var(--number-transition-timing);\n transition-property: background, border, color;\n width: var(--pine-dimension-450);\n\n // switch toggle\n &::after {\n background: var(--pine-color-secondary);\n border-radius: var(--pine-border-radius-full);\n box-shadow: var(--pine-box-shadow);\n content: \"\";\n display: block;\n height: var(--sizing-input-toggle-size);\n inset-block-start: 50%;\n inset-inline-start: 50%;\n position: absolute;\n transform: translate3d(-100%, -50%, 0);\n transition: transform var(--number-transition-timing);\n width: var(--sizing-input-toggle-size);\n }\n}\n\nlabel {\n display: flex;\n gap: var(--pine-dimension-150);\n\n .pds-switch--error & {\n color: inherit;\n }\n}\n\n.visually-hidden {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: polygon(0 0, 0 0, 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n// Help and error messages\n.pds-switch__message {\n color: var(--pine-color-text-message);\n font: var(--pine-typography-body-sm-medium);\n margin-block-start: var(--pine-dimension-xs);\n margin-inline-start: var(--spacing-message-inline);\n width: 100%;\n\n + .pds-switch__message {\n margin-block-start: var(--spacing-message-inline);\n }\n}\n\n.pds-switch__message--error {\n color: inherit;\n display: flex;\n gap: var(--pine-dimension-2xs);\n\n pds-icon {\n margin-block-start: var(--pine-dimension-025);\n }\n}\n\n// Disabled state\ninput:disabled {\n background-color: var(--pine-color-neutral-disabled);\n cursor: not-allowed;\n\n ~ label {\n cursor: initial;\n }\n\n &:hover::after {\n background-color: var(--pine-color-background-container-disabled);\n }\n\n .pds-switch__message {\n color: initial;\n }\n}\n\n// Hover state\ninput:hover:not(:disabled) {\n background-color: var(--pine-color-neutral-hover);\n}\n\n // Focus state\ninput:focus-visible:not(:disabled) {\n outline: var(--pine-outline-focus);\n outline-offset: var(--pine-border-width);\n}\n\n// 'Checked' state\n// switch toggle\ninput:checked::after {\n transform: translate3d(0, -50%, 0);\n}\n\n// switch container\ninput:checked:not(:disabled) {\n background-color: currentColor;\n color: var(--pine-color-accent);\n\n &:hover {\n border-color: currentColor;\n color: var(--pine-color-accent-hover);\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { danger } from '@pine-ds/icons/icons';\n\n@Component({\n tag: 'pds-switch',\n styleUrls: ['../../global/styles/utils/label.scss', 'pds-switch.scss'],\n shadow: true,\n})\nexport class PdsSwitch {\n @Element() el: HTMLPdsSwitchElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute and the label `for` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Determines the input 'checked' state.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Determines the input 'disabled' state, preventing user interaction.\n */\n @Prop() disabled? = false;\n\n /**\n * Displays message text describing an invalid state.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Visually hides the label text for instances where only the switch should be displayed. Label remains accessible to assistive technology such as screen readers.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * Displays help text for additional description of an input.\n */\n @Prop() helperMessage: string;\n\n /**\n * Determines the input 'invalid' state, signifying an error is present.\n */\n @Prop() invalid? = false;\n\n /**\n * Displays text to describe the input.\n */\n @Prop() label!: string;\n\n /**\n * Identifies form data and unifies a group of radio inputs for toggling a single property/value.\n */\n @Prop() name: string;\n\n /**\n * Determines the 'required' state of the input.\n */\n @Prop() required? = false;\n\n /**\n * Provides input with a string submitted in form data.\n */\n @Prop() value: string;\n\n /**\n * Emits an event on input change.\n */\n @Event() pdsSwitchChange: EventEmitter<InputEvent>;\n\n private onSwitchUpdate = (e: Event) => {\n if (this.disabled) return;\n\n const input = e.target as HTMLInputElement;\n this.checked = input.checked;\n this.pdsSwitchChange.emit(e as InputEvent);\n };\n\n private switchClassNames = () => {\n let switchClasses = `pds-switch`;\n\n if (this.invalid === true) {\n switchClasses += \" pds-switch--error\";\n }\n if (this.helperMessage !== undefined) {\n switchClasses += \" pds-switch--message\";\n }\n return switchClasses;\n };\n\n render() {\n return (\n <Host class={this.switchClassNames()} aria-disabled={this.disabled ? 'true' : null}>\n <label htmlFor={this.componentId}>\n <input\n aria-describedby={assignDescription(this.componentId, this.invalid, this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n checked={this.checked}\n class=\"pds-switch__input\"\n disabled={this.disabled}\n id={this.componentId}\n name={this.name ? this.name : this.componentId}\n onChange={this.onSwitchUpdate}\n required={this.required}\n type=\"checkbox\"\n value={this.value}\n />\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n {this.helperMessage &&\n <div\n class={`pds-switch__message`}\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </div>\n }\n {this.errorMessage &&\n <div\n class={`pds-switch__message pds-switch__message--error`}\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </div>\n }\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;AAAA,MAAM,QAAQ,GAAG,oTAAoT;;ACArU,MAAM,YAAY,GAAG,gwHAAgwH;;MCSxwH,SAAS,GAAA,MAAA;AALtB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAaE;;AAEG;AACsB,QAAA,IAAO,CAAA,OAAA,GAAG,KAAK;AAExC;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAI,KAAK;AAiBzB;;AAEG;AACK,QAAA,IAAO,CAAA,OAAA,GAAI,KAAK;AAYxB;;AAEG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAI,KAAK;AAYjB,QAAA,IAAA,CAAA,cAAc,GAAG,CAAC,CAAQ,KAAI;YACpC,IAAI,IAAI,CAAC,QAAQ;gBAAE;AAEnB,YAAA,MAAM,KAAK,GAAG,CAAC,CAAC,MAA0B;AAC1C,YAAA,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO;AAC5B,YAAA,IAAI,CAAC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AA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAE,IAAI,CAAC,SAAS,GAAG,iBAAiB,GAAG,EAAE,EAAA,EACjD,IAAI,CAAC,KAAK,CACN,CACD,EACP,IAAI,CAAC,aAAa;AACjB,YAAA,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE,CAAqB,mBAAA,CAAA,EAC5B,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,IAExC,IAAI,CAAC,aAAa,CACf,EAEP,IAAI,CAAC,YAAY;YAChB,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE,CAAgD,8CAAA,CAAA,EACvD,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,eAC9B,WAAW,EAAA,EAErB,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,EAAG,CAAA,EACtC,IAAI,CAAC,YAAY,CACd,CAEH;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"pds-switch.entry.js","sources":["src/global/styles/utils/label.scss?tag=pds-switch&encapsulation=shadow","src/components/pds-switch/pds-switch.scss?tag=pds-switch&encapsulation=shadow","src/components/pds-switch/pds-switch.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n:host([aria-disabled=\"true\"]) label {\n color: var(--pine-color-text-label-disabled);\n}\n\n:host([aria-readonly=\"true\"]) {\n label {\n color: var(--pine-color-text-label-readonly);\n }\n}\n\nlabel {\n color: var(--pine-color-text-label);\n font: var(--pine-typography-body-medium);\n letter-spacing: var(--pine-letter-spacing);\n}\n",":host {\n// Need discussions\n --sizing-input-toggle-size: calc(var(--pine-dimension-250) - (var(--pine-dimension-025) * 2));\n --pine-dimension-025: 2px;\n --spacing-message-inline: calc(var(--pine-dimension-450) + var(--pine-dimension-150));\n --number-transition-timing: 0.15s ease-out;\n\n align-items: flex-start;\n color: var(--pine-color-text);\n display: inline-flex;\n flex-flow: row wrap;\n position: relative;\n}\n\n:host(.pds-switch--error) {\n color: var(--pine-color-text-message-danger);\n\n input,\n input:checked,\n input:hover:not(:disabled):not(:checked) {\n background-color: var(--pine-color-danger);\n }\n\n input:focus-visible:not(:disabled):not(:checked) {\n outline-color: var(--pine-color-focus-ring-danger);\n }\n\n label {\n color: var(--color-text-error);\n }\n}\n\n// switch container\ninput {\n appearance: none;\n background: var(--pine-color-neutral);\n border: 0;\n border-radius: var(--pine-dimension-sm);\n cursor: pointer;\n display: inline-block;\n flex-shrink: 0;\n height: var(--pine-dimension-250);\n margin: 0;\n padding: 0;\n position: relative;\n transition: var(--number-transition-timing);\n transition-property: background, border, color;\n width: var(--pine-dimension-450);\n\n // switch toggle\n &::after {\n background: var(--pine-color-secondary);\n border-radius: var(--pine-border-radius-full);\n box-shadow: var(--pine-box-shadow);\n content: \"\";\n display: block;\n height: var(--sizing-input-toggle-size);\n inset-block-start: 50%;\n inset-inline-start: 50%;\n position: absolute;\n transform: translate3d(-100%, -50%, 0);\n transition: transform var(--number-transition-timing);\n width: var(--sizing-input-toggle-size);\n }\n}\n\nlabel {\n display: flex;\n gap: var(--pine-dimension-150);\n\n .pds-switch--error & {\n color: inherit;\n }\n}\n\n.visually-hidden {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: polygon(0 0, 0 0, 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n// Help and error messages\n.pds-switch__message {\n color: var(--pine-color-text-message);\n font: var(--pine-typography-body-sm-medium);\n margin-block-start: var(--pine-dimension-xs);\n margin-inline-start: var(--spacing-message-inline);\n width: 100%;\n\n + .pds-switch__message {\n margin-block-start: var(--spacing-message-inline);\n }\n}\n\n.pds-switch__message--error {\n color: inherit;\n display: flex;\n gap: var(--pine-dimension-2xs);\n\n pds-icon {\n margin-block-start: var(--pine-dimension-025);\n }\n}\n\n// Disabled state\ninput:disabled {\n background-color: var(--pine-color-neutral-disabled);\n cursor: not-allowed;\n\n ~ label {\n cursor: initial;\n }\n\n &:hover::after {\n background-color: var(--pine-color-background-container-disabled);\n }\n\n .pds-switch__message {\n color: initial;\n }\n}\n\n// Hover state\ninput:hover:not(:disabled) {\n background-color: var(--pine-color-neutral-hover);\n}\n\n // Focus state\ninput:focus-visible:not(:disabled) {\n outline: var(--pine-outline-focus);\n outline-offset: var(--pine-border-width);\n}\n\n// 'Checked' state\n// switch toggle\ninput:checked::after {\n transform: translate3d(0, -50%, 0);\n}\n\n// switch container\ninput:checked:not(:disabled) {\n background-color: currentColor;\n color: var(--pine-color-accent);\n\n &:hover {\n border-color: currentColor;\n color: var(--pine-color-accent-hover);\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { danger } from '@pine-ds/icons/icons';\n\nimport { inheritAriaAttributes } from '@utils/attributes';\nimport type { Attributes } from '@utils/attributes';\n\n@Component({\n tag: 'pds-switch',\n styleUrls: ['../../global/styles/utils/label.scss', 'pds-switch.scss'],\n shadow: true,\n})\nexport class PdsSwitch {\n private inheritedAttributes: Attributes = {};\n\n @Element() el: HTMLPdsSwitchElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute and the label `for` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Determines the input 'checked' state.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Determines the input 'disabled' state, preventing user interaction.\n */\n @Prop() disabled? = false;\n\n /**\n * Displays message text describing an invalid state.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Visually hides the label text for instances where only the switch should be displayed. Label remains accessible to assistive technology such as screen readers.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * Displays help text for additional description of an input.\n */\n @Prop() helperMessage: string;\n\n /**\n * Determines the input 'invalid' state, signifying an error is present.\n */\n @Prop() invalid? = false;\n\n /**\n * Displays text to describe the input.\n */\n @Prop() label!: string;\n\n /**\n * Identifies form data and unifies a group of radio inputs for toggling a single property/value.\n */\n @Prop() name: string;\n\n /**\n * Determines the 'required' state of the input.\n */\n @Prop() required? = false;\n\n /**\n * Provides input with a string submitted in form data.\n */\n @Prop() value: string;\n\n /**\n * Emits an event on input change.\n */\n @Event() pdsSwitchChange: EventEmitter<InputEvent>;\n\n private onSwitchUpdate = (e: Event) => {\n if (this.disabled) return;\n\n const input = e.target as HTMLInputElement;\n this.checked = input.checked;\n this.pdsSwitchChange.emit(e as InputEvent);\n };\n\n private switchClassNames = () => {\n let switchClasses = `pds-switch`;\n\n if (this.invalid === true) {\n switchClasses += \" pds-switch--error\";\n }\n if (this.helperMessage !== undefined) {\n switchClasses += \" pds-switch--message\";\n }\n return switchClasses;\n };\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n }\n }\n\n render() {\n return (\n <Host class={this.switchClassNames()} aria-disabled={this.disabled ? 'true' : null}>\n <label htmlFor={this.componentId}>\n <input\n aria-describedby={assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n checked={this.checked}\n class=\"pds-switch__input\"\n disabled={this.disabled}\n id={this.componentId}\n name={this.name ? this.name : this.componentId}\n onChange={this.onSwitchUpdate}\n required={this.required}\n type=\"checkbox\"\n value={this.value}\n {...this.inheritedAttributes}\n />\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n {this.helperMessage &&\n <div\n class={`pds-switch__message`}\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </div>\n }\n {this.errorMessage &&\n <div\n class={`pds-switch__message pds-switch__message--error`}\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </div>\n }\n </Host>\n );\n }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Aa,CACf,EAEP,IAAI,CAAC,YAAY;YAChB,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAE,CAAgD,8CAAA,CAAA,EACvD,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,eAC9B,WAAW,EAAA,EAErB,CAAA,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,EAAG,CAAA,EACtC,IAAI,CAAC,YAAY,CACd,CAEH;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{e as upSmall,d as downSmall}from"./index-
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{e as upSmall,d as downSmall}from"./index-_4gljHh-.js";var pdsTableHeadCellCss=":host{--border-head-cell-default:var(--pine-border-width-thin) solid var(--pine-color-grey-100);--box-shadow-default:3px 3px 6px -2px rgba(0, 0, 0, 0.1);-webkit-border-after:var(--border-head-cell-default);border-block-end:var(--border-head-cell-default);color:var(--pine-color-text);display:table-cell;font-family:var(--pine-font-family-body);font-size:var(--pine-font-size);font-weight:var(--pine-font-weight-regular);line-height:var(--pine-line-height-body);padding:12px;text-align:start;vertical-align:inherit}:host(.is-compact){padding-block:var(--pine-dimension-2xs)}:host(.is-fixed){background:var(--pine-color-background-container);left:var(--pine-dimension-none);position:-webkit-sticky;position:sticky;z-index:1}:host(.has-scrolled.is-fixed){-webkit-box-shadow:var(--box-shadow-default);box-shadow:var(--box-shadow-default)}:host(.is-sortable){cursor:pointer}:host(.is-sortable) pds-icon{-webkit-margin-start:var(--pine-dimension-2xs);margin-inline-start:var(--pine-dimension-2xs);-webkit-padding-before:2px;padding-block-start:2px;position:absolute}:host(.is-sortable:hover),:host(.is-active){color:var(--pine-color-text-active)}";var PdsTableHeadCell=function(){function e(e){var t=this;registerInstance(this,e);this.pdsTableSort=createEvent(this,"pdsTableSort");this.sortingDirection="asc";this.tableScrolling=false;this.isSelected=false;this.handleScroll=function(){if(t.tableRef.scrollLeft>0){t.tableScrolling=true}else{t.tableScrolling=false}};this.toggleSort=function(){if(t.sortable){var e=t.hostElement.innerText.trim();t.sortingDirection=t.sortingDirection==="asc"?"desc":"asc";t.tableRef.querySelectorAll("pds-table-head-cell").forEach((function(e){e.classList.remove("is-active")}));t.hostElement.classList.toggle("is-active");t.pdsTableSort.emit({column:e,direction:t.sortingDirection})}}}e.prototype.componentWillRender=function(){this.tableRef=this.hostElement.closest("pds-table")};e.prototype.componentDidLoad=function(){if(this.tableRef&&this.tableRef.responsive&&this.tableRef.fixedColumn){this.tableRef.addEventListener("scroll",this.handleScroll)}};e.prototype.classNames=function(){var e=[];if(this.tableRef&&this.tableRef.compact){e.push("is-compact")}if(this.sortable){e.push("is-sortable")}if(this.sortable&&this.sortingDirection!==null){e.push("sort-"+this.sortingDirection)}if(this.tableRef&&this.tableRef.fixedColumn&&this.tableScrolling){e.push("has-scrolled")}return e.join(" ")};e.prototype.render=function(){return h(Host,{key:"8b7b8472a8e7f05e8f5b3c7cc3de2cd45c7f3f57",class:this.classNames(),role:"columnheader",onClick:this.toggleSort,style:this.tableRef&&this.tableRef.fixedColumn&&this.tableRef.selectable?{"--fixed-cell-position":"40px"}:{}},h("slot",{key:"86266623f850b38494eb9f2cbca9baf54e082d7e"}),this.sortable&&h("pds-icon",{key:"e1e7f058ecab154e50ae3200b75de55244b31428",icon:this.sortingDirection==="asc"?upSmall:downSmall}))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PdsTableHeadCell.style=pdsTableHeadCellCss;export{PdsTableHeadCell as pds_table_head_cell};
|
|
2
2
|
//# sourceMappingURL=pds-table-head-cell.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{i as isRequired,a as assignDescription,m as messageId}from"./form-DTL_39D_.js";import{d as debounceEvent}from"./utils-Dw9B1JDC.js";import{i as inheritAriaAttributes,a as inheritAttributes}from"./attributes-C0M1gTKv.js";import{f as danger}from"./index-
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-Uh5ntVcq.js";import{i as isRequired,a as assignDescription,m as messageId}from"./form-DTL_39D_.js";import{d as debounceEvent}from"./utils-Dw9B1JDC.js";import{i as inheritAriaAttributes,a as inheritAttributes}from"./attributes-C0M1gTKv.js";import{f as danger}from"./index-_4gljHh-.js";var labelCss=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var pdsInputTokensCss=":host{--pine-input-color-background-danger:var(--pine-color-red-050)}";var pdsTextareaCss=":host{display:inline}:host([aria-readonly=true]) textarea{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-readonly)}.pds-textarea{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}label{display:block;-webkit-margin-after:var(--pine-dimension-xs);margin-block-end:var(--pine-dimension-xs)}.pds-textarea__field{background-color:var(--pine-color-background-container);border:var(--pine-border);border-radius:calc(var(--pine-dimension-xs) * 1.25);font:var(--pine-typography-body);letter-spacing:var(--pine-letter-spacing);padding:var(--pine-dimension-xs) var(--pine-dimension-sm)}.pds-textarea__field:hover:not(:disabled,.is-invalid){border:var(--pine-border-hover)}.pds-textarea__field:disabled{background-color:var(--pine-color-background-container-disabled);color:var(--pine-color-text-disabled);cursor:not-allowed}.pds-textarea__field:focus-visible{outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}.pds-textarea__field::-webkit-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::-moz-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field:-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::-ms-input-placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field::placeholder{color:var(--pine-color-text-placeholder)}.pds-textarea__field.is-invalid{background-color:var(--pine-input-color-background-danger);border-color:var(--pine-color-border-danger)}.pds-textarea__field.is-invalid:focus-visible{outline-color:var(--pine-color-focus-ring-danger)}.pds-textarea__error-message,.pds-textarea__helper-message{font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-xs);margin-block-start:var(--pine-dimension-xs)}.pds-textarea__error-message{-ms-flex-align:center;align-items:center;color:var(--pine-color-text-message-danger);display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}";var PdsTextarea=function(){function e(e){var t=this;registerInstance(this,e);this.pdsBlur=createEvent(this,"pdsBlur");this.pdsFocus=createEvent(this,"pdsFocus");this.pdsInput=createEvent(this,"pdsInput");this.pdsTextareaChange=createEvent(this,"pdsTextareaChange");this.inheritedAttributes={};this.disabled=false;this.invalid=false;this.name=this.componentId;this.readonly=false;this.required=false;this.value="";this.hasFocus=false;this.onBlur=function(e){t.hasFocus=false;if(t.focusedValue!==t.value){t.emitValueChange(e)}t.pdsBlur.emit(e)};this.onFocus=function(e){t.hasFocus=true;t.focusedValue=t.value;t.pdsFocus.emit(e)};this.onInput=function(e){var i=e.target;if(i){t.value=i.value||""}t.emitInputChange(e)};this.onTextareaChange=function(e){t.emitValueChange(e)}}e.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(this.nativeTextarea){this.nativeTextarea.focus()}return[2]}))}))};e.prototype.debounceChanged=function(){var e=this,t=e.pdsInput,i=e.debounce,r=e.originalPdsInput;this.pdsInput=i===undefined?r!==null&&r!==void 0?r:t:debounceEvent(t,i)};e.prototype.valueChanged=function(){var e=this.nativeTextarea;var t=this.getValue();if(e&&e.value!==t){e.value=t}};e.prototype.emitInputChange=function(e){var t=this.value;this.pdsInput.emit({value:t,event:e})};e.prototype.emitValueChange=function(e){var t=e.target;isRequired(t,this);var i=t.value;var r=i==null?i:i.toString();this.focusedValue=r;this.pdsTextareaChange.emit({value:r,event:e})};e.prototype.getValue=function(){return this.value||""};e.prototype.textareaClassNames=function(){var e=["pds-textarea__field"];if(this.invalid&&this.invalid===true){e.push("is-invalid")}return e.join(" ")};e.prototype.connectedCallback=function(){this.debounceChanged()};e.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign(Object.assign({},inheritAriaAttributes(this.el)),inheritAttributes(this.el))};e.prototype.componentDidLoad=function(){this.originalPdsInput=this.pdsInput};e.prototype.render=function(){var e=this;var t=this.getValue();return h(Host,{key:"6c5edcf968b607f1fccc9992d1c4974e5be38e94","aria-disabled":this.disabled?"true":null,"aria-readonly":this.readonly?"true":null},h("div",{key:"f8d9eb6ec8ce7ed1a44c7802972a9bcb31d734a4",class:"pds-textarea"},this.label&&h("label",{key:"a7d3c200c40f61773b1139efe7ef86333975753e",htmlFor:this.componentId},this.label),h("textarea",Object.assign({key:"178f1393bce68322ce0597dd072bc5a60062f855",ref:function(t){return e.nativeTextarea=t},"aria-describedby":assignDescription(this.componentId,this.invalid,this.helperMessage),"aria-invalid":this.invalid?"true":undefined,autocomplete:this.autocomplete,class:this.textareaClassNames(),disabled:this.disabled,id:this.componentId,name:this.name,placeholder:this.placeholder,readOnly:this.readonly,required:this.required,rows:this.rows,onBlur:this.onBlur,onChange:this.onTextareaChange,onFocus:this.onFocus,onInput:this.onInput},this.inheritedAttributes),t),this.helperMessage&&h("p",{key:"a9d026ad670ae391a87d1ba6d183241ca2e52456",class:"pds-textarea__helper-message",id:messageId(this.componentId,"helper")},this.helperMessage),this.invalid&&h("p",{key:"0b794b20c024f40ee850183a797a8c3bcc0b600c","aria-live":"assertive",class:"pds-textarea__error-message",id:messageId(this.componentId,"error")},h("pds-icon",{key:"889e8d84f53be8f963fd250f60fb54b35f46c7b5",icon:danger,size:"small"}),this.errorMessage)))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{debounce:["debounceChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return e}();PdsTextarea.style=labelCss+(pdsInputTokensCss+pdsTextareaCss);export{PdsTextarea as pds_textarea};
|
|
2
2
|
//# sourceMappingURL=pds-textarea.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";import{p as promiseResolve,b as bootstrapLazy}from"./index-Uh5ntVcq.js";export{s as setNonce}from"./index-Uh5ntVcq.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var patchBrowser=function(){var e=import.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return promiseResolve(n)};patchBrowser().then((function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,globalScripts()];case 1:n.sent();return[2,bootstrapLazy([["pds-copytext",[[1,"pds-copytext",{border:[516],componentId:[1,"component-id"],fullWidth:[4,"full-width"],truncate:[4],value:[1]}]]],["pds-table-head",[[1,"pds-table-head",{indeterminate:[1028],isSelected:[1028,"is-selected"]}]]],["pds-table-row",[[1,"pds-table-row",{indeterminate:[1028],isSelected:[1028,"is-selected"]}]]],["pds-accordion",[[1,"pds-accordion",{componentId:[1,"component-id"],isOpen:[1540,"open"]},null,{isOpen:["handleOpenState"]}]]],["pds-avatar",[[1,"pds-avatar",{alt:[1],badge:[4],componentId:[1,"component-id"],dropdown:[4],image:[1],size:[513],variant:[513]}]]],["pds-chip",[[1,"pds-chip",{componentId:[1,"component-id"],dot:[4],large:[4],sentiment:[1],variant:[1]}]]],["pds-input",[[1,"pds-input",{autocomplete:[1],componentId:[1,"component-id"],debounce:[2],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],name:[1],placeholder:[1],readonly:[4],required:[4],type:[1],value:[1032],hasFocus:[32],setFocus:[64]},null,{debounce:["debounceChanged"],value:["valueChanged"]}]]],["pds-link",[[1,"pds-link",{componentId:[1,"component-id"],external:[4],variant:[1],fontSize:[1,"font-size"],href:[1]}]]],["pds-radio",[[2,"pds-radio",{checked:[4],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],hideLabel:[4,"hide-label"],name:[1],required:[4],value:[1]}]]],["pds-select",[[1,"pds-select",{autocomplete:[1],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],multiple:[4],name:[1],required:[4],value:[1025]},null,{value:["valueChanged"]}]]],["pds-sortable-item",[[6,"pds-sortable-item",{enableActions:[4,"enable-actions"],componentId:[1,"component-id"],showHandle:[1028,"show-handle"]}]]],["pds-switch",[[1,"pds-switch",{componentId:[1,"component-id"],checked:[1028],disabled:[4],errorMessage:[1,"error-message"],hideLabel:[4,"hide-label"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],name:[1],required:[4],value:[1]}]]],["pds-textarea",[[1,"pds-textarea",{autocomplete:[1],componentId:[1,"component-id"],disabled:[4],debounce:[2],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[1028],label:[1],name:[1],placeholder:[1],readonly:[4],required:[4],rows:[2],value:[1025],hasFocus:[32],setFocus:[64]},null,{debounce:["debounceChanged"],value:["valueChanged"]}]]],["pds-box",[[0,"pds-box",{alignItems:[1,"align-items"],alignSelf:[1,"align-self"],auto:[4],backgroundColor:[1,"background-color"],border:[4],borderColor:[1,"border-color"],borderRadius:[1,"border-radius"],direction:[1],display:[1],fit:[4],gap:[1],flex:[1],justifyContent:[1,"justify-content"],marginBlockStart:[1,"margin-block-start"],marginInlineStart:[1,"margin-inline-start"],marginInlineEnd:[1,"margin-inline-end"],marginBlockEnd:[1,"margin-block-end"],minHeight:[1,"min-height"],minWidth:[1,"min-width"],offset:[1],offsetXs:[1,"offset-xs"],offsetSm:[1,"offset-sm"],offsetMd:[1,"offset-md"],offsetLg:[1,"offset-lg"],offsetXl:[1,"offset-xl"],padding:[1],paddingBlockStart:[1,"padding-block-start"],paddingBlockEnd:[1,"padding-block-end"],paddingInlineStart:[1,"padding-inline-start"],paddingInlineEnd:[1,"padding-inline-end"],shadow:[1],size:[1],sizeXs:[1,"size-xs"],sizeSm:[1,"size-sm"],sizeMd:[1,"size-md"],sizeLg:[1,"size-lg"],sizeXl:[1,"size-xl"]}]]],["pds-divider",[[1,"pds-divider",{componentId:[1,"component-id"],offset:[1],vertical:[4]}]]],["pds-image",[[1,"pds-image",{alt:[1],componentId:[1,"component-id"],height:[2],loading:[1],sizes:[1],src:[1],srcset:[1],width:[2]}]]],["pds-popover",[[1,"pds-popover",{popoverTargetAction:[1,"popover-target-action"],popoverType:[1,"popover-type"],componentId:[1,"component-id"],text:[1],maxWidth:[2,"max-width"],placement:[513],active:[32]},[[2,"click","handleClick"],[11,"scroll","handleScroll"]]]]],["pds-progress",[[1,"pds-progress",{animated:[4],componentId:[1,"component-id"],fillColor:[1,"fill-color"],label:[1],percent:[2],showPercent:[4,"show-percent"]}]]],["pds-row",[[0,"pds-row",{alignItems:[1,"align-items"],border:[4],colGap:[1,"col-gap"],componentId:[1,"component-id"],justifyContent:[1,"justify-content"],minHeight:[1,"min-height"],noWrap:[4,"no-wrap"]}]]],["pds-sortable",[[6,"pds-sortable",{border:[516],componentId:[1,"component-id"],dividers:[516],handleType:[1,"handle-type"]}]]],["pds-tab",[[4,"pds-tab",{name:[1],parentComponentId:[1,"parent-component-id"],variant:[1],index:[2],selected:[4]}]]],["pds-table",[[1,"pds-table",{compact:[4],componentId:[1,"component-id"],responsive:[4],fixedColumn:[4,"fixed-column"],selectable:[4],sortingColumn:[32],sortingDirection:[32]},[[0,"pdsTableSort","handleTableSort"],[0,"pdsTableSelectAll","handleTableSelectAll"],[0,"pdsTableRowSelected","handleTableSelect"]]]]],["pds-table-body",[[1,"pds-table-body"]]],["pds-tabpanel",[[4,"pds-tabpanel",{name:[1],parentComponentId:[1,"parent-component-id"],variant:[1],selected:[1028]}]]],["pds-tabs",[[1,"pds-tabs",{tablistLabel:[1,"tablist-label"],componentId:[1,"component-id"],variant:[1],activeTabName:[1025,"active-tab-name"],activeTabIndex:[1026,"active-tab-index"]},[[16,"pdsTabClick","tabClickHandler"],[0,"keydown","handleKeyDown"]]]]],["pds-text",[[1,"pds-text",{align:[1],color:[1],decoration:[1],gutter:[1],italic:[4],size:[1],weight:[1],tag:[1],truncate:[4]}]]],["pds-tooltip",[[1,"pds-tooltip",{content:[1],componentId:[1,"component-id"],hasArrow:[4,"has-arrow"],htmlContent:[4,"html-content"],placement:[513],maxWidth:[1,"max-width"],opened:[1540],isOpen:[32],showTooltip:[64],hideTooltip:[64]},null,{opened:["handleOpenToggle"]}]]],["pds-icon",[[1,"pds-icon",{color:[1],icon:[8],name:[513],size:[513],src:[1],ariaLabel:[32],isVisible:[32],svgContent:[32]},null,{size:["updateStyles"],color:["updateStyles"],name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"]}]]],["pds-button",[[1,"pds-button",{componentId:[1,"component-id"],disabled:[4],fullWidth:[4,"full-width"],href:[1],icon:[1],iconOnly:[4,"icon-only"],loading:[4],name:[1],target:[1],type:[1],value:[1],variant:[1]}]]],["pds-table-head-cell",[[1,"pds-table-head-cell",{sortable:[4],sortingDirection:[32],tableScrolling:[32],isSelected:[32]}]]],["pds-table-cell",[[1,"pds-table-cell",{truncate:[4],tableScrolling:[32]}]]],["pds-checkbox",[[1,"pds-checkbox",{checked:[1028],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],indeterminate:[1028],invalid:[4],label:[1],hideLabel:[4,"hide-label"],name:[1],required:[4],value:[1]},null,{checked:["updateIndeterminate"]}]]],["pds-loader",[[1,"pds-loader",{isLoading:[4,"is-loading"],showLabel:[4,"show-label"],size:[513],variant:[1]}]]]],e)]}}))}))}));
|
|
1
|
+
import{__awaiter,__generator}from"tslib";import{p as promiseResolve,b as bootstrapLazy}from"./index-Uh5ntVcq.js";export{s as setNonce}from"./index-Uh5ntVcq.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var patchBrowser=function(){var e=import.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return promiseResolve(n)};patchBrowser().then((function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,globalScripts()];case 1:n.sent();return[2,bootstrapLazy([["pds-copytext",[[1,"pds-copytext",{border:[516],componentId:[1,"component-id"],fullWidth:[4,"full-width"],truncate:[4],value:[1]}]]],["pds-table-head",[[1,"pds-table-head",{indeterminate:[1028],isSelected:[1028,"is-selected"]}]]],["pds-table-row",[[1,"pds-table-row",{indeterminate:[1028],isSelected:[1028,"is-selected"]}]]],["pds-accordion",[[1,"pds-accordion",{componentId:[1,"component-id"],isOpen:[1540,"open"]},null,{isOpen:["handleOpenState"]}]]],["pds-avatar",[[1,"pds-avatar",{alt:[1],badge:[4],componentId:[1,"component-id"],dropdown:[4],image:[1],size:[513],variant:[513]}]]],["pds-chip",[[1,"pds-chip",{componentId:[1,"component-id"],dot:[4],large:[4],sentiment:[1],variant:[1]}]]],["pds-input",[[1,"pds-input",{autocomplete:[1],componentId:[1,"component-id"],debounce:[2],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],name:[1],placeholder:[1],readonly:[4],required:[4],type:[1],value:[1032],hasFocus:[32],setFocus:[64]},null,{debounce:["debounceChanged"],value:["valueChanged"]}]]],["pds-link",[[1,"pds-link",{componentId:[1,"component-id"],external:[4],variant:[1],fontSize:[1,"font-size"],href:[1]}]]],["pds-radio",[[2,"pds-radio",{checked:[4],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],hideLabel:[4,"hide-label"],name:[1],required:[4],value:[1]}]]],["pds-select",[[1,"pds-select",{autocomplete:[1],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],multiple:[4],name:[1],required:[4],value:[1025]},null,{value:["valueChanged"]}]]],["pds-sortable-item",[[6,"pds-sortable-item",{enableActions:[4,"enable-actions"],componentId:[1,"component-id"],showHandle:[1028,"show-handle"]}]]],["pds-switch",[[1,"pds-switch",{componentId:[1,"component-id"],checked:[1028],disabled:[4],errorMessage:[1,"error-message"],hideLabel:[4,"hide-label"],helperMessage:[1,"helper-message"],invalid:[4],label:[1],name:[1],required:[4],value:[1]}]]],["pds-textarea",[[1,"pds-textarea",{autocomplete:[1],componentId:[1,"component-id"],disabled:[4],debounce:[2],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],invalid:[1028],label:[1],name:[1],placeholder:[1],readonly:[4],required:[4],rows:[2],value:[1025],hasFocus:[32],setFocus:[64]},null,{debounce:["debounceChanged"],value:["valueChanged"]}]]],["pds-box",[[0,"pds-box",{alignItems:[1,"align-items"],alignSelf:[1,"align-self"],auto:[4],backgroundColor:[1,"background-color"],border:[4],borderColor:[1,"border-color"],borderRadius:[1,"border-radius"],direction:[1],display:[1],fit:[4],gap:[1],flex:[1],justifyContent:[1,"justify-content"],marginBlockStart:[1,"margin-block-start"],marginInlineStart:[1,"margin-inline-start"],marginInlineEnd:[1,"margin-inline-end"],marginBlockEnd:[1,"margin-block-end"],minHeight:[1,"min-height"],minWidth:[1,"min-width"],offset:[1],offsetXs:[1,"offset-xs"],offsetSm:[1,"offset-sm"],offsetMd:[1,"offset-md"],offsetLg:[1,"offset-lg"],offsetXl:[1,"offset-xl"],padding:[1],paddingBlockStart:[1,"padding-block-start"],paddingBlockEnd:[1,"padding-block-end"],paddingInlineStart:[1,"padding-inline-start"],paddingInlineEnd:[1,"padding-inline-end"],shadow:[1],size:[1],sizeXs:[1,"size-xs"],sizeSm:[1,"size-sm"],sizeMd:[1,"size-md"],sizeLg:[1,"size-lg"],sizeXl:[1,"size-xl"]}]]],["pds-divider",[[1,"pds-divider",{componentId:[1,"component-id"],offset:[1],vertical:[4]}]]],["pds-image",[[1,"pds-image",{alt:[1],componentId:[1,"component-id"],height:[2],loading:[1],sizes:[1],src:[1],srcset:[1],width:[2]}]]],["pds-popover",[[1,"pds-popover",{popoverTargetAction:[1,"popover-target-action"],popoverType:[1,"popover-type"],componentId:[1,"component-id"],text:[1],maxWidth:[2,"max-width"],placement:[513],active:[32]},[[2,"click","handleClick"],[11,"scroll","handleScroll"]]]]],["pds-progress",[[1,"pds-progress",{animated:[4],componentId:[1,"component-id"],fillColor:[1,"fill-color"],label:[1],percent:[2],showPercent:[4,"show-percent"]}]]],["pds-row",[[0,"pds-row",{alignItems:[1,"align-items"],border:[4],colGap:[1,"col-gap"],componentId:[1,"component-id"],justifyContent:[1,"justify-content"],minHeight:[1,"min-height"],noWrap:[4,"no-wrap"]}]]],["pds-sortable",[[6,"pds-sortable",{border:[516],componentId:[1,"component-id"],dividers:[516],handleType:[1,"handle-type"]}]]],["pds-tab",[[4,"pds-tab",{name:[1],parentComponentId:[1,"parent-component-id"],variant:[1],index:[2],selected:[4]}]]],["pds-table",[[1,"pds-table",{compact:[4],componentId:[1,"component-id"],responsive:[4],fixedColumn:[4,"fixed-column"],selectable:[4],sortingColumn:[32],sortingDirection:[32]},[[0,"pdsTableSort","handleTableSort"],[0,"pdsTableSelectAll","handleTableSelectAll"],[0,"pdsTableRowSelected","handleTableSelect"]]]]],["pds-table-body",[[1,"pds-table-body"]]],["pds-tabpanel",[[4,"pds-tabpanel",{name:[1],parentComponentId:[1,"parent-component-id"],variant:[1],selected:[1028]}]]],["pds-tabs",[[1,"pds-tabs",{tablistLabel:[1,"tablist-label"],componentId:[1,"component-id"],variant:[1],activeTabName:[1025,"active-tab-name"],activeTabIndex:[1026,"active-tab-index"]},[[16,"pdsTabClick","tabClickHandler"],[0,"keydown","handleKeyDown"]]]]],["pds-text",[[1,"pds-text",{align:[1],color:[1],decoration:[1],gutter:[1],italic:[4],size:[1],weight:[1],tag:[1],truncate:[4]}]]],["pds-tooltip",[[1,"pds-tooltip",{content:[1],componentId:[1,"component-id"],hasArrow:[4,"has-arrow"],htmlContent:[4,"html-content"],placement:[513],maxWidth:[1,"max-width"],opened:[1540],isOpen:[32],showTooltip:[64],hideTooltip:[64]},null,{opened:["handleOpenToggle"]}]]],["pds-icon",[[1,"pds-icon",{color:[1],flipRtl:[4,"flip-rtl"],icon:[8],name:[513],size:[513],src:[1],ariaLabel:[32],isVisible:[32],svgContent:[32]},null,{size:["updateStyles"],color:["updateStyles"],name:["loadIcon"],src:["loadIcon"],icon:["loadIcon"]}]]],["pds-button",[[1,"pds-button",{componentId:[1,"component-id"],disabled:[4],fullWidth:[4,"full-width"],href:[1],icon:[1],iconOnly:[4,"icon-only"],loading:[4],name:[1],target:[1],type:[1],value:[1],variant:[1]}]]],["pds-table-head-cell",[[1,"pds-table-head-cell",{sortable:[4],sortingDirection:[32],tableScrolling:[32],isSelected:[32]}]]],["pds-table-cell",[[1,"pds-table-cell",{truncate:[4],tableScrolling:[32]}]]],["pds-checkbox",[[1,"pds-checkbox",{checked:[1028],componentId:[1,"component-id"],disabled:[4],errorMessage:[1,"error-message"],helperMessage:[1,"helper-message"],indeterminate:[1028],invalid:[4],label:[1],hideLabel:[4,"hide-label"],name:[1],required:[4],value:[1]},null,{checked:["updateIndeterminate"]}]]],["pds-loader",[[1,"pds-loader",{isLoading:[4,"is-loading"],showLabel:[4,"show-label"],size:[513],variant:[1]}]]]],e)]}}))}))}));
|
|
2
2
|
//# sourceMappingURL=pine-core.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./p-C_8VmA8d.system.js","./p-BG7_qxVr.system.js","./p-B4W0_y2p.system.js","./p-BhQhw0S3.system.js"],(function(i){"use strict";var e,r,n,t,s,a,o,l,c;return{setters:[function(i){e=i.r;r=i.c;n=i.h;t=i.H;s=i.g},function(i){a=i.m;o=i.a},function(i){l=i.f},function(i){c=i.i}],execute:function(){var d=":host{display:inline-block}:host([aria-disabled=true]) label{color:var(--pine-color-text-label-disabled)}:host([aria-readonly=true]) label{color:var(--pine-color-text-label-readonly)}label{color:var(--pine-color-text-label);font:var(--pine-typography-body-medium);letter-spacing:var(--pine-letter-spacing)}";var p=':host{--sizing-input-toggle-size:calc(var(--pine-dimension-250) - (var(--pine-dimension-025) * 2));--pine-dimension-025:2px;--spacing-message-inline:calc(var(--pine-dimension-450) + var(--pine-dimension-150));--number-transition-timing:0.15s ease-out;-ms-flex-align:start;align-items:flex-start;color:var(--pine-color-text);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-flow:row wrap;flex-flow:row wrap;position:relative}:host(.pds-switch--error){color:var(--pine-color-text-message-danger)}:host(.pds-switch--error) input,:host(.pds-switch--error) input:checked,:host(.pds-switch--error) input:hover:not(:disabled):not(:checked){background-color:var(--pine-color-danger)}:host(.pds-switch--error) input:focus-visible:not(:disabled):not(:checked){outline-color:var(--pine-color-focus-ring-danger)}:host(.pds-switch--error) label{color:var(--color-text-error)}input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pine-color-neutral);border:0;border-radius:var(--pine-dimension-sm);cursor:pointer;display:inline-block;-ms-flex-negative:0;flex-shrink:0;height:var(--pine-dimension-250);margin:0;padding:0;position:relative;-webkit-transition:var(--number-transition-timing);transition:var(--number-transition-timing);-webkit-transition-property:background, border, color;transition-property:background, border, color;width:var(--pine-dimension-450)}input::after{background:var(--pine-color-secondary);border-radius:var(--pine-border-radius-full);-webkit-box-shadow:var(--pine-box-shadow);box-shadow:var(--pine-box-shadow);content:"";display:block;height:var(--sizing-input-toggle-size);inset-block-start:50%;inset-inline-start:50%;position:absolute;-webkit-transform:translate3d(-100%, -50%, 0);transform:translate3d(-100%, -50%, 0);-webkit-transition:-webkit-transform var(--number-transition-timing);transition:-webkit-transform var(--number-transition-timing);transition:transform var(--number-transition-timing);transition:transform var(--number-transition-timing), -webkit-transform var(--number-transition-timing);width:var(--sizing-input-toggle-size)}label{display:-ms-flexbox;display:flex;gap:var(--pine-dimension-150)}.pds-switch--error label{color:inherit}.visually-hidden{border:0;clip:rect(0 0 0 0);-webkit-clip-path:polygon(0 0, 0 0, 0 0);clip-path:polygon(0 0, 0 0, 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pds-switch__message{color:var(--pine-color-text-message);font:var(--pine-typography-body-sm-medium);-webkit-margin-before:var(--pine-dimension-xs);margin-block-start:var(--pine-dimension-xs);-webkit-margin-start:var(--spacing-message-inline);margin-inline-start:var(--spacing-message-inline);width:100%}.pds-switch__message+.pds-switch__message{-webkit-margin-before:var(--spacing-message-inline);margin-block-start:var(--spacing-message-inline)}.pds-switch__message--error{color:inherit;display:-ms-flexbox;display:flex;gap:var(--pine-dimension-2xs)}.pds-switch__message--error pds-icon{-webkit-margin-before:var(--pine-dimension-025);margin-block-start:var(--pine-dimension-025)}input:disabled{background-color:var(--pine-color-neutral-disabled);cursor:not-allowed}input:disabled~label{cursor:initial}input:disabled:hover::after{background-color:var(--pine-color-background-container-disabled)}input:disabled .pds-switch__message{color:initial}input:hover:not(:disabled){background-color:var(--pine-color-neutral-hover)}input:focus-visible:not(:disabled){outline:var(--pine-outline-focus);outline-offset:var(--pine-border-width)}input:checked::after{-webkit-transform:translate3d(0, -50%, 0);transform:translate3d(0, -50%, 0)}input:checked:not(:disabled){background-color:currentColor;color:var(--pine-color-accent)}input:checked:not(:disabled):hover{border-color:currentColor;color:var(--pine-color-accent-hover)}';var h=i("pds_switch",function(){function i(i){var n=this;e(this,i);this.pdsSwitchChange=r(this,"pdsSwitchChange");this.inheritedAttributes={};this.checked=false;this.disabled=false;this.invalid=false;this.required=false;this.onSwitchUpdate=function(i){if(n.disabled)return;var e=i.target;n.checked=e.checked;n.pdsSwitchChange.emit(i)};this.switchClassNames=function(){var i="pds-switch";if(n.invalid===true){i+=" pds-switch--error"}if(n.helperMessage!==undefined){i+=" pds-switch--message"}return i}}i.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign({},c(this.el))};i.prototype.render=function(){return n(t,{key:"1ccbfafc2087558aae2fe82c9a97c640a9c3ab66",class:this.switchClassNames(),"aria-disabled":this.disabled?"true":null},n("label",{key:"9cd218cace5c432f57f03514c91c27ba32eeb97f",htmlFor:this.componentId},n("input",Object.assign({key:"ce995e0706a576dd36a4f1b31ca862ae614f7e2d","aria-describedby":o(this.componentId,this.invalid,this.errorMessage||this.helperMessage),"aria-invalid":this.invalid?"true":undefined,checked:this.checked,class:"pds-switch__input",disabled:this.disabled,id:this.componentId,name:this.name?this.name:this.componentId,onChange:this.onSwitchUpdate,required:this.required,type:"checkbox",value:this.value},this.inheritedAttributes)),n("span",{key:"ea20d65944a429e24b8bd0ae58dafd7ece29e9a7",class:this.hideLabel?"visually-hidden":""},this.label)),this.helperMessage&&n("div",{key:"45656b263c5169d0c6b60dd19e8537e0f12df342",class:"pds-switch__message",id:a(this.componentId,"helper")},this.helperMessage),this.errorMessage&&n("div",{key:"53ca563b419ce20ff4f4c81c90eee8f687e355b8",class:"pds-switch__message pds-switch__message--error",id:a(this.componentId,"error"),"aria-live":"assertive"},n("pds-icon",{key:"b8e38204aea3e9e1c542d5c945f57d389d800b66",icon:l,size:"small"}),this.errorMessage))};Object.defineProperty(i.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return i}());h.style=d+p}}}));
|
|
2
|
+
//# sourceMappingURL=p-103b62a1.system.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["labelCss","pdsSwitchCss","PdsSwitch","exports","class_1","hostRef","_this","this","inheritedAttributes","checked","disabled","invalid","required","onSwitchUpdate","e","input","target","pdsSwitchChange","emit","switchClassNames","switchClasses","helperMessage","undefined","prototype","componentWillLoad","Object","assign","inheritAriaAttributes","el","render","h","Host","key","class","htmlFor","componentId","assignDescription","errorMessage","id","name","onChange","type","value","hideLabel","label","messageId","icon","danger","size"],"sources":["src/global/styles/utils/label.scss?tag=pds-switch&encapsulation=shadow","src/components/pds-switch/pds-switch.scss?tag=pds-switch&encapsulation=shadow","src/components/pds-switch/pds-switch.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n:host([aria-disabled=\"true\"]) label {\n color: var(--pine-color-text-label-disabled);\n}\n\n:host([aria-readonly=\"true\"]) {\n label {\n color: var(--pine-color-text-label-readonly);\n }\n}\n\nlabel {\n color: var(--pine-color-text-label);\n font: var(--pine-typography-body-medium);\n letter-spacing: var(--pine-letter-spacing);\n}\n",":host {\n// Need discussions\n --sizing-input-toggle-size: calc(var(--pine-dimension-250) - (var(--pine-dimension-025) * 2));\n --pine-dimension-025: 2px;\n --spacing-message-inline: calc(var(--pine-dimension-450) + var(--pine-dimension-150));\n --number-transition-timing: 0.15s ease-out;\n\n align-items: flex-start;\n color: var(--pine-color-text);\n display: inline-flex;\n flex-flow: row wrap;\n position: relative;\n}\n\n:host(.pds-switch--error) {\n color: var(--pine-color-text-message-danger);\n\n input,\n input:checked,\n input:hover:not(:disabled):not(:checked) {\n background-color: var(--pine-color-danger);\n }\n\n input:focus-visible:not(:disabled):not(:checked) {\n outline-color: var(--pine-color-focus-ring-danger);\n }\n\n label {\n color: var(--color-text-error);\n }\n}\n\n// switch container\ninput {\n appearance: none;\n background: var(--pine-color-neutral);\n border: 0;\n border-radius: var(--pine-dimension-sm);\n cursor: pointer;\n display: inline-block;\n flex-shrink: 0;\n height: var(--pine-dimension-250);\n margin: 0;\n padding: 0;\n position: relative;\n transition: var(--number-transition-timing);\n transition-property: background, border, color;\n width: var(--pine-dimension-450);\n\n // switch toggle\n &::after {\n background: var(--pine-color-secondary);\n border-radius: var(--pine-border-radius-full);\n box-shadow: var(--pine-box-shadow);\n content: \"\";\n display: block;\n height: var(--sizing-input-toggle-size);\n inset-block-start: 50%;\n inset-inline-start: 50%;\n position: absolute;\n transform: translate3d(-100%, -50%, 0);\n transition: transform var(--number-transition-timing);\n width: var(--sizing-input-toggle-size);\n }\n}\n\nlabel {\n display: flex;\n gap: var(--pine-dimension-150);\n\n .pds-switch--error & {\n color: inherit;\n }\n}\n\n.visually-hidden {\n border: 0;\n clip: rect(0 0 0 0);\n clip-path: polygon(0 0, 0 0, 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n// Help and error messages\n.pds-switch__message {\n color: var(--pine-color-text-message);\n font: var(--pine-typography-body-sm-medium);\n margin-block-start: var(--pine-dimension-xs);\n margin-inline-start: var(--spacing-message-inline);\n width: 100%;\n\n + .pds-switch__message {\n margin-block-start: var(--spacing-message-inline);\n }\n}\n\n.pds-switch__message--error {\n color: inherit;\n display: flex;\n gap: var(--pine-dimension-2xs);\n\n pds-icon {\n margin-block-start: var(--pine-dimension-025);\n }\n}\n\n// Disabled state\ninput:disabled {\n background-color: var(--pine-color-neutral-disabled);\n cursor: not-allowed;\n\n ~ label {\n cursor: initial;\n }\n\n &:hover::after {\n background-color: var(--pine-color-background-container-disabled);\n }\n\n .pds-switch__message {\n color: initial;\n }\n}\n\n// Hover state\ninput:hover:not(:disabled) {\n background-color: var(--pine-color-neutral-hover);\n}\n\n // Focus state\ninput:focus-visible:not(:disabled) {\n outline: var(--pine-outline-focus);\n outline-offset: var(--pine-border-width);\n}\n\n// 'Checked' state\n// switch toggle\ninput:checked::after {\n transform: translate3d(0, -50%, 0);\n}\n\n// switch container\ninput:checked:not(:disabled) {\n background-color: currentColor;\n color: var(--pine-color-accent);\n\n &:hover {\n border-color: currentColor;\n color: var(--pine-color-accent-hover);\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { danger } from '@pine-ds/icons/icons';\n\nimport { inheritAriaAttributes } from '@utils/attributes';\nimport type { Attributes } from '@utils/attributes';\n\n@Component({\n tag: 'pds-switch',\n styleUrls: ['../../global/styles/utils/label.scss', 'pds-switch.scss'],\n shadow: true,\n})\nexport class PdsSwitch {\n private inheritedAttributes: Attributes = {};\n\n @Element() el: HTMLPdsSwitchElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute and the label `for` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Determines the input 'checked' state.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Determines the input 'disabled' state, preventing user interaction.\n */\n @Prop() disabled? = false;\n\n /**\n * Displays message text describing an invalid state.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Visually hides the label text for instances where only the switch should be displayed. Label remains accessible to assistive technology such as screen readers.\n */\n @Prop() hideLabel: boolean;\n\n /**\n * Displays help text for additional description of an input.\n */\n @Prop() helperMessage: string;\n\n /**\n * Determines the input 'invalid' state, signifying an error is present.\n */\n @Prop() invalid? = false;\n\n /**\n * Displays text to describe the input.\n */\n @Prop() label!: string;\n\n /**\n * Identifies form data and unifies a group of radio inputs for toggling a single property/value.\n */\n @Prop() name: string;\n\n /**\n * Determines the 'required' state of the input.\n */\n @Prop() required? = false;\n\n /**\n * Provides input with a string submitted in form data.\n */\n @Prop() value: string;\n\n /**\n * Emits an event on input change.\n */\n @Event() pdsSwitchChange: EventEmitter<InputEvent>;\n\n private onSwitchUpdate = (e: Event) => {\n if (this.disabled) return;\n\n const input = e.target as HTMLInputElement;\n this.checked = input.checked;\n this.pdsSwitchChange.emit(e as InputEvent);\n };\n\n private switchClassNames = () => {\n let switchClasses = `pds-switch`;\n\n if (this.invalid === true) {\n switchClasses += \" pds-switch--error\";\n }\n if (this.helperMessage !== undefined) {\n switchClasses += \" pds-switch--message\";\n }\n return switchClasses;\n };\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n }\n }\n\n render() {\n return (\n <Host class={this.switchClassNames()} aria-disabled={this.disabled ? 'true' : null}>\n <label htmlFor={this.componentId}>\n <input\n aria-describedby={assignDescription(this.componentId, this.invalid, this.errorMessage || this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n checked={this.checked}\n class=\"pds-switch__input\"\n disabled={this.disabled}\n id={this.componentId}\n name={this.name ? this.name : this.componentId}\n onChange={this.onSwitchUpdate}\n required={this.required}\n type=\"checkbox\"\n value={this.value}\n {...this.inheritedAttributes}\n />\n <span class={this.hideLabel ? 'visually-hidden' : ''}>\n {this.label}\n </span>\n </label>\n {this.helperMessage &&\n <div\n class={`pds-switch__message`}\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </div>\n }\n {this.errorMessage &&\n <div\n class={`pds-switch__message pds-switch__message--error`}\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </div>\n }\n </Host>\n );\n }\n}\n"],"mappings":"oTAAA,IAAMA,EAAW,qTCAjB,IAAMC,EAAe,+vH,ICYRC,EAASC,EAAA,wBALtB,SAAAC,EAAAC,GAAA,IAAAC,EAAAC,K,yDAMUA,KAAmBC,oBAAe,GAYjBD,KAAOE,QAAG,MAK3BF,KAAQG,SAAI,MAoBZH,KAAOI,QAAI,MAeXJ,KAAQK,SAAI,MAYZL,KAAAM,eAAiB,SAACC,GACxB,GAAIR,EAAKI,SAAU,OAEnB,IAAMK,EAAQD,EAAEE,OAChBV,EAAKG,QAAUM,EAAMN,QACrBH,EAAKW,gBAAgBC,KAAKJ,EAC5B,EAEQP,KAAgBY,iBAAG,WACzB,IAAIC,EAAgB,aAEpB,GAAId,EAAKK,UAAY,KAAM,CACzBS,GAAiB,oB,CAEnB,GAAId,EAAKe,gBAAkBC,UAAW,CACpCF,GAAiB,sB,CAEnB,OAAOA,CACT,CAmDD,CAjDChB,EAAAmB,UAAAC,kBAAA,WACEjB,KAAKC,oBAAmBiB,OAAAC,OAAA,GACnBC,EAAsBpB,KAAKqB,I,EAIlCxB,EAAAmB,UAAAM,OAAA,WACE,OACEC,EAACC,EAAI,CAA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