@ionic/core 8.2.3-dev.11724345963.10ca6051 → 8.2.3-dev.11724780956.16364df0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/components/ion-input-password-toggle.js +12 -7
  2. package/components/ion-input.js +14 -5
  3. package/components/ion-textarea.js +15 -5
  4. package/components/ion-toggle.js +14 -11
  5. package/css/ionic/bundle.ionic.css.map +1 -1
  6. package/css/ionic/global.bundle.ionic.css.map +1 -1
  7. package/css/ionic/typography.ionic.css.map +1 -1
  8. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +12 -7
  9. package/dist/cjs/ion-input.cjs.entry.js +14 -5
  10. package/dist/cjs/ion-textarea.cjs.entry.js +15 -5
  11. package/dist/cjs/ion-toggle.cjs.entry.js +14 -11
  12. package/dist/collection/components/input/input.js +14 -5
  13. package/dist/collection/components/input-password-toggle/input-password-toggle.common.css +61 -0
  14. package/dist/collection/components/input-password-toggle/input-password-toggle.ionic.css +147 -0
  15. package/dist/collection/components/input-password-toggle/input-password-toggle.js +10 -7
  16. package/dist/collection/components/input-password-toggle/test/basic/input-password-toggle.e2e.js +1 -1
  17. package/dist/collection/components/textarea/test/shape/textarea.e2e.js +79 -0
  18. package/dist/collection/components/textarea/textarea.ionic.css +12 -1
  19. package/dist/collection/components/textarea/textarea.js +17 -7
  20. package/dist/collection/components/toggle/test/color/toggle.e2e.js +1 -1
  21. package/dist/collection/components/toggle/test/enable-on-off-labels/toggle.e2e.js +1 -1
  22. package/dist/collection/components/toggle/test/item/toggle.e2e.js +4 -2
  23. package/dist/collection/components/toggle/test/label/toggle.e2e.js +29 -0
  24. package/dist/collection/components/toggle/test/sizes/toggle.e2e.js +1 -1
  25. package/dist/collection/components/toggle/test/states/toggle.e2e.js +29 -1
  26. package/dist/collection/components/toggle/toggle.ionic.css +391 -0
  27. package/dist/collection/components/toggle/toggle.ios.css +163 -138
  28. package/dist/collection/components/toggle/toggle.js +12 -9
  29. package/dist/collection/components/toggle/toggle.md.css +163 -138
  30. package/dist/docs.json +13 -5
  31. package/dist/esm/ion-input-password-toggle.entry.js +12 -7
  32. package/dist/esm/ion-input.entry.js +14 -5
  33. package/dist/esm/ion-textarea.entry.js +15 -5
  34. package/dist/esm/ion-toggle.entry.js +14 -11
  35. package/dist/esm-es5/ion-input-password-toggle.entry.js +1 -1
  36. package/dist/esm-es5/ion-input.entry.js +1 -1
  37. package/dist/esm-es5/ion-textarea.entry.js +1 -1
  38. package/dist/esm-es5/ion-toggle.entry.js +1 -1
  39. package/dist/html.html-data.json +7 -1
  40. package/dist/ionic/ionic.esm.js +1 -1
  41. package/dist/ionic/p-13c363e4.entry.js +4 -0
  42. package/dist/ionic/p-22711da4.system.entry.js +4 -0
  43. package/dist/ionic/p-7b590e46.system.js +1 -1
  44. package/dist/ionic/p-a6028478.entry.js +4 -0
  45. package/dist/ionic/p-aad91b75.system.entry.js +4 -0
  46. package/dist/ionic/p-bf55ce83.system.entry.js +4 -0
  47. package/dist/ionic/{p-201d8768.system.entry.js → p-c2c3807b.system.entry.js} +1 -1
  48. package/dist/ionic/p-c8453a83.entry.js +4 -0
  49. package/dist/ionic/p-de8e8567.entry.js +4 -0
  50. package/dist/types/components/input/input.d.ts +1 -0
  51. package/dist/types/components/textarea/textarea.d.ts +7 -2
  52. package/dist/types/components.d.ts +4 -4
  53. package/hydrate/index.js +55 -28
  54. package/package.json +1 -1
  55. package/dist/collection/components/input-password-toggle/input-password-toggle.css +0 -0
  56. package/dist/ionic/p-1ee206ac.entry.js +0 -4
  57. package/dist/ionic/p-3a2eb448.system.entry.js +0 -4
  58. package/dist/ionic/p-6691825a.system.entry.js +0 -4
  59. package/dist/ionic/p-7a1b640f.entry.js +0 -4
  60. package/dist/ionic/p-8102551e.system.entry.js +0 -4
  61. package/dist/ionic/p-924deb6b.entry.js +0 -4
  62. package/dist/ionic/p-a6bb62ea.entry.js +0 -4
