@limetech/lime-elements 37.1.0-next.56 → 37.1.0-next.58

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 (161) hide show
  1. package/dist/cjs/get-icon-props-46a7e937.js +97 -0
  2. package/dist/cjs/get-icon-props-46a7e937.js.map +1 -0
  3. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +14 -2
  4. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/limel-breadcrumbs.cjs.entry.js +6 -4
  6. package/dist/cjs/limel-breadcrumbs.cjs.entry.js.map +1 -1
  7. package/dist/cjs/limel-chip-set.cjs.entry.js +22 -5
  8. package/dist/cjs/limel-chip-set.cjs.entry.js.map +1 -1
  9. package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-file-viewer.cjs.entry.js.map +1 -1
  11. package/dist/cjs/limel-file.cjs.entry.js +19 -9
  12. package/dist/cjs/limel-file.cjs.entry.js.map +1 -1
  13. package/dist/cjs/limel-list.cjs.entry.js +14 -4
  14. package/dist/cjs/limel-list.cjs.entry.js.map +1 -1
  15. package/dist/cjs/limel-menu_2.cjs.entry.js +14 -4
  16. package/dist/cjs/limel-menu_2.cjs.entry.js.map +1 -1
  17. package/dist/cjs/limel-picker.cjs.entry.js +5 -2
  18. package/dist/cjs/limel-picker.cjs.entry.js.map +1 -1
  19. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +3 -1
  20. package/dist/cjs/limel-progress-flow-item.cjs.entry.js.map +1 -1
  21. package/dist/cjs/limel-progress-flow.cjs.entry.js +15 -2
  22. package/dist/cjs/limel-progress-flow.cjs.entry.js.map +1 -1
  23. package/dist/cjs/limel-select.cjs.entry.js +21 -5
  24. package/dist/cjs/limel-select.cjs.entry.js.map +1 -1
  25. package/dist/cjs/limel-tab-bar.cjs.entry.js +13 -3
  26. package/dist/cjs/limel-tab-bar.cjs.entry.js.map +1 -1
  27. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +14 -2
  28. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js.map +1 -1
  29. package/dist/collection/components/action-bar/action-bar.types.js.map +1 -1
  30. package/dist/collection/components/breadcrumbs/breadcrumbs.js +6 -4
  31. package/dist/collection/components/breadcrumbs/breadcrumbs.js.map +1 -1
  32. package/dist/collection/components/breadcrumbs/breadcrumbs.types.js.map +1 -1
  33. package/dist/collection/components/chip-set/chip-set.js +22 -5
  34. package/dist/collection/components/chip-set/chip-set.js.map +1 -1
  35. package/dist/collection/components/chip-set/chip.types.js.map +1 -1
  36. package/dist/collection/components/file/file-metadata.js +13 -8
  37. package/dist/collection/components/file/file-metadata.js.map +1 -1
  38. package/dist/collection/components/file/file.js +6 -1
  39. package/dist/collection/components/file/file.js.map +1 -1
  40. package/dist/collection/components/file/file.types.js.map +1 -1
  41. package/dist/collection/components/file-viewer/file-viewer.js +1 -1
  42. package/dist/collection/components/file-viewer/file-viewer.js.map +1 -1
  43. package/dist/collection/components/icon/get-icon-props.js +88 -0
  44. package/dist/collection/components/icon/get-icon-props.js.map +1 -0
  45. package/dist/collection/components/list/list-item.types.js.map +1 -1
  46. package/dist/collection/components/list/list-renderer.js +7 -4
  47. package/dist/collection/components/list/list-renderer.js.map +1 -1
  48. package/dist/collection/components/list/list.js +7 -0
  49. package/dist/collection/components/list/list.js.map +1 -1
  50. package/dist/collection/components/menu/menu.types.js.map +1 -1
  51. package/dist/collection/components/menu-list/menu-list-renderer.js +7 -4
  52. package/dist/collection/components/menu-list/menu-list-renderer.js.map +1 -1
  53. package/dist/collection/components/menu-list/menu-list.js +7 -0
  54. package/dist/collection/components/menu-list/menu-list.js.map +1 -1
  55. package/dist/collection/components/picker/picker.js +5 -2
  56. package/dist/collection/components/picker/picker.js.map +1 -1
  57. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js +3 -1
  58. package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.js.map +1 -1
  59. package/dist/collection/components/progress-flow/progress-flow.js +15 -2
  60. package/dist/collection/components/progress-flow/progress-flow.js.map +1 -1
  61. package/dist/collection/components/progress-flow/progress-flow.types.js.map +1 -1
  62. package/dist/collection/components/select/option.types.js.map +1 -1
  63. package/dist/collection/components/select/select.js +2 -1
  64. package/dist/collection/components/select/select.js.map +1 -1
  65. package/dist/collection/components/select/select.template.js +20 -5
  66. package/dist/collection/components/select/select.template.js.map +1 -1
  67. package/dist/collection/components/tab-bar/tab-bar.js +13 -3
  68. package/dist/collection/components/tab-bar/tab-bar.js.map +1 -1
  69. package/dist/collection/components/tab-bar/tab.types.js.map +1 -1
  70. package/dist/esm/get-icon-props-02ab4784.js +91 -0
  71. package/dist/esm/get-icon-props-02ab4784.js.map +1 -0
  72. package/dist/esm/limel-action-bar-item_2.entry.js +14 -2
  73. package/dist/esm/limel-action-bar-item_2.entry.js.map +1 -1
  74. package/dist/esm/limel-breadcrumbs.entry.js +6 -4
  75. package/dist/esm/limel-breadcrumbs.entry.js.map +1 -1
  76. package/dist/esm/limel-chip-set.entry.js +22 -5
  77. package/dist/esm/limel-chip-set.entry.js.map +1 -1
  78. package/dist/esm/limel-file-viewer.entry.js +1 -1
  79. package/dist/esm/limel-file-viewer.entry.js.map +1 -1
  80. package/dist/esm/limel-file.entry.js +19 -9
  81. package/dist/esm/limel-file.entry.js.map +1 -1
  82. package/dist/esm/limel-list.entry.js +14 -4
  83. package/dist/esm/limel-list.entry.js.map +1 -1
  84. package/dist/esm/limel-menu_2.entry.js +14 -4
  85. package/dist/esm/limel-menu_2.entry.js.map +1 -1
  86. package/dist/esm/limel-picker.entry.js +5 -2
  87. package/dist/esm/limel-picker.entry.js.map +1 -1
  88. package/dist/esm/limel-progress-flow-item.entry.js +3 -1
  89. package/dist/esm/limel-progress-flow-item.entry.js.map +1 -1
  90. package/dist/esm/limel-progress-flow.entry.js +15 -2
  91. package/dist/esm/limel-progress-flow.entry.js.map +1 -1
  92. package/dist/esm/limel-select.entry.js +21 -5
  93. package/dist/esm/limel-select.entry.js.map +1 -1
  94. package/dist/esm/limel-tab-bar.entry.js +13 -3
  95. package/dist/esm/limel-tab-bar.entry.js.map +1 -1
  96. package/dist/lime-elements/lime-elements.esm.js +1 -1
  97. package/dist/lime-elements/p-0191d535.entry.js +2 -0
  98. package/dist/lime-elements/p-0191d535.entry.js.map +1 -0
  99. package/dist/lime-elements/p-5dd76e36.entry.js +82 -0
  100. package/dist/lime-elements/p-5dd76e36.entry.js.map +1 -0
  101. package/dist/lime-elements/p-93384ba2.entry.js +82 -0
  102. package/dist/lime-elements/p-93384ba2.entry.js.map +1 -0
  103. package/dist/lime-elements/p-a1c14a7c.entry.js +2 -0
  104. package/dist/lime-elements/p-a1c14a7c.entry.js.map +1 -0
  105. package/dist/lime-elements/p-bbf317b8.entry.js +16 -0
  106. package/dist/lime-elements/p-bbf317b8.entry.js.map +1 -0
  107. package/dist/lime-elements/p-cf736097.entry.js +236 -0
  108. package/dist/lime-elements/p-cf736097.entry.js.map +1 -0
  109. package/dist/lime-elements/p-dff00513.entry.js +2 -0
  110. package/dist/lime-elements/p-dff00513.entry.js.map +1 -0
  111. package/dist/lime-elements/p-e321e7e0.entry.js +2 -0
  112. package/dist/lime-elements/p-e321e7e0.entry.js.map +1 -0
  113. package/dist/lime-elements/{p-b4f1c135.entry.js → p-eb1edb6f.entry.js} +2 -2
  114. package/dist/lime-elements/p-eb1edb6f.entry.js.map +1 -0
  115. package/dist/lime-elements/p-edc9a703.entry.js +2 -0
  116. package/dist/lime-elements/p-edc9a703.entry.js.map +1 -0
  117. package/dist/lime-elements/p-efc550f6.js +2 -0
  118. package/dist/lime-elements/p-efc550f6.js.map +1 -0
  119. package/dist/lime-elements/p-f2691d44.entry.js +2 -0
  120. package/dist/lime-elements/p-f2691d44.entry.js.map +1 -0
  121. package/dist/lime-elements/{p-bc23beb6.entry.js → p-f76277b6.entry.js} +25 -25
  122. package/dist/lime-elements/p-f76277b6.entry.js.map +1 -0
  123. package/dist/types/components/action-bar/action-bar-item/action-bar-item.d.ts +2 -0
  124. package/dist/types/components/action-bar/action-bar.types.d.ts +2 -2
  125. package/dist/types/components/breadcrumbs/breadcrumbs.types.d.ts +1 -1
  126. package/dist/types/components/chip-set/chip-set.d.ts +1 -0
  127. package/dist/types/components/chip-set/chip.types.d.ts +29 -1
  128. package/dist/types/components/file/file.types.d.ts +18 -1
  129. package/dist/types/components/icon/get-icon-props.d.ts +48 -0
  130. package/dist/types/components/list/list-item.types.d.ts +11 -2
  131. package/dist/types/components/list/list.d.ts +1 -0
  132. package/dist/types/components/menu/menu.types.d.ts +11 -1
  133. package/dist/types/components/menu-list/menu-list.d.ts +1 -0
  134. package/dist/types/components/progress-flow/progress-flow.types.d.ts +9 -0
  135. package/dist/types/components/select/option.types.d.ts +11 -1
  136. package/dist/types/components/select/select.template.d.ts +1 -0
  137. package/dist/types/components/tab-bar/tab-bar.d.ts +1 -0
  138. package/dist/types/components/tab-bar/tab.types.d.ts +11 -1
  139. package/package.json +1 -1
  140. package/dist/lime-elements/p-17b91e03.entry.js +0 -236
  141. package/dist/lime-elements/p-17b91e03.entry.js.map +0 -1
  142. package/dist/lime-elements/p-1bdc524d.entry.js +0 -2
  143. package/dist/lime-elements/p-1bdc524d.entry.js.map +0 -1
  144. package/dist/lime-elements/p-4449f7af.entry.js +0 -82
  145. package/dist/lime-elements/p-4449f7af.entry.js.map +0 -1
  146. package/dist/lime-elements/p-4fc7e0df.entry.js +0 -2
  147. package/dist/lime-elements/p-4fc7e0df.entry.js.map +0 -1
  148. package/dist/lime-elements/p-685e5867.entry.js +0 -2
  149. package/dist/lime-elements/p-685e5867.entry.js.map +0 -1
  150. package/dist/lime-elements/p-6e66b78a.entry.js +0 -2
  151. package/dist/lime-elements/p-6e66b78a.entry.js.map +0 -1
  152. package/dist/lime-elements/p-71802c27.entry.js +0 -2
  153. package/dist/lime-elements/p-71802c27.entry.js.map +0 -1
  154. package/dist/lime-elements/p-7d76f0d4.entry.js +0 -2
  155. package/dist/lime-elements/p-7d76f0d4.entry.js.map +0 -1
  156. package/dist/lime-elements/p-98be972f.entry.js +0 -16
  157. package/dist/lime-elements/p-98be972f.entry.js.map +0 -1
  158. package/dist/lime-elements/p-b4f1c135.entry.js.map +0 -1
  159. package/dist/lime-elements/p-b9698f79.entry.js +0 -82
  160. package/dist/lime-elements/p-b9698f79.entry.js.map +0 -1
  161. package/dist/lime-elements/p-bc23beb6.entry.js.map +0 -1
