@usecapsule/core-components 3.3.0-dev.0 → 3.3.0-dev.1

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 +10 -25
  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-0462f723.js +2 -0
  8. package/dist/capsule/p-0462f723.js.map +1 -0
  9. package/dist/capsule/p-05cb769b.entry.js +10 -0
  10. package/dist/capsule/{p-0e558c7f.entry.js.map → p-05cb769b.entry.js.map} +1 -1
  11. package/dist/capsule/p-0eea90f8.entry.js +2 -0
  12. package/dist/capsule/p-4203888d.entry.js +29 -0
  13. package/dist/capsule/p-4203888d.entry.js.map +1 -0
  14. package/dist/capsule/{p-1bd11889.entry.js → p-69c3c53b.entry.js} +2 -2
  15. package/dist/capsule/{p-1bd11889.entry.js.map → p-69c3c53b.entry.js.map} +1 -1
  16. package/dist/capsule/{p-5d62e610.entry.js → p-742bda0b.entry.js} +2 -2
  17. package/dist/capsule/p-c1aa1ffb.entry.js +2 -0
  18. package/dist/capsule/{p-5965b15e.entry.js.map → p-c1aa1ffb.entry.js.map} +1 -1
  19. package/dist/capsule/p-d351f076.entry.js +2 -0
  20. package/dist/capsule/p-d351f076.entry.js.map +1 -0
  21. package/dist/cjs/_commonjsHelpers-b3309d7b.js +12 -0
  22. package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
  23. package/dist/cjs/capsule.cjs.js +1 -1
  24. package/dist/cjs/{cpsl-alert_34.cjs.entry.js → cpsl-alert_33.cjs.entry.js} +13368 -16935
  25. package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +1 -0
  26. package/dist/cjs/cpsl-animation.cjs.entry.js +2 -3
  27. package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
  28. package/dist/cjs/cpsl-hero.cjs.entry.js +6 -9
  29. package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
  30. package/dist/cjs/cpsl-identicon.cjs.entry.js +1 -1
  31. package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
  32. package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
  33. package/dist/cjs/cpsl-modal-v2.cjs.entry.js +1 -1
  34. package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
  35. package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
  36. package/dist/cjs/index-65f57499.js +2 -2
  37. package/dist/cjs/index.cjs.js +12 -35
  38. package/dist/cjs/index.cjs.js.map +1 -1
  39. package/dist/cjs/loader.cjs.js +1 -1
  40. package/dist/collection/assets/icons/index.js +1 -21
  41. package/dist/collection/assets/icons/index.js.map +1 -1
  42. package/dist/collection/assets/icons/refresh.svg +3 -3
  43. package/dist/collection/collection-manifest.json +1 -2
  44. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  45. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  46. package/dist/collection/components/cpsl-button/cpsl-button.css +2 -89
  47. package/dist/collection/components/cpsl-button/cpsl-button.js +5 -6
  48. package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
  49. package/dist/collection/components/cpsl-button/cpsl-button.stories.js.map +1 -1
  50. package/dist/collection/components/cpsl-card/cpsl-card.css +2 -5
  51. package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +0 -3
  52. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +7 -11
  53. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  54. package/dist/collection/components/cpsl-divider/cpsl-divider.css +1 -2
  55. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +1 -1
  56. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  57. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +2 -2
  58. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  59. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +6 -1
  60. package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
  61. package/dist/collection/components/cpsl-hero/cpsl-hero.css +71 -136
  62. package/dist/collection/components/cpsl-hero/cpsl-hero.js +9 -63
  63. package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
  64. package/dist/collection/components/cpsl-icon/cpsl-icon.css +0 -8
  65. package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
  66. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
  67. package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +2 -1
  68. package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
  69. package/dist/collection/components/cpsl-input/cpsl-input.css +2 -21
  70. package/dist/collection/components/cpsl-input/cpsl-input.js +28 -100
  71. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  72. package/dist/collection/components/{cpsl-auth-modal/cpsl-auth-modal.css → cpsl-modal/cpsl-modal.css} +58 -33
  73. package/dist/collection/components/{cpsl-auth-modal/cpsl-auth-modal.js → cpsl-modal/cpsl-modal.js} +129 -11
  74. package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -0
  75. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +1 -1
  76. package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
  77. package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +1 -1
  78. package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +1 -1
  79. package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
  80. package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
  81. package/dist/collection/components/cpsl-popover/cpsl-popover.css +0 -2
  82. package/dist/collection/components/cpsl-popover/cpsl-popover.js +11 -9
  83. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
  84. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +3 -12
  85. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +23 -28
  86. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -1
  87. package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
  88. package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
  89. package/dist/collection/components/cpsl-select/cpsl-select.css +0 -17
  90. package/dist/collection/components/cpsl-select/cpsl-select.js +5 -95
  91. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  92. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
  93. package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -1
  94. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  95. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
  96. package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +8 -30
  97. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +7 -5
  98. package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
  99. package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
  100. package/dist/collection/components/cpsl-tab/cpsl-tab.css +1 -24
  101. package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
  102. package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
  103. package/dist/collection/components/cpsl-table/cpsl-table.js +9 -1
  104. package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
  105. package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +4 -1
  106. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +4 -1
  107. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  108. package/dist/collection/components/cpsl-text/cpsl-text.css +0 -19
  109. package/dist/collection/components/cpsl-text/cpsl-text.js +4 -5
  110. package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
  111. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +1 -3
  112. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  113. package/dist/collection/interface.js.map +1 -1
  114. package/dist/collection/utils/theme/generateBorderRadii.js +3 -4
  115. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  116. package/dist/collection/utils/theme/generatePalette.js +6 -22
  117. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  118. package/dist/collection/utils/theme/generateTheme.js +3 -9
  119. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  120. package/dist/collection/utils/theme/utils.js.map +1 -1
  121. package/dist/esm/_commonjsHelpers-1789f0cf.js +9 -0
  122. package/dist/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
  123. package/dist/esm/capsule.js +1 -1
  124. package/dist/esm/{cpsl-alert_34.entry.js → cpsl-alert_33.entry.js} +13370 -16936
  125. package/dist/esm/cpsl-alert_33.entry.js.map +1 -0
  126. package/dist/esm/cpsl-animation.entry.js +1 -2
  127. package/dist/esm/cpsl-animation.entry.js.map +1 -1
  128. package/dist/esm/cpsl-hero.entry.js +7 -10
  129. package/dist/esm/cpsl-hero.entry.js.map +1 -1
  130. package/dist/esm/cpsl-identicon.entry.js +1 -1
  131. package/dist/esm/cpsl-info-box.entry.js +2 -2
  132. package/dist/esm/cpsl-info-box.entry.js.map +1 -1
  133. package/dist/esm/cpsl-modal-v2.entry.js +1 -1
  134. package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
  135. package/dist/esm/cpsl-row.entry.js +1 -1
  136. package/dist/esm/index-91db3414.js +2 -2
  137. package/dist/esm/index.js +12 -35
  138. package/dist/esm/index.js.map +1 -1
  139. package/dist/esm/loader.js +1 -1
  140. package/dist/types/assets/icons/index.d.ts +0 -20
  141. package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -2
  142. package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +3 -18
  143. package/dist/types/components/cpsl-input/cpsl-input.d.ts +3 -13
  144. package/dist/types/components/{cpsl-auth-modal/cpsl-auth-modal.d.ts → cpsl-modal/cpsl-modal.d.ts} +23 -3
  145. package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +2 -2
  146. package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +0 -1
  147. package/dist/types/components/cpsl-select/cpsl-select.d.ts +1 -22
  148. package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
  149. package/dist/types/components.d.ts +146 -222
  150. package/dist/types/interface.d.ts +0 -13
  151. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  152. package/dist/types/utils/theme/generatePalette.d.ts +2 -4
  153. package/dist/types/utils/theme/generateTheme.d.ts +1 -1
  154. package/package.json +2 -3
  155. package/dist/capsule/p-0e558c7f.entry.js +0 -10
  156. package/dist/capsule/p-32cdf894.entry.js +0 -2
  157. package/dist/capsule/p-32cdf894.entry.js.map +0 -1
  158. package/dist/capsule/p-3b042fd1.entry.js +0 -2
  159. package/dist/capsule/p-5965b15e.entry.js +0 -2
  160. package/dist/capsule/p-60508b1e.entry.js +0 -20
  161. package/dist/capsule/p-60508b1e.entry.js.map +0 -1
  162. package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +0 -1
  163. package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +0 -3
  164. package/dist/collection/assets/icons/bank.svg +0 -3
  165. package/dist/collection/assets/icons/credit-card.svg +0 -3
  166. package/dist/collection/assets/icons/dot.svg +0 -3
  167. package/dist/collection/assets/icons/download.svg +0 -3
  168. package/dist/collection/assets/icons/globe.svg +0 -3
  169. package/dist/collection/assets/icons/hero-alert-circle.svg +0 -3
  170. package/dist/collection/assets/icons/hero-checkmark-capsule.svg +0 -11
  171. package/dist/collection/assets/icons/hero-checkmark.svg +0 -3
  172. package/dist/collection/assets/icons/hero-external-connection.svg +0 -71
  173. package/dist/collection/assets/icons/link-external.svg +0 -3
  174. package/dist/collection/assets/icons/log-out.svg +0 -3
  175. package/dist/collection/assets/icons/moonpay-brand.svg +0 -10
  176. package/dist/collection/assets/icons/puzzle-piece.svg +0 -3
  177. package/dist/collection/assets/icons/qr-code-02.svg +0 -3
  178. package/dist/collection/assets/icons/qr-code.svg +0 -3
  179. package/dist/collection/assets/icons/search.svg +0 -3
  180. package/dist/collection/assets/icons/send.svg +0 -3
  181. package/dist/collection/assets/icons/shield.svg +0 -3
  182. package/dist/collection/assets/icons/stripe-brand.svg +0 -3
  183. package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +0 -1
  184. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +0 -97
  185. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +0 -121
  186. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +0 -1
  187. package/dist/esm/cpsl-alert_34.entry.js.map +0 -1
  188. package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +0 -20
  189. /package/dist/capsule/{p-3b042fd1.entry.js.map → p-0eea90f8.entry.js.map} +0 -0
  190. /package/dist/capsule/{p-5d62e610.entry.js.map → p-742bda0b.entry.js.map} +0 -0
