@lanaco/lnc-react-ui 4.0.26 → 4.0.28

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/index10.js CHANGED
@@ -1,152 +1,254 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as g } from "react";
3
- import { n as s } from "./emotion-styled.browser.esm-BiK8DcgW.js";
4
- import { M as f } from "./consts-DNVz1x1I.js";
5
- import { u as w } from "./useDetectMobile-BookNOsk.js";
6
- import { R as v } from "./style-Ch-xOasu.js";
7
- import { t as k, m as h, l as y, k as N } from "./utils-DtEdJZWa.js";
8
- const S = s.div`
9
- width: 100%;
10
- height: 22.5rem;
11
- min-height: 22.5rem;
12
- max-height: 22.5rem;
13
- overflow: hidden;
14
- box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.1),
15
- 0px 1px 2px 0px rgba(0, 0, 0, 0.06);
16
- border: 1px solid var(--gray-95008, #14161a14);
1
+ import { jsx as i, jsxs as l } from "react/jsx-runtime";
2
+ import { forwardRef as m } from "react";
3
+ import { n as p } from "./emotion-styled.browser.esm-BiK8DcgW.js";
4
+ import { t as v, m as y, l as b } from "./utils-DtEdJZWa.js";
5
+ import $ from "./Icon.js";
6
+ import { u as k } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
7
+ import { M as N } from "./consts-DNVz1x1I.js";
8
+ const W = p.div`
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: flex-start;
12
+ flex-shrink: 0;
13
+ align-self: stretch;
17
14
  border-radius: 0.75rem;
