@salla.sa/twilight-components 1.0.13 → 1.0.15

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 (88) hide show
  1. package/dist/cjs/Helper-8852feaa.js +23 -0
  2. package/dist/cjs/index-0b5b5867.js +1656 -0
  3. package/dist/cjs/index.cjs.js +13 -0
  4. package/dist/cjs/loader.cjs.js +21 -0
  5. package/dist/cjs/salla-branches.cjs.entry.js +92 -0
  6. package/dist/cjs/salla-button.cjs.entry.js +77 -0
  7. package/dist/cjs/salla-localization.cjs.entry.js +77 -0
  8. package/dist/cjs/salla-login-6a54572d.js +14 -0
  9. package/dist/cjs/salla-login_2.cjs.entry.js +97 -0
  10. package/dist/cjs/salla-product-availability.cjs.entry.js +75 -0
  11. package/dist/cjs/salla-rating.cjs.entry.js +303 -0
  12. package/dist/cjs/salla-search-311c7053.js +81 -0
  13. package/dist/cjs/salla-search.cjs.entry.js +11 -0
  14. package/dist/cjs/salla-verify.cjs.entry.js +96 -0
  15. package/dist/cjs/twilight-components.cjs.js +19 -0
  16. package/dist/collection/Helpers/Helper.js +19 -0
  17. package/dist/collection/collection-manifest.json +20 -0
  18. package/dist/collection/components/generate-summary.js +35 -0
  19. package/dist/collection/components/salla-branches/salla-branches.css +12 -0
  20. package/dist/collection/components/salla-branches/salla-branches.js +235 -0
  21. package/dist/collection/components/salla-button/salla-button.css +3 -0
  22. package/dist/collection/components/salla-button/salla-button.js +243 -0
  23. package/dist/collection/components/salla-localization/salla-localization.js +200 -0
  24. package/dist/collection/components/salla-login/salla-login.js +31 -0
  25. package/dist/collection/components/salla-modal/salla-modal.js +360 -0
  26. package/dist/collection/components/salla-product-availability/salla-product-availability.js +331 -0
  27. package/dist/collection/components/salla-rating/salla-rating.css +3 -0
  28. package/dist/collection/components/salla-rating/salla-rating.js +488 -0
  29. package/dist/collection/components/salla-search/salla-search.js +132 -0
  30. package/dist/collection/components/salla-verify/salla-verify.js +99 -0
  31. package/dist/collection/index.js +2 -0
  32. package/dist/collection/interfaces/colors.js +1 -0
  33. package/dist/collection/interfaces/index.js +2 -0
  34. package/dist/collection/interfaces/ratio.js +1 -0
  35. package/dist/collection/plugins/tailwind-theme/generator.js +53 -0
  36. package/dist/collection/plugins/tailwind-theme/index.js +26 -0
  37. package/dist/{twilight-components → esm}/Helper-81ac9a8c.js +0 -0
  38. package/dist/esm/index-8b97d225.js +1628 -0
  39. package/dist/esm/index.js +4 -0
  40. package/dist/esm/loader.js +17 -0
  41. package/dist/esm/polyfills/core-js.js +11 -0
  42. package/dist/esm/polyfills/css-shim.js +1 -0
  43. package/dist/esm/polyfills/dom.js +79 -0
  44. package/dist/esm/polyfills/es5-html-element.js +1 -0
  45. package/dist/esm/polyfills/index.js +34 -0
  46. package/dist/esm/polyfills/system.js +6 -0
  47. package/dist/{twilight-components/multi-warehouse.entry.js → esm/salla-branches.entry.js} +16 -17
  48. package/dist/{twilight-components → esm}/salla-button.entry.js +5 -2
  49. package/dist/{twilight-components → esm}/salla-localization.entry.js +1 -1
  50. package/dist/{twilight-components/salla-login-97e0a9ab.js → esm/salla-login-c9c9fa57.js} +1 -1
  51. package/dist/{twilight-components/salla-modal.entry.js → esm/salla-login_2.entry.js} +16 -9
  52. package/dist/{twilight-components → esm}/salla-product-availability.entry.js +2 -2
  53. package/dist/{twilight-components → esm}/salla-rating.entry.js +9 -5
  54. package/dist/esm/salla-search-add7bdb6.js +79 -0
  55. package/dist/esm/salla-search.entry.js +3 -0
  56. package/dist/{twilight-components → esm}/salla-verify.entry.js +1 -1
  57. package/dist/esm/twilight-components.js +17 -0
  58. package/dist/index.cjs.js +1 -0
  59. package/dist/index.js +1 -0
  60. package/dist/twilight-components/index.esm.js +1 -3
  61. package/dist/twilight-components/p-010b8dfd.entry.js +1 -0
  62. package/dist/twilight-components/p-0ceecf63.js +1 -0
  63. package/dist/twilight-components/p-32d29245.entry.js +1 -0
  64. package/dist/twilight-components/p-50e70ad4.entry.js +1 -0
  65. package/dist/twilight-components/p-68c9f122.entry.js +1 -0
  66. package/dist/twilight-components/p-8126278e.entry.js +1 -0
  67. package/dist/twilight-components/p-9bc28e0c.js +1 -0
  68. package/dist/twilight-components/p-9d327a79.entry.js +1 -0
  69. package/dist/twilight-components/p-b05450bc.entry.js +1 -0
  70. package/dist/twilight-components/p-bd5da080.js +1 -0
  71. package/dist/twilight-components/p-cb1c59a2.js +1 -0
  72. package/dist/twilight-components/p-d584d0c7.entry.js +1 -0
  73. package/dist/twilight-components/twilight-components.css +1 -0
  74. package/dist/twilight-components/twilight-components.esm.js +1 -125
  75. package/dist/types/components/{multi-warehouse/multi-warehouse.d.ts → salla-branches/salla-branches.d.ts} +1 -1
  76. package/dist/types/components/salla-modal/salla-modal.d.ts +3 -0
  77. package/dist/types/components/salla-rating/salla-rating.d.ts +2 -2
  78. package/dist/types/components/salla-search/salla-search.d.ts +20 -17
  79. package/dist/types/components.d.ts +19 -15
  80. package/package.json +1 -1
  81. package/dist/twilight-components/app-globals-0f993ce5.js +0 -3
  82. package/dist/twilight-components/css-shim-a64b8820.js +0 -4
  83. package/dist/twilight-components/dom-d08ba8aa.js +0 -73
  84. package/dist/twilight-components/index-8cf58712.js +0 -3010
  85. package/dist/twilight-components/salla-login.entry.js +0 -2
  86. package/dist/twilight-components/salla-search-df1c9b54.js +0 -95
  87. package/dist/twilight-components/salla-search.entry.js +0 -2
  88. package/dist/twilight-components/shadow-css-bc14d9fd.js +0 -389
