@pine-ds/core 0.0.2-alpha.0 → 0.0.2-alpha.1

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.
Files changed (72) hide show
  1. package/components/custom-elements.d.ts +2 -0
  2. package/components/index.d.ts +33 -0
  3. package/components/index.js +3 -0
  4. package/components/index.js.map +1 -0
  5. package/components/package.json +9 -0
  6. package/components/pds-avatar.d.ts +11 -0
  7. package/components/pds-avatar.js +98 -0
  8. package/components/pds-avatar.js.map +1 -0
  9. package/components/pds-button.d.ts +11 -0
  10. package/components/pds-button.js +8 -0
  11. package/components/pds-button.js.map +1 -0
  12. package/components/pds-button2.js +82 -0
  13. package/components/pds-button2.js.map +1 -0
  14. package/components/pds-checkbox.d.ts +11 -0
  15. package/components/pds-checkbox.js +83 -0
  16. package/components/pds-checkbox.js.map +1 -0
  17. package/components/pds-chip.d.ts +11 -0
  18. package/components/pds-chip.js +76 -0
  19. package/components/pds-chip.js.map +1 -0
  20. package/components/pds-copytext.d.ts +11 -0
  21. package/components/pds-copytext.js +100 -0
  22. package/components/pds-copytext.js.map +1 -0
  23. package/components/pds-divider.d.ts +11 -0
  24. package/components/pds-divider.js +53 -0
  25. package/components/pds-divider.js.map +1 -0
  26. package/components/pds-icon.js +8 -0
  27. package/components/pds-icon.js.map +1 -0
  28. package/components/pds-icon2.js +299 -0
  29. package/components/pds-icon2.js.map +1 -0
  30. package/components/pds-image.d.ts +11 -0
  31. package/components/pds-image.js +54 -0
  32. package/components/pds-image.js.map +1 -0
  33. package/components/pds-input.d.ts +11 -0
  34. package/components/pds-input.js +71 -0
  35. package/components/pds-input.js.map +1 -0
  36. package/components/pds-label.js +39 -0
  37. package/components/pds-label.js.map +1 -0
  38. package/components/pds-link.d.ts +11 -0
  39. package/components/pds-link.js +63 -0
  40. package/components/pds-link.js.map +1 -0
  41. package/components/pds-progress.d.ts +11 -0
  42. package/components/pds-progress.js +48 -0
  43. package/components/pds-progress.js.map +1 -0
  44. package/components/pds-radio.d.ts +11 -0
  45. package/components/pds-radio.js +77 -0
  46. package/components/pds-radio.js.map +1 -0
  47. package/components/pds-sortable-item.d.ts +11 -0
  48. package/components/pds-sortable-item.js +47 -0
  49. package/components/pds-sortable-item.js.map +1 -0
  50. package/components/pds-sortable.d.ts +11 -0
  51. package/components/pds-sortable.js +2724 -0
  52. package/components/pds-sortable.js.map +1 -0
  53. package/components/pds-switch.d.ts +11 -0
  54. package/components/pds-switch.js +81 -0
  55. package/components/pds-switch.js.map +1 -0
  56. package/components/pds-tab.d.ts +11 -0
  57. package/components/pds-tab.js +52 -0
  58. package/components/pds-tab.js.map +1 -0
  59. package/components/pds-tabpanel.d.ts +11 -0
  60. package/components/pds-tabpanel.js +44 -0
  61. package/components/pds-tabpanel.js.map +1 -0
  62. package/components/pds-tabs.d.ts +11 -0
  63. package/components/pds-tabs.js +118 -0
  64. package/components/pds-tabs.js.map +1 -0
  65. package/components/pds-textarea.d.ts +11 -0
  66. package/components/pds-textarea.js +81 -0
  67. package/components/pds-textarea.js.map +1 -0
  68. package/components/pds-tooltip.d.ts +11 -0
  69. package/components/pds-tooltip.js +177 -0
  70. package/components/pds-tooltip.js.map +1 -0
  71. package/dist/docs.json +1 -1
  72. package/package.json +2 -1
