@m3e/chips 1.0.0-rc.2 → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +42 -65
- package/dist/index.js +59 -18
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +29 -18
- package/dist/index.min.js.map +1 -1
- package/dist/src/AssistChipElement.d.ts +83 -0
- package/dist/src/AssistChipElement.d.ts.map +1 -0
- package/dist/src/ChipElement.d.ts +83 -0
- package/dist/src/ChipElement.d.ts.map +1 -0
- package/dist/src/ChipSetElement.d.ts +42 -0
- package/dist/src/ChipSetElement.d.ts.map +1 -0
- package/dist/src/ChipVariant.d.ts +3 -0
- package/dist/src/ChipVariant.d.ts.map +1 -0
- package/dist/src/FilterChipElement.d.ts +105 -0
- package/dist/src/FilterChipElement.d.ts.map +1 -0
- package/dist/src/FilterChipSetElement.d.ts +77 -0
- package/dist/src/FilterChipSetElement.d.ts.map +1 -0
- package/dist/src/InputChipElement.d.ts +117 -0
- package/dist/src/InputChipElement.d.ts.map +1 -0
- package/dist/src/InputChipSetElement.d.ts +74 -0
- package/dist/src/InputChipSetElement.d.ts.map +1 -0
- package/dist/src/SuggestionChipElement.d.ts +84 -0
- package/dist/src/SuggestionChipElement.d.ts.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -404,6 +404,21 @@
|
|
|
404
404
|
"tagName": "m3e-assist-chip",
|
|
405
405
|
"customElement": true,
|
|
406
406
|
"members": [
|
|
407
|
+
{
|
|
408
|
+
"kind": "field",
|
|
409
|
+
"name": "formAssociated",
|
|
410
|
+
"static": true,
|
|
411
|
+
"readonly": true,
|
|
412
|
+
"default": "true",
|
|
413
|
+
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration.",
|
|
414
|
+
"type": {
|
|
415
|
+
"text": "boolean"
|
|
416
|
+
},
|
|
417
|
+
"inheritedFrom": {
|
|
418
|
+
"name": "AttachInternals",
|
|
419
|
+
"module": "../core/src/shared/mixins/AttachInternals.ts"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
407
422
|
{
|
|
408
423
|
"kind": "field",
|
|
409
424
|
"name": "name",
|
|
@@ -447,18 +462,6 @@
|
|
|
447
462
|
"module": "../core/src/shared/mixins/LinkButton.ts"
|
|
448
463
|
}
|
|
449
464
|
},
|
|
450
|
-
{
|
|
451
|
-
"kind": "field",
|
|
452
|
-
"name": "formAssociated",
|
|
453
|
-
"static": true,
|
|
454
|
-
"readonly": true,
|
|
455
|
-
"default": "formAssociated",
|
|
456
|
-
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration.",
|
|
457
|
-
"inheritedFrom": {
|
|
458
|
-
"name": "AttachInternals",
|
|
459
|
-
"module": "../core/src/shared/mixins/AttachInternals.ts"
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
465
|
{
|
|
463
466
|
"kind": "field",
|
|
464
467
|
"name": "[_internals]",
|
|
@@ -2937,27 +2940,6 @@
|
|
|
2937
2940
|
}
|
|
2938
2941
|
]
|
|
2939
2942
|
},
|
|
2940
|
-
{
|
|
2941
|
-
"kind": "method",
|
|
2942
|
-
"name": "dispatchEvent",
|
|
2943
|
-
"return": {
|
|
2944
|
-
"type": {
|
|
2945
|
-
"text": "boolean"
|
|
2946
|
-
}
|
|
2947
|
-
},
|
|
2948
|
-
"parameters": [
|
|
2949
|
-
{
|
|
2950
|
-
"name": "event",
|
|
2951
|
-
"type": {
|
|
2952
|
-
"text": "Event"
|
|
2953
|
-
}
|
|
2954
|
-
}
|
|
2955
|
-
],
|
|
2956
|
-
"inheritedFrom": {
|
|
2957
|
-
"name": "EventAttribute",
|
|
2958
|
-
"module": "../core/src/shared/mixins/EventAttribute.ts"
|
|
2959
|
-
}
|
|
2960
|
-
},
|
|
2961
2943
|
{
|
|
2962
2944
|
"kind": "field",
|
|
2963
2945
|
"name": "[_suppressedEventHandler]",
|
|
@@ -3464,7 +3446,7 @@
|
|
|
3464
3446
|
"type": {
|
|
3465
3447
|
"text": "readonly string[] | null"
|
|
3466
3448
|
},
|
|
3467
|
-
"description": "The
|
|
3449
|
+
"description": "The values of the set.",
|
|
3468
3450
|
"readonly": true
|
|
3469
3451
|
},
|
|
3470
3452
|
{
|
|
@@ -4588,6 +4570,21 @@
|
|
|
4588
4570
|
"tagName": "m3e-suggestion-chip",
|
|
4589
4571
|
"customElement": true,
|
|
4590
4572
|
"members": [
|
|
4573
|
+
{
|
|
4574
|
+
"kind": "field",
|
|
4575
|
+
"name": "formAssociated",
|
|
4576
|
+
"static": true,
|
|
4577
|
+
"readonly": true,
|
|
4578
|
+
"default": "true",
|
|
4579
|
+
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration.",
|
|
4580
|
+
"type": {
|
|
4581
|
+
"text": "boolean"
|
|
4582
|
+
},
|
|
4583
|
+
"inheritedFrom": {
|
|
4584
|
+
"name": "AttachInternals",
|
|
4585
|
+
"module": "../core/src/shared/mixins/AttachInternals.ts"
|
|
4586
|
+
}
|
|
4587
|
+
},
|
|
4591
4588
|
{
|
|
4592
4589
|
"kind": "field",
|
|
4593
4590
|
"name": "name",
|
|
@@ -4631,18 +4628,6 @@
|
|
|
4631
4628
|
"module": "../core/src/shared/mixins/LinkButton.ts"
|
|
4632
4629
|
}
|
|
4633
4630
|
},
|
|
4634
|
-
{
|
|
4635
|
-
"kind": "field",
|
|
4636
|
-
"name": "formAssociated",
|
|
4637
|
-
"static": true,
|
|
4638
|
-
"readonly": true,
|
|
4639
|
-
"default": "formAssociated",
|
|
4640
|
-
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration.",
|
|
4641
|
-
"inheritedFrom": {
|
|
4642
|
-
"name": "AttachInternals",
|
|
4643
|
-
"module": "../core/src/shared/mixins/AttachInternals.ts"
|
|
4644
|
-
}
|
|
4645
|
-
},
|
|
4646
4631
|
{
|
|
4647
4632
|
"kind": "field",
|
|
4648
4633
|
"name": "[_internals]",
|
|
@@ -5909,25 +5894,6 @@
|
|
|
5909
5894
|
"kind": "mixin",
|
|
5910
5895
|
"description": "Mixin that adds support for custom event attributes.",
|
|
5911
5896
|
"name": "EventAttribute",
|
|
5912
|
-
"members": [
|
|
5913
|
-
{
|
|
5914
|
-
"kind": "method",
|
|
5915
|
-
"name": "dispatchEvent",
|
|
5916
|
-
"return": {
|
|
5917
|
-
"type": {
|
|
5918
|
-
"text": "boolean"
|
|
5919
|
-
}
|
|
5920
|
-
},
|
|
5921
|
-
"parameters": [
|
|
5922
|
-
{
|
|
5923
|
-
"name": "event",
|
|
5924
|
-
"type": {
|
|
5925
|
-
"text": "Event"
|
|
5926
|
-
}
|
|
5927
|
-
}
|
|
5928
|
-
]
|
|
5929
|
-
}
|
|
5930
|
-
],
|
|
5931
5897
|
"parameters": [
|
|
5932
5898
|
{
|
|
5933
5899
|
"name": "base",
|
|
@@ -6225,6 +6191,17 @@
|
|
|
6225
6191
|
"description": "Mixin to augment an element with behavior used to submit a form.",
|
|
6226
6192
|
"name": "FormSubmitter",
|
|
6227
6193
|
"members": [
|
|
6194
|
+
{
|
|
6195
|
+
"kind": "field",
|
|
6196
|
+
"name": "formAssociated",
|
|
6197
|
+
"type": {
|
|
6198
|
+
"text": "boolean"
|
|
6199
|
+
},
|
|
6200
|
+
"static": true,
|
|
6201
|
+
"readonly": true,
|
|
6202
|
+
"default": "true",
|
|
6203
|
+
"description": "Indicates that this custom element participates in form submission, validation, and form state restoration."
|
|
6204
|
+
},
|
|
6228
6205
|
{
|
|
6229
6206
|
"kind": "field",
|
|
6230
6207
|
"name": "name",
|
package/dist/index.js
CHANGED
|
@@ -268,6 +268,16 @@ M3eChipElement.styles = css `
|
|
|
268
268
|
overflow: hidden;
|
|
269
269
|
text-overflow: ellipsis;
|
|
270
270
|
}
|
|
271
|
+
a {
|
|
272
|
+
all: unset;
|
|
273
|
+
display: block;
|
|
274
|
+
position: absolute;
|
|
275
|
+
top: 0px;
|
|
276
|
+
left: 0px;
|
|
277
|
+
right: 0px;
|
|
278
|
+
bottom: 0px;
|
|
279
|
+
z-index: 1;
|
|
280
|
+
}
|
|
271
281
|
:host([variant="elevated"]) .base {
|
|
272
282
|
background-color: var(--m3e-elevated-chip-container-color, ${DesignToken.color.surfaceContainerLow});
|
|
273
283
|
|
|
@@ -541,6 +551,18 @@ var _M3eFilterChipElement_instances, _M3eFilterChipElement_clickHandler, _M3eFil
|
|
|
541
551
|
* with Material 3 guidelines. Appearance variants include `elevated` and `outlined`, enabling visual
|
|
542
552
|
* differentiation and contextual emphasis.
|
|
543
553
|
*
|
|
554
|
+
* @example
|
|
555
|
+
* The following example illustrates a single-select `m3e-filter-chip-set` containing multiple `m3e-filter-chip` components that
|
|
556
|
+
* allow a user to choose an option. You can use the `multi` attribute to enable multiselect.
|
|
557
|
+
* ```html
|
|
558
|
+
* <m3e-filter-chip-set aria-label="Filter by topic">
|
|
559
|
+
* <m3e-filter-chip><m3e-icon slot="icon" name="palette"></m3e-icon>Design</m3e-filter-chip>
|
|
560
|
+
* <m3e-filter-chip><m3e-icon slot="icon" name="accessibility_new"></m3e-icon>Accessibility</m3e-filter-chip>
|
|
561
|
+
* <m3e-filter-chip><m3e-icon slot="icon" name="motion_photos_on"></m3e-icon>Motion</m3e-filter-chip>
|
|
562
|
+
* <m3e-filter-chip><m3e-icon slot="icon" name="description"></m3e-icon>Documentation</m3e-filter-chip>
|
|
563
|
+
* </m3e-filter-chip-set>
|
|
564
|
+
* ```
|
|
565
|
+
*
|
|
544
566
|
* @tag m3e-filter-chip
|
|
545
567
|
*
|
|
546
568
|
* @slot - Renders the label of the chip.
|
|
@@ -922,6 +944,19 @@ var _M3eInputChipElement_instances, _M3eInputChipElement_handleAvatarSlotChange,
|
|
|
922
944
|
* and manage discrete values such as tags or keywords. It supports expressive styling, accessibility,
|
|
923
945
|
* keyboard interaction, and appearance variants including `elevated` and `outlined`.
|
|
924
946
|
*
|
|
947
|
+
* @example
|
|
948
|
+
* The following example illustrates the use of the `m3e-input-chip-set` inside a `m3e-form-field`.
|
|
949
|
+
* In this example, the `input` slot specifies the `input` element used to add input chips and the
|
|
950
|
+
* field label's `for` attribute targets the `input` element to provide an accessible label.
|
|
951
|
+
* ```html
|
|
952
|
+
* <m3e-form-field>
|
|
953
|
+
* <label slot="label" for="keywords">Keywords</label>
|
|
954
|
+
* <m3e-input-chip-set aria-label="Enter keywords">
|
|
955
|
+
* <input id="keywords" slot="input" placeholder="New keyword..." />
|
|
956
|
+
* </m3e-input-chip-set>
|
|
957
|
+
* </m3e-form-field>
|
|
958
|
+
* ```
|
|
959
|
+
*
|
|
925
960
|
* @tag m3e-input-chip
|
|
926
961
|
*
|
|
927
962
|
* @slot - Renders the label of the chip.
|
|
@@ -1207,7 +1242,7 @@ let M3eInputChipSetElement = class M3eInputChipSetElement extends RequiredConstr
|
|
|
1207
1242
|
// validating required state on change to support form-field integration.
|
|
1208
1243
|
return [...this.querySelectorAll("m3e-input-chip")];
|
|
1209
1244
|
}
|
|
1210
|
-
/** The
|
|
1245
|
+
/** The values of the set. */
|
|
1211
1246
|
get value() {
|
|
1212
1247
|
const values = this.chips.map((x) => x.value);
|
|
1213
1248
|
return values.length == 0 ? null : values;
|
|
@@ -1381,6 +1416,29 @@ _M3eInputChipSetElement_handleInputKeyDown = function _M3eInputChipSetElement_ha
|
|
|
1381
1416
|
}
|
|
1382
1417
|
}
|
|
1383
1418
|
};
|
|
1419
|
+
(() => {
|
|
1420
|
+
const lightDomStyle = new CSSStyleSheet();
|
|
1421
|
+
lightDomStyle.replaceSync(css `
|
|
1422
|
+
m3e-input-chip-set [slot="input"]::placeholder {
|
|
1423
|
+
user-select: none;
|
|
1424
|
+
color: currentColor;
|
|
1425
|
+
transition: opacity ${DesignToken.motion.duration.extraLong1};
|
|
1426
|
+
}
|
|
1427
|
+
m3e-input-chip-set:not(:focus-within) [slot="input"]::placeholder {
|
|
1428
|
+
opacity: 0;
|
|
1429
|
+
transition: 0s;
|
|
1430
|
+
}
|
|
1431
|
+
m3e-input-chip-set:hover [slot="input"]::placeholder {
|
|
1432
|
+
transition: 0s;
|
|
1433
|
+
}
|
|
1434
|
+
@media (prefers-reduced-motion) {
|
|
1435
|
+
m3e-input-chip-set [slot="input"]::placeholder {
|
|
1436
|
+
transition: none !important;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
`.toString());
|
|
1440
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
1441
|
+
})();
|
|
1384
1442
|
/** The styles of the element. */
|
|
1385
1443
|
M3eInputChipSetElement.styles = [
|
|
1386
1444
|
M3eChipSetElement.styles,
|
|
@@ -1402,27 +1460,10 @@ M3eInputChipSetElement.styles = [
|
|
|
1402
1460
|
::slotted(m3e-input-chip) {
|
|
1403
1461
|
min-width: 0;
|
|
1404
1462
|
}
|
|
1405
|
-
::slotted([slot="input"])::placeholder {
|
|
1406
|
-
user-select: none;
|
|
1407
|
-
color: currentColor;
|
|
1408
|
-
transition: opacity ${DesignToken.motion.duration.extraLong1};
|
|
1409
|
-
}
|
|
1410
|
-
:host(:not(:focus-within)) ::slotted([slot="input"])::placeholder {
|
|
1411
|
-
opacity: 0;
|
|
1412
|
-
transition: 0s;
|
|
1413
|
-
}
|
|
1414
|
-
:host(:hover) ::slotted([slot="input"])::placeholder {
|
|
1415
|
-
transition: 0s;
|
|
1416
|
-
}
|
|
1417
1463
|
span[role="row"],
|
|
1418
1464
|
span[role="gridcell"] {
|
|
1419
1465
|
display: contents;
|
|
1420
1466
|
}
|
|
1421
|
-
@media (prefers-reduced-motion) {
|
|
1422
|
-
::slotted([slot="input"])::placeholder {
|
|
1423
|
-
transition: none !important;
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
1467
|
`,
|
|
1427
1468
|
];
|
|
1428
1469
|
M3eInputChipSetElement = __decorate([
|