@m3e/web 2.5.2 → 2.5.4

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 (101) hide show
  1. package/dist/all.js +1039 -40
  2. package/dist/all.js.map +1 -1
  3. package/dist/all.min.js +158 -45
  4. package/dist/all.min.js.map +1 -1
  5. package/dist/autocomplete.js +2 -2
  6. package/dist/autocomplete.js.map +1 -1
  7. package/dist/autocomplete.min.js +1 -1
  8. package/dist/autocomplete.min.js.map +1 -1
  9. package/dist/bottom-sheet.js +2 -2
  10. package/dist/bottom-sheet.js.map +1 -1
  11. package/dist/bottom-sheet.min.js +1 -1
  12. package/dist/bottom-sheet.min.js.map +1 -1
  13. package/dist/calendar.js +12 -0
  14. package/dist/calendar.js.map +1 -1
  15. package/dist/calendar.min.js +5 -5
  16. package/dist/calendar.min.js.map +1 -1
  17. package/dist/chips.js +2 -2
  18. package/dist/chips.js.map +1 -1
  19. package/dist/chips.min.js +1 -1
  20. package/dist/chips.min.js.map +1 -1
  21. package/dist/core.js +2 -25
  22. package/dist/core.js.map +1 -1
  23. package/dist/core.min.js +1 -1
  24. package/dist/core.min.js.map +1 -1
  25. package/dist/css-custom-data.json +262 -262
  26. package/dist/custom-elements.json +1954 -2000
  27. package/dist/datepicker.js +6 -0
  28. package/dist/datepicker.js.map +1 -1
  29. package/dist/datepicker.min.js +1 -1
  30. package/dist/datepicker.min.js.map +1 -1
  31. package/dist/dialog.js +2 -2
  32. package/dist/dialog.js.map +1 -1
  33. package/dist/dialog.min.js +1 -1
  34. package/dist/dialog.min.js.map +1 -1
  35. package/dist/expansion-panel.js +2 -2
  36. package/dist/expansion-panel.js.map +1 -1
  37. package/dist/expansion-panel.min.js +1 -1
  38. package/dist/expansion-panel.min.js.map +1 -1
  39. package/dist/html-custom-data.json +92 -92
  40. package/dist/icon.js +1 -1
  41. package/dist/icon.js.map +1 -1
  42. package/dist/icon.min.js +1 -1
  43. package/dist/icon.min.js.map +1 -1
  44. package/dist/list.js +1 -1
  45. package/dist/list.js.map +1 -1
  46. package/dist/list.min.js +1 -1
  47. package/dist/list.min.js.map +1 -1
  48. package/dist/nav-bar.js +1 -1
  49. package/dist/nav-bar.js.map +1 -1
  50. package/dist/nav-bar.min.js +1 -1
  51. package/dist/nav-bar.min.js.map +1 -1
  52. package/dist/nav-menu.js +2 -2
  53. package/dist/nav-menu.js.map +1 -1
  54. package/dist/nav-menu.min.js +1 -1
  55. package/dist/nav-menu.min.js.map +1 -1
  56. package/dist/paginator.js +2 -2
  57. package/dist/paginator.js.map +1 -1
  58. package/dist/paginator.min.js +2 -2
  59. package/dist/paginator.min.js.map +1 -1
  60. package/dist/search.js +3 -3
  61. package/dist/search.js.map +1 -1
  62. package/dist/search.min.js +1 -1
  63. package/dist/search.min.js.map +1 -1
  64. package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
  65. package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
  66. package/dist/src/calendar/CalendarElement.d.ts.map +1 -1
  67. package/dist/src/chips/InputChipElement.d.ts.map +1 -1
  68. package/dist/src/core/shared/mixins/index.d.ts +0 -1
  69. package/dist/src/core/shared/mixins/index.d.ts.map +1 -1
  70. package/dist/src/core/shared/primitives/CollapsibleElement.d.ts.map +1 -1
  71. package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -1
  72. package/dist/src/dialog/DialogElement.d.ts.map +1 -1
  73. package/dist/src/expansion-panel/ExpansionPanelElement.d.ts.map +1 -1
  74. package/dist/src/icon/IconElement.d.ts.map +1 -1
  75. package/dist/src/list/ListItemButtonElement.d.ts +0 -5
  76. package/dist/src/list/ListItemButtonElement.d.ts.map +1 -1
  77. package/dist/src/nav-bar/NavItemElement.d.ts.map +1 -1
  78. package/dist/src/nav-menu/NavMenuItemElement.d.ts.map +1 -1
  79. package/dist/src/paginator/PaginatorElement.d.ts.map +1 -1
  80. package/dist/src/search/SearchBarElement.d.ts.map +1 -1
  81. package/dist/src/search/SearchViewElement.d.ts.map +1 -1
  82. package/dist/src/theme/getColorFromImage.d.ts +12 -0
  83. package/dist/src/theme/getColorFromImage.d.ts.map +1 -0
  84. package/dist/src/theme/index.d.ts +1 -0
  85. package/dist/src/theme/index.d.ts.map +1 -1
  86. package/dist/src/tree/TreeItemElement.d.ts.map +1 -1
  87. package/dist/theme.js +1005 -1
  88. package/dist/theme.js.map +1 -1
  89. package/dist/theme.min.js +133 -20
  90. package/dist/theme.min.js.map +1 -1
  91. package/dist/toc.js +1 -1
  92. package/dist/toc.js.map +1 -1
  93. package/dist/toc.min.js +1 -1
  94. package/dist/toc.min.js.map +1 -1
  95. package/dist/tree.js +2 -2
  96. package/dist/tree.js.map +1 -1
  97. package/dist/tree.min.js +1 -1
  98. package/dist/tree.min.js.map +1 -1
  99. package/package.json +1 -1
  100. package/dist/src/core/shared/mixins/EventAttribute.d.ts +0 -11
  101. package/dist/src/core/shared/mixins/EventAttribute.d.ts.map +0 -1
@@ -24,12 +24,6 @@
24
24
  ],
25
25
  "references": []
26
26
  },
27
- {
28
- "name": "m3e-avatar",
29
- "description": "An image, icon or textual initials representing a user or other identity.\n---\n\n\n### **Slots:**\n - _default_ - Renders the content of the avatar.\n\n### **CSS Properties:**\n - **--m3e-avatar-size** - Size of the avatar. _(default: undefined)_\n- **--m3e-avatar-shape** - Border radius of the avatar. _(default: undefined)_\n- **--m3e-avatar-font-size** - Font size for the avatar. _(default: undefined)_\n- **--m3e-avatar-font-weight** - Font weight for the avatar. _(default: undefined)_\n- **--m3e-avatar-line-height** - Line height for the avatar. _(default: undefined)_\n- **--m3e-avatar-tracking** - Letter spacing for the avatar. _(default: undefined)_\n- **--m3e-avatar-color** - Background color of the avatar. _(default: undefined)_\n- **--m3e-avatar-label-color** - Text color of the avatar. _(default: undefined)_",
30
- "attributes": [],
31
- "references": []
32
- },
33
27
  {
34
28
  "name": "m3e-autocomplete",
35
29
  "description": "Enhances a text input with suggested options.\n---\n\n\n### **Events:**\n - **change** - Emitted when the committed value changes due to selecting an option or clearing the input.\n- **query** - Emitted when the input is focused or when the user modifies its value.\n- **toggle** - Emitted when the options menu opens or closes.\n\n### **Methods:**\n - **attach(control: _HTMLElement_): _void_** - Attaches the element to an interactive control.\n- **detach(): _void_** - Detaches the element from its current interactive control.\n- **clear(restoreFocus): _void_** - Clears the value of the element.\n\n### **Slots:**\n - _default_ - Renders the options of the autocomplete.\n- **loading** - Renders content when loading options.\n- **no-data** - Renders content when there are no options to show.",
@@ -127,6 +121,12 @@
127
121
  ],
128
122
  "references": []
129
123
  },
124
+ {
125
+ "name": "m3e-avatar",
126
+ "description": "An image, icon or textual initials representing a user or other identity.\n---\n\n\n### **Slots:**\n - _default_ - Renders the content of the avatar.\n\n### **CSS Properties:**\n - **--m3e-avatar-size** - Size of the avatar. _(default: undefined)_\n- **--m3e-avatar-shape** - Border radius of the avatar. _(default: undefined)_\n- **--m3e-avatar-font-size** - Font size for the avatar. _(default: undefined)_\n- **--m3e-avatar-font-weight** - Font weight for the avatar. _(default: undefined)_\n- **--m3e-avatar-line-height** - Line height for the avatar. _(default: undefined)_\n- **--m3e-avatar-tracking** - Letter spacing for the avatar. _(default: undefined)_\n- **--m3e-avatar-color** - Background color of the avatar. _(default: undefined)_\n- **--m3e-avatar-label-color** - Text color of the avatar. _(default: undefined)_",
127
+ "attributes": [],
128
+ "references": []
129
+ },
130
130
  {
131
131
  "name": "m3e-bottom-sheet-action",
132
132
  "description": "An element, nested within a clickable element, used to close a parenting bottom sheet.\n---\n\n\n### **Methods:**\n \n\n### **Slots:**\n - _default_ - Renders the content of the action.",
@@ -375,6 +375,28 @@
375
375
  ],
376
376
  "references": []
377
377
  },
378
+ {
379
+ "name": "m3e-button-group",
380
+ "description": "Organizes buttons and adds interactions between them.\n---\n\n\n### **Slots:**\n - _default_ - Renders the buttons of the group.\n\n### **CSS Properties:**\n - **--m3e-standard-button-group-extra-small-spacing** - Spacing between buttons in standard variant, extra-small size. _(default: undefined)_\n- **--m3e-standard-button-group-small-spacing** - Spacing between buttons in standard variant, small size. _(default: undefined)_\n- **--m3e-standard-button-group-medium-spacing** - Spacing between buttons in standard variant, medium size. _(default: undefined)_\n- **--m3e-standard-button-group-large-spacing** - Spacing between buttons in standard variant, large size. _(default: undefined)_\n- **--m3e-standard-button-group-extra-large-spacing** - Spacing between buttons in standard variant, extra-large size. _(default: undefined)_\n- **--m3e-connected-button-group-spacing** - Spacing between buttons in connected variant. _(default: undefined)_\n- **--m3e-connected-button-group-extra-small-inner-shape** - Corner shape for connected variant, extra-small size. _(default: undefined)_\n- **--m3e-connected-button-group-extra-small-inner-pressed-shape** - Pressed corner shape for connected variant, extra-small size. _(default: undefined)_\n- **--m3e-connected-button-group-small-inner-shape** - Corner shape for connected variant, small size. _(default: undefined)_\n- **--m3e-connected-button-group-small-inner-pressed-shape** - Pressed corner shape for connected variant, small size. _(default: undefined)_\n- **--m3e-connected-button-group-medium-inner-shape** - Corner shape for connected variant, medium size. _(default: undefined)_\n- **--m3e-connected-button-group-medium-inner-pressed-shape** - Pressed corner shape for connected variant, medium size. _(default: undefined)_\n- **--m3e-connected-button-group-large-inner-shape** - Corner shape for connected variant, large size. _(default: undefined)_\n- **--m3e-connected-button-group-large-inner-pressed-shape** - Pressed corner shape for connected variant, large size. _(default: undefined)_\n- **--m3e-connected-button-group-extra-large-inner-shape** - Corner shape for connected variant, extra-large size. _(default: undefined)_\n- **--m3e-connected-button-group-extra-large-inner-pressed-shape** - Pressed corner shape for connected variant, extra-large size. _(default: undefined)_",
381
+ "attributes": [
382
+ {
383
+ "name": "multi",
384
+ "description": "Whether multiple toggle buttons can be selected.",
385
+ "values": []
386
+ },
387
+ {
388
+ "name": "size",
389
+ "description": "The size of the group.",
390
+ "values": [{ "name": "ButtonGroupSize" }]
391
+ },
392
+ {
393
+ "name": "variant",
394
+ "description": "The appearance variant of the group.",
395
+ "values": [{ "name": "ButtonGroupVariant" }]
396
+ }
397
+ ],
398
+ "references": []
399
+ },
378
400
  {
379
401
  "name": "m3e-calendar",
380
402
  "description": "A calendar used to select a date.\n---\n\n\n### **Events:**\n - **change** - Emitted when the selected date changes.\n\n### **Methods:**\n - **focusActiveCell(): _Promise<void>_** - Asynchronously focuses the active date.\n- **updateTodayDate(): _void_** - Updates today's date.\n- **movePreviousPeriod(): _Promise<void>_** - Moves the calendar to the previous period.\n- **moveNextPeriod(): _Promise<void>_** - Moves the calendar to the next period.\n- **togglePeriod(): _Promise<void>_** - Toggles the current period.\n\n### **Slots:**\n - **header** - Renders the header of the calendar.\n\n### **CSS Properties:**\n - **--m3e-calendar-container-color** - Background color of the container surface. _(default: undefined)_\n- **--m3e-calendar-container-elevation** - Elevation shadow applied to the container surface. _(default: undefined)_\n- **--m3e-calendar-container-shape** - Corner radius of the container surface. _(default: undefined)_\n- **--m3e-calendar-padding** - Padding applied to the calendar header and body. _(default: undefined)_\n- **--m3e-calendar-period-button-text-color** - Text color used for the period‑navigation buttons in the header. _(default: undefined)_\n- **--m3e-calendar-weekday-font-size** - Font size of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-font-weight** - Font weight of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-line-height** - Line height of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-tracking** - Letter spacing of weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-weekday-color** - Text color for weekday labels in month view. _(default: undefined)_\n- **--m3e-calendar-date-font-size** - Font size of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-font-weight** - Font weight of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-line-height** - Line height of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-date-tracking** - Letter spacing of date cells in month view. _(default: undefined)_\n- **--m3e-calendar-item-font-size** - Font size of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-font-weight** - Font weight of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-line-height** - Line height of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-tracking** - Letter spacing of items in year and multi‑year views. _(default: undefined)_\n- **--m3e-calendar-item-color** - Text color for date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-color** - Text color for selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-container-color** - Background color for selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-ripple-color** - Ripple color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-hover-color** - Hover color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-selected-focus-color** - Focus color used when interacting with selected date items. _(default: undefined)_\n- **--m3e-calendar-item-current-outline-thickness** - Outline thickness used to indicate the current date. _(default: undefined)_\n- **--m3e-calendar-item-current-outline-color** - Outline color used to indicate the current date. _(default: undefined)_\n- **--m3e-calendar-item-special-color** - Text color for dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-container-color** - Background color for dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-ripple-color** - Ripple color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-hover-color** - Hover color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-item-special-focus-color** - Focus color used when interacting with dates marked as special. _(default: undefined)_\n- **--m3e-calendar-range-container-color** - Background color applied to the selected date range. _(default: undefined)_\n- **--m3e-calendar-range-color** - Text color for dates within a selected range. _(default: undefined)_\n- **--m3e-calendar-item-disabled-color** - Color used for disabled date items. _(default: undefined)_\n- **--m3e-calendar-item-disabled-color-opacity** - Opacity applied to the disabled item color. _(default: undefined)_\n- **--m3e-calendar-slide-animation-duration** - Duration of slide transitions between calendar views. _(default: undefined)_",
@@ -554,23 +576,38 @@
554
576
  "references": []
555
577
  },