@@ -0,0 +1,100 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$3 } from './pds-button2.js';
3
+ import { d as defineCustomElement$2 } from './pds-icon2.js';
4
+
5
+ const pdsCopytextCss = ":host(.pds-copytext){--background:var(--pine-color-base-white);--background-hover:var(--pine-color-neutral-grey-200);--border:var(--pine-border-interactive);--border-hover:var(--pine-border-interactive-hover-color);--border-radius:var(--pine-border-radius-md);--box-shadow-focus:0 0 0 4px var(--pine-color-primary-200);--color-hover:var(--pine-color-neutral-charcoal-400);--font-size:var(--pine-font-size-body);--font-weight:var(--pine-font-weight-semibold);--line-height:var(--pine-line-height-md);--spacing-sm:var(--pine-spacing-sm);--spacing-xs:var(--pine-spacing-xs);--spacing-xxs:var(--pine-spacing-xxs)}:host(.pds-copytext) pds-button{-ms-flex-align:center;align-items:center;background:var(--background);border:0;border-radius:var(--border-radius);display:-ms-inline-flexbox;display:inline-flex;font-size:var(--font-size);font-weight:var(--font-weight);max-width:100%;padding:var(--spacing-xxs) var(--spacing-xs)}:host(.pds-copytext) pds-button:hover{background-color:var(--background-hover);color:var(--color-hover)}:host(.pds-copytext) pds-button:focus-visible{-webkit-box-shadow:var(--box-shadow-focus);box-shadow:var(--box-shadow-focus);outline:none}:host(.pds-copytext) pds-button span{line-height:var(--line-height);-webkit-margin-end:var(--spacing-xs);margin-inline-end:var(--spacing-xs);white-space:nowrap}:host(.pds-copytext) pds-button :nth-child(2){-ms-flex-negative:0;flex-shrink:0}:host(.pds-copytext):host(.pds-copytext--bordered){border:0;padding:0}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button{padding:0}:host(.pds-copytext):host(.pds-copytext--bordered) pds-button:hover{background:none}:host(.pds-copytext):host(.pds-copytext--bordered) span{border:var(--border);border-radius:var(--border-radius);-webkit-margin-end:var(--spacing-sm);margin-inline-end:var(--spacing-sm);padding-block:var(--spacing-xs);padding-inline:var(--spacing-sm)}:host(.pds-copytext):host(.pds-copytext--bordered) :hover span{border-color:var(--border-hover)}:host(.pds-copytext):host(.pds-copytext--full-width){display:-ms-flexbox;display:flex;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;width:100%}:host(.pds-copytext):host(.pds-copytext--full-width) pds-button span{text-align:left;width:100%}:host(.pds-copytext):host(.pds-copytext--truncated) pds-button{display:-ms-flexbox;display:flex;width:100%}:host(.pds-copytext):host(.pds-copytext--truncated) pds-button span{overflow:hidden;text-align:left;text-overflow:ellipsis;width:100%}";
6
+
7
+ const PdsCopytext$1 = /*@__PURE__*/ proxyCustomElement(class PdsCopytext extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.__attachShadow();
12
+ this.pdsCopyTextClick = createEvent(this, "pdsCopyTextClick", 7);
13
+ this.copyToClipboard = async (value) => {
14
+ try {
15
+ if (navigator.clipboard) {
16
+ await navigator.clipboard.writeText(value);
17
+ this.pdsCopyTextClick.emit('Copied to clipboard');
18
+ }
19
+ else {
20
+ // falback for safari
21
+ const el = document.createElement('textarea');
22
+ el.value = value;
23
+ el.setAttribute('readonly', '');
24
+ el.style.position = 'absolute';
25
+ el.style.left = '-9999px';
26
+ document.body.appendChild(el);
27
+ el.focus();
28
+ el.setSelectionRange(0, el.value.length);
29
+ document.execCommand('copy');
30
+ document.body.removeChild(el);
31
+ this.pdsCopyTextClick.emit('Copied to clipboard');
32
+ }
33
+ }
34
+ catch (err) {
35
+ this.pdsCopyTextClick.emit(`Error writing text to clipboard: ${err}`);
36
+ }
37
+ };
38
+ this.handleClick = () => {
39
+ this.copyToClipboard(this.value);
40
+ };
41
+ this.border = true;
42
+ this.componentId = undefined;
43
+ this.fullWidth = false;
44
+ this.truncate = false;
45
+ this.value = undefined;
46
+ }
47
+ classNames() {
48
+ const classNames = ['pds-copytext'];
49
+ if (this.border) {
50
+ classNames.push('pds-copytext--bordered');
51
+ }
52
+ if (this.fullWidth) {
53
+ classNames.push('pds-copytext--full-width');
54
+ }
55
+ if (this.truncate) {
56
+ classNames.push('pds-copytext--truncated');
57
+ }
58
+ return classNames.join(' ');
59
+ }
60
+ render() {
61
+ return (h(Host, { class: this.classNames(), id: this.componentId }, h("pds-button", { type: "button", variant: "unstyled", onClick: this.handleClick }, h("span", null, this.value), h("pds-icon", { name: "copy", size: "16px" }))));
62
+ }
63
+ static get style() { return pdsCopytextCss; }
64
+ }, [1, "pds-copytext", {
65
+ "border": [516],
66
+ "componentId": [1, "component-id"],
67
+ "fullWidth": [4, "full-width"],
68
+ "truncate": [4],
69
+ "value": [1]
70
+ }]);
71
+ function defineCustomElement$1() {
72
+ if (typeof customElements === "undefined") {
73
+ return;
74
+ }
75
+ const components = ["pds-copytext", "pds-button", "pds-icon"];
76
+ components.forEach(tagName => { switch (tagName) {
77
+ case "pds-copytext":
78
+ if (!customElements.get(tagName)) {
79
+ customElements.define(tagName, PdsCopytext$1);
80
+ }
81
+ break;
82
+ case "pds-button":
83
+ if (!customElements.get(tagName)) {
84
+ defineCustomElement$3();
85
+ }
86
+ break;
87
+ case "pds-icon":
88
+ if (!customElements.get(tagName)) {
89
+ defineCustomElement$2();
90
+ }
91
+ break;
92
+ } });
93
+ }
94
+
95
+ const PdsCopytext = PdsCopytext$1;
96
+ const defineCustomElement = defineCustomElement$1;
97
+
98
+ export { PdsCopytext, defineCustomElement };
99
+
100
+ //# sourceMappingURL=pds-copytext.js.map
@@ -0,0 +1 @@
1
+ {"file":"pds-copytext.js","mappings":";;;;AAAA,MAAM,cAAc,GAAG,ygFAAygF;;MCOnhFA,aAAW;;;;;;QAkCd,oBAAe,GAAG,OAAO,KAAa;YAC5C,IAAI;gBACF,IAAI,SAAS,CAAC,SAAS,EAAE;oBACvB,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;oBAC3C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;iBACnD;qBAAM;;oBAEL,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;oBAC9C,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC;oBACjB,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;oBAChC,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;oBAC/B,EAAE,CAAC,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;oBAC1B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;oBAC9B,EAAE,CAAC,KAAK,EAAE,CAAC;oBACX,EAAE,CAAC,iBAAiB,CAAC,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsCopytext"],"sources":["src/components/pds-copytext/pds-copytext.scss?tag=pds-copytext&encapsulation=shadow","src/components/pds-copytext/pds-copytext.tsx"],"sourcesContent":[":host(.pds-copytext) {\n\n --background: var(--pine-color-base-white);\n --background-hover: var(--pine-color-neutral-grey-200);\n --border: var(--pine-border-interactive);\n --border-hover: var(--pine-border-interactive-hover-color);\n --border-radius: var(--pine-border-radius-md);\n --box-shadow-focus: 0 0 0 4px var(--pine-color-primary-200);\n --color-hover: var(--pine-color-neutral-charcoal-400);\n --font-size: var(--pine-font-size-body);\n --font-weight: var(--pine-font-weight-semibold);\n --line-height: var(--pine-line-height-md);\n --spacing-sm: var(--pine-spacing-sm);\n --spacing-xs: var(--pine-spacing-xs);\n --spacing-xxs: var(--pine-spacing-xxs);\n\n pds-button {\n align-items: center;\n background: var(--background);\n border: 0;\n border-radius: var(--border-radius);\n display: inline-flex;\n font-size: var(--font-size);\n font-weight: var(--font-weight);\n max-width: 100%;\n padding: var(--spacing-xxs) var(--spacing-xs);\n\n &:hover {\n background-color: var(--background-hover);\n color: var(--color-hover);\n }\n\n &:focus-visible {\n box-shadow: var(--box-shadow-focus);\n outline: none;\n }\n\n span {\n line-height: var(--line-height);\n margin-inline-end: var(--spacing-xs);\n white-space: nowrap;\n }\n\n :nth-child(2) {\n flex-shrink: 0;\n }\n }\n\n // bordered\n\n &:host(.pds-copytext--bordered) {\n border: 0;\n padding: 0;\n\n pds-button {\n padding: 0;\n\n &:hover {\n background: none;\n }\n }\n\n span {\n border: var(--border);\n border-radius: var(--border-radius);\n margin-inline-end: var(--spacing-sm);\n padding-block: var(--spacing-xs);\n padding-inline: var(--spacing-sm);\n }\n\n :hover {\n span {\n border-color: var(--border-hover)\n }\n }\n }\n\n // full width\n\n &:host(.pds-copytext--full-width) {\n display: flex;\n width: 100%;\n\n pds-button {\n display: flex;\n justify-content: space-between;\n width: 100%;\n\n span {\n text-align: left;\n width: 100%;\n }\n }\n }\n\n // truncated\n\n &:host(.pds-copytext--truncated) {\n pds-button {\n display: flex;\n width: 100%;\n\n span {\n overflow: hidden;\n text-align: left;\n text-overflow: ellipsis;\n width: 100%;\n }\n }\n }\n}\n","import { Component, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pds-copytext',\n styleUrl: 'pds-copytext.scss',\n shadow: true,\n})\nexport class PdsCopytext {\n /**\n * Determines whether `copytext` should have a border.\n * @defaultValue true\n */\n @Prop({ reflect: true }) border = true;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether `copytext` should expand to the full width of its container.\n * @defaultValue false\n */\n @Prop() fullWidth = false;\n\n /**\n * Determines whether the `value` should truncate and display with an ellipsis.\n * @defaultValue false\n */\n @Prop() truncate = false;\n\n /**\n * String that is displayed and that is also copied to the clipboard upon interaction.\n */\n @Prop() value!: string;\n\n /**\n * Event when copyText button is clicked.\n */\n @Event() pdsCopyTextClick: EventEmitter;\n\n private copyToClipboard = async (value: string) => {\n try {\n if (navigator.clipboard) {\n await navigator.clipboard.writeText(value);\n this.pdsCopyTextClick.emit('Copied to clipboard');\n } else {\n // falback for safari\n const el = document.createElement('textarea');\n el.value = value;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n el.focus();\n el.setSelectionRange(0, el.value.length);\n document.execCommand('copy');\n document.body.removeChild(el);\n this.pdsCopyTextClick.emit('Copied to clipboard');\n }\n } catch (err) {\n this.pdsCopyTextClick.emit(`Error writing text to clipboard: ${err}`);\n }\n };\n\n private handleClick = () => {\n this.copyToClipboard(this.value);\n };\n\n private classNames() {\n const classNames = ['pds-copytext'];\n\n if (this.border) {\n classNames.push('pds-copytext--bordered');\n }\n\n if (this.fullWidth) {\n classNames.push('pds-copytext--full-width');\n }\n\n if (this.truncate) {\n classNames.push('pds-copytext--truncated');\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host class={this.classNames()} id={this.componentId}>\n <pds-button type=\"button\" variant=\"unstyled\" onClick={this.handleClick}>\n <span>{this.value}</span>\n <pds-icon name=\"copy\" size=\"16px\"></pds-icon>\n </pds-button>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PdsDivider extends Components.PdsDivider, HTMLElement {}
4
+ export const PdsDivider: {
5
+ prototype: PdsDivider;
6
+ new (): PdsDivider;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,53 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const pdsDividerCss = ":host{--background-color:var(--pine-color-neutral-grey-400);--offset-xxs:var(--pine-spacing-xxs);--offset-xs:var(--pine-spacing-xs);--offset-sm:var(--pine-spacing-sm);--offset-md:var(--pine-spacing-md);--offset-lg:var(--pine-spacing-lg);--offset-xxl:var(--pine-spacing-2xl)}.pds-divider{background:var(--background-color);border:0;display:-ms-flexbox;display:flex;height:1px;margin:0;width:100%}.pds-divider--vertical{height:100%;width:1px}.pds-divider--offset-xxs{margin:0 calc(var(--offset-xxs) * -1);padding:0 var(--offset-xxs)}.pds-divider--offset-xxs.pds-divider--vertical{margin:calc(var(--offset-xxs) * -1) 0;padding:var(--offset-xxs) 0}.pds-divider--offset-xs{margin:0 calc(var(--offset-xs) * -1);padding:0 var(--offset-xs)}.pds-divider--offset-xs.pds-divider--vertical{margin:calc(var(--offset-xs) * -1) 0;padding:var(--offset-xs) 0}.pds-divider--offset-sm{margin:0 calc(var(--offset-sm) * -1);padding:0 var(--offset-sm)}.pds-divider--offset-sm.pds-divider--vertical{margin:calc(var(--offset-sm) * -1) 0;padding:var(--offset-sm) 0}.pds-divider--offset-md{margin:0 calc(var(--offset-md) * -1);padding:0 var(--offset-md)}.pds-divider--offset-md.pds-divider--vertical{margin:calc(var(--offset-md) * -1) 0;padding:var(--offset-md) 0}.pds-divider--offset-lg{margin:0 calc(var(--offset-lg) * -1);padding:0 var(--offset-lg)}.pds-divider--offset-lg.pds-divider--vertical{margin:calc(var(--offset-lg) * -1) 0;padding:var(--offset-lg) 0}.pds-divider--offset-xl{margin:0 calc(var(--offset-xl) * -1);padding:0 var(--offset-xl)}.pds-divider--offset-xl.pds-divider--vertical{margin:calc(var(--offset-xl) * -1) 0;padding:var(--offset-xl) 0}.pds-divider--offset-xxl{margin:0 calc(var(--offset-xxl) * -1);padding:0 var(--offset-xxl)}.pds-divider--offset-xxl.pds-divider--vertical{margin:calc(var(--offset-xxl) * -1) 0;padding:var(--offset-xxl) 0}@media (max-width: 767px){.pds-divider--vertical{display:none}}";
4
+
5
+ const PdsDivider$1 = /*@__PURE__*/ proxyCustomElement(class PdsDivider extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ this.componentId = undefined;
11
+ this.offset = undefined;
12
+ this.vertical = false;
13
+ }
14
+ classNames() {
15
+ const classNames = ['pds-divider'];
16
+ if (this.vertical) {
17
+ classNames.push('pds-divider--vertical');
18
+ }
19
+ if (this.offset) {
20
+ const offsetClassName = 'pds-divider--offset-' + this.offset;
21
+ classNames.push(offsetClassName);
22
+ }
23
+ return classNames.join(' ');
24
+ }
25
+ render() {
26
+ return (h(Host, { id: this.componentId }, h("hr", { class: this.classNames() })));
27
+ }
28
+ static get style() { return pdsDividerCss; }
29
+ }, [1, "pds-divider", {
30
+ "componentId": [1, "component-id"],
31
+ "offset": [1],
32
+ "vertical": [4]
33
+ }]);
34
+ function defineCustomElement$1() {
35
+ if (typeof customElements === "undefined") {
36
+ return;
37
+ }
38
+ const components = ["pds-divider"];
39
+ components.forEach(tagName => { switch (tagName) {
40
+ case "pds-divider":
41
+ if (!customElements.get(tagName)) {
42
+ customElements.define(tagName, PdsDivider$1);
43
+ }
44
+ break;
45
+ } });
46
+ }
47
+
48
+ const PdsDivider = PdsDivider$1;
49
+ const defineCustomElement = defineCustomElement$1;
50
+
51
+ export { PdsDivider, defineCustomElement };
52
+
53
+ //# sourceMappingURL=pds-divider.js.map
@@ -0,0 +1 @@
1
+ {"file":"pds-divider.js","mappings":";;AAAA,MAAM,aAAa,GAAG,+2DAA+2D;;MCOx3DA,YAAU;;;;;;;wBAeF,KAAK;;IAEhB,UAAU;QAChB,MAAM,UAAU,GAAG,CAAC,aAAa,CAAC,CAAC;QAEnC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,UAAU,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SAC1C;QAED,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,MAAM,eAAe,GAAG,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC;YAC7D,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SAClC;QAED,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC7B;IAED,MAAM;QACJ,QACE,EAAC,IAAI,IAAC,EAAE,EAAE,IAAI,CAAC,WAAW,IACxB,UAAI,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,GAAI,CAC3B,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsDivider"],"sources":["src/components/pds-divider/pds-divider.scss?tag=pds-divider&encapsulation=shadow","src/components/pds-divider/pds-divider.tsx"],"sourcesContent":[":host {\n --background-color: var(--pine-color-neutral-grey-400);\n --offset-xxs: var(--pine-spacing-xxs);\n --offset-xs: var(--pine-spacing-xs);\n --offset-sm: var(--pine-spacing-sm);\n --offset-md: var(--pine-spacing-md);\n --offset-lg: var(--pine-spacing-lg);\n --offset-xxl: var(--pine-spacing-2xl);\n}\n\n$pds-divider-offsets: (\n xxs: var(--offset-xxs),\n xs: var(--offset-xs),\n sm: var(--offset-sm),\n md: var(--offset-md),\n lg: var(--offset-lg),\n xl: var(--offset-xl),\n xxl: var(--offset-xxl),\n);\n\n.pds-divider {\n background: var(--background-color);\n border: 0;\n display: flex;\n height: 1px;\n margin: 0;\n width: 100%;\n}\n\n.pds-divider--vertical {\n height: 100%;\n width: 1px;\n}\n\n@each $offset, $value in $pds-divider-offsets {\n .pds-divider--offset-#{$offset} {\n margin: 0 calc($value * -1);\n padding: 0 $value;\n\n &.pds-divider--vertical {\n margin: calc($value * -1) 0;\n padding: $value 0;\n }\n }\n}\n\n@media (max-width: 767px) {\n .pds-divider--vertical {\n display: none;\n }\n}\n","import { Component, Prop, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'pds-divider',\n styleUrl: 'pds-divider.scss',\n shadow: true,\n})\nexport class PdsDivider {\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Adds offset margin/padding to expand the width (horizontal) or the height (vertical) of divider.\n */\n @Prop() offset: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';\n\n /**\n * Sets divider to display vertically\n * @defaultValue false\n */\n @Prop() vertical = false;\n\n private classNames() {\n const classNames = ['pds-divider'];\n\n if (this.vertical) {\n classNames.push('pds-divider--vertical');\n }\n\n if (this.offset) {\n const offsetClassName = 'pds-divider--offset-' + this.offset;\n classNames.push(offsetClassName);\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host id={this.componentId}>\n <hr class={this.classNames()} />\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,8 @@
1
+ import { P as PdsIcon$1, d as defineCustomElement$1 } from './pds-icon2.js';
2
+
3
+ const PdsIcon = PdsIcon$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { PdsIcon, defineCustomElement };
7
+
8
+ //# sourceMappingURL=pds-icon.js.map
@@ -0,0 +1 @@
1
+ {"file":"pds-icon.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,299 @@
1
+ import { getAssetPath, proxyCustomElement, HTMLElement, Build, h, Host } from '@stencil/core/internal/client';
2
+
3
+ let CACHED_MAP;
4
+ const getIconMap = () => {
5
+ if (typeof window === 'undefined') {
6
+ return new Map();
7
+ }
8
+ else {
9
+ if (!CACHED_MAP) {
10
+ const win = window; // eslint-disable-line @typescript-eslint/no-explicit-any
11
+ win.PdsIcons = win.PdsIcons || {};
12
+ CACHED_MAP = win.PdsIcons.map = win.PdsIcons.map || new Map();
13
+ }
14
+ return CACHED_MAP;
15
+ }
16
+ };
17
+ const getName = (iconName, icon) => {
18
+ if (!iconName && icon && !isSrc(icon)) {
19
+ iconName = icon;
20
+ }
21
+ if (isStr(iconName)) {
22
+ iconName = toLower(iconName);
23
+ }
24
+ if (!isStr(iconName) || iconName.trim() === '') {
25
+ return null;
26
+ }
27
+ const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
28
+ if (invalidChars != '') {
29
+ return null;
30
+ }
31
+ return iconName;
32
+ };
33
+ const getNamedUrl = (iconName) => {
34
+ const url = getIconMap().get(iconName);
35
+ if (url) {
36
+ return url;
37
+ }
38
+ return getAssetPath(`svg/${iconName}.svg`);
39
+ };
40
+ const getSrc = (src) => {
41
+ if (isStr(src)) {
42
+ src = src.trim();
43
+ if (isSrc(src)) {
44
+ return src;
45
+ }
46
+ }
47
+ return null;
48
+ };
49
+ const getUrl = (pdsIcon) => {
50
+ let url = getName(pdsIcon.name, pdsIcon.icon);
51
+ if (url) {
52
+ return getNamedUrl(url);
53
+ }
54
+ if (pdsIcon.icon) {
55
+ url = getSrc(pdsIcon.icon);
56
+ if (url) {
57
+ return url;
58
+ }
59
+ }
60
+ return null;
61
+ };
62
+ const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
63
+ const isStr = (val) => typeof val === 'string'; // eslint-disable-line @typescript-eslint/no-explicit-any
64
+ const toLower = (val) => val.toLowerCase();
65
+ /**
66
+ * Elements inside of web components sometimes need to inherit global attributes
67
+ * set on the host. For example, the inner input in `ion-input` should inherit
68
+ * the `title` attribute that developers set directly on `ion-input`. This
69
+ * helper function should be called in componentWillLoad and assigned to a variable
70
+ * that is later used in the render function.
71
+ *
72
+ * This does not need to be reactive as changing attributes on the host element
73
+ * does not trigger a re-render.
74
+ */
75
+ const inheritAttributes = (el, attributes = []) => {
76
+ const attributeObject = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
77
+ attributes.forEach(attr => {
78
+ if (el.hasAttribute(attr)) {
79
+ const value = el.getAttribute(attr);
80
+ if (value !== null) {
81
+ attributeObject[attr] = el.getAttribute(attr);
82
+ }
83
+ el.removeAttribute(attr);
84
+ }
85
+ });
86
+ return attributeObject;
87
+ };
88
+
89
+ const validateContent = (svgContent) => {
90
+ const div = document.createElement('div');
91
+ div.innerHTML = svgContent;
92
+ // setup this way to ensure it works on our buddy IE
93
+ for (let i = div.childNodes.length - 1; i >= 0; i--) {
94
+ if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
95
+ div.removeChild(div.childNodes[i]);
96
+ }
97
+ }
98
+ // must only have 1 root element
99
+ const svgElm = div.firstElementChild;
100
+ if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
101
+ const svgClass = svgElm.getAttribute('class') || '';
102
+ svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
103
+ // root element must be an svg
104
+ // lets double check we've got valid elements
105
+ // do not allow scripts
106
+ if (isValid(svgElm)) {
107
+ return div.innerHTML;
108
+ }
109
+ }
110
+ return '';
111
+ };
112
+ const isValid = (elm) => {
113
+ if (elm.nodeType === 1) {
114
+ if (elm.nodeName.toLowerCase() === 'script') {
115
+ return false;
116
+ }
117
+ for (let i = 0; i < elm.attributes.length; i++) {
118
+ const name = elm.attributes[i].name;
119
+ if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {
120
+ return false;
121
+ }
122
+ }
123
+ for (let i = 0; i < elm.childNodes.length; i++) {
124
+ if (!isValid(elm.childNodes[i])) {
125
+ return false;
126
+ }
127
+ }
128
+ }
129
+ return true;
130
+ };
131
+
132
+ const pdsIconContent = new Map();
133
+ const requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any
134
+ const getSvgContent = (url, sanitize = false) => {
135
+ let req = requests.get(url);
136
+ if (!req) {
137
+ if (typeof fetch != 'undefined' && typeof document !== 'undefined') {
138
+ // we don't have a request
139
+ req = fetch(url).then((rsp) => {
140
+ if (rsp.ok) {
141
+ return rsp.text().then((svgContent) => {
142
+ if (svgContent && sanitize !== false) {
143
+ svgContent = validateContent(svgContent);
144
+ }
145
+ pdsIconContent.set(url, svgContent || '');
146
+ });
147
+ }
148
+ pdsIconContent.set(url, '');
149
+ });
150
+ requests.set(url, req);
151
+ }
152
+ else {
153
+ pdsIconContent.set(url, '');
154
+ return Promise.resolve();
155
+ }
156
+ }
157
+ return req;
158
+ };
159
+
160
+ const pdsIconCss = ":host{contain:strict;display:inline-block;fill:currentColor;height:1em;width:1em}:host .pdsicon{fill:currentColor}.pds-icon-fill-none{fill:none}.icon-inner,.pds-icon,svg{display:block;height:100%;width:100%}";
161
+
162
+ const PdsIcon = /*@__PURE__*/ proxyCustomElement(class PdsIcon extends HTMLElement {
163
+ constructor() {
164
+ super();
165
+ this.__registerHost();
166
+ this.__attachShadow();
167
+ this.inheritedAttributes = {}; // eslint-disable-line @typescript-eslint/no-explicit-any
168
+ this.hasAriaHidden = () => {
169
+ const { el } = this;
170
+ return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';
171
+ };
172
+ this.ariaLabel = undefined;
173
+ this.isVisible = false;
174
+ this.svgContent = undefined;
175
+ this.color = undefined;
176
+ this.icon = undefined;
177
+ this.name = undefined;
178
+ this.size = 'regular';
179
+ }
180
+ iconSize() {
181
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
182
+ const sizes = {
183
+ small: '12px',
184
+ regular: '16px',
185
+ medium: '20px',
186
+ large: '24px',
187
+ };
188
+ if (sizes[this.size]) {
189
+ return sizes[this.size];
190
+ }
191
+ else {
192
+ return this.size;
193
+ }
194
+ }
195
+ componentWillLoad() {
196
+ this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
197
+ }
198
+ connectedCallback() {
199
+ this.waitUntilVisible(this.el, '50px', () => {
200
+ this.isVisible = true;
201
+ this.loadIcon();
202
+ });
203
+ }
204
+ disconnectedCallback() {
205
+ if (this.io) {
206
+ this.io.disconnect();
207
+ this.io = undefined;
208
+ }
209
+ }
210
+ loadIcon() {
211
+ if (Build.isBrowser && this.isVisible) {
212
+ const url = getUrl(this);
213
+ if (url) {
214
+ if (pdsIconContent.has(url)) {
215
+ this.svgContent = pdsIconContent.get(url);
216
+ }
217
+ else {
218
+ getSvgContent(url).then(() => (this.svgContent = pdsIconContent.get(url)));
219
+ }
220
+ }
221
+ }
222
+ const label = getName(this.name, this.icon);
223
+ if (label) {
224
+ this.ariaLabel = label.replace(/\-/g, ' ');
225
+ }
226
+ }
227
+ render() {
228
+ const { ariaLabel, inheritedAttributes } = this;
229
+ const style = {
230
+ height: this.iconSize(),
231
+ width: this.iconSize(),
232
+ color: this.color,
233
+ };
234
+ return (h(Host, Object.assign({ "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: "img", style: style, class: Object.assign({}, createColorClasses(this.color)) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
235
+ }
236
+ /*****
237
+ * Private Methods
238
+ ****/
239
+ waitUntilVisible(el, rootMargin, cb) {
240
+ if (Build.isBrowser && typeof window !== 'undefined' && (window).IntersectionObserver) {
241
+ const io = (this.io = new (window).IntersectionObserver((data) => {
242
+ if (data[0].isIntersecting) {
243
+ io.disconnect();
244
+ this.io = undefined;
245
+ cb();
246
+ }
247
+ }, { rootMargin }));
248
+ io.observe(el);
249
+ }
250
+ else {
251
+ // browser doesn't support IntersectionObserver
252
+ // so just fallback to always show it
253
+ cb();
254
+ }
255
+ }
256
+ static get assetsDirs() { return ["svg"]; }
257
+ get el() { return this; }
258
+ static get watchers() { return {
259
+ "name": ["loadIcon"],
260
+ "icon": ["loadIcon"]
261
+ }; }
262
+ static get style() { return pdsIconCss; }
263
+ }, [1, "pds-icon", {
264
+ "color": [1],
265
+ "icon": [8],
266
+ "name": [513],
267
+ "size": [513],
268
+ "ariaLabel": [32],
269
+ "isVisible": [32],
270
+ "svgContent": [32]
271
+ }, undefined, {
272
+ "name": ["loadIcon"],
273
+ "icon": ["loadIcon"]
274
+ }]);
275
+ const createColorClasses = (color) => {
276
+ return color
277
+ ? {
278
+ 'pds-color': true,
279
+ [`pds-color-${color}`]: true,
280
+ }
281
+ : null;
282
+ };
283
+ function defineCustomElement() {
284
+ if (typeof customElements === "undefined") {
285
+ return;
286
+ }
287
+ const components = ["pds-icon"];
288
+ components.forEach(tagName => { switch (tagName) {
289
+ case "pds-icon":
290
+ if (!customElements.get(tagName)) {
291
+ customElements.define(tagName, PdsIcon);
292
+ }
293
+ break;
294
+ } });
295
+ }
296
+
297
+ export { PdsIcon as P, defineCustomElement as d };
298
+
299
+ //# sourceMappingURL=pds-icon2.js.map
@@ -0,0 +1 @@
1
+ {"file":"pds-icon2.js","mappings":";;AACA,IAAI,UAAU,CAAC;AAKR,MAAM,UAAU,GAAG,MAAM;AAChC,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,IAAI,GAAG,EAAE,CAAC;AACzB,KAAK;AACL,SAAS;AACT,QAAQ,IAAI,CAAC,UAAU,EAAE;AACzB,YAAY,MAAM,GAAG,GAAG,MAAM,CAAC;AAC/B,YAAY,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;AAC9C,YAAY,UAAU,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC;AAC1E,SAAS;AACT,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,CAAC,CAAC;AACK,MAAM,OAAO,GAAG,CA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KAAK,WAAW,IAAI,CAAC,MAAM,EAAE,oBAAoB,EAAE;YACnF,MAAM,EAAE,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,IAAI;gBACzD,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE;oBACxB,EAAE,CAAC,UAAU,EAAE,CAAC;oBAChB,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC;oBACpB,EAAE,EAAE,CAAC;iBACR;aACJ,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;YACpB,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;SAClB;aACI;;;YAGD,EAAE,EAAE,CAAC;SACR;KACJ;IAaD,WAAW,UAAU,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;AA4F/C,MAAM,kBAAkB,GAAG,CAAC,KAAK;IAC7B,OAAO,KAAK;UACN;YACE,WAAW,EAAE,IAAI;YACjB,CAAC,aAAa,KAAK,EAAE,GAAG,IAAI;SAC/B;UACC,IAAI,CAAC;AACf,CAAC,CAAC;;;;;;;;;;;;;;;;;","names":[],"sources":["../../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 { getAssetPath } from \"@stencil/core\";\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 = 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 `ion-input` should inherit\n * the `title` attribute that developers set directly on `ion-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-ion-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};\n//# sourceMappingURL=validate.js.map\n","import { validateContent } from \"./validate\";\nexport const pdsIconContent = new Map();\nconst requests = new Map(); // eslint-disable-line @typescript-eslint/no-explicit-any\nexport const getSvgContent = (url, sanitize = false) => {\n let req = requests.get(url);\n if (!req) {\n if (typeof fetch != 'undefined' && typeof document !== 'undefined') {\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 else {\n pdsIconContent.set(url, '');\n return Promise.resolve();\n }\n }\n return req;\n};\n//# sourceMappingURL=request.js.map\n",":host {\n contain: strict;\n display: inline-block;\n fill: currentColor;\n height: 1em;\n width: 1em;\n}\n:host .pdsicon {\n fill: currentColor;\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.hasAriaHidden = () => {\n const { el } = this;\n return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';\n };\n this.ariaLabel = undefined;\n this.isVisible = false;\n this.svgContent = undefined;\n this.color = undefined;\n this.icon = undefined;\n this.name = undefined;\n this.size = 'regular';\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 componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);\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 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 const style = {\n height: this.iconSize(),\n width: this.iconSize(),\n color: this.color,\n };\n return (h(Host, Object.assign({ \"aria-label\": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: \"img\", style: style, 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 \"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 \"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 \"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 \"attribute\": \"size\",\n \"reflect\": true,\n \"defaultValue\": \"'regular'\"\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\": \"name\",\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"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PdsImage extends Components.PdsImage, HTMLElement {}
4
+ export const PdsImage: {
5
+ prototype: PdsImage;
6
+ new (): PdsImage;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,54 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const pdsImageCss = ":host{--image-aspect-ratio:auto;display:inline-block}img{aspect-ratio:var(--image-aspect-ratio);height:auto;width:100%}";
4
+
5
+ const PdsImage$1 = /*@__PURE__*/ proxyCustomElement(class PdsImage extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ this.alt = '';
11
+ this.componentId = undefined;
12
+ this.height = undefined;
13
+ this.loading = 'eager';
14
+ this.sizes = undefined;
15
+ this.src = undefined;
16
+ this.srcset = undefined;
17
+ this.width = undefined;
18
+ }
19
+ render() {
20
+ return (h(Host, { class: {
21
+ 'pds-image': true,
22
+ }, id: this.componentId }, h("img", { alt: this.alt, height: this.height, loading: this.loading, sizes: this.sizes, src: this.src, srcset: this.srcset, width: this.width })));
23
+ }
24
+ static get style() { return pdsImageCss; }
25
+ }, [1, "pds-image", {
26
+ "alt": [1],
27
+ "componentId": [1, "component-id"],
28
+ "height": [2],
29
+ "loading": [1],
30
+ "sizes": [1],
31
+ "src": [1],
32
+ "srcset": [1],
33
+ "width": [2]
34
+ }]);
35
+ function defineCustomElement$1() {
36
+ if (typeof customElements === "undefined") {
37
+ return;
38
+ }
39
+ const components = ["pds-image"];
40
+ components.forEach(tagName => { switch (tagName) {
41
+ case "pds-image":
42
+ if (!customElements.get(tagName)) {
43
+ customElements.define(tagName, PdsImage$1);
44
+ }
45
+ break;
46
+ } });
47
+ }
48
+
49
+ const PdsImage = PdsImage$1;
50
+ const defineCustomElement = defineCustomElement$1;
51
+
52
+ export { PdsImage, defineCustomElement };
53
+
54
+ //# sourceMappingURL=pds-image.js.map
@@ -0,0 +1 @@
1
+ {"file":"pds-image.js","mappings":";;AAAA,MAAM,WAAW,GAAG,yHAAyH;;MCOhIA,UAAQ;;;;;mBAKJ,EAAE;;;uBAiBoB,OAAO;;;;;;IA0B5C,MAAM;QACJ,QACE,EAAC,IAAI,IACH,KAAK,EAAE;gBACL,WAAW,EAAE,IAAI;aAClB,EACD,EAAE,EAAE,IAAI,CAAC,WAAW,IAEpB,WACE,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACG,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsImage"],"sources":["src/components/pds-image/pds-image.scss?tag=pds-image&encapsulation=shadow","src/components/pds-image/pds-image.tsx"],"sourcesContent":[":host {\n /**\n * @prop --image-aspect-ratio: The image's aspect ratio.\n */\n\n --image-aspect-ratio: auto;\n display: inline-block;\n}\n\nimg {\n aspect-ratio: var(--image-aspect-ratio);\n height: auto;\n width: 100%;\n}","import { Component, Host, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'pds-image',\n styleUrl: 'pds-image.scss',\n shadow: true,\n})\nexport class PdsImage {\n /**\n * The image's alt tag. If none is provided,\n * it will default to an empty string.\n */\n @Prop() alt? = '';\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * The height of the image in pixels. Setting this will\n * devote space in the layout to prevent layout\n * shifts when the image is loaded.\n */\n @Prop() height?: number;\n\n /**\n * Indicates how the browser should load the image.\n */\n @Prop() loading?: 'eager' | 'lazy' = 'eager';\n\n /**\n * Determines the intended display size of an image\n * within certian breakpoints. Has no effect if `srcset`\n * is not set or value has no width descriptor.\n */\n @Prop() sizes?: string;\n\n /**\n * The image's source.\n */\n @Prop() src: string;\n\n /**\n * A set of image sources for the browser to use.\n */\n @Prop() srcset?: string\n\n /**\n * The width of the image in pixels. Setting this will\n * devote space in the layout to prevent layout\n * shifts when the image is loaded.\n */\n @Prop() width?: number;\n\n render() {\n return (\n <Host\n class={{\n 'pds-image': true,\n }}\n id={this.componentId}\n >\n <img\n alt={this.alt}\n height={this.height}\n loading={this.loading}\n sizes={this.sizes}\n src={this.src}\n srcset={this.srcset}\n width={this.width}\n />\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface PdsInput extends Components.PdsInput, HTMLElement {}
4
+ export const PdsInput: {
5
+ prototype: PdsInput;
6
+ new (): PdsInput;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;