le-kit 0.1.5 → 0.1.7

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 (201) hide show
  1. package/{dist/le-kit/assets/custom-elements.json → custom-elements.json} +833 -833
  2. package/dist/cjs/index-D7B9TPh8.js +1835 -0
  3. package/dist/cjs/index-D7B9TPh8.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +119 -0
  5. package/dist/cjs/index.cjs.js.map +1 -0
  6. package/dist/cjs/le-box.cjs.entry.js +184 -0
  7. package/dist/cjs/le-box.entry.cjs.js.map +1 -0
  8. package/dist/cjs/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.cjs.js.map +1 -0
  9. package/dist/cjs/le-button_6.cjs.entry.js +1200 -0
  10. package/dist/cjs/le-card.cjs.entry.js +29 -0
  11. package/dist/cjs/le-card.entry.cjs.js.map +1 -0
  12. package/dist/cjs/le-kit.cjs.js +25 -0
  13. package/dist/cjs/le-kit.cjs.js.map +1 -0
  14. package/dist/cjs/le-number-input.cjs.entry.js +202 -0
  15. package/dist/cjs/le-number-input.entry.cjs.js.map +1 -0
  16. package/dist/cjs/le-popup.cjs.entry.js +212 -0
  17. package/dist/cjs/le-popup.entry.cjs.js.map +1 -0
  18. package/dist/cjs/le-round-progress.cjs.entry.js +106 -0
  19. package/dist/cjs/le-round-progress.entry.cjs.js.map +1 -0
  20. package/dist/cjs/le-stack.cjs.entry.js +135 -0
  21. package/dist/cjs/le-stack.entry.cjs.js.map +1 -0
  22. package/dist/cjs/le-text.cjs.entry.js +335 -0
  23. package/dist/cjs/le-text.entry.cjs.js.map +1 -0
  24. package/dist/cjs/le-turntable.cjs.entry.js +139 -0
  25. package/dist/cjs/le-turntable.entry.cjs.js.map +1 -0
  26. package/dist/cjs/loader.cjs.js +13 -0
  27. package/dist/cjs/loader.cjs.js.map +1 -0
  28. package/dist/cjs/utils-DrsoID-a.js +152 -0
  29. package/dist/cjs/utils-DrsoID-a.js.map +1 -0
  30. package/dist/collection/collection-manifest.json +26 -0
  31. package/dist/collection/components/le-box/le-box.default.css +37 -0
  32. package/dist/collection/components/le-box/le-box.js +614 -0
  33. package/dist/collection/components/le-box/le-box.js.map +1 -0
  34. package/dist/collection/components/le-button/le-button.default.css +263 -0
  35. package/dist/collection/components/le-button/le-button.js +368 -0
  36. package/dist/collection/components/le-button/le-button.js.map +1 -0
  37. package/dist/collection/components/le-card/le-card.default.css +74 -0
  38. package/dist/collection/components/le-card/le-card.js +102 -0
  39. package/dist/collection/components/le-card/le-card.js.map +1 -0
  40. package/dist/collection/components/le-checkbox/le-checkbox.css +93 -0
  41. package/dist/collection/components/le-checkbox/le-checkbox.js +192 -0
  42. package/dist/collection/components/le-checkbox/le-checkbox.js.map +1 -0
  43. package/dist/collection/components/le-component/le-component.css +189 -0
  44. package/dist/{le-kit/le-component.entry.js → collection/components/le-component/le-component.js} +141 -24
  45. package/dist/collection/components/le-component/le-component.js.map +1 -0
  46. package/dist/collection/components/le-number-input/le-number-input.css +135 -0
  47. package/dist/collection/components/le-number-input/le-number-input.js +515 -0
  48. package/dist/collection/components/le-number-input/le-number-input.js.map +1 -0
  49. package/dist/collection/components/le-popover/le-popover.css +143 -0
  50. package/dist/collection/components/le-popover/le-popover.js +693 -0
  51. package/dist/collection/components/le-popover/le-popover.js.map +1 -0
  52. package/dist/collection/components/le-popup/le-popup.api.js +101 -0
  53. package/dist/collection/components/le-popup/le-popup.api.js.map +1 -0
  54. package/dist/collection/components/le-popup/le-popup.css +222 -0
  55. package/dist/collection/components/le-popup/le-popup.js +596 -0
  56. package/dist/collection/components/le-popup/le-popup.js.map +1 -0
  57. package/dist/collection/components/le-round-progress/le-round-progress.css +34 -0
  58. package/dist/collection/components/le-round-progress/le-round-progress.js +184 -0
  59. package/dist/collection/components/le-round-progress/le-round-progress.js.map +1 -0
  60. package/dist/collection/components/le-slot/le-slot.default.css +222 -0
  61. package/dist/{le-kit/le-slot.entry.js → collection/components/le-slot/le-slot.js} +270 -20
  62. package/dist/collection/components/le-slot/le-slot.js.map +1 -0
  63. package/dist/collection/components/le-stack/le-stack.default.css +37 -0
  64. package/dist/collection/components/le-stack/le-stack.js +389 -0
  65. package/dist/collection/components/le-stack/le-stack.js.map +1 -0
  66. package/dist/collection/components/le-string-input/le-string-input.css +83 -0
  67. package/dist/collection/components/le-string-input/le-string-input.js +359 -0
  68. package/dist/collection/components/le-string-input/le-string-input.js.map +1 -0
  69. package/dist/collection/components/le-text/le-text.default.css +169 -0
  70. package/dist/collection/components/le-text/le-text.js +475 -0
  71. package/dist/collection/components/le-text/le-text.js.map +1 -0
  72. package/dist/collection/components/le-turntable/le-turntable.css +10 -0
  73. package/dist/collection/components/le-turntable/le-turntable.js +210 -0
  74. package/dist/collection/components/le-turntable/le-turntable.js.map +1 -0
  75. package/dist/collection/global/app.js +167 -0
  76. package/dist/collection/global/app.js.map +1 -0
  77. package/dist/collection/index.js +15 -0
  78. package/dist/collection/index.js.map +1 -0
  79. package/dist/collection/types/blocks.js +115 -0
  80. package/dist/collection/types/blocks.js.map +1 -0
  81. package/dist/collection/types/options.js +2 -0
  82. package/dist/collection/types/options.js.map +1 -0
  83. package/dist/collection/utils/utils.js +141 -0
  84. package/dist/collection/utils/utils.js.map +1 -0
  85. package/dist/components/index.js +127 -0
  86. package/dist/components/index.js.map +1 -0
  87. package/dist/components/le-box.js +256 -0
  88. package/dist/components/le-box.js.map +1 -0
  89. package/dist/components/le-button.js +9 -0
  90. package/dist/components/le-button.js.map +1 -0
  91. package/dist/components/le-button2.js +1446 -0
  92. package/dist/components/le-button2.js.map +1 -0
  93. package/dist/components/le-card.js +83 -0
  94. package/dist/components/le-card.js.map +1 -0
  95. package/dist/components/le-checkbox.js +9 -0
  96. package/dist/components/le-checkbox.js.map +1 -0
  97. package/dist/components/le-component.js +9 -0
  98. package/dist/components/le-component.js.map +1 -0
  99. package/dist/components/le-number-input.js +271 -0
  100. package/dist/components/le-number-input.js.map +1 -0
  101. package/dist/components/le-popover.js +9 -0
  102. package/dist/components/le-popover.js.map +1 -0
  103. package/dist/{le-kit/le-popover.entry.js → components/le-popover2.js} +45 -9
  104. package/dist/components/le-popover2.js.map +1 -0
  105. package/dist/components/le-popup.js +279 -0
  106. package/dist/components/le-popup.js.map +1 -0
  107. package/dist/components/le-round-progress.js +135 -0
  108. package/dist/components/le-round-progress.js.map +1 -0
  109. package/dist/components/le-slot.js +9 -0
  110. package/dist/components/le-slot.js.map +1 -0
  111. package/dist/components/le-stack.js +198 -0
  112. package/dist/components/le-stack.js.map +1 -0
  113. package/dist/components/le-string-input.js +9 -0
  114. package/dist/components/le-string-input.js.map +1 -0
  115. package/dist/components/le-text.js +398 -0
  116. package/dist/components/le-text.js.map +1 -0
  117. package/dist/components/le-turntable.js +164 -0
  118. package/dist/components/le-turntable.js.map +1 -0
  119. package/dist/docs.d.ts +443 -0
  120. package/dist/docs.json +5185 -0
  121. package/dist/esm/index-PS-3Rz-c.js +1818 -0
  122. package/dist/esm/index-PS-3Rz-c.js.map +1 -0
  123. package/dist/esm/index.js +106 -0
  124. package/dist/esm/index.js.map +1 -0
  125. package/dist/{le-kit → esm}/le-box.entry.js +3 -3
  126. package/dist/esm/le-box.entry.js.map +1 -0
  127. package/dist/esm/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.js.map +1 -0
  128. package/dist/esm/le-button_6.entry.js +1193 -0
  129. package/dist/{le-kit → esm}/le-card.entry.js +3 -3
  130. package/dist/esm/le-card.entry.js.map +1 -0
  131. package/dist/esm/le-kit.js +21 -0
  132. package/dist/esm/le-kit.js.map +1 -0
  133. package/dist/{le-kit → esm}/le-number-input.entry.js +5 -5
  134. package/dist/esm/le-number-input.entry.js.map +1 -0
  135. package/dist/{le-kit → esm}/le-popup.entry.js +6 -6
  136. package/dist/esm/le-popup.entry.js.map +1 -0
  137. package/dist/{le-kit → esm}/le-round-progress.entry.js +2 -2
  138. package/dist/esm/le-round-progress.entry.js.map +1 -0
  139. package/dist/{le-kit → esm}/le-stack.entry.js +3 -3
  140. package/dist/esm/le-stack.entry.js.map +1 -0
  141. package/dist/{le-kit → esm}/le-text.entry.js +3 -3
  142. package/dist/esm/le-text.entry.js.map +1 -0
  143. package/dist/{le-kit → esm}/le-turntable.entry.js +2 -2
  144. package/dist/esm/le-turntable.entry.js.map +1 -0
  145. package/dist/esm/loader.js +11 -0
  146. package/dist/esm/loader.js.map +1 -0
  147. package/dist/{le-kit/utils-FDOApZ53.js → esm/utils-lgjSfQP0.js} +3 -3
  148. package/dist/{le-kit/utils-FDOApZ53.js.map → esm/utils-lgjSfQP0.js.map} +1 -1
  149. package/dist/index.cjs.js +1 -0
  150. package/dist/index.js +1 -0
  151. package/dist/le-kit/index.esm.js +2 -116
  152. package/dist/le-kit/index.esm.js.map +1 -1
  153. package/dist/le-kit/le-button.le-checkbox.le-component.le-popover.le-slot.le-string-input.entry.esm.js.map +1 -0
  154. package/dist/le-kit/le-kit.css +1 -1010
  155. package/dist/le-kit/le-kit.esm.js +2 -48
  156. package/dist/le-kit/le-kit.esm.js.map +1 -1
  157. package/dist/le-kit/p-27710b5b.entry.js +2 -0
  158. package/dist/le-kit/p-27710b5b.entry.js.map +1 -0
  159. package/dist/le-kit/p-34102cef.entry.js +2 -0
  160. package/dist/le-kit/p-34102cef.entry.js.map +1 -0
  161. package/dist/le-kit/p-56a80e6d.entry.js +2 -0
  162. package/dist/le-kit/p-56a80e6d.entry.js.map +1 -0
  163. package/dist/le-kit/p-615ea10f.entry.js +2 -0
  164. package/dist/le-kit/p-615ea10f.entry.js.map +1 -0
  165. package/dist/le-kit/p-935bb2d4.entry.js +2 -0
  166. package/dist/le-kit/p-935bb2d4.entry.js.map +1 -0
  167. package/dist/le-kit/p-9d3dc4e5.entry.js +2 -0
  168. package/dist/le-kit/p-9d3dc4e5.entry.js.map +1 -0
  169. package/dist/le-kit/p-DN2JVY-7.js +2 -0
  170. package/dist/le-kit/p-DN2JVY-7.js.map +1 -0
  171. package/dist/le-kit/p-PS-3Rz-c.js +3 -0
  172. package/dist/le-kit/p-PS-3Rz-c.js.map +1 -0
  173. package/dist/le-kit/p-ccabc638.entry.js +2 -0
  174. package/dist/le-kit/p-ccabc638.entry.js.map +1 -0
  175. package/dist/le-kit/p-d8157b06.entry.js +2 -0
  176. package/dist/le-kit/p-d8157b06.entry.js.map +1 -0
  177. package/dist/le-kit/p-e8c2ca0e.entry.js +2 -0
  178. package/dist/le-kit/p-e8c2ca0e.entry.js.map +1 -0
  179. package/dist/themes/base.css +89 -0
  180. package/dist/themes/dark.css +100 -0
  181. package/dist/themes/default.css +108 -0
  182. package/dist/themes/gradient.css +100 -0
  183. package/dist/themes/index.css +413 -0
  184. package/dist/themes/minimal.css +100 -0
  185. package/dist/themes/warm.css +100 -0
  186. package/dist/types/components.d.ts +4 -4
  187. package/dist/types/global/app.d.ts +33 -0
  188. package/dist/types/index.d.ts +1 -1
  189. package/package.json +3 -2
  190. package/readme.md +22 -0
  191. package/dist/le-kit/index-Da-89pOc.js +0 -4522
  192. package/dist/le-kit/index-Da-89pOc.js.map +0 -1
  193. package/dist/le-kit/le-button.entry.esm.js.map +0 -1
  194. package/dist/le-kit/le-button.entry.js +0 -90
  195. package/dist/le-kit/le-checkbox.entry.esm.js.map +0 -1
  196. package/dist/le-kit/le-checkbox.entry.js +0 -59
  197. package/dist/le-kit/le-component.entry.esm.js.map +0 -1
  198. package/dist/le-kit/le-popover.entry.esm.js.map +0 -1
  199. package/dist/le-kit/le-slot.entry.esm.js.map +0 -1
  200. package/dist/le-kit/le-string-input.entry.esm.js.map +0 -1
  201. package/dist/le-kit/le-string-input.entry.js +0 -93
@@ -0,0 +1,184 @@
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
@@ -0,0 +1 @@
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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;;;;;;;;;;;;;;;;;;;;;;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"]}
@@ -0,0 +1,222 @@
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
+ }