kelt-ui-kit-react 1.9.8 → 2.0.0

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/src/index.css CHANGED
@@ -1,9 +1,9 @@
1
1
  /* variables couleur */
2
2
  :root {
3
- --primary-color: #004aad;
4
- --secondary-color: #ff914d;
5
- --tertiary-color: #00ada1;
6
- --quaternary-color: #0082ad;
3
+ --primary-color: #123852;
4
+ --secondary-color: #EB5E3B;
5
+ --tertiary-color: #30B8C2;
6
+ --quaternary-color: #7dc2ef;
7
7
  --success-color: #28a745;
8
8
  --info-color: #17a2b8;
9
9
  --warning-color: #ec942c;
@@ -17,7 +17,10 @@
17
17
  html,
18
18
  body {
19
19
  margin: 0;
20
- font-family: "Raleway", sans-serif !important;
20
+ font-family: "Lexend", sans-serif;
21
+ font-optical-sizing: auto;
22
+ font-style: normal;
23
+ font-size: 18px;
21
24
  -webkit-font-smoothing: antialiased;
22
25
  -moz-osx-font-smoothing: grayscale;
23
26
  height: 100%;
@@ -28,38 +31,48 @@ body {
28
31
  width: 100%;
29
32
  background-color: #fff;
30
33
  }
34
+
31
35
  .app {
32
36
  container: app-container/ inline-size;
33
37
  }
34
38
 
35
39
  input[type="number"]::-webkit-outer-spin-button,
36
40
  input[type="number"]::-webkit-inner-spin-button {
37
- -webkit-appearance: none; /* Chrome, Safari, Edge */
41
+ -webkit-appearance: none;
42
+ /* Chrome, Safari, Edge */
38
43
  margin: 0;
39
44
  }
45
+
40
46
  /* flex properties */
41
47
 
42
48
  .d-flex {
43
49
  display: flex;
44
50
  }
51
+
45
52
  .justify-content-start {
46
53
  justify-content: start;
47
54
  }
55
+
48
56
  .justify-content-end {
49
57
  justify-content: end;
50
58
  }
59
+
51
60
  .justify-content-center {
52
61
  justify-content: center;
53
62
  }
63
+
54
64
  .justify-content-between {
55
65
  justify-content: space-between;
56
66
  }
67
+
57
68
  .justify-content-around {
58
69
  justify-content: space-around;
59
70
  }
71
+
60
72
  .justify-content-evenly {
61
73
  justify-content: space-evenly;
62
74
  }
75
+
63
76
  .align-items-start {
64
77
  align-items: start;
65
78
  }
@@ -310,63 +323,83 @@ a {
310
323
  .mb-3 {
311
324
  margin-bottom: 1rem;
312
325
  }
326
+
313
327
  .pb-0 {
314
328
  padding-bottom: 0;
315
329
  }
330
+
316
331
  .pb-1 {
317
332
  padding-bottom: 0.25rem;
318
333
  }
334
+
319
335
  .pb-2 {
320
336
  padding-bottom: 0.5rem;
321
337
  }
338
+
322
339
  .pb-3 {
323
340
  padding-bottom: 1rem;
324
341
  }
342
+
325
343
  .pt-0 {
326
344
  padding-top: 0;
327
345
  }
346
+
328
347
  .pt-1 {
329
348
  padding-top: 0.25rem;
330
349
  }
350
+
331
351
  .pt-2 {
332
352
  padding-top: 0.5rem;
333
353
  }
354
+
334
355
  .pt-3 {
335
356
  padding-top: 1rem;
336
357
  }
358
+
337
359
  .pl-0 {
338
360
  padding-left: 0;
339
361
  }
362
+
340
363
  .pl-1 {
341
364
  padding-left: 0.25rem;
342
365
  }
366
+
343
367
  .pl-2 {
344
368
  padding-left: 0.5rem;
345
369
  }
370
+
346
371
  .pl-3 {
347
372
  padding-left: 1rem;
348
373
  }
374
+
349
375
  .pr-0 {
350
376
  padding-right: 0;
351
377
  }
378
+
352
379
  .pr-1 {
353
380
  padding-right: 0.25rem;
354
381
  }
382
+
355
383
  .pr-2 {
356
384
  padding-right: 0.5rem;
357
385
  }
386
+
358
387
  .pr-3 {
359
388
  padding-right: 1rem;
360
389
  }
390
+
361
391
  .p-0 {
362
392
  padding: 0;
363
393
  }
394
+
364
395
  .p-1 {
365
396
  padding: 0.25rem;
366
397
  }
398
+
367
399
  .p-2 {
368
400
  padding: 0.5rem;
369
401
  }
402
+
370
403
  .p-3 {
371
404
  padding: 1rem;
372
405
  }
@@ -375,25 +408,32 @@ a {
375
408
  .border-bottom {
376
409
  border-bottom: 1px solid #cfbdbd;
377
410
  }
411
+
378
412
  .border-top {
379
413
  border-top: 1px solid #cfbdbd;
380
414
  }
415
+
381
416
  .border-left {
382
417
  border-left: 1px solid #cfbdbd;
383
418
  }
419
+
384
420
  .border-right {
385
421
  border-right: 1px solid #cfbdbd;
386
422
  }
423
+
387
424
  /* fonts */
388
425
  .font-weight-bold {
389
426
  font-weight: 600;
390
427
  }
428
+
391
429
  .font-weight-light {
392
430
  font-weight: 300;
393
431
  }
432
+
394
433
  .font-weight-normal {
395
434
  font-weight: 400;
396
435
  }
436
+
397
437
  .font-weight-italic {
398
438
  font-style: italic;
399
439
  }
@@ -402,32 +442,41 @@ a {
402
442
  .visible {
403
443
  visibility: visible;
404
444
  }
445
+
405
446
  .hidden {
406
447
  visibility: hidden;
407
448
  }
449
+
408
450
  .position-relative {
409
451
  position: relative;
410
452
  }
453
+
411
454
  .position-absolute {
412
455
  position: absolute;
413
456
  }
457
+
414
458
  .cursor-pointer {
415
459
  cursor: pointer;
416
460
  }
461
+
417
462
  .w-100 {
418
463
  width: 100%;
419
464
  }
465
+
420
466
  .min-width-auto {
421
467
  min-width: auto;
422
468
  }
469
+
423
470
  .disabled {
424
471
  opacity: 0.5;
425
472
  cursor: not-allowed;
426
473
  pointer-events: none;
427
474
  }
475
+
428
476
  .overflow-auto {
429
477
  overflow: auto;
430
478
  }
479
+
431
480
  .toggle-btn {
432
481
  display: flex;
433
482
  width: 100%;
@@ -492,11 +541,8 @@ a {
492
541
  /* Couleurs : gris pour la barre, transparent pour le fond */
493
542
  }
494
543
 
495
- @media (min-width: 576px) {
496
- }
544
+ @media (min-width: 576px) {}
497
545
 
498
- @media (min-width: 768px) {
499
- }
546
+ @media (min-width: 768px) {}
500
547
 
501
- @media (min-width: 992px) {
502
- }
548
+ @media (min-width: 992px) {}
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export { Expands } from "./expands/Expands";
33
33
  export { FilAriane } from "./filAriane/FilAriane";
34
34
  export { DynamicForm } from "./form/Form";
35
35
  export { TypeInputEnum } from "./form/form.enum";
36
+ export type { FormMode } from "./form/form.interface";
36
37
  export { Input } from "./form/input/Input";
37
38
  export { InputNumber } from "./form/inputNumber/InputNumber";
38
39
  export { InputPrice } from "./form/inputPrice/InputPrice";
@@ -22,6 +22,7 @@ export const Menus = (props: ExpandProps) => {
22
22
  <Menu
23
23
  item={item}
24
24
  onChange={onChange}
25
+ className={item.subMenu && item.subMenu.length > 0 ? "has-submenu" : ""}
25
26
  active={currentItem?.id === item.id}
26
27
  />
27
28
  {item.subMenu && item.subMenu.length > 0 && (
@@ -4,12 +4,13 @@ export type MenuProps = {
4
4
  active: boolean;
5
5
  item: MenuInterface;
6
6
  onChange: (item: MenuInterface) => void;
7
+ className?: string;
7
8
  };
8
9
  export const Menu = (props: MenuProps): JSX.Element => {
9
10
  return (
10
11
  <div
11
12
  onClick={() => props.onChange(props.item)}
12
- className={props.active ? "expand expand--active" : "expand"}
13
+ className={`expand ${props.active ? "expand--active" : ""} ${props.className || ""}`}
13
14
  >
14
15
  {props.item.children}
15
16
  </div>
@@ -108,14 +108,18 @@ export const Sidebar = ({
108
108
  axisLocked.current = Math.abs(deltaX) > Math.abs(deltaY) ? "x" : "y";
109
109
  }
110
110
 
111
- if (axisLocked.current !== "x") return; // c'est un scroll vertical, on laisse faire
111
+ if (axisLocked.current !== "x") {
112
+ return;
113
+ }
114
+
115
+ // Ignore les petits mouvements horizontaux
116
+ if (deltaX < 20) {
117
+ return;
118
+ }
112
119
 
113
- // On gère le swipe horizontal nous-mêmes : on empêche le scroll natif
114
- // et on bloque le bounce/scroll de la page pendant le drag
115
120
  event.preventDefault();
116
121
 
117
122
  setIsDragging(true);
118
- // On ne permet que le swipe vers la droite (fermeture), pas de drag négatif
119
123
  setDragX(Math.max(0, deltaX));
120
124
  },
121
125
  [isOpen],
@@ -189,6 +193,7 @@ export const Sidebar = ({
189
193
  transition: isDragging ? "none" : undefined,
190
194
  }}
191
195
  className={`sidebar ${isOpen ? "open" : "closed"} ${className ?? ""}`}
196
+ onClick={(event) => event.stopPropagation()}
192
197
  onTouchStart={handleTouchStart}
193
198
  onTouchMove={handleTouchMove}
194
199
  onTouchEnd={handleTouchEnd}
package/src/tabs/tabs.css CHANGED
@@ -1,24 +1,30 @@
1
1
  .tabs-root {
2
2
  height: 100%;
3
+
3
4
  .tabs-header {
4
5
  display: flex;
5
6
  border-bottom: 1px solid #b2a1a1;
7
+
6
8
  .tab-button {
7
9
  padding: 0.5rem 0.75rem;
8
10
  border: 0px;
9
11
  outline: none;
10
12
  background-color: transparent;
11
- color: #1e293b; /* slate-800 */
13
+ color: #1e293b;
14
+ /* slate-800 */
12
15
  cursor: pointer;
13
16
 
14
17
  &.tab-button--active {
15
- border-bottom: 2px solid var(--primary-color); /* slate-800 */
18
+ border-bottom: 2px solid var(--primary-color);
19
+ /* slate-800 */
16
20
  border-radius: 0px;
21
+ font-weight: bold;
17
22
  }
23
+
18
24
  &.tab-button--disabled {
19
25
  opacity: 0.5;
20
26
  cursor: not-allowed;
21
27
  }
22
28
  }
23
29
  }
24
- }
30
+ }
@@ -34,9 +34,14 @@ export const Toaster = () => {
34
34
  return ReactDOM.createPortal(
35
35
  <div className={`toaster toaster-${severity}`}>
36
36
  {close && (
37
- <div className="toaster--close" onClick={onClose}>
37
+ <button
38
+ type="button"
39
+ className="toaster--close"
40
+ onClick={onClose}
41
+ aria-label="Fermer la notification"
42
+ >
38
43
  <Icon classIcon="bi-x" />
39
- </div>
44
+ </button>
40
45
  )}
41
46
  <div>
42
47
  {severity === "info" && <Icon classIcon="bi-info-circle" />}
@@ -9,6 +9,7 @@ export const ToasterView = (): JSX.Element => {
9
9
  description: "This is a description for the toast message.",
10
10
  severity: "warning",
11
11
  duration: 10000,
12
+ close: true,
12
13
  children: <div>Additional content can go here.</div>,
13
14
  });
14
15
  }, [showToast]);
@@ -15,6 +15,7 @@ type ToasterState = {
15
15
  severity?: "info" | "success" | "error" | "warning";
16
16
  duration?: number;
17
17
  children?: React.ReactNode;
18
+ close?: boolean;
18
19
  }
19
20
  ) => void;
20
21
  hideToast: () => void;
@@ -36,6 +37,7 @@ export const useToasterStore = create<ToasterState>((set) => ({
36
37
  duration: options.duration || 2500,
37
38
  visible: true,
38
39
  children: options.children || null,
40
+ close: options.close ?? true,
39
41
  })),
40
42
  hideToast: () => set(() => ({ visible: false })),
41
43
  }));
@@ -15,7 +15,12 @@
15
15
  position: absolute;
16
16
  top: 2px;
17
17
  right: 2px;
18
+ margin: 0;
19
+ padding: 0;
20
+ border: 0;
21
+ background: transparent;
18
22
  color: #333;
23
+ min-width: auto;
19
24
  cursor: pointer;
20
25
  .bi {
21
26
  font-size: 1.2rem;
@@ -55,7 +60,7 @@
55
60
  }
56
61
  .title {
57
62
  font-weight: 500;
58
- font-size: 16px;
63
+ font-size: 18px;
59
64
  &.title-info {
60
65
  color: var(--primary-color);
61
66
  }
@@ -70,7 +75,7 @@
70
75
  }
71
76
  }
72
77
  .subtitle {
73
- font-size: 14px;
78
+ font-size: 16px;
74
79
  }
75
80
  .bi-info-circle {
76
81
  color: var(--primary-color);