le-kit 0.1.18 → 0.2.0

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 (173) hide show
  1. package/dist/cjs/index-pT2cVC5w.js.map +1 -1
  2. package/dist/cjs/le-button_13.cjs.entry.js +24 -28
  3. package/dist/cjs/le-card.cjs.entry.js +1 -1
  4. package/dist/cjs/le-combobox.cjs.entry.js +1 -1
  5. package/dist/cjs/le-header-placeholder.cjs.entry.js +1 -1
  6. package/dist/cjs/le-icon.cjs.entry.js +108 -0
  7. package/dist/cjs/le-kit.cjs.js +1 -1
  8. package/dist/cjs/le-multiselect.cjs.entry.js +3 -3
  9. package/dist/cjs/le-navigation.cjs.entry.js +499 -0
  10. package/dist/cjs/le-number-input.cjs.entry.js +1 -1
  11. package/dist/cjs/le-round-progress.cjs.entry.js +1 -1
  12. package/dist/cjs/le-segmented-control.cjs.entry.js +1 -1
  13. package/dist/cjs/le-stack.cjs.entry.js +1 -1
  14. package/dist/cjs/le-tab-bar.cjs.entry.js +1 -1
  15. package/dist/cjs/le-tab-panel.cjs.entry.js +2 -2
  16. package/dist/cjs/le-tab.cjs.entry.js +1 -1
  17. package/dist/cjs/le-tabs.cjs.entry.js +2 -2
  18. package/dist/cjs/le-tag.cjs.entry.js +1 -1
  19. package/dist/cjs/le-turntable.cjs.entry.js +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/collection/assets/icons/chevron-down.svg +3 -0
  22. package/dist/collection/collection-manifest.json +2 -0
  23. package/dist/collection/components/le-button/le-button.css +24 -24
  24. package/dist/collection/components/le-button/le-button.js +2 -2
  25. package/dist/collection/components/le-button/le-button.js.map +1 -1
  26. package/dist/collection/components/le-card/le-card.js +1 -1
  27. package/dist/collection/components/le-checkbox/le-checkbox.js +1 -1
  28. package/dist/collection/components/le-collapse/le-collapse.css +3 -3
  29. package/dist/collection/components/le-collapse/le-collapse.js +11 -15
  30. package/dist/collection/components/le-collapse/le-collapse.js.map +1 -1
  31. package/dist/collection/components/le-combobox/le-combobox.js +1 -1
  32. package/dist/collection/components/le-current-heading/le-current-heading.js +1 -1
  33. package/dist/collection/components/le-dropdown-base/le-dropdown-base.js +1 -1
  34. package/dist/collection/components/le-header/le-header.js +2 -2
  35. package/dist/collection/components/le-header-placeholder/le-header-placeholder.js +1 -1
  36. package/dist/collection/components/le-icon/le-icon.css +13 -0
  37. package/dist/collection/components/le-icon/le-icon.js +168 -0
  38. package/dist/collection/components/le-icon/le-icon.js.map +1 -0
  39. package/dist/collection/components/le-multiselect/le-multiselect.js +3 -3
  40. package/dist/collection/components/le-navigation/le-navigation.css +323 -0
  41. package/dist/collection/components/le-navigation/le-navigation.js +742 -0
  42. package/dist/collection/components/le-navigation/le-navigation.js.map +1 -0
  43. package/dist/collection/components/le-number-input/le-number-input.js +1 -1
  44. package/dist/collection/components/le-popover/le-popover.js +3 -3
  45. package/dist/collection/components/le-popup/le-popup.js +7 -7
  46. package/dist/collection/components/le-round-progress/le-round-progress.js +1 -1
  47. package/dist/collection/components/le-scroll-progress/le-scroll-progress.js +1 -1
  48. package/dist/collection/components/le-segmented-control/le-segmented-control.js +1 -1
  49. package/dist/collection/components/le-select/le-select.js +2 -2
  50. package/dist/collection/components/le-slot/le-slot.js +1 -1
  51. package/dist/collection/components/le-stack/le-stack.js +1 -1
  52. package/dist/collection/components/le-string-input/le-string-input.js +2 -2
  53. package/dist/collection/components/le-tab/le-tab.js +1 -1
  54. package/dist/collection/components/le-tab-bar/le-tab-bar.js +1 -1
  55. package/dist/collection/components/le-tab-panel/le-tab-panel.js +2 -2
  56. package/dist/collection/components/le-tabs/le-tabs.js +2 -2
  57. package/dist/collection/components/le-tag/le-tag.js +1 -1
  58. package/dist/collection/components/le-turntable/le-turntable.js +1 -1
  59. package/dist/collection/dist/components/assets/custom-elements.json +2149 -1404
  60. package/dist/collection/dist/components/assets/icons/chevron-down.json +13 -0
  61. package/dist/collection/dist/components/assets/icons/chevron-down.svg +3 -0
  62. package/dist/collection/types/options.js.map +1 -1
  63. package/dist/components/assets/custom-elements.json +2149 -1404
  64. package/dist/components/assets/icons/chevron-down.json +13 -0
  65. package/dist/components/assets/icons/chevron-down.svg +3 -0
  66. package/dist/components/index.js.map +1 -1
  67. package/dist/components/le-button2.js +8 -8
  68. package/dist/components/le-button2.js.map +1 -1
  69. package/dist/components/le-card.js +1 -1
  70. package/dist/components/le-collapse.js +1 -137
  71. package/dist/components/le-collapse.js.map +1 -1
  72. package/dist/components/le-collapse2.js +138 -0
  73. package/dist/components/le-collapse2.js.map +1 -0
  74. package/dist/components/le-combobox.js +1 -1
  75. package/dist/components/le-current-heading.js +1 -1
  76. package/dist/components/le-dropdown-base2.js +1 -1
  77. package/dist/components/le-header-placeholder.js +1 -1
  78. package/dist/components/le-header.js +2 -2
  79. package/dist/components/le-icon.d.ts +11 -0
  80. package/dist/components/le-icon.js +9 -0
  81. package/dist/components/le-icon.js.map +1 -0
  82. package/dist/components/le-icon2.js +133 -0
  83. package/dist/components/le-icon2.js.map +1 -0
  84. package/dist/components/le-multiselect.js +3 -3
  85. package/dist/components/le-navigation.d.ts +11 -0
  86. package/dist/components/le-navigation.js +598 -0
  87. package/dist/components/le-navigation.js.map +1 -0
  88. package/dist/components/le-number-input.js +1 -1
  89. package/dist/components/le-popover2.js +3 -3
  90. package/dist/components/le-round-progress.js +1 -1
  91. package/dist/components/le-scroll-progress.js +1 -1
  92. package/dist/components/le-segmented-control.js +1 -1
  93. package/dist/components/le-stack.js +1 -1
  94. package/dist/components/le-tab-bar.js +1 -1
  95. package/dist/components/le-tab-panel.js +2 -2
  96. package/dist/components/le-tab2.js +1 -1
  97. package/dist/components/le-tabs.js +2 -2
  98. package/dist/components/le-tag2.js +1 -1
  99. package/dist/components/le-turntable.js +1 -1
  100. package/dist/docs.json +515 -27
  101. package/dist/esm/index-CNv6tzAt.js.map +1 -1
  102. package/dist/esm/le-button_13.entry.js +24 -28
  103. package/dist/esm/le-card.entry.js +1 -1
  104. package/dist/esm/le-combobox.entry.js +1 -1
  105. package/dist/esm/le-header-placeholder.entry.js +1 -1
  106. package/dist/esm/le-icon.entry.js +106 -0
  107. package/dist/esm/le-icon.entry.js.map +1 -0
  108. package/dist/esm/le-kit.js +1 -1
  109. package/dist/esm/le-multiselect.entry.js +3 -3
  110. package/dist/esm/le-navigation.entry.js +497 -0
  111. package/dist/esm/le-navigation.entry.js.map +1 -0
  112. package/dist/esm/le-number-input.entry.js +1 -1
  113. package/dist/esm/le-round-progress.entry.js +1 -1
  114. package/dist/esm/le-segmented-control.entry.js +1 -1
  115. package/dist/esm/le-stack.entry.js +1 -1
  116. package/dist/esm/le-tab-bar.entry.js +1 -1
  117. package/dist/esm/le-tab-panel.entry.js +2 -2
  118. package/dist/esm/le-tab.entry.js +1 -1
  119. package/dist/esm/le-tabs.entry.js +2 -2
  120. package/dist/esm/le-tag.entry.js +1 -1
  121. package/dist/esm/le-turntable.entry.js +1 -1
  122. package/dist/esm/loader.js +1 -1
  123. package/dist/le-kit/dist/components/assets/custom-elements.json +2149 -1404
  124. package/dist/le-kit/dist/components/assets/icons/chevron-down.json +13 -0
  125. package/dist/le-kit/dist/components/assets/icons/chevron-down.svg +3 -0
  126. package/dist/le-kit/le-kit.esm.js +1 -1
  127. package/dist/le-kit/{p-b3531106.entry.js → p-0ac4397c.entry.js} +2 -2
  128. package/dist/le-kit/{p-31c3649c.entry.js → p-25a29e69.entry.js} +2 -2
  129. package/dist/le-kit/p-2ec60692.entry.js +2 -0
  130. package/dist/le-kit/{p-269fb44f.entry.js → p-511fbb63.entry.js} +2 -2
  131. package/dist/le-kit/{p-8afe6862.entry.js → p-58120921.entry.js} +2 -2
  132. package/dist/le-kit/{p-c83a1255.entry.js → p-5ceb06d8.entry.js} +2 -2
  133. package/dist/le-kit/p-8c5a8f1e.entry.js +2 -0
  134. package/dist/le-kit/p-8c5a8f1e.entry.js.map +1 -0
  135. package/dist/le-kit/{p-deef1f4d.entry.js → p-9a3bdbe1.entry.js} +2 -2
  136. package/dist/le-kit/p-CNv6tzAt.js.map +1 -1
  137. package/dist/le-kit/{p-e4618b36.entry.js → p-a0d2c580.entry.js} +2 -2
  138. package/dist/le-kit/{p-629c5e13.entry.js → p-a8963634.entry.js} +2 -2
  139. package/dist/le-kit/p-b1dc7e06.entry.js +2 -0
  140. package/dist/le-kit/p-b1dc7e06.entry.js.map +1 -0
  141. package/dist/le-kit/p-bb160082.entry.js +2 -0
  142. package/dist/le-kit/p-bb160082.entry.js.map +1 -0
  143. package/dist/le-kit/{p-7d316315.entry.js → p-de5638c9.entry.js} +2 -2
  144. package/dist/le-kit/{p-d2a5d431.entry.js → p-df9389f0.entry.js} +2 -2
  145. package/dist/le-kit/{p-684adc9f.entry.js → p-e24d3e33.entry.js} +2 -2
  146. package/dist/le-kit/{p-95cf203e.entry.js → p-ec20e438.entry.js} +2 -2
  147. package/dist/le-kit/{p-9ba2bfb3.entry.js → p-f4f2c3e7.entry.js} +2 -2
  148. package/dist/types/components/le-collapse/le-collapse.d.ts +5 -3
  149. package/dist/types/components/le-icon/le-icon.d.ts +28 -0
  150. package/dist/types/components/le-navigation/le-navigation.d.ts +112 -0
  151. package/dist/types/components.d.ts +194 -10
  152. package/dist/types/types/options.d.ts +5 -0
  153. package/package.json +1 -1
  154. package/dist/collection/dist/components/assets/.gitkeep +0 -1
  155. package/dist/components/assets/.gitkeep +0 -1
  156. package/dist/le-kit/dist/components/assets/.gitkeep +0 -1
  157. package/dist/le-kit/p-3829f572.entry.js +0 -2
  158. package/dist/le-kit/p-3829f572.entry.js.map +0 -1
  159. package/dist/le-kit/p-e07d4b78.entry.js +0 -2
  160. /package/dist/le-kit/{p-b3531106.entry.js.map → p-0ac4397c.entry.js.map} +0 -0
  161. /package/dist/le-kit/{p-31c3649c.entry.js.map → p-25a29e69.entry.js.map} +0 -0
  162. /package/dist/le-kit/{p-e07d4b78.entry.js.map → p-2ec60692.entry.js.map} +0 -0
  163. /package/dist/le-kit/{p-269fb44f.entry.js.map → p-511fbb63.entry.js.map} +0 -0
  164. /package/dist/le-kit/{p-8afe6862.entry.js.map → p-58120921.entry.js.map} +0 -0
  165. /package/dist/le-kit/{p-c83a1255.entry.js.map → p-5ceb06d8.entry.js.map} +0 -0
  166. /package/dist/le-kit/{p-deef1f4d.entry.js.map → p-9a3bdbe1.entry.js.map} +0 -0
  167. /package/dist/le-kit/{p-e4618b36.entry.js.map → p-a0d2c580.entry.js.map} +0 -0
  168. /package/dist/le-kit/{p-629c5e13.entry.js.map → p-a8963634.entry.js.map} +0 -0
  169. /package/dist/le-kit/{p-7d316315.entry.js.map → p-de5638c9.entry.js.map} +0 -0
  170. /package/dist/le-kit/{p-d2a5d431.entry.js.map → p-df9389f0.entry.js.map} +0 -0
  171. /package/dist/le-kit/{p-684adc9f.entry.js.map → p-e24d3e33.entry.js.map} +0 -0
  172. /package/dist/le-kit/{p-95cf203e.entry.js.map → p-ec20e438.entry.js.map} +0 -0
  173. /package/dist/le-kit/{p-9ba2bfb3.entry.js.map → p-f4f2c3e7.entry.js.map} +0 -0