@@ -0,0 +1,97 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Get the icon name.
5
+ * This helps in setting the right icon, both if the consumer only types `icon: string`,
6
+ * and if they use the `Icon` interface for writing the icon name.
7
+ * @param {string | Icon | undefined} icon - The icon to retrieve the name from.
8
+ * @returns {string | undefined} The icon name or the provided string, or `undefined` if `icon` is falsy.
9
+ */
10
+ function getIconName(icon) {
11
+ if (typeof icon === 'object' && 'name' in icon) {
12
+ return icon.name;
13
+ }
14
+ if (typeof icon === 'string') {
15
+ return icon;
16
+ }
17
+ return undefined;
18
+ }
19
+ /**
20
+ * Get the icon color.
21
+ * This is added because the old way of specifying `iconColor`
22
+ * deprecated in our components. So consumers should now use the new
23
+ * `Icon` interface instead. But our components must still support the
24
+ * old way of writing `iconColor: string`.
25
+ * @param {string | Icon | undefined} icon - The icon to retrieve the color from.
26
+ * @param {string | undefined} [iconColor] - The color to use when the deprecated `iconColor` is used.
27
+ * @returns {string | undefined} The icon color or the provided color string, or `undefined` if `iconColor` is falsy.
28
+ */
29
+ function getIconColor(icon, iconColor) {
30
+ if (typeof icon === 'object' && 'color' in icon) {
31
+ return icon.color;
32
+ }
33
+ if (typeof icon === 'string') {
34
+ return iconColor;
35
+ }
36
+ return undefined;
37
+ }
38
+ /**
39
+ * Get the icon color.
40
+ * This is added because the old way of specifying `iconFillColor` is
41
+ * deprecated in our components. So consumers should now use the new
42
+ * `Icon` interface instead. But our components must still support the
43
+ * old way of writing `iconFillColor: string`.
44
+ * @param {string | Icon} icon - The icon to retrieve the color from.
45
+ * @param {string | undefined} [iconFillColor] - The color to use when `iconFillColor` is used.
46
+ * @returns {string | undefined} The icon color or the provided color string, or `undefined` if `iconColor` is falsy.
47
+ */
48
+ function getIconFillColor(icon, iconFillColor) {
49
+ if (typeof icon === 'object' && 'color' in icon) {
50
+ return icon.color;
51
+ }
52
+ if (typeof icon === 'string') {
53
+ return iconFillColor;
54
+ }
55
+ return undefined;
56
+ }
57
+ /**
58
+ * Get the icon background color.
59
+ * This function is used to retrieve the background color associated with an icon,
60
+ * whether provided as a string or using the `Icon` interface.
61
+ * @param {string | Icon | undefined} icon - The icon to retrieve the background color from.
62
+ * @param {string | undefined} [iconBackgroundColor] - The background color to use when provided explicitly.
63
+ * @returns {string | undefined} The icon background color or the provided background color string, or `undefined` if `iconBackgroundColor` is falsy.
64
+ */
65
+ function getIconBackgroundColor(icon, iconBackgroundColor) {
66
+ if (typeof icon === 'object' && 'backgroundColor' in icon) {
67
+ return icon.backgroundColor;
68
+ }
69
+ if (typeof icon === 'string') {
70
+ return iconBackgroundColor;
71
+ }
72
+ return undefined;
73
+ }
74
+ /**
75
+ * Get the icon title.
76
+ * This function is used to retrieve the title associated with an icon, whether provided as a string or using the `Icon` interface.
77
+ * @param {string | Icon | undefined} icon - The icon to retrieve the title from.
78
+ * @param {string | undefined} [iconTitle] - The title to use when provided explicitly.
79
+ * @returns {string | undefined} The icon title or the provided title string, or `undefined` if `iconTitle` is falsy.
80
+ */
81
+ function getIconTitle(icon, iconTitle) {
82
+ if (typeof icon === 'object' && 'title' in icon) {
83
+ return icon.title;
84
+ }
85
+ if (typeof icon === 'string') {
86
+ return iconTitle;
87
+ }
88
+ return undefined;
89
+ }
90
+
91
+ exports.getIconBackgroundColor = getIconBackgroundColor;
92
+ exports.getIconColor = getIconColor;
93
+ exports.getIconFillColor = getIconFillColor;
94
+ exports.getIconName = getIconName;
95
+ exports.getIconTitle = getIconTitle;
96
+
97
+ //# sourceMappingURL=get-icon-props-46a7e937.js.map
@@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AAQ,IAAI,OAAO,IAAI,IAAI,EAAE;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC;GACrB;EAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAO,SAAS,CAAC;GACpB;EAED,OAAO,SAAS,CAAC;AACrB;;;;;;;;","names":[],"sources":["./src/components/icon/get-icon-props.ts"],"sourcesContent":["import { Icon } from '../../interface';\n\n/**\n * Get the icon name.\n * This helps in setting the right icon, both if the consumer only types `icon: string`,\n * and if they use the `Icon` interface for writing the icon name.\n * @param {string | Icon | undefined} icon - The icon to retrieve the name from.\n * @returns {string | undefined} The icon name or the provided string, or `undefined` if `icon` is falsy.\n */\nexport function getIconName(\n icon: string | Icon | undefined\n): string | undefined {\n if (typeof icon === 'object' && 'name' in icon) {\n return icon.name;\n }\n\n if (typeof icon === 'string') {\n return icon;\n }\n\n return undefined;\n}\n\n/**\n * Get the icon color.\n * This is added because the old way of specifying `iconColor`\n * deprecated in our components. So consumers should now use the new\n * `Icon` interface instead. But our components must still support the\n * old way of writing `iconColor: string`.\n * @param {string | Icon | undefined} icon - The icon to retrieve the color from.\n * @param {string | undefined} [iconColor] - The color to use when the deprecated `iconColor` is used.\n * @returns {string | undefined} The icon color or the provided color string, or `undefined` if `iconColor` is falsy.\n */\nexport function getIconColor(\n icon: string | Icon | undefined,\n iconColor?: string | undefined\n): string | undefined {\n if (typeof icon === 'object' && 'color' in icon) {\n return icon.color;\n }\n\n if (typeof icon === 'string') {\n return iconColor;\n }\n\n return undefined;\n}\n\n/**\n * Get the icon color.\n * This is added because the old way of specifying `iconFillColor` is\n * deprecated in our components. So consumers should now use the new\n * `Icon` interface instead. But our components must still support the\n * old way of writing `iconFillColor: string`.\n * @param {string | Icon} icon - The icon to retrieve the color from.\n * @param {string | undefined} [iconFillColor] - The color to use when `iconFillColor` is used.\n * @returns {string | undefined} The icon color or the provided color string, or `undefined` if `iconColor` is falsy.\n */\nexport function getIconFillColor(\n icon: string | Icon | undefined,\n iconFillColor?: string | undefined\n): string {\n if (typeof icon === 'object' && 'color' in icon) {\n return icon.color;\n }\n\n if (typeof icon === 'string') {\n return iconFillColor;\n }\n\n return undefined;\n}\n\n/**\n * Get the icon background color.\n * This function is used to retrieve the background color associated with an icon,\n * whether provided as a string or using the `Icon` interface.\n * @param {string | Icon | undefined} icon - The icon to retrieve the background color from.\n * @param {string | undefined} [iconBackgroundColor] - The background color to use when provided explicitly.\n * @returns {string | undefined} The icon background color or the provided background color string, or `undefined` if `iconBackgroundColor` is falsy.\n */\nexport function getIconBackgroundColor(\n icon: string | Icon | undefined,\n iconBackgroundColor?: string | undefined\n): string | undefined {\n if (typeof icon === 'object' && 'backgroundColor' in icon) {\n return icon.backgroundColor;\n }\n\n if (typeof icon === 'string') {\n return iconBackgroundColor;\n }\n\n return undefined;\n}\n\n/**\n * Get the icon title.\n * This function is used to retrieve the title associated with an icon, whether provided as a string or using the `Icon` interface.\n * @param {string | Icon | undefined} icon - The icon to retrieve the title from.\n * @param {string | undefined} [iconTitle] - The title to use when provided explicitly.\n * @returns {string | undefined} The icon title or the provided title string, or `undefined` if `iconTitle` is falsy.\n */\nexport function getIconTitle(\n icon: string | Icon | undefined,\n iconTitle?: string | undefined\n): string | undefined {\n if (typeof icon === 'object' && 'title' in icon) {\n return icon.title;\n }\n\n if (typeof icon === 'string') {\n return iconTitle;\n }\n\n return undefined;\n}\n"],"version":3}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-38eb64b5.js');
6
6
  const randomString = require('./random-string-c8445652.js');
