le-kit 0.1.4 → 0.1.5

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 (198) hide show
  1. package/dist/le-kit/assets/custom-elements.json +4305 -0
  2. package/dist/le-kit/index-Da-89pOc.js +4522 -0
  3. package/dist/le-kit/{index-D21JjI31.js.map → index-Da-89pOc.js.map} +1 -1
  4. package/dist/le-kit/index.esm.js +116 -2
  5. package/dist/le-kit/index.esm.js.map +1 -1
  6. package/dist/{esm → le-kit}/le-box.entry.js +3 -3
  7. package/dist/le-kit/le-button.entry.esm.js.map +1 -0
  8. package/dist/le-kit/le-button.entry.js +90 -0
  9. package/dist/{esm → le-kit}/le-card.entry.js +3 -3
  10. package/dist/le-kit/le-checkbox.entry.esm.js.map +1 -0
  11. package/dist/le-kit/le-checkbox.entry.js +59 -0
  12. package/dist/le-kit/le-component.entry.esm.js.map +1 -0
  13. package/dist/{collection/components/le-component/le-component.js → le-kit/le-component.entry.js} +19 -134
  14. package/dist/le-kit/le-kit.css +1010 -1
  15. package/dist/le-kit/le-kit.esm.js +48 -2
  16. package/dist/le-kit/le-kit.esm.js.map +1 -1
  17. package/dist/{esm → le-kit}/le-number-input.entry.js +5 -5
  18. package/dist/le-kit/le-popover.entry.esm.js.map +1 -0
  19. package/dist/{components/le-popover2.js → le-kit/le-popover.entry.js} +9 -45
  20. package/dist/{esm → le-kit}/le-popup.entry.js +6 -6
  21. package/dist/{esm → le-kit}/le-round-progress.entry.js +2 -2
  22. package/dist/le-kit/le-slot.entry.esm.js.map +1 -0
  23. package/dist/{collection/components/le-slot/le-slot.js → le-kit/le-slot.entry.js} +30 -279
  24. package/dist/{esm → le-kit}/le-stack.entry.js +3 -3
  25. package/dist/le-kit/le-string-input.entry.esm.js.map +1 -0
  26. package/dist/le-kit/le-string-input.entry.js +93 -0
  27. package/dist/{esm → le-kit}/le-text.entry.js +3 -3
  28. package/dist/{esm → le-kit}/le-turntable.entry.js +2 -2
  29. package/dist/{esm/utils-CJLZrrdC.js → le-kit/utils-FDOApZ53.js} +3 -3
  30. package/dist/le-kit/{utils-apol-Xc_.js.map → utils-FDOApZ53.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/cjs/index-CO4npcak.js +0 -1796
  33. package/dist/cjs/index-CO4npcak.js.map +0 -1
  34. package/dist/cjs/index.cjs.js +0 -117
  35. package/dist/cjs/index.cjs.js.map +0 -1
  36. package/dist/cjs/le-box.cjs.entry.js +0 -184
  37. package/dist/cjs/le-box.entry.cjs.js.map +0 -1
  38. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +0 -1
  39. package/dist/cjs/le-button_6.cjs.entry.js +0 -1199
  40. package/dist/cjs/le-card.cjs.entry.js +0 -29
  41. package/dist/cjs/le-card.entry.cjs.js.map +0 -1
  42. package/dist/cjs/le-kit.cjs.js +0 -25
  43. package/dist/cjs/le-kit.cjs.js.map +0 -1
  44. package/dist/cjs/le-number-input.cjs.entry.js +0 -202
  45. package/dist/cjs/le-number-input.entry.cjs.js.map +0 -1
  46. package/dist/cjs/le-popup.cjs.entry.js +0 -212
  47. package/dist/cjs/le-popup.entry.cjs.js.map +0 -1
  48. package/dist/cjs/le-round-progress.cjs.entry.js +0 -106
  49. package/dist/cjs/le-round-progress.entry.cjs.js.map +0 -1
  50. package/dist/cjs/le-stack.cjs.entry.js +0 -135
  51. package/dist/cjs/le-stack.entry.cjs.js.map +0 -1
  52. package/dist/cjs/le-text.cjs.entry.js +0 -335
  53. package/dist/cjs/le-text.entry.cjs.js.map +0 -1
  54. package/dist/cjs/le-turntable.cjs.entry.js +0 -139
  55. package/dist/cjs/le-turntable.entry.cjs.js.map +0 -1
  56. package/dist/cjs/loader.cjs.js +0 -13
  57. package/dist/cjs/loader.cjs.js.map +0 -1
  58. package/dist/cjs/utils-BeT0iyCQ.js +0 -152
  59. package/dist/cjs/utils-BeT0iyCQ.js.map +0 -1
  60. package/dist/collection/collection-manifest.json +0 -26
  61. package/dist/collection/components/le-box/le-box.default.css +0 -37
  62. package/dist/collection/components/le-box/le-box.js +0 -614
  63. package/dist/collection/components/le-box/le-box.js.map +0 -1
  64. package/dist/collection/components/le-button/le-button.default.css +0 -263
  65. package/dist/collection/components/le-button/le-button.js +0 -368
  66. package/dist/collection/components/le-button/le-button.js.map +0 -1
  67. package/dist/collection/components/le-card/le-card.default.css +0 -74
  68. package/dist/collection/components/le-card/le-card.js +0 -102
  69. package/dist/collection/components/le-card/le-card.js.map +0 -1
  70. package/dist/collection/components/le-checkbox/le-checkbox.css +0 -93
  71. package/dist/collection/components/le-checkbox/le-checkbox.js +0 -192
  72. package/dist/collection/components/le-checkbox/le-checkbox.js.map +0 -1
  73. package/dist/collection/components/le-component/le-component.css +0 -189
  74. package/dist/collection/components/le-component/le-component.js.map +0 -1
  75. package/dist/collection/components/le-number-input/le-number-input.css +0 -135
  76. package/dist/collection/components/le-number-input/le-number-input.js +0 -515
  77. package/dist/collection/components/le-number-input/le-number-input.js.map +0 -1
  78. package/dist/collection/components/le-popover/le-popover.css +0 -143
  79. package/dist/collection/components/le-popover/le-popover.js +0 -693
  80. package/dist/collection/components/le-popover/le-popover.js.map +0 -1
  81. package/dist/collection/components/le-popup/le-popup.api.js +0 -101
  82. package/dist/collection/components/le-popup/le-popup.api.js.map +0 -1
  83. package/dist/collection/components/le-popup/le-popup.css +0 -222
  84. package/dist/collection/components/le-popup/le-popup.js +0 -596
  85. package/dist/collection/components/le-popup/le-popup.js.map +0 -1
  86. package/dist/collection/components/le-round-progress/le-round-progress.css +0 -34
  87. package/dist/collection/components/le-round-progress/le-round-progress.js +0 -184
  88. package/dist/collection/components/le-round-progress/le-round-progress.js.map +0 -1
  89. package/dist/collection/components/le-slot/le-slot.default.css +0 -222
  90. package/dist/collection/components/le-slot/le-slot.js.map +0 -1
  91. package/dist/collection/components/le-stack/le-stack.default.css +0 -37
  92. package/dist/collection/components/le-stack/le-stack.js +0 -389
  93. package/dist/collection/components/le-stack/le-stack.js.map +0 -1
  94. package/dist/collection/components/le-string-input/le-string-input.css +0 -83
  95. package/dist/collection/components/le-string-input/le-string-input.js +0 -359
  96. package/dist/collection/components/le-string-input/le-string-input.js.map +0 -1
  97. package/dist/collection/components/le-text/le-text.default.css +0 -169
  98. package/dist/collection/components/le-text/le-text.js +0 -475
  99. package/dist/collection/components/le-text/le-text.js.map +0 -1
  100. package/dist/collection/components/le-turntable/le-turntable.css +0 -10
  101. package/dist/collection/components/le-turntable/le-turntable.js +0 -210
  102. package/dist/collection/components/le-turntable/le-turntable.js.map +0 -1
  103. package/dist/collection/global/app.js +0 -130
  104. package/dist/collection/global/app.js.map +0 -1
  105. package/dist/collection/index.js +0 -15
  106. package/dist/collection/index.js.map +0 -1
  107. package/dist/collection/types/blocks.js +0 -115
  108. package/dist/collection/types/blocks.js.map +0 -1
  109. package/dist/collection/types/options.js +0 -2
  110. package/dist/collection/types/options.js.map +0 -1
  111. package/dist/collection/utils/utils.js +0 -141
  112. package/dist/collection/utils/utils.js.map +0 -1
  113. package/dist/components/index.js +0 -127
  114. package/dist/components/index.js.map +0 -1
  115. package/dist/components/le-box.js +0 -256
  116. package/dist/components/le-box.js.map +0 -1
  117. package/dist/components/le-button.js +0 -9
  118. package/dist/components/le-button.js.map +0 -1
  119. package/dist/components/le-button2.js +0 -1408
  120. package/dist/components/le-button2.js.map +0 -1
  121. package/dist/components/le-card.js +0 -83
  122. package/dist/components/le-card.js.map +0 -1
  123. package/dist/components/le-checkbox.js +0 -9
  124. package/dist/components/le-checkbox.js.map +0 -1
  125. package/dist/components/le-component.js +0 -9
  126. package/dist/components/le-component.js.map +0 -1
  127. package/dist/components/le-number-input.js +0 -271
  128. package/dist/components/le-number-input.js.map +0 -1
  129. package/dist/components/le-popover.js +0 -9
  130. package/dist/components/le-popover.js.map +0 -1
  131. package/dist/components/le-popover2.js.map +0 -1
  132. package/dist/components/le-popup.js +0 -279
  133. package/dist/components/le-popup.js.map +0 -1
  134. package/dist/components/le-round-progress.js +0 -135
  135. package/dist/components/le-round-progress.js.map +0 -1
  136. package/dist/components/le-slot.js +0 -9
  137. package/dist/components/le-slot.js.map +0 -1
  138. package/dist/components/le-stack.js +0 -198
  139. package/dist/components/le-stack.js.map +0 -1
  140. package/dist/components/le-string-input.js +0 -9
  141. package/dist/components/le-string-input.js.map +0 -1
  142. package/dist/components/le-text.js +0 -398
  143. package/dist/components/le-text.js.map +0 -1
  144. package/dist/components/le-turntable.js +0 -164
  145. package/dist/components/le-turntable.js.map +0 -1
  146. package/dist/docs.d.ts +0 -443
  147. package/dist/docs.json +0 -5185
  148. package/dist/esm/index-D71TXvJa.js +0 -1781
  149. package/dist/esm/index-D71TXvJa.js.map +0 -1
  150. package/dist/esm/index.js +0 -106
  151. package/dist/esm/index.js.map +0 -1
  152. package/dist/esm/le-box.entry.js.map +0 -1
  153. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +0 -1
  154. package/dist/esm/le-button_6.entry.js +0 -1192
  155. package/dist/esm/le-card.entry.js.map +0 -1
  156. package/dist/esm/le-kit.js +0 -21
  157. package/dist/esm/le-kit.js.map +0 -1
  158. package/dist/esm/le-number-input.entry.js.map +0 -1
  159. package/dist/esm/le-popup.entry.js.map +0 -1
  160. package/dist/esm/le-round-progress.entry.js.map +0 -1
  161. package/dist/esm/le-stack.entry.js.map +0 -1
  162. package/dist/esm/le-text.entry.js.map +0 -1
  163. package/dist/esm/le-turntable.entry.js.map +0 -1
  164. package/dist/esm/loader.js +0 -11
  165. package/dist/esm/loader.js.map +0 -1
  166. package/dist/esm/utils-CJLZrrdC.js.map +0 -1
  167. package/dist/index.cjs.js +0 -1
  168. package/dist/index.js +0 -1
  169. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +0 -1
  170. package/dist/le-kit/p-024a764e.entry.js +0 -2
  171. package/dist/le-kit/p-024a764e.entry.js.map +0 -1
  172. package/dist/le-kit/p-073cf0b9.entry.js +0 -2
  173. package/dist/le-kit/p-073cf0b9.entry.js.map +0 -1
  174. package/dist/le-kit/p-0955b105.entry.js +0 -2
  175. package/dist/le-kit/p-0955b105.entry.js.map +0 -1
  176. package/dist/le-kit/p-18d79ee2.entry.js +0 -2
  177. package/dist/le-kit/p-18d79ee2.entry.js.map +0 -1
  178. package/dist/le-kit/p-4b1d3b6d.entry.js +0 -2
  179. package/dist/le-kit/p-4b1d3b6d.entry.js.map +0 -1
  180. package/dist/le-kit/p-79d179bd.entry.js +0 -2
  181. package/dist/le-kit/p-79d179bd.entry.js.map +0 -1
  182. package/dist/le-kit/p-D71TXvJa.js +0 -3
  183. package/dist/le-kit/p-D71TXvJa.js.map +0 -1
  184. package/dist/le-kit/p-c8a9288e.entry.js +0 -2
  185. package/dist/le-kit/p-c8a9288e.entry.js.map +0 -1
  186. package/dist/le-kit/p-cfc35bd3.entry.js +0 -2
  187. package/dist/le-kit/p-cfc35bd3.entry.js.map +0 -1
  188. package/dist/le-kit/p-d04da1f5.entry.js +0 -2
  189. package/dist/le-kit/p-d04da1f5.entry.js.map +0 -1
  190. package/dist/le-kit/p-qIai5-eB.js +0 -2
  191. package/dist/le-kit/p-qIai5-eB.js.map +0 -1
  192. package/dist/themes/base.css +0 -89
  193. package/dist/themes/dark.css +0 -100
  194. package/dist/themes/default.css +0 -108
  195. package/dist/themes/gradient.css +0 -100
  196. package/dist/themes/index.css +0 -413
  197. package/dist/themes/minimal.css +0 -100
  198. package/dist/themes/warm.css +0 -100
@@ -1,184 +0,0 @@
1
- import { h } from "@stencil/core";
2
- export class LeRoundProgress {
3
- // host element
4
- el;
5
- // progress value coming from an attribute
6
- value = 0;
7
- updateValue(newValue) {
8
- this.value = parseFloat(newValue);
9
- }
10
- // padding value coming from an attribute
11
- padding = 0;
12
- updatePadding(newValue) {
13
- this.padding = parseFloat(newValue);
14
- this.calcParams();
15
- }
16
- // the progress backgrounds can be as many as needed
17
- // but it should be JSON format: double quotes and strict commas
18
- paths;
19
- updateProgressBackgrounds(newValue) {
20
- this.progressPaths = JSON.parse(newValue);
21
- }
22
- progressPaths;
23
- params;
24
- /**
25
- * Component lifecycles
26
- *
27
- * Before the component is loaded, we need to calculate and update params
28
- * using the component size (width of the round progress)
29
- * and progress width (max of )
30
- */
31
- componentWillLoad() {
32
- if (typeof this.paths === 'string') {
33
- this.updateProgressBackgrounds(this.paths);
34
- }
35
- this.calcParams();
36
- }
37
- calcParams() {
38
- // get element width
39
- const width = this.el.getBoundingClientRect().width;
40
- const diameter = width - this.padding;
41
- // calc circumference — we'll need it later to calc the stroke paths
42
- const circumference = Math.PI * diameter;
43
- this.params = { width, diameter, circumference };
44
- }
45
- /**
46
- * Returns the viewPath attribute value for the SVG
47
- * based on the width of the parent element
48
- */
49
- getViewBox() {
50
- return '0 0 ' + this.params.width + ' ' + this.params.width;
51
- }
52
- /**
53
- * Returns the circular path for the progress stroke
54
- * and additional paths in the background
55
- */
56
- getPath() {
57
- return ('M' +
58
- this.params.width / 2 +
59
- ' ' +
60
- (this.params.width - this.params.diameter) / 2 +
61
- ' a ' +
62
- this.params.diameter / 2 +
63
- ' ' +
64
- this.params.diameter / 2 +
65
- ' 0 0 1 0 ' +
66
- this.params.diameter +
67
- ' a ' +
68
- this.params.diameter / 2 +
69
- ' ' +
70
- this.params.diameter / 2 +
71
- ' 0 0 1 0 -' +
72
- this.params.diameter);
73
- }
74
- getStrokeDashArray() {
75
- return (this.value / 100) * this.params.circumference + ', ' + this.params.circumference;
76
- }
77
- getPaths() {
78
- if (!this.progressPaths || !this.progressPaths.length) {
79
- return null;
80
- }
81
- let paths = [];
82
- this.progressPaths.forEach(bg => {
83
- paths.push(h("path", { class: "round-progress--path", d: this.getPath(), stroke: bg.color, "stroke-width": bg.width, "stroke-dasharray": bg.dasharray, "stroke-linecap": bg.linecap }));
84
- });
85
- return (h("svg", { viewBox: this.getViewBox(), class: "round-progress" }, paths));
86
- }
87
- render() {
88
- return (h("div", { key: '1ffc36704bee5d0822623ac4559ad2d4690095a4', class: "round-progress--container" }, this.getPaths(), h("svg", { key: '12e4dfe5fe2df0cb672d4c001459b8dcc8253591', viewBox: this.getViewBox(), class: "round-progress round-progress--progress" }, h("path", { key: 'd8ce69610687fb578ce2104bd3eccba24951dd96', class: "round-progress--circle", "stroke-dasharray": this.getStrokeDashArray(), d: this.getPath() })), h("slot", { key: '3976b08a7e838579d6af34a778a8756255d98e57' })));
89
- }
90
- static get is() { return "le-round-progress"; }
91
- static get encapsulation() { return "shadow"; }
92
- static get originalStyleUrls() {
93
- return {
94
- "$": ["le-round-progress.css"]
95
- };
96
- }
97
- static get styleUrls() {
98
- return {
99
- "$": ["le-round-progress.css"]
100
- };
101
- }
102
- static get properties() {
103
- return {
104
- "value": {
105
- "type": "number",
106
- "mutable": false,
107
- "complexType": {
108
- "original": "number",
109
- "resolved": "number",
110
- "references": {}
111
- },
112
- "required": false,
113
- "optional": false,
114
- "docs": {
115
- "tags": [],
116
- "text": ""
117
- },
118
- "getter": false,
119
- "setter": false,
120
- "reflect": false,
121
- "attribute": "value",
122
- "defaultValue": "0"
123
- },
124
- "padding": {
125
- "type": "number",
126
- "mutable": false,
127
- "complexType": {
128
- "original": "number",
129
- "resolved": "number",
130
- "references": {}
131
- },
132
- "required": false,
133
- "optional": false,
134
- "docs": {
135
- "tags": [],
136
- "text": ""
137
- },
138
- "getter": false,
139
- "setter": false,
140
- "reflect": false,
141
- "attribute": "padding",
142
- "defaultValue": "0"
143
- },
144
- "paths": {
145
- "type": "string",
146
- "mutable": false,
147
- "complexType": {
148
- "original": "string",
149
- "resolved": "string",
150
- "references": {}
151
- },
152
- "required": false,
153
- "optional": false,
154
- "docs": {
155
- "tags": [],
156
- "text": ""
157
- },
158
- "getter": false,
159
- "setter": false,
160
- "reflect": false,
161
- "attribute": "paths"
162
- }
163
- };
164
- }
165
- static get states() {
166
- return {
167
- "params": {}
168
- };
169
- }
170
- static get elementRef() { return "el"; }
171
- static get watchers() {
172
- return [{
173
- "propName": "value",
174
- "methodName": "updateValue"
175
- }, {
176
- "propName": "padding",
177
- "methodName": "updatePadding"
178
- }, {
179
- "propName": "paths",
180
- "methodName": "updateProgressBackgrounds"
181
- }];
182
- }
183
- }
184
- //# sourceMappingURL=le-round-progress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"le-round-progress.js","sourceRoot":"","sources":["../../../src/components/le-round-progress/le-round-progress.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAO1E,MAAM,OAAO,eAAe;IAC1B,eAAe;IACJ,EAAE,CAAc;IAE3B,0CAA0C;IAClC,KAAK,GAAW,CAAC,CAAC;IAE1B,WAAW,CAAC,QAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,yCAAyC;IACjC,OAAO,GAAW,CAAC,CAAC;IAE5B,aAAa,CAAC,QAAgB;QAC5B,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,oDAAoD;IACpD,gEAAgE;IACxD,KAAK,CAAS;IAEtB,yBAAyB,CAAC,QAAgB;QACxC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IACD,aAAa,CAAQ;IAEZ,MAAM,CAIb;IAEF;;;;;;OAMG;IACH,iBAAiB;QACf,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,UAAU;QACR,oBAAoB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC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CAAC,MAAM,EAAE,CAAC;YACtD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YAC9B,KAAK,CAAC,IAAI,CAAC,YAAM,KAAK,EAAC,sBAAsB,EAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,KAAK,kBAAgB,EAAE,CAAC,KAAK,sBAAoB,EAAE,CAAC,SAAS,oBAAkB,EAAE,CAAC,OAAO,GAAI,CAAC,CAAC;QAC7K,CAAC,CAAC,CAAC;QACH,OAAO,CACL,WAAK,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAC,gBAAgB,IACpD,KAAK,CACF,CACP,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,CACL,4DAAK,KAAK,EAAC,2BAA2B;YACnC,IAAI,CAAC,QAAQ,EAAE;YAChB,4DAAK,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAC,yCAAyC;gBAC9E,6DAAM,KAAK,EAAC,wBAAwB,sBAAmB,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,GAAI,CACnG;YACN,8DAAQ,CACJ,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, h, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'le-round-progress',\n styleUrl: 'le-round-progress.css',\n shadow: true,\n})\nexport class LeRoundProgress {\n // host element\n @Element() el: HTMLElement;\n\n // progress value coming from an attribute\n @Prop() value: number = 0;\n @Watch('value')\n updateValue(newValue: string) {\n this.value = parseFloat(newValue);\n }\n\n // padding value coming from an attribute\n @Prop() padding: number = 0;\n @Watch('padding')\n updatePadding(newValue: string) {\n this.padding = parseFloat(newValue);\n this.calcParams();\n }\n\n // the progress backgrounds can be as many as needed\n // but it should be JSON format: double quotes and strict commas\n @Prop() paths: string;\n @Watch('paths')\n updateProgressBackgrounds(newValue: string) {\n this.progressPaths = JSON.parse(newValue);\n }\n progressPaths: any[];\n\n @State() params: {\n width: number;\n diameter: number;\n circumference: number;\n };\n\n /**\n * Component lifecycles\n *\n * Before the component is loaded, we need to calculate and update params\n * using the component size (width of the round progress)\n * and progress width (max of )\n */\n componentWillLoad() {\n if (typeof this.paths === 'string') {\n this.updateProgressBackgrounds(this.paths);\n }\n this.calcParams();\n }\n\n calcParams() {\n // get element width\n const width = this.el.getBoundingClientRect().width;\n const diameter = width - this.padding;\n // calc circumference — we'll need it later to calc the stroke paths\n const circumference = Math.PI * diameter;\n\n this.params = { width, diameter, circumference };\n }\n\n /**\n * Returns the viewPath attribute value for the SVG\n * based on the width of the parent element\n */\n getViewBox() {\n return '0 0 ' + this.params.width + ' ' + this.params.width;\n }\n\n /**\n * Returns the circular path for the progress stroke\n * and additional paths in the background\n */\n getPath() {\n return (\n 'M' +\n this.params.width / 2 +\n ' ' +\n (this.params.width - this.params.diameter) / 2 +\n ' a ' +\n this.params.diameter / 2 +\n ' ' +\n this.params.diameter / 2 +\n ' 0 0 1 0 ' +\n this.params.diameter +\n ' a ' +\n this.params.diameter / 2 +\n ' ' +\n this.params.diameter / 2 +\n ' 0 0 1 0 -' +\n this.params.diameter\n );\n }\n\n getStrokeDashArray() {\n return (this.value / 100) * this.params.circumference + ', ' + this.params.circumference;\n }\n\n getPaths() {\n if (!this.progressPaths || !this.progressPaths.length) {\n return null;\n }\n let paths = [];\n this.progressPaths.forEach(bg => {\n paths.push(<path class=\"round-progress--path\" d={this.getPath()} stroke={bg.color} stroke-width={bg.width} stroke-dasharray={bg.dasharray} stroke-linecap={bg.linecap} />);\n });\n return (\n <svg viewBox={this.getViewBox()} class=\"round-progress\">\n {paths}\n </svg>\n );\n }\n\n render() {\n return (\n <div class=\"round-progress--container\">\n {this.getPaths()}\n <svg viewBox={this.getViewBox()} class=\"round-progress round-progress--progress\">\n <path class=\"round-progress--circle\" stroke-dasharray={this.getStrokeDashArray()} d={this.getPath()} />\n </svg>\n <slot />\n </div>\n );\n }\n}\n"]}
@@ -1,222 +0,0 @@
1
- /**
2
- * Styles for le-slot component
3
- * Uses :host(.admin-mode) to toggle between default and admin styles
4
- */
5
-
6
- /* ============================================
7
- DEFAULT MODE - Invisible passthrough
8
- ============================================ */
9
- :host {
10
- display: contents;
11
- --le-slot-border-color: #0088ff;
12
- --le-slot-bg-color: rgba(0, 136, 255, 0.05);
13
- --le-slot-header-bg: rgb(218, 238, 255);
14
- --le-slot-label-color: #0066cc;
15
- --le-slot-description-color: #666;
16
- --le-slot-required-color: #e53935;
17
- --le-slot-dropzone-min-height: 20px;
18
- --le-slot-dropzone-border-color: #ccc;
19
- }
20
-
21
- .le-slot-container,
22
- .le-slot-header,
23
- .le-slot-description,
24
- .le-slot-dropzone,
25
- .le-slot-input {
26
- display: none;
27
- }
28
-
29
- /* Hidden slot wrapper - keeps slot in DOM but invisible */
30
- .hidden-slot {
31
- display: none;
32
- }
33
-
34
- /* ============================================
35
- ADMIN MODE - Visible placeholder UI
36
- ============================================ */
37
- :host(.admin-mode) {
38
- display: block;
39
- flex: 1;
40
- }
41
-
42
- :host(.admin-mode) .le-slot-container {
43
- position: relative;
44
- display: flex;
45
- flex-direction: column;
46
- border: 2px dashed var(--le-slot-border-color);
47
- border-radius: 4px;
48
- background: var(--le-slot-bg-color);
49
- margin: 4px 0;
50
- }
51
-
52
- :host(.admin-mode) .le-slot-header {
53
- display: flex;
54
- align-items: center;
55
- gap: 4px;
56
- padding: 0 0 0 var(--le-spacing-1, 4px);
57
- background: var(--le-slot-header-bg);
58
- border-bottom: 1px solid var(--le-slot-border-color);
59
- font-size: var(--le-font-size-xs, 11px);
60
- font-weight: 400;
61
- text-transform: capitalize;
62
- }
63
- :host(.admin-mode) .le-slot-header-no-label {
64
- justify-content: flex-end;
65
- height: 16px;
66
- border: none;
67
- background-color: transparent;
68
- }
69
-
70
- .le-slot-label {
71
- color: var(--le-slot-label-color);
72
- text-align: start;
73
- overflow: hidden;
74
- width: 0;
75
- flex: 1 1 0%;
76
- }
77
-
78
- .le-slot-required {
79
- color: var(--le-slot-required-color);
80
- font-weight: bold;
81
- }
82
-
83
- :host(.admin-mode) .le-slot-description {
84
- display: block;
85
- padding: 4px 8px;
86
- font-size: 12px;
87
- color: var(--le-slot-description-color);
88
- font-style: italic;
89
- }
90
- :host(.admin-mode) .le-slot-description-icon {
91
- display: inline-block;
92
- font-size: 9px;
93
- line-height: 1;
94
- cursor: pointer;
95
- color: var(--le-slot-description-color);
96
- }
97
-
98
- :host(.admin-mode) .le-slot-dropzone {
99
- display: block;
100
- min-height: var(--le-slot-dropzone-min-height);
101
- padding: var(--le-spacing-1, 4px);
102
- position: relative;
103
- }
104
-
105
- :host(.admin-mode) .le-slot-dropzone:empty::before {
106
- content: 'Drop content here';
107
- display: flex;
108
- align-items: center;
109
- justify-content: center;
110
- position: absolute;
111
- inset: 8px;
112
- border: 2px dashed var(--le-slot-dropzone-border-color);
113
- border-radius: 4px;
114
- color: #999;
115
- font-size: 12px;
116
- pointer-events: none;
117
- }
118
-
119
- /* Highlight when dragging over */
120
- :host(.admin-mode.drag-over) .le-slot-container {
121
- border-color: #00cc66;
122
- background: rgba(0, 204, 102, 0.1);
123
- }
124
-
125
- :host(.admin-mode.drag-over) .le-slot-dropzone:empty::before {
126
- border-color: #00cc66;
127
- color: #00cc66;
128
- content: 'Release to drop';
129
- }
130
-
131
- /* ============================================
132
- TEXT INPUT STYLES (Admin mode)
133
- ============================================ */
134
- :host(.admin-mode) .le-slot-input {
135
- display: block;
136
- padding: var(--le-spacing-1, 4px);
137
- }
138
-
139
- :host(.admin-mode) .le-slot-input input,
140
- :host(.admin-mode) .le-slot-input textarea {
141
- display: block;
142
- width: 100%;
143
- padding: 8px 10px;
144
- border: 1px solid var(--le-slot-dropzone-border-color);
145
- border-radius: 4px;
146
- font-family: inherit;
147
- font-size: 14px;
148
- line-height: 1.4;
149
- background: #fff;
150
- color: #333;
151
- box-sizing: border-box;
152
- transition: border-color 0.2s, box-shadow 0.2s;
153
- }
154
-
155
- :host(.admin-mode) .le-slot-input input:focus,
156
- :host(.admin-mode) .le-slot-input textarea:focus {
157
- outline: none;
158
- border-color: var(--le-slot-border-color);
159
- box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.15);
160
- }
161
-
162
- :host(.admin-mode) .le-slot-input input::placeholder,
163
- :host(.admin-mode) .le-slot-input textarea::placeholder {
164
- color: #999;
165
- }
166
-
167
- :host(.admin-mode) .le-slot-input textarea {
168
- resize: vertical;
169
- min-height: 60px;
170
- }
171
-
172
- /* Hide the slot content in text/textarea mode - it's just for default value */
173
- :host(.admin-mode) .le-slot-input slot {
174
- display: none;
175
- }
176
-
177
- /* ============================================
178
- INVALID HTML STATE
179
- ============================================ */
180
- .le-slot-invalid {
181
- color: var(--le-slot-required-color);
182
- font-size: 10px;
183
- margin-left: auto;
184
- font-weight: normal;
185
- text-transform: none;
186
- }
187
-
188
- :host(.admin-mode) .le-slot-input.has-error input,
189
- :host(.admin-mode) .le-slot-input.has-error textarea {
190
- border-color: var(--le-slot-required-color);
191
- background: rgba(229, 57, 53, 0.05);
192
- }
193
-
194
- :host(.admin-mode) .le-slot-input.has-error input:focus,
195
- :host(.admin-mode) .le-slot-input.has-error textarea:focus {
196
- border-color: var(--le-slot-required-color);
197
- box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
198
- }
199
-
200
-
201
- /* ========================================
202
- Component Picker (Add Button & Popover)
203
- ======================================== */
204
- .le-slot-add-btn {
205
- font-size: 24px;
206
- line-height: 0px;
207
- width: 12px;
208
- height: 12px;
209
- }
210
-
211
- .le-slot-header-no-label .le-slot-add-btn {
212
- font-size: 16px;
213
- }
214
-
215
- .le-slot-button {
216
- width: 20px;
217
- height: 20px;
218
- }
219
-
220
- :host(.admin-mode) .le-slot-header-no-label.le-slot-header-text {
221
- height: 0;
222
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"le-slot.js","sourceRoot":"","sources":["../../../src/components/le-slot/le-slot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AAMH,MAAM,OAAO,MAAM;IACN,EAAE,CAAc;IAE3B;;;;;OAKG;IACK,IAAI,GAAiC,MAAM,CAAC;IAEpD;;;OAGG;IACK,IAAI,GAAW,EAAE,CAAC;IAE1B;;;OAGG;IACK,KAAK,CAAU;IAEvB;;;OAGG;IACK,WAAW,CAAU;IAE7B;;;;;OAKG;IACK,iBAAiB,CAAU;IAEnC;;OAEG;IACK,QAAQ,GAAY,IAAI,CAAC;IAEjC;;OAEG;IACK,QAAQ,GAAY,KAAK,CAAC;IAElC;;OAEG;IACK,WAAW,CAAU;IAE7B;;;;;;OAMG;IACK,GAAG,CAAU;IAErB;;;;OAIG;IACK,SAAS,CAAU;IAE3B;;OAEG;IACc,SAAS,GAAY,KAAK,CAAC;IAE5C;;OAEG;IACc,SAAS,GAAW,EAAE,CAAC;IAExC;;OAEG;IACc,WAAW,GAAY,IAAI,CAAC;IAE7C;;OAEG;IACc,mBAAmB,GAAoB,EAAE,CAAC;IAE3D;;OAEG;IACc,UAAU,GAAY,KAAK,CAAC;IAE7C;;OAEG;IACK,OAAO,CAAmB;IAElC;;OAEG;IACK,cAAc,CAAW;IAEjC;;;OAGG;IACM,YAAY,CAAkE;IAE/E,sBAAsB,CAAc;IAE5C,iBAAiB;QACf,IAAI,CAAC,sBAAsB,GAAG,kBAAkB,CAAC,IAAI,C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ACP,CAAC;QACN,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h, Host, Element, Event, EventEmitter } from '@stencil/core';\nimport { classnames, observeModeChanges } from '../../utils/utils';\n\n/**\n * Slot placeholder component for admin/CMS mode.\n *\n * This component renders a visual placeholder for slots when in admin mode,\n * allowing CMS systems to show available drop zones for content or inline editing.\n *\n * In non-admin mode, this component renders nothing and acts as a passthrough.\n *\n * @slot - Default slot for placeholder content or drop zone UI\n *\n * @cmsInternal true\n * @cmsCategory System\n */\n@Component({\n tag: 'le-slot',\n styleUrl: 'le-slot.default.css',\n shadow: true,\n})\nexport class LeSlot {\n @Element() el: HTMLElement;\n\n /**\n * The type of slot content.\n * - `slot`: Default, shows a dropzone for components (default)\n * - `text`: Shows a single-line text input\n * - `textarea`: Shows a multi-line text area\n */\n @Prop() type: 'slot' | 'text' | 'textarea' = 'slot';\n\n /**\n * The name of the slot this placeholder represents.\n * Should match the slot name in the parent component.\n */\n @Prop() name: string = '';\n\n /**\n * Label to display in admin mode.\n * If not provided, the slot name will be used.\n */\n @Prop() label?: string;\n\n /**\n * Description of what content this slot accepts.\n * Shown in admin mode to guide content editors.\n */\n @Prop() description?: string;\n\n /**\n * Comma-separated list of allowed component tags for this slot.\n * Used by CMS to filter available components.\n *\n * @example \"le-card,le-button,le-text\"\n */\n @Prop() allowedComponents?: string;\n\n /**\n * Whether multiple components can be dropped in this slot.\n */\n @Prop() multiple: boolean = true;\n\n /**\n * Whether this slot is required to have content.\n */\n @Prop() required: boolean = false;\n\n /**\n * Placeholder text for text/textarea inputs in admin mode.\n */\n @Prop() placeholder?: string;\n\n /**\n * The HTML tag to create when there's no slotted element.\n * Used with type=\"text\" or type=\"textarea\" to auto-create elements.\n * \n * @example \"h3\" - creates <h3 slot=\"header\">content</h3>\n * @example \"p\" - creates <p slot=\"content\">content</p>\n */\n @Prop() tag?: string;\n\n /**\n * CSS styles for the slot dropzone container.\n * Useful for layouts - e.g., \"flex-direction: row\" for horizontal stacks.\n * Only applies in admin mode for type=\"slot\".\n */\n @Prop() slotStyle?: string;\n\n /**\n * Internal state to track admin mode\n */\n @State() private adminMode: boolean = false;\n\n /**\n * Internal state for text input value (synced from slot content)\n */\n @State() private textValue: string = '';\n\n /**\n * Whether the current textValue contains valid HTML\n */\n @State() private isValidHtml: boolean = true;\n\n /**\n * Available components loaded from Custom Elements Manifest\n */\n @State() private availableComponents: ComponentInfo[] = [];\n\n /**\n * Whether the component picker popover is open\n */\n @State() private pickerOpen: boolean = false;\n\n /**\n * Reference to the slot element to access assignedNodes\n */\n private slotRef?: HTMLSlotElement;\n\n /**\n * The original slotted element (e.g., <h3 slot=\"header\">)\n */\n private slottedElement?: Element;\n\n /**\n * Emitted when text content changes in admin mode.\n * The event detail contains the new text value and validity.\n */\n @Event() leSlotChange: EventEmitter<{ name: string; value: string; isValid: boolean }>;\n\n private disconnectModeObserver?: () => void;\n\n connectedCallback() {\n this.disconnectModeObserver = observeModeChanges(this.el, (mode) => {\n const wasAdmin = this.adminMode;\n this.adminMode = mode === 'admin';\n \n // When entering admin mode, read content from slotted elements\n if (this.adminMode && !wasAdmin) {\n // Need to wait for render to access slot ref\n requestAnimationFrame(() => this.readSlottedContent());\n \n // Load available components for the component picker\n if (this.type === 'slot') {\n this.loadAvailableComponents();\n }\n }\n });\n }\n\n disconnectedCallback() {\n this.disconnectModeObserver?.();\n }\n\n /**\n * Flag to prevent re-reading content right after we updated it\n */\n private isUpdating: boolean = false;\n\n /**\n * Read content from slotted elements via assignedNodes()\n */\n private readSlottedContent() {\n if (!this.slotRef) return;\n \n // Skip if we just updated the content ourselves\n if (this.isUpdating) {\n this.isUpdating = false;\n return;\n }\n\n const assignedNodes = this.slotRef.assignedNodes({ flatten: true });\n \n // For text/textarea types, we want to edit the innerHTML of slotted elements\n if (this.type === 'text' || this.type === 'textarea') {\n // Find the first element node (skip text nodes that are just whitespace)\n const elementNode = assignedNodes.find(\n node => node.nodeType === Node.ELEMENT_NODE\n ) as Element | undefined;\n\n if (elementNode) {\n // Only update textValue if slotted element changed or we don't have one yet\n if (this.slottedElement !== elementNode) {\n this.slottedElement = elementNode;\n this.textValue = elementNode.innerHTML?.trim() || '';\n // console.log(`[le-slot \"${this.name}\"] Read slotted content:`, this.textValue);\n }\n } else {\n // No element, check for direct text content\n const textContent = assignedNodes\n .filter(node => node.nodeType === Node.TEXT_NODE)\n .map(node => node.textContent)\n .join('')\n .trim();\n \n if (textContent && !this.textValue) {\n this.textValue = textContent;\n // console.log(`[le-slot \"${this.name}\"] Read text content:`, this.textValue);\n }\n }\n }\n }\n\n /**\n * Validates if a string contains valid HTML\n */\n private validateHtml(html: string): boolean {\n // Empty string is valid\n if (!html.trim()) return true;\n \n // Create a template element to parse the HTML\n const template = document.createElement('template');\n template.innerHTML = html;\n \n // Check that we don't have obviously broken HTML\n // Count opening and closing tags for common elements\n const openTags = (html.match(/<[a-z][^>]*(?<!\\/)>/gi) || []).length;\n const closeTags = (html.match(/<\\/[a-z][^>]*>/gi) || []).length;\n const selfClosing = (html.match(/<[a-z][^>]*\\/>/gi) || []).length;\n \n // Simple validation: opening tags (minus self-closing) should roughly match closing tags\n // Allow some tolerance for void elements like <br>, <img>, etc.\n const voidElements = (html.match(/<(br|hr|img|input|meta|link|area|base|col|embed|param|source|track|wbr)[^>]*>/gi) || []).length;\n \n const effectiveOpenTags = openTags - selfClosing - voidElements;\n \n // If difference is too large, HTML is likely broken\n if (Math.abs(effectiveOpenTags - closeTags) > 1) {\n return false;\n }\n \n return true;\n }\n\n private handleTextInput = (event: Event) => {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n this.textValue = target.value;\n this.isValidHtml = this.validateHtml(this.textValue);\n\n if (this.isValidHtml) {\n // Set flag to prevent slotchange from re-reading what we just wrote\n this.isUpdating = true;\n\n console.log('Updating text value:', this.textValue, 'slottedElement:', this.slottedElement);\n\n if (this.slottedElement) {\n // Update existing slotted element's innerHTML\n this.slottedElement.innerHTML = this.textValue;\n } else if (this.tag && this.textValue) {\n // No slotted element exists\n // If the slot doesn't have a name, then it's the default slot\n // remove the existing non-slotted content (text nodes and elements without slot attribute)\n const rootNode = this.el.getRootNode();\n if (!this.name && rootNode instanceof ShadowRoot) {\n const hostComponent = rootNode.host;\n Array.from(hostComponent.childNodes).forEach(node => {\n if (node.nodeType === Node.TEXT_NODE || \n (node.nodeType === Node.ELEMENT_NODE && !(node as Element).hasAttribute('slot'))) {\n node.remove();\n }\n });\n }\n // create one using the specified tag\n this.createSlottedElement();\n } else if (this.textValue) {\n // no tag specified - just replace everything in the host component\n const rootNode = this.el.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n const hostComponent = rootNode.host;\n hostComponent.innerHTML = this.textValue;\n }\n }\n }\n \n this.leSlotChange.emit({ \n name: this.name, \n value: this.textValue,\n isValid: this.isValidHtml \n });\n };\n\n /**\n * Create a new slotted element when none exists.\n * The element is appended to the host component's light DOM.\n */\n private createSlottedElement() {\n if (!this.tag) return;\n \n // Find the host component (le-card, etc.) by traversing up through shadow DOM\n // le-slot is inside le-card's shadow DOM, so we need to find le-card's host\n const rootNode = this.el.getRootNode();\n if (!(rootNode instanceof ShadowRoot)) return;\n \n const hostComponent = rootNode.host;\n if (!hostComponent) return;\n \n // Create the new element\n const newElement = document.createElement(this.tag);\n newElement.innerHTML = this.textValue;\n \n // Set the slot attribute if this is a named slot\n if (this.name) {\n newElement.setAttribute('slot', this.name);\n }\n \n // Append to the host component's light DOM\n hostComponent.appendChild(newElement);\n \n // Store reference to the new element\n this.slottedElement = newElement;\n \n // console.log(`[le-slot \"${this.name}\"] Created new <${this.tag}> element`);\n }\n\n /**\n * Load available components from Custom Elements Manifest\n */\n private async loadAvailableComponents() {\n try {\n const response = await fetch('/custom-elements.json');\n const manifest = await response.json();\n \n const components: ComponentInfo[] = [];\n const allowedList = this.allowedComponents?.split(',').map(s => s.trim()) || [];\n \n for (const module of manifest.modules) {\n for (const declaration of module.declarations || []) {\n if (declaration.tagName && declaration.customElement) {\n // Skip internal components (le-slot, le-component, le-popover)\n const isInternal = ['le-slot', 'le-component', 'le-popover'].includes(declaration.tagName);\n if (isInternal) continue;\n \n // If allowedComponents is specified, filter by it\n if (allowedList.length > 0 && !allowedList.includes(declaration.tagName)) {\n continue;\n }\n \n components.push({\n tagName: declaration.tagName,\n name: this.formatComponentName(declaration.tagName),\n description: declaration.description || '',\n });\n }\n }\n }\n \n this.availableComponents = components;\n } catch (error) {\n console.warn('[le-slot] Failed to load component manifest:', error);\n }\n }\n\n /**\n * Format a tag name into a display name\n * e.g., 'le-card' -> 'Card'\n */\n private formatComponentName(tagName: string): string {\n return tagName\n .replace(/^le-/, '')\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n }\n\n /**\n * Add a new component to the slot\n */\n private addComponent(tagName: string) {\n // Find the host component by traversing up through shadow DOM\n const rootNode = this.el.getRootNode();\n if (!(rootNode instanceof ShadowRoot)) return;\n \n const hostComponent = rootNode.host;\n if (!hostComponent) return;\n \n // Create the new component element\n const newElement = document.createElement(tagName);\n \n // Set the slot attribute if this is a named slot\n if (this.name) {\n newElement.setAttribute('slot', this.name);\n }\n \n // Append to the host component's light DOM\n hostComponent.appendChild(newElement);\n \n // Emit change event so the page can save\n this.leSlotChange.emit({\n name: this.name,\n value: hostComponent.innerHTML,\n isValid: true,\n });\n }\n\n /**\n * Handle slot change event to re-read content when nodes are assigned\n */\n private handleSlotChange = () => {\n this.readSlottedContent();\n };\n\n render() {\n const displayLabel = this.label || this.name;\n\n // Always render the same structure, CSS handles visibility via .admin-mode class\n return (\n <Host\n class={{ \n 'admin-mode': this.adminMode,\n 'invalid-html': !this.isValidHtml \n }}\n role={this.adminMode ? 'region' : undefined}\n aria-label={this.adminMode ? `Slot: ${displayLabel}` : undefined}\n data-slot-name={this.name}\n data-slot-type={this.type}\n data-allowed={this.allowedComponents}\n data-multiple={this.multiple}\n data-required={this.required}\n >\n {this.adminMode ? (\n <div class=\"le-slot-container\">\n <div class={classnames('le-slot-header', {\n 'le-slot-header-no-label': !displayLabel,\n 'le-slot-header-text': this.type === 'text',\n 'le-slot-header-error': !this.isValidHtml\n })}>\n {displayLabel && (\n <span class=\"le-slot-label\">\n {displayLabel}\n {this.required && <span class=\"le-slot-required\">*</span>}\n </span>\n )}\n {/* {this.description && <le-popover mode=\"default\" showClose={false} align=\"end\" position=\"bottom\">\n <span slot=\"trigger\" class=\"le-slot-description-icon\">ℹ️</span>\n {this.description}\n </le-popover>} */}\n {!this.isValidHtml && <span class=\"le-slot-invalid\">⚠ Invalid HTML</span>}\n {this.type === 'slot' && this.adminMode && (\n <le-popover \n mode=\"default\"\n showClose={true}\n align=\"start\"\n position=\"right\"\n popoverTitle=\"Add Component\"\n open={this.pickerOpen}\n onLePopoverOpen={() => this.pickerOpen = true}\n onLePopoverClose={() => this.pickerOpen = false}\n >\n <le-button\n type=\"button\"\n class=\"le-slot-button\"\n slot=\"trigger\"\n variant=\"clear\"\n size=\"small\"\n aria-label=\"Add component\"\n icon-only\n >\n <span class=\"le-slot-add-btn\" slot=\"icon-only\">+</span>\n </le-button>\n <div class=\"le-slot-picker\">\n {this.availableComponents.length > 0 ? (\n <ul class=\"le-slot-picker-list\">\n {this.availableComponents.map(component => (\n <li key={component.tagName}>\n <button\n class=\"le-slot-picker-item\"\n onClick={() => {\n this.addComponent(component.tagName);\n this.pickerOpen = false;\n }}\n >\n <span class=\"le-slot-picker-name\">{component.name}</span>\n {component.description && (\n <span class=\"le-slot-picker-desc\">{component.description}</span>\n )}\n </button>\n </li>\n ))}\n </ul>\n ) : (\n <div class=\"le-slot-picker-empty\">No components available</div>\n )}\n </div>\n </le-popover>\n )}\n </div>\n {this.renderContent()}\n </div>\n ) : (\n // In default mode, just pass through the slot - slotted content renders naturally\n // Note: We use unnamed slot here because named slots from parent component\n // are passed as le-slot's light DOM children\n <slot \n // ref={(el) => this.slotRef = el as HTMLSlotElement}\n // onSlotchange={this.handleSlotChange}\n ></slot>\n )}\n </Host>\n );\n }\n\n private renderContent() {\n // Create the slot element with ref for reading assignedNodes\n // Wrap in a hidden div since slot elements can't have style prop in Stencil\n // Note: We use unnamed slot here because named slots from parent component\n // are passed as le-slot's light DOM children\n const slotElement = (\n <div class=\"hidden-slot\">\n <slot \n ref={(el) => this.slotRef = el as HTMLSlotElement}\n onSlotchange={this.handleSlotChange}\n ></slot>\n </div>\n );\n\n switch (this.type) {\n case 'text':\n return (\n <div class={{ 'le-slot-input': true, 'has-error': !this.isValidHtml }}>\n <le-string-input\n mode=\"default\"\n value={this.textValue}\n placeholder={this.placeholder || `Enter ${this.label || this.name || 'text'}...`}\n onChange={this.handleTextInput}\n // required={this.required}\n ></le-string-input>\n {slotElement}\n </div>\n );\n\n case 'textarea':\n return (\n <div class={{ 'le-slot-input': true, 'has-error': !this.isValidHtml }}>\n <textarea\n value={this.textValue}\n placeholder={this.placeholder || `Enter ${this.label || this.name || 'text'}...`}\n onInput={this.handleTextInput}\n required={this.required}\n rows={3}\n ></textarea>\n {slotElement}\n </div>\n );\n\n case 'slot':\n default:\n // Parse slotStyle string into style object if provided\n const dropzoneStyle: { [key: string]: string } = {};\n if (this.slotStyle) {\n this.slotStyle.split(';').forEach(rule => {\n const [prop, value] = rule.split(':').map(s => s.trim());\n if (prop && value) {\n // Convert kebab-case to camelCase for style object\n const camelProp = prop.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());\n dropzoneStyle[camelProp] = value;\n }\n });\n }\n return (\n <div class=\"le-slot-dropzone\" style={dropzoneStyle}>\n <slot \n ref={(el) => this.slotRef = el as HTMLSlotElement}\n onSlotchange={this.handleSlotChange}\n ></slot>\n </div>\n );\n }\n }\n}\n\n/**\n * Component info from the manifest\n */\ninterface ComponentInfo {\n tagName: string;\n name: string;\n description: string;\n}\n"]}
@@ -1,37 +0,0 @@
1
- /**
2
- * le-stack default styles
3
- *
4
- * The component uses inline styles for flex properties to allow
5
- * dynamic prop-based configuration. This CSS handles theming.
6
- */
7
-
8
- :host {
9
- display: block;
10
- }
11
-
12
- :host([hidden]) {
13
- display: none;
14
- }
15
-
16
- /* Base stack container */
17
- .stack {
18
- gap: var(--le-stack-gap, var(--le-space-md));
19
- }
20
-
21
- /* Full width/height variants */
22
- :host(.full-width) {
23
- width: 100%;
24
- }
25
-
26
- :host(.full-height) {
27
- height: 100%;
28
- }
29
-
30
- /* Direction-specific defaults */
31
- :host(.direction-horizontal) .stack {
32
- min-height: 0;
33
- }
34
-
35
- :host(.direction-vertical) .stack {
36
- min-width: 0;
37
- }