@lanaco/lnc-react-ui 4.0.124 → 4.0.126

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.
@@ -1,270 +1,77 @@
1
- import { jsx as r, jsxs as l, Fragment as y } from "react/jsx-runtime";
2
- import { forwardRef as S, useState as T, useMemo as $ } from "react";
1
+ import { jsx as s, jsxs as i, Fragment as b } from "react/jsx-runtime";
2
+ import { forwardRef as N, useState as x, useMemo as q } from "react";
3
3
  import { P as n } from "./index-CblbdqjE.js";
4
- import z from "./Chip.js";
5
- import { s as k } from "./emotion-styled.browser.esm-BNN1dTl3.js";
6
- import { M as I } from "./consts-BuFChS64.js";
7
- import { u as E } from "./useDetectMobile-Bkvj0VMa.js";
8
- import N from "./Icon.js";
9
- import C from "./IconButton.js";
10
- import F from "./Button.js";
11
- const j = k.div`
12
- display: flex;
13
- gap: 0.75rem;
14
- align-items: center;
15
- align-content: center;
16
-
17
- & .tags__item {
18
- color: var(--gray-900, #0c1520);
19
- background: var(--gray-100, #f3f6fb);
20
- font-size: 0.875rem;
21
- font-style: normal;
22
- font-weight: 400;
23
- line-height: 1.25rem;
24
- letter-spacing: -0.0056rem;
25
- padding: 0.5rem 0.75rem;
26
-
27
- &.active {
28
- color: var(--white, #fff);
29
- background: var(--gray-900, #0c1520);
30
- font-weight: 500;
31
-
32
- &:hover {
33
- color: var(--white, #fff);
34
- background: var(--gray-900, #0c1520);
35
- }
36
- }
37
-
38
- &:hover {
39
- background: var(--gray-200, #e4e9f0);
40
- }
41
-
42
- &:focus {
43
- outline: none;
44
- }
45
- }
46
-
47
- @media (max-width: ${I + "px"}) {
48
- width: 100%;
49
- overflow-x: auto;
50
- white-space: nowrap;
51
-
52
- -webkit-overflow-scrolling: touch;
53
- ::-webkit-scrollbar {
54
- -webkit-appearance: none;
55
- }
56
- -ms-overflow-style: none;
57
- /* Internet Explorer 10+ */
58
- scrollbar-width: none;
59
- /* Firefox */
60
-
61
- &::-webkit-scrollbar {
62
- display: none;
63
- /* Safari and Chrome */
64
- }
65
- }
66
- `, P = k.div`
67
- display: flex;
68
- gap: 1.25rem;
69
- width: 100%;
70
-
71
- & .section__column {
72
- display: flex;
73
- flex-direction: column;
74
- gap: 1.25rem;
75
- width: 100%;
76
- }
77
-
78
- & .section__show-more {
79
- color: var(--neutral-600, #0f2a46);
80
- font-size: 0.875rem;
81
- font-style: normal;
82
- font-weight: 500;
83
- line-height: 1.25rem;
84
- letter-spacing: -0.0056rem;
85
-
86
- &:focus {
87
- outline: none;
88
- }
89
- }
90
-
91
- @media (max-width: ${I + "px"}) {
92
- flex-direction: column;
93
- }
94
- `, R = k.div`
95
- width: 100%;
96
- height: fit-content;
97
- background: var(--white, #fff);
98
- border: 1px solid var(--gray-100, #f3f6fb);
99
- display: flex;
100
- flex-direction: column;
101
- gap: 0.75rem;
102
- padding: 1rem;
103
- border-radius: 0.75rem;
104
-
105
- &:hover {
106
- cursor: pointer;
107
- }
108
-
109
- &.expanded {
110
- border: 1px solid #ff7621;
111
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.16),
112
- 0 1px 4px 0 rgba(255, 118, 33, 0.5) inset;
113
- }
114
-
115
- & .card__heading {
116
- display: flex;
117
- justify-content: space-between;
118
- width: 100%;
119
-
120
- & .card__title {
121
- color: var(--neutral-600, #0f2a46);
122
- font-size: 1rem;
123
- font-style: normal;
124
- font-weight: 500;
125
- line-height: 1.5rem;
126
- }
127
-
128
- & .card__icon {
129
- color: var(--neutral-600, #0f2a46);
130
- }
131
- }
132
-
133
- & .card__description {
134
- color: var(--neutral-400, #47607b);
135
- font-size: 0.875rem;
136
- font-style: normal;
137
- font-weight: 400;
138
- line-height: 1.25rem;
139
- letter-spacing: 0.0156rem;
140
- }
141
-
142
- & .card__impression {
143
- display: flex;
144
- align-items: center;
145
- gap: 0.75rem;
146
-
147
- & .imppression__question {
148
- color: var(--gray-500, #7a8594);
149
- font-size: 0.75rem;
150
- font-style: normal;
151
- font-weight: 500;
152
- line-height: 1rem;
153
- letter-spacing: 0.0313rem;
154
- }
155
-
156
- & .impression__actions {
157
- display: flex;
158
- gap: 0.5rem;
159
-
160
- button {
161
- color: var(--gray-600, #676e79);
162
-
163
- &:focus {
164
- outline: none;
165
- }
166
- }
167
- }
168
-
169
- &.feedback {
170
- gap: 0.25rem;
171
- }
172
- }
173
-
174
- @media (max-width: ${I + "px"}) {
175
- & .card__impression {
176
- justify-content: space-between;
177
-
178
- &.feedback {
179
- justify-content: flex-start;
180
- }
181
- }
182
- }
183
- `, q = S(
184
- ({ tags: s = [], allTagText: a, selectedTagCode: d = null, onSelectTag: h = () => {
185
- } }, p) => /* @__PURE__ */ r(j, { children: [{ name: a, code: null }, ...s].map((i, f) => /* @__PURE__ */ r(
186
- z,
187
- {
188
- label: i == null ? void 0 : i.name,
189
- borderRadius: "curved",
190
- color: "neutral",
191
- className: `tags__item ${d === (i == null ? void 0 : i.code) ? "active" : ""}`,
192
- onClick: () => {
193
- h(i);
194
- }
195
- },
196
- `faq-section-tag__${f + 1}`
197
- )) })
198
- );
199
- q.propTypes = {
200
- tags: n.array,
201
- allTagText: n.string,
202
- onSelectTag: n.func
203
- };
204
- const b = ({
205
- title: s,
4
+ import { I as M, a as C, F } from "./tag-D6in2BG6.js";
5
+ import { u as $ } from "./useDetectMobile-Bkvj0VMa.js";
6
+ import w from "./Icon.js";
7
+ import S from "./IconButton.js";
8
+ import E from "./Button.js";
9
+ import { s as P } from "./emotion-styled.browser.esm-BNN1dTl3.js";
10
+ import { M as z } from "./consts-BuFChS64.js";
11
+ const I = ({
12
+ title: t,
206
13
  description: a,
207
- questionText: d,
208
- feedbackText: h,
209
- impressions: p = !1,
210
- onSelectItem: i = () => {
14
+ questionText: l,
15
+ feedbackText: _,
16
+ impressions: d = !1,
17
+ onSelectItem: p = () => {
211
18
  },
212
- onImpressed: f = () => {
19
+ onImpressed: h = () => {
213
20
  }
214
21
  }) => {
215
- const [m, c] = T(!1), [g, u] = T(!1), _ = () => {
216
- c((t) => !t), i();
217
- }, o = (t, w) => {
218
- t == null || t.stopPropagation(), u(!0), f(w);
22
+ const [f, c] = x(!1), [u, g] = x(!1), m = () => {
23
+ c((r) => !r), p();
24
+ }, o = (r, T) => {
25
+ r == null || r.stopPropagation(), g(!0), h(T);
219
26
  };
220
- return /* @__PURE__ */ l(
221
- R,
27
+ return /* @__PURE__ */ i(
28
+ C,
222
29
  {
223
- className: m ? "expanded" : "",
224
- onClick: _,
30
+ className: f ? "expanded" : "",
31
+ onClick: m,
225
32
  children: [
226
- /* @__PURE__ */ l("div", { className: "card__heading", children: [
227
- /* @__PURE__ */ r("div", { className: "card__title", children: s }),
228
- /* @__PURE__ */ r(
229
- N,
33
+ /* @__PURE__ */ i("div", { className: "card__heading", children: [
34
+ /* @__PURE__ */ s("div", { className: "card__title", children: t }),
35
+ /* @__PURE__ */ s(
36
+ w,
230
37
  {
231
- icon: m ? " mng-lnc-subtract" : " mng-lnc-add",
38
+ icon: f ? " mng-lnc-subtract" : " mng-lnc-add",
232
39
  sizeInUnits: "1.25rem",
233
40
  className: "card__icon"
234
41
  }
235
42
  )
236
43
  ] }),
237
- m && /* @__PURE__ */ l(y, { children: [
238
- /* @__PURE__ */ r("div", { className: "card__description", children: a }),
239
- p && /* @__PURE__ */ r(y, { children: g ? /* @__PURE__ */ l("div", { className: "card__impression feedback", children: [
240
- /* @__PURE__ */ r(
241
- N,
44
+ f && /* @__PURE__ */ i(b, { children: [
45
+ /* @__PURE__ */ s("div", { className: "card__description", children: a }),
46
+ d && /* @__PURE__ */ s(b, { children: u ? /* @__PURE__ */ i("div", { className: "card__impression feedback", children: [
47
+ /* @__PURE__ */ s(
48
+ w,
242
49
  {
243
50
  icon: " mng-lnc-checkmark--outline",
244
51
  sizeInUnits: "1.25rem",
245
52
  color: "success"
246
53
  }
247
54
  ),
248
- /* @__PURE__ */ r("div", { className: "imppression__question", children: h })
249
- ] }) : /* @__PURE__ */ l("div", { className: "card__impression", children: [
250
- /* @__PURE__ */ r("div", { className: "imppression__question", children: d }),
251
- /* @__PURE__ */ l("div", { className: "impression__actions", children: [
252
- /* @__PURE__ */ r(
253
- C,
55
+ /* @__PURE__ */ s("div", { className: "imppression__question", children: _ })
56
+ ] }) : /* @__PURE__ */ i("div", { className: "card__impression", children: [
57
+ /* @__PURE__ */ s("div", { className: "imppression__question", children: l }),
58
+ /* @__PURE__ */ i("div", { className: "impression__actions", children: [
59
+ /* @__PURE__ */ s(
60
+ S,
254
61
  {
255
62
  icon: " mng-lnc-thumbs-up",
256
63
  borderRadius: "curved",
257
64
  btnType: "outline",
258
- onClick: (t) => o(t, !0)
65
+ onClick: (r) => o(r, !0)
259
66
  }
260
67
  ),
261
- /* @__PURE__ */ r(
262
- C,
68
+ /* @__PURE__ */ s(
69
+ S,
263
70
  {
264
71
  icon: " mng-lnc-thumbs-down",
265
72
  borderRadius: "curved",
266
73
  btnType: "outline",
267
- onClick: (t) => o(t, !1)
74
+ onClick: (r) => o(r, !1)
268
75
  }
269
76
  )
270
77
  ] })
@@ -273,87 +80,87 @@ const b = ({
273
80
  ]
274
81
  }
275
82
  );
276
- }, M = S(
83
+ }, k = N(
277
84
  ({
278
- items: s = [],
85
+ items: t = [],
279
86
  questionText: a,
280
- feedbackText: d,
281
- showMoreText: h,
282
- impressions: p = !1,
283
- onSelectItem: i = () => {
87
+ feedbackText: l,
88
+ showMoreText: _,
89
+ impressions: d = !1,
90
+ onSelectItem: p = () => {
284
91
  },
285
- onImpressed: f = () => {
92
+ onImpressed: h = () => {
286
93
  }
287
- }, m) => {
288
- const c = E(), [g, u] = T(!1), _ = () => {
289
- u((t) => !t);
290
- }, o = $(() => {
94
+ }, f) => {
95
+ const c = $(), [u, g] = x(!1), m = () => {
96
+ g((r) => !r);
97
+ }, o = q(() => {
291
98
  if (c)
292
- return s == null ? void 0 : s.map((e, v) => /* @__PURE__ */ r(
293
- b,
99
+ return t == null ? void 0 : t.map((e, v) => /* @__PURE__ */ s(
100
+ I,
294
101
  {
295
102
  title: e == null ? void 0 : e.title,
296
103
  description: e == null ? void 0 : e.description,
297
104
  questionText: a,
298
- feedbackText: d,
299
- impressions: p,
300
- onSelectItem: () => i(e),
301
- onImpressed: (x) => f(e, x)
105
+ feedbackText: l,
106
+ impressions: d,
107
+ onSelectItem: () => p(e),
108
+ onImpressed: (y) => h(e, y)
302
109
  },
303
110
  `faq-section-item__${v + 1}`
304
111
  ));
305
- const t = [], w = [];
306
- return s == null || s.forEach((e, v) => {
307
- v % 2 === 0 ? t.push(
308
- /* @__PURE__ */ r(
309
- b,
112
+ const r = [], T = [];
113
+ return t == null || t.forEach((e, v) => {
114
+ v % 2 === 0 ? r.push(
115
+ /* @__PURE__ */ s(
116
+ I,
310
117
  {
311
118
  title: e == null ? void 0 : e.title,
312
119
  description: e == null ? void 0 : e.description,
313
120
  questionText: a,
314
- feedbackText: d,
315
- impressions: p,
316
- onSelectItem: () => i(e),
317
- onImpressed: (x) => f(e, x)
121
+ feedbackText: l,
122
+ impressions: d,
123
+ onSelectItem: () => p(e),
124
+ onImpressed: (y) => h(e, y)
318
125
  },
319
126
  `faq-section-item__${v + 1}`
320
127
  )
321
- ) : w.push(
322
- /* @__PURE__ */ r(
323
- b,
128
+ ) : T.push(
129
+ /* @__PURE__ */ s(
130
+ I,
324
131
  {
325
132
  title: e == null ? void 0 : e.title,
326
133
  description: e == null ? void 0 : e.description,
327
134
  questionText: a,
328
- feedbackText: d,
329
- impressions: p,
330
- onSelectItem: () => i(e),
331
- onImpressed: (x) => f(e, x)
135
+ feedbackText: l,
136
+ impressions: d,
137
+ onSelectItem: () => p(e),
138
+ onImpressed: (y) => h(e, y)
332
139
  },
333
140
  `faq-section-item__${v + 1}`
334
141
  )
335
142
  );
336
- }), /* @__PURE__ */ l(y, { children: [
337
- /* @__PURE__ */ r("div", { className: "section__column", children: t }),
338
- /* @__PURE__ */ r("div", { className: "section__column", children: w })
143
+ }), /* @__PURE__ */ i(b, { children: [
144
+ /* @__PURE__ */ s("div", { className: "section__column", children: r }),
145
+ /* @__PURE__ */ s("div", { className: "section__column", children: T })
339
146
  ] });
340
- }, [s, c]);
341
- return /* @__PURE__ */ r(P, { children: c ? g ? o : /* @__PURE__ */ l(y, { children: [
147
+ }, [t, c]);
148
+ return /* @__PURE__ */ s(M, { children: c ? u ? o : /* @__PURE__ */ i(b, { children: [
342
149
  o == null ? void 0 : o.slice(0, 4),
343
- (o == null ? void 0 : o.length) > 4 && /* @__PURE__ */ r(
344
- F,
150
+ (o == null ? void 0 : o.length) > 4 && /* @__PURE__ */ s(
151
+ E,
345
152
  {
346
- text: h,
153
+ text: _,
347
154
  btnType: "basic",
348
155
  color: "neutral",
349
156
  className: "section__show-more",
350
- onClick: _
157
+ onClick: m
351
158
  }
352
159
  )
353
160
  ] }) : o });
354
161
  }
355
162
  );
356
- b.propTypes = {
163
+ I.propTypes = {
357
164
  title: n.string,
358
165
  description: n.string,
359
166
  questionText: n.string,
@@ -363,7 +170,7 @@ b.propTypes = {
363
170
  onSelectItem: n.func,
364
171
  onImpressed: n.func
365
172
  };
366
- M.propTypes = {
173
+ k.propTypes = {
367
174
  items: n.array,
368
175
  questionText: n.string,
369
176
  feedbackText: n.string,
@@ -372,7 +179,7 @@ M.propTypes = {
372
179
  onSelectItem: n.func,
373
180
  onImpressed: n.func
374
181
  };
375
- const B = k.div`
182
+ const B = P.div`
376
183
  display: flex;
377
184
  flex-direction: column;
378
185
  align-items: center;
@@ -404,7 +211,7 @@ const B = k.div`
404
211
  line-height: 1.5rem;
405
212
  }
406
213
 
407
- @media (max-width: ${I + "px"}) {
214
+ @media (max-width: ${z + "px"}) {
408
215
  & .section__title {
409
216
  font-size: 1rem;
410
217
  font-weight: 500;
@@ -418,56 +225,56 @@ const B = k.div`
418
225
  letter-spacing: 0.25px;
419
226
  }
420
227
  }
421
- `, U = S(
228
+ `, R = N(
422
229
  ({
423
- title: s,
230
+ title: t,
424
231
  description: a,
425
- questionText: d = "What do you think about this answer?",
426
- feedbackText: h = "Thank you for feedback!",
427
- showMoreText: p = "Show more",
428
- allTagText: i = "All",
429
- impressions: f = !1,
430
- tags: m = [],
232
+ questionText: l = "What do you think about this answer?",
233
+ feedbackText: _ = "Thank you for feedback!",
234
+ showMoreText: d = "Show more",
235
+ allTagText: p = "All",
236
+ impressions: h = !1,
237
+ tags: f = [],
431
238
  items: c = [],
432
- onSelectItem: g = () => {
239
+ onSelectItem: u = () => {
433
240
  },
434
- onImpressed: u = () => {
241
+ onImpressed: g = () => {
435
242
  }
436
- }, _) => {
437
- const [o, t] = T(null);
438
- return /* @__PURE__ */ l(B, { ref: _, children: [
439
- /* @__PURE__ */ l("div", { className: "section__heading", children: [
440
- s && /* @__PURE__ */ r("div", { className: "section__title", children: s }),
441
- a && /* @__PURE__ */ r("div", { className: "section__description", children: a })
243
+ }, m) => {
244
+ const [o, r] = x(null);
245
+ return /* @__PURE__ */ i(B, { ref: m, children: [
246
+ /* @__PURE__ */ i("div", { className: "section__heading", children: [
247
+ t && /* @__PURE__ */ s("div", { className: "section__title", children: t }),
248
+ a && /* @__PURE__ */ s("div", { className: "section__description", children: a })
442
249
  ] }),
443
- /* @__PURE__ */ r(
444
- q,
250
+ /* @__PURE__ */ s(
251
+ F,
445
252
  {
446
- tags: m,
447
- allTagText: i,
253
+ tags: f,
254
+ allTagText: p,
448
255
  selectedTagCode: o,
449
256
  onSelectTag: (e) => {
450
- t(e == null ? void 0 : e.code);
257
+ r(e == null ? void 0 : e.code);
451
258
  }
452
259
  }
453
260
  ),
454
- /* @__PURE__ */ r(
455
- M,
261
+ /* @__PURE__ */ s(
262
+ k,
456
263
  {
457
264
  items: o === null ? c : c == null ? void 0 : c.filter((e) => (e == null ? void 0 : e.tagCode) === o),
458
- questionText: d,
459
- feedbackText: h,
460
- showMoreText: p,
461
- impressions: f,
462
- onSelectItem: g,
463
- onImpressed: u
265
+ questionText: l,
266
+ feedbackText: _,
267
+ showMoreText: d,
268
+ impressions: h,
269
+ onSelectItem: u,
270
+ onImpressed: g
464
271
  },
465
272
  `faq-section-items__${o}`
466
273
  )
467
274
  ] });
468
275
  }
469
276
  );
470
- U.propTypes = {
277
+ R.propTypes = {
471
278
  title: n.string,
472
279
  description: n.string,
473
280
  tags: n.array,
@@ -481,5 +288,5 @@ U.propTypes = {
481
288
  onImpressed: n.func
482
289
  };
483
290
  export {
484
- U as default
291
+ R as default
485
292
  };