7
7
  const makeEnterClickable = require('./make-enter-clickable-59460fd6.js');
8
+ const getIconProps = require('./get-icon-props-46a7e937.js');
8
9
 
9
10
  const actionBarItemCss = "limel-action-bar-item{transition:opacity 0.2s ease-in-out;position:relative;display:flex;align-items:center}limel-action-bar-item:not([is-visible]){opacity:0;pointer-events:none}button{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:0.25rem;width:100%;min-width:var(--action-bar-item-height);max-width:var(--action-bar-item-max-width, 10rem);height:var(--action-bar-item-height);color:var(--limel-action-bar-item-text-color);border-radius:var(--action-bar-item-height);font-size:0.875rem;padding:0 0.25rem}button:not([disabled]){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--limel-action-bar-item-text-color);background-color:var(--action-bar-background-color)}button:not([disabled]):hover{color:var(--limel-action-bar-item-text-color);background-color:var(--action-bar-background-color);box-shadow:var(--button-shadow-hovered)}button:not([disabled]):active{background-color:var(--action-bar-background-color);box-shadow:var(--button-shadow-inset-pressed);transform:translate3d(0, 0.05rem, 0)}button:not([disabled]):focus{outline:none}button:not([disabled]):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button:has(.text){padding:0 0.5rem}button[disabled]{opacity:0.4}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 0.25rem}limel-icon{flex-shrink:0;width:calc(var(--action-bar-item-height) - 0.75rem);height:calc(var(--action-bar-item-height) - 0.75rem);color:var(--action-bar-item-icon-color, var(--limel-action-bar-item-text-color))}div[role=separator]{width:1px;height:1.5rem;border-radius:var(--action-bar-item-height);background-color:var(--limel-action-bar-item-text-color);opacity:0.2}@media (pointer: fine){div[role=separator]{margin-right:0.5rem;margin-left:0.5rem}}limel-menu{--notification-badge-background-color:rgb(var(--contrast-600));--notification-badge-text-color:rgb(var(--contrast-1200))}limel-menu[open] button{box-shadow:var(--button-shadow-inset)}button[slot=trigger]{animation:fade-in ease-out 0.25s;font-size:0.75rem;font-weight:bold;transform:translate3d(0, 0, 0)}@keyframes fade-in{0%{scale:0.8;opacity:0}100%{scale:1;opacity:1}}";
10
11
 
