@govtechsg/sgds-web-component 3.0.0 → 3.0.2
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/Masthead/index.js +1 -1
- package/base/card.js +1 -1
- package/components/Alert/index.umd.js +501 -425
- package/components/Alert/index.umd.js.map +1 -1
- package/components/Breadcrumb/index.umd.js +502 -426
- package/components/Breadcrumb/index.umd.js.map +1 -1
- package/components/Card/index.umd.js +1 -1
- package/components/ComboBox/combo-box.js +1 -1
- package/components/ComboBox/index.umd.js +502 -426
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/Datepicker/index.umd.js +501 -425
- package/components/Datepicker/index.umd.js.map +1 -1
- package/components/Dropdown/index.umd.js +501 -425
- package/components/Dropdown/index.umd.js.map +1 -1
- package/components/FileUpload/index.umd.js +501 -425
- package/components/FileUpload/index.umd.js.map +1 -1
- package/components/Icon/icon-registry.d.ts +187 -141
- package/components/Icon/icon-registry.js +500 -284
- package/components/Icon/icon-registry.js.map +1 -1
- package/components/Icon/index.umd.js +501 -425
- package/components/Icon/index.umd.js.map +1 -1
- package/components/Icon/sgds-icon.js +1 -1
- package/components/Icon/sgds-icon.js.map +1 -1
- package/components/IconButton/index.umd.js +501 -425
- package/components/IconButton/index.umd.js.map +1 -1
- package/components/Input/index.umd.js +501 -425
- package/components/Input/index.umd.js.map +1 -1
- package/components/Link/index.umd.js +1 -1
- package/components/Link/link.js +1 -1
- package/components/Mainnav/index.umd.js +501 -425
- package/components/Mainnav/index.umd.js.map +1 -1
- package/components/Masthead/index.umd.js +1 -1
- package/components/Masthead/masthead.js +1 -1
- package/components/Pagination/index.umd.js +501 -425
- package/components/Pagination/index.umd.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +501 -425
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/Sidenav/index.umd.js +501 -425
- package/components/Sidenav/index.umd.js.map +1 -1
- package/components/Stepper/index.umd.js +501 -425
- package/components/Stepper/index.umd.js.map +1 -1
- package/components/Toast/index.umd.js +1 -1
- package/components/Toast/toast.js +1 -1
- package/components/index.umd.js +506 -430
- package/components/index.umd.js.map +1 -1
- package/index.umd.js +506 -430
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/react/base/card.cjs.js +1 -1
- package/react/base/card.js +1 -1
- package/react/components/ComboBox/combo-box.cjs.js +1 -1
- package/react/components/ComboBox/combo-box.js +1 -1
- package/react/components/Icon/icon-registry.cjs.js +500 -424
- package/react/components/Icon/icon-registry.cjs.js.map +1 -1
- package/react/components/Icon/icon-registry.js +500 -284
- package/react/components/Icon/icon-registry.js.map +1 -1
- package/react/components/Icon/sgds-icon.cjs.js +1 -1
- package/react/components/Icon/sgds-icon.cjs.js.map +1 -1
- package/react/components/Icon/sgds-icon.js +1 -1
- package/react/components/Icon/sgds-icon.js.map +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/components/Masthead/masthead.cjs.js +1 -1
- package/react/components/Masthead/masthead.js +1 -1
- package/react/components/Toast/toast.cjs.js +1 -1
- package/react/components/Toast/toast.js +1 -1
- package/themes/day.css +2 -2
- package/themes/night.css +2 -2
|
@@ -29,7 +29,7 @@ class SgdsIcon extends SgdsElement {
|
|
|
29
29
|
.join("");
|
|
30
30
|
try {
|
|
31
31
|
const iconRegistry = await import('./icon-registry.js');
|
|
32
|
-
const svg = iconRegistry[pascalName];
|
|
32
|
+
const svg = iconRegistry["IconRegistry"][pascalName];
|
|
33
33
|
if (svg) {
|
|
34
34
|
this._svgContent = svg;
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-icon.js","sources":["../../../src/components/Icon/sgds-icon.ts"],"sourcesContent":["import SgdsElement from \"../../base/sgds-element\";\nimport { html } from \"lit/static-html.js\";\nimport { property, state } from \"lit/decorators.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport iconStyles from \"./icon.css\";\n\n/**\n * @summary Icons offer a form of visual shorthand that we are all familiar with. They can label, inform and aid navigation quickly and effectively in minimal space. Icons must first and foremost communicate meaning. By default, the icon component renders icons from `SgdsIcon` library set\n */\nexport class SgdsIcon extends SgdsElement {\n static styles = [...SgdsElement.styles, iconStyles];\n\n /** The name of the icon from sgds icon library */\n @property({ type: String, reflect: true }) name: string;\n\n /** Specifies a small, medium or large icon, the size is medium by default. */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2-xl\" | \"3-xl\" = \"lg\";\n\n /** @internal */\n @state()\n private _svgContent: string | null = null;\n\n async updated(changedProperties: Map<string, any>) {\n if (changedProperties.has(\"name\")) {\n await this._loadSvg(this.name);\n }\n }\n\n private async _loadSvg(name: string): Promise<void> {\n if (name) {\n const pascalName = name\n .split(\"-\")\n .map(name => String(name).charAt(0).toUpperCase() + String(name).slice(1))\n .join(\"\");\n try {\n const iconRegistry = await import(\"./icon-registry\");\n const svg = iconRegistry[pascalName];\n if (svg) {\n this._svgContent = svg;\n } else {\n throw new Error(\"icon `name` not found\");\n }\n } catch (error) {\n console.error(`Unable to load icon: ${name}.`, error);\n }\n }\n }\n\n render() {\n return html`${unsafeSVG(this._svgContent)}`;\n }\n}\n\nexport default SgdsIcon;\n"],"names":["iconStyles"],"mappings":";;;;;;;AAMA;;AAEG;AACG,MAAO,QAAS,SAAQ,WAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAO6C,IAAI,CAAA,IAAA,GAAgD,IAAI,CAAC;;QAI5F,IAAW,CAAA,WAAA,GAAkB,IAAI,CAAC;KA+B3C;IA7BC,MAAM,OAAO,CAAC,iBAAmC,EAAA;AAC/C,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACjC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;KACF;IAEO,MAAM,QAAQ,CAAC,IAAY,EAAA;QACjC,IAAI,IAAI,EAAE;YACR,MAAM,UAAU,GAAG,IAAI;iBACpB,KAAK,CAAC,GAAG,CAAC;iBACV,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBACzE,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,YAAA,IAAI;AACF,gBAAA,MAAM,YAAY,GAAG,MAAM,OAAO,oBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"sgds-icon.js","sources":["../../../src/components/Icon/sgds-icon.ts"],"sourcesContent":["import SgdsElement from \"../../base/sgds-element\";\nimport { html } from \"lit/static-html.js\";\nimport { property, state } from \"lit/decorators.js\";\nimport { unsafeSVG } from \"lit/directives/unsafe-svg.js\";\nimport iconStyles from \"./icon.css\";\n\n/**\n * @summary Icons offer a form of visual shorthand that we are all familiar with. They can label, inform and aid navigation quickly and effectively in minimal space. Icons must first and foremost communicate meaning. By default, the icon component renders icons from `SgdsIcon` library set\n */\nexport class SgdsIcon extends SgdsElement {\n static styles = [...SgdsElement.styles, iconStyles];\n\n /** The name of the icon from sgds icon library */\n @property({ type: String, reflect: true }) name: string;\n\n /** Specifies a small, medium or large icon, the size is medium by default. */\n @property({ type: String, reflect: true }) size: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2-xl\" | \"3-xl\" = \"lg\";\n\n /** @internal */\n @state()\n private _svgContent: string | null = null;\n\n async updated(changedProperties: Map<string, any>) {\n if (changedProperties.has(\"name\")) {\n await this._loadSvg(this.name);\n }\n }\n\n private async _loadSvg(name: string): Promise<void> {\n if (name) {\n const pascalName = name\n .split(\"-\")\n .map(name => String(name).charAt(0).toUpperCase() + String(name).slice(1))\n .join(\"\");\n try {\n const iconRegistry = await import(\"./icon-registry\");\n const svg = iconRegistry[\"IconRegistry\"][pascalName];\n if (svg) {\n this._svgContent = svg;\n } else {\n throw new Error(\"icon `name` not found\");\n }\n } catch (error) {\n console.error(`Unable to load icon: ${name}.`, error);\n }\n }\n }\n\n render() {\n return html`${unsafeSVG(this._svgContent)}`;\n }\n}\n\nexport default SgdsIcon;\n"],"names":["iconStyles"],"mappings":";;;;;;;AAMA;;AAEG;AACG,MAAO,QAAS,SAAQ,WAAW,CAAA;AAAzC,IAAA,WAAA,GAAA;;;QAO6C,IAAI,CAAA,IAAA,GAAgD,IAAI,CAAC;;QAI5F,IAAW,CAAA,WAAA,GAAkB,IAAI,CAAC;KA+B3C;IA7BC,MAAM,OAAO,CAAC,iBAAmC,EAAA;AAC/C,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACjC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;KACF;IAEO,MAAM,QAAQ,CAAC,IAAY,EAAA;QACjC,IAAI,IAAI,EAAE;YACR,MAAM,UAAU,GAAG,IAAI;iBACpB,KAAK,CAAC,GAAG,CAAC;iBACV,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;iBACzE,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,YAAA,IAAI;AACF,gBAAA,MAAM,YAAY,GAAG,MAAM,OAAO,oBAAiB,CAAC,CAAC;gBACrD,MAAM,GAAG,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC;gBACrD,IAAI,GAAG,EAAE;AACP,oBAAA,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;iBACxB;qBAAM;AACL,oBAAA,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;iBAC1C;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,CAAA,qBAAA,EA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