@usecapsule/core-components 3.3.0-dev.2 → 3.3.0-dev.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. package/css/capsule-core.css +25 -10
  2. package/css/capsule-core.css.map +1 -1
  3. package/dist/capsule/capsule.esm.js +1 -1
  4. package/dist/capsule/capsule.esm.js.map +1 -1
  5. package/dist/capsule/index.esm.js +1 -1
  6. package/dist/capsule/index.esm.js.map +1 -1
  7. package/dist/capsule/p-0e558c7f.entry.js +10 -0
  8. package/dist/capsule/{p-05cb769b.entry.js.map → p-0e558c7f.entry.js.map} +1 -1
  9. package/dist/capsule/{p-69c3c53b.entry.js → p-1bd11889.entry.js} +2 -2
  10. package/dist/capsule/{p-69c3c53b.entry.js.map → p-1bd11889.entry.js.map} +1 -1
  11. package/dist/capsule/p-32cdf894.entry.js +2 -0
  12. package/dist/capsule/p-32cdf894.entry.js.map +1 -0
  13. package/dist/capsule/p-3b042fd1.entry.js +2 -0
  14. package/dist/capsule/p-5965b15e.entry.js +2 -0
  15. package/dist/capsule/{p-c1aa1ffb.entry.js.map → p-5965b15e.entry.js.map} +1 -1
  16. package/dist/capsule/{p-742bda0b.entry.js → p-5d62e610.entry.js} +2 -2
  17. package/dist/capsule/p-60508b1e.entry.js +20 -0
  18. package/dist/capsule/p-60508b1e.entry.js.map +1 -0
  19. package/dist/cjs/capsule.cjs.js +1 -1
  20. package/dist/cjs/{cpsl-alert_33.cjs.entry.js → cpsl-alert_34.cjs.entry.js} +17028 -13461
  21. package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -0
  22. package/dist/cjs/cpsl-animation.cjs.entry.js +3 -2
  23. package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
  24. package/dist/cjs/cpsl-hero.cjs.entry.js +9 -6
  25. package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
  26. package/dist/cjs/cpsl-identicon.cjs.entry.js +1 -1
  27. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  28. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  29. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +1 -1
  30. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
  31. package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
  32. package/dist/cjs/index-65f57499.js +2 -2
  33. package/dist/cjs/index.cjs.js +35 -12
  34. package/dist/cjs/index.cjs.js.map +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +3 -0
  37. package/dist/collection/assets/icons/bank.svg +3 -0
  38. package/dist/collection/assets/icons/credit-card.svg +3 -0
  39. package/dist/collection/assets/icons/dot.svg +3 -0
  40. package/dist/collection/assets/icons/download.svg +3 -0
  41. package/dist/collection/assets/icons/globe.svg +3 -0
  42. package/dist/collection/assets/icons/hero-alert-circle.svg +3 -0
  43. package/dist/collection/assets/icons/hero-checkmark-capsule.svg +11 -0
  44. package/dist/collection/assets/icons/hero-checkmark.svg +3 -0
  45. package/dist/collection/assets/icons/hero-external-connection.svg +71 -0
  46. package/dist/collection/assets/icons/index.js +21 -1
  47. package/dist/collection/assets/icons/index.js.map +1 -1
  48. package/dist/collection/assets/icons/link-external.svg +3 -0
  49. package/dist/collection/assets/icons/log-out.svg +3 -0
  50. package/dist/collection/assets/icons/moonpay-brand.svg +10 -0
  51. package/dist/collection/assets/icons/puzzle-piece.svg +3 -0
  52. package/dist/collection/assets/icons/qr-code-02.svg +3 -0
  53. package/dist/collection/assets/icons/qr-code.svg +3 -0
  54. package/dist/collection/assets/icons/refresh.svg +3 -3
  55. package/dist/collection/assets/icons/search.svg +3 -0
  56. package/dist/collection/assets/icons/send.svg +3 -0
  57. package/dist/collection/assets/icons/shield.svg +3 -0
  58. package/dist/collection/assets/icons/stripe-brand.svg +3 -0
  59. package/dist/collection/collection-manifest.json +2 -1
  60. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  61. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  62. package/dist/collection/components/{cpsl-modal/cpsl-modal.css → cpsl-auth-modal/cpsl-auth-modal.css} +33 -58
  63. package/dist/collection/components/{cpsl-modal/cpsl-modal.js → cpsl-auth-modal/cpsl-auth-modal.js} +11 -129
  64. package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +1 -0
  65. package/dist/collection/components/cpsl-button/cpsl-button.css +89 -2
  66. package/dist/collection/components/cpsl-button/cpsl-button.js +6 -5
  67. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  68. package/dist/collection/components/cpsl-button/cpsl-button.stories.js.map +1 -1
  69. package/dist/collection/components/cpsl-card/cpsl-card.css +5 -2
  70. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +3 -0
  71. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +11 -7
  72. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  73. package/dist/collection/components/cpsl-divider/cpsl-divider.css +2 -1
  74. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +1 -1
  75. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  76. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +2 -2
  77. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  78. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +1 -6
  79. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
  80. package/dist/collection/components/cpsl-hero/cpsl-hero.css +136 -71
  81. package/dist/collection/components/cpsl-hero/cpsl-hero.js +63 -9
  82. package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
  83. package/dist/collection/components/cpsl-icon/cpsl-icon.css +8 -0
  84. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  85. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +97 -0
  86. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +121 -0
  87. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +1 -0
  88. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
  89. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -2
  90. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  91. package/dist/collection/components/cpsl-input/cpsl-input.css +21 -2
  92. package/dist/collection/components/cpsl-input/cpsl-input.js +100 -28
  93. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  94. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +1 -1
  95. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
  96. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  97. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  98. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  99. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  100. package/dist/collection/components/cpsl-popover/cpsl-popover.css +2 -0
  101. package/dist/collection/components/cpsl-popover/cpsl-popover.js +9 -11
  102. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
  103. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +12 -3
  104. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +28 -23
  105. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -1
  106. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  107. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  108. package/dist/collection/components/cpsl-select/cpsl-select.css +17 -0
  109. package/dist/collection/components/cpsl-select/cpsl-select.js +95 -5
  110. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  111. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
  112. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -1
  113. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  114. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
  115. package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +30 -8
  116. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +5 -7
  117. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
  118. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  119. package/dist/collection/components/cpsl-tab/cpsl-tab.css +24 -1
  120. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  121. package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
  122. package/dist/collection/components/cpsl-table/cpsl-table.js +1 -9
  123. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  124. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +1 -4
  125. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +1 -4
  126. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  127. package/dist/collection/components/cpsl-text/cpsl-text.css +19 -0
  128. package/dist/collection/components/cpsl-text/cpsl-text.js +5 -4
  129. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  130. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -1
  131. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  132. package/dist/collection/interface.js.map +1 -1
  133. package/dist/collection/utils/theme/generateBorderRadii.js +4 -3
  134. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  135. package/dist/collection/utils/theme/generatePalette.js +22 -6
  136. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  137. package/dist/collection/utils/theme/generateTheme.js +9 -3
  138. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  139. package/dist/collection/utils/theme/utils.js.map +1 -1
  140. package/dist/esm/capsule.js +1 -1
  141. package/dist/esm/{cpsl-alert_33.entry.js → cpsl-alert_34.entry.js} +17029 -13463
  142. package/dist/esm/cpsl-alert_34.entry.js.map +1 -0
  143. package/dist/esm/cpsl-animation.entry.js +2 -1
  144. package/dist/esm/cpsl-animation.entry.js.map +1 -1
  145. package/dist/esm/cpsl-hero.entry.js +10 -7
  146. package/dist/esm/cpsl-hero.entry.js.map +1 -1
  147. package/dist/esm/cpsl-identicon.entry.js +1 -1
  148. package/dist/esm/cpsl-info-box.entry.js +2 -2
  149. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  150. package/dist/esm/cpsl-modal-v2.entry.js +1 -1
  151. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
  152. package/dist/esm/cpsl-row.entry.js +1 -1
  153. package/dist/esm/index-91db3414.js +2 -2
  154. package/dist/esm/index.js +35 -12
  155. package/dist/esm/index.js.map +1 -1
  156. package/dist/esm/loader.js +1 -1
  157. package/dist/types/assets/icons/index.d.ts +20 -0
  158. package/dist/types/components/{cpsl-modal/cpsl-modal.d.ts → cpsl-auth-modal/cpsl-auth-modal.d.ts} +3 -23
  159. package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -2
  160. package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +18 -3
  161. package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +20 -0
  162. package/dist/types/components/cpsl-input/cpsl-input.d.ts +13 -3
  163. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +2 -2
  164. package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +1 -0
  165. package/dist/types/components/cpsl-select/cpsl-select.d.ts +22 -1
  166. package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
  167. package/dist/types/components.d.ts +222 -146
  168. package/dist/types/interface.d.ts +13 -0
  169. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  170. package/dist/types/utils/theme/generatePalette.d.ts +4 -2
  171. package/dist/types/utils/theme/generateTheme.d.ts +1 -1
  172. package/package.json +3 -2
  173. package/dist/capsule/p-0462f723.js +0 -2
  174. package/dist/capsule/p-0462f723.js.map +0 -1
  175. package/dist/capsule/p-05cb769b.entry.js +0 -10
  176. package/dist/capsule/p-0eea90f8.entry.js +0 -2
  177. package/dist/capsule/p-4203888d.entry.js +0 -29
  178. package/dist/capsule/p-4203888d.entry.js.map +0 -1
  179. package/dist/capsule/p-c1aa1ffb.entry.js +0 -2
  180. package/dist/capsule/p-d351f076.entry.js +0 -2
  181. package/dist/capsule/p-d351f076.entry.js.map +0 -1
  182. package/dist/cjs/_commonjsHelpers-b3309d7b.js +0 -12
  183. package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
  184. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +0 -1
  185. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +0 -1
  186. package/dist/esm/_commonjsHelpers-1789f0cf.js +0 -9
  187. package/dist/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
  188. package/dist/esm/cpsl-alert_33.entry.js.map +0 -1
  189. /package/dist/capsule/{p-0eea90f8.entry.js.map → p-3b042fd1.entry.js.map} +0 -0
  190. /package/dist/capsule/{p-742bda0b.entry.js.map → p-5d62e610.entry.js.map} +0 -0