556
578
  {
557
- "name": "m3e-button-group",
558
- "description": "Organizes buttons and adds interactions between them.\n---\n\n\n### **Slots:**\n - _default_ - Renders the buttons of the group.\n\n### **CSS Properties:**\n - **--m3e-standard-button-group-extra-small-spacing** - Spacing between buttons in standard variant, extra-small size. _(default: undefined)_\n- **--m3e-standard-button-group-small-spacing** - Spacing between buttons in standard variant, small size. _(default: undefined)_\n- **--m3e-standard-button-group-medium-spacing** - Spacing between buttons in standard variant, medium size. _(default: undefined)_\n- **--m3e-standard-button-group-large-spacing** - Spacing between buttons in standard variant, large size. _(default: undefined)_\n- **--m3e-standard-button-group-extra-large-spacing** - Spacing between buttons in standard variant, extra-large size. _(default: undefined)_\n- **--m3e-connected-button-group-spacing** - Spacing between buttons in connected variant. _(default: undefined)_\n- **--m3e-connected-button-group-extra-small-inner-shape** - Corner shape for connected variant, extra-small size. _(default: undefined)_\n- **--m3e-connected-button-group-extra-small-inner-pressed-shape** - Pressed corner shape for connected variant, extra-small size. _(default: undefined)_\n- **--m3e-connected-button-group-small-inner-shape** - Corner shape for connected variant, small size. _(default: undefined)_\n- **--m3e-connected-button-group-small-inner-pressed-shape** - Pressed corner shape for connected variant, small size. _(default: undefined)_\n- **--m3e-connected-button-group-medium-inner-shape** - Corner shape for connected variant, medium size. _(default: undefined)_\n- **--m3e-connected-button-group-medium-inner-pressed-shape** - Pressed corner shape for connected variant, medium size. _(default: undefined)_\n- **--m3e-connected-button-group-large-inner-shape** - Corner shape for connected variant, large size. _(default: undefined)_\n- **--m3e-connected-button-group-large-inner-pressed-shape** - Pressed corner shape for connected variant, large size. _(default: undefined)_\n- **--m3e-connected-button-group-extra-large-inner-shape** - Corner shape for connected variant, extra-large size. _(default: undefined)_\n- **--m3e-connected-button-group-extra-large-inner-pressed-shape** - Pressed corner shape for connected variant, extra-large size. _(default: undefined)_",
579
+ "name": "m3e-checkbox",
580
+ "description": "A checkbox that allows a user to select one or more options from a limited number of choices.\n---\n\n\n### **Events:**\n - **input** - Emitted when the checked state changes.\n- **change** - Emitted when the checked state changes.\n- **invalid** - Emitted when a form is submitted and the element fails constraint validation.\n- **click** - Emitted when the element is clicked.\n\n### **Methods:**\n - **markAsPristine(): _void_** - Marks the element as pristine.\n- **markAsDirty(): _void_** - Marks the element as dirty.\n- **markAsTouched(): _void_** - Marks the element as touched.\n- **markAsUntouched(): _void_** - Marks the element as untouched.\n- **reportValidity(): _boolean_** - Returns `true` if the element has no validity problems; otherwise, returns `false`, fires\r\nan invalid event, and (if the event isn't canceled) reports the problem to the user.\n- **checkValidity(): _boolean_** - Returns `true` if the element has no validity problems; otherwise,\r\nreturns `false`, fires an invalid event.\n- **setCustomValidity(error: _string_): _void_** - Sets a custom validity message for the element.\n- **formDisabledCallback(disabled: _boolean_): _void_** - Called when the element is disabled or enabled via its form association.\n- **formResetCallback(): _void_** - Called when the associated form is reset.\n\n### **CSS Properties:**\n - **--m3e-checkbox-icon-size** - Size of the checkbox icon inside the container. _(default: undefined)_\n- **--m3e-checkbox-container-size** - Base size of the checkbox container. _(default: undefined)_\n- **--m3e-checkbox-container-shape** - Border radius of the icon container. _(default: undefined)_\n- **--m3e-checkbox-unselected-outline-thickness** - Border thickness for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-outline-color** - Border color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-hover-outline-color** - Border color on hover when unselected. _(default: undefined)_\n- **--m3e-checkbox-unselected-disabled-outline-color** - Base color for disabled unselected outline. _(default: undefined)_\n- **--m3e-checkbox-unselected-disabled-outline-opacity** - Opacity for disabled unselected outline. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-outline-color** - Border color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-selected-container-color** - Background color for selected container. _(default: undefined)_\n- **--m3e-checkbox-selected-icon-color** - Icon color for selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-container-color** - Base color for disabled selected container. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-container-opacity** - Opacity for disabled selected container. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-icon-color** - Base color for disabled selected icon. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-icon-opacity** - Opacity for disabled selected icon. _(default: undefined)_\n- **--m3e-checkbox-unselected-hover-color** - Ripple hover color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-focus-color** - Ripple focus color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-ripple-color** - Ripple base color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-selected-hover-color** - Ripple hover color for selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-focus-color** - Ripple focus color for selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-ripple-color** - Ripple base color for selected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-hover-color** - Ripple hover color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-focus-color** - Ripple focus color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-ripple-color** - Ripple base color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-selected-error-hover-color** - Ripple hover color for invalid selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-error-focus-color** - Ripple focus color for invalid selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-error-ripple-color** - Ripple base color for invalid selected state. _(default: undefined)_",
559
581
  "attributes": [
560
582
  {
561
- "name": "multi",
562
- "description": "Whether multiple toggle buttons can be selected.",
583
+ "name": "checked",
584
+ "description": "Whether the element is checked.",
563
585
  "values": []
564
586
  },
565
587
  {
566
- "name": "size",
567
- "description": "The size of the group.",
568
- "values": [{ "name": "ButtonGroupSize" }]
588
+ "name": "disabled",
589
+ "description": "Whether the element is disabled.",
590
+ "values": []
569
591
  },
570
592
  {
571
- "name": "variant",
572
- "description": "The appearance variant of the group.",
573
- "values": [{ "name": "ButtonGroupVariant" }]
593
+ "name": "indeterminate",
594
+ "description": "Whether the element's checked state is indeterminate.",
595
+ "values": []
596
+ },
597
+ {
598
+ "name": "name",
599
+ "description": "The name that identifies the element when submitting the associated form.",
600
+ "values": []
601
+ },
602
+ {
603
+ "name": "required",
604
+ "description": "Whether the element is required.",
605
+ "values": []
606
+ },
607
+ {
608
+ "name": "value",
609
+ "description": "A string representing the value of the checkbox.",
610
+ "values": []
574
611
  }
575
612
  ],
576
613
  "references": []
@@ -647,43 +684,6 @@
647
684
  ],
648
685
  "references": []
649
686
  },
650
- {
651
- "name": "m3e-checkbox",
652
- "description": "A checkbox that allows a user to select one or more options from a limited number of choices.\n---\n\n\n### **Events:**\n - **input** - Emitted when the checked state changes.\n- **change** - Emitted when the checked state changes.\n- **invalid** - Emitted when a form is submitted and the element fails constraint validation.\n- **click** - Emitted when the element is clicked.\n\n### **Methods:**\n - **markAsPristine(): _void_** - Marks the element as pristine.\n- **markAsDirty(): _void_** - Marks the element as dirty.\n- **markAsTouched(): _void_** - Marks the element as touched.\n- **markAsUntouched(): _void_** - Marks the element as untouched.\n- **reportValidity(): _boolean_** - Returns `true` if the element has no validity problems; otherwise, returns `false`, fires\r\nan invalid event, and (if the event isn't canceled) reports the problem to the user.\n- **checkValidity(): _boolean_** - Returns `true` if the element has no validity problems; otherwise,\r\nreturns `false`, fires an invalid event.\n- **setCustomValidity(error: _string_): _void_** - Sets a custom validity message for the element.\n- **formDisabledCallback(disabled: _boolean_): _void_** - Called when the element is disabled or enabled via its form association.\n- **formResetCallback(): _void_** - Called when the associated form is reset.\n\n### **CSS Properties:**\n - **--m3e-checkbox-icon-size** - Size of the checkbox icon inside the container. _(default: undefined)_\n- **--m3e-checkbox-container-size** - Base size of the checkbox container. _(default: undefined)_\n- **--m3e-checkbox-container-shape** - Border radius of the icon container. _(default: undefined)_\n- **--m3e-checkbox-unselected-outline-thickness** - Border thickness for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-outline-color** - Border color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-hover-outline-color** - Border color on hover when unselected. _(default: undefined)_\n- **--m3e-checkbox-unselected-disabled-outline-color** - Base color for disabled unselected outline. _(default: undefined)_\n- **--m3e-checkbox-unselected-disabled-outline-opacity** - Opacity for disabled unselected outline. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-outline-color** - Border color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-selected-container-color** - Background color for selected container. _(default: undefined)_\n- **--m3e-checkbox-selected-icon-color** - Icon color for selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-container-color** - Base color for disabled selected container. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-container-opacity** - Opacity for disabled selected container. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-icon-color** - Base color for disabled selected icon. _(default: undefined)_\n- **--m3e-checkbox-selected-disabled-icon-opacity** - Opacity for disabled selected icon. _(default: undefined)_\n- **--m3e-checkbox-unselected-hover-color** - Ripple hover color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-focus-color** - Ripple focus color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-ripple-color** - Ripple base color for unselected state. _(default: undefined)_\n- **--m3e-checkbox-selected-hover-color** - Ripple hover color for selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-focus-color** - Ripple focus color for selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-ripple-color** - Ripple base color for selected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-hover-color** - Ripple hover color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-focus-color** - Ripple focus color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-unselected-error-ripple-color** - Ripple base color for invalid unselected state. _(default: undefined)_\n- **--m3e-checkbox-selected-error-hover-color** - Ripple hover color for invalid selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-error-focus-color** - Ripple focus color for invalid selected state. _(default: undefined)_\n- **--m3e-checkbox-selected-error-ripple-color** - Ripple base color for invalid selected state. _(default: undefined)_",
653
- "attributes": [
654
- {
655
- "name": "checked",
656
- "description": "Whether the element is checked.",
657
- "values": []
658
- },
659
- {
660
- "name": "disabled",
661
- "description": "Whether the element is disabled.",
662
- "values": []
663
- },
664
- {
665
- "name": "indeterminate",
666
- "description": "Whether the element's checked state is indeterminate.",
667
- "values": []
668
- },
669
- {
670
- "name": "name",
671
- "description": "The name that identifies the element when submitting the associated form.",
672
- "values": []
673
- },
674
- {
675
- "name": "required",
676
- "description": "Whether the element is required.",
677
- "values": []
678
- },
679
- {
680
- "name": "value",
681
- "description": "A string representing the value of the checkbox.",
682
- "values": []
683
- }
684
- ],
685
- "references": []
686
- },
687
687
  {
688
688
  "name": "m3e-assist-chip",
689
689
  "description": "A chip users interact with to perform a smart or automated action that can span multiple applications.\n---\n\n\n### **Events:**\n - **click** - Emitted when the element is clicked.\n\n### **Slots:**\n - _default_ - Renders the label of the chip.\n- **icon** - Renders an icon before the chip's label.\n- **trailing-icon** - Renders an icon after the chip's label.\n\n### **CSS Properties:**\n - **--m3e-chip-container-shape** - Border radius of the chip container. _(default: undefined)_\n- **--m3e-chip-container-height** - Base height of the chip container before density adjustment. _(default: undefined)_\n- **--m3e-chip-label-text-font-size** - Font size of the chip label text. _(default: undefined)_\n- **--m3e-chip-label-text-font-weight** - Font weight of the chip label text. _(default: undefined)_\n- **--m3e-chip-label-text-line-height** - Line height of the chip label text. _(default: undefined)_\n- **--m3e-chip-label-text-tracking** - Letter spacing of the chip label text. _(default: undefined)_\n- **--m3e-chip-label-text-color** - Label text color in default state. _(default: undefined)_\n- **--m3e-chip-icon-color** - Icon color in default state. _(default: undefined)_\n- **--m3e-chip-icon-size** - Font size of leading/trailing icons. _(default: undefined)_\n- **--m3e-chip-spacing** - Horizontal gap between chip content elements. _(default: undefined)_\n- **--m3e-chip-padding-start** - Default start padding when no icon is present. _(default: undefined)_\n- **--m3e-chip-padding-end** - Default end padding when no trailing icon is present. _(default: undefined)_\n- **--m3e-chip-with-icon-padding-start** - Start padding when leading icon is present. _(default: undefined)_\n- **--m3e-chip-with-icon-padding-end** - End padding when trailing icon is present. _(default: undefined)_\n- **--m3e-chip-disabled-label-text-color** - Base color for disabled label text. _(default: undefined)_\n- **--m3e-chip-disabled-label-text-opacity** - Opacity applied to disabled label text. _(default: undefined)_\n- **--m3e-chip-disabled-icon-color** - Base color for disabled icons. _(default: undefined)_\n- **--m3e-chip-disabled-icon-opacity** - Opacity applied to disabled icons. _(default: undefined)_\n- **--m3e-elevated-chip-container-color** - Background color for elevated variant. _(default: undefined)_\n- **--m3e-elevated-chip-elevation** - Elevation level for elevated variant. _(default: undefined)_\n- **--m3e-elevated-chip-hover-elevation** - Elevation level on hover. _(default: undefined)_\n- **--m3e-elevated-chip-disabled-container-color** - Background color for disabled elevated variant. _(default: undefined)_\n- **--m3e-elevated-chip-disabled-container-opacity** - Opacity applied to disabled elevated background. _(default: undefined)_\n- **--m3e-elevated-chip-disabled-elevation** - Elevation level for disabled elevated variant. _(default: undefined)_\n- **--m3e-outlined-chip-outline-thickness** - Outline thickness for outlined variant. _(default: undefined)_\n- **--m3e-outlined-chip-outline-color** - Outline color for outlined variant. _(default: undefined)_\n- **--m3e-outlined-chip-disabled-outline-color** - Outline color for disabled outlined variant. _(default: undefined)_\n- **--m3e-outlined-chip-disabled-outline-opacity** - Opacity applied to disabled outline. _(default: undefined)_",
@@ -1075,33 +1075,6 @@
1075
1075
  ],
1076
1076
  "references": []
1077
1077
  },
1078
- {
1079
- "name": "m3e-divider",
1080
- "description": "A thin line that separates content in lists or other containers.\n---\n\n\n### **CSS Properties:**\n - **--m3e-divider-thickness** - Thickness of the divider line. _(default: undefined)_\n- **--m3e-divider-color** - Color of the divider line. _(default: undefined)_\n- **--m3e-divider-inset-size** - When inset, fallback inset size used when no specific start or end inset is provided. _(default: undefined)_\n- **--m3e-divider-inset-start-size** - When inset, leading inset size. _(default: undefined)_\n- **--m3e-divider-inset-end-size** - When inset, trailing inset size. _(default: undefined)_",
1081
- "attributes": [
1082
- {
1083
- "name": "inset",
1084
- "description": "Whether the divider is indented with equal padding on both sides.",
1085
- "values": []
1086
- },
1087
- {
1088
- "name": "inset-start",
1089
- "description": "Whether the divider is indented with padding on the leading side.",
1090
- "values": []
1091
- },
1092
- {
1093
- "name": "inset-end",
1094
- "description": "Whether the divider is indented with padding on the trailing side.",
1095
- "values": []
1096
- },
1097
- {
1098
- "name": "vertical",
1099
- "description": "Whether the divider is vertically aligned with adjacent content.",
1100
- "values": []
1101
- }
1102
- ],
1103
- "references": []
1104
- },
1105
1078
  {
1106
1079
  "name": "m3e-dialog-action",
1107
1080
  "description": "An element, nested within a clickable element, used to close a parenting dialog.\n---\n\n\n### **Methods:**\n \n\n### **Slots:**\n - _default_ - Renders the content of the action.",
@@ -1163,6 +1136,33 @@
1163
1136
  ],