@@ -23,6 +24,9 @@ const ActionBarButton = class {
23
24
  componentWillLoad() {
24
25
  makeEnterClickable.makeEnterClickable(this.host);
25
26
  }
27
+ componentDidLoad() {
28
+ this.triggerIconColorWarning();
29
+ }
26
30
  disconnectedCallback() {
27
31
  makeEnterClickable.removeEnterClickable(this.host);
28
32
  }
@@ -48,8 +52,10 @@ const ActionBarButton = class {
48
52
  return;
49
53
  }
50
54
  if ('icon' in this.item) {
51
- return (index.h("limel-icon", { name: this.item.icon, style: {
52
- '--action-bar-item-icon-color': `${this.item.iconColor}`,
55
+ const name = getIconProps.getIconName(this.item.icon);
56
+ const color = getIconProps.getIconColor(this.item.icon, this.item.iconColor);
57
+ return (index.h("limel-icon", { name: name, style: {
58
+ '--action-bar-item-icon-color': `${color}`,
53
59
  } }));
54
60
  }
55
61
  }
@@ -70,6 +76,12 @@ const ActionBarButton = class {
70
76
  return (index.h("limel-tooltip", { elementId: this.tooltipId, label: this.item.commandText }));
71
77
  }
72
78
  }
79
+ triggerIconColorWarning() {
80
+ if (this.isItem(this.item) && this.item.iconColor) {
81
+ /* eslint-disable-next-line no-console */
82
+ console.warn("The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.");
83
+ }
84
+ }
73
85
  get host() { return index.getElement(this); }
74
86
  };
75
87
  ActionBarButton.style = actionBarItemCss;
@@ -1 +1 @@
1
- {"file":"limel-action-bar-item.limel-action-bar-overflow-menu.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,gBAAgB,GAAG,urEAAurE;;MCuBnsE,eAAe;EA4BxB;;;IA+BQ,gBAAW,GAAG,CAAC,KAAiB;MACpC,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC/B,CAAC;;qBA5C0B,IAAI;IAW5B,IAAI,CAAC,SAAS,GAAGA,+BAAkB,EAAE,CAAC;GACzC;EAEM,iBAAiB;IACpBC,qCAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACjC;EAEM,oBAAoB;IACvBC,uCAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACnC;EAEM,MAAM;I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CAAC,IAA8B;IAC7C,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC,CAAC;GACjC;;;;;;","names":["createRandomString","makeEnterClickable","removeEnterClickable","h"],"sources":["./src/components/action-bar/action-bar-item/action-bar-item.scss?tag=limel-action-bar-item","./src/components/action-bar/action-bar-item/action-bar-item.tsx","./src/components/action-bar/action-bar-item/action-bar-overflow-menu.tsx"],"sourcesContent":["@use '../../../style/mixins';\n@use '../../../style/functions';\n\nlimel-action-bar-item {\n transition: opacity 0.2s ease-in-out;\n position: relative;\n display: flex;\n align-items: center;\n\n &:not([is-visible]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\nbutton {\n all: unset;\n\n &:not([disabled]) {\n @include mixins.is-flat-inset-clickable(\n $color: var(--limel-action-bar-item-text-color),\n $color--hovered: var(--limel-action-bar-item-text-color),\n $background-color: var(--action-bar-background-color),\n $background-color--hovered: var(--action-bar-background-color),\n $background-color--inset: var(--action-bar-background-color)\n );\n @include mixins.visualize-keyboard-focus;\n }\n\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n\n width: 100%;\n min-width: var(--action-bar-item-height);\n max-width: var(--action-bar-item-max-width, 10rem);\n height: var(--action-bar-item-height);\n color: var(--limel-action-bar-item-text-color);\n\n border-radius: var(--action-bar-item-height);\n font-size: functions.pxToRem(14);\n padding: 0 0.25rem;\n\n &:has(.text) {\n padding: 0 0.5rem;\n }\n\n &[disabled] {\n opacity: 0.4;\n }\n}\n\n.text {\n @include mixins.truncate-text();\n padding: 0 0.25rem;\n}\n\nlimel-icon {\n flex-shrink: 0;\n width: calc(var(--action-bar-item-height) - 0.75rem);\n height: calc(var(--action-bar-item-height) - 0.75rem);\n color: var(\n --action-bar-item-icon-color,\n var(--limel-action-bar-item-text-color)\n );\n}\n\ndiv[role='separator'] {\n width: 1px;\n height: 1.5rem;\n border-radius: var(--action-bar-item-height);\n background-color: var(--limel-action-bar-item-text-color);\n opacity: 0.2;\n\n @media (pointer: fine) {\n margin-right: 0.5rem;\n margin-left: 0.5rem;\n }\n}\n\n// 👇 Overflow menu\n\nlimel-menu {\n --notification-badge-background-color: rgb(var(--contrast-600));\n --notification-badge-text-color: rgb(var(--contrast-1200));\n\n &[open] {\n button {\n box-shadow: var(--button-shadow-inset);\n }\n }\n}\n\nbutton[slot='trigger'] {\n animation: fade-in ease-out 0.25s;\n font-size: 0.75rem;\n font-weight: bold;\n transform: translate3d(0, 0, 0);\n}\n\n@keyframes fade-in {\n 0% {\n scale: 0.8;\n opacity: 0;\n }\n 100% {\n scale: 1;\n opacity: 1;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n} from '@stencil/core';\nimport { ActionBarItem, ListSeparator } from '../../../interface';\nimport { createRandomString } from '../../../util/random-string';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from 'src/util/make-enter-clickable';\n\n/**\n * @private\n */\n@Component({\n tag: 'limel-action-bar-item',\n shadow: false,\n styleUrl: 'action-bar-item.scss',\n})\nexport class ActionBarButton {\n /**\n * Item that is placed in the action bar.\n */\n @Prop()\n public item!: ActionBarItem | ListSeparator;\n\n /**\n * Fired when a action bar item has been clicked.\n */\n @Event()\n public select: EventEmitter<ActionBarItem | ListSeparator>;\n\n /**\n * When the item is displayed in the available width,\n * this will be `false`.\n */\n @Prop({ reflect: true })\n public isVisible: boolean = true;\n\n @Element()\n private host: HTMLLimelActionBarItemElement;\n\n /**\n * Used to attach the right tooltip to the right button\n */\n private tooltipId: string;\n\n constructor() {\n this.tooltipId = createRandomString();\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public render() {\n if (!this.isItem(this.item) && this.item.separator) {\n return <div role=\"separator\" />;\n }\n\n return (\n <button\n id={this.tooltipId}\n type=\"button\"\n onClick={this.handleClick}\n disabled={this.isDisabled()}\n >\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderTooltip()}\n </button>\n );\n }\n\n private handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.select.emit(this.item);\n };\n\n private isItem(item: ActionBarItem | ListSeparator): item is ActionBarItem {\n return !('separator' in item);\n }\n\n private isDisabled() {\n if (this.isItem(this.item) && this.item.disabled) {\n return true;\n }\n\n if (!this.isVisible) {\n return true;\n }\n }\n\n private renderIcon() {\n if (this.isItem(this.item) && !this.item.icon) {\n return;\n }\n\n if ('icon' in this.item) {\n return (\n <limel-icon\n name={this.item.icon}\n style={{\n '--action-bar-item-icon-color': `${this.item.iconColor}`,\n }}\n />\n );\n }\n }\n\n private renderLabel() {\n if (!this.isItem(this.item) || this.item.iconOnly) {\n return;\n }\n\n return <span class=\"text\">{this.item.text}</span>;\n }\n\n private renderTooltip() {\n if (!this.isItem(this.item)) {\n return;\n }\n\n if (this.item.text) {\n return (\n <limel-tooltip\n elementId={this.tooltipId}\n label={this.item.text}\n helperLabel={this.item.commandText}\n />\n );\n }\n\n if (this.item.commandText) {\n return (\n <limel-tooltip\n elementId={this.tooltipId}\n label={this.item.commandText}\n />\n );\n }\n }\n}\n","import { Component, Prop, h, Event, EventEmitter } from '@stencil/core';\nimport {\n ActionBarItem,\n ListSeparator,\n MenuItem,\n OpenDirection,\n} from '../../../interface';\nimport { LimelMenuCustomEvent } from 'src/components';\n\n/**\n * @private\n */\n@Component({\n tag: 'limel-action-bar-overflow-menu',\n shadow: false,\n})\nexport class ActionBarOverflowMenu {\n /**\n * List of the items that should be rendered in the overflow menu.\n */\n @Prop()\n public items: Array<MenuItem | ListSeparator>;\n\n /**\n * Defines the location that the content of the overflow menu\n * appears, in relation to its trigger.\n * It defaults to `bottom-end`, since in normal scenarios\n * (for example when the action bar is not floating at the bottom of the screen)\n * this menu is the right-most item in the user interface of the component.\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection = 'bottom-end';\n\n @Event()\n public select: EventEmitter<ActionBarItem>;\n\n public render() {\n return [\n <limel-menu\n openDirection={this.openDirection}\n items={this.items}\n onSelect={this.handleSelect}\n >\n <button slot=\"trigger\">{this.countOverflowedItems()}</button>\n </limel-menu>,\n ];\n }\n\n private countOverflowedItems = () => {\n return `+${this.numberOfMenuItems}`;\n };\n\n private handleSelect = (event: LimelMenuCustomEvent<MenuItem>) => {\n event.stopPropagation();\n this.select.emit(event.detail);\n };\n\n private get numberOfMenuItems() {\n return this.items.filter((item) => this.isMenuItem(item)).length;\n }\n\n private isMenuItem(item: MenuItem | ListSeparator): item is MenuItem {\n return !('separator' in item);\n }\n}\n"],"version":3}
1
+ {"file":"limel-action-bar-item.limel-action-bar-overflow-menu.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,urEAAurE;;MCwBnsE,eAAe;EA4BxB;;;IAmCQ,gBAAW,GAAG,CAAC,KAAiB;MACpC,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC/B,CAAC;;qBAhD0B,IAAI;IAW5B,IAAI,CAAC,SAAS,GAAGA,+BAAkB,EAAE,CAAC;GACzC;EAEM,iBAAiB;IACpBC,qCAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACjC;EAEM,gBAAgB;IACnB,IAAI,CAAC,uBAAuB,EAAE,CAAC;GAClC;EAEM,oBAAoB;IACvBC,uCAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACnC;EAEM,MAAM;IACT,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;MAChD,OAAOC,iBAAK,IAAI,EAAC,WAAW,GAAG,CAAC;KACnC;IAED,QACIA,oBACI,EAAE,EAAE,IAAI,CAAC,SAAS,EAClB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE,IAE1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EAEO,UAAU,CAAC,IAA8B;IAC7C,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC,CAAC;GACjC;;;;;;","names":["createRandomString","makeEnterClickable","removeEnterClickable","h","getIconName","getIconColor"],"sources":["./src/components/action-bar/action-bar-item/action-bar-item.scss?tag=limel-action-bar-item","./src/components/action-bar/action-bar-item/action-bar-item.tsx","./src/components/action-bar/action-bar-item/action-bar-overflow-menu.tsx"],"sourcesContent":["@use '../../../style/mixins';\n@use '../../../style/functions';\n\nlimel-action-bar-item {\n transition: opacity 0.2s ease-in-out;\n position: relative;\n display: flex;\n align-items: center;\n\n &:not([is-visible]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\nbutton {\n all: unset;\n\n &:not([disabled]) {\n @include mixins.is-flat-inset-clickable(\n $color: var(--limel-action-bar-item-text-color),\n $color--hovered: var(--limel-action-bar-item-text-color),\n $background-color: var(--action-bar-background-color),\n $background-color--hovered: var(--action-bar-background-color),\n $background-color--inset: var(--action-bar-background-color)\n );\n @include mixins.visualize-keyboard-focus;\n }\n\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n\n width: 100%;\n min-width: var(--action-bar-item-height);\n max-width: var(--action-bar-item-max-width, 10rem);\n height: var(--action-bar-item-height);\n color: var(--limel-action-bar-item-text-color);\n\n border-radius: var(--action-bar-item-height);\n font-size: functions.pxToRem(14);\n padding: 0 0.25rem;\n\n &:has(.text) {\n padding: 0 0.5rem;\n }\n\n &[disabled] {\n opacity: 0.4;\n }\n}\n\n.text {\n @include mixins.truncate-text();\n padding: 0 0.25rem;\n}\n\nlimel-icon {\n flex-shrink: 0;\n width: calc(var(--action-bar-item-height) - 0.75rem);\n height: calc(var(--action-bar-item-height) - 0.75rem);\n color: var(\n --action-bar-item-icon-color,\n var(--limel-action-bar-item-text-color)\n );\n}\n\ndiv[role='separator'] {\n width: 1px;\n height: 1.5rem;\n border-radius: var(--action-bar-item-height);\n background-color: var(--limel-action-bar-item-text-color);\n opacity: 0.2;\n\n @media (pointer: fine) {\n margin-right: 0.5rem;\n margin-left: 0.5rem;\n }\n}\n\n// 👇 Overflow menu\n\nlimel-menu {\n --notification-badge-background-color: rgb(var(--contrast-600));\n --notification-badge-text-color: rgb(var(--contrast-1200));\n\n &[open] {\n button {\n box-shadow: var(--button-shadow-inset);\n }\n }\n}\n\nbutton[slot='trigger'] {\n animation: fade-in ease-out 0.25s;\n font-size: 0.75rem;\n font-weight: bold;\n transform: translate3d(0, 0, 0);\n}\n\n@keyframes fade-in {\n 0% {\n scale: 0.8;\n opacity: 0;\n }\n 100% {\n scale: 1;\n opacity: 1;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n} from '@stencil/core';\nimport { ActionBarItem, ListSeparator } from '../../../interface';\nimport { createRandomString } from '../../../util/random-string';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from 'src/util/make-enter-clickable';\nimport { getIconColor, getIconName } from '../../icon/get-icon-props';\n\n/**\n * @private\n */\n@Component({\n tag: 'limel-action-bar-item',\n shadow: false,\n styleUrl: 'action-bar-item.scss',\n})\nexport class ActionBarButton {\n /**\n * Item that is placed in the action bar.\n */\n @Prop()\n public item!: ActionBarItem | ListSeparator;\n\n /**\n * Fired when a action bar item has been clicked.\n */\n @Event()\n public select: EventEmitter<ActionBarItem | ListSeparator>;\n\n /**\n * When the item is displayed in the available width,\n * this will be `false`.\n */\n @Prop({ reflect: true })\n public isVisible: boolean = true;\n\n @Element()\n private host: HTMLLimelActionBarItemElement;\n\n /**\n * Used to attach the right tooltip to the right button\n */\n private tooltipId: string;\n\n constructor() {\n this.tooltipId = createRandomString();\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public componentDidLoad() {\n this.triggerIconColorWarning();\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public render() {\n if (!this.isItem(this.item) && this.item.separator) {\n return <div role=\"separator\" />;\n }\n\n return (\n <button\n id={this.tooltipId}\n type=\"button\"\n onClick={this.handleClick}\n disabled={this.isDisabled()}\n >\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderTooltip()}\n </button>\n );\n }\n\n private handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.select.emit(this.item);\n };\n\n private isItem(item: ActionBarItem | ListSeparator): item is ActionBarItem {\n return !('separator' in item);\n }\n\n private isDisabled() {\n if (this.isItem(this.item) && this.item.disabled) {\n return true;\n }\n\n if (!this.isVisible) {\n return true;\n }\n }\n\n private renderIcon() {\n if (this.isItem(this.item) && !this.item.icon) {\n return;\n }\n\n if ('icon' in this.item) {\n const name = getIconName(this.item.icon);\n const color = getIconColor(this.item.icon, this.item.iconColor);\n\n return (\n <limel-icon\n name={name}\n style={{\n '--action-bar-item-icon-color': `${color}`,\n }}\n />\n );\n }\n }\n\n private renderLabel() {\n if (!this.isItem(this.item) || this.item.iconOnly) {\n return;\n }\n\n return <span class=\"text\">{this.item.text}</span>;\n }\n\n private renderTooltip() {\n if (!this.isItem(this.item)) {\n return;\n }\n\n if (this.item.text) {\n return (\n <limel-tooltip\n elementId={this.tooltipId}\n label={this.item.text}\n helperLabel={this.item.commandText}\n />\n );\n }\n\n if (this.item.commandText) {\n return (\n <limel-tooltip\n elementId={this.tooltipId}\n label={this.item.commandText}\n />\n );\n }\n }\n\n private triggerIconColorWarning() {\n if (this.isItem(this.item) && this.item.iconColor) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.\"\n );\n }\n }\n}\n","import { Component, Prop, h, Event, EventEmitter } from '@stencil/core';\nimport {\n ActionBarItem,\n ListSeparator,\n MenuItem,\n OpenDirection,\n} from '../../../interface';\nimport { LimelMenuCustomEvent } from 'src/components';\n\n/**\n * @private\n */\n@Component({\n tag: 'limel-action-bar-overflow-menu',\n shadow: false,\n})\nexport class ActionBarOverflowMenu {\n /**\n * List of the items that should be rendered in the overflow menu.\n */\n @Prop()\n public items: Array<MenuItem | ListSeparator>;\n\n /**\n * Defines the location that the content of the overflow menu\n * appears, in relation to its trigger.\n * It defaults to `bottom-end`, since in normal scenarios\n * (for example when the action bar is not floating at the bottom of the screen)\n * this menu is the right-most item in the user interface of the component.\n */\n @Prop({ reflect: true })\n public openDirection: OpenDirection = 'bottom-end';\n\n @Event()\n public select: EventEmitter<ActionBarItem>;\n\n public render() {\n return [\n <limel-menu\n openDirection={this.openDirection}\n items={this.items}\n onSelect={this.handleSelect}\n >\n <button slot=\"trigger\">{this.countOverflowedItems()}</button>\n </limel-menu>,\n ];\n }\n\n private countOverflowedItems = () => {\n return `+${this.numberOfMenuItems}`;\n };\n\n private handleSelect = (event: LimelMenuCustomEvent<MenuItem>) => {\n event.stopPropagation();\n this.select.emit(event.detail);\n };\n\n private get numberOfMenuItems() {\n return this.items.filter((item) => this.isMenuItem(item)).length;\n }\n\n private isMenuItem(item: MenuItem | ListSeparator): item is MenuItem {\n return !('separator' in item);\n }\n}\n"],"version":3}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-38eb64b5.js');
6
6
  const makeEnterClickable = require('./make-enter-clickable-59460fd6.js');
7
7
  const randomString = require('./random-string-c8445652.js');
8
+ const getIconProps = require('./get-icon-props-46a7e937.js');
8
9
 
9
10
  const breadcrumbsCss = ":host(limel-breadcrumbs){--limel-breadcrumbs-item-height:1.5rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-item-text-color:var(\n --breadcrumbs-item-text-color,\n rgb(var(--contrast-1500))\n );--limel-overflow-mask-horizontal:linear-gradient(\n to right,\n transparent 0%,\n black calc(0% + var(--limel-left-edge-fade-width, 1rem)),\n black calc(100% - var(--limel-right-edge-fade-width, 1rem)),\n transparent 100%\n );-webkit-mask-image:var(--limel-overflow-mask-horizontal);mask-image:var(--limel-overflow-mask-horizontal);padding-left:var(--limel-left-edge-fade-width, 1rem);padding-right:var(--limel-right-edge-fade-width, 1rem);--limel-left-edge-fade-width:0.5rem;--limel-right-edge-fade-width:0.5rem}ol,li,.step{all:unset}*{box-sizing:border-box}ol{padding:0.5rem;gap:var(--limel-breadcrumbs-gap)}.step{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;max-width:var(--breadcrumbs-item-max-width, 10rem);height:var(--limel-breadcrumbs-item-height);color:var(--limel-breadcrumbs-item-text-color);border-radius:100vw;font-size:0.875rem;padding:0 0.25rem}.step:not(:has(.text)){padding:0 0.125rem}.step:not(.last):focus{outline:none}.step:not(.last):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.step:not(.last):after{content:var(--limel-breadcrumbs-divider);width:var(--limel-breadcrumbs-gap);position:absolute;top:0;right:calc(var(--limel-breadcrumbs-gap) * -1);bottom:0;left:auto;text-align:center}a.step{cursor:pointer;transition:color 0.2s ease}a.step:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:\"\";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.step:hover{--limel-breadcrumbs-item-text-color:rgb(var(--color-blue-default))}a.step:hover:before{opacity:0.3;transform:scale(1)}button.step:not(.last){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--limel-breadcrumbs-item-text-color);background-color:transparent}button.step:not(.last):hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button.step:not(.last):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}limel-icon{flex-shrink:0;width:calc(var(--limel-breadcrumbs-item-height) - 0.25rem);height:calc(var(--limel-breadcrumbs-item-height) - 0.25rem)}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 0.25rem}.last{opacity:0.7}:host(limel-breadcrumbs){box-sizing:border-box;display:flex;width:100%;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;direction:rtl}:host(limel-breadcrumbs)::-webkit-scrollbar{display:none}ol{display:flex;flex-direction:row-reverse;justify-content:flex-end;margin-right:auto}.step{direction:ltr}";
10
11
 
@@ -38,13 +39,14 @@ const Breadcrumbs = class {
38
39
  return (index.h("li", { class: "last step", tabindex: "-1", "aria-current": this.areItemsLinks(this.items) ? 'page' : 'step' }, this.renderIcon(lastItem[0]), index.h("span", { class: "text" }, lastItem[0].text)));
39
40
  };
40
41
  this.renderIcon = (item) => {
41
- var _a;
42
- if (!((_a = item.icon) === null || _a === void 0 ? void 0 : _a.name)) {
42
+ const name = getIconProps.getIconName(item.icon);
43
+ const color = getIconProps.getIconColor(item.icon);
44
+ if (!name) {
43
45
  return;
44
46
  }
45
47
  return (index.h("limel-icon", { style: {
46
- color: `${item.icon.color}`,
47
- }, name: item.icon.name }));
48
+ color: `${color}`,
49
+ }, name: name }));
48
50
  };