@@ -0,0 +1,121 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { Icons } from "../../assets/icons";
3
+ function isOfTypeIconType(key) {
4
+ return Object.keys(Icons).includes(key);
5
+ }
6
+ export class CpslIconGroup {
7
+ constructor() {
8
+ this.isHovered = undefined;
9
+ this.expandFrom = 'right';
10
+ this.disabled = false;
11
+ this.icons = undefined;
12
+ }
13
+ componentDidLoad() {
14
+ this.el.addEventListener('mouseover', () => {
15
+ this.isHovered = true;
16
+ });
17
+ this.el.addEventListener('mouseout', () => {
18
+ this.isHovered = false;
19
+ });
20
+ }
21
+ disconnectedCallback() {
22
+ this.el.removeEventListener('mouseover', () => {
23
+ this.isHovered = true;
24
+ });
25
+ this.el.removeEventListener('mouseout', () => {
26
+ this.isHovered = false;
27
+ });
28
+ }
29
+ render() {
30
+ // If disabled remove all brand icons to ensure the disabled color is shown correctly
31
+ const icons = this.disabled ? this.icons.map(icon => icon.replace('Brand', '')) : this.icons;
32
+ return (h(Host, { key: '4c81ff12c46582623d226e8a7f3078ff279bc8ae' }, icons.map((icon, index) => {
33
+ const isIcon = isOfTypeIconType(icon);
34
+ return (h("span", { part: "icon-container", class: {
35
+ 'icon-container': true,
36
+ 'expanded': !this.disabled && this.isHovered && (this.expandFrom === 'right' ? index !== this.icons.length - 1 : index === 0),
37
+ 'disabled': this.disabled,
38
+ }, style: { zIndex: `${this.icons.length - index}` } }, h("cpsl-icon", { key: icon, icon: isIcon ? icon : undefined, src: !isIcon ? icon : undefined })));
39
+ })));
40
+ }
41
+ static get is() { return "cpsl-icon-group"; }
42
+ static get encapsulation() { return "shadow"; }
43
+ static get originalStyleUrls() {
44
+ return {
45
+ "$": ["cpsl-icon-group.scss"]
46
+ };
47
+ }
48
+ static get styleUrls() {
49
+ return {
50
+ "$": ["cpsl-icon-group.css"]
51
+ };
52
+ }
53
+ static get properties() {
54
+ return {
55
+ "expandFrom": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "'left' | 'right'",
60
+ "resolved": "\"left\" | \"right\"",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": "The direction the icons should expand from"
68
+ },
69
+ "attribute": "expand-from",
70
+ "reflect": false,
71
+ "defaultValue": "'right'"
72
+ },
73
+ "disabled": {
74
+ "type": "boolean",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "boolean",
78
+ "resolved": "boolean",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": "If `true`, the user cannot interact with the input."
86
+ },
87
+ "attribute": "disabled",
88
+ "reflect": false,
89
+ "defaultValue": "false"
90
+ },
91
+ "icons": {
92
+ "type": "unknown",
93
+ "mutable": false,
94
+ "complexType": {
95
+ "original": "(IconType | string)[]",
96
+ "resolved": "string[]",
97
+ "references": {
98
+ "IconType": {
99
+ "location": "import",
100
+ "path": "../../interface",
101
+ "id": "src/interface.ts::IconType"
102
+ }
103
+ }
104
+ },
105
+ "required": false,
106
+ "optional": false,
107
+ "docs": {
108
+ "tags": [],
109
+ "text": "The name of the icons to display."
110
+ }
111
+ }
112
+ };
113
+ }
114
+ static get states() {
115
+ return {
116
+ "isHovered": {}
117
+ };
118
+ }
119
+ static get elementRef() { return "el"; }
120
+ }
121
+ //# sourceMappingURL=cpsl-icon-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpsl-icon-group.js","sourceRoot":"","sources":["../../../../src/components/cpsl-icon-group/cpsl-icon-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,SAAS,gBAAgB,CAAC,GAAW;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC;AAOD,MAAM,OAAO,aAAa;;;0BAQe,OAAO;wBAK3B,KAAK;;;IAOxB,gBAAgB;QACd,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE;YACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,UAAU,EAAE,GAAG,EAAE;YACxC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, State } from '@stencil/core';\nimport { IconType } from '../../interface';\nimport { Icons } from '../../assets/icons';\n\nfunction isOfTypeIconType(key: string): key is IconType {\n return Object.keys(Icons).includes(key);\n}\n\n@Component({\n tag: 'cpsl-icon-group',\n styleUrl: 'cpsl-icon-group.scss',\n shadow: true,\n})\nexport class CpslIconGroup {\n @Element() el!: HTMLCpslIconGroupElement;\n\n @State() isHovered: boolean;\n\n /**\n * The direction the icons should expand from\n */\n @Prop() expandFrom: 'left' | 'right' = 'right';\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * The name of the icons to display.\n */\n @Prop() icons: (IconType | string)[];\n\n componentDidLoad() {\n this.el.addEventListener('mouseover', () => {\n this.isHovered = true;\n });\n this.el.addEventListener('mouseout', () => {\n this.isHovered = false;\n });\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('mouseover', () => {\n this.isHovered = true;\n });\n this.el.removeEventListener('mouseout', () => {\n this.isHovered = false;\n });\n }\n\n render() {\n // If disabled remove all brand icons to ensure the disabled color is shown correctly\n const icons = this.disabled ? this.icons.map(icon => icon.replace('Brand', '')) : this.icons;\n\n return (\n <Host>\n {icons.map((icon, index) => {\n const isIcon = isOfTypeIconType(icon);\n\n return (\n <span\n part=\"icon-container\"\n class={{\n 'icon-container': true,\n 'expanded': !this.disabled && this.isHovered && (this.expandFrom === 'right' ? index !== this.icons.length - 1 : index === 0),\n 'disabled': this.disabled,\n }}\n style={{ zIndex: `${this.icons.length - index}` }}\n >\n <cpsl-icon key={icon} icon={isIcon ? icon : undefined} src={!isIcon ? icon : undefined} />\n </span>\n );\n })}\n </Host>\n );\n }\n}\n"]}
@@ -28,7 +28,7 @@ export class CpslIdenticon {
28
28
  [shapeA, shapeB, shapeC, shapeD],
29
29
  [rotationA, rotationB, rotationC, rotationD],
30
30
  ];