@@ -59,6 +59,28 @@
59
59
  * }
60
60
  * }
61
61
  */
62
+ /**
63
+ * A heuristic that applies CSS to tablet
64
+ * viewports.
65
+ *
66
+ * Usage:
67
+ * @include tablet-viewport() {
68
+ * :host {
69
+ * background-color: green;
70
+ * }
71
+ * }
72
+ */
73
+ /**
74
+ * A heuristic that applies CSS to mobile
75
+ * viewports (i.e. phones, not tablets).
76
+ *
77
+ * Usage:
78
+ * @include mobile-viewport() {
79
+ * :host {
80
+ * background-color: blue;
81
+ * }
82
+ * }
83
+ */
62
84
  :host {
63
85
  /**
64
86
  * @prop --track-background: Background of the toggle track
@@ -84,7 +106,6 @@
84
106
  outline: none;
85
107
  cursor: pointer;
86
108
  user-select: none;
87
- z-index: 2;
88
109
  }
89
110
 
90
111
  :host(.in-item) {
@@ -141,26 +162,6 @@ input {
141
162
  cursor: inherit;
142
163
  }
143
164
 
144
- .label-text-wrapper {
145
- text-overflow: ellipsis;
146
- white-space: nowrap;
147
- overflow: hidden;
148
- }
149
-
150
- :host(.in-item) .label-text-wrapper {
151
- margin-top: 10px;
152
- margin-bottom: 10px;
153
- }
154
-
155
- :host(.in-item.toggle-label-placement-stacked) .label-text-wrapper {
156
- margin-top: 10px;
157
- margin-bottom: 16px;
158
- }
159
-
160
- :host(.in-item.toggle-label-placement-stacked) .native-wrapper {
161
- margin-bottom: 10px;
162
- }
163
-
164
165
  /**
165
166
  * If no label text is placed into the slot
166
167
  * then the element should be hidden otherwise
@@ -175,26 +176,6 @@ input {
175
176
  align-items: center;
176
177
  }
177
178
 
178
- :host(.toggle-justify-space-between) .toggle-wrapper {
179
- justify-content: space-between;
180
- }
181
-
182
- :host(.toggle-justify-start) .toggle-wrapper {
183
- justify-content: start;
184
- }
185
-
186
- :host(.toggle-justify-end) .toggle-wrapper {
187
- justify-content: end;
188
- }
189
-
190
- :host(.toggle-alignment-start) .toggle-wrapper {
191
- align-items: start;
192
- }
193
-
194
- :host(.toggle-alignment-center) .toggle-wrapper {
195
- align-items: center;
196
- }
197
-
198
179
  /**
199
180
  * Label is on the left of the input in LTR and
200
181
  * on the right in RTL.
@@ -203,18 +184,6 @@ input {
203
184
  flex-direction: row;
204
185
  }
205
186
 
206
- :host(.toggle-label-placement-start) .label-text-wrapper {
207
- /**
208
- * The margin between the label and
209
- * the input should be on the end
210
- * when the label sits at the start.
211
- */
212
- -webkit-margin-start: 0;
213
- margin-inline-start: 0;
214
- -webkit-margin-end: 16px;
215
- margin-inline-end: 16px;
216
- }
217
-
218
187
  /**
219
188
  * Label is on the right of the input in LTR and
220
189
  * on the left in RTL.
@@ -223,91 +192,6 @@ input {
223
192
  flex-direction: row-reverse;
224
193
  }
225
194
 
226
- /**
227
- * The margin between the label and
228
- * the input should be on the start
229
- * when the label sits at the end.
230
- */
231
- :host(.toggle-label-placement-end) .label-text-wrapper {
232
- -webkit-margin-start: 16px;
233
- margin-inline-start: 16px;
234
- -webkit-margin-end: 0;
235
- margin-inline-end: 0;
236
- }
237
-
238
- :host(.toggle-label-placement-fixed) .label-text-wrapper {
239
- /**
240
- * The margin between the label and
241
- * the input should be on the end
242
- * when the label sits at the start.
243
- */
244
- -webkit-margin-start: 0;
245
- margin-inline-start: 0;
246
- -webkit-margin-end: 16px;
247
- margin-inline-end: 16px;
248
- }
249
-
250
- /**
251
- * Label is on the left of the input in LTR and
252
- * on the right in RTL. Label also has a fixed width.
253
- */
254
- :host(.toggle-label-placement-fixed) .label-text-wrapper {
255
- flex: 0 0 100px;
256
- width: 100px;
257
- min-width: 100px;
258
- max-width: 200px;
259
- }
260
-
261
- /**
262
- * Label is on top of the toggle.
263
- */
264
- :host(.toggle-label-placement-stacked) .toggle-wrapper {
265
- flex-direction: column;
266
- }
267
-
268
- :host(.toggle-label-placement-stacked) .label-text-wrapper {
269
- transform: scale(0.75);
270
- /**
271
- * The margin between the label and
272
- * the toggle should be on the bottom
273
- * when the label sits on top.
274
- */
275
- margin-left: 0;
276
- margin-right: 0;
277
- margin-bottom: 16px;
278
- /**
279
- * Label text should not extend
280
- * beyond the bounds of the toggle.
281
- */
282
- max-width: calc(100% / 0.75);
283
- }
284
-
285
- :host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper {
286
- transform-origin: left top;
287
- }
288
- :host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper, :host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-start .label-text-wrapper {
289
- transform-origin: right top;
290
- }
291
-
292
- @supports selector(:dir(rtl)) {
293
- :host(.toggle-label-placement-stacked.toggle-alignment-start:dir(rtl)) .label-text-wrapper {
294
- transform-origin: right top;
295
- }
296
- }
297
-
298
- :host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper {
299
- transform-origin: center top;
300
- }
301
- :host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper, :host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-center .label-text-wrapper {
302
- transform-origin: calc(100% - center) top;
303
- }
304
-
305
- @supports selector(:dir(rtl)) {
306
- :host(.toggle-label-placement-stacked.toggle-alignment-center:dir(rtl)) .label-text-wrapper {
307
- transform-origin: calc(100% - center) top;
308
- }
309
- }
310
-
311
195
  .toggle-icon-wrapper {
312
196
  display: flex;
313
197
  position: relative;
@@ -378,6 +262,147 @@ input {
378
262
  transform: translate3d(calc(var(--handle-spacing) * 2), 0, 0);
379
263
  }
380
264
 
265
+ :host {
266
+ z-index: 2;
267
+ }
268
+
269
+ :host(.in-item) .label-text-wrapper {
270
+ margin-top: 10px;
271
+ margin-bottom: 10px;
272
+ }
273
+
274
+ :host(.in-item.toggle-label-placement-stacked) .label-text-wrapper {
275
+ margin-top: 10px;
276
+ margin-bottom: 16px;
277
+ }
278
+
279
+ :host(.in-item.toggle-label-placement-stacked) .native-wrapper {
280
+ margin-bottom: 10px;
281
+ }
282
+
283
+ .label-text-wrapper {
284
+ text-overflow: ellipsis;
285
+ white-space: nowrap;
286
+ overflow: hidden;
287
+ }
288
+
289
+ :host(.toggle-justify-space-between) .toggle-wrapper {
290
+ justify-content: space-between;
291
+ }
292
+
293
+ :host(.toggle-justify-start) .toggle-wrapper {
294
+ justify-content: start;
295
+ }
296
+
297
+ :host(.toggle-justify-end) .toggle-wrapper {
298
+ justify-content: end;
299
+ }
300
+
301
+ :host(.toggle-alignment-start) .toggle-wrapper {
302
+ align-items: start;
303
+ }
304
+
305
+ :host(.toggle-alignment-center) .toggle-wrapper {
306
+ align-items: center;
307
+ }
308
+
309
+ :host(.toggle-label-placement-fixed) .label-text-wrapper {
310
+ /**
311
+ * The margin between the label and
312
+ * the input should be on the end
313
+ * when the label sits at the start.
314
+ */
315
+ -webkit-margin-start: 0;
316
+ margin-inline-start: 0;
317
+ -webkit-margin-end: 16px;
318
+ margin-inline-end: 16px;
319
+ }
320
+
321
+ /**
322
+ * Label is on the left of the input in LTR and
323
+ * on the right in RTL. Label also has a fixed width.
324
+ */
325
+ :host(.toggle-label-placement-fixed) .label-text-wrapper {
326
+ flex: 0 0 100px;
327
+ width: 100px;
328
+ min-width: 100px;
329
+ max-width: 200px;
330
+ }
331
+
332
+ /**
333
+ * Label is on top of the toggle.
334
+ */
335
+ :host(.toggle-label-placement-stacked) .toggle-wrapper {
336
+ flex-direction: column;
337
+ }
338
+
339
+ :host(.toggle-label-placement-stacked) .label-text-wrapper {
340
+ transform: scale(0.75);
341
+ /**
342
+ * The margin between the label and
343
+ * the toggle should be on the bottom
344
+ * when the label sits on top.
345
+ */
346
+ margin-left: 0;
347
+ margin-right: 0;
348
+ margin-bottom: 16px;
349
+ /**
350
+ * Label text should not extend
351
+ * beyond the bounds of the toggle.
352
+ */
353
+ max-width: calc(100% / 0.75);
354
+ }
355
+
356
+ :host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper {
357
+ transform-origin: left top;
358
+ }
359
+ :host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-start) .label-text-wrapper, :host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-start .label-text-wrapper {
360
+ transform-origin: right top;
361
+ }
362
+
363
+ @supports selector(:dir(rtl)) {
364
+ :host(.toggle-label-placement-stacked.toggle-alignment-start:dir(rtl)) .label-text-wrapper {
365
+ transform-origin: right top;
366
+ }
367
+ }
368
+
369
+ :host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper {
370
+ transform-origin: center top;
371
+ }
372
+ :host-context([dir=rtl]):host(.toggle-label-placement-stacked.toggle-alignment-center) .label-text-wrapper, :host-context([dir=rtl]).toggle-label-placement-stacked.toggle-alignment-center .label-text-wrapper {
373
+ transform-origin: calc(100% - center) top;
374
+ }
375
+
376
+ @supports selector(:dir(rtl)) {
377
+ :host(.toggle-label-placement-stacked.toggle-alignment-center:dir(rtl)) .label-text-wrapper {
378
+ transform-origin: calc(100% - center) top;
379
+ }
380
+ }
381
+
382
+ :host(.toggle-label-placement-start) .label-text-wrapper {
383
+ /**
384
+ * The margin between the label and
385
+ * the input should be on the end
386
+ * when the label sits at the start.
387
+ */
388
+ -webkit-margin-start: 0;
389
+ margin-inline-start: 0;
390
+ -webkit-margin-end: 16px;
391
+ margin-inline-end: 16px;
392
+ }
393
+
394
+ /**
395
+ * The margin between the label and
396
+ * the input should be on the start
397
+ * when the label sits at the end.
398
+ */
399
+ :host(.toggle-label-placement-end) .label-text-wrapper {
400
+ -webkit-margin-start: 16px;
401
+ margin-inline-start: 16px;
402
+ -webkit-margin-end: 0;
403
+ margin-inline-end: 0;
404
+ }
405
+
381
406
  /**
382
407
  * Convert a pixels given value into rem
383
408
  *
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * (C) Ionic http://ionicframework.com - MIT License
3
3
  */