49
51
  this.renderLabel = (item) => {
50
52
  if (item.type === 'icon-only') {
@@ -1 +1 @@
1
- {"file":"limel-breadcrumbs.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,cAAc,GAAG,68FAA68F;;MC8Cv9F,WAAW;;;;IAiDZ,gBAAW,GAAG;MAClB,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;MAEpD,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QAChC,OAAO,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;OACrD;MAED,OAAO,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KACvD,CAAC;IAEM,mBAAc,GAAG,CAAC,IAAqB;MAC3C,MAAM,SAAS,GAAGA,+BAAkB,EAAE,CAAC;MAEvC,OAAO;QACHC,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B;EAoGO,oBAAoB;;IACxB,MAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,CAAC,MAAM,CAAC;IAC3CC,uCAAoB,CAAC,OAAO,CAAC,CAAC;GACjC;;;;;;;","names":["createRandomString","h","makeEnterClickable","removeEnterClickable"],"sources":["./src/components/breadcrumbs/breadcrumbs.scss?tag=limel-breadcrumbs&encapsulation=shadow","./src/components/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["@use '../../style/mixins';\n\n/**\n* @prop --breadcrumbs-item-text-color: Text color of breadcrumbs items, defaults to `--contrast-1100`.\n* @prop --breadcrumbs-item-max-width: Maximum width of a button in the breadcrumbs. Defaults to `10rem`. Keep in mind that the buttons should not appear too big.\n*/\n\n$padding: 0.5rem;\n\n:host(limel-breadcrumbs) {\n --limel-breadcrumbs-item-height: 1.5rem;\n --limel-breadcrumbs-gap: 0.75rem;\n --limel-breadcrumbs-gap: 0.75rem;\n --limel-breadcrumbs-item-text-color: var(\n --breadcrumbs-item-text-color,\n rgb(var(--contrast-1500))\n );\n @include mixins.fade-out-overflowed-content-on-edges(horizontally);\n --limel-left-edge-fade-width: #{$padding};\n --limel-right-edge-fade-width: #{$padding};\n}\n\nol,\nli,\n.step {\n all: unset;\n}\n\n* {\n box-sizing: border-box;\n}\n\nol {\n padding: $padding; // needed for the focus and hover effects, since we are using overflow\n gap: var(--limel-breadcrumbs-gap);\n}\n\n.step {\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n\n max-width: var(--breadcrumbs-item-max-width, 10rem);\n height: var(--limel-breadcrumbs-item-height);\n\n color: var(--limel-breadcrumbs-item-text-color);\n border-radius: 100vw;\n font-size: 0.875rem;\n padding: 0 0.25rem;\n\n &:not(:has(.text)) {\n padding: 0 0.125rem;\n }\n\n &:not(.last) {\n @include mixins.visualize-keyboard-focus;\n\n &:after {\n content: var(--limel-breadcrumbs-divider);\n width: var(--limel-breadcrumbs-gap);\n\n position: absolute;\n top: 0;\n right: calc(var(--limel-breadcrumbs-gap) * -1);\n bottom: 0;\n left: auto;\n\n text-align: center;\n }\n }\n}\n\na.step {\n cursor: pointer;\n transition: color 0.2s ease;\n &:before {\n transition: opacity 0.2s ease, transform 0.3s ease-out;\n content: '';\n position: absolute;\n inset: auto 0 0 0;\n width: calc(100% - 0.5rem);\n margin: auto;\n height: 0.125rem;\n border-radius: 1rem;\n\n background-color: currentColor;\n opacity: 0;\n transform: scale(0.6);\n }\n\n &:hover {\n --limel-breadcrumbs-item-text-color: rgb(var(--color-blue-default));\n &:before {\n opacity: 0.3;\n transform: scale(1);\n }\n }\n}\n\nbutton.step {\n &:not(.last) {\n @include mixins.is-flat-clickable(\n $color: var(--limel-breadcrumbs-item-text-color)\n );\n }\n}\n\nlimel-icon {\n flex-shrink: 0;\n width: calc(var(--limel-breadcrumbs-item-height) - 0.25rem);\n height: calc(var(--limel-breadcrumbs-item-height) - 0.25rem);\n}\n\n.text {\n @include mixins.truncate-text;\n padding: 0 0.25rem;\n}\n\n.last {\n opacity: 0.7;\n}\n\n// LAYOUT:\n// The code below makes sure that the last item is always visible,\n// and previous items overflow out of the container\n// while keeping the container scrollable.\n// All without any additional scripts in the component code.\n\n:host(limel-breadcrumbs) {\n box-sizing: border-box;\n\n display: flex;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none; // This hides the scrollbars appearing under in Firefox\n -ms-overflow-style: none; // Same as above for IE 11\n &::-webkit-scrollbar {\n display: none; // This hides the scrollbars appearing under in Chrome\n }\n\n direction: rtl;\n}\n\nol {\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-end;\n margin-right: auto;\n}\n\n.step {\n direction: ltr;\n}\n","import {\n Component,\n Element,\n h,\n Event,\n EventEmitter,\n Prop,\n} from '@stencil/core';\nimport { BreadcrumbsItem } from '../../interface';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * A Breadcrumb consists of a list of distinct \"places\" that a user has gone through,\n * before ending up where they are right now, in a website or an application.\n *\n * These \"places\" can be for example _pages_ of a website, which are hierarchically\n * laid out before the current page that the user is looking at.\n * They could also be _steps_ which the user has gone through, which perhaps have no\n * hierarchical relation with each other, but has eventually led the user \"here\".\n *\n * :::note\n * - Where the user currently is, is always the last step of the breadcrumb.\n * - A breadcrumbs never shows where users can go after this place.\n * It only illustrates where user has been before ending up here.\n * If the path that a user can take is not changing and if next steps are clear,\n * you can use the [Progress flow component](#/component/limel-progress-flow) instead.\n * :::\n *\n * Breadcrumbs are often placed horizontally before the main content of the current screen.\n * @exampleComponent limel-example-breadcrumbs-links\n * @exampleComponent limel-example-breadcrumbs-buttons\n * @exampleComponent limel-example-breadcrumbs-icons\n * @exampleComponent limel-example-breadcrumbs-divider\n * @exampleComponent limel-example-breadcrumbs-icon-color\n * @exampleComponent limel-example-breadcrumbs-styling\n */\n\n@Component({\n tag: 'limel-breadcrumbs',\n shadow: true,\n styleUrl: 'breadcrumbs.scss',\n})\nexport class Breadcrumbs {\n /**\n * List of items in the breadcrumbs,\n * each representing a step or a page.\n */\n @Prop()\n public items: BreadcrumbsItem[];\n\n /**\n * The visual divider that separates items.\n * It must be a single character such as `-` or `,`.\n */\n @Prop()\n public divider: string = '›';\n\n /**\n * Fired when clicking on buttons (not links!)\n * inside the breadcrumbs.\n */\n @Event()\n public select: EventEmitter<BreadcrumbsItem>;\n\n @Element()\n private host: HTMLLimelBreadcrumbsElement;\n\n private button: HTMLButtonElement;\n private anchor: HTMLAnchorElement;\n\n public render() {\n return (\n <ol\n role=\"navigation\"\n aria-label=\"Breadcrumb\"\n style={{ '--limel-breadcrumbs-divider': `'${this.divider}'` }}\n >\n {this.renderSteps()}\n {this.renderLastStep()}\n </ol>\n );\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n this.removeEnterClickable();\n }\n\n private renderSteps = () => {\n const allStepsWithoutLast = this.items.slice(0, -1);\n\n if (this.areItemsLinks(this.items)) {\n return allStepsWithoutLast.map(this.renderAsLink);\n }\n\n return allStepsWithoutLast.map(this.renderAsButton);\n };\n\n private renderAsButton = (item: BreadcrumbsItem) => {\n const tooltipId = createRandomString();\n\n return [\n <button\n role=\"listitem\"\n id={tooltipId}\n class=\"step\"\n onClick={this.handleClick(item)}\n >\n {this.renderIcon(item)}\n {this.renderLabel(item)}\n </button>,\n this.renderTooltip(item, tooltipId),\n ];\n };\n\n private renderAsLink = (item: BreadcrumbsItem) => {\n const tooltipId = createRandomString();\n\n return [\n <a\n role=\"listitem\"\n id={createRandomString()}\n class=\"step\"\n href={item.link.href}\n title={item.link.title}\n >\n {this.renderIcon(item)}\n {this.renderLabel(item)}\n </a>,\n this.renderTooltip(item, tooltipId),\n ];\n };\n\n private renderLastStep = () => {\n const lastItem = this.items.slice(-1);\n\n return (\n <li\n class=\"last step\"\n tabindex=\"-1\"\n aria-current={this.areItemsLinks(this.items) ? 'page' : 'step'}\n >\n {this.renderIcon(lastItem[0])}\n <span class=\"text\">{lastItem[0].text}</span>\n </li>\n );\n };\n\n private renderIcon = (item: BreadcrumbsItem) => {\n if (!item.icon?.name) {\n return;\n }\n\n return (\n <limel-icon\n style={{\n color: `${item.icon.color}`,\n }}\n name={item.icon.name}\n />\n );\n };\n\n private renderLabel = (item: BreadcrumbsItem) => {\n if (item.type === 'icon-only') {\n return;\n }\n\n return <span class=\"text\">{item.text}</span>;\n };\n\n private renderTooltip = (item: BreadcrumbsItem, tooltipId: string) => {\n if (item.type === 'icon-only') {\n return <limel-tooltip elementId={tooltipId} label={item.text} />;\n }\n };\n\n private areItemsLinks = (items: BreadcrumbsItem[]) => {\n return items.some((item) => 'link' in item);\n };\n\n private handleClick = (item: BreadcrumbsItem) => (event: MouseEvent) => {\n event.stopPropagation();\n this.select.emit(item);\n };\n\n private removeEnterClickable() {\n const element = this.button ?? this.anchor;\n removeEnterClickable(element);\n }\n}\n"],"version":3}
1
+ {"file":"limel-breadcr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IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC;KAC/C,CAAC;IAEM,gBAAW,GAAG,CAAC,IAAqB,KAAK,CAAC,KAAiB;MAC/D,KAAK,CAAC,eAAe,EAAE,CAAC;MACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC1B,CAAC;;mBAvIuB,GAAG;;EAerB,MAAM;IACT,QACIA,gBACI,IAAI,EAAC,YAAY,gBACN,YAAY,EACvB,KAAK,EAAE,EAAE,6BAA6B,EAAE,IAAI,IAAI,CAAC,OAAO,GAAG,EAAE,IAE5D,IAAI,CAAC,WAAW,EAAE,EAClB,IAAI,CAAC,cAAc,EAAE,CACrB,EACP;GACL;EAEM,iBAAiB;IACpBG,qCAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GACjC;EAEM,oBAAoB;IACvB,IAAI,CAAC,oBAAoB,EAAE,CAAC;GAC/B;EAuGO,oBAAoB;;IACxB,MAAM,OAAO,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,IAAI,CAAC,MAAM,CAAC;IAC3CC,uCAAoB,CAAC,OAAO,CAAC,CAAC;GACjC;;;;;;;","names":["createRandomString","h","getIconName","getIconColor","makeEnterClickable","removeEnterClickable"],"sources":["./src/components/breadcrumbs/breadcrumbs.scss?tag=limel-breadcrumbs&encapsulation=shadow","./src/components/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["@use '../../style/mixins';\n\n/**\n* @prop --breadcrumbs-item-text-color: Text color of breadcrumbs items, defaults to `--contrast-1100`.\n* @prop --breadcrumbs-item-max-width: Maximum width of a button in the breadcrumbs. Defaults to `10rem`. Keep in mind that the buttons should not appear too big.\n*/\n\n$padding: 0.5rem;\n\n:host(limel-breadcrumbs) {\n --limel-breadcrumbs-item-height: 1.5rem;\n --limel-breadcrumbs-gap: 0.75rem;\n --limel-breadcrumbs-gap: 0.75rem;\n --limel-breadcrumbs-item-text-color: var(\n --breadcrumbs-item-text-color,\n rgb(var(--contrast-1500))\n );\n @include mixins.fade-out-overflowed-content-on-edges(horizontally);\n --limel-left-edge-fade-width: #{$padding};\n --limel-right-edge-fade-width: #{$padding};\n}\n\nol,\nli,\n.step {\n all: unset;\n}\n\n* {\n box-sizing: border-box;\n}\n\nol {\n padding: $padding; // needed for the focus and hover effects, since we are using overflow\n gap: var(--limel-breadcrumbs-gap);\n}\n\n.step {\n position: relative;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.25rem;\n\n max-width: var(--breadcrumbs-item-max-width, 10rem);\n height: var(--limel-breadcrumbs-item-height);\n\n color: var(--limel-breadcrumbs-item-text-color);\n border-radius: 100vw;\n font-size: 0.875rem;\n padding: 0 0.25rem;\n\n &:not(:has(.text)) {\n padding: 0 0.125rem;\n }\n\n &:not(.last) {\n @include mixins.visualize-keyboard-focus;\n\n &:after {\n content: var(--limel-breadcrumbs-divider);\n width: var(--limel-breadcrumbs-gap);\n\n position: absolute;\n top: 0;\n right: calc(var(--limel-breadcrumbs-gap) * -1);\n bottom: 0;\n left: auto;\n\n text-align: center;\n }\n }\n}\n\na.step {\n cursor: pointer;\n transition: color 0.2s ease;\n &:before {\n transition: opacity 0.2s ease, transform 0.3s ease-out;\n content: '';\n position: absolute;\n inset: auto 0 0 0;\n width: calc(100% - 0.5rem);\n margin: auto;\n height: 0.125rem;\n border-radius: 1rem;\n\n background-color: currentColor;\n opacity: 0;\n transform: scale(0.6);\n }\n\n &:hover {\n --limel-breadcrumbs-item-text-color: rgb(var(--color-blue-default));\n &:before {\n opacity: 0.3;\n transform: scale(1);\n }\n }\n}\n\nbutton.step {\n &:not(.last) {\n @include mixins.is-flat-clickable(\n $color: var(--limel-breadcrumbs-item-text-color)\n );\n }\n}\n\nlimel-icon {\n flex-shrink: 0;\n width: calc(var(--limel-breadcrumbs-item-height) - 0.25rem);\n height: calc(var(--limel-breadcrumbs-item-height) - 0.25rem);\n}\n\n.text {\n @include mixins.truncate-text;\n padding: 0 0.25rem;\n}\n\n.last {\n opacity: 0.7;\n}\n\n// LAYOUT:\n// The code below makes sure that the last item is always visible,\n// and previous items overflow out of the container\n// while keeping the container scrollable.\n// All without any additional scripts in the component code.\n\n:host(limel-breadcrumbs) {\n box-sizing: border-box;\n\n display: flex;\n width: 100%;\n overflow-x: auto;\n scrollbar-width: none; // This hides the scrollbars appearing under in Firefox\n -ms-overflow-style: none; // Same as above for IE 11\n &::-webkit-scrollbar {\n display: none; // This hides the scrollbars appearing under in Chrome\n }\n\n direction: rtl;\n}\n\nol {\n display: flex;\n flex-direction: row-reverse;\n justify-content: flex-end;\n margin-right: auto;\n}\n\n.step {\n direction: ltr;\n}\n","import {\n Component,\n Element,\n h,\n Event,\n EventEmitter,\n Prop,\n} from '@stencil/core';\nimport { BreadcrumbsItem } from '../../interface';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\nimport { createRandomString } from '../../util/random-string';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\n/**\n * A Breadcrumb consists of a list of distinct \"places\" that a user has gone through,\n * before ending up where they are right now, in a website or an application.\n *\n * These \"places\" can be for example _pages_ of a website, which are hierarchically\n * laid out before the current page that the user is looking at.\n * They could also be _steps_ which the user has gone through, which perhaps have no\n * hierarchical relation with each other, but has eventually led the user \"here\".\n *\n * :::note\n * - Where the user currently is, is always the last step of the breadcrumb.\n * - A breadcrumbs never shows where users can go after this place.\n * It only illustrates where user has been before ending up here.\n * If the path that a user can take is not changing and if next steps are clear,\n * you can use the [Progress flow component](#/component/limel-progress-flow) instead.\n * :::\n *\n * Breadcrumbs are often placed horizontally before the main content of the current screen.\n * @exampleComponent limel-example-breadcrumbs-links\n * @exampleComponent limel-example-breadcrumbs-buttons\n * @exampleComponent limel-example-breadcrumbs-icons\n * @exampleComponent limel-example-breadcrumbs-divider\n * @exampleComponent limel-example-breadcrumbs-icon-color\n * @exampleComponent limel-example-breadcrumbs-styling\n */\n\n@Component({\n tag: 'limel-breadcrumbs',\n shadow: true,\n styleUrl: 'breadcrumbs.scss',\n})\nexport class Breadcrumbs {\n /**\n * List of items in the breadcrumbs,\n * each representing a step or a page.\n */\n @Prop()\n public items: BreadcrumbsItem[];\n\n /**\n * The visual divider that separates items.\n * It must be a single character such as `-` or `,`.\n */\n @Prop()\n public divider: string = '›';\n\n /**\n * Fired when clicking on buttons (not links!)\n * inside the breadcrumbs.\n */\n @Event()\n public select: EventEmitter<BreadcrumbsItem>;\n\n @Element()\n private host: HTMLLimelBreadcrumbsElement;\n\n private button: HTMLButtonElement;\n private anchor: HTMLAnchorElement;\n\n public render() {\n return (\n <ol\n role=\"navigation\"\n aria-label=\"Breadcrumb\"\n style={{ '--limel-breadcrumbs-divider': `'${this.divider}'` }}\n >\n {this.renderSteps()}\n {this.renderLastStep()}\n </ol>\n );\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n this.removeEnterClickable();\n }\n\n private renderSteps = () => {\n const allStepsWithoutLast = this.items.slice(0, -1);\n\n if (this.areItemsLinks(this.items)) {\n return allStepsWithoutLast.map(this.renderAsLink);\n }\n\n return allStepsWithoutLast.map(this.renderAsButton);\n };\n\n private renderAsButton = (item: BreadcrumbsItem) => {\n const tooltipId = createRandomString();\n\n return [\n <button\n role=\"listitem\"\n id={tooltipId}\n class=\"step\"\n onClick={this.handleClick(item)}\n >\n {this.renderIcon(item)}\n {this.renderLabel(item)}\n </button>,\n this.renderTooltip(item, tooltipId),\n ];\n };\n\n private renderAsLink = (item: BreadcrumbsItem) => {\n const tooltipId = createRandomString();\n\n return [\n <a\n role=\"listitem\"\n id={createRandomString()}\n class=\"step\"\n href={item.link.href}\n title={item.link.title}\n >\n {this.renderIcon(item)}\n {this.renderLabel(item)}\n </a>,\n this.renderTooltip(item, tooltipId),\n ];\n };\n\n private renderLastStep = () => {\n const lastItem = this.items.slice(-1);\n\n return (\n <li\n class=\"last step\"\n tabindex=\"-1\"\n aria-current={this.areItemsLinks(this.items) ? 'page' : 'step'}\n >\n {this.renderIcon(lastItem[0])}\n <span class=\"text\">{lastItem[0].text}</span>\n </li>\n );\n };\n\n private renderIcon = (item: BreadcrumbsItem) => {\n const name = getIconName(item.icon);\n const color = getIconColor(item.icon);\n\n if (!name) {\n return;\n }\n\n return (\n <limel-icon\n style={{\n color: `${color}`,\n }}\n name={name}\n />\n );\n };\n\n private renderLabel = (item: BreadcrumbsItem) => {\n if (item.type === 'icon-only') {\n return;\n }\n\n return <span class=\"text\">{item.text}</span>;\n };\n\n private renderTooltip = (item: BreadcrumbsItem, tooltipId: string) => {\n if (item.type === 'icon-only') {\n return <limel-tooltip elementId={tooltipId} label={item.text} />;\n }\n };\n\n private areItemsLinks = (items: BreadcrumbsItem[]) => {\n return items.some((item) => 'link' in item);\n };\n\n private handleClick = (item: BreadcrumbsItem) => (event: MouseEvent) => {\n event.stopPropagation();\n this.select.emit(item);\n };\n\n private removeEnterClickable() {\n const element = this.button ?? this.anchor;\n removeEnterClickable(element);\n }\n}\n"],"version":3}
@@ -6,6 +6,7 @@ const index = require('./index-38eb64b5.js');
6
6
  const keycodes = require('./keycodes-3949f425.js');
7
7
  const translations = require('./translations-a384b596.js');
8
8
  const linkHelper = require('./link-helper-4f75d41d.js');
9
+ const getIconProps = require('./get-icon-props-46a7e937.js');
9
10
  const component$2 = require('./component-ae3bfacf.js');
10
11
  const isEqual = require('./isEqual-d2a13a24.js');
11
12
  const component = require('./component-67144c1c.js');
@@ -1835,6 +1836,7 @@ const ChipSet = class {
1835
1836
  this.syncEmptyInput();
1836
1837
  }
1837
1838
  componentDidLoad() {
1839
+ this.triggerIconColorWarning(this.value);
1838
1840
  if (this.type === 'input') {
1839
1841
  this.mdcTextField = new component$2.MDCTextField(this.host.shadowRoot.querySelector('.mdc-text-field'));
1840
1842
  }
@@ -2067,14 +2069,18 @@ const ChipSet = class {
2067
2069
  event.stopPropagation();
2068
2070
  }
2069
2071
  renderChipIcon(chip) {
2072
+ const name = getIconProps.getIconName(chip.icon);
2073
+ const color = getIconProps.getIconColor(chip.icon, chip.iconFillColor);
2074
+ const backgroundColor = getIconProps.getIconBackgroundColor(chip.icon, chip.iconBackgroundColor);
2075
+ const title = getIconProps.getIconTitle(chip.icon, chip.iconTitle);
2070
2076
  const style = {};
2071
- if (chip.iconFillColor) {
2072
- style['--icon-color'] = chip.iconFillColor;
2077
+ if (color) {
2078
+ style['--icon-color'] = color;
2073
2079
  }
2074
- if (chip.iconBackgroundColor) {
2075
- style['--icon-background-color'] = chip.iconBackgroundColor;
2080
+ if (backgroundColor) {
2081
+ style['--icon-background-color'] = backgroundColor;
2076
2082
  }
2077
- return (index.h("limel-icon", { class: "mdc-chip__icon mdc-chip__icon--leading", name: chip.icon, style: style, size: "small", badge: true, title: chip.iconTitle }));
2083
+ return (index.h("limel-icon", { class: "mdc-chip__icon mdc-chip__icon--leading", name: name, style: style, size: "small", badge: true, title: title }));
2078
2084
  }
2079
2085
  renderLeadingIcon() {
2080
2086
  if (!this.leadingIcon) {
@@ -2118,6 +2124,17 @@ const ChipSet = class {
2118
2124
  }
2119
2125
  return index.h("limel-badge", { label: chip.badge });
2120
2126
  }
2127
+ triggerIconColorWarning(value) {
2128
+ for (const chip of value) {
2129
+ if (chip.icon &&
2130
+ (chip.iconFillColor ||
2131
+ chip.iconBackgroundColor ||
2132
+ chip.iconTitle)) {
2133
+ /* eslint-disable-next-line no-console */
2134
+ console.warn("The `iconFillColor`, `iconBackgroundColor`, and `iconTitle` props are deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name', `iconBackgroundColor: 'color-name', and `iconTitle: 'title'`, write `icon { name: 'icon-name', color: 'color-name', backgroundColor: 'color-name', title: 'title' }`.");
2135
+ }
2136
+ }
2137
+ }
2121
2138
  get host() { return index.getElement(this); }
2122
2139
  static get watchers() { return {
2123
2140
  "value": ["handleChangeChips"]