31
- return (h(Host, { key: '9e7e42f8de3d9611e30bf8c193d4ff8864805dd9', class: {
31
+ return (h(Host, { key: '39bcae00e3fd58ff94639fbb43c77fd942899e51', class: {
32
32
  red: color === 'red',
33
33
  orange: color === 'orange',
34
34
  yellow: color === 'yellow',
@@ -71,7 +71,6 @@
71
71
  padding-top: var(--box-padding-top);
72
72
  padding-bottom: var(--box-padding-bottom);
73
73
  display: flex;
74
- background: var(--cpsl-color-background-secondary);
75
- border: var(--box-border-width) solid var(--cpsl-color-input-border-placeholder);
74
+ background: var(--cpsl-color-background-4);
76
75
  border-radius: var(--box-border-radius);
77
76
  }
@@ -1,7 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  export class CpslInfoBox {
3
3
  render() {
4
- return (h(Host, { key: '71bc7e0e6976741e4da0fcc6d0135037c416d663' }, h("div", { key: 'd7c1f41e2d60c1e7319ea93b740dc789061f6f2b', class: "info-box-container" }, h("slot", { key: '84681d40c32832a00874901eb9e75679313f2034' }))));
4
+ return (h(Host, { key: '363605fc58be1a71b771e4d839654c6198fb9988' }, h("div", { key: '7b56cdfbb5db9ee33d906a9235ffd89fce06962f', class: "info-box-container" }, h("slot", { key: '868bc4bdb1f1817d2f918a7c5a1c50582c4545f7' }))));
5
5
  }
6
6
  static get is() { return "cpsl-info-box"; }
7
7
  static get encapsulation() { return "shadow"; }
@@ -73,6 +73,7 @@
73
73
  --input-color: var(--cpsl-color-text-primary);
74
74
  --input-placeholder-color: var(--cpsl-color-text-secondary);
75
75
  --input-font-size: var(--cpsl-font-size-body-m);
76
+ --input-font-weight: 400;
76
77
  --optional-label-color: var(--cpsl-color-text-secondary);
77
78
  --label-color: var(--cpsl-color-text-primary);
78
79
  --label-font-size: var(--cpsl-font-size-body-s);
@@ -84,13 +85,17 @@
84
85
  --helper-text-icon-size: 16px;
85
86
  --helper-text-font-size: var(--cpsl-font-size-body-xs);
86
87
  --helper-text-margin-top: 0px;
87
- --button-padding: 4px;
88
+ --button-padding: 8px;
88
89
  display: flex;
89
90
  flex-direction: column;
90
91
  gap: 4px;
91
92
  font-family: var(--cpsl-font-family, inherit);
92
93
  }
93
94
 
95
+ :host(.contrast-text) {
96
+ --input-color: var(--cpsl-color-contrast);
97
+ }
98
+
94
99
  :host(:not(.has-value)) {
95
100
  --container-border-color: var(--cpsl-color-input-border-placeholder);
96
101
  --input-color: var(--cpsl-color-text-secondary);
@@ -140,6 +145,7 @@
140
145
  height: 100%;
141
146
  box-sizing: border-box;
142
147
  font-size: var(--input-font-size);
148
+ font-weight: var(--input-font-weight);
143
149
  color: var(--input-color);
144
150
  background: var(--input-background-color);
145
151
  font-family: var(--cpsl-font-family, inherit);
@@ -151,6 +157,15 @@
151
157
  color: var(--input-placeholder-color);
152
158
  opacity: 1; /* Firefox */
153
159
  }
160
+ .native-input::-moz-selection {
161
+ /* Code for Firefox */
162
+ color: var(--cpsl-color-text-inverted);
163
+ background: var(--cpsl-color-background-64);
164
+ }
165
+ .native-input::selection {
166
+ color: var(--cpsl-color-text-inverted);
167
+ background: var(--cpsl-color-background-64);
168
+ }
154
169
 
155
170
  .label {
156
171
  display: inline-block;
@@ -201,7 +216,11 @@
201
216
  :host ::slotted(cpsl-button) {
202
217
  width: calc(var(--container-height) - var(--button-padding) * 2);
203
218
  height: calc(var(--container-height) - var(--button-padding) * 2);
204
- --button-border-radius: calc(var(--container-border-radius) - 2px);
219
+ --button-border-radius: calc(var(--container-border-radius) - 4px);
220
+ --button-padding-top: 4px;
221
+ --button-padding-start: 4px;
222
+ --button-padding-end: 4px;
223
+ --button-padding-bottom: 4px;
205
224
  }
206
225
  :host slot[name=end]::slotted(cpsl-button) {
207
226
  margin-right: calc((var(--container-padding-end) - var(--button-padding)) * -1);
@@ -1,11 +1,15 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import IMask from "imask/esm/imask";
3
+ import "imask/esm/masked/pattern";
2
4
  export class CpslInput {
3
5
  constructor() {
4
6
  this.inputId = `cpsl-input-${inputIds++}`;
5
7
  this.onInput = (ev) => {
8
+ var _a, _b, _c;
6
9
  const input = ev.target;
7
- if (input) {
8
- this.value = input.value || '';
10
+ (_a = this.maskedInput) === null || _a === void 0 ? void 0 : _a._onInput(ev);
11
+ if (Boolean(input)) {
12
+ this.value = (_c = (_b = this.maskedInput) === null || _b === void 0 ? void 0 : _b.unmaskedValue) !== null && _c !== void 0 ? _c : (input.value || '');
9
13
  input.value === '' ? this.disableSlots() : this.enableSlots();
10
14
  }
11
15
  this.emitInputChange(ev);
@@ -30,15 +34,20 @@ export class CpslInput {
30
34
  this.cpslFocus.emit(ev);
31
35
  };
32
36
  this.onPaste = (ev) => {
33
- var _a;
37
+ var _a, _b, _c, _d;
34
38
  ev.stopPropagation();
35
39
  ev.preventDefault();
36
40
  const input = ev.target;
37
41
  const pasteData = ((_a = ev.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text')) || '';
38
- // Manually set the value
39
- input.value = input.value + pasteData;
40
- this.value = this.value + pasteData;
41
- pasteData === '' ? this.disableSlots() : this.enableSlots();
42
+ // Manually set the value & cursor position
43
+ const initialSelectionStart = input.selectionStart;
44
+ const newVal = `${input.value.slice(0, input.selectionStart)}${pasteData}${input.value.slice(input.selectionEnd, input.value.length)}`;
45
+ input.value = newVal;
46
+ // this.value = newVal;
47
+ input.selectionEnd = initialSelectionStart + pasteData.length;
48
+ (_b = this.maskedInput) === null || _b === void 0 ? void 0 : _b._onInput(Object.assign(Object.assign({}, ev), { target: input }));
49
+ this.value = (_d = (_c = this.maskedInput) === null || _c === void 0 ? void 0 : _c.unmaskedValue) !== null && _d !== void 0 ? _d : (input.value || '');
50
+ this.value === '' ? this.disableSlots() : this.enableSlots();
42
51
  // Emit the cpslPaste event
43
52
  this.cpslPaste.emit(ev);
44
53
  // Emit the cpslChange event since the value was modified by paste
@@ -48,14 +57,17 @@ export class CpslInput {
48
57
  this.nativeInput.focus();
49
58
  };
50
59
  this.hasFocus = false;
60
+ this.maskedInput = undefined;
51
61
  this.autocapitalize = 'off';
52
62
  this.autocomplete = 'off';
53
63
  this.autocorrect = 'off';
54
64
  this.noAutoDisable = undefined;
55
65
  this.autofocus = false;
56
66
  this.disabled = false;
67
+ this.contrastText = false;
57
68
  this.enterkeyhint = undefined;
58
69
  this.errorText = undefined;
70
+ this.mask = undefined;
59
71
  this.helperText = undefined;
60
72
  this.inputmode = undefined;
61
73
  this.label = undefined;
@@ -85,18 +97,39 @@ export class CpslInput {
85
97
  this.enableSlots();
86
98
  }
87
99
  }
88
- /**
89
- * Update the native input element when the value changes
90
- */
91
- // @Watch('value')
92
- // protected valueChanged() {
93
- // const nativeInput = this.nativeInput;
94
- // const value = this.value;
95
- // if (nativeInput && nativeInput.value !== value) {
96
- // nativeInput.value = value;
97
- // }
98
- // Boolean(value) ? this.disableSlots() : this.enableSlots();
99
- // }
100
+ handleSetupMask() {
101
+ var _a, _b;
102
+ if (this.nativeInput) {
103
+ if (this.mask) {
104
+ if (this.maskedInput) {
105
+ this.maskedInput.updateOptions({
106
+ mask: this.mask,
107
+ });
108
+ }
109
+ else {
110
+ this.maskedInput = IMask(this.nativeInput, {
111
+ mask: this.mask,
112
+ definitions: {
113
+ // <any single char>: <same type as mask (RegExp, Function, etc.)>
114
+ // defaults are '0', 'a', '*'
115
+ '#': /[\d]/,
116
+ },
117
+ });
118
+ }
119
+ }
120
+ else {
121
+ (_a = this.maskedInput) === null || _a === void 0 ? void 0 : _a.destroy();
122
+ this.nativeInput.value = (_b = this.value) !== null && _b !== void 0 ? _b : '';
123
+ this.maskedInput = undefined;
124
+ }
125
+ }
126
+ }
127
+ handleValueChange() {
128
+ var _a;
129
+ if (!this.value) {
130
+ this.nativeInput.value = (_a = this.value) !== null && _a !== void 0 ? _a : '';
131
+ }
132
+ }
100
133
  componentDidLoad() {
101
134
  this.initButtons();
102
135
  if (this.value) {
@@ -105,6 +138,7 @@ export class CpslInput {
105
138
  else {
106
139
  this.disableSlots();
107
140
  }
141
+ this.handleSetupMask();
108
142
  }
109
143
  disableSlots() {
110
144
  var _a, _b;
@@ -137,7 +171,7 @@ export class CpslInput {
137
171
  * Emits a `cpslInput` event.
138
172
  */
139
173
  emitInputChange(event) {
140
- this.cpslInput.emit({ value: this.nativeInput.value, event });
174
+ this.cpslInput.emit({ value: this.value || '', event });
141
175
  }
142
176
  /**
143
177
  * Emits a `cpslChange` event.
@@ -160,12 +194,8 @@ export class CpslInput {
160
194
  return this.el.querySelector('[slot="end"]');
161
195
  }
162
196
  render() {
163
- var _a;
164
- return (h(Host, { key: 'f406b64446832eb4f25c668707ce66194bcf7770', class: {
165
- 'disabled': this.disabled,
166
- 'focused': this.hasFocus,
167
- 'has-value': Boolean(this.focusedValue) || Boolean(this.value),
168
- } }, this.label && (h("label", { key: '5b2c4f219de0d03aebe4ae38a75c9132c9b2b9ea', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: '9c050f74275e83c717ab3f8f6af8a5bd0693a4b4', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: '4633e4edbc36defba6bd94ee65b6150c4c5ddf50', name: "start" }), h("input", { key: '4a5b287135486260dec2a14077a2a6e933a5cbb7', class: "native-input", ref: input => (this.nativeInput = input), id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, value: this.value, onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), h("slot", { key: '476c2c16758a1c7227cd6903ff1b2de3befbaab9', name: "end" })), (this.errorText || this.helperText) && (h("div", { key: '0490e976cb9fc8f36ba0dee545e72346f574daf6', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: '9500ff41ad9119d311dc5bfbf5fd583586728d78' }, (_a = this.errorText) !== null && _a !== void 0 ? _a : this.helperText)))));
197
+ var _a, _b;
198
+ return (h(Host, { key: '1eb8d3755e662a13cbbaf75b700631a6d6934004', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value), 'contrast-text': this.contrastText } }, this.label && (h("label", { key: '0560cd807a98a1723cfd95631305329e8ed6a8d1', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: 'd6d9a3afdea3aa69d448b8272a083a6f670421a7', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: '28d274d72a481970b92e41cd3c31574f7f9c7069', name: "start" }), h("input", { key: '4d2ebafbff1b4a33e2c5f384e8adacab0f6a80ce', class: "native-input", part: "native-input", ref: input => (this.nativeInput = input), id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, defaultValue: (_a = this.value) !== null && _a !== void 0 ? _a : '', onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), h("slot", { key: 'd06db621a70b4f4c031c2d5c9bbe554d9212b625', name: "end" })), (this.errorText || this.helperText) && (h("div", { key: '4c92057fe59e91475c7398e1957f070b63e9e941', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: 'cab25a4fbb41aa4a5837cc78cfd193184a0a138b' }, (_b = this.errorText) !== null && _b !== void 0 ? _b : this.helperText)))));
169
199
  }
170
200
  static get is() { return "cpsl-input"; }
171
201
  static get encapsulation() { return "shadow"; }
@@ -294,6 +324,24 @@ export class CpslInput {
294
324
  "reflect": false,
295
325
  "defaultValue": "false"
296
326
  },
327
+ "contrastText": {
328
+ "type": "boolean",
329
+ "mutable": false,
330
+ "complexType": {
331
+ "original": "boolean",
332
+ "resolved": "boolean",
333
+ "references": {}
334
+ },
335
+ "required": false,
336
+ "optional": false,
337
+ "docs": {
338
+ "tags": [],
339
+ "text": "If `true`, the input primary color will use the contrast value, not the primary text value."
340
+ },
341
+ "attribute": "contrast-text",
342
+ "reflect": false,
343
+ "defaultValue": "false"
344
+ },
297
345
  "enterkeyhint": {
298
346
  "type": "string",
299
347
  "mutable": false,
@@ -328,6 +376,23 @@ export class CpslInput {
328
376
  "attribute": "error-text",
329
377
  "reflect": false
330
378
  },
379
+ "mask": {
380
+ "type": "string",
381
+ "mutable": false,
382
+ "complexType": {
383
+ "original": "string",
384
+ "resolved": "string",
385
+ "references": {}
386
+ },
387
+ "required": false,
388
+ "optional": true,
389
+ "docs": {
390
+ "tags": [],
391
+ "text": "Mask string to apply to the input."
392
+ },
393
+ "attribute": "mask",
394
+ "reflect": false
395
+ },
331
396
  "helperText": {
332
397
  "type": "string",
333
398
  "mutable": false,
@@ -610,7 +675,7 @@ export class CpslInput {
610
675
  "mutable": false,
611
676
  "complexType": {
612
677
  "original": "IconType",
613
- "resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
678
+ "resolved": "\"search\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowCircleBrokenDownLeft\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"bank\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"creditCard\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"dot\" | \"downloadCloud\" | \"download\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"globe\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroAlertCircle\" | \"heroCheckmarkCapsule\" | \"heroCheckmark\" | \"heroEmail\" | \"heroExternalConnection\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkExternal\" | \"linkedinBrand\" | \"linkedin\" | \"logOut\" | \"mail\" | \"menu\" | \"moonpayBrand\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"puzzlePiece\" | \"qrCode02\" | \"qrCode\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"send\" | \"settings\" | \"shield\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"stripeBrand\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
614
679
  "references": {
615
680
  "IconType": {
616
681
  "location": "import",
@@ -690,7 +755,8 @@ export class CpslInput {
690
755
  }
691
756
  static get states() {
692
757
  return {
693
- "hasFocus": {}
758
+ "hasFocus": {},
759
+ "maskedInput": {}
694
760
  };
695
761
  }
696
762
  static get events() {
@@ -803,6 +869,12 @@ export class CpslInput {
803
869
  return [{
804
870
  "propName": "disabled",
805
871
  "methodName": "handleDisable"
872
+ }, {
873
+ "propName": "mask",
874
+ "methodName": "handleSetupMask"
875
+ }, {
876
+ "propName": "value",
877
+ "methodName": "handleValueChange"
806
878
  }];
807
879
  }
808
880
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AASrG,MAAM,OAAO,SAAS;;QAIZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QA0RrC,YAAO,GAAG,CAAC,EAAc,EAAE,EAAE;YACnC,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,KAAK,EAAE,CAAC;gBACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC/B,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAChE,CAAC;YAED,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEM,aAAQ,GAAG,CAAC,EAAS,EAAE,EAAE;YAC/B,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEM,WAAM,GAAG,CAAC,EAAc,EAAE,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;gBACrC;;;mBAGG;gBACH,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;YAC3B,CAAC;YAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n private nativeInput?: HTMLInputElement;\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n /**\n * Update the native input element when the value changes\n */\n // @Watch('value')\n // protected valueChanged() {\n // const nativeInput = this.nativeInput;\n // const value = this.value;\n // if (nativeInput && nativeInput.value !== value) {\n // nativeInput.value = value;\n // }\n // Boolean(value) ? this.disableSlots() : this.enableSlots();\n // }\n\n componentDidLoad() {\n this.initButtons();\n if (this.value) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.endEl?.setAttribute('disabled', 'true');\n this.startEl?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.endEl?.setAttribute('disabled', 'false');\n this.startEl?.setAttribute('disabled', 'false');\n }\n\n private initButtons() {\n if (this.endEl?.tagName === 'CPSL-BUTTON') {\n this.endEl.setAttribute('full-width', 'true');\n this.endEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n if (this.startEl?.tagName === 'CPSL-BUTTON') {\n this.startEl.setAttribute('full-width', 'true');\n this.startEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n this.cpslInput.emit({ value: this.nativeInput.value, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n\n // Manually set the value\n input.value = input.value + pasteData;\n this.value = this.value + pasteData;\n pasteData === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitInputChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get startEl() {\n return this.el.querySelector('[slot=\"start\"]');\n }\n\n private get endEl() {\n return this.el.querySelector('[slot=\"end\"]');\n }\n\n render() {\n return (\n <Host\n class={{\n 'disabled': this.disabled,\n 'focused': this.hasFocus,\n 'has-value': Boolean(this.focusedValue) || Boolean(this.value),\n }}\n >\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n ref={input => (this.nativeInput = input)}\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
1
+ {"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGrG,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAEpC,OAAO,0BAA0B,CAAC;AAOlC,MAAM,OAAO,SAAS;;QAIZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QA2TrC,YAAO,GAAG,CAAC,EAAc,EAAE,EAAE;;YACnC,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YAEnD,MAAA,IAAI,CAAC,WAAW,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\nimport IMask from 'imask/esm/imask';\nimport InputMask from 'imask/esm/controls/input';\nimport 'imask/esm/masked/pattern';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n private nativeInput?: HTMLInputElement;\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n @State() maskedInput?: InputMask;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * If `true`, the input primary color will use the contrast value, not the primary text value.\n */\n @Prop() contrastText = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Mask string to apply to the input.\n */\n @Prop() mask?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n @Watch('mask')\n handleSetupMask() {\n if (this.nativeInput) {\n if (this.mask) {\n if (this.maskedInput) {\n this.maskedInput.updateOptions({\n mask: this.mask as any,\n });\n } else {\n this.maskedInput = IMask(this.nativeInput, {\n mask: this.mask,\n definitions: {\n // <any single char>: <same type as mask (RegExp, Function, etc.)>\n // defaults are '0', 'a', '*'\n '#': /[\\d]/,\n },\n });\n }\n } else {\n this.maskedInput?.destroy();\n this.nativeInput.value = this.value ?? '';\n this.maskedInput = undefined;\n }\n }\n }\n\n @Watch('value')\n handleValueChange() {\n if (!this.value) {\n this.nativeInput.value = this.value ?? '';\n }\n }\n\n componentDidLoad() {\n this.initButtons();\n if (this.value) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n\n this.handleSetupMask();\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.endEl?.setAttribute('disabled', 'true');\n this.startEl?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.endEl?.setAttribute('disabled', 'false');\n this.startEl?.setAttribute('disabled', 'false');\n }\n\n private initButtons() {\n if (this.endEl?.tagName === 'CPSL-BUTTON') {\n this.endEl.setAttribute('full-width', 'true');\n this.endEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n if (this.startEl?.tagName === 'CPSL-BUTTON') {\n this.startEl.setAttribute('full-width', 'true');\n this.startEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n this.cpslInput.emit({ value: this.value || '', event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n\n this.maskedInput?._onInput(ev);\n\n if (Boolean(input)) {\n this.value = this.maskedInput?.unmaskedValue ?? (input.value || '');\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n\n // Manually set the value & cursor position\n const initialSelectionStart = input.selectionStart;\n const newVal = `${input.value.slice(0, input.selectionStart)}${pasteData}${input.value.slice(input.selectionEnd, input.value.length)}`;\n input.value = newVal;\n\n // this.value = newVal;\n input.selectionEnd = initialSelectionStart + pasteData.length;\n\n this.maskedInput?._onInput({ ...(ev as any), target: input });\n this.value = this.maskedInput?.unmaskedValue ?? (input.value || '');\n\n this.value === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitInputChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get startEl() {\n return this.el.querySelector('[slot=\"start\"]');\n }\n\n private get endEl() {\n return this.el.querySelector('[slot=\"end\"]');\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value), 'contrast-text': this.contrastText }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n part=\"native-input\"\n ref={input => (this.nativeInput = input)}\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n defaultValue={this.value ?? ''}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
@@ -29,7 +29,7 @@ export class CpslModalV2 {
29
29
  this.toggleHeight();
30
30
  }
31
31
  render() {
32
- return (h(Host, { key: '0682407f6320fe77b42e4ceed6a9b7738a1b5541', class: { 'open': this.open, 'elevated': this.elevated, 'no-overlay': this.noOverlay } }, !this.noOverlay && (h("cpsl-overlay", { key: '23a4453e4aef7ab92d281fd8c3cfe751e5a9a814', zIndexOverride: this.zIndexOverride ? this.zIndexOverride : undefined, id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration })), h("cpsl-card", { key: 'a8703d0aa0144970928dab18b153ceb703292433', class: "card", style: { transitionDuration: this.open ? `${this.exitTransitionDuration}s` : `${this.enterTransitionDuration}s` } }, h("slot", { key: '502bb4e11f0520dfeb027a06d7bbb21843cb579f' }))));
32
+ return (h(Host, { key: '2dca618fb17113f9c346e6e54684b50c5ac3f493', class: { 'open': this.open, 'elevated': this.elevated, 'no-overlay': this.noOverlay } }, !this.noOverlay && (h("cpsl-overlay", { key: 'f43f994363f20b0f4b43cfc61753f41ad41ecb63', zIndexOverride: this.zIndexOverride ? this.zIndexOverride : undefined, id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration })), h("cpsl-card", { key: '02a53d032d3b95bd78843cf2d1d06a3cc11c4894', class: "card", style: { transitionDuration: this.open ? `${this.exitTransitionDuration}s` : `${this.enterTransitionDuration}s` } }, h("slot", { key: '3c246e9fb544c6ddcd2cec53c2b5e4362dab0a6a' }))));
33
33
  }
34
34
  static get is() { return "cpsl-modal-v2"; }
35
35
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"cpsl-modal-v2.js","sourceRoot":"","sources":["../../../../src/components/cpsl-modal-v2/cpsl-modal-v2.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,E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AAE,IAAI,CAAC,sBAAsB,GACnD,CACH;YACD,kEACE,KAAK,EAAC,MAAM,EACZ,KAAK,EAAE,EAAE,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,uBAAuB,GAAG,EAAE;gBAEjH,8DAAa,CACH,CACP,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, Watch, Element, Event, h, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-modal-v2',\n styleUrl: 'cpsl-modal-v2.scss',\n shadow: true,\n})\nexport class CpslModalV2 {\n @Element() el!: HTMLCpslModalV2Element;\n\n /**\n * Duration in seconds of the modal entering.\n * Default is .15.\n */\n @Prop() enterTransitionDuration?: number = 0.15;\n\n /**\n * Duration in seconds of the modal exiting.\n * Default is .15.\n */\n @Prop() exitTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show the modal with a box shadow.\n */\n @Prop() elevated: boolean;\n\n /**\n * Whether or not to show the overlay.\n */\n @Prop() noOverlay: boolean;\n\n /**\n * Whether or not to show the modal.\n */\n @Prop() open: boolean;\n\n /**\n * Override z-index.\n */\n @Prop() zIndexOverride?: number;\n\n /**\n * Emitted when enter animation starts.\n */\n @Event() cpslModalEntering!: EventEmitter<null>;\n\n /**\n * Emitted when enter animation finishes.\n */\n @Event() cpslModalEntered!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation starts.\n */\n @Event() cpslModalExiting!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalExited!: EventEmitter<null>;\n\n @Watch('open')\n toggleHeight() {\n if (!this.open) {\n this.cpslModalExiting.emit();\n // Animate out before setting display to none\n setTimeout(() => {\n this.el.style.display = 'none';\n this.cpslModalExited.emit();\n }, this.exitTransitionDuration * 1000);\n } else {\n this.cpslModalEntering.emit();\n this.el.style.display = 'flex';\n setTimeout(() => {\n this.cpslModalEntered.emit();\n }, this.enterTransitionDuration * 1000);\n }\n }\n\n componentDidLoad() {\n this.toggleHeight();\n }\n\n render() {\n return (\n <Host class={{ 'open': this.open, 'elevated': this.elevated, 'no-overlay': this.noOverlay }}>\n {!this.noOverlay && (\n <cpsl-overlay\n zIndexOverride={this.zIndexOverride ? this.zIndexOverride : undefined}\n id=\"overlay\"\n open={this.open}\n enterTransitionDuration={this.enterTransitionDuration}\n exitTransitionDuration={this.exitTransitionDuration}\n />\n )}\n <cpsl-card\n class=\"card\"\n style={{ transitionDuration: this.open ? `${this.exitTransitionDuration}s` : `${this.enterTransitionDuration}s` }}\n >\n <slot></slot>\n </cpsl-card>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"cpsl-modal-v2.js","sourceRoot":"","sources":["../../../../src/components/cpsl-modal-v2/cpsl-modal-v2.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAgB,MAAM,eAAe,CAAC;AAO9F,MAAM,OAAO,WAAW;;uCAOqB,IAAI;sCAML,IAAI;;;;;;IA2C9C,YAAY;QACV,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;YAC7B,6CAA6C;YAC7C,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;gBAC/B,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;YAC9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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, Watch, Element, Event, h, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-modal-v2',\n styleUrl: 'cpsl-modal-v2.scss',\n shadow: true,\n})\nexport class CpslModalV2 {\n @Element() el!: HTMLCpslModalV2Element;\n\n /**\n * Duration in seconds of the modal entering.\n * Default is .15.\n */\n @Prop() enterTransitionDuration?: number = 0.15;\n\n /**\n * Duration in seconds of the modal exiting.\n * Default is .15.\n */\n @Prop() exitTransitionDuration?: number = 0.15;\n\n /**\n * Whether or not to show the modal with a box shadow.\n */\n @Prop() elevated: boolean;\n\n /**\n * Whether or not to show the overlay.\n */\n @Prop() noOverlay: boolean;\n\n /**\n * Whether or not to show the modal.\n */\n @Prop() open: boolean;\n\n /**\n * Override z-index.\n */\n @Prop() zIndexOverride?: number;\n\n /**\n * Emitted when enter animation starts.\n */\n @Event() cpslModalEntering!: EventEmitter<null>;\n\n /**\n * Emitted when enter animation finishes.\n */\n @Event() cpslModalEntered!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation starts.\n */\n @Event() cpslModalExiting!: EventEmitter<null>;\n\n /**\n * Emitted when exit animation finishes.\n */\n @Event() cpslModalExited!: EventEmitter<null>;\n\n @Watch('open')\n toggleHeight() {\n if (!this.open) {\n this.cpslModalExiting.emit();\n // Animate out before setting display to none\n setTimeout(() => {\n this.el.style.display = 'none';\n this.cpslModalExited.emit();\n }, this.exitTransitionDuration * 1000);\n } else {\n this.cpslModalEntering.emit();\n this.el.style.display = 'flex';\n setTimeout(() => {\n this.cpslModalEntered.emit();\n }, this.enterTransitionDuration * 1000);\n }\n }\n\n componentDidLoad() {\n this.toggleHeight();\n }\n\n render() {\n return (\n <Host class={{ 'open': this.open, 'elevated': this.elevated, 'no-overlay': this.noOverlay }}>\n {!this.noOverlay && (\n <cpsl-overlay\n zIndexOverride={this.zIndexOverride ? this.zIndexOverride : undefined}\n id=\"overlay\"\n open={this.open}\n enterTransitionDuration={this.enterTransitionDuration}\n exitTransitionDuration={this.exitTransitionDuration}\n />\n )}\n <cpsl-card class=\"card\" style={{ transitionDuration: this.open ? `${this.exitTransitionDuration}s` : `${this.enterTransitionDuration}s` }}>\n <slot></slot>\n </cpsl-card>\n </Host>\n );\n }\n}\n"]}