@@ -0,0 +1,168 @@
1
+ /**
2
+ * Based on the script from Paul Andreson's article:
3
+ * https://paulcpederson.com/articles/stencil-icons/
4
+ */
5
+ import { Build, getAssetPath, h } from "@stencil/core";
6
+ const iconCache = {};
7
+ const requestCache = {};
8
+ async function fetchIcon({ name }) {
9
+ if (iconCache[name]) {
10
+ return iconCache[name];
11
+ }
12
+ if (!requestCache[name]) {
13
+ requestCache[name] = fetch(getAssetPath(`./assets/icons/${name}.json`))
14
+ .then(resp => resp.json())
15
+ .catch(() => {
16
+ console.error(`"${name}" is not a valid name`);
17
+ return '';
18
+ });
19
+ }
20
+ const path = await requestCache[name];
21
+ iconCache[name] = path;
22
+ return path;
23
+ }
24
+ export class LeIcon {
25
+ el;
26
+ /**
27
+ * Name of the icon to display. Corresponds to a JSON file in the assets folder.
28
+ * For example, "search" will load the "search.json" file.
29
+ */
30
+ name = null;
31
+ /**
32
+ * Size of the icon in pixels. Default is 16.
33
+ */
34
+ size = 16;
35
+ iconData = null;
36
+ visible = false;
37
+ async loadIconData() {
38
+ const { name, visible } = this;
39
+ if (!Build.isBrowser || !name || !visible) {
40
+ return;
41
+ }
42
+ this.iconData = await fetchIcon({ name });
43
+ }
44
+ intersectionObserver;
45
+ connectedCallback() {
46
+ this.waitUntilVisible(() => {
47
+ this.visible = true;
48
+ this.loadIconData();
49
+ });
50
+ }
51
+ disconnectedCallback() {
52
+ if (this.intersectionObserver) {
53
+ this.intersectionObserver.disconnect();
54
+ this.intersectionObserver = null;
55
+ }
56
+ }
57
+ async componentWillLoad() {
58
+ this.loadIconData();
59
+ }
60
+ waitUntilVisible(callback) {
61
+ if (!Build.isBrowser ||
62
+ typeof window === 'undefined' ||
63
+ !window.IntersectionObserver) {
64
+ callback();
65
+ return;
66
+ }
67
+ this.intersectionObserver = new IntersectionObserver(entries => {
68
+ entries.forEach(entry => {
69
+ if (entry.isIntersecting) {
70
+ this.intersectionObserver.disconnect();
71
+ this.intersectionObserver = null;
72
+ callback();
73
+ }
74
+ });
75
+ }, { rootMargin: '50px' });
76
+ this.intersectionObserver.observe(this.el);
77
+ }
78
+ /**
79
+ * Renders the SVG content out of a JSON data in a format:
80
+ * { "viewBox": "...", children: [{ "tag": "g", ""children": [ ... ], ...attrs }, ...] }
81
+ *
82
+ * @returns JSX.Element | null
83
+ */
84
+ renderSVGContent(children) {
85
+ if (!children || children.length === 0) {
86
+ return null;
87
+ }
88
+ const createElement = node => {
89
+ const { tag, children, ...attrs } = node;
90
+ return h(tag, attrs, children ? children.map(createElement) : null);
91
+ };
92
+ const svgElements = children.map(createElement);
93
+ return svgElements;
94
+ }
95
+ render() {
96
+ return (h("svg", { key: 'bf1ded84a38f5d8fdb1723476f4709dc58f71def', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", height: this.size, width: this.size, viewBox: this.iconData?.viewBox || `0 0 ${this.size} ${this.size}` }, this.renderSVGContent(this.iconData?.children)));
97
+ }
98
+ static get is() { return "le-icon"; }
99
+ static get encapsulation() { return "shadow"; }
100
+ static get originalStyleUrls() {
101
+ return {
102
+ "$": ["le-icon.css"]
103
+ };
104
+ }
105
+ static get styleUrls() {
106
+ return {
107
+ "$": ["le-icon.css"]
108
+ };
109
+ }
110
+ static get properties() {
111
+ return {
112
+ "name": {
113
+ "type": "string",
114
+ "mutable": false,
115
+ "complexType": {
116
+ "original": "string",
117
+ "resolved": "string",
118
+ "references": {}
119
+ },
120
+ "required": false,
121
+ "optional": false,
122
+ "docs": {
123
+ "tags": [],
124
+ "text": "Name of the icon to display. Corresponds to a JSON file in the assets folder.\nFor example, \"search\" will load the \"search.json\" file."
125
+ },
126
+ "getter": false,
127
+ "setter": false,
128
+ "reflect": false,
129
+ "attribute": "name",
130
+ "defaultValue": "null"
131
+ },
132
+ "size": {
133
+ "type": "number",
134
+ "mutable": false,
135
+ "complexType": {
136
+ "original": "number",
137
+ "resolved": "number",
138
+ "references": {}
139
+ },
140
+ "required": false,
141
+ "optional": false,
142
+ "docs": {
143
+ "tags": [],
144
+ "text": "Size of the icon in pixels. Default is 16."
145
+ },
146
+ "getter": false,
147
+ "setter": false,
148
+ "reflect": false,
149
+ "attribute": "size",
150
+ "defaultValue": "16"
151
+ }
152
+ };
153
+ }
154
+ static get states() {
155
+ return {
156
+ "iconData": {},
157
+ "visible": {}
158
+ };
159
+ }
160
+ static get elementRef() { return "el"; }
161
+ static get watchers() {
162
+ return [{
163
+ "propName": "name",
164
+ "methodName": "loadIconData"
165
+ }];
166
+ }
167
+ }
168
+ //# sourceMappingURL=le-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"le-icon.js","sourceRoot":"","sources":["../../../src/components/le-icon/le-icon.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/F,M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a,GAAG,IAAI,CAAC,EAAE;YAC3B,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC;YACzC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACtE,CAAC,CAAC;QAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAChD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,4DACE,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,cAAc,EACnB,MAAM,EAAE,IAAI,CAAC,IAAI,EACjB,KAAK,EAAE,IAAI,CAAC,IAAI,EAChB,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,IAAI,OAAO,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,IAEjE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAC3C,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/**\n * Based on the script from Paul Andreson's article:\n * https://paulcpederson.com/articles/stencil-icons/\n */\nimport { Build, Component, Element, getAssetPath, h, Prop, State, Watch } from '@stencil/core';\n\nconst iconCache = {};\nconst requestCache = {};\n\nasync function fetchIcon({ name }): Promise<string> {\n if (iconCache[name]) {\n return iconCache[name];\n }\n if (!requestCache[name]) {\n requestCache[name] = fetch(getAssetPath(`./assets/icons/${name}.json`))\n .then(resp => resp.json())\n .catch(() => {\n console.error(`\"${name}\" is not a valid name`);\n return '';\n });\n }\n\n const path = await requestCache[name];\n iconCache[name] = path;\n\n return path;\n}\n\n@Component({\n tag: 'le-icon',\n styleUrl: 'le-icon.css',\n shadow: true,\n})\nexport class LeIcon {\n @Element() el: HTMLElement;\n\n /**\n * Name of the icon to display. Corresponds to a JSON file in the assets folder.\n * For example, \"search\" will load the \"search.json\" file.\n */\n @Prop() name: string = null;\n\n /**\n * Size of the icon in pixels. Default is 16.\n */\n @Prop() size: number = 16;\n\n @State() private iconData: any = null;\n\n @State() private visible = false;\n\n @Watch('name') private async loadIconData(): Promise<void> {\n const { name, visible } = this;\n\n if (!Build.isBrowser || !name || !visible) {\n return;\n }\n\n this.iconData = await fetchIcon({ name });\n }\n\n private intersectionObserver: IntersectionObserver;\n\n connectedCallback(): void {\n this.waitUntilVisible(() => {\n this.visible = true;\n this.loadIconData();\n });\n }\n\n disconnectedCallback(): void {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n }\n }\n\n async componentWillLoad(): Promise<void> {\n this.loadIconData();\n }\n\n private waitUntilVisible(callback: () => void): void {\n if (\n !Build.isBrowser ||\n typeof window === 'undefined' ||\n !(window as any).IntersectionObserver\n ) {\n callback();\n return;\n }\n\n this.intersectionObserver = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n this.intersectionObserver.disconnect();\n this.intersectionObserver = null;\n callback();\n }\n });\n },\n { rootMargin: '50px' },\n );\n\n this.intersectionObserver.observe(this.el);\n }\n\n /**\n * Renders the SVG content out of a JSON data in a format:\n * { \"viewBox\": \"...\", children: [{ \"tag\": \"g\", \"\"children\": [ ... ], ...attrs }, ...] }\n *\n * @returns JSX.Element | null\n */\n private renderSVGContent(children?: any[]) {\n if (!children || children.length === 0) {\n return null;\n }\n\n const createElement = node => {\n const { tag, children, ...attrs } = node;\n return h(tag, attrs, children ? children.map(createElement) : null);\n };\n\n const svgElements = children.map(createElement);\n return svgElements;\n }\n\n render() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n height={this.size}\n width={this.size}\n viewBox={this.iconData?.viewBox || `0 0 ${this.size} ${this.size}`}\n >\n {this.renderSVGContent(this.iconData?.children)}\n </svg>\n );\n }\n}\n"]}
@@ -308,13 +308,13 @@ export class LeMultiselect {
308
308
  render() {
309
309
  const hasSelections = this.selectedOptions.length > 0;
310
310
  const atMaxSelections = this.maxSelections && this.value.length >= this.maxSelections;
311
- return (h("le-component", { key: '41e4bfe6f961a44cae4cb8de69d836da9dab2a42', component: "le-multiselect" }, h("le-dropdown-base", { key: '74b05d1f6b8930fe97f4f2ae861a12c1749640fe', ref: el => (this.dropdownEl = el), options: this.effectiveOptions, value: this.value, multiple: true, disabled: this.disabled, filterFn: this.searchable ? this.filterOption : undefined, filterQuery: this.searchQuery, emptyText: this.emptyText, showCheckboxes: true, fullWidth: this.fullWidth, onLeOptionSelect: this.handleOptionSelect, onLeDropdownOpen: this.handleDropdownOpen, onLeDropdownClose: this.handleDropdownClose }, h("div", { key: 'f270977fc98dd71908e63ae6acebaf2d275a8451', slot: "trigger", class: {
311
+ return (h("le-component", { key: '6fa8274a23f2cc144150442ca9478d405fa9db59', component: "le-multiselect" }, h("le-dropdown-base", { key: 'eccf77b1d40bcc1dbae6d6e73523199dba89c02a', ref: el => (this.dropdownEl = el), options: this.effectiveOptions, value: this.value, multiple: true, disabled: this.disabled, filterFn: this.searchable ? this.filterOption : undefined, filterQuery: this.searchQuery, emptyText: this.emptyText, showCheckboxes: true, fullWidth: this.fullWidth, onLeOptionSelect: this.handleOptionSelect, onLeDropdownOpen: this.handleDropdownOpen, onLeDropdownClose: this.handleDropdownClose }, h("div", { key: '3c665ad3efc5543a9afcb836c8a996030460723a', slot: "trigger", class: {
312
312
  'multiselect-trigger': true,
313
313
  'has-selections': hasSelections,
314
314
  'is-open': this.open,
315
315
  'is-disabled': this.disabled,
316
- }, tabIndex: this.disabled ? -1 : 0, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": this.open ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, this.renderTags(), h("div", { key: '9323e791cb4e6e822b493aac81868fc98c10f28f', class: "multiselect-actions" }, hasSelections && !this.disabled && (h("button", { key: '9fcc99acf644977a4f6bb1a54ad47ea1a0521e82', type: "button", class: "multiselect-clear", onClick: this.handleClearAll, "aria-label": "Clear all", tabIndex: -1 }, h("svg", { key: 'd82a6a3b3454854e6357156bed2dcf77fc76309b', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'efcd41249ae3166b87b8edd12e85ce6dc44c1ca7', d: "M4 4l8 8M12 4l-8 8" })))), h("span", { key: '07f295dfa81aca548bddeb9b00324ad28be84c0d', class: "multiselect-arrow" }, h("svg", { key: 'ab794b727c4de9af2fd8e1f5bf5fdd4370fc60a5', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: '7b5b9628aa0f6cf44a5806cd01fb80ff07e6a05a', d: "M4 6l4 4 4-4" }))))), this.searchable && this.open && (h("div", { key: 'a1da7b5910a7899cf18159e4c1ad9b230eb94ae5', class: "multiselect-search", slot: "header" }, h("le-string-input", { key: '8b2e0876aa7f07e5b35379b2154a2cf548731c26', mode: "default", inputRef: el => (this.inputEl = el), class: "search-input", placeholder: "Search...", value: this.searchQuery, onInput: this.handleSearchInput })))), this.name &&
317
- this.value.map(val => (h("input", { type: "hidden", name: this.name, value: val.toString(), key: val.toString() }))), atMaxSelections && (h("span", { key: '5d98fd2daa6a9ddbc90b9be701fda628156dbe62', class: "multiselect-status" }, "Maximum ", this.maxSelections, " selections"))));
316
+ }, tabIndex: this.disabled ? -1 : 0, role: "combobox", "aria-haspopup": "listbox", "aria-expanded": this.open ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.handleTriggerClick, onKeyDown: this.handleTriggerKeyDown }, this.renderTags(), h("div", { key: 'a19d6d1dfa9bfb757874bb4e39f75e3dc8e4f101', class: "multiselect-actions" }, hasSelections && !this.disabled && (h("button", { key: 'f639279dd53a1eaff6ff146c57129d598bc55ca5', type: "button", class: "multiselect-clear", onClick: this.handleClearAll, "aria-label": "Clear all", tabIndex: -1 }, h("svg", { key: 'a5458f2d7dae924b7f943df067269beca1d9bfdd', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: 'c2fd9f943f0496e2c0e0ecbb79e1a16993cb796d', d: "M4 4l8 8M12 4l-8 8" })))), h("span", { key: 'bd7fc5ef0af6b937fea089881f3d5fc881219247', class: "multiselect-arrow" }, h("svg", { key: '180c1c3b35713fc5de0aade07ef3524dd674cca5', viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { key: '48c1e6e3f2c0c20b52d2ba551d2720e5da5f0bed', d: "M4 6l4 4 4-4" }))))), this.searchable && this.open && (h("div", { key: '3b6dbe407a4d33065ff50496c14a71ebd27e71bb', class: "multiselect-search", slot: "header" }, h("le-string-input", { key: '35ed3a229b0ca6f4e1f9e8732c94a531af2d7fb3', mode: "default", inputRef: el => (this.inputEl = el), class: "search-input", placeholder: "Search...", value: this.searchQuery, onInput: this.handleSearchInput })))), this.name &&
317
+ this.value.map(val => (h("input", { type: "hidden", name: this.name, value: val.toString(), key: val.toString() }))), atMaxSelections && (h("span", { key: '214ee34c77755375045fce655129736ff4a1ef0f', class: "multiselect-status" }, "Maximum ", this.maxSelections, " selections"))));
318
318
  }
319
319
  static get is() { return "le-multiselect"; }
320
320
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,323 @@
1
+ :host {
2
+ display: block;
3
+
4
+ --le-nav-radius: var(--le-radius-md);
5
+ --le-nav-gap: var(--le-spacing-2);
6
+ --le-nav-item-padding-x: var(--le-spacing-1);
7
+ --le-nav-item-padding-y: var(--le-spacing-2);
8
+ --le-nav-item-gap: var(--le-spacing-2);
9
+
10
+ --le-nav-color: var(--le-color-text-primary);
11
+ --le-nav-muted: var(--le-color-text-secondary);
12
+ --le-nav-hover-bg: var(--le-color-gray-100);
13
+ --le-nav-selected-bg: var(--le-color-primary);
14
+ --le-nav-selected-color: var(--le-color-primary-contrast);
15
+ }
16
+
17
+ /* ==========================================
18
+ * Vertical navigation
19
+ * ========================================== */
20
+
21
+ .nav-vertical {
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: var(--le-nav-gap);
25
+ }
26
+
27
+ .nav-search {
28
+ width: 100%;
29
+ }
30
+
31
+ .nav-search-input {
32
+ --le-input-radius: var(--le-radius-md);
33
+ }
34
+
35
+ .nav-empty {
36
+ padding: var(--le-spacing-2);
37
+ color: var(--le-nav-muted);
38
+ font-size: var(--le-font-size-sm);
39
+ }
40
+
41
+ .nav-list {
42
+ list-style: none;
43
+ margin: 0;
44
+ padding: 0;
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: var(--le-spacing-1);
48
+ }
49
+
50
+ .nav-row {
51
+ display: flex;
52
+ align-items: stretch;
53
+ gap: var(--le-spacing-1);
54
+ border-radius: var(--le-nav-radius);
55
+ }
56
+
57
+ .nav-row:hover {
58
+ background: var(--le-nav-hover-bg);
59
+ }
60
+
61
+ .nav-toggle,
62
+ .nav-toggle-spacer {
63
+ box-sizing: border-box;
64
+ width: var(--le-spacing-4);
65
+ min-width: var(--le-spacing-4);
66
+ display: inline-flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ border: 1px solid transparent;
70
+ border-radius: var(--le-nav-radius);
71
+ color: inherit;
72
+ }
73
+
74
+ .nav-toggle {
75
+ background: transparent;
76
+ cursor: pointer;
77
+ opacity: 0.4;
78
+ }
79
+
80
+ .nav-toggle:hover:not(:disabled) {
81
+ opacity: 1;
82
+ }
83
+
84
+ .nav-toggle:focus-visible {
85
+ outline: 2px solid var(--le-color-focus);
86
+ outline-offset: 2px;
87
+ opacity: 1;
88
+ }
89
+
90
+ .nav-chevron {
91
+ display: inline-block;
92
+ transition: transform var(--le-transition-fast);
93
+ }
94
+
95
+ .nav-chevron svg {
96
+ display: block;
97
+ width: var(--le-spacing-4);
98
+ height: var(--le-spacing-4);
99
+ }
100
+
101
+ .nav-node > div > button > .nav-chevron {
102
+ transform: rotate(-90deg);
103
+ }
104
+ .nav-node.open > div > button > .nav-chevron {
105
+ transform: rotate(0deg);
106
+ }
107
+
108
+ .nav-item {
109
+ flex: 1;
110
+ display: inline-flex;
111
+ align-items: center;
112
+ gap: var(--le-nav-item-gap);
113
+ padding: var(--le-nav-item-padding-y) var(--le-nav-item-padding-x) var(--le-nav-item-padding-y) 0;
114
+ border-radius: var(--le-nav-radius);
115
+ border: 1px solid transparent;
116
+ background: transparent;
117
+ text-decoration: none;
118
+ color: var(--le-nav-color);
119
+ font-family: var(--le-font-family-base);
120
+ font-size: var(--le-font-size-md);
121
+ line-height: var(--le-line-height-tight);
122
+ cursor: pointer;
123
+ }
124
+
125
+ .nav-item:focus-visible {
126
+ outline: 2px solid var(--le-color-focus);
127
+ outline-offset: 2px;
128
+ }
129
+
130
+ .nav-node.selected > .nav-row {
131
+ background: var(--le-nav-selected-bg);
132
+ color: var(--le-nav-selected-color);
133
+ }
134
+ .nav-node.selected > .nav-row > .nav-item {
135
+ color: inherit;
136
+ }
137
+
138
+ .nav-node.disabled > .nav-row > .nav-item {
139
+ opacity: 0.5;
140
+ cursor: not-allowed;
141
+ }
142
+
143
+ .nav-text {
144
+ display: flex;
145
+ flex-direction: column;
146
+ min-width: 0;
147
+ }
148
+
149
+ .nav-label {
150
+ white-space: nowrap;
151
+ overflow: hidden;
152
+ text-overflow: ellipsis;
153
+ }
154
+
155
+ .nav-description {
156
+ color: color-mix(in srgb, var(--le-nav-muted) 90%, transparent);
157
+ font-size: var(--le-font-size-sm);
158
+ line-height: var(--le-line-height-tight);
159
+ }
160
+
161
+ .nav-icon {
162
+ display: inline-flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ flex-shrink: 0;
166
+ }
167
+
168
+ .nav-icon-end {
169
+ margin-left: auto;
170
+ }
171
+
172
+ .nav-children {
173
+ margin-top: var(--le-spacing-1);
174
+ }
175
+
176
+ /* ==========================================
177
+ * Horizontal navigation
178
+ * ========================================== */
179
+
180
+ .nav-horizontal {
181
+ display: flex;
182
+ align-items: center;
183
+ gap: var(--le-spacing-2);
184
+ }
185
+
186
+ .nav-horizontal-shell {
187
+ position: relative;
188
+ }
189
+
190
+ .nav-horizontal-measure {
191
+ position: absolute;
192
+ left: -10000px;
193
+ top: -10000px;
194
+ visibility: hidden;
195
+ pointer-events: none;
196
+ display: flex;
197
+ align-items: center;
198
+ gap: var(--le-spacing-2);
199
+ flex-wrap: wrap;
200
+ }
201
+
202
+ .nav-horizontal.wrap {
203
+ flex-wrap: wrap;
204
+ }
205
+
206
+ .nav-horizontal.nowrap {
207
+ flex-wrap: nowrap;
208
+ overflow: hidden;
209
+ }
210
+
211
+ .h-item {
212
+ display: flex;
213
+ align-items: center;
214
+ }
215
+
216
+ .h-link {
217
+ display: inline-flex;
218
+ align-items: center;
219
+ gap: var(--le-spacing-2);
220
+ padding: var(--le-spacing-2) var(--le-spacing-3);
221
+ border-radius: var(--le-nav-radius);
222
+ border: 1px solid transparent;
223
+ background: transparent;
224
+ text-decoration: none;
225
+ color: var(--le-nav-color);
226
+ font-family: var(--le-font-family-base);
227
+ font-size: var(--le-font-size-md);
228
+ cursor: pointer;
229
+ }
230
+
231
+ .h-link:hover {
232
+ background: var(--le-nav-hover-bg);
233
+ }
234
+
235
+ .h-link:focus-visible {
236
+ outline: 2px solid var(--le-color-focus);
237
+ outline-offset: 2px;
238
+ }
239
+
240
+ .h-link.disabled,
241
+ .h-trigger.disabled {
242
+ opacity: 0.5;
243
+ pointer-events: none;
244
+ }
245
+
246
+ .h-link.selected,
247
+ .h-trigger.selected {
248
+ background: var(--le-nav-selected-bg);
249
+ color: var(--le-nav-selected-color);
250
+ }
251
+
252
+ .h-label {
253
+ white-space: nowrap;
254
+ }
255
+
256
+ .h-trigger {
257
+ display: inline-flex;
258
+ align-items: center;
259
+ gap: var(--le-spacing-1);
260
+ border-radius: var(--le-nav-radius);
261
+ }
262
+
263
+ .h-submenu-toggle {
264
+ width: var(--le-spacing-3);
265
+ height: var(--le-spacing-3);
266
+ display: inline-flex;
267
+ align-items: center;
268
+ justify-content: center;
269
+ border: 1px solid transparent;
270
+ border-radius: var(--le-nav-radius);
271
+ background: transparent;
272
+ color: currentColor;
273
+ cursor: pointer;
274
+ }
275
+
276
+ .h-submenu-toggle:hover {
277
+ background: var(--le-nav-hover-bg);
278
+ }
279
+
280
+ .more-trigger-wrap {
281
+ display: flex;
282
+ align-items: center;
283
+ }
284
+
285
+ .more-trigger-wrap.is-measure {
286
+ position: absolute;
287
+ visibility: hidden;
288
+ pointer-events: none;
289
+ }
290
+
291
+ .more-trigger-wrap.is-visible {
292
+ position: static;
293
+ visibility: visible;
294
+ }
295
+
296
+ .overflow-trigger {
297
+ display: inline-flex;
298
+ align-items: center;
299
+ justify-content: center;
300
+ gap: var(--le-spacing-2);
301
+ padding: var(--le-spacing-2) var(--le-spacing-3);
302
+ border-radius: var(--le-nav-radius);
303
+ border: 1px solid transparent;
304
+ background: transparent;
305
+ color: var(--le-nav-color);
306
+ cursor: pointer;
307
+ font-family: var(--le-font-family-base);
308
+ font-size: var(--le-font-size-md);
309
+ }
310
+
311
+ .overflow-trigger:hover {
312
+ background: var(--le-nav-hover-bg);
313
+ }
314
+
315
+ .overflow-trigger:focus-visible {
316
+ outline: 2px solid var(--le-color-focus);
317
+ outline-offset: 2px;
318
+ }
319
+
320
+ /* Popover list container */
321
+ le-popover::part(content) {
322
+ padding: var(--le-spacing-1);
323
+ }