1164
1137
  "references": []
1165
1138
  },
1139
+ {
1140
+ "name": "m3e-divider",
1141
+ "description": "A thin line that separates content in lists or other containers.\n---\n\n\n### **CSS Properties:**\n - **--m3e-divider-thickness** - Thickness of the divider line. _(default: undefined)_\n- **--m3e-divider-color** - Color of the divider line. _(default: undefined)_\n- **--m3e-divider-inset-size** - When inset, fallback inset size used when no specific start or end inset is provided. _(default: undefined)_\n- **--m3e-divider-inset-start-size** - When inset, leading inset size. _(default: undefined)_\n- **--m3e-divider-inset-end-size** - When inset, trailing inset size. _(default: undefined)_",
1142
+ "attributes": [
1143
+ {
1144
+ "name": "inset",
1145
+ "description": "Whether the divider is indented with equal padding on both sides.",
1146
+ "values": []
1147
+ },
1148
+ {
1149
+ "name": "inset-start",
1150
+ "description": "Whether the divider is indented with padding on the leading side.",
1151
+ "values": []
1152
+ },
1153
+ {
1154
+ "name": "inset-end",
1155
+ "description": "Whether the divider is indented with padding on the trailing side.",
1156
+ "values": []
1157
+ },
1158
+ {
1159
+ "name": "vertical",
1160
+ "description": "Whether the divider is vertically aligned with adjacent content.",
1161
+ "values": []
1162
+ }
1163
+ ],
1164
+ "references": []
1165
+ },
1166
1166
  {
1167
1167
  "name": "m3e-drawer-container",
1168
1168
  "description": "A container for one or two sliding drawers.\n---\n\n\n### **Events:**\n - **change** - Emitted when the state of the start or end drawers change.\n\n### **Slots:**\n - _default_ - Renders the main content.\n- **start** - Renders the start drawer.\n- **end** - Renders the end drawer.\n\n### **CSS Properties:**\n - **--m3e-drawer-container-color** - The background color of the drawer container. _(default: undefined)_\n- **--m3e-drawer-container-elevation** - The elevation level of the drawer container. _(default: undefined)_\n- **--m3e-drawer-container-width** - The width of the drawer container. _(default: undefined)_\n- **--m3e-drawer-container-scrim-opacity** - The opacity of the scrim behind the drawer. _(default: undefined)_\n- **--m3e-modal-drawer-start-shape** - The shape of the drawer's start edge (typically left in LTR). _(default: undefined)_\n- **--m3e-modal-drawer-end-shape** - The shape of the drawer's end edge (typically right in LTR). _(default: undefined)_\n- **--m3e-modal-drawer-container-color** - The background color of the modal drawer container. _(default: undefined)_\n- **--m3e-modal-drawer-elevation** - The elevation level of the modal drawer container. _(default: undefined)_\n- **--m3e-drawer-divider-color** - The color of the divider between drawer sections. _(default: undefined)_\n- **--m3e-drawer-divider-thickness** - The thickness of the divider line. _(default: undefined)_",
@@ -1584,18 +1584,6 @@
1584
1584
  ],
1585
1585
  "references": []
1586
1586
  },
1587
- {
1588
- "name": "m3e-loading-indicator",
1589
- "description": "Shows indeterminate progress for a short wait time.\n---\n\n\n### **CSS Properties:**\n - **--m3e-loading-indicator-active-indicator-color** - Uncontained active indicator color. _(default: undefined)_\n- **--m3e-loading-indicator-contained-active-indicator-color** - Contained active indicator color. _(default: undefined)_\n- **--m3e-loading-indicator-contained-container-color** - Contained container (background) color. _(default: undefined)_\n- **--m3e-loading-indicator-active-indicator-size** - Size of the active indicator. _(default: undefined)_\n- **--m3e-loading-indicator-container-shape** - Container shape. _(default: undefined)_\n- **--m3e-loading-indicator-container-size** - Container size. _(default: undefined)_",
1590
- "attributes": [
1591
- {
1592
- "name": "variant",
1593
- "description": "The appearance variant of the indicator.",
1594
- "values": [{ "name": "LoadingIndicatorVariant" }]
1595
- }
1596
- ],
1597
- "references": []
1598
- },
1599
1587
  {
1600
1588
  "name": "m3e-action-list",
1601
1589
  "description": "A list of actions.\n---\n\n\n### **Slots:**\n - _default_ - Renders the items of the list.\n\n### **CSS Properties:**\n - **--m3e-list-divider-inset-start-size** - Start inset for dividers within the list. _(default: undefined)_\n- **--m3e-list-divider-inset-end-size** - End inset for dividers within the list. _(default: undefined)_\n- **--m3e-segmented-list-segment-gap** - Gap between list items in segmented variant. _(default: undefined)_\n- **--m3e-segmented-list-container-shape** - Border radius of the segmented list container. _(default: undefined)_\n- **--m3e-segmented-list-item-container-color** - Background color of items in segmented variant. _(default: undefined)_\n- **--m3e-segmented-list-item-disabled-container-color** - Background color of disabled items in segmented variant. _(default: undefined)_\n- **--m3e-segmented-list-item-container-shape** - Border radius of items in segmented variant. _(default: undefined)_\n- **--m3e-segmented-list-item-hover-container-shape** - Border radius of items in segmented variant on hover. _(default: undefined)_\n- **--m3e-segmented-list-item-focus-container-shape** - Border radius of items in segmented variant on focus. _(default: undefined)_\n- **--m3e-segmented-list-item-selected-container-shape** - Border radius of items in segmented variant when selected. _(default: undefined)_",
@@ -1761,6 +1749,18 @@
1761
1749
  ],
1762
1750
  "references": []
1763
1751
  },