18
- margin-bottom: 0.5rem;
15
+ border: 1px solid var(--neutral-9508, rgba(20, 22, 26, 0.08));
16
+ background: var(--Lanaco-Gray-white, #fff);
17
+
18
+ /* drop-shadow-sm */
19
+ box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
19
20
 
20
- & img {
21
+ & .wrapper__image {
21
22
  width: 100%;
22
- height: 100%;
23
+ aspect-ratio: 1 / 1;
23
24
  object-fit: cover;
25
+ height: auto;
26
+ border-radius: 0.75rem 0.75rem 0 0;
24
27
  }
25
- `, $ = s.div`
26
- display: grid;
27
- grid-template-columns: ${(a) => `repeat(${a.limit}, minmax(0, 1fr))`};
28
- gap: 1.25rem;
29
28
 
30
- @media (max-width: ${f + "px"}) {
29
+ & .wrapper__content {
31
30
  display: flex;
32
- gap: 1rem;
33
- overflow-x: auto;
31
+ padding: 0.75rem;
32
+ flex-direction: column;
33
+ align-items: flex-start;
34
+ gap: 0.25rem;
35
+ align-self: stretch;
34
36
 
35
- -webkit-overflow-scrolling: touch;
36
- ::-webkit-scrollbar {
37
- -webkit-appearance: none;
37
+ & .wrapper__title {
38
+ color: var(--gray-950);
39
+ font-size: 1rem;
40
+ font-style: normal;
41
+ font-weight: 500;
42
+ line-height: 1.5rem;
43
+ ${v(2)}
38
44
  }
39
- -ms-overflow-style: none;
40
- /* Internet Explorer 10+ */
41
- scrollbar-width: none;
42
- /* Firefox */
43
-
44
- &::-webkit-scrollbar {
45
- display: none;
46
- /* Safari and Chrome */
45
+
46
+ & .wrapper__description {
47
+ color: var(--gray-600);
48
+ font-size: 0.75rem;
49
+ font-style: normal;
50
+ font-weight: 400;
51
+ line-height: 1rem;
52
+ letter-spacing: 0.025rem;
53
+ ${v(2)}
47
54
  }
48
55
  }
49
- `, j = s.div`
56
+ `, I = p.div`
57
+ width: 100%;
58
+ height: 11.625rem;
59
+ border-radius: 0.75rem;
60
+ background: ${y("-90deg")};
61
+ `, C = p.div`
50
62
  display: flex;
51
- flex-direction: column;
52
- gap: 0.5rem;
53
- cursor: pointer;
63
+ padding: 0 0.75rem 0 0;
64
+ align-items: center;
65
+ background: var(--neutral-9504, rgba(20, 22, 26, 0.04));
66
+ border-radius: 999px;
54
67
 
55
- & img {
56
- width: 100%;
57
- aspect-ratio: 1 / 1; /* defining the aspect ratio of the image */
58
- object-fit: cover; /* making sure the image isn't distorted */
59
- border-radius: 0.75rem;
68
+ & .wrapper__icon {
69
+ font-size: 1.75rem;
70
+ color: var(--gray-950, #14161a);
71
+ background: var(--gray-200);
72
+ border-radius: 999px;
73
+ width: 2.75rem;
74
+ height: 2.75rem;
75
+
76
+ & i {
77
+ width: auto;
78
+ }
60
79
  }
61
80
 
62
- & .card-title {
63
- font-size: 0.875rem;
64
- font-weight: 600;
65
- ${k(2)}
81
+ & .wrapper__text {
82
+ color: var(--gray-950, #14161a);
83
+ text-align: center;
84
+ font-size: 1rem;
85
+ font-style: normal;
86
+ font-weight: 400;
87
+ line-height: 1.5rem;
88
+ }
89
+
90
+ &.active {
91
+ background: var(--yellow-600, #d97706);
92
+
93
+ & .wrapper__icon {
94
+ color: var(--white, #fff);
95
+ }
96
+
97
+ & .wrapper__text {
98
+ color: var(--white, #fff);
99
+ }
66
100
  }
101
+ `, T = p.div`
102
+ width: 7rem;
103
+ height: 3rem;
104
+ border-radius: 999px;
105
+ background: ${y("-90deg")};
106
+ `, j = m(({}, r) => /* @__PURE__ */ i(T, {})), z = m(
107
+ ({ text: r, isActive: n, icon: t, onSelectCard: s = () => {
108
+ } }, f) => /* @__PURE__ */ l(C, { className: n ? "active" : "", onClick: s, children: [
109
+ /* @__PURE__ */ i($, { icon: t, className: "wrapper__icon" }),
110
+ /* @__PURE__ */ i("div", { className: "wrapper__text", children: r })
111
+ ] })
112
+ ), F = m(
113
+ ({ image: r, imageComponent: n, title: t, description: s, onSelectCard: f = () => {
114
+ } }, w) => {
115
+ const { theme: d } = k();
116
+ return /* @__PURE__ */ l(W, { theme: d, onClick: f, children: [
117
+ b(n) ? n : /* @__PURE__ */ i("img", { src: r, className: "wrapper__image" }),
118
+ /* @__PURE__ */ l("div", { className: "wrapper__content", children: [
119
+ t && /* @__PURE__ */ i("div", { className: "wrapper__title", children: t }),
120
+ s && /* @__PURE__ */ i("div", { className: "wrapper__description", children: s })
121
+ ] })
122
+ ] });
123
+ }
124
+ ), O = m(({}, r) => /* @__PURE__ */ i(I, {})), A = p.div`
125
+ display: flex;
126
+ flex-direction: column;
127
+ align-items: center;
128
+ gap: 1.5rem;
129
+
130
+ & .wrapper__heading {
131
+ display: flex;
132
+ flex-direction: column;
133
+ gap: 1rem;
134
+ text-align: center;
67
135
 
68
- &:hover {
69
- & .card-title {
70
- color: var(--primary-500, #F59E0B);
136
+ & .wrapper__title {
137
+ color: var(--gray-950, #14161a);
138
+ text-align: center;
139
+ font-size: 1.5rem;
140
+ font-style: normal;
141
+ font-weight: 600;
142
+ line-height: 2rem;
143
+ letter-spacing: -0.47px;
144
+ }
145
+
146
+ & .wrapper__subtitle {
147
+ color: var(---gray-600, #676e79);
148
+ font-size: 0.875rem;
149
+ font-style: normal;
150
+ font-weight: 400;
151
+ line-height: 1.25rem;
152
+ letter-spacing: 0.25px;
71
153
  }
72
154
  }
73
155
 
74
- & .skeleton-img {
75
- background-color: ${h("-90deg")};
76
- border-radius: 0.75rem;
77
- border: 1px solid white;
156
+ & .wrapper__tags {
157
+ display: grid;
158
+ grid-template-columns: ${(r) => `repeat(${r == null ? void 0 : r.limitTags}, minmax(0, 1fr))`};
159
+ justify-content: center;
160
+ align-items: center;
161
+ gap: 0.75rem;
78
162
  }
79
163
 
80
- & .skeleton-title {
81
- background-color: ${h("-90deg")};
164
+ & .wrapper__cards {
165
+ display: grid;
166
+ grid-template-columns: ${(r) => `repeat(${r == null ? void 0 : r.limitCards}, minmax(0, 1fr))`};
167
+ justify-content: center;
168
+ align-items: center;
169
+ gap: 1.5rem;
82
170
  width: 100%;
83
- height: 1.25rem;
84
171
  }
85
172
 
86
- @media (max-width: ${f + "px"}) {
87
- & img {
88
- width: 8.875rem;
89
- height: 8.875rem;
90
- min-width: 8.875rem;
91
- min-height: 8.875rem;
92
- min-width: 8.875rem;
93
- min-height: 8.875rem;
94
- object-fit: cover;
173
+ @media (max-width: ${N + "px"}) {
174
+ & .wrapper__tags {
175
+ display: flex;
176
+ overflow-x: scroll;
177
+ justify-content: flex-start;
178
+ width: 100%;
179
+ }
180
+
181
+ & .wrapper__cards {
182
+ grid-template-columns: ${(r) => `repeat(${r == null ? void 0 : r.limitCardsForMobile}, minmax(0, 1fr))`};
183
+ gap: 1rem;
95
184
  }
96
185
  }
97
- `, u = g((a, c) => {
98
- const {
99
- uuid: l,
100
- title: i,
101
- image: o,
102
- sellerUuid: p,
103
- onSelectCard: t = () => {
186
+ `, X = m(
187
+ ({
188
+ title: r,
189
+ subtitle: n,
190
+ tags: t = [],
191
+ limitTags: s = 7,
192
+ limitTagsForMobile: f = 7,
193
+ limitCards: w = 3,
194
+ limitCardsForMobile: d = 2,
195
+ cards: a = [],
196
+ onSelectTag: h = () => {
104
197
  },
105
- imageComponent: d
106
- } = a;
107
- return /* @__PURE__ */ m(j, { className: "product-card", onClick: t, children: [
108
- y(d) ? d : /* @__PURE__ */ r("img", { src: o }),
109
- /* @__PURE__ */ r("div", { className: "card-title", children: i })
110
- ] });
111
- }), P = g((a, c) => {
112
- const {
113
- icon: l,
114
- items: i,
115
- limit: o = 4,
116
- bannerImage: p,
117
- onSelectCard: t = () => {
118
- },
119
- title: d = "Season inspiration"
120
- } = a, b = w();
121
- return /* @__PURE__ */ m(v, { ref: c, children: [
122
- /* @__PURE__ */ r("div", { className: "regular-title", children: /* @__PURE__ */ m("div", { className: "regular-title-text", children: [
123
- N(l) && /* @__PURE__ */ r("i", { className: l }),
124
- /* @__PURE__ */ r("span", { children: d })
125
- ] }) }),
126
- /* @__PURE__ */ r(S, { className: "products-banner", children: /* @__PURE__ */ r("img", { src: p }) }),
127
- /* @__PURE__ */ r($, { limit: o, children: b === !0 ? i == null ? void 0 : i.map((e, n) => /* @__PURE__ */ r(
128
- u,
129
- {
130
- title: e == null ? void 0 : e.title,
131
- image: e == null ? void 0 : e.image,
132
- sellerUuid: e == null ? void 0 : e.sellerUuid,
133
- uuid: e == null ? void 0 : e.uuid,
134
- onSelectCard: () => t == null ? void 0 : t(e == null ? void 0 : e.uuid)
135
- },
136
- n
137
- )) : i == null ? void 0 : i.slice(0, o).map((e, n) => /* @__PURE__ */ r(
138
- u,
198
+ onSelectCard: _ = () => {
199
+ }
200
+ }, M) => {
201
+ var x, u;
202
+ const c = (e) => {
203
+ h == null || h(e == null ? void 0 : e.uuid);
204
+ }, g = (e) => {
205
+ _ == null || _(e == null ? void 0 : e.uuid);
206
+ };
207
+ return /* @__PURE__ */ l(
208
+ A,
139
209
  {
140
- title: e == null ? void 0 : e.title,
141
- image: e == null ? void 0 : e.image,
142
- sellerUuid: e == null ? void 0 : e.sellerUuid,
143
- uuid: e == null ? void 0 : e.uuid,
144
- onSelectCard: () => t == null ? void 0 : t(e == null ? void 0 : e.uuid)
145
- },
146
- n
147
- )) })
148
- ] });
149
- });
210
+ limitTags: s,
211
+ limitTagsForMobile: f,
212
+ limitCards: w,
213
+ limitCardsForMobile: d,
214
+ children: [
215
+ /* @__PURE__ */ l("div", { className: "wrapper__heading", children: [
216
+ r && /* @__PURE__ */ i("div", { className: "wrapper__title", children: r }),
217
+ n && /* @__PURE__ */ i("div", { className: "wrapper__subtitle", children: n })
218
+ ] }),
219
+ /* @__PURE__ */ i("div", { className: "wrapper__tags", children: t && (t == null ? void 0 : t.length) > 0 ? t == null ? void 0 : t.map((e, o) => /* @__PURE__ */ i(
220
+ z,
221
+ {
222
+ icon: e == null ? void 0 : e.icon,
223
+ text: e == null ? void 0 : e.text,
224
+ onSelectCard: () => c == null ? void 0 : c(e)
225
+ },
226
+ `field-of-interests-with-tags-card-tag__${o + 1}`
227
+ )) : (x = Array.from("123")) == null ? void 0 : x.map((e, o) => /* @__PURE__ */ i(
228
+ j,
229
+ {},
230
+ `field-of-interests-with-tags-card-tag-skeleton__${o + 1}`
231
+ )) }),
232
+ /* @__PURE__ */ i("div", { className: "wrapper__cards", children: a && (a == null ? void 0 : a.length) > 0 ? a == null ? void 0 : a.map((e, o) => /* @__PURE__ */ i(
233
+ F,
234
+ {
235
+ image: e == null ? void 0 : e.image,
236
+ imageComponent: e == null ? void 0 : e.imageComponent,
237
+ title: e == null ? void 0 : e.title,
238
+ description: e == null ? void 0 : e.description,
239
+ onSelectCard: () => g == null ? void 0 : g(e == null ? void 0 : e.uuid)
240
+ },
241
+ `field-of-interests-with-tags-card__${o + 1}`
242
+ )) : (u = Array.from("123")) == null ? void 0 : u.map((e, o) => /* @__PURE__ */ i(
243
+ O,
244
+ {},
245
+ `field-of-interests-with-tags-card-skeleton__${o + 1}`
246
+ )) })
247
+ ]
248
+ }
249
+ );
250
+ }
251
+ );
150
252
  export {
151
- P as default
253
+ X as default
152
254
  };