@@ -1,15 +1,11 @@
1
1
  import { Host, h } from "@stencil/core";
2
- import IMask from "imask/esm/imask";
3
- import "imask/esm/masked/pattern";
4
2
  export class CpslInput {
5
3
  constructor() {
6
4
  this.inputId = `cpsl-input-${inputIds++}`;
7
5
  this.onInput = (ev) => {
8
- var _a, _b, _c;
9
6
  const input = ev.target;
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 || '');
7
+ if (input) {
8
+ this.value = input.value || '';
13
9
  input.value === '' ? this.disableSlots() : this.enableSlots();
14
10
  }
15
11
  this.emitInputChange(ev);
@@ -34,20 +30,15 @@ export class CpslInput {
34
30
  this.cpslFocus.emit(ev);
35
31
  };
36
32
  this.onPaste = (ev) => {
37
- var _a, _b, _c, _d;
33
+ var _a;
38
34
  ev.stopPropagation();
39
35
  ev.preventDefault();
40
36
  const input = ev.target;
41
37
  const pasteData = ((_a = ev.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text')) || '';
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();
38
+ // Manually set the value
39
+ input.value = input.value + pasteData;
40
+ this.value = this.value + pasteData;
41
+ pasteData === '' ? this.disableSlots() : this.enableSlots();
51
42
  // Emit the cpslPaste event
52
43
  this.cpslPaste.emit(ev);
53
44
  // Emit the cpslChange event since the value was modified by paste
@@ -57,17 +48,14 @@ export class CpslInput {
57
48
  this.nativeInput.focus();
58
49
  };
59
50
  this.hasFocus = false;
60
- this.maskedInput = undefined;
61
51
  this.autocapitalize = 'off';
62
52
  this.autocomplete = 'off';
63
53
  this.autocorrect = 'off';
64
54
  this.noAutoDisable = undefined;
65
55
  this.autofocus = false;
66
56
  this.disabled = false;
67
- this.contrastText = false;
68
57
  this.enterkeyhint = undefined;
69
58
  this.errorText = undefined;
70
- this.mask = undefined;
71
59
  this.helperText = undefined;
72
60
  this.inputmode = undefined;
73
61
  this.label = undefined;
@@ -97,39 +85,18 @@ export class CpslInput {
97
85
  this.enableSlots();
98
86
  }
99
87
  }
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
- }
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
+ // }
133
100
  componentDidLoad() {
134
101
  this.initButtons();
135
102
  if (this.value) {
@@ -138,7 +105,6 @@ export class CpslInput {
138
105
  else {
139
106
  this.disableSlots();
140
107
  }
141
- this.handleSetupMask();
142
108
  }
143
109
  disableSlots() {
144
110
  var _a, _b;
@@ -171,7 +137,7 @@ export class CpslInput {
171
137
  * Emits a `cpslInput` event.
172
138
  */
173
139
  emitInputChange(event) {
174
- this.cpslInput.emit({ value: this.value || '', event });
140
+ this.cpslInput.emit({ value: this.nativeInput.value, event });
175
141
  }
176
142
  /**
177
143
  * Emits a `cpslChange` event.
@@ -194,8 +160,12 @@ export class CpslInput {
194
160
  return this.el.querySelector('[slot="end"]');
195
161
  }
196
162
  render() {
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)))));
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)))));
199
169
  }
200
170
  static get is() { return "cpsl-input"; }
201
171
  static get encapsulation() { return "shadow"; }
@@ -324,24 +294,6 @@ export class CpslInput {
324
294
  "reflect": false,
325
295
  "defaultValue": "false"
326
296
  },
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
- },
345
297
  "enterkeyhint": {
346
298
  "type": "string",
347
299
  "mutable": false,
@@ -376,23 +328,6 @@ export class CpslInput {
376
328
  "attribute": "error-text",
377
329
  "reflect": false
378
330
  },
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
- },
396
331
  "helperText": {
397
332
  "type": "string",
398
333
  "mutable": false,
@@ -675,7 +610,7 @@ export class CpslInput {
675
610
  "mutable": false,
676
611
  "complexType": {
677
612
  "original": "IconType",
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\"",
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\"",
679
614
  "references": {
680
615
  "IconType": {
681
616
  "location": "import",
@@ -755,8 +690,7 @@ export class CpslInput {
755
690
  }
756
691
  static get states() {
757
692
  return {
758
- "hasFocus": {},
759
- "maskedInput": {}
693
+ "hasFocus": {}
760
694
  };
761
695
  }
762
696
  static get events() {
@@ -869,12 +803,6 @@ export class CpslInput {
869
803
  return [{
870
804
  "propName": "disabled",
871
805
  "methodName": "handleDisable"
872
- }, {
873
- "propName": "mask",
874
- "methodName": "handleSetupMask"
875
- }, {
876
- "propName": "value",
877
- "methodName": "handleValueChange"
878
806
  }];
879
807
  }
880
808
  }
@@ -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;AAGrG,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAEpC,OAAO,0BAA0B,CAAC;AAOlC,MAAM,OAAO,SAAS;;QAIZ,YAAO,GAAG,cAAc,QAAQ,EAA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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"]}
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,EA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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"]}
@@ -54,15 +54,29 @@
54
54
  * }
55
55
  */
56
56
  :host {
57
- --container-width: 560px;
58
- --container-gap: 8px;
57
+ --container-width: 360px;
58
+ --container-gap: 16px;
59
+ --container-border-radius: var(--cpsl-border-radius-modal);
60
+ --container-border-width: 1px;
61
+ --container-border-color: var(--cpsl-color-modal-border);
62
+ --container-background-color: var(--cpsl-color-modal-surface-footer);
63
+ --container-padding-bottom: 16px;
64
+ --container-box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.12);
65
+ --inner-container-background-color: var(--cpsl-color-modal-surface-main);
66
+ --inner-container-border-radius: var(--cpsl-border-radius-modal);
67
+ --inner-container-box-shadow: 0px 1px 2px 0px var(--cpsl-color-alpha-black-8);
68
+ --inner-container-padding-top: 16px;
69
+ --inner-container-padding-end: 16px;
70
+ --inner-container-padding-bottom: 24px;
71
+ --inner-container-padding-start: 16px;
72
+ --inner-container-margin-bottom: 16px;
59
73
  display: block;
60
- z-index: 10011;
74
+ z-index: 10005;
61
75
  position: relative;
62
76
  }
63
77
 
64
78
  :host cpsl-overlay {
65
- z-index: 10011;
79
+ z-index: 10005;
66
80
  }
67
81
 
68
82
  @media (max-width: 480px) {
@@ -79,21 +93,21 @@
79
93
  border-bottom-left-radius: 0px;
80
94
  border-bottom-right-radius: 0px;
81
95
  }
82
- :host(.include-mobile-styling) .modal-body-card {
83
- --card-border-radius-bl: 0px;
84
- --card-border-radius-br: 0px;
85
- }
86
96
  }
87
97
 
88
98
  :host(.no-overlay) {
89
99
  z-index: 0;
90
100
  }
91
- :host(.no-overlay) .modal-body-card {
92
- --card-border-width: 1px;
101
+
102
+ .modal-header {
103
+ position: sticky;
104
+ top: 0;
105
+ padding-top: var(--inner-container-padding-top);
106
+ background: var(--inner-container-background-color);
93
107
  }
94
108
 
95
109
  .modal-wrapper {
96
- z-index: 10011;
110
+ z-index: 10005;
97
111
  position: fixed;
98
112
  top: 0;
99
113
  left: 0;
@@ -110,10 +124,19 @@
110
124
  .modal-container {
111
125
  position: relative;
112
126
  overflow: hidden;
127
+ -webkit-padding-start: var(--container-padding-start);
128
+ padding-inline-start: var(--container-padding-start);
129
+ -webkit-padding-end: var(--container-padding-end);
130
+ padding-inline-end: var(--container-padding-end);
131
+ padding-top: var(--container-padding-top);
132
+ padding-bottom: var(--container-padding-bottom);
113
133
  width: var(--container-width);
114
134
  display: flex;
115
135
  flex-direction: column;
116
- gap: var(--container-gap);
136
+ border: var(--container-border-width) solid var(--container-border-color);
137
+ border-radius: var(--container-border-radius);
138
+ box-shadow: var(--container-box-shadow);
139
+ background: var(--container-background-color);
117
140
  max-width: 95vw;
118
141
  max-height: 95vh;
119
142
  max-height: 95dvh;
@@ -125,33 +148,35 @@
125
148
  .modal-container ::-webkit-scrollbar {
126
149
  display: none;
127
150
  }
128
- .modal-container.no-footer {
129
- gap: 0px;
151
+
152
+ .modal-inner-container {
153
+ -webkit-padding-start: var(--inner-container-padding-start);
154
+ padding-inline-start: var(--inner-container-padding-start);
155
+ -webkit-padding-end: var(--inner-container-padding-end);
156
+ padding-inline-end: var(--inner-container-padding-end);
157
+ padding-top: 0;
158
+ padding-bottom: var(--inner-container-padding-bottom);
159
+ margin-bottom: var(--inner-container-margin-bottom);
160
+ border-radius: var(--inner-container-border-radius);
161
+ box-shadow: var(--inner-container-box-shadow);
162
+ background: var(--inner-container-background-color);
130
163
  }
131
164
 
132
- .modal-body-card {
133
- --card-padding-top: 16px;
134
- --card-padding-bottom: 16px;
135
- --card-padding-start: 16px;
136
- --card-padding-end: 16px;
137
- --card-border-width: 0px;
138
- box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.08);
165
+ .expanded {
166
+ height: 0px;
167
+ overflow: hidden;
168
+ display: none;
139
169
  }
140
170
 
141
- .no-opacity {
142
- opacity: 0;
171
+ .modal-inner-container.no-footer {
172
+ margin-bottom: 0px;
173
+ box-shadow: none;
143
174
  }
144
175
 
145
- .mobile-footer {
146
- margin-top: 16px;
176
+ .modal-container.no-footer {
177
+ padding-bottom: 0px;
147
178
  }
148
179
 
149
- .footer-hidden {
150
- height: 0px;
151
- visibility: hidden;
152
- --card-padding-top: 0px;
153
- --card-padding-bottom: 0px;
154
- --card-padding-start: 0px;
155
- --card-padding-end: 0px;
156
- --card-border-width: 0px;
180
+ .no-opacity {
181
+ opacity: 0;
157
182
  }