@@ -0,0 +1,31 @@
1
+ import { Component, h } from '@stencil/core';
2
+ export class SallaLogin {
3
+ render() {
4
+ return (h("salla-modal", { id: "salla-login", title: "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u0648\u0642\u0639" },
5
+ h("div", { id: "showLoginMethods" },
6
+ h("p", { class: "text-sm text-gray-text mb-5" }, "\u0627\u062E\u062A\u0631 \u0627\u0644\u0648\u0633\u064A\u0644\u0629 \u0627\u0644\u0645\u0646\u0627\u0633\u0628\u0629"),
7
+ h("div", { id: "openEmailLogin", class: "mb-2.5 box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" },
8
+ h("div", { class: "flex-shrink-0" },
9
+ h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" },
10
+ h("i", { class: "sicon-mail" }))),
11
+ h("div", { class: "flex-1 min-w-0" },
12
+ h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" },
13
+ h("div", { class: "flex-1" },
14
+ h("span", { class: "absolute inset-0", "aria-hidden": "true" }),
15
+ h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"),
16
+ h("h6", { class: "font-boldf" }, "\u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A")),
17
+ h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))),
18
+ h("div", { class: "box-content relative rounded-md border border-border-color bg-white py-5 pe-4 ps-5 flex items-center space-s-3 hover:border-gray-200" },
19
+ h("div", { class: "flex-shrink-0" },
20
+ h("div", { class: "bg-primary w-12 h-12 text-lg text-white rounded-icon" },
21
+ h("i", { class: "sicon-phone" }))),
22
+ h("div", { class: "flex-1 min-w-0" },
23
+ h("a", { href: "#", class: "focus:outline-none flex justify-between items-center" },
24
+ h("div", { class: "flex-1" },
25
+ h("span", { class: "absolute inset-0", "aria-hidden": "true" }),
26
+ h("p", { class: "text-sm text-gray-text" }, "\u0633\u062C\u0644 \u062F\u062E\u0648\u0644"),
27
+ h("h6", { class: "font-boldf" }, "\u0627\u0644\u0647\u0627\u062A\u0641")),
28
+ h("i", { class: "sicon-keyboard_arrow_left text-primary text-xl" })))))));
29
+ }
30
+ static get is() { return "salla-login"; }
31
+ }
@@ -0,0 +1,360 @@
1
+ import { Component, h, Prop, Host, Element, Event, Watch, Method } from '@stencil/core';
2
+ import Helper from "../../Helpers/Helper";
3
+ //todo:: button component
4
+ export class SallaModal {
5
+ constructor() {
6
+ var _a;
7
+ this.error = false;
8
+ this.success = false;
9
+ this.isClosable = true;
10
+ this.modalWidth = 'w-96'; //todo use friendly names
11
+ this.visible = false;
12
+ this.subTitleFirst = false;
13
+ this.subTitle = '';
14
+ this.icon = '';
15
+ this.imageIcon = '';
16
+ Helper.setHost(this.host);
17
+ salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.show());
18
+ salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.hide());
19
+ this.title = this.host.title;
20
+ this.host.removeAttribute('title');
21
+ (_a = Helper.getElement('[slot=body]')) === null || _a === void 0 ? void 0 : _a.classList.add('s-modal-body');
22
+ }
23
+ handleVisible(newValue) {
24
+ if (!newValue) {
25
+ this.toggleModal(false);
26
+ this.close.emit();
27
+ return;
28
+ }
29
+ this.host.classList.remove('hidden');
30
+ setTimeout(() => this.toggleModal(true)); //small amont of time to running toggle After adding hidden
31
+ this.ready.emit();
32
+ }
33
+ async show() {
34
+ this.host.setAttribute('visible', '');
35
+ return this.host;
36
+ }
37
+ async hide() {
38
+ this.host.removeAttribute('visible');
39
+ return this.host;
40
+ }
41
+ async setTitle(title) {
42
+ this.title = title;
43
+ return this.host;
44
+ }
45
+ toggleModal(isOpen) {
46
+ Helper.toggleElement(this.host.querySelector('.s-modal-body'), 's-modal-entering', 's-modal-leaving', () => isOpen)
47
+ .toggleElement(this.host.querySelector('[slot=body]'), 's-modal-entering', 's-modal-leaving', () => isOpen)
48
+ .toggleElement(this.overlay, 's-modal-entering', 's-modal-overlay-leaving', () => isOpen)
49
+ .toggleElement(document.body, 'modal-is-open', 'modal-is-closed', () => isOpen);
50
+ if (!isOpen) {
51
+ setTimeout(() => this.host.classList.add('hidden'), 350);
52
+ }
53
+ }
54
+ closeModal() {
55
+ if (!this.isClosable) {
56
+ return;
57
+ }
58
+ this.host.removeAttribute('visible');
59
+ }
60
+ //todo:: pref for each modal
61
+ render() {
62
+ this.host.id = this.host.id || 'salla-modal';
63
+ return (h(Host, { class: 's-modal-container hidden', "aria-modal": "true", role: "dialog" },
64
+ h("div", { class: "s-modal-wrapper" },
65
+ h("div", { class: "s-modal-overlay", ref: el => this.overlay = el, onClick: () => this.closeModal() }),
66
+ h("span", { class: "s-modal-spacer" }, "\u200B"),
67
+ h("slot", { name: "body" },
68
+ h("div", { class: 's-modal-body ' + this.modalWidth },
69
+ h("div", { class: { 's-modal-header': true, 's-modal-is-center': this.icon != '' || this.imageIcon != '' } },
70
+ this.isClosable ?
71
+ h("button", { class: "s-modal-close cursor-pointer", onClick: () => this.closeModal(), type: "button" },
72
+ h("span", { class: "sicon-cancel" }))
73
+ : '',
74
+ this.error || this.success || this.icon
75
+ ? h("div", { class: {
76
+ 's-modal-icon': true,
77
+ 's-modal-bg-error': this.error,
78
+ 's-modal-bg-success': this.success,
79
+ 's-modal-bg-normal': !this.error && !this.success
80
+ } },
81
+ h("i", { class: {
82
+ [this.icon]: true,
83
+ 's-modal-text-error': this.error,
84
+ 's-modal-text-success': this.success,
85
+ } }))
86
+ : this.imageIcon ?
87
+ h("img", { class: "s-modal-header-img", src: this.imageIcon })
88
+ : '',
89
+ this.title || this.subTitle ?
90
+ h("div", { class: "s-modal-header-content" },
91
+ h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.title }),
92
+ h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle }))
93
+ : ''),
94
+ h("slot", null),
95
+ h("slot", { name: "footer" }))))));
96
+ }
97
+ static get is() { return "salla-modal"; }
98
+ static get properties() { return {
99
+ "error": {
100
+ "type": "boolean",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "boolean",
104
+ "resolved": "boolean",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": false,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": ""
112
+ },
113
+ "attribute": "error",
114
+ "reflect": false,
115
+ "defaultValue": "false"
116
+ },
117
+ "success": {
118
+ "type": "boolean",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "boolean",
122
+ "resolved": "boolean",
123
+ "references": {}
124
+ },
125
+ "required": false,
126
+ "optional": false,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": ""
130
+ },
131
+ "attribute": "success",
132
+ "reflect": false,
133
+ "defaultValue": "false"
134
+ },
135
+ "isClosable": {
136
+ "type": "boolean",
137
+ "mutable": true,
138
+ "complexType": {
139
+ "original": "boolean",
140
+ "resolved": "boolean",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": ""
148
+ },
149
+ "attribute": "is-closable",
150
+ "reflect": false,
151
+ "defaultValue": "true"
152
+ },
153
+ "modalWidth": {
154
+ "type": "string",
155
+ "mutable": false,
156
+ "complexType": {
157
+ "original": "string",
158
+ "resolved": "string",
159
+ "references": {}
160
+ },
161
+ "required": false,
162
+ "optional": false,
163
+ "docs": {
164
+ "tags": [],
165
+ "text": ""
166
+ },
167
+ "attribute": "modal-width",
168
+ "reflect": true,
169
+ "defaultValue": "'w-96'"
170
+ },
171
+ "visible": {
172
+ "type": "boolean",
173
+ "mutable": false,
174
+ "complexType": {
175
+ "original": "boolean",
176
+ "resolved": "boolean",
177
+ "references": {}
178
+ },
179
+ "required": false,
180
+ "optional": false,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": ""
184
+ },
185
+ "attribute": "visible",
186
+ "reflect": true,
187
+ "defaultValue": "false"
188
+ },
189
+ "subTitleFirst": {
190
+ "type": "boolean",
191
+ "mutable": false,
192
+ "complexType": {
193
+ "original": "boolean",
194
+ "resolved": "boolean",
195
+ "references": {}
196
+ },
197
+ "required": false,
198
+ "optional": false,
199
+ "docs": {
200
+ "tags": [],
201
+ "text": ""
202
+ },
203
+ "attribute": "sub-title-first",
204
+ "reflect": false,
205
+ "defaultValue": "false"
206
+ },
207
+ "subTitle": {
208
+ "type": "string",
209
+ "mutable": false,
210
+ "complexType": {
211
+ "original": "string",
212
+ "resolved": "string",
213
+ "references": {}
214
+ },
215
+ "required": false,
216
+ "optional": false,
217
+ "docs": {
218
+ "tags": [],
219
+ "text": ""
220
+ },
221
+ "attribute": "sub-title",
222
+ "reflect": false,
223
+ "defaultValue": "''"
224
+ },
225
+ "icon": {
226
+ "type": "string",
227
+ "mutable": false,
228
+ "complexType": {
229
+ "original": "string",
230
+ "resolved": "string",
231
+ "references": {}
232
+ },
233
+ "required": false,
234
+ "optional": false,
235
+ "docs": {
236
+ "tags": [],
237
+ "text": ""
238
+ },
239
+ "attribute": "icon",
240
+ "reflect": false,
241
+ "defaultValue": "''"
242
+ },
243
+ "imageIcon": {
244
+ "type": "string",
245
+ "mutable": false,
246
+ "complexType": {
247
+ "original": "string",
248
+ "resolved": "string",
249
+ "references": {}
250
+ },
251
+ "required": false,
252
+ "optional": false,
253
+ "docs": {
254
+ "tags": [],
255
+ "text": ""
256
+ },
257
+ "attribute": "image-icon",
258
+ "reflect": false,
259
+ "defaultValue": "''"
260
+ }
261
+ }; }
262
+ static get events() { return [{
263
+ "method": "ready",
264
+ "name": "ready",
265
+ "bubbles": true,
266
+ "cancelable": true,
267
+ "composed": true,
268
+ "docs": {
269
+ "tags": [],
270
+ "text": ""
271
+ },
272
+ "complexType": {
273
+ "original": "any",
274
+ "resolved": "any",
275
+ "references": {}
276
+ }
277
+ }, {
278
+ "method": "close",
279
+ "name": "close",
280
+ "bubbles": true,
281
+ "cancelable": true,
282
+ "composed": true,
283
+ "docs": {
284
+ "tags": [],
285
+ "text": ""
286
+ },
287
+ "complexType": {
288
+ "original": "any",
289
+ "resolved": "any",
290
+ "references": {}
291
+ }
292
+ }]; }
293
+ static get methods() { return {
294
+ "show": {
295
+ "complexType": {
296
+ "signature": "() => Promise<HTMLElement>",
297
+ "parameters": [],
298
+ "references": {
299
+ "Promise": {
300
+ "location": "global"
301
+ },
302
+ "HTMLElement": {
303
+ "location": "global"
304
+ }
305
+ },
306
+ "return": "Promise<HTMLElement>"
307
+ },
308
+ "docs": {
309
+ "text": "",
310
+ "tags": []
311
+ }
312
+ },
313
+ "hide": {
314
+ "complexType": {
315
+ "signature": "() => Promise<HTMLElement>",
316
+ "parameters": [],
317
+ "references": {
318
+ "Promise": {
319
+ "location": "global"
320
+ },
321
+ "HTMLElement": {
322
+ "location": "global"
323
+ }
324
+ },
325
+ "return": "Promise<HTMLElement>"
326
+ },
327
+ "docs": {
328
+ "text": "",
329
+ "tags": []
330
+ }
331
+ },
332
+ "setTitle": {
333
+ "complexType": {
334
+ "signature": "(title: any) => Promise<HTMLElement>",
335
+ "parameters": [{
336
+ "tags": [],
337
+ "text": ""
338
+ }],
339
+ "references": {
340
+ "Promise": {
341
+ "location": "global"
342
+ },
343
+ "HTMLElement": {
344
+ "location": "global"
345
+ }
346
+ },
347
+ "return": "Promise<HTMLElement>"
348
+ },
349
+ "docs": {
350
+ "text": "",
351
+ "tags": []
352
+ }
353
+ }
354
+ }; }
355
+ static get elementRef() { return "host"; }
356
+ static get watchers() { return [{
357
+ "propName": "visible",
358
+ "methodName": "handleVisible"
359
+ }]; }
360
+ }