4
- import circleRegular from "@phosphor-icons/core/assets/regular/circle.svg";
5
- import lineVerticalRegular from "@phosphor-icons/core/assets/regular/line-vertical.svg";
4
+ import checkRegular from "@phosphor-icons/core/assets/regular/check.svg";
5
+ import minusRegular from "@phosphor-icons/core/assets/regular/minus.svg";
6
6
  import { Host, h } from "@stencil/core";
7
7
  import { renderHiddenInput, inheritAriaAttributes } from "../../utils/helpers";
8
8
  import { hapticSelection } from "../../utils/native/haptic";
@@ -140,7 +140,7 @@ export class Toggle {
140
140
  const theme = getIonTheme(this);
141
141
  const defaultIcons = {
142
142
  ios: removeOutline,
143
- ionic: lineVerticalRegular,
143
+ ionic: checkRegular,
144
144
  md: checkmarkOutline,
145
145
  };
146
146
  // Get the default icon based on the theme, falling back to 'md' icon if necessary
@@ -166,7 +166,7 @@ export class Toggle {
166
166
  const theme = getIonTheme(this);
167
167
  const defaultIcons = {
168
168
  ios: ellipseOutline,
169
- ionic: circleRegular,
169
+ ionic: minusRegular,
170
170
  md: removeOutline,
171
171
  };
172
172
  // Get the default icon based on the theme, falling back to 'md' icon if necessary
@@ -206,8 +206,9 @@ export class Toggle {
206
206
  const theme = getIonTheme(this);
207
207
  const value = this.getValue();
208
208
  const rtl = isRTL(el) ? 'rtl' : 'ltr';
209
+ const isIonicTheme = theme === 'ionic';
209
210
  renderHiddenInput(true, el, name, checked ? value : '', disabled);
210
- return (h(Host, { key: '184a920569b42f66f52fc7aab2d8670220a7e605', onClick: this.onClick, class: createColorClasses(color, {
211
+ return (h(Host, { key: '93fc47d96f36150a67232eaf362a77578f3fad11', onClick: this.onClick, class: createColorClasses(color, {
211
212
  [theme]: true,
212
213
  'in-item': hostContext('ion-item', el),
213
214
  'toggle-activated': activated,
@@ -217,10 +218,12 @@ export class Toggle {
217
218
  [`toggle-alignment-${alignment}`]: true,
218
219
  [`toggle-label-placement-${labelPlacement}`]: true,
219
220
  [`toggle-${rtl}`]: true,
220
- }) }, h("label", { key: '702b8e0c1014fa2425a8e4b4e68d451bd6b8ff7a', class: "toggle-wrapper" }, h("input", Object.assign({ key: 'c382b53502cc1aa783674625ddc66adbe96a0619', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl) }, this.inheritedAttributes)), h("div", { key: 'd3c469fb9aca7c90cf1df6e731f3c1345b558b31', class: {
221
+ 'ion-activatable': isIonicTheme,
222
+ 'ion-focusable': isIonicTheme,
223
+ }) }, h("label", { key: '5393138f72b8ccb31443b56a76a96332bf5b519f', class: "toggle-wrapper" }, h("input", Object.assign({ key: '35af93ddf795b8145bd6f7d7eb66d4793f35372c', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl) }, this.inheritedAttributes)), h("div", { key: 'dee41d1d8e3ae69153087222b77b016242e9a6c8', class: {
221
224
  'label-text-wrapper': true,
222
225
  'label-text-wrapper-hidden': !this.hasLabel,
223
- }, part: "label" }, h("slot", { key: '1891a02e9ad17a2433f29c7f51cb9d9b16750a4e' })), h("div", { key: 'f84cb5515f519de8a174d9111a99fe4d648d0e76', class: "native-wrapper" }, this.renderToggleControl()))));
226
+ }, part: "label" }, h("slot", { key: '0d708fa9324b8af4d730641ef1577dd682aedfd8' })), h("div", { key: '55b9a578a8464758c409c43288e708617dea4dd8', class: "native-wrapper" }, this.renderToggleControl()))));
224
227
  }
225
228
  static get is() { return "ion-toggle"; }
226
229
  static get encapsulation() { return "shadow"; }
@@ -228,14 +231,14 @@ export class Toggle {
228
231
  return {
229
232
  "ios": ["toggle.ios.scss"],
230
233
  "md": ["toggle.md.scss"],
231
- "ionic": ["toggle.md.scss"]
234
+ "ionic": ["toggle.ionic.scss"]
232
235
  };
233
236
  }
234
237
  static get styleUrls() {
235
238
  return {
236
239
  "ios": ["toggle.ios.css"],
237
240
  "md": ["toggle.md.css"],
238
- "ionic": ["toggle.md.css"]
241
+ "ionic": ["toggle.ionic.css"]
239
242
  };
240
243
  }
241
244
  static get properties() {