1752
+ {
1753
+ "name": "m3e-loading-indicator",
1754
+ "description": "Shows indeterminate progress for a short wait time.\n---\n\n\n### **CSS Properties:**\n - **--m3e-loading-indicator-active-indicator-color** - Uncontained active indicator color. _(default: undefined)_\n- **--m3e-loading-indicator-contained-active-indicator-color** - Contained active indicator color. _(default: undefined)_\n- **--m3e-loading-indicator-contained-container-color** - Contained container (background) color. _(default: undefined)_\n- **--m3e-loading-indicator-active-indicator-size** - Size of the active indicator. _(default: undefined)_\n- **--m3e-loading-indicator-container-shape** - Container shape. _(default: undefined)_\n- **--m3e-loading-indicator-container-size** - Container size. _(default: undefined)_",
1755
+ "attributes": [
1756
+ {
1757
+ "name": "variant",
1758
+ "description": "The appearance variant of the indicator.",
1759
+ "values": [{ "name": "LoadingIndicatorVariant" }]
1760
+ }
1761
+ ],
1762
+ "references": []
1763
+ },
1764
1764
  {
1765
1765
  "name": "m3e-menu",
1766
1766
  "description": "Presents a list of choices on a temporary surface.\n---\n\n\n### **Events:**\n - **beforetoggle** - Dispatched before the toggle state changes.\n- **toggle** - Dispatched after the toggle state has changed.\n\n### **Methods:**\n - **show(trigger: _HTMLElement_): _Promise<void>_** - Opens the menu.\n- **hide(restoreFocus: _boolean_): _void_** - Hides the menu.\n- **hideAll(restoreFocus: _boolean_): _void_** - Closes this menu and any parenting menus.\n- **toggle(trigger: _HTMLElement_): _Promise<void>_** - Toggles the menu.\n\n### **Slots:**\n - _default_ - Renders the contents of the menu.\n\n### **CSS Properties:**\n - **--m3e-menu-container-shape** - Controls the corner radius of the menu container. _(default: undefined)_\n- **--m3e-menu-active-container-shape** - Controls the corner radius of the menu container when active. _(default: undefined)_\n- **--m3e-menu-container-min-width** - Minimum width of the menu container. _(default: undefined)_\n- **--m3e-menu-container-max-width** - Maximum width of the menu container. _(default: undefined)_\n- **--m3e-menu-container-max-height** - Maximum height of the menu container. _(default: undefined)_\n- **--m3e-menu-container-padding-block** - Vertical padding inside the menu container. _(default: undefined)_\n- **--m3e-menu-container-padding-inline** - Horizontal padding inside the menu container. _(default: undefined)_\n- **--m3e-menu-container-color** - Background color of the menu container. _(default: undefined)_\n- **--m3e-menu-container-elevation** - Box shadow elevation of the menu container. _(default: undefined)_\n- **--m3e-vibrant-menu-container-color** - Background color of the menu container for vibrant variant. _(default: undefined)_\n- **--m3e-menu-divider-spacing** - Vertical spacing around slotted `m3e-divider` elements. _(default: undefined)_\n- **--m3e-menu-gap** - Gap between content in the menu. _(default: undefined)_",
package/dist/icon.js CHANGED
@@ -232,7 +232,7 @@ let M3eIconElement = class M3eIconElement extends Role(LitElement, "img") {
232
232
  };
233
233
  _M3eIconElement_iconRegistryUnobserve = new WeakMap();
234
234
  /** The styles of the element. */
235
- M3eIconElement.styles = css`:host { display: inline-block; user-select: none; font-size: var(--m3e-icon-size, 1.5rem); width: 1em; height: 1em; vertical-align: middle; overflow: hidden; } .icon { font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; width: inherit; height: inherit; vertical-align: inherit; font-variation-settings: "FILL" var(--_icon-fill, 0), "wght" var(--_icon-weight, 400), "GRAD" var(--_icon-grade, 0), "opsz" var(--_icon-optical-size, 24); } :host([variant="outlined"]) .icon { font-family: "Material Symbols Outlined"; } :host([variant="rounded"]) .icon { font-family: "Material Symbols Rounded"; } :host([variant="sharp"]) .icon { font-family: "Material Symbols Sharp"; } svg { font-size: inherit; width: 1em; height: 1em; }`;
235
+ M3eIconElement.styles = css`:host { display: inline-block; user-select: none; font-size: var(--m3e-icon-size, 1.5rem); width: 1em; height: 1em; vertical-align: middle; overflow: hidden; } .icon { font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; width: inherit; height: inherit; vertical-align: inherit; font-variation-settings: "FILL" var(--_icon-fill, 0), "wght" var(--_icon-weight, 400), "GRAD" var(--_icon-grade, 0), "opsz" var(--_icon-optical-size, 24); } :host([variant="outlined"]) .icon { font-family: "Material Symbols Outlined"; } :host([variant="rounded"]) .icon { font-family: "Material Symbols Rounded"; } :host([variant="sharp"]) .icon { font-family: "Material Symbols Sharp"; } svg { fill: currentColor; font-size: inherit; width: 1em; height: 1em; }`;
236
236
  __decorate([query(".icon")], M3eIconElement.prototype, "_icon", void 0);
237
237
  __decorate([property()], M3eIconElement.prototype, "name", void 0);
238
238
  __decorate([property({
package/dist/icon.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"icon.js","sources":["../../src/icon/IconRegistry.ts","../../src/icon/IconElement.ts","../../src/icon/registerIcon.ts"],"sourcesContent":["import { svg, SVGTemplateResult } from \"lit\";\r\n\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\n/** @private */ const PATH_DATA_PATTERN = /^[MmLlHhVvCcSsQqTtAaZz0-9.,\\s-]+$/;\r\n/** @private */ const VIEW_BOX_PATTERN = /^-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?$/;\r\n\r\n/** Encapsulates information used to construct an SVG. */\r\nexport type SvgIconInfo = {\r\n /** The viewbox of the SVG. */\r\n viewBox: string;\r\n\r\n /** The path of the SVG. */\r\n path: string;\r\n};\r\n\r\n/** Represents the fill-axis SVG data for a single icon. */\r\nexport type SvgIconFillSet = {\r\n /** The unfilled (FILL=0) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n outlined: SvgIconInfo | string;\r\n\r\n /** The filled (FILL=1) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n filled: SvgIconInfo | string;\r\n};\r\n\r\n/**\r\n * Service to register and display icons used by the `m3e-icon` component.\r\n * @internal\r\n */\r\nexport class IconRegistry {\r\n /** @private */\r\n static readonly #icons = new Map<string, { outlined: SVGTemplateResult; filled: SVGTemplateResult }>();\r\n\r\n /** @private */ static readonly #observers = new Map<string, Array<() => void>>();\r\n\r\n /**\r\n * Adds an icon to the registry for the given variant and weight.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {SvgIconFillSet} fillSet The SVG data for both fill states (outlined and filled) of the icon.\r\n */\r\n static addIcon(name: string, variant: IconVariant, fillSet: SvgIconFillSet): void {\r\n const trustOutlinedViewBox = typeof fillSet.outlined === \"string\";\r\n const trustFilledViewBox = typeof fillSet.filled === \"string\";\r\n\r\n if (typeof fillSet.outlined === \"string\") {\r\n fillSet.outlined = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.outlined,\r\n };\r\n }\r\n if (typeof fillSet.filled === \"string\") {\r\n fillSet.filled = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.filled,\r\n };\r\n }\r\n\r\n this.#validateSvgIconInfo(name, variant, fillSet.outlined, trustOutlinedViewBox);\r\n this.#validateSvgIconInfo(name, variant, fillSet.filled, trustFilledViewBox);\r\n\r\n if (window !== undefined) {\r\n const key = this.#createKey(name, variant);\r\n this.#icons.set(key, {\r\n outlined: svg`<svg viewBox=\"${fillSet.outlined.viewBox}\"><path d=\"${fillSet.outlined.path}\"/></svg>`,\r\n filled: svg`<svg viewBox=\"${fillSet.filled.viewBox}\"><path d=\"${fillSet.filled.path}\"/></svg>`,\r\n });\r\n\r\n this.#observers.get(key)?.forEach((x) => x());\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether an icon is registered for the given variant.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @returns {boolean} Whether `icon` is registered for the given `variant`.\r\n */\r\n static isIconRegistered(name: string, variant: IconVariant): boolean {\r\n return window !== undefined && this.#icons.has(this.#createKey(name, variant));\r\n }\r\n\r\n /**\r\n * Renders an icon from the registry.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {boolean} filled Whether to render a filled variant of the icon.\r\n * @returns {SVGTemplateResult | undefined} A `SVGTemplateResult` used to render the icon.\r\n */\r\n static renderIcon(name: string, variant: IconVariant, filled: boolean): SVGTemplateResult | undefined {\r\n const data = this.#icons.get(this.#createKey(name, variant));\r\n return filled ? data?.filled : data?.outlined;\r\n }\r\n\r\n /**\r\n * Begins observing registration for the specified icon.\r\n * @param {string} name The name of the icon to observe.\r\n * @param {IconVariant} variant The variant of the icon to observe.\r\n * @param {() => void} callback Callback invoked when the specified icon is registered for the given variant.\r\n * @returns {() => void} Function used to stop observing.\r\n */\r\n static observe(name: string, variant: IconVariant, callback: () => void): () => void {\r\n if (window === undefined) return () => {};\r\n\r\n const key = this.#createKey(name, variant);\r\n if (!this.#observers.has(key)) {\r\n this.#observers.set(key, [callback]);\r\n } else {\r\n this.#observers.get(key)?.push(callback);\r\n }\r\n\r\n return () => {\r\n const callbacks = this.#observers.get(key);\r\n if (callbacks) {\r\n const index = callbacks.indexOf(callback);\r\n if (index >= 0) {\r\n callbacks.splice(index, 1);\r\n }\r\n if (callbacks.length == 0) {\r\n this.#observers.delete(key);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /** @private */\r\n static #createKey(name: string, variant: IconVariant): string {\r\n return `${variant}-${name}`;\r\n }\r\n\r\n /** @private */\r\n static #validateSvgIconInfo(name: string, variant: IconVariant, info: SvgIconInfo, trustViewBox = false): void {\r\n if (!trustViewBox && !VIEW_BOX_PATTERN.test(info.viewBox)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid viewbox data.`);\r\n }\r\n if (!PATH_DATA_PATTERN.test(info.path)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid path data.`);\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport { IconRegistry } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\nimport { IconGrade } from \"./IconGrade\";\r\nimport { IconWeight } from \"./IconWeight\";\r\n\r\n/**\r\n * A small symbol used to easily identify an action or category.\r\n *\r\n * @description\r\n * The `m3e-icon` component makes it easier to use Material Symbols in your application. Material Symbols are Google's newest icons supporting\r\n * a range of design variants. For more information, see:\r\n * - {@link https://developers.google.com/fonts/docs/material_symbols|Material Symbol Guide}\r\n * - {@link https://fonts.google.com/icons|Material Symbol Library}\r\n *\r\n * The Material Symbols font is the easiest way to incorporate Material Symbols into your application. Using the\r\n * {@link https://developers.google.com/fonts/docs/css2#forming_api_urls|Fonts CSS API}, you can use variable fonts to optimize icon\r\n * usage within your application. See {@link https://caniuse.com/variable-fonts|Can I Use's Variable Fonts} to determine whether\r\n * your user's browser support variable fonts.\r\n *\r\n * @example\r\n * The following example illustrates showing the `home` icon. The `name` attribute specifies the icon to present.\r\n * ```html\r\n * <m3e-icon name=\"home\"></m3e-icon>\r\n * ```\r\n * @example\r\n * The next example illustrates a link used to download a variable font for outlined icons with fill support.\r\n * ```html\r\n * <link href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0\" rel=\"stylesheet\"/>\r\n * ```\r\n *\r\n * @tag m3e-icon\r\n *\r\n * @attr filled - Whether the icon is filled.\r\n * @attr grade - The grade of the icon.\r\n * @attr optical-size - A value from 20 to 48 indicating the optical size of the icon.\r\n * @attr name - The name of the icon.\r\n * @attr variant - The appearance variant of the icon.\r\n * @attr weight - A value from 100 to 700 indicating the weight of the icon.\r\n */\r\n@customElement(\"m3e-icon\")\r\nexport class M3eIconElement extends Role(LitElement, \"img\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n user-select: none;\r\n font-size: var(--m3e-icon-size, 1.5rem);\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: middle;\r\n overflow: hidden;\r\n }\r\n .icon {\r\n font-weight: normal;\r\n font-style: normal;\r\n line-height: 1;\r\n letter-spacing: normal;\r\n text-transform: none;\r\n white-space: nowrap;\r\n word-wrap: normal;\r\n direction: ltr;\r\n font-feature-settings: \"liga\";\r\n -webkit-font-smoothing: antialiased;\r\n width: inherit;\r\n height: inherit;\r\n vertical-align: inherit;\r\n font-variation-settings:\r\n \"FILL\" var(--_icon-fill, 0),\r\n \"wght\" var(--_icon-weight, 400),\r\n \"GRAD\" var(--_icon-grade, 0),\r\n \"opsz\" var(--_icon-optical-size, 24);\r\n }\r\n :host([variant=\"outlined\"]) .icon {\r\n font-family: \"Material Symbols Outlined\";\r\n }\r\n :host([variant=\"rounded\"]) .icon {\r\n font-family: \"Material Symbols Rounded\";\r\n }\r\n :host([variant=\"sharp\"]) .icon {\r\n font-family: \"Material Symbols Sharp\";\r\n }\r\n svg {\r\n font-size: inherit;\r\n width: 1em;\r\n height: 1em;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".icon\") private readonly _icon?: HTMLSpanElement;\r\n /** @private */ #iconRegistryUnobserve?: () => void;\r\n\r\n /** The name of the icon. */\r\n @property() name: string = \"\";\r\n\r\n /**\r\n * The appearance variant of the icon.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: IconVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the icon is filled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) filled = false;\r\n\r\n /**\r\n * The grade of the icon.\r\n * @default \"medium\"\r\n */\r\n @property() grade: IconGrade = \"medium\";\r\n\r\n /**\r\n * A value from 100 to 700 indicating the weight of the icon.\r\n * @default 400\r\n */\r\n @property({ type: Number }) weight: IconWeight = 400;\r\n\r\n /**\r\n * A value from 20 to 48 indicating the optical size of the icon.\r\n * @default 24\r\n */\r\n @property({ attribute: \"optical-size\", type: Number }) opticalSize = 24;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n if (\r\n !this.hasAttribute(\"aria-label\") &&\r\n !this.hasAttribute(\"aria-labelledby\") &&\r\n !this.hasAttribute(\"aria-hidden\")\r\n ) {\r\n this.ariaHidden = \"true\";\r\n }\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#iconRegistryUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(_changedProperties: PropertyValues<this>): void {\r\n super.willUpdate(_changedProperties);\r\n\r\n if (_changedProperties.has(\"name\") && !IconRegistry.isIconRegistered(this.name, this.variant)) {\r\n this.#iconRegistryUnobserve = IconRegistry.observe(this.name, this.variant, () => {\r\n this.requestUpdate();\r\n this.#iconRegistryUnobserve?.();\r\n this.#iconRegistryUnobserve = undefined;\r\n });\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"filled\")) {\r\n this._icon?.style.setProperty(\"--_icon-fill\", this.filled ? \"1\" : \"0\");\r\n }\r\n if (_changedProperties.has(\"grade\")) {\r\n this._icon?.style.setProperty(\r\n \"--_icon-grade\",\r\n this.grade === \"low\" ? \"-25\" : this.grade === \"high\" ? \"200\" : \"0\",\r\n );\r\n }\r\n if (_changedProperties.has(\"weight\")) {\r\n this._icon?.style.setProperty(\"--_icon-weight\", `${this.weight}`);\r\n }\r\n if (_changedProperties.has(\"opticalSize\")) {\r\n this._icon?.style.setProperty(\"--_icon-optical-size\", `${this.opticalSize}`);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return IconRegistry.isIconRegistered(this.name, this.variant)\r\n ? IconRegistry.renderIcon(this.name, this.variant, this.filled)\r\n : html`<div class=\"icon\" aria-hidden=\"true\">${this.name}</div>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-icon\": M3eIconElement;\r\n }\r\n}\r\n","import { IconRegistry, SvgIconInfo } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\nexport type { SvgIconInfo } from \"./IconRegistry\";\r\n\r\n/**\r\n * Registers an SVG icon to the internal icon registry used by `m3e-icon`.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param data The outlined and filled SVG information of the icon.\r\n */\r\nexport function registerIcon(\r\n name: string,\r\n variant: IconVariant,\r\n data: { outlined: SvgIconInfo; filled: SvgIconInfo },\r\n): void {\r\n IconRegistry.addIcon(name, variant, data);\r\n}\r\n"],"names":["PATH_DATA_PATTERN","VIEW_BOX_PATTERN","IconRegistry","addIcon","name","variant","fillSet","trustOutlinedViewBox","outlined","trustFilledViewBox","filled","viewBox","path","__classPrivateFieldGet","_a","_IconRegistry_validateSvgIconInfo","call","window","undefined","key","_IconRegistry_createKey","_IconRegistry_icons","set","svg","_IconRegistry_observers","get","forEach","x","isIconRegistered","has","renderIcon","data","observe","callback","push","callbacks","index","indexOf","splice","length","delete","info","trustViewBox","test","Error","value","Map","M3eIconElement","Role","LitElement","constructor","_M3eIconElement_iconRegistryUnobserve","grade","weight","opticalSize","connectedCallback","hasAttribute","ariaHidden","disconnectedCallback","willUpdate","_changedProperties","__classPrivateFieldSet","requestUpdate","updated","_icon","style","setProperty","render","html","styles","css","__decorate","query","prototype","property","reflect","type","Boolean","Number","attribute","customElement","registerIcon"],"mappings":";;;;;;;;;;;AAIA;AAAgB,MAAMA,iBAAiB,GAAG,mCAAmC;AAC7E;AAAgB,MAAMC,gBAAgB,GAAG,iEAAiE;AAoB1G;;;AAGG;MACUC,YAAY,CAAA;AAMvB;;;;;AAKG;AACH,EAAA,OAAOC,OAAOA,CAACC,IAAY,EAAEC,OAAoB,EAAEC,OAAuB,EAAA;AACxE,IAAA,MAAMC,oBAAoB,GAAG,OAAOD,OAAO,CAACE,QAAQ,KAAK,QAAQ;AACjE,IAAA,MAAMC,kBAAkB,GAAG,OAAOH,OAAO,CAACI,MAAM,KAAK,QAAQ;AAE7D,IAAA,IAAI,OAAOJ,OAAO,CAACE,QAAQ,KAAK,QAAQ,EAAE;MACxCF,OAAO,CAACE,QAAQ,GAAG;AACjBG,QAAAA,OAAO,EAAE,gBAAgB;QACzBC,IAAI,EAAEN,OAAO,CAACE;OACf;AACH,IAAA;AACA,IAAA,IAAI,OAAOF,OAAO,CAACI,MAAM,KAAK,QAAQ,EAAE;MACtCJ,OAAO,CAACI,MAAM,GAAG;AACfC,QAAAA,OAAO,EAAE,gBAAgB;QACzBC,IAAI,EAAEN,OAAO,CAACI;OACf;AACH,IAAA;IAEAG,sBAAA,CAAA,IAAI,EAAAC,EAAA,EAAA,GAAA,EAAAC,iCAAA,CAAqB,CAAAC,IAAA,CAAzB,IAAI,EAAsBZ,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAACE,QAAQ,EAAED,oBAAoB,CAAC;IAChFM,sBAAA,CAAA,IAAI,EAAAC,EAAA,EAAA,GAAA,EAAAC,iCAAA,CAAqB,CAAAC,IAAA,CAAzB,IAAI,EAAsBZ,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAACI,MAAM,EAAED,kBAAkB,CAAC;IAE5E,IAAI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QAAQ,EAAE,CAA6B,EAAA3B,cAAA,CAAA0B,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAMZF,UAAA,CAAA,CAA3BG,QAAQ,CAAC;AAAEE,EAAAA,IAAI,EAAEE;CAAQ,CAAC,CAA0B,EAAA/B,cAAA,CAAA0B,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMEF,UAAA,CAAA,CAAtDG,QAAQ,CAAC;AAAEK,EAAAA,SAAS,EAAE,cAAc;AAAEH,EAAAA,IAAI,EAAEE;AAAM,CAAE,CAAC,CAAkB,EAAA/B,cAAA,CAAA0B,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAlF7D1B,cAAc,GAAAwB,UAAA,CAAA,CAD1BS,aAAa,CAAC,UAAU,CAAC,CACb,EAAAjC,cAAc,CAgJ1B;;ACxLD;;;;;AAKG;SACakC,YAAYA,CAC1B7E,IAAY,EACZC,OAAoB,EACpB0B,IAAoD,EAAA;EAEpD7B,YAAY,CAACC,OAAO,CAACC,IAAI,EAAEC,OAAO,EAAE0B,IAAI,CAAC;AAC3C;;;;"}
1
+ {"version":3,"file":"icon.js","sources":["../../src/icon/IconRegistry.ts","../../src/icon/IconElement.ts","../../src/icon/registerIcon.ts"],"sourcesContent":["import { svg, SVGTemplateResult } from \"lit\";\r\n\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\n/** @private */ const PATH_DATA_PATTERN = /^[MmLlHhVvCcSsQqTtAaZz0-9.,\\s-]+$/;\r\n/** @private */ const VIEW_BOX_PATTERN = /^-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?$/;\r\n\r\n/** Encapsulates information used to construct an SVG. */\r\nexport type SvgIconInfo = {\r\n /** The viewbox of the SVG. */\r\n viewBox: string;\r\n\r\n /** The path of the SVG. */\r\n path: string;\r\n};\r\n\r\n/** Represents the fill-axis SVG data for a single icon. */\r\nexport type SvgIconFillSet = {\r\n /** The unfilled (FILL=0) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n outlined: SvgIconInfo | string;\r\n\r\n /** The filled (FILL=1) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n filled: SvgIconInfo | string;\r\n};\r\n\r\n/**\r\n * Service to register and display icons used by the `m3e-icon` component.\r\n * @internal\r\n */\r\nexport class IconRegistry {\r\n /** @private */\r\n static readonly #icons = new Map<string, { outlined: SVGTemplateResult; filled: SVGTemplateResult }>();\r\n\r\n /** @private */ static readonly #observers = new Map<string, Array<() => void>>();\r\n\r\n /**\r\n * Adds an icon to the registry for the given variant and weight.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {SvgIconFillSet} fillSet The SVG data for both fill states (outlined and filled) of the icon.\r\n */\r\n static addIcon(name: string, variant: IconVariant, fillSet: SvgIconFillSet): void {\r\n const trustOutlinedViewBox = typeof fillSet.outlined === \"string\";\r\n const trustFilledViewBox = typeof fillSet.filled === \"string\";\r\n\r\n if (typeof fillSet.outlined === \"string\") {\r\n fillSet.outlined = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.outlined,\r\n };\r\n }\r\n if (typeof fillSet.filled === \"string\") {\r\n fillSet.filled = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.filled,\r\n };\r\n }\r\n\r\n this.#validateSvgIconInfo(name, variant, fillSet.outlined, trustOutlinedViewBox);\r\n this.#validateSvgIconInfo(name, variant, fillSet.filled, trustFilledViewBox);\r\n\r\n if (window !== undefined) {\r\n const key = this.#createKey(name, variant);\r\n this.#icons.set(key, {\r\n outlined: svg`<svg viewBox=\"${fillSet.outlined.viewBox}\"><path d=\"${fillSet.outlined.path}\"/></svg>`,\r\n filled: svg`<svg viewBox=\"${fillSet.filled.viewBox}\"><path d=\"${fillSet.filled.path}\"/></svg>`,\r\n });\r\n\r\n this.#observers.get(key)?.forEach((x) => x());\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether an icon is registered for the given variant.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @returns {boolean} Whether `icon` is registered for the given `variant`.\r\n */\r\n static isIconRegistered(name: string, variant: IconVariant): boolean {\r\n return window !== undefined && this.#icons.has(this.#createKey(name, variant));\r\n }\r\n\r\n /**\r\n * Renders an icon from the registry.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {boolean} filled Whether to render a filled variant of the icon.\r\n * @returns {SVGTemplateResult | undefined} A `SVGTemplateResult` used to render the icon.\r\n */\r\n static renderIcon(name: string, variant: IconVariant, filled: boolean): SVGTemplateResult | undefined {\r\n const data = this.#icons.get(this.#createKey(name, variant));\r\n return filled ? data?.filled : data?.outlined;\r\n }\r\n\r\n /**\r\n * Begins observing registration for the specified icon.\r\n * @param {string} name The name of the icon to observe.\r\n * @param {IconVariant} variant The variant of the icon to observe.\r\n * @param {() => void} callback Callback invoked when the specified icon is registered for the given variant.\r\n * @returns {() => void} Function used to stop observing.\r\n */\r\n static observe(name: string, variant: IconVariant, callback: () => void): () => void {\r\n if (window === undefined) return () => {};\r\n\r\n const key = this.#createKey(name, variant);\r\n if (!this.#observers.has(key)) {\r\n this.#observers.set(key, [callback]);\r\n } else {\r\n this.#observers.get(key)?.push(callback);\r\n }\r\n\r\n return () => {\r\n const callbacks = this.#observers.get(key);\r\n if (callbacks) {\r\n const index = callbacks.indexOf(callback);\r\n if (index >= 0) {\r\n callbacks.splice(index, 1);\r\n }\r\n if (callbacks.length == 0) {\r\n this.#observers.delete(key);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /** @private */\r\n static #createKey(name: string, variant: IconVariant): string {\r\n return `${variant}-${name}`;\r\n }\r\n\r\n /** @private */\r\n static #validateSvgIconInfo(name: string, variant: IconVariant, info: SvgIconInfo, trustViewBox = false): void {\r\n if (!trustViewBox && !VIEW_BOX_PATTERN.test(info.viewBox)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid viewbox data.`);\r\n }\r\n if (!PATH_DATA_PATTERN.test(info.path)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid path data.`);\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport { IconRegistry } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\nimport { IconGrade } from \"./IconGrade\";\r\nimport { IconWeight } from \"./IconWeight\";\r\n\r\n/**\r\n * A small symbol used to easily identify an action or category.\r\n *\r\n * @description\r\n * The `m3e-icon` component makes it easier to use Material Symbols in your application. Material Symbols are Google's newest icons supporting\r\n * a range of design variants. For more information, see:\r\n * - {@link https://developers.google.com/fonts/docs/material_symbols|Material Symbol Guide}\r\n * - {@link https://fonts.google.com/icons|Material Symbol Library}\r\n *\r\n * The Material Symbols font is the easiest way to incorporate Material Symbols into your application. Using the\r\n * {@link https://developers.google.com/fonts/docs/css2#forming_api_urls|Fonts CSS API}, you can use variable fonts to optimize icon\r\n * usage within your application. See {@link https://caniuse.com/variable-fonts|Can I Use's Variable Fonts} to determine whether\r\n * your user's browser support variable fonts.\r\n *\r\n * @example\r\n * The following example illustrates showing the `home` icon. The `name` attribute specifies the icon to present.\r\n * ```html\r\n * <m3e-icon name=\"home\"></m3e-icon>\r\n * ```\r\n * @example\r\n * The next example illustrates a link used to download a variable font for outlined icons with fill support.\r\n * ```html\r\n * <link href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0\" rel=\"stylesheet\"/>\r\n * ```\r\n *\r\n * @tag m3e-icon\r\n *\r\n * @attr filled - Whether the icon is filled.\r\n * @attr grade - The grade of the icon.\r\n * @attr optical-size - A value from 20 to 48 indicating the optical size of the icon.\r\n * @attr name - The name of the icon.\r\n * @attr variant - The appearance variant of the icon.\r\n * @attr weight - A value from 100 to 700 indicating the weight of the icon.\r\n */\r\n@customElement(\"m3e-icon\")\r\nexport class M3eIconElement extends Role(LitElement, \"img\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n user-select: none;\r\n font-size: var(--m3e-icon-size, 1.5rem);\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: middle;\r\n overflow: hidden;\r\n }\r\n .icon {\r\n font-weight: normal;\r\n font-style: normal;\r\n line-height: 1;\r\n letter-spacing: normal;\r\n text-transform: none;\r\n white-space: nowrap;\r\n word-wrap: normal;\r\n direction: ltr;\r\n font-feature-settings: \"liga\";\r\n -webkit-font-smoothing: antialiased;\r\n width: inherit;\r\n height: inherit;\r\n vertical-align: inherit;\r\n font-variation-settings:\r\n \"FILL\" var(--_icon-fill, 0),\r\n \"wght\" var(--_icon-weight, 400),\r\n \"GRAD\" var(--_icon-grade, 0),\r\n \"opsz\" var(--_icon-optical-size, 24);\r\n }\r\n :host([variant=\"outlined\"]) .icon {\r\n font-family: \"Material Symbols Outlined\";\r\n }\r\n :host([variant=\"rounded\"]) .icon {\r\n font-family: \"Material Symbols Rounded\";\r\n }\r\n :host([variant=\"sharp\"]) .icon {\r\n font-family: \"Material Symbols Sharp\";\r\n }\r\n svg {\r\n fill: currentColor;\r\n font-size: inherit;\r\n width: 1em;\r\n height: 1em;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".icon\") private readonly _icon?: HTMLSpanElement;\r\n /** @private */ #iconRegistryUnobserve?: () => void;\r\n\r\n /** The name of the icon. */\r\n @property() name: string = \"\";\r\n\r\n /**\r\n * The appearance variant of the icon.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: IconVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the icon is filled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) filled = false;\r\n\r\n /**\r\n * The grade of the icon.\r\n * @default \"medium\"\r\n */\r\n @property() grade: IconGrade = \"medium\";\r\n\r\n /**\r\n * A value from 100 to 700 indicating the weight of the icon.\r\n * @default 400\r\n */\r\n @property({ type: Number }) weight: IconWeight = 400;\r\n\r\n /**\r\n * A value from 20 to 48 indicating the optical size of the icon.\r\n * @default 24\r\n */\r\n @property({ attribute: \"optical-size\", type: Number }) opticalSize = 24;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n if (\r\n !this.hasAttribute(\"aria-label\") &&\r\n !this.hasAttribute(\"aria-labelledby\") &&\r\n !this.hasAttribute(\"aria-hidden\")\r\n ) {\r\n this.ariaHidden = \"true\";\r\n }\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#iconRegistryUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(_changedProperties: PropertyValues<this>): void {\r\n super.willUpdate(_changedProperties);\r\n\r\n if (_changedProperties.has(\"name\") && !IconRegistry.isIconRegistered(this.name, this.variant)) {\r\n this.#iconRegistryUnobserve = IconRegistry.observe(this.name, this.variant, () => {\r\n this.requestUpdate();\r\n this.#iconRegistryUnobserve?.();\r\n this.#iconRegistryUnobserve = undefined;\r\n });\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"filled\")) {\r\n this._icon?.style.setProperty(\"--_icon-fill\", this.filled ? \"1\" : \"0\");\r\n }\r\n if (_changedProperties.has(\"grade\")) {\r\n this._icon?.style.setProperty(\r\n \"--_icon-grade\",\r\n this.grade === \"low\" ? \"-25\" : this.grade === \"high\" ? \"200\" : \"0\",\r\n );\r\n }\r\n if (_changedProperties.has(\"weight\")) {\r\n this._icon?.style.setProperty(\"--_icon-weight\", `${this.weight}`);\r\n }\r\n if (_changedProperties.has(\"opticalSize\")) {\r\n this._icon?.style.setProperty(\"--_icon-optical-size\", `${this.opticalSize}`);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return IconRegistry.isIconRegistered(this.name, this.variant)\r\n ? IconRegistry.renderIcon(this.name, this.variant, this.filled)\r\n : html`<div class=\"icon\" aria-hidden=\"true\">${this.name}</div>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-icon\": M3eIconElement;\r\n }\r\n}\r\n","import { IconRegistry, SvgIconInfo } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\nexport type { SvgIconInfo } from \"./IconRegistry\";\r\n\r\n/**\r\n * Registers an SVG icon to the internal icon registry used by `m3e-icon`.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param data The outlined and filled SVG information of the icon.\r\n */\r\nexport function registerIcon(\r\n name: string,\r\n variant: IconVariant,\r\n data: { outlined: SvgIconInfo; filled: SvgIconInfo },\r\n): void {\r\n IconRegistry.addIcon(name, variant, data);\r\n}\r\n"],"names":["PATH_DATA_PATTERN","VIEW_BOX_PATTERN","IconRegistry","addIcon","name","variant","fillSet","trustOutlinedViewBox","outlined","trustFilledViewBox","filled","viewBox","path","__classPrivateFieldGet","_a","_IconRegistry_validateSvgIconInfo","call","window","undefined","key","_IconRegistry_createKey","_IconRegistry_icons","set","svg","_IconRegistry_observers","get","forEach","x","isIconRegistered","has","renderIcon","data","observe","callback","push","callbacks","index","indexOf","splice","length","delete","info","trustViewBox","test","Error","value","Map","M3eIconElement","Role","LitElement","constructor","_M3eIconElement_iconRegistryUnobserve","grade","weight","opticalSize","connectedCallback","hasAttribute","ariaHidden","disconnectedCallback","willUpdate","_changedProperties","__classPrivateFieldSet","requestUpdate","updated","_icon","style","setProperty","render","html","styles","css","__decorate","query","prototype","property","reflect","type","Boolean","Number","attribute","customElement","registerIcon"],"mappings":";;;;;;;;;;;AAIA;AAAgB,MAAMA,iBAAiB,G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CAAA0B,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAMEF,UAAA,CAAA,CAAtDG,QAAQ,CAAC;AAAEK,EAAAA,SAAS,EAAE,cAAc;AAAEH,EAAAA,IAAI,EAAEE;AAAM,CAAE,CAAC,CAAkB,EAAA/B,cAAA,CAAA0B,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAnF7D1B,cAAc,GAAAwB,UAAA,CAAA,CAD1BS,aAAa,CAAC,UAAU,CAAC,CACb,EAAAjC,cAAc,CAiJ1B;;ACzLD;;;;;AAKG;SACakC,YAAYA,CAC1B7E,IAAY,EACZC,OAAoB,EACpB0B,IAAoD,EAAA;EAEpD7B,YAAY,CAACC,OAAO,CAACC,IAAI,EAAEC,OAAO,EAAE0B,IAAI,CAAC;AAC3C;;;;"}
package/dist/icon.min.js CHANGED
@@ -3,5 +3,5 @@
3
3
  * Copyright (c) 2025–2026 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{__classPrivateFieldGet as t,__classPrivateFieldSet as i,__decorate as e}from"tslib";import{svg as o,LitElement as s,html as a,css as n}from"lit";import{query as r,property as l}from"lit/decorators.js";import{Role as h,customElement as d}from"@m3e/web/core";var c,p,f,v,m;const g=/^[MmLlHhVvCcSsQqTtAaZz0-9.,\s-]+$/,u=/^-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?$/;class w{static addIcon(i,e,s){const a="string"==typeof s.outlined,n="string"==typeof s.filled;if("string"==typeof s.outlined&&(s.outlined={viewBox:"0 -960 960 960",path:s.outlined}),"string"==typeof s.filled&&(s.filled={viewBox:"0 -960 960 960",path:s.filled}),t(this,c,"m",m).call(this,i,e,s.outlined,a),t(this,c,"m",m).call(this,i,e,s.filled,n),void 0!==window){const a=t(this,c,"m",v).call(this,i,e);t(this,c,"f",p).set(a,{outlined:o`<svg viewBox="${s.outlined.viewBox}"><path d="${s.outlined.path}"/></svg>`,filled:o`<svg viewBox="${s.filled.viewBox}"><path d="${s.filled.path}"/></svg>`}),t(this,c,"f",f).get(a)?.forEach(t=>t())}}static isIconRegistered(i,e){return void 0!==window&&t(this,c,"f",p).has(t(this,c,"m",v).call(this,i,e))}static renderIcon(i,e,o){const s=t(this,c,"f",p).get(t(this,c,"m",v).call(this,i,e));return o?s?.filled:s?.outlined}static observe(i,e,o){if(void 0===window)return()=>{};const s=t(this,c,"m",v).call(this,i,e);return t(this,c,"f",f).has(s)?t(this,c,"f",f).get(s)?.push(o):t(this,c,"f",f).set(s,[o]),()=>{const i=t(this,c,"f",f).get(s);if(i){const e=i.indexOf(o);e>=0&&i.splice(e,1),0==i.length&&t(this,c,"f",f).delete(s)}}}}var y;c=w,v=function(t,i){return`${i}-${t}`},m=function(t,i,e,o=!1){if(!o&&!u.test(e.viewBox))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid viewbox data.`);if(!g.test(e.path))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid path data.`)},p={value:new Map},f={value:new Map};let b=class extends(h(s,"img")){constructor(){super(...arguments),y.set(this,void 0),this.name="",this.variant="outlined",this.filled=!1,this.grade="medium",this.weight=400,this.opticalSize=24}connectedCallback(){this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby")||this.hasAttribute("aria-hidden")||(this.ariaHidden="true"),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),t(this,y,"f")?.call(this)}willUpdate(e){super.willUpdate(e),e.has("name")&&!w.isIconRegistered(this.name,this.variant)&&i(this,y,w.observe(this.name,this.variant,()=>{this.requestUpdate(),t(this,y,"f")?.call(this),i(this,y,void 0,"f")}),"f")}updated(t){super.updated(t),t.has("filled")&&this._icon?.style.setProperty("--_icon-fill",this.filled?"1":"0"),t.has("grade")&&this._icon?.style.setProperty("--_icon-grade","low"===this.grade?"-25":"high"===this.grade?"200":"0"),t.has("weight")&&this._icon?.style.setProperty("--_icon-weight",`${this.weight}`),t.has("opticalSize")&&this._icon?.style.setProperty("--_icon-optical-size",`${this.opticalSize}`)}render(){return w.isIconRegistered(this.name,this.variant)?w.renderIcon(this.name,this.variant,this.filled):a`<div class="icon" aria-hidden="true">${this.name}</div>`}};function $(t,i,e){w.addIcon(t,i,e)}y=new WeakMap,b.styles=n`:host { display: inline-block; user-select: none; font-size: var(--m3e-icon-size, 1.5rem); width: 1em; height: 1em; vertical-align: middle; overflow: hidden; } .icon { font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; width: inherit; height: inherit; vertical-align: inherit; font-variation-settings: "FILL" var(--_icon-fill, 0), "wght" var(--_icon-weight, 400), "GRAD" var(--_icon-grade, 0), "opsz" var(--_icon-optical-size, 24); } :host([variant="outlined"]) .icon { font-family: "Material Symbols Outlined"; } :host([variant="rounded"]) .icon { font-family: "Material Symbols Rounded"; } :host([variant="sharp"]) .icon { font-family: "Material Symbols Sharp"; } svg { font-size: inherit; width: 1em; height: 1em; }`,e([r(".icon")],b.prototype,"_icon",void 0),e([l()],b.prototype,"name",void 0),e([l({reflect:!0})],b.prototype,"variant",void 0),e([l({type:Boolean,reflect:!0})],b.prototype,"filled",void 0),e([l()],b.prototype,"grade",void 0),e([l({type:Number})],b.prototype,"weight",void 0),e([l({attribute:"optical-size",type:Number})],b.prototype,"opticalSize",void 0),b=e([d("m3e-icon")],b);export{b as M3eIconElement,$ as registerIcon};
6
+ import{__classPrivateFieldGet as t,__classPrivateFieldSet as i,__decorate as e}from"tslib";import{svg as o,LitElement as s,html as a,css as n}from"lit";import{query as r,property as l}from"lit/decorators.js";import{Role as h,customElement as d}from"@m3e/web/core";var c,f,p,v,m;const g=/^[MmLlHhVvCcSsQqTtAaZz0-9.,\s-]+$/,u=/^-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?\s+-?\d+(\.\d+)?$/;class w{static addIcon(i,e,s){const a="string"==typeof s.outlined,n="string"==typeof s.filled;if("string"==typeof s.outlined&&(s.outlined={viewBox:"0 -960 960 960",path:s.outlined}),"string"==typeof s.filled&&(s.filled={viewBox:"0 -960 960 960",path:s.filled}),t(this,c,"m",m).call(this,i,e,s.outlined,a),t(this,c,"m",m).call(this,i,e,s.filled,n),void 0!==window){const a=t(this,c,"m",v).call(this,i,e);t(this,c,"f",f).set(a,{outlined:o`<svg viewBox="${s.outlined.viewBox}"><path d="${s.outlined.path}"/></svg>`,filled:o`<svg viewBox="${s.filled.viewBox}"><path d="${s.filled.path}"/></svg>`}),t(this,c,"f",p).get(a)?.forEach(t=>t())}}static isIconRegistered(i,e){return void 0!==window&&t(this,c,"f",f).has(t(this,c,"m",v).call(this,i,e))}static renderIcon(i,e,o){const s=t(this,c,"f",f).get(t(this,c,"m",v).call(this,i,e));return o?s?.filled:s?.outlined}static observe(i,e,o){if(void 0===window)return()=>{};const s=t(this,c,"m",v).call(this,i,e);return t(this,c,"f",p).has(s)?t(this,c,"f",p).get(s)?.push(o):t(this,c,"f",p).set(s,[o]),()=>{const i=t(this,c,"f",p).get(s);if(i){const e=i.indexOf(o);e>=0&&i.splice(e,1),0==i.length&&t(this,c,"f",p).delete(s)}}}}var y;c=w,v=function(t,i){return`${i}-${t}`},m=function(t,i,e,o=!1){if(!o&&!u.test(e.viewBox))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid viewbox data.`);if(!g.test(e.path))throw new Error(`Unable to register icon '${t}' for variant '${i}'. Invalid path data.`)},f={value:new Map},p={value:new Map};let b=class extends(h(s,"img")){constructor(){super(...arguments),y.set(this,void 0),this.name="",this.variant="outlined",this.filled=!1,this.grade="medium",this.weight=400,this.opticalSize=24}connectedCallback(){this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby")||this.hasAttribute("aria-hidden")||(this.ariaHidden="true"),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),t(this,y,"f")?.call(this)}willUpdate(e){super.willUpdate(e),e.has("name")&&!w.isIconRegistered(this.name,this.variant)&&i(this,y,w.observe(this.name,this.variant,()=>{this.requestUpdate(),t(this,y,"f")?.call(this),i(this,y,void 0,"f")}),"f")}updated(t){super.updated(t),t.has("filled")&&this._icon?.style.setProperty("--_icon-fill",this.filled?"1":"0"),t.has("grade")&&this._icon?.style.setProperty("--_icon-grade","low"===this.grade?"-25":"high"===this.grade?"200":"0"),t.has("weight")&&this._icon?.style.setProperty("--_icon-weight",`${this.weight}`),t.has("opticalSize")&&this._icon?.style.setProperty("--_icon-optical-size",`${this.opticalSize}`)}render(){return w.isIconRegistered(this.name,this.variant)?w.renderIcon(this.name,this.variant,this.filled):a`<div class="icon" aria-hidden="true">${this.name}</div>`}};function $(t,i,e){w.addIcon(t,i,e)}y=new WeakMap,b.styles=n`:host { display: inline-block; user-select: none; font-size: var(--m3e-icon-size, 1.5rem); width: 1em; height: 1em; vertical-align: middle; overflow: hidden; } .icon { font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; width: inherit; height: inherit; vertical-align: inherit; font-variation-settings: "FILL" var(--_icon-fill, 0), "wght" var(--_icon-weight, 400), "GRAD" var(--_icon-grade, 0), "opsz" var(--_icon-optical-size, 24); } :host([variant="outlined"]) .icon { font-family: "Material Symbols Outlined"; } :host([variant="rounded"]) .icon { font-family: "Material Symbols Rounded"; } :host([variant="sharp"]) .icon { font-family: "Material Symbols Sharp"; } svg { fill: currentColor; font-size: inherit; width: 1em; height: 1em; }`,e([r(".icon")],b.prototype,"_icon",void 0),e([l()],b.prototype,"name",void 0),e([l({reflect:!0})],b.prototype,"variant",void 0),e([l({type:Boolean,reflect:!0})],b.prototype,"filled",void 0),e([l()],b.prototype,"grade",void 0),e([l({type:Number})],b.prototype,"weight",void 0),e([l({attribute:"optical-size",type:Number})],b.prototype,"opticalSize",void 0),b=e([d("m3e-icon")],b);export{b as M3eIconElement,$ as registerIcon};
7
7
  //# sourceMappingURL=icon.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.min.js","sources":["../../src/icon/IconRegistry.ts","../../src/icon/IconElement.ts","../../src/icon/registerIcon.ts"],"sourcesContent":["import { svg, SVGTemplateResult } from \"lit\";\r\n\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\n/** @private */ const PATH_DATA_PATTERN = /^[MmLlHhVvCcSsQqTtAaZz0-9.,\\s-]+$/;\r\n/** @private */ const VIEW_BOX_PATTERN = /^-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?$/;\r\n\r\n/** Encapsulates information used to construct an SVG. */\r\nexport type SvgIconInfo = {\r\n /** The viewbox of the SVG. */\r\n viewBox: string;\r\n\r\n /** The path of the SVG. */\r\n path: string;\r\n};\r\n\r\n/** Represents the fill-axis SVG data for a single icon. */\r\nexport type SvgIconFillSet = {\r\n /** The unfilled (FILL=0) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n outlined: SvgIconInfo | string;\r\n\r\n /** The filled (FILL=1) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n filled: SvgIconInfo | string;\r\n};\r\n\r\n/**\r\n * Service to register and display icons used by the `m3e-icon` component.\r\n * @internal\r\n */\r\nexport class IconRegistry {\r\n /** @private */\r\n static readonly #icons = new Map<string, { outlined: SVGTemplateResult; filled: SVGTemplateResult }>();\r\n\r\n /** @private */ static readonly #observers = new Map<string, Array<() => void>>();\r\n\r\n /**\r\n * Adds an icon to the registry for the given variant and weight.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {SvgIconFillSet} fillSet The SVG data for both fill states (outlined and filled) of the icon.\r\n */\r\n static addIcon(name: string, variant: IconVariant, fillSet: SvgIconFillSet): void {\r\n const trustOutlinedViewBox = typeof fillSet.outlined === \"string\";\r\n const trustFilledViewBox = typeof fillSet.filled === \"string\";\r\n\r\n if (typeof fillSet.outlined === \"string\") {\r\n fillSet.outlined = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.outlined,\r\n };\r\n }\r\n if (typeof fillSet.filled === \"string\") {\r\n fillSet.filled = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.filled,\r\n };\r\n }\r\n\r\n this.#validateSvgIconInfo(name, variant, fillSet.outlined, trustOutlinedViewBox);\r\n this.#validateSvgIconInfo(name, variant, fillSet.filled, trustFilledViewBox);\r\n\r\n if (window !== undefined) {\r\n const key = this.#createKey(name, variant);\r\n this.#icons.set(key, {\r\n outlined: svg`<svg viewBox=\"${fillSet.outlined.viewBox}\"><path d=\"${fillSet.outlined.path}\"/></svg>`,\r\n filled: svg`<svg viewBox=\"${fillSet.filled.viewBox}\"><path d=\"${fillSet.filled.path}\"/></svg>`,\r\n });\r\n\r\n this.#observers.get(key)?.forEach((x) => x());\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether an icon is registered for the given variant.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @returns {boolean} Whether `icon` is registered for the given `variant`.\r\n */\r\n static isIconRegistered(name: string, variant: IconVariant): boolean {\r\n return window !== undefined && this.#icons.has(this.#createKey(name, variant));\r\n }\r\n\r\n /**\r\n * Renders an icon from the registry.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {boolean} filled Whether to render a filled variant of the icon.\r\n * @returns {SVGTemplateResult | undefined} A `SVGTemplateResult` used to render the icon.\r\n */\r\n static renderIcon(name: string, variant: IconVariant, filled: boolean): SVGTemplateResult | undefined {\r\n const data = this.#icons.get(this.#createKey(name, variant));\r\n return filled ? data?.filled : data?.outlined;\r\n }\r\n\r\n /**\r\n * Begins observing registration for the specified icon.\r\n * @param {string} name The name of the icon to observe.\r\n * @param {IconVariant} variant The variant of the icon to observe.\r\n * @param {() => void} callback Callback invoked when the specified icon is registered for the given variant.\r\n * @returns {() => void} Function used to stop observing.\r\n */\r\n static observe(name: string, variant: IconVariant, callback: () => void): () => void {\r\n if (window === undefined) return () => {};\r\n\r\n const key = this.#createKey(name, variant);\r\n if (!this.#observers.has(key)) {\r\n this.#observers.set(key, [callback]);\r\n } else {\r\n this.#observers.get(key)?.push(callback);\r\n }\r\n\r\n return () => {\r\n const callbacks = this.#observers.get(key);\r\n if (callbacks) {\r\n const index = callbacks.indexOf(callback);\r\n if (index >= 0) {\r\n callbacks.splice(index, 1);\r\n }\r\n if (callbacks.length == 0) {\r\n this.#observers.delete(key);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /** @private */\r\n static #createKey(name: string, variant: IconVariant): string {\r\n return `${variant}-${name}`;\r\n }\r\n\r\n /** @private */\r\n static #validateSvgIconInfo(name: string, variant: IconVariant, info: SvgIconInfo, trustViewBox = false): void {\r\n if (!trustViewBox && !VIEW_BOX_PATTERN.test(info.viewBox)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid viewbox data.`);\r\n }\r\n if (!PATH_DATA_PATTERN.test(info.path)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid path data.`);\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport { IconRegistry } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\nimport { IconGrade } from \"./IconGrade\";\r\nimport { IconWeight } from \"./IconWeight\";\r\n\r\n/**\r\n * A small symbol used to easily identify an action or category.\r\n *\r\n * @description\r\n * The `m3e-icon` component makes it easier to use Material Symbols in your application. Material Symbols are Google's newest icons supporting\r\n * a range of design variants. For more information, see:\r\n * - {@link https://developers.google.com/fonts/docs/material_symbols|Material Symbol Guide}\r\n * - {@link https://fonts.google.com/icons|Material Symbol Library}\r\n *\r\n * The Material Symbols font is the easiest way to incorporate Material Symbols into your application. Using the\r\n * {@link https://developers.google.com/fonts/docs/css2#forming_api_urls|Fonts CSS API}, you can use variable fonts to optimize icon\r\n * usage within your application. See {@link https://caniuse.com/variable-fonts|Can I Use's Variable Fonts} to determine whether\r\n * your user's browser support variable fonts.\r\n *\r\n * @example\r\n * The following example illustrates showing the `home` icon. The `name` attribute specifies the icon to present.\r\n * ```html\r\n * <m3e-icon name=\"home\"></m3e-icon>\r\n * ```\r\n * @example\r\n * The next example illustrates a link used to download a variable font for outlined icons with fill support.\r\n * ```html\r\n * <link href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0\" rel=\"stylesheet\"/>\r\n * ```\r\n *\r\n * @tag m3e-icon\r\n *\r\n * @attr filled - Whether the icon is filled.\r\n * @attr grade - The grade of the icon.\r\n * @attr optical-size - A value from 20 to 48 indicating the optical size of the icon.\r\n * @attr name - The name of the icon.\r\n * @attr variant - The appearance variant of the icon.\r\n * @attr weight - A value from 100 to 700 indicating the weight of the icon.\r\n */\r\n@customElement(\"m3e-icon\")\r\nexport class M3eIconElement extends Role(LitElement, \"img\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n user-select: none;\r\n font-size: var(--m3e-icon-size, 1.5rem);\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: middle;\r\n overflow: hidden;\r\n }\r\n .icon {\r\n font-weight: normal;\r\n font-style: normal;\r\n line-height: 1;\r\n letter-spacing: normal;\r\n text-transform: none;\r\n white-space: nowrap;\r\n word-wrap: normal;\r\n direction: ltr;\r\n font-feature-settings: \"liga\";\r\n -webkit-font-smoothing: antialiased;\r\n width: inherit;\r\n height: inherit;\r\n vertical-align: inherit;\r\n font-variation-settings:\r\n \"FILL\" var(--_icon-fill, 0),\r\n \"wght\" var(--_icon-weight, 400),\r\n \"GRAD\" var(--_icon-grade, 0),\r\n \"opsz\" var(--_icon-optical-size, 24);\r\n }\r\n :host([variant=\"outlined\"]) .icon {\r\n font-family: \"Material Symbols Outlined\";\r\n }\r\n :host([variant=\"rounded\"]) .icon {\r\n font-family: \"Material Symbols Rounded\";\r\n }\r\n :host([variant=\"sharp\"]) .icon {\r\n font-family: \"Material Symbols Sharp\";\r\n }\r\n svg {\r\n font-size: inherit;\r\n width: 1em;\r\n height: 1em;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".icon\") private readonly _icon?: HTMLSpanElement;\r\n /** @private */ #iconRegistryUnobserve?: () => void;\r\n\r\n /** The name of the icon. */\r\n @property() name: string = \"\";\r\n\r\n /**\r\n * The appearance variant of the icon.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: IconVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the icon is filled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) filled = false;\r\n\r\n /**\r\n * The grade of the icon.\r\n * @default \"medium\"\r\n */\r\n @property() grade: IconGrade = \"medium\";\r\n\r\n /**\r\n * A value from 100 to 700 indicating the weight of the icon.\r\n * @default 400\r\n */\r\n @property({ type: Number }) weight: IconWeight = 400;\r\n\r\n /**\r\n * A value from 20 to 48 indicating the optical size of the icon.\r\n * @default 24\r\n */\r\n @property({ attribute: \"optical-size\", type: Number }) opticalSize = 24;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n if (\r\n !this.hasAttribute(\"aria-label\") &&\r\n !this.hasAttribute(\"aria-labelledby\") &&\r\n !this.hasAttribute(\"aria-hidden\")\r\n ) {\r\n this.ariaHidden = \"true\";\r\n }\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#iconRegistryUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(_changedProperties: PropertyValues<this>): void {\r\n super.willUpdate(_changedProperties);\r\n\r\n if (_changedProperties.has(\"name\") && !IconRegistry.isIconRegistered(this.name, this.variant)) {\r\n this.#iconRegistryUnobserve = IconRegistry.observe(this.name, this.variant, () => {\r\n this.requestUpdate();\r\n this.#iconRegistryUnobserve?.();\r\n this.#iconRegistryUnobserve = undefined;\r\n });\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"filled\")) {\r\n this._icon?.style.setProperty(\"--_icon-fill\", this.filled ? \"1\" : \"0\");\r\n }\r\n if (_changedProperties.has(\"grade\")) {\r\n this._icon?.style.setProperty(\r\n \"--_icon-grade\",\r\n this.grade === \"low\" ? \"-25\" : this.grade === \"high\" ? \"200\" : \"0\",\r\n );\r\n }\r\n if (_changedProperties.has(\"weight\")) {\r\n this._icon?.style.setProperty(\"--_icon-weight\", `${this.weight}`);\r\n }\r\n if (_changedProperties.has(\"opticalSize\")) {\r\n this._icon?.style.setProperty(\"--_icon-optical-size\", `${this.opticalSize}`);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return IconRegistry.isIconRegistered(this.name, this.variant)\r\n ? IconRegistry.renderIcon(this.name, this.variant, this.filled)\r\n : html`<div class=\"icon\" aria-hidden=\"true\">${this.name}</div>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-icon\": M3eIconElement;\r\n }\r\n}\r\n","import { IconRegistry, SvgIconInfo } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\nexport type { SvgIconInfo } from \"./IconRegistry\";\r\n\r\n/**\r\n * Registers an SVG icon to the internal icon registry used by `m3e-icon`.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param data The outlined and filled SVG information of the icon.\r\n */\r\nexport function registerIcon(\r\n name: string,\r\n variant: IconVariant,\r\n data: { outlined: SvgIconInfo; filled: SvgIconInfo },\r\n): void {\r\n IconRegistry.addIcon(name, variant, data);\r\n}\r\n"],"names":["PATH_DATA_PATTERN","VIEW_BOX_PATTERN","IconRegistry","addIcon","name","variant","fillSet","trustOutlinedViewBox","outlined","trustFilledViewBox","filled","viewBox","path","__classPrivateFieldGet","this","_a","_IconRegistry_validateSvgIconInfo","call","undefined","window","key","_IconRegistry_createKey","_IconRegistry_icons","set","svg","_IconRegistry_observers","get","forEach","x","isIconRegistered","has","renderIcon","data","observe","callback","push","callbacks","index","indexOf","splice","length","delete","info","trustViewBox","test","Error","value","Map","M3eIconElement","Role","LitElement","constructor","_M3eIconElement_iconRegistryUnobserve","grade","weight","opticalSize","connectedCallback","hasAttribute","ariaHidden","super","disconnectedCallback","willUpdate","_changedProperties","__classPrivateFieldSet","requestUpdate","updated","_icon","style","setProperty","render","html","registerIcon","styles","css","__decorate","query","prototype","property","reflect","type","Boolean","Number","attribute","customElement"],"mappings":";;;;;sRAIgB,MAAMA,EAAoB,oCACpBC,EAAmB,wEAwB5BC,EAYX,cAAOC,CAAQC,EAAcC,EAAsBC,GACjD,MAAMC,EAAmD,iBAArBD,EAAQE,SACtCC,EAA+C,iBAAnBH,EAAQI,OAkB1C,GAhBgC,iBAArBJ,EAAQE,WACjBF,EAAQE,SAAW,CACjBG,QAAS,iBACTC,KAAMN,EAAQE,WAGY,iBAAnBF,EAAQI,SACjBJ,EAAQI,OAAS,CACfC,QAAS,iBACTC,KAAMN,EAAQI,SAIlBG,EAAAC,KAAIC,EAAA,IAAAC,GAAqBC,KAAzBH,KAA0BV,EAAMC,EAASC,EAAQE,SAAUD,GAC3DM,EAAAC,KAAIC,EAAA,IAAAC,GAAqBC,KAAzBH,KAA0BV,EAAMC,EAASC,EAAQI,OAAQD,QAE1CS,IAAXC,OAAsB,CACxB,MAAMC,EAAMP,EAAAC,KAAIC,EAAA,IAAAM,GAAWJ,KAAfH,KAAgBV,EAAMC,GAClCQ,EAAAC,KAAIC,EAAA,IAAAO,GAAQC,IAAIH,EAAK,CACnBZ,SAAUgB,CAAG,iBAA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AAmBhC,IAAI,UACzBhB,KAAKoD,OAAOC,MAAMC,YAChB,gBACe,QAAftD,KAAKuC,MAAkB,MAAuB,SAAfvC,KAAKuC,MAAmB,MAAQ,KAG/DS,EAAmBhC,IAAI,WACzBhB,KAAKoD,OAAOC,MAAMC,YAAY,iBAAkB,GAAGtD,KAAKwC,UAEtDQ,EAAmBhC,IAAI,gBACzBhB,KAAKoD,OAAOC,MAAMC,YAAY,uBAAwB,GAAGtD,KAAKyC,cAElE,CAGmBc,MAAAA,GACjB,OAAOnE,EAAa2B,iBAAiBf,KAAKV,KAAMU,KAAKT,SACjDH,EAAa6B,WAAWjB,KAAKV,KAAMU,KAAKT,QAASS,KAAKJ,QACtD4D,CAAI,wCAAwCxD,KAAKV,YACvD,YCjLcmE,EACdnE,EACAC,EACA2B,GAEA9B,EAAaC,QAAQC,EAAMC,EAAS2B,EACtC,eD8BkBgB,EAAAwB,OAAyBC,CAAG,i4BA8CKC,EAAA,CAAhCC,EAAM,UAAkD3B,EAAA4B,UAAA,gBAI7DF,EAAA,CAAXG,KAA6B7B,EAAA4B,UAAA,eAMDF,EAAA,CAA5BG,EAAS,CAAEC,SAAS,KAA0C9B,EAAA4B,UAAA,eAAA,GAMnBF,EAAA,CAA3CG,EAAS,CAAEE,KAAMC,QAASF,SAAS,KAAuB9B,EAAA4B,UAAA,cAAA,GAM/CF,EAAA,CAAXG,KAAuC7B,EAAA4B,UAAA,gBAMZF,EAAA,CAA3BG,EAAS,CAAEE,KAAME,UAAmCjC,EAAA4B,UAAA,cAAA,GAMEF,EAAA,CAAtDG,EAAS,CAAEK,UAAW,eAAgBH,KAAME,UAA2BjC,EAAA4B,UAAA,mBAAA,GAlF7D5B,EAAc0B,EAAA,CAD1BS,EAAc,aACFnC"}
1
+ {"version":3,"file":"icon.min.js","sources":["../../src/icon/IconRegistry.ts","../../src/icon/IconElement.ts","../../src/icon/registerIcon.ts"],"sourcesContent":["import { svg, SVGTemplateResult } from \"lit\";\r\n\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\n/** @private */ const PATH_DATA_PATTERN = /^[MmLlHhVvCcSsQqTtAaZz0-9.,\\s-]+$/;\r\n/** @private */ const VIEW_BOX_PATTERN = /^-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?\\s+-?\\d+(\\.\\d+)?$/;\r\n\r\n/** Encapsulates information used to construct an SVG. */\r\nexport type SvgIconInfo = {\r\n /** The viewbox of the SVG. */\r\n viewBox: string;\r\n\r\n /** The path of the SVG. */\r\n path: string;\r\n};\r\n\r\n/** Represents the fill-axis SVG data for a single icon. */\r\nexport type SvgIconFillSet = {\r\n /** The unfilled (FILL=0) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n outlined: SvgIconInfo | string;\r\n\r\n /** The filled (FILL=1) SVG representation (or path assuming viewBox=\"0 -960 960 960\") of the icon. */\r\n filled: SvgIconInfo | string;\r\n};\r\n\r\n/**\r\n * Service to register and display icons used by the `m3e-icon` component.\r\n * @internal\r\n */\r\nexport class IconRegistry {\r\n /** @private */\r\n static readonly #icons = new Map<string, { outlined: SVGTemplateResult; filled: SVGTemplateResult }>();\r\n\r\n /** @private */ static readonly #observers = new Map<string, Array<() => void>>();\r\n\r\n /**\r\n * Adds an icon to the registry for the given variant and weight.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {SvgIconFillSet} fillSet The SVG data for both fill states (outlined and filled) of the icon.\r\n */\r\n static addIcon(name: string, variant: IconVariant, fillSet: SvgIconFillSet): void {\r\n const trustOutlinedViewBox = typeof fillSet.outlined === \"string\";\r\n const trustFilledViewBox = typeof fillSet.filled === \"string\";\r\n\r\n if (typeof fillSet.outlined === \"string\") {\r\n fillSet.outlined = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.outlined,\r\n };\r\n }\r\n if (typeof fillSet.filled === \"string\") {\r\n fillSet.filled = {\r\n viewBox: \"0 -960 960 960\",\r\n path: fillSet.filled,\r\n };\r\n }\r\n\r\n this.#validateSvgIconInfo(name, variant, fillSet.outlined, trustOutlinedViewBox);\r\n this.#validateSvgIconInfo(name, variant, fillSet.filled, trustFilledViewBox);\r\n\r\n if (window !== undefined) {\r\n const key = this.#createKey(name, variant);\r\n this.#icons.set(key, {\r\n outlined: svg`<svg viewBox=\"${fillSet.outlined.viewBox}\"><path d=\"${fillSet.outlined.path}\"/></svg>`,\r\n filled: svg`<svg viewBox=\"${fillSet.filled.viewBox}\"><path d=\"${fillSet.filled.path}\"/></svg>`,\r\n });\r\n\r\n this.#observers.get(key)?.forEach((x) => x());\r\n }\r\n }\r\n\r\n /**\r\n * Determines whether an icon is registered for the given variant.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @returns {boolean} Whether `icon` is registered for the given `variant`.\r\n */\r\n static isIconRegistered(name: string, variant: IconVariant): boolean {\r\n return window !== undefined && this.#icons.has(this.#createKey(name, variant));\r\n }\r\n\r\n /**\r\n * Renders an icon from the registry.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param {boolean} filled Whether to render a filled variant of the icon.\r\n * @returns {SVGTemplateResult | undefined} A `SVGTemplateResult` used to render the icon.\r\n */\r\n static renderIcon(name: string, variant: IconVariant, filled: boolean): SVGTemplateResult | undefined {\r\n const data = this.#icons.get(this.#createKey(name, variant));\r\n return filled ? data?.filled : data?.outlined;\r\n }\r\n\r\n /**\r\n * Begins observing registration for the specified icon.\r\n * @param {string} name The name of the icon to observe.\r\n * @param {IconVariant} variant The variant of the icon to observe.\r\n * @param {() => void} callback Callback invoked when the specified icon is registered for the given variant.\r\n * @returns {() => void} Function used to stop observing.\r\n */\r\n static observe(name: string, variant: IconVariant, callback: () => void): () => void {\r\n if (window === undefined) return () => {};\r\n\r\n const key = this.#createKey(name, variant);\r\n if (!this.#observers.has(key)) {\r\n this.#observers.set(key, [callback]);\r\n } else {\r\n this.#observers.get(key)?.push(callback);\r\n }\r\n\r\n return () => {\r\n const callbacks = this.#observers.get(key);\r\n if (callbacks) {\r\n const index = callbacks.indexOf(callback);\r\n if (index >= 0) {\r\n callbacks.splice(index, 1);\r\n }\r\n if (callbacks.length == 0) {\r\n this.#observers.delete(key);\r\n }\r\n }\r\n };\r\n }\r\n\r\n /** @private */\r\n static #createKey(name: string, variant: IconVariant): string {\r\n return `${variant}-${name}`;\r\n }\r\n\r\n /** @private */\r\n static #validateSvgIconInfo(name: string, variant: IconVariant, info: SvgIconInfo, trustViewBox = false): void {\r\n if (!trustViewBox && !VIEW_BOX_PATTERN.test(info.viewBox)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid viewbox data.`);\r\n }\r\n if (!PATH_DATA_PATTERN.test(info.path)) {\r\n throw new Error(`Unable to register icon '${name}' for variant '${variant}'. Invalid path data.`);\r\n }\r\n }\r\n}\r\n","import { css, CSSResultGroup, html, LitElement, PropertyValues } from \"lit\";\r\nimport { property, query } from \"lit/decorators.js\";\r\n\r\nimport { customElement, Role } from \"@m3e/web/core\";\r\n\r\nimport { IconRegistry } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\nimport { IconGrade } from \"./IconGrade\";\r\nimport { IconWeight } from \"./IconWeight\";\r\n\r\n/**\r\n * A small symbol used to easily identify an action or category.\r\n *\r\n * @description\r\n * The `m3e-icon` component makes it easier to use Material Symbols in your application. Material Symbols are Google's newest icons supporting\r\n * a range of design variants. For more information, see:\r\n * - {@link https://developers.google.com/fonts/docs/material_symbols|Material Symbol Guide}\r\n * - {@link https://fonts.google.com/icons|Material Symbol Library}\r\n *\r\n * The Material Symbols font is the easiest way to incorporate Material Symbols into your application. Using the\r\n * {@link https://developers.google.com/fonts/docs/css2#forming_api_urls|Fonts CSS API}, you can use variable fonts to optimize icon\r\n * usage within your application. See {@link https://caniuse.com/variable-fonts|Can I Use's Variable Fonts} to determine whether\r\n * your user's browser support variable fonts.\r\n *\r\n * @example\r\n * The following example illustrates showing the `home` icon. The `name` attribute specifies the icon to present.\r\n * ```html\r\n * <m3e-icon name=\"home\"></m3e-icon>\r\n * ```\r\n * @example\r\n * The next example illustrates a link used to download a variable font for outlined icons with fill support.\r\n * ```html\r\n * <link href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0\" rel=\"stylesheet\"/>\r\n * ```\r\n *\r\n * @tag m3e-icon\r\n *\r\n * @attr filled - Whether the icon is filled.\r\n * @attr grade - The grade of the icon.\r\n * @attr optical-size - A value from 20 to 48 indicating the optical size of the icon.\r\n * @attr name - The name of the icon.\r\n * @attr variant - The appearance variant of the icon.\r\n * @attr weight - A value from 100 to 700 indicating the weight of the icon.\r\n */\r\n@customElement(\"m3e-icon\")\r\nexport class M3eIconElement extends Role(LitElement, \"img\") {\r\n /** The styles of the element. */\r\n static override styles: CSSResultGroup = css`\r\n :host {\r\n display: inline-block;\r\n user-select: none;\r\n font-size: var(--m3e-icon-size, 1.5rem);\r\n width: 1em;\r\n height: 1em;\r\n vertical-align: middle;\r\n overflow: hidden;\r\n }\r\n .icon {\r\n font-weight: normal;\r\n font-style: normal;\r\n line-height: 1;\r\n letter-spacing: normal;\r\n text-transform: none;\r\n white-space: nowrap;\r\n word-wrap: normal;\r\n direction: ltr;\r\n font-feature-settings: \"liga\";\r\n -webkit-font-smoothing: antialiased;\r\n width: inherit;\r\n height: inherit;\r\n vertical-align: inherit;\r\n font-variation-settings:\r\n \"FILL\" var(--_icon-fill, 0),\r\n \"wght\" var(--_icon-weight, 400),\r\n \"GRAD\" var(--_icon-grade, 0),\r\n \"opsz\" var(--_icon-optical-size, 24);\r\n }\r\n :host([variant=\"outlined\"]) .icon {\r\n font-family: \"Material Symbols Outlined\";\r\n }\r\n :host([variant=\"rounded\"]) .icon {\r\n font-family: \"Material Symbols Rounded\";\r\n }\r\n :host([variant=\"sharp\"]) .icon {\r\n font-family: \"Material Symbols Sharp\";\r\n }\r\n svg {\r\n fill: currentColor;\r\n font-size: inherit;\r\n width: 1em;\r\n height: 1em;\r\n }\r\n `;\r\n\r\n /** @private */ @query(\".icon\") private readonly _icon?: HTMLSpanElement;\r\n /** @private */ #iconRegistryUnobserve?: () => void;\r\n\r\n /** The name of the icon. */\r\n @property() name: string = \"\";\r\n\r\n /**\r\n * The appearance variant of the icon.\r\n * @default \"outlined\"\r\n */\r\n @property({ reflect: true }) variant: IconVariant = \"outlined\";\r\n\r\n /**\r\n * Whether the icon is filled.\r\n * @default false\r\n */\r\n @property({ type: Boolean, reflect: true }) filled = false;\r\n\r\n /**\r\n * The grade of the icon.\r\n * @default \"medium\"\r\n */\r\n @property() grade: IconGrade = \"medium\";\r\n\r\n /**\r\n * A value from 100 to 700 indicating the weight of the icon.\r\n * @default 400\r\n */\r\n @property({ type: Number }) weight: IconWeight = 400;\r\n\r\n /**\r\n * A value from 20 to 48 indicating the optical size of the icon.\r\n * @default 24\r\n */\r\n @property({ attribute: \"optical-size\", type: Number }) opticalSize = 24;\r\n\r\n /** @inheritdoc */\r\n override connectedCallback(): void {\r\n if (\r\n !this.hasAttribute(\"aria-label\") &&\r\n !this.hasAttribute(\"aria-labelledby\") &&\r\n !this.hasAttribute(\"aria-hidden\")\r\n ) {\r\n this.ariaHidden = \"true\";\r\n }\r\n\r\n super.connectedCallback();\r\n }\r\n\r\n /** @inheritdoc */\r\n override disconnectedCallback(): void {\r\n super.disconnectedCallback();\r\n\r\n this.#iconRegistryUnobserve?.();\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override willUpdate(_changedProperties: PropertyValues<this>): void {\r\n super.willUpdate(_changedProperties);\r\n\r\n if (_changedProperties.has(\"name\") && !IconRegistry.isIconRegistered(this.name, this.variant)) {\r\n this.#iconRegistryUnobserve = IconRegistry.observe(this.name, this.variant, () => {\r\n this.requestUpdate();\r\n this.#iconRegistryUnobserve?.();\r\n this.#iconRegistryUnobserve = undefined;\r\n });\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override updated(_changedProperties: PropertyValues<this>): void {\r\n super.updated(_changedProperties);\r\n\r\n if (_changedProperties.has(\"filled\")) {\r\n this._icon?.style.setProperty(\"--_icon-fill\", this.filled ? \"1\" : \"0\");\r\n }\r\n if (_changedProperties.has(\"grade\")) {\r\n this._icon?.style.setProperty(\r\n \"--_icon-grade\",\r\n this.grade === \"low\" ? \"-25\" : this.grade === \"high\" ? \"200\" : \"0\",\r\n );\r\n }\r\n if (_changedProperties.has(\"weight\")) {\r\n this._icon?.style.setProperty(\"--_icon-weight\", `${this.weight}`);\r\n }\r\n if (_changedProperties.has(\"opticalSize\")) {\r\n this._icon?.style.setProperty(\"--_icon-optical-size\", `${this.opticalSize}`);\r\n }\r\n }\r\n\r\n /** @inheritdoc */\r\n protected override render(): unknown {\r\n return IconRegistry.isIconRegistered(this.name, this.variant)\r\n ? IconRegistry.renderIcon(this.name, this.variant, this.filled)\r\n : html`<div class=\"icon\" aria-hidden=\"true\">${this.name}</div>`;\r\n }\r\n}\r\n\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n \"m3e-icon\": M3eIconElement;\r\n }\r\n}\r\n","import { IconRegistry, SvgIconInfo } from \"./IconRegistry\";\r\nimport { IconVariant } from \"./IconVariant\";\r\n\r\nexport type { SvgIconInfo } from \"./IconRegistry\";\r\n\r\n/**\r\n * Registers an SVG icon to the internal icon registry used by `m3e-icon`.\r\n * @param {string} name The name of the icon.\r\n * @param {IconVariant} variant The variant of the icon.\r\n * @param data The outlined and filled SVG information of the icon.\r\n */\r\nexport function registerIcon(\r\n name: string,\r\n variant: IconVariant,\r\n data: { outlined: SvgIconInfo; filled: SvgIconInfo },\r\n): void {\r\n IconRegistry.addIcon(name, variant, data);\r\n}\r\n"],"names":["PATH_DATA_PATTERN","VIEW_BOX_PATTERN","IconRegistry","addIcon","name","variant","fillSet","trustOutlinedViewBox","outlined","trustFilledViewBox","filled","viewBox","path","__classPrivateFieldGet","this","_a","_IconRegistry_validateSvgIconInfo","call","undefined","window","key","_IconRegistry_createKey","_IconRegistry_icons","set","svg","_IconRegistry_observers","get","forEach","x","isIconRegistered","has","renderIcon","data","observe","callback","push","callbacks","index","indexOf","splice","length","delete","info","trustViewBox","test","Error","value","Map","M3eIconElement","Role","LitElement","constructor","_M3eIconElement_iconRegistryUnobserve","grade","weight","opticalSize","connectedCallback","hasAttribute","ariaHidden","super","disconnectedCallback","willUpdate","_changedProperties","__classPrivateFieldSet","requestUpdate","updated","_icon","style","setProperty","render","html","registerIcon","styles","css","__decorate","query","prototype","property","reflect","type","Boolean","Number","attribute","customElement"],"mappings":";;;;;sRAIgB,MAAMA,EAAoB,oCACpBC,EAAmB,wEAwB5BC,EAYX,cAAOC,CAAQC,EAAcC,EAAsBC,GACjD,MAAMC,EAAmD,iBAArBD,EAAQE,SACtCC,EAA+C,iBAAnBH,EAAQI,OAkB1C,GAhBgC,iBAArBJ,EAAQE,WACjBF,EAAQE,SAAW,CACjBG,QAAS,iBACTC,KAAMN,EAAQE,WAGY,iBAAnBF,EAAQI,SACjBJ,EAAQI,OAAS,CACfC,QAAS,iBACTC,KAAMN,EAAQI,SAIlBG,EAAAC,KAAIC,EAAA,IAAAC,GAAqBC,KAAzBH,KAA0BV,EAAMC,EAASC,EAAQE,SAAUD,GAC3DM,EAAAC,KAAIC,EAAA,IAAAC,GAAqBC,KAAzBH,KAA0BV,EAAMC,EAASC,EAAQI,OAAQD,QAE1CS,IAAXC,OAAsB,CACxB,MAAMC,EAAMP,EAAAC,KAAIC,EAAA,IAAAM,GAAWJ,KAAfH,KAAgBV,EAAMC,GAClCQ,EAAAC,KAAIC,EAAA,IAAAO,GAAQC,IAAIH,EAAK,CACnBZ,SAAUgB,CAAG,iBAAiBlB,EAAQE,SAASG,qBAAqBL,EAAQE,SAASI,gBACrFF,OAAQc,CAAG,iBAAiBlB,EAAQI,OAAOC,qBAAqBL,EAAQI,OAAOE,kBAGjFC,EAAAC,KAAIC,EAAA,IAAAU,GAAYC,IAAIN,IAAM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AMC,YAAY,iBAAkB,GAAGtD,KAAKwC,UAEtDQ,EAAmBhC,IAAI,gBACzBhB,KAAKoD,OAAOC,MAAMC,YAAY,uBAAwB,GAAGtD,KAAKyC,cAElE,CAGmBc,MAAAA,GACjB,OAAOnE,EAAa2B,iBAAiBf,KAAKV,KAAMU,KAAKT,SACjDH,EAAa6B,WAAWjB,KAAKV,KAAMU,KAAKT,QAASS,KAAKJ,QACtD4D,CAAI,wCAAwCxD,KAAKV,YACvD,YClLcmE,EACdnE,EACAC,EACA2B,GAEA9B,EAAaC,QAAQC,EAAMC,EAAS2B,EACtC,eD8BkBgB,EAAAwB,OAAyBC,CAAG,q5BA+CKC,EAAA,CAAhCC,EAAM,UAAkD3B,EAAA4B,UAAA,gBAI7DF,EAAA,CAAXG,KAA6B7B,EAAA4B,UAAA,eAMDF,EAAA,CAA5BG,EAAS,CAAEC,SAAS,KAA0C9B,EAAA4B,UAAA,eAAA,GAMnBF,EAAA,CAA3CG,EAAS,CAAEE,KAAMC,QAASF,SAAS,KAAuB9B,EAAA4B,UAAA,cAAA,GAM/CF,EAAA,CAAXG,KAAuC7B,EAAA4B,UAAA,gBAMZF,EAAA,CAA3BG,EAAS,CAAEE,KAAME,UAAmCjC,EAAA4B,UAAA,cAAA,GAMEF,EAAA,CAAtDG,EAAS,CAAEK,UAAW,eAAgBH,KAAME,UAA2BjC,EAAA4B,UAAA,mBAAA,GAnF7D5B,EAAc0B,EAAA,CAD1BS,EAAc,aACFnC"}
package/dist/list.js CHANGED
@@ -982,7 +982,7 @@ _M3eListOptionElement_handleClick = function _M3eListOptionElement_handleClick(e
982
982
  }
983
983
  };
984
984
  /** The styles of the element. */
985
- M3eListOptionElement.styles = [M3eListItemElement.styles, css`:host { outline: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { position: relative; } .indicator { min-width: 1.5rem; min-height: 1.5rem; display: flex; align-items: center; justify-content: center; } :host(:not(:disabled)) { cursor: pointer; } :host(:state(-three-line)) .indicator { align-self: flex-start; margin-top: var(--m3e-list-item-three-line-top-offset, 0.25rem); } :host([selected]) .base, :host([selected]) .state-layer, :host([selected]) .ripple, :host([selected]) .focus-ring { border-radius: var(--m3e-list-item-selected-container-shape, ${DesignToken.shape.corner.large}); } :host([selected]:not(:disabled)) .base { color: var(--m3e-list-item-selected-label-text-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="overline"]) { color: var(--m3e-list-item-selected-overline-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="supporting-text"]) { color: var(--m3e-list-item-selected-supporting-text-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="leading"]) { color: var(--m3e-list-item-selected-leading-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="trailing"]) { color: var(--m3e-list-item-selected-trailing-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) .base { background-color: var(--m3e-list-item-selected-container-color, ${DesignToken.color.secondaryContainer}); } :host([selected]:disabled) .base { background-color: color-mix( in srgb, var(--m3e-list-item-selected-disabled-container-color, ${DesignToken.color.onSurface}) var(--m3e-list-item-selected-disabled-container-opacity, 10%), transparent ); } :host([selected]:not(:disabled)) .state-layer { --m3e-state-layer-hover-color: var( --m3e-list-item-selected-hover-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-hover-opacity: var( --m3e-list-item-selected-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity} ); --m3e-state-layer-focus-color: var( --m3e-list-item-selected-focus-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-focus-opacity: var( --m3e-list-item-selected-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity} ); } :host([selected]:not(:disabled)) .ripple { --m3e-ripple-color: var(--m3e-list-item-selected-pressed-state-layer-color, ${DesignToken.color.onSurface}); --m3e-ripple-opacity: var( --m3e-list-item-selected-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity} ); } :host(:state(-hide-selection)) .indicator, :host(:not(:state(-hide-selection))) ::slotted([slot="trailing"]) { display: none; } @media (forced-colors: active) { :host([selected]:not(:disabled)) .content, :host([selected]:not(:disabled)) ::slotted([slot="overline"]), :host([selected]:not(:disabled)) ::slotted([slot="supporting-text"]), :host([selected]:not(:disabled)) ::slotted([slot="leading"]), :host([selected]:not(:disabled)) ::slotted([slot="trailing"]) { color: HighlightText; forced-color-adjust: none; } :host([selected]:not(:disabled)) .base { background-color: Highlight; } }`];
985
+ M3eListOptionElement.styles = [M3eListItemElement.styles, css`:host { outline: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { position: relative; } .indicator { min-width: 1.5rem; min-height: 1.5rem; display: flex; align-items: center; justify-content: center; } :host(:not(:disabled)) { cursor: pointer; } :host(:state(-three-line)) .indicator { align-self: flex-start; margin-top: var(--m3e-list-item-three-line-top-offset, 0.25rem); } :host([selected]) .base, :host([selected]) .state-layer, :host([selected]) .ripple, :host([selected]) .focus-ring { border-radius: var(--m3e-list-item-selected-container-shape, ${DesignToken.shape.corner.large}); } :host([selected]:not(:disabled)) .content { color: var(--m3e-list-item-selected-label-text-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="overline"]) { color: var(--m3e-list-item-selected-overline-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="supporting-text"]) { color: var(--m3e-list-item-selected-supporting-text-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="leading"]) { color: var(--m3e-list-item-selected-leading-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) ::slotted([slot="trailing"]) { color: var(--m3e-list-item-selected-trailing-color, ${DesignToken.color.onSecondaryContainer}); } :host([selected]:not(:disabled)) .base { background-color: var(--m3e-list-item-selected-container-color, ${DesignToken.color.secondaryContainer}); } :host([selected]:disabled) .base { background-color: color-mix( in srgb, var(--m3e-list-item-selected-disabled-container-color, ${DesignToken.color.onSurface}) var(--m3e-list-item-selected-disabled-container-opacity, 10%), transparent ); } :host([selected]:not(:disabled)) .state-layer { --m3e-state-layer-hover-color: var( --m3e-list-item-selected-hover-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-hover-opacity: var( --m3e-list-item-selected-hover-state-layer-opacity, ${DesignToken.state.hoverStateLayerOpacity} ); --m3e-state-layer-focus-color: var( --m3e-list-item-selected-focus-state-layer-color, ${DesignToken.color.onSurface} ); --m3e-state-layer-focus-opacity: var( --m3e-list-item-selected-focus-state-layer-opacity, ${DesignToken.state.focusStateLayerOpacity} ); } :host([selected]:not(:disabled)) .ripple { --m3e-ripple-color: var(--m3e-list-item-selected-pressed-state-layer-color, ${DesignToken.color.onSurface}); --m3e-ripple-opacity: var( --m3e-list-item-selected-pressed-state-layer-opacity, ${DesignToken.state.pressedStateLayerOpacity} ); } :host(:state(-hide-selection)) .indicator, :host(:not(:state(-hide-selection))) ::slotted([slot="trailing"]) { display: none; } @media (forced-colors: active) { :host([selected]:not(:disabled)) .content, :host([selected]:not(:disabled)) ::slotted([slot="overline"]), :host([selected]:not(:disabled)) ::slotted([slot="supporting-text"]), :host([selected]:not(:disabled)) ::slotted([slot="leading"]), :host([selected]:not(:disabled)) ::slotted([slot="trailing"]) { color: HighlightText; forced-color-adjust: none; } :host([selected]:not(:disabled)) .base { background-color: Highlight; } }`];
986
986
  __decorate([query(".focus-ring")], M3eListOptionElement.prototype, "_focusRing", void 0);
987
987
  __decorate([query(".state-layer")], M3eListOptionElement.prototype, "_stateLayer", void 0);
988
988
  __decorate([query(".ripple")], M3eListOptionElement.prototype, "_ripple", void 0);