@searchcraft/javascript-sdk 0.1.2 → 0.1.3
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.
- package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js +34 -0
- package/dist/searchcraft-javascript-sdk/_commonjsHelpers-63cbe26c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js +3043 -0
- package/dist/searchcraft-javascript-sdk/index-be6bffea.js.map +1 -0
- package/dist/{esm/index-72ac5051.js → searchcraft-javascript-sdk/index-d6567b9c.js} +10 -2
- package/dist/searchcraft-javascript-sdk/index-d6567b9c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/index.esm.js +14 -1
- package/dist/searchcraft-javascript-sdk/index.esm.js.map +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js +93 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-auto-search-form.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-base-search-form.entry.js +4 -4
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-form.entry.js.map +1 -0
- package/dist/{components/p-1912bbbd.js → searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js} +22 -47
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-result.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js +57 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-base-search-results.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button-icon.entry.js +1 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-button-icon.entry.js.map +1 -0
- package/dist/{esm → searchcraft-javascript-sdk}/searchcraft-button.entry.js +5 -5
- package/dist/searchcraft-javascript-sdk/searchcraft-button.entry.js.map +1 -0
- package/dist/{components/p-d446eda4.js → searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js} +7 -25
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-icon-set.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js +31 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-clear-input-button.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js +22 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-error-message.entry.js.map +1 -0
- package/dist/{components/p-cb75ba7a.js → searchcraft-javascript-sdk/searchcraft-input-caption.entry.js} +10 -32
- package/dist/searchcraft-javascript-sdk/searchcraft-input-caption.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js +23 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-icon.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js +30 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-input-label.entry.js.map +1 -0
- package/dist/{components/p-1bd04bac.js → searchcraft-javascript-sdk/searchcraft-input.entry.js} +11 -80
- package/dist/searchcraft-javascript-sdk/searchcraft-input.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js +48 -1
- package/dist/searchcraft-javascript-sdk/searchcraft-javascript-sdk.esm.js.map +1 -1
- package/dist/{components/p-d0edf961.js → searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js} +7 -25
- package/dist/searchcraft-javascript-sdk/searchcraft-search-icon-set.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js +17 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-dark.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js +17 -0
- package/dist/searchcraft-javascript-sdk/searchcraft-spinner-light.entry.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js +334 -0
- package/dist/searchcraft-javascript-sdk/shadow-css-423dab2c.js.map +1 -0
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js +3008 -0
- package/dist/searchcraft-javascript-sdk/store-b50263a1.js.map +1 -0
- package/dist/{esm/utils-02b18bb5.js → searchcraft-javascript-sdk/utils-7bff0c78.js} +11 -7
- package/dist/searchcraft-javascript-sdk/utils-7bff0c78.js.map +1 -0
- package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +2 -1
- package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +1 -2
- package/dist/types/components.d.ts +6 -4
- package/dist/types/utils/utils.d.ts +1 -5
- package/package.json +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-5b0b9d4c.js +0 -84
- package/dist/cjs/index-5b0b9d4c.js.map +0 -1
- package/dist/cjs/index-e7e9ab69.js +0 -1271
- package/dist/cjs/index-e7e9ab69.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -16
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js +0 -460
- package/dist/cjs/searchcraft-auto-search-form_13.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js +0 -64
- package/dist/cjs/searchcraft-base-search-form.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js +0 -18
- package/dist/cjs/searchcraft-button-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-button.cjs.entry.js +0 -37
- package/dist/cjs/searchcraft-button.cjs.entry.js.map +0 -1
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js +0 -27
- package/dist/cjs/searchcraft-javascript-sdk.cjs.js.map +0 -1
- package/dist/cjs/store-ab3978ce.js +0 -251
- package/dist/cjs/store-ab3978ce.js.map +0 -1
- package/dist/cjs/utils-57b6c18f.js +0 -48
- package/dist/cjs/utils-57b6c18f.js.map +0 -1
- package/dist/collection/assets/searchcraft-button-icons.js +0 -9
- package/dist/collection/assets/searchcraft-button-icons.js.map +0 -1
- package/dist/collection/assets/searchcraft-clear-icon-set.js +0 -45
- package/dist/collection/assets/searchcraft-clear-icon-set.js.map +0 -1
- package/dist/collection/assets/searchcraft-search-icon-set.js +0 -45
- package/dist/collection/assets/searchcraft-search-icon-set.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -27
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js +0 -294
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.js.map +0 -1
- package/dist/collection/components/searchcraft-auto-search-form/searchcraft-auto-search-form.module.css +0 -19
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js +0 -168
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-form/searchcraft-base-search-form.module.css +0 -14
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js +0 -302
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-result/searchcraft-base-search-result.module.css +0 -210
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js +0 -123
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.js.map +0 -1
- package/dist/collection/components/searchcraft-base-search-results/searchcraft-base-search-results.module.css +0 -20
- package/dist/collection/components/searchcraft-button/searchcraft-button.js +0 -137
- package/dist/collection/components/searchcraft-button/searchcraft-button.js.map +0 -1
- package/dist/collection/components/searchcraft-button/searchcraft-button.module.css +0 -82
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js +0 -96
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.js.map +0 -1
- package/dist/collection/components/searchcraft-clear-input-button/searchcraft-clear-input-button.module.css +0 -33
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js +0 -64
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.js.map +0 -1
- package/dist/collection/components/searchcraft-error-message/searchcraft-error-message.module.css +0 -21
- package/dist/collection/components/searchcraft-input/searchcraft-input.js +0 -276
- package/dist/collection/components/searchcraft-input/searchcraft-input.js.map +0 -1
- package/dist/collection/components/searchcraft-input/searchcraft-input.module.css +0 -241
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js +0 -122
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.js.map +0 -1
- package/dist/collection/components/searchcraft-input-caption/searchcraft-input-caption.module.css +0 -79
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js +0 -71
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.js.map +0 -1
- package/dist/collection/components/searchcraft-input-icon/searchcraft-input-icon.module.css +0 -21
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js +0 -77
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.js.map +0 -1
- package/dist/collection/components/searchcraft-input-label/searchcraft-input-label.module.css +0 -21
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js +0 -19
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.js.map +0 -1
- package/dist/collection/components/searchcraft-spinner-dark/searchcraft-spinner-dark.module.css +0 -35
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js +0 -19
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.js.map +0 -1
- package/dist/collection/components/searchcraft-spinner-light/searchcraft-spinner-light.module.css +0 -26
- package/dist/collection/index.js +0 -14
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/provider/store.js +0 -68
- package/dist/collection/provider/store.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -41
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/index.js +0 -5
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-066c8210.js +0 -1106
- package/dist/components/p-066c8210.js.map +0 -1
- package/dist/components/p-1912bbbd.js.map +0 -1
- package/dist/components/p-1bd04bac.js.map +0 -1
- package/dist/components/p-36c95064.js +0 -247
- package/dist/components/p-36c95064.js.map +0 -1
- package/dist/components/p-5cdc6210.js +0 -82
- package/dist/components/p-5cdc6210.js.map +0 -1
- package/dist/components/p-5e3152c4.js +0 -44
- package/dist/components/p-5e3152c4.js.map +0 -1
- package/dist/components/p-63035c6a.js +0 -50
- package/dist/components/p-63035c6a.js.map +0 -1
- package/dist/components/p-6f2a72d3.js +0 -41
- package/dist/components/p-6f2a72d3.js.map +0 -1
- package/dist/components/p-8d9551ce.js +0 -34
- package/dist/components/p-8d9551ce.js.map +0 -1
- package/dist/components/p-b1ff2296.js +0 -69
- package/dist/components/p-b1ff2296.js.map +0 -1
- package/dist/components/p-c3838435.js +0 -62
- package/dist/components/p-c3838435.js.map +0 -1
- package/dist/components/p-cb75ba7a.js.map +0 -1
- package/dist/components/p-d0edf961.js.map +0 -1
- package/dist/components/p-d446eda4.js.map +0 -1
- package/dist/components/p-d54bca75.js +0 -50
- package/dist/components/p-d54bca75.js.map +0 -1
- package/dist/components/p-d6616aa5.js +0 -34
- package/dist/components/p-d6616aa5.js.map +0 -1
- package/dist/components/searchcraft-auto-search-form.js +0 -185
- package/dist/components/searchcraft-auto-search-form.js.map +0 -1
- package/dist/components/searchcraft-base-search-form.js +0 -153
- package/dist/components/searchcraft-base-search-form.js.map +0 -1
- package/dist/components/searchcraft-base-search-result.js +0 -8
- package/dist/components/searchcraft-base-search-result.js.map +0 -1
- package/dist/components/searchcraft-base-search-results.js +0 -111
- package/dist/components/searchcraft-base-search-results.js.map +0 -1
- package/dist/components/searchcraft-button-icon.js +0 -33
- package/dist/components/searchcraft-button-icon.js.map +0 -1
- package/dist/components/searchcraft-button.js +0 -8
- package/dist/components/searchcraft-button.js.map +0 -1
- package/dist/components/searchcraft-clear-icon-set.js +0 -8
- package/dist/components/searchcraft-clear-icon-set.js.map +0 -1
- package/dist/components/searchcraft-clear-input-button.js +0 -8
- package/dist/components/searchcraft-clear-input-button.js.map +0 -1
- package/dist/components/searchcraft-error-message.js +0 -8
- package/dist/components/searchcraft-error-message.js.map +0 -1
- package/dist/components/searchcraft-input-caption.js +0 -8
- package/dist/components/searchcraft-input-caption.js.map +0 -1
- package/dist/components/searchcraft-input-icon.js +0 -8
- package/dist/components/searchcraft-input-icon.js.map +0 -1
- package/dist/components/searchcraft-input-label.js +0 -8
- package/dist/components/searchcraft-input-label.js.map +0 -1
- package/dist/components/searchcraft-input.js +0 -8
- package/dist/components/searchcraft-input.js.map +0 -1
- package/dist/components/searchcraft-search-icon-set.js +0 -8
- package/dist/components/searchcraft-search-icon-set.js.map +0 -1
- package/dist/components/searchcraft-spinner-dark.js +0 -8
- package/dist/components/searchcraft-spinner-dark.js.map +0 -1
- package/dist/components/searchcraft-spinner-light.js +0 -8
- package/dist/components/searchcraft-spinner-light.js.map +0 -1
- package/dist/esm/index-72ac5051.js.map +0 -1
- package/dist/esm/index-eace3343.js +0 -1242
- package/dist/esm/index-eace3343.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -13
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/searchcraft-auto-search-form_13.entry.js +0 -444
- package/dist/esm/searchcraft-auto-search-form_13.entry.js.map +0 -1
- package/dist/esm/searchcraft-base-search-form.entry.js.map +0 -1
- package/dist/esm/searchcraft-button-icon.entry.js.map +0 -1
- package/dist/esm/searchcraft-button.entry.js.map +0 -1
- package/dist/esm/searchcraft-javascript-sdk.js +0 -22
- package/dist/esm/searchcraft-javascript-sdk.js.map +0 -1
- package/dist/esm/store-e55b12aa.js +0 -247
- package/dist/esm/store-e55b12aa.js.map +0 -1
- package/dist/esm/utils-02b18bb5.js.map +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -1
- package/dist/loader/index.cjs.js +0 -1
- package/dist/loader/index.d.ts +0 -24
- package/dist/loader/index.es2017.js +0 -1
- package/dist/loader/index.js +0 -2
- package/dist/loader/package.json +0 -11
- package/dist/searchcraft-javascript-sdk/p-0ba9029b.js +0 -3
- package/dist/searchcraft-javascript-sdk/p-0ba9029b.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-36c95064.js +0 -11
- package/dist/searchcraft-javascript-sdk/p-36c95064.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-437c6ef9.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-437c6ef9.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-562e923d.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-562e923d.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5959cd6a.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5959cd6a.entry.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js +0 -7
- package/dist/searchcraft-javascript-sdk/p-5cdc6210.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-5e3152c4.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-5e3152c4.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-e1255160.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-e1255160.js.map +0 -1
- package/dist/searchcraft-javascript-sdk/p-eb632a89.entry.js +0 -2
- package/dist/searchcraft-javascript-sdk/p-eb632a89.entry.js.map +0 -1
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js +0 -0
- /package/dist/{esm → searchcraft-javascript-sdk}/app-globals-0f993ce5.js.map +0 -0
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--font-stack: Helvetica, Arial, sans-serif;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.interactiveResultContainerLight {
|
|
6
|
-
background-color: #FAFAFA;
|
|
7
|
-
align-items: flex-start;
|
|
8
|
-
border-radius: 16px;
|
|
9
|
-
display: flex;
|
|
10
|
-
position: relative;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: 16px;
|
|
13
|
-
padding: 8px;
|
|
14
|
-
}
|
|
15
|
-
@media (min-width: 600px) {
|
|
16
|
-
.interactiveResultContainerLight {
|
|
17
|
-
flex-direction: row;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.interactiveResultContainerDark {
|
|
22
|
-
background-color: #2E2E2E;
|
|
23
|
-
align-items: flex-start;
|
|
24
|
-
border-radius: 16px;
|
|
25
|
-
display: flex;
|
|
26
|
-
position: relative;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
gap: 16px;
|
|
29
|
-
padding: 8px;
|
|
30
|
-
}
|
|
31
|
-
@media (min-width: 600px) {
|
|
32
|
-
.interactiveResultContainerDark {
|
|
33
|
-
flex-direction: row;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.resultContainer {
|
|
38
|
-
align-items: flex-start;
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
gap: 16px;
|
|
42
|
-
}
|
|
43
|
-
@media (min-width: 600px) {
|
|
44
|
-
.resultContainer {
|
|
45
|
-
flex-direction: row;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.interactiveIconLarge {
|
|
50
|
-
display: inline-block;
|
|
51
|
-
position: absolute;
|
|
52
|
-
right: 5px;
|
|
53
|
-
top: 8px;
|
|
54
|
-
}
|
|
55
|
-
@media (max-width: 600px) {
|
|
56
|
-
.interactiveIconLarge {
|
|
57
|
-
display: none;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.interactiveIconSmall {
|
|
62
|
-
position: absolute;
|
|
63
|
-
right: 5px;
|
|
64
|
-
top: -2px;
|
|
65
|
-
display: inline-block;
|
|
66
|
-
}
|
|
67
|
-
@media (min-width: 600px) {
|
|
68
|
-
.interactiveIconSmall {
|
|
69
|
-
display: none;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.imageContainer {
|
|
74
|
-
max-height: 540px;
|
|
75
|
-
max-width: 100%;
|
|
76
|
-
}
|
|
77
|
-
@media (min-width: 600px) {
|
|
78
|
-
.imageContainer {
|
|
79
|
-
max-height: 100%;
|
|
80
|
-
max-width: 50%;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.contentContainer {
|
|
85
|
-
max-height: 100%;
|
|
86
|
-
max-width: 100%;
|
|
87
|
-
}
|
|
88
|
-
@media (min-width: 600px) {
|
|
89
|
-
.contentContainer {
|
|
90
|
-
max-width: 50%;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.imageLight {
|
|
95
|
-
aspect-ratio: 2/1;
|
|
96
|
-
border-radius: 8px;
|
|
97
|
-
max-height: 100%;
|
|
98
|
-
max-width: 100%;
|
|
99
|
-
border: 1px solid #D9D9D9;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.imageDark {
|
|
103
|
-
aspect-ratio: 2/1;
|
|
104
|
-
border-radius: 8px;
|
|
105
|
-
max-height: 100%;
|
|
106
|
-
max-width: 100%;
|
|
107
|
-
border: 1px solid #333;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.headingLight {
|
|
111
|
-
font-family: var(--font-stack);
|
|
112
|
-
font-size: 16px;
|
|
113
|
-
font-weight: 700;
|
|
114
|
-
line-height: 20px;
|
|
115
|
-
margin-bottom: 4px;
|
|
116
|
-
margin-top: 0px;
|
|
117
|
-
position: relative;
|
|
118
|
-
color: #292929;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.headingDark {
|
|
122
|
-
font-family: var(--font-stack);
|
|
123
|
-
font-size: 16px;
|
|
124
|
-
font-weight: 700;
|
|
125
|
-
line-height: 20px;
|
|
126
|
-
margin-bottom: 4px;
|
|
127
|
-
margin-top: 0px;
|
|
128
|
-
position: relative;
|
|
129
|
-
color: #FFF;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.subheadingLight {
|
|
133
|
-
font-family: var(--font-stack);
|
|
134
|
-
font-size: 12px;
|
|
135
|
-
font-weight: 400;
|
|
136
|
-
line-height: 16px;
|
|
137
|
-
margin-bottom: 4px;
|
|
138
|
-
margin-top: 0px;
|
|
139
|
-
color: #737373;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.subheadingDark {
|
|
143
|
-
font-family: var(--font-stack);
|
|
144
|
-
font-size: 12px;
|
|
145
|
-
font-weight: 400;
|
|
146
|
-
line-height: 16px;
|
|
147
|
-
margin-bottom: 4px;
|
|
148
|
-
margin-top: 0px;
|
|
149
|
-
color: #BFBFBF;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.primaryContentLight {
|
|
153
|
-
font-family: var(--font-stack);
|
|
154
|
-
font-size: 16px;
|
|
155
|
-
font-weight: 400;
|
|
156
|
-
line-height: 20px;
|
|
157
|
-
margin-bottom: 4px;
|
|
158
|
-
margin-top: 0px;
|
|
159
|
-
color: #404040;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.primaryContentDark {
|
|
163
|
-
font-family: var(--font-stack);
|
|
164
|
-
font-size: 16px;
|
|
165
|
-
font-weight: 400;
|
|
166
|
-
line-height: 20px;
|
|
167
|
-
margin-bottom: 4px;
|
|
168
|
-
margin-top: 0px;
|
|
169
|
-
color: #E6E6E6;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.secondaryContentLight {
|
|
173
|
-
font-family: var(--font-stack);
|
|
174
|
-
font-size: 16px;
|
|
175
|
-
font-weight: 400;
|
|
176
|
-
line-height: 20px;
|
|
177
|
-
margin-bottom: 4px;
|
|
178
|
-
margin-top: 0px;
|
|
179
|
-
color: #404040;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.secondaryContentDark {
|
|
183
|
-
font-family: var(--font-stack);
|
|
184
|
-
font-size: 16px;
|
|
185
|
-
font-weight: 400;
|
|
186
|
-
line-height: 20px;
|
|
187
|
-
margin-bottom: 4px;
|
|
188
|
-
margin-top: 0px;
|
|
189
|
-
color: #E6E6E6;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.tertiaryContentLight {
|
|
193
|
-
font-family: var(--font-stack);
|
|
194
|
-
font-size: 16px;
|
|
195
|
-
font-weight: 400;
|
|
196
|
-
line-height: 20px;
|
|
197
|
-
margin-bottom: 4px;
|
|
198
|
-
margin-top: 0px;
|
|
199
|
-
color: #404040;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.tertiaryContentDark {
|
|
203
|
-
font-family: var(--font-stack);
|
|
204
|
-
font-size: 16px;
|
|
205
|
-
font-weight: 400;
|
|
206
|
-
line-height: 20px;
|
|
207
|
-
margin-bottom: 4px;
|
|
208
|
-
margin-top: 0px;
|
|
209
|
-
color: #E6E6E6;
|
|
210
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { useSearchcraftStore } from "../../provider/store";
|
|
3
|
-
import { extractDynamicProperties, parseCustomStyles, parseSearchKeys, } from "../../utils/utils";
|
|
4
|
-
export class SearchcraftBaseSearchResults {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.query = '';
|
|
7
|
-
this.searchResults = null;
|
|
8
|
-
this.searchKeys = '';
|
|
9
|
-
this.customStylesForResults = {};
|
|
10
|
-
}
|
|
11
|
-
componentDidLoad() {
|
|
12
|
-
// Initialize searchKeys if not provided
|
|
13
|
-
if (!this.searchKeys || this.searchKeys.length === 0) {
|
|
14
|
-
console.warn('No searchKeys provided; using empty keys array.');
|
|
15
|
-
this.searchKeys = ''; // Ensure it's explicitly set as an empty array
|
|
16
|
-
}
|
|
17
|
-
// Subscribe to state changes
|
|
18
|
-
this.unsubscribe = useSearchcraftStore.subscribe((state) => {
|
|
19
|
-
this.searchResults = Object.assign({}, state.searchResults);
|
|
20
|
-
this.query = state.query;
|
|
21
|
-
});
|
|
22
|
-
// Fetch initial state
|
|
23
|
-
const { searchResults, query } = useSearchcraftStore.getState();
|
|
24
|
-
this.searchResults = searchResults;
|
|
25
|
-
this.query = query;
|
|
26
|
-
}
|
|
27
|
-
disconnectedCallback() {
|
|
28
|
-
if (this.unsubscribe) {
|
|
29
|
-
this.unsubscribe();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
34
|
-
if (!((_a = this.searchResults) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
35
|
-
console.warn('No search results data available');
|
|
36
|
-
return h("div", null, "No results to display.");
|
|
37
|
-
}
|
|
38
|
-
const parsedSearchKeys = parseSearchKeys(this.searchKeys);
|
|
39
|
-
const parsedCustomStyles = parseCustomStyles(this.customStylesForResults);
|
|
40
|
-
return (h("div", { class: 'resultsContainer' }, (_d = (_c = (_b = this.searchResults) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.hits) === null || _d === void 0 ? void 0 :
|
|
41
|
-
_d.map((document, index) => {
|
|
42
|
-
const { doc: result } = document;
|
|
43
|
-
const dynamicProperties = extractDynamicProperties(result, parsedSearchKeys);
|
|
44
|
-
// Render the custom element if present, otherwise fallback to default
|
|
45
|
-
const customElement = this.hostElement.querySelector('[slot="result-template"]');
|
|
46
|
-
if (customElement) {
|
|
47
|
-
// Clone the custom element and pass data to it
|
|
48
|
-
const customElementClone = customElement.cloneNode(true);
|
|
49
|
-
customElementClone.removeAttribute('slot'); // Remove the slot attribute
|
|
50
|
-
customElementClone.setAttribute('data-result', JSON.stringify(result));
|
|
51
|
-
return (h("div", { key: `${dynamicProperties.id}-${index}` }, customElementClone.outerHTML));
|
|
52
|
-
}
|
|
53
|
-
// Fallback to the default element
|
|
54
|
-
return (h("searchcraft-base-search-result", { key: `${dynamicProperties.id}-${index}`, "button-callback": () => console.log('button callback'), "result-callback": () => console.log('interactive element'), "keydown-callback": () => console.log('keydown'), "is-interactive": true, "heading-text": dynamicProperties[parsedSearchKeys[0]], "subheading-text": dynamicProperties[parsedSearchKeys[1]], "primary-content": dynamicProperties[parsedSearchKeys[2]], "secondary-content": dynamicProperties[parsedSearchKeys[3]], "tertiary-content": dynamicProperties[parsedSearchKeys[4]], "image-source": dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]], customStyles: parsedCustomStyles }));
|
|
55
|
-
}), this.query.length > 0 &&
|
|
56
|
-
((_g = (_f = (_e = this.searchResults) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.hits) === null || _g === void 0 ? void 0 : _g.length) === 0 && (h("searchcraft-error-message", { "error-message": `No search results found for "${this.query}" query` })), h("slot", { name: 'result-template' })));
|
|
57
|
-
}
|
|
58
|
-
static get is() { return "searchcraft-base-search-results"; }
|
|
59
|
-
static get encapsulation() { return "shadow"; }
|
|
60
|
-
static get originalStyleUrls() {
|
|
61
|
-
return {
|
|
62
|
-
"$": ["searchcraft-base-search-results.module.scss"]
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
static get styleUrls() {
|
|
66
|
-
return {
|
|
67
|
-
"$": ["searchcraft-base-search-results.module.css"]
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
static get properties() {
|
|
71
|
-
return {
|
|
72
|
-
"searchKeys": {
|
|
73
|
-
"type": "string",
|
|
74
|
-
"mutable": false,
|
|
75
|
-
"complexType": {
|
|
76
|
-
"original": "string",
|
|
77
|
-
"resolved": "string",
|
|
78
|
-
"references": {}
|
|
79
|
-
},
|
|
80
|
-
"required": false,
|
|
81
|
-
"optional": false,
|
|
82
|
-
"docs": {
|
|
83
|
-
"tags": [],
|
|
84
|
-
"text": "Array of keys to dynamically extract properties from each document.\nMust be explicitly set by the parent component."
|
|
85
|
-
},
|
|
86
|
-
"attribute": "search-keys",
|
|
87
|
-
"reflect": false,
|
|
88
|
-
"defaultValue": "''"
|
|
89
|
-
},
|
|
90
|
-
"customStylesForResults": {
|
|
91
|
-
"type": "string",
|
|
92
|
-
"mutable": false,
|
|
93
|
-
"complexType": {
|
|
94
|
-
"original": "string | Record<string, string>",
|
|
95
|
-
"resolved": "string | { [x: string]: string; }",
|
|
96
|
-
"references": {
|
|
97
|
-
"Record": {
|
|
98
|
-
"location": "global",
|
|
99
|
-
"id": "global::Record"
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
"required": false,
|
|
104
|
-
"optional": false,
|
|
105
|
-
"docs": {
|
|
106
|
-
"tags": [],
|
|
107
|
-
"text": "Custom styles to apply to search results.\nExpected format: JSON string, e.g., '{\"borderRadius\": \"10px\", \"padding\": \"16px\"}'"
|
|
108
|
-
},
|
|
109
|
-
"attribute": "custom-styles-for-results",
|
|
110
|
-
"reflect": false,
|
|
111
|
-
"defaultValue": "{}"
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
static get states() {
|
|
116
|
-
return {
|
|
117
|
-
"query": {},
|
|
118
|
-
"searchResults": {}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
static get elementRef() { return "hostElement"; }
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=searchcraft-base-search-results.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-base-search-results.js","sourceRoot":"","sources":["../../../src/components/searchcraft-base-search-results/searchcraft-base-search-results.tsx"],"names":[],"mappings":"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","sourcesContent":["import { Component, h, Prop, State, Element } from '@stencil/core';\nimport type { SearchcraftResponse } from '@searchcraft/core';\n\nimport { useSearchcraftStore } from '@provider/store';\nimport {\n extractDynamicProperties,\n parseCustomStyles,\n parseSearchKeys,\n} from '@utils/utils';\n\n@Component({\n tag: 'searchcraft-base-search-results',\n styleUrl: 'searchcraft-base-search-results.module.scss',\n shadow: true,\n})\nexport class SearchcraftBaseSearchResults {\n @State() query = '';\n @State() searchResults: SearchcraftResponse | null = null;\n\n /**\n * Array of keys to dynamically extract properties from each document.\n * Must be explicitly set by the parent component.\n */\n @Prop() searchKeys = '';\n\n /**\n * Custom styles to apply to search results.\n * Expected format: JSON string, e.g., '{\"borderRadius\": \"10px\", \"padding\": \"16px\"}'\n */\n @Prop() customStylesForResults: string | Record<string, string> = {};\n\n @Element() hostElement: HTMLElement; // Reference to the host element\n\n private unsubscribe: () => void;\n\n componentDidLoad() {\n // Initialize searchKeys if not provided\n if (!this.searchKeys || this.searchKeys.length === 0) {\n console.warn('No searchKeys provided; using empty keys array.');\n this.searchKeys = ''; // Ensure it's explicitly set as an empty array\n }\n\n // Subscribe to state changes\n this.unsubscribe = useSearchcraftStore.subscribe((state) => {\n this.searchResults = { ...state.searchResults };\n this.query = state.query;\n });\n\n // Fetch initial state\n const { searchResults, query } = useSearchcraftStore.getState();\n this.searchResults = searchResults;\n this.query = query;\n }\n\n disconnectedCallback() {\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n }\n\n render() {\n if (!this.searchResults?.data) {\n console.warn('No search results data available');\n return <div>No results to display.</div>;\n }\n\n const parsedSearchKeys = parseSearchKeys(this.searchKeys);\n const parsedCustomStyles = parseCustomStyles(this.customStylesForResults);\n return (\n <div class='resultsContainer'>\n {this.searchResults?.data?.hits?.map((document, index) => {\n const { doc: result } = document;\n const dynamicProperties = extractDynamicProperties(\n result,\n parsedSearchKeys,\n );\n\n // Render the custom element if present, otherwise fallback to default\n const customElement = this.hostElement.querySelector(\n '[slot=\"result-template\"]',\n );\n if (customElement) {\n // Clone the custom element and pass data to it\n const customElementClone = customElement.cloneNode(\n true,\n ) as HTMLElement;\n customElementClone.removeAttribute('slot'); // Remove the slot attribute\n customElementClone.setAttribute(\n 'data-result',\n JSON.stringify(result),\n );\n return (\n <div key={`${dynamicProperties.id}-${index}`}>\n {customElementClone.outerHTML}\n </div>\n );\n }\n // Fallback to the default element\n return (\n <searchcraft-base-search-result\n key={`${dynamicProperties.id}-${index}`}\n button-callback={() => console.log('button callback')}\n result-callback={() => console.log('interactive element')}\n keydown-callback={() => console.log('keydown')}\n is-interactive={true}\n heading-text={dynamicProperties[parsedSearchKeys[0]]}\n subheading-text={dynamicProperties[parsedSearchKeys[1]]}\n primary-content={dynamicProperties[parsedSearchKeys[2]]}\n secondary-content={dynamicProperties[parsedSearchKeys[3]]}\n tertiary-content={dynamicProperties[parsedSearchKeys[4]]}\n image-source={\n dynamicProperties[parsedSearchKeys[parsedSearchKeys.length - 1]]\n }\n customStyles={parsedCustomStyles}\n />\n );\n })}\n\n {this.query.length > 0 &&\n this.searchResults?.data?.hits?.length === 0 && (\n <searchcraft-error-message\n error-message={`No search results found for \"${this.query}\" query`}\n />\n )}\n\n {/* Slot for custom element */}\n <slot name='result-template' />\n </div>\n );\n }\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--font-stack: Helvetica, Arial, sans-serif;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.resultsContainer {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
margin: 100px 20px;
|
|
10
|
-
}
|
|
11
|
-
.resultsContainer > p {
|
|
12
|
-
align-self: center;
|
|
13
|
-
}
|
|
14
|
-
.resultsContainer > div {
|
|
15
|
-
margin-bottom: 20px;
|
|
16
|
-
}
|
|
17
|
-
.resultsContainer > div img {
|
|
18
|
-
height: 300px;
|
|
19
|
-
width: 200px;
|
|
20
|
-
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { h, Fragment, } from "@stencil/core";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
export class SearchcraftButton {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.handleClick = () => {
|
|
6
|
-
this.buttonClick.emit(); // Emit the event instead of calling a function
|
|
7
|
-
};
|
|
8
|
-
this.iconElement = undefined;
|
|
9
|
-
this.iconOnly = false;
|
|
10
|
-
this.iconPosition = 'left';
|
|
11
|
-
this.label = 'Search';
|
|
12
|
-
this.isRequesting = false;
|
|
13
|
-
this.theme = 'light';
|
|
14
|
-
}
|
|
15
|
-
getButtonStyle() {
|
|
16
|
-
return this.theme === 'light' ? 'buttonLight' : 'buttonDark';
|
|
17
|
-
}
|
|
18
|
-
render() {
|
|
19
|
-
const buttonStyle = this.getButtonStyle();
|
|
20
|
-
return (h(Fragment, { key: 'd95f39680caa437650f45f089c25273ddf24e076' }, this.iconOnly ? (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.isRequesting ? (h("searchcraft-spinner-dark", null)) : (this.iconElement))) : (h("button", { class: classNames(buttonStyle, 'searchcraft-button'), onClick: this.handleClick, type: 'submit' }, this.iconPosition === 'left' && this.isRequesting ? (h("div", { class: 'spinner-margin-right' }, h("searchcraft-spinner-dark", null))) : (this.iconElement), h("span", { class: classNames(this.isRequesting && 'button-label', 'searchcraft-button-label') }, this.label)))));
|
|
21
|
-
}
|
|
22
|
-
static get is() { return "searchcraft-button"; }
|
|
23
|
-
static get encapsulation() { return "shadow"; }
|
|
24
|
-
static get originalStyleUrls() {
|
|
25
|
-
return {
|
|
26
|
-
"$": ["searchcraft-button.module.scss"]
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
static get styleUrls() {
|
|
30
|
-
return {
|
|
31
|
-
"$": ["searchcraft-button.module.css"]
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
static get properties() {
|
|
35
|
-
return {
|
|
36
|
-
"iconElement": {
|
|
37
|
-
"type": "unknown",
|
|
38
|
-
"mutable": false,
|
|
39
|
-
"complexType": {
|
|
40
|
-
"original": "Element",
|
|
41
|
-
"resolved": "Element",
|
|
42
|
-
"references": {
|
|
43
|
-
"Element": {
|
|
44
|
-
"location": "global",
|
|
45
|
-
"id": "global::Element"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"required": false,
|
|
50
|
-
"optional": true,
|
|
51
|
-
"docs": {
|
|
52
|
-
"tags": [],
|
|
53
|
-
"text": ""
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"iconOnly": {
|
|
57
|
-
"type": "boolean",
|
|
58
|
-
"mutable": false,
|
|
59
|
-
"complexType": {
|
|
60
|
-
"original": "boolean",
|
|
61
|
-
"resolved": "boolean",
|
|
62
|
-
"references": {}
|
|
63
|
-
},
|
|
64
|
-
"required": false,
|
|
65
|
-
"optional": false,
|
|
66
|
-
"docs": {
|
|
67
|
-
"tags": [],
|
|
68
|
-
"text": ""
|
|
69
|
-
},
|
|
70
|
-
"attribute": "icon-only",
|
|
71
|
-
"reflect": false,
|
|
72
|
-
"defaultValue": "false"
|
|
73
|
-
},
|
|
74
|
-
"iconPosition": {
|
|
75
|
-
"type": "string",
|
|
76
|
-
"mutable": false,
|
|
77
|
-
"complexType": {
|
|
78
|
-
"original": "string",
|
|
79
|
-
"resolved": "string",
|
|
80
|
-
"references": {}
|
|
81
|
-
},
|
|
82
|
-
"required": false,
|
|
83
|
-
"optional": false,
|
|
84
|
-
"docs": {
|
|
85
|
-
"tags": [],
|
|
86
|
-
"text": ""
|
|
87
|
-
},
|
|
88
|
-
"attribute": "icon-position",
|
|
89
|
-
"reflect": false,
|
|
90
|
-
"defaultValue": "'left'"
|
|
91
|
-
},
|
|
92
|
-
"label": {
|
|
93
|
-
"type": "string",
|
|
94
|
-
"mutable": false,
|
|
95
|
-
"complexType": {
|
|
96
|
-
"original": "string",
|
|
97
|
-
"resolved": "string",
|
|
98
|
-
"references": {}
|
|
99
|
-
},
|
|
100
|
-
"required": false,
|
|
101
|
-
"optional": false,
|
|
102
|
-
"docs": {
|
|
103
|
-
"tags": [],
|
|
104
|
-
"text": ""
|
|
105
|
-
},
|
|
106
|
-
"attribute": "label",
|
|
107
|
-
"reflect": false,
|
|
108
|
-
"defaultValue": "'Search'"
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
static get states() {
|
|
113
|
-
return {
|
|
114
|
-
"isRequesting": {},
|
|
115
|
-
"theme": {}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
static get events() {
|
|
119
|
-
return [{
|
|
120
|
-
"method": "buttonClick",
|
|
121
|
-
"name": "buttonClick",
|
|
122
|
-
"bubbles": true,
|
|
123
|
-
"cancelable": true,
|
|
124
|
-
"composed": true,
|
|
125
|
-
"docs": {
|
|
126
|
-
"tags": [],
|
|
127
|
-
"text": ""
|
|
128
|
-
},
|
|
129
|
-
"complexType": {
|
|
130
|
-
"original": "void",
|
|
131
|
-
"resolved": "void",
|
|
132
|
-
"references": {}
|
|
133
|
-
}
|
|
134
|
-
}];
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=searchcraft-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchcraft-button.js","sourceRoot":"","sources":["../../../src/components/searchcraft-button/searchcraft-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,IAAI,EACJ,CAAC,EACD,KAAK,EACL,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,UAAU,MAAM,YAAY,CAAC;AAOpC,MAAM,OAAO,iBAAiB;;QAepB,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,+CAA+C;QAC1E,CAAC,CAAC;;wBAfiB,KAAK;4BACD,MAAM;qBACb,QAAQ;4BAIA,KAAK;qBACZ,OAAO;;IAEhB,cAAc;QACpB,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;IAC/D,CAAC;IAMD,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAE1C,OAAO,CACL,EAAC,QAAQ,uDACN,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CACf,cACE,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ,IAEZ,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB,mCAA4B,CAC7B,CAAC,CAAC,CAAC,CACF,IAAI,CAAC,WAAW,CACjB,CACM,CACV,CAAC,CAAC,CAAC,CACF,cACE,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAC,QAAQ;YAEZ,IAAI,CAAC,YAAY,KAAK,MAAM,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACnD,WAAK,KAAK,EAAC,sBAAsB;gBAC/B,mCAA4B,CACxB,CACP,CAAC,CAAC,CAAC,CACF,IAAI,CAAC,WAAW,CACjB;YACD,YACE,KAAK,EAAE,UAAU,CACf,IAAI,CAAC,YAAY,IAAI,cAAc,EACnC,0BAA0B,CAC3B,IAEA,IAAI,CAAC,KAAK,CACN,CACA,CACV,CACQ,CACZ,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Event,\n type EventEmitter,\n Prop,\n h,\n State,\n Fragment,\n} from '@stencil/core';\nimport classNames from 'classnames';\n\n@Component({\n tag: 'searchcraft-button',\n styleUrl: 'searchcraft-button.module.scss',\n shadow: true,\n})\nexport class SearchcraftButton {\n @Prop() iconElement?: Element;\n @Prop() iconOnly = false;\n @Prop() iconPosition = 'left';\n @Prop() label = 'Search';\n\n @Event() buttonClick!: EventEmitter<void>;\n\n @State() isRequesting = false;\n @State() theme = 'light';\n\n private getButtonStyle() {\n return this.theme === 'light' ? 'buttonLight' : 'buttonDark';\n }\n\n private handleClick = () => {\n this.buttonClick.emit(); // Emit the event instead of calling a function\n };\n\n render() {\n const buttonStyle = this.getButtonStyle();\n\n return (\n <Fragment>\n {this.iconOnly ? (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.isRequesting ? (\n <searchcraft-spinner-dark />\n ) : (\n this.iconElement\n )}\n </button>\n ) : (\n <button\n class={classNames(buttonStyle, 'searchcraft-button')}\n onClick={this.handleClick}\n type='submit'\n >\n {this.iconPosition === 'left' && this.isRequesting ? (\n <div class='spinner-margin-right'>\n <searchcraft-spinner-dark />\n </div>\n ) : (\n this.iconElement\n )}\n <span\n class={classNames(\n this.isRequesting && 'button-label',\n 'searchcraft-button-label',\n )}\n >\n {this.label}\n </span>\n </button>\n )}\n </Fragment>\n );\n }\n}\n"]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--font-stack: Helvetica, Arial, sans-serif;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.buttonLight {
|
|
6
|
-
border-radius: 8px;
|
|
7
|
-
display: flex;
|
|
8
|
-
font-family: var(--font-stack);
|
|
9
|
-
font-size: 16px;
|
|
10
|
-
font-weight: 700;
|
|
11
|
-
line-height: 20px;
|
|
12
|
-
padding: 11px 20px;
|
|
13
|
-
position: relative;
|
|
14
|
-
background-color: #000;
|
|
15
|
-
border: 1px solid #E6E6E6;
|
|
16
|
-
color: #FFF;
|
|
17
|
-
}
|
|
18
|
-
.buttonLight:hover {
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
}
|
|
21
|
-
.buttonLight:hover {
|
|
22
|
-
background-color: #2E2E2E;
|
|
23
|
-
}
|
|
24
|
-
.buttonLight:focus {
|
|
25
|
-
outline: 2px solid #000000;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.buttonDark {
|
|
29
|
-
border-radius: 8px;
|
|
30
|
-
display: flex;
|
|
31
|
-
font-family: var(--font-stack);
|
|
32
|
-
font-size: 16px;
|
|
33
|
-
font-weight: 700;
|
|
34
|
-
line-height: 20px;
|
|
35
|
-
padding: 11px 20px;
|
|
36
|
-
position: relative;
|
|
37
|
-
background-color: #FFF;
|
|
38
|
-
border: 1px solid #404040;
|
|
39
|
-
color: #292929;
|
|
40
|
-
}
|
|
41
|
-
.buttonDark:hover {
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
}
|
|
44
|
-
.buttonDark:hover {
|
|
45
|
-
background-color: #FAFAFA;
|
|
46
|
-
}
|
|
47
|
-
.buttonDark:focus {
|
|
48
|
-
outline: 2px solid #404040;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.spinnerMarginRight {
|
|
52
|
-
left: 4px;
|
|
53
|
-
margin-right: 4px;
|
|
54
|
-
position: absolute;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.spinnerMarginLeft {
|
|
58
|
-
left: 4px;
|
|
59
|
-
margin-left: 4px;
|
|
60
|
-
position: absolute;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.buttonLabel {
|
|
64
|
-
animation: right-and-back 0.2s;
|
|
65
|
-
margin-left: 4px;
|
|
66
|
-
position: relative;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@keyframes right-and-back {
|
|
70
|
-
0% {
|
|
71
|
-
right: -6px;
|
|
72
|
-
}
|
|
73
|
-
50% {
|
|
74
|
-
right: -12px;
|
|
75
|
-
}
|
|
76
|
-
75% {
|
|
77
|
-
right: -6px;
|
|
78
|
-
}
|
|
79
|
-
100% {
|
|
80
|
-
right: 0px;
|
|
81
|
-
}
|
|
82
|
-
}
|