@ledgerhq/lumen-ui-react 0.1.44 → 0.1.46

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 (108) hide show
  1. package/dist/i18n/locales/de.json.d.ts +1 -3
  2. package/dist/i18n/locales/de.json.js +1 -1
  3. package/dist/i18n/locales/en.json.d.ts +1 -3
  4. package/dist/i18n/locales/en.json.js +1 -1
  5. package/dist/i18n/locales/es.json.d.ts +1 -3
  6. package/dist/i18n/locales/es.json.js +1 -1
  7. package/dist/i18n/locales/fr.json.d.ts +1 -3
  8. package/dist/i18n/locales/fr.json.js +1 -1
  9. package/dist/i18n/locales/ja.json.d.ts +1 -3
  10. package/dist/i18n/locales/ja.json.js +2 -2
  11. package/dist/i18n/locales/ko.json.d.ts +1 -3
  12. package/dist/i18n/locales/ko.json.js +2 -2
  13. package/dist/i18n/locales/pt.json.d.ts +1 -3
  14. package/dist/i18n/locales/pt.json.js +1 -1
  15. package/dist/i18n/locales/ru.json.d.ts +1 -3
  16. package/dist/i18n/locales/ru.json.js +1 -1
  17. package/dist/i18n/locales/th.json.d.ts +1 -3
  18. package/dist/i18n/locales/th.json.js +2 -2
  19. package/dist/i18n/locales/tr.json.d.ts +1 -3
  20. package/dist/i18n/locales/tr.json.js +2 -2
  21. package/dist/i18n/locales/zh.json.d.ts +1 -3
  22. package/dist/i18n/locales/zh.json.js +2 -2
  23. package/dist/index.js +172 -164
  24. package/dist/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  25. package/dist/lib/Components/AmountDisplay/AmountDisplay.js +1 -0
  26. package/dist/lib/Components/AmountInput/AmountInput.d.ts +1 -1
  27. package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
  28. package/dist/lib/Components/AmountInput/AmountInput.js +34 -32
  29. package/dist/lib/Components/AmountInput/types.d.ts +8 -0
  30. package/dist/lib/Components/AmountInput/types.d.ts.map +1 -1
  31. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +1 -0
  32. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -1
  33. package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +9 -8
  34. package/dist/lib/Components/Avatar/Avatar.d.ts +1 -4
  35. package/dist/lib/Components/Avatar/Avatar.d.ts.map +1 -1
  36. package/dist/lib/Components/Avatar/Avatar.js +33 -40
  37. package/dist/lib/Components/Avatar/types.d.ts +0 -6
  38. package/dist/lib/Components/Avatar/types.d.ts.map +1 -1
  39. package/dist/lib/Components/BaseInput/BaseInput.js +13 -13
  40. package/dist/lib/Components/Button/BaseButton.d.ts +1 -1
  41. package/dist/lib/Components/Button/Button.js +9 -9
  42. package/dist/lib/Components/Card/Card.js +18 -18
  43. package/dist/lib/Components/DataTable/DataTable.d.ts.map +1 -1
  44. package/dist/lib/Components/DataTable/DataTable.js +97 -80
  45. package/dist/lib/Components/DataTable/types.d.ts +2 -1
  46. package/dist/lib/Components/DataTable/types.d.ts.map +1 -1
  47. package/dist/lib/Components/Divider/Divider.js +4 -4
  48. package/dist/lib/Components/DotIcon/DotIcon.js +5 -5
  49. package/dist/lib/Components/DotIndicator/getDotIndicatorProps.d.ts +24 -0
  50. package/dist/lib/Components/DotIndicator/getDotIndicatorProps.d.ts.map +1 -0
  51. package/dist/lib/Components/DotIndicator/getDotIndicatorProps.js +11 -0
  52. package/dist/lib/Components/DotIndicator/index.d.ts +1 -0
  53. package/dist/lib/Components/DotIndicator/index.d.ts.map +1 -1
  54. package/dist/lib/Components/Icon/Icon.js +4 -4
  55. package/dist/lib/Components/Link/Link.js +6 -6
  56. package/dist/lib/Components/MediaCard/MediaCard.js +4 -4
  57. package/dist/lib/Components/MediaImage/MediaImage.js +6 -6
  58. package/dist/lib/Components/Menu/Menu.d.ts +8 -3
  59. package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
  60. package/dist/lib/Components/Menu/Menu.js +40 -33
  61. package/dist/lib/Components/Menu/types.d.ts +6 -5
  62. package/dist/lib/Components/Menu/types.d.ts.map +1 -1
  63. package/dist/lib/Components/NavBar/NavBar.js +9 -9
  64. package/dist/lib/Components/Pagination/Pagination.js +10 -10
  65. package/dist/lib/Components/Popover/Popover.js +10 -10
  66. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts +8 -3
  67. package/dist/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  68. package/dist/lib/Components/SegmentedControl/SegmentedControl.js +41 -32
  69. package/dist/lib/Components/SegmentedControl/types.d.ts +6 -5
  70. package/dist/lib/Components/SegmentedControl/types.d.ts.map +1 -1
  71. package/dist/lib/Components/Select/Select.d.ts +19 -5
  72. package/dist/lib/Components/Select/Select.d.ts.map +1 -1
  73. package/dist/lib/Components/Select/Select.js +127 -104
  74. package/dist/lib/Components/Select/index.d.ts +1 -1
  75. package/dist/lib/Components/Select/index.d.ts.map +1 -1
  76. package/dist/lib/Components/Select/types.d.ts +20 -19
  77. package/dist/lib/Components/Select/types.d.ts.map +1 -1
  78. package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts +9 -9
  79. package/dist/lib/Components/Select/useSelectItems/useSelectItems.d.ts.map +1 -1
  80. package/dist/lib/Components/Select/utils/groupItems.d.ts +2 -2
  81. package/dist/lib/Components/Select/utils/groupItems.d.ts.map +1 -1
  82. package/dist/lib/Components/SideBar/SideBar.d.ts +11 -3
  83. package/dist/lib/Components/SideBar/SideBar.d.ts.map +1 -1
  84. package/dist/lib/Components/SideBar/SideBar.js +61 -51
  85. package/dist/lib/Components/SideBar/index.d.ts +2 -2
  86. package/dist/lib/Components/SideBar/index.d.ts.map +1 -1
  87. package/dist/lib/Components/SideBar/types.d.ts +7 -6
  88. package/dist/lib/Components/SideBar/types.d.ts.map +1 -1
  89. package/dist/lib/Components/Table/Table.d.ts +17 -1
  90. package/dist/lib/Components/Table/Table.d.ts.map +1 -1
  91. package/dist/lib/Components/Table/Table.js +74 -45
  92. package/dist/lib/Components/Table/types.d.ts +23 -0
  93. package/dist/lib/Components/Table/types.d.ts.map +1 -1
  94. package/dist/lib/Components/TileButton/TileButton.js +6 -6
  95. package/dist/lib/Components/Tooltip/Tooltip.js +4 -4
  96. package/dist/lib/Symbols/Icons/ChevronAscending.js +1 -1
  97. package/dist/lib/Symbols/Icons/ChevronDescending.js +1 -1
  98. package/dist/lib/Symbols/Icons/Contact.d.ts +29 -0
  99. package/dist/lib/Symbols/Icons/Contact.d.ts.map +1 -0
  100. package/dist/lib/Symbols/Icons/Contact.js +28 -0
  101. package/dist/lib/Symbols/index.d.ts +1 -0
  102. package/dist/lib/Symbols/index.d.ts.map +1 -1
  103. package/dist/lib/Symbols/index.js +388 -386
  104. package/dist/libs/utils-shared/dist/index.js +149 -148
  105. package/dist/package.json +3 -3
  106. package/package.json +3 -3
  107. package/dist/lib/Components/Design-tokens/shared.d.ts +0 -20
  108. package/dist/lib/Components/Design-tokens/shared.d.ts.map +0 -1
@@ -11,9 +11,6 @@ import { AvatarProps } from './types';
11
11
  * import { Avatar } from '@ledgerhq/lumen-ui-react';
12
12
  *
13
13
  * <Avatar src="https://example.com/photo.jpg" size="md" />
14
- *
15
- * // With notification indicator
16
- * <Avatar src="https://example.com/photo.jpg" showNotification />
17
14
  */
18
- export declare const Avatar: ({ ref, className, src, alt, appearance, size, imgLoading, showNotification: showNotificationProp, ...props }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const Avatar: ({ ref, className, src, alt, appearance, size, imgLoading, ...props }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
19
16
  //# sourceMappingURL=Avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AA0C3C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,GAAI,8GAUpB,WAAW,4CAwDb,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiC3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,GAAI,sEASpB,WAAW,4CAwCb,CAAC"}
@@ -1,11 +1,10 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { cva as h } from "class-variance-authority";
3
- import { useState as x, useEffect as z } from "react";
4
- import { useCommonTranslation as N } from "../../../i18n/useCommonTranslation.js";
5
- import { User as A } from "../../Symbols/Icons/User.js";
6
- import { DotIndicator as j } from "../DotIndicator/DotIndicator.js";
7
- const k = {
8
- root: h(
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { cva as u } from "class-variance-authority";
3
+ import { useState as v, useEffect as b } from "react";
4
+ import { useCommonTranslation as g } from "../../../i18n/useCommonTranslation.js";
5
+ import { User as z } from "../../Symbols/Icons/User.js";
6
+ const x = {
7
+ root: u(
9
8
  "relative inline-flex items-center justify-center rounded-full transition-colors",
10
9
  {
11
10
  variants: {
@@ -26,60 +25,54 @@ const k = {
26
25
  }
27
26
  }
28
27
  )
29
- }, w = {
28
+ }, h = {
30
29
  sm: 16,
31
30
  md: 24,
32
31
  lg: 32,
33
32
  xl: 40
34
- }, E = {
35
- sm: "lg",
36
- md: "xl"
37
- }, V = ({
38
- ref: l,
39
- className: c,
40
- src: e,
41
- alt: m,
42
- appearance: d = "transparent",
43
- size: a = "md",
44
- imgLoading: f,
45
- showNotification: p = !1,
46
- ...u
33
+ }, y = ({
34
+ ref: o,
35
+ className: n,
36
+ src: a,
37
+ alt: s,
38
+ appearance: l = "transparent",
39
+ size: r = "md",
40
+ imgLoading: i,
41
+ ...m
47
42
  }) => {
48
- const { t: r } = N(), [v, o] = x(!1), b = !e || v, n = m || r("components.avatar.defaultAlt"), s = p && (a === "sm" || a === "md"), g = s ? `${n}, ${r("components.avatar.notificationAriaLabel")}` : n;
49
- z(() => {
50
- o(!1);
51
- }, [e]);
52
- const i = /* @__PURE__ */ t(
43
+ const { t: c } = g(), [d, t] = v(!1), p = !a || d, f = s || c("components.avatar.defaultAriaLabel");
44
+ return b(() => {
45
+ t(!1);
46
+ }, [a]), /* @__PURE__ */ e(
53
47
  "div",
54
48
  {
55
- ref: l,
56
- className: k.root({ appearance: d, size: a, className: c }),
49
+ ref: o,
50
+ className: x.root({ appearance: l, size: r, className: n }),
57
51
  role: "img",
58
- "aria-label": g,
59
- ...u,
60
- children: b ? /* @__PURE__ */ t(
61
- A,
52
+ "aria-label": f,
53
+ ...m,
54
+ children: p ? /* @__PURE__ */ e(
55
+ z,
62
56
  {
63
57
  className: "text-base",
64
- size: w[a],
58
+ size: h[r],
65
59
  "aria-label": "Fallback Icon",
66
60
  "aria-hidden": "true"
67
61
  }
68
- ) : /* @__PURE__ */ t(
62
+ ) : /* @__PURE__ */ e(
69
63
  "img",
70
64
  {
71
- src: e,
65
+ src: a,
72
66
  alt: "",
73
- loading: f,
74
- onError: () => o(!0),
67
+ loading: i,
68
+ onError: () => t(!0),
75
69
  className: "size-full overflow-hidden rounded-full object-cover",
76
70
  "aria-hidden": "true"
77
71
  }
78
72
  )
79
73
  }
80
74
  );
81
- return s ? /* @__PURE__ */ t(j, { size: E[a], appearance: "red", children: i }) : i;
82
75
  };
83
76
  export {
84
- V as Avatar
77
+ y as Avatar
85
78
  };
@@ -22,12 +22,6 @@ export type AvatarProps = {
22
22
  * @default md
23
23
  */
24
24
  size?: 'sm' | 'md' | 'lg' | 'xl';
25
- /**
26
- * Whether to show the notifications indicator.
27
- * @optional
28
- * @default false
29
- */
30
- showNotification?: boolean;
31
25
  /**
32
26
  * Additional custom CSS classes to apply. Do not use this prop to modify the component's core appearance.
33
27
  * @optional
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IAEpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC/B,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IAEpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC/B,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
@@ -37,7 +37,7 @@ const te = u(
37
37
  "group-has-disabled:text-disabled",
38
38
  "peer-focus:top-6 peer-focus:translate-y-0 peer-focus:body-4",
39
39
  "w-[calc(100%-var(--size-56))] truncate"
40
- ), oe = u(ae, {
40
+ ), se = u(ae, {
41
41
  variants: {
42
42
  status: {
43
43
  default: "",
@@ -53,7 +53,7 @@ const te = u(
53
53
  status: "default",
54
54
  floated: !1
55
55
  }
56
- }), se = u("mt-8 flex items-center gap-2 body-3", {
56
+ }), oe = u("mt-8 flex items-center gap-2 body-3", {
57
57
  variants: {
58
58
  status: {
59
59
  default: "text-muted",
@@ -90,8 +90,8 @@ const te = u(
90
90
  }), { t: E } = Z(), t = K(null), L = Q(), c = k || `input-${L}`, A = D ?? (e === "error" ? !0 : void 0), i = a.value !== void 0, [H, f] = X(
91
91
  a.defaultValue?.toString() || ""
92
92
  ), M = Y(
93
- (o) => {
94
- i || f(o.target.value), h?.(o);
93
+ (s) => {
94
+ i || f(s.target.value), h?.(s);
95
95
  },
96
96
  [i, h]
97
97
  ), O = i ? !!a.value && a.value.toString().length > 0 : H.length > 0, { inputPlaceholder: T, labelStaysFloatedWithPlaceholder: W } = G({
@@ -111,17 +111,17 @@ const te = u(
111
111
  "div",
112
112
  {
113
113
  className: n(te({ status: e }), S),
114
- onPointerDown: (o) => {
115
- if (o.target.closest("input, button, a")) return;
116
- const s = t.current;
117
- if (!s) return;
118
- const x = s.value.length > 0 ? s.value.length : 0;
114
+ onPointerDown: (s) => {
115
+ if (s.target.closest("input, button, a")) return;
116
+ const o = t.current;
117
+ if (!o) return;
118
+ const x = o.value.length > 0 ? o.value.length : 0;
119
119
  window.requestAnimationFrame(() => {
120
120
  try {
121
- s.setSelectionRange(x, x);
121
+ o.setSelectionRange(x, x);
122
122
  } catch {
123
123
  }
124
- s.focus();
124
+ o.focus();
125
125
  });
126
126
  },
127
127
  children: [
@@ -149,7 +149,7 @@ const te = u(
149
149
  {
150
150
  htmlFor: c,
151
151
  className: n(
152
- oe({
152
+ se({
153
153
  status: e,
154
154
  floated: W
155
155
  }),
@@ -176,7 +176,7 @@ const te = u(
176
176
  "div",
177
177
  {
178
178
  id: g,
179
- className: se({ status: e }),
179
+ className: oe({ status: e }),
180
180
  role: e === "error" ? "alert" : void 0,
181
181
  children: [
182
182
  e === "error" && /* @__PURE__ */ r(y, { size: 16, className: "text-error" }),
@@ -1,6 +1,6 @@
1
1
  import { BaseButtonProps } from './types';
2
2
  export declare const baseButtonVariants: (props?: ({
3
- appearance?: "base" | "red" | "gray" | "transparent" | "accent" | "no-background" | null | undefined;
3
+ appearance?: "base" | "gray" | "transparent" | "accent" | "no-background" | "red" | null | undefined;
4
4
  disabled?: boolean | null | undefined;
5
5
  loading?: boolean | null | undefined;
6
6
  size?: "md" | "sm" | "lg" | "xs" | null | undefined;
@@ -1,8 +1,8 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { cn as n } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as d } from "class-variance-authority";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { cn as d } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as e } from "class-variance-authority";
4
4
  import { BaseButton as b } from "./BaseButton.js";
5
- const l = d("", {
5
+ const l = e("", {
6
6
  variants: {
7
7
  size: {
8
8
  sm: "px-16 py-10 body-2-semi-bold",
@@ -15,22 +15,22 @@ const l = d("", {
15
15
  }
16
16
  }), x = ({
17
17
  ref: t,
18
- className: m,
19
- loading: s,
18
+ className: s,
19
+ loading: m,
20
20
  disabled: r,
21
21
  children: a,
22
22
  size: o,
23
23
  icon: i,
24
24
  ...p
25
- }) => /* @__PURE__ */ e(
25
+ }) => /* @__PURE__ */ n(
26
26
  b,
27
27
  {
28
28
  ref: t,
29
29
  size: o,
30
30
  disabled: r,
31
31
  icon: i,
32
- loading: s,
33
- className: n(l({ size: o }), "gap-8", m),
32
+ loading: m,
33
+ className: d(l({ size: o }), "gap-8", s),
34
34
  ...p,
35
35
  children: a
36
36
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx as s, jsxs as f, Fragment as b } from "react/jsx-runtime";
2
- import { createSafeContext as m, DisabledProvider as g, cn as o, getButtonA11yProps as C } from "../../../libs/utils-shared/dist/index.js";
3
- import { cva as p } from "class-variance-authority";
2
+ import { createSafeContext as m, DisabledProvider as p, cn as o, getButtonA11yProps as C } from "../../../libs/utils-shared/dist/index.js";
3
+ import { cva as g } from "class-variance-authority";
4
4
  import { useMemo as h } from "react";
5
5
  import { ChevronUp as N } from "../../Symbols/Icons/ChevronUp.js";
6
6
  import { ChevronDown as w } from "../../Symbols/Icons/ChevronDown.js";
@@ -46,7 +46,7 @@ const k = ({
46
46
  }
47
47
  ), [q, v] = m("CardContentAlign", {
48
48
  align: "left"
49
- }), E = p(
49
+ }), E = g(
50
50
  "flex w-full flex-col overflow-clip rounded-lg bg-surface text-base transition-colors",
51
51
  {
52
52
  variants: {
@@ -96,7 +96,7 @@ const k = ({
96
96
  }),
97
97
  [r, e, l, i]
98
98
  );
99
- return /* @__PURE__ */ s(R, { value: u, children: /* @__PURE__ */ s(g, { value: { disabled: i }, children: /* @__PURE__ */ s(
99
+ return /* @__PURE__ */ s(R, { value: u, children: /* @__PURE__ */ s(p, { value: { disabled: i }, children: /* @__PURE__ */ s(
100
100
  "div",
101
101
  {
102
102
  ref: t,
@@ -144,7 +144,7 @@ const k = ({
144
144
  ]
145
145
  }
146
146
  );
147
- }, z = ({
147
+ }, V = ({
148
148
  ref: t,
149
149
  children: a,
150
150
  className: r,
@@ -157,7 +157,7 @@ const k = ({
157
157
  ...e,
158
158
  children: a
159
159
  }
160
- ), V = ({
160
+ ), z = ({
161
161
  ref: t,
162
162
  children: a,
163
163
  className: r,
@@ -203,7 +203,7 @@ const k = ({
203
203
  children: a
204
204
  }
205
205
  );
206
- }, I = ({
206
+ }, U = ({
207
207
  ref: t,
208
208
  children: a,
209
209
  className: r,
@@ -226,7 +226,7 @@ const k = ({
226
226
  children: a
227
227
  }
228
228
  );
229
- }, L = ({
229
+ }, I = ({
230
230
  ref: t,
231
231
  children: a,
232
232
  className: r,
@@ -249,7 +249,7 @@ const k = ({
249
249
  children: a
250
250
  }
251
251
  );
252
- }, M = ({
252
+ }, L = ({
253
253
  ref: t,
254
254
  children: a,
255
255
  className: r,
@@ -272,7 +272,7 @@ const k = ({
272
272
  children: a
273
273
  }
274
274
  ) });
275
- }, S = ({
275
+ }, M = ({
276
276
  ref: t,
277
277
  children: a,
278
278
  className: r,
@@ -304,7 +304,7 @@ const k = ({
304
304
  ) })
305
305
  }
306
306
  );
307
- }, U = ({
307
+ }, S = ({
308
308
  ref: t,
309
309
  children: a,
310
310
  className: r,
@@ -320,14 +320,14 @@ const k = ({
320
320
  );
321
321
  export {
322
322
  P as Card,
323
- V as CardContent,
324
- L as CardContentDescription,
323
+ z as CardContent,
324
+ I as CardContentDescription,
325
325
  B as CardContentRow,
326
- I as CardContentTitle,
327
- S as CardFooter,
328
- U as CardFooterActions,
326
+ U as CardContentTitle,
327
+ M as CardFooter,
328
+ S as CardFooterActions,
329
329
  T as CardHeader,
330
- z as CardLeading,
331
- M as CardTrailing,
330
+ V as CardLeading,
331
+ L as CardTrailing,
332
332
  k as resolveCardInnerContext
333
333
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,OAAO,EAER,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAgBvD,OAAO,KAAK,EAGV,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAejB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,OAAO,EAAE,sKAelD,kBAAkB,CAAC,KAAK,CAAC,4CAqB3B,CAAC;AAyDF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,GAAI,8BAA8B,cAAc,4CA6BrE,CAAC;AAsHF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,wBAGxC,gBAAgB,4CAqBlB,CAAC"}
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,OAAO,EAER,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAkBvD,OAAO,KAAK,EAGV,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAejB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,OAAO,EAAE,sKAelD,kBAAkB,CAAC,KAAK,CAAC,4CAqB3B,CAAC;AAqFF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,GAAI,8BAA8B,cAAc,4CA8BrE,CAAC;AAsHF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,wBAGxC,gBAAgB,4CAqBlB,CAAC"}
@@ -1,91 +1,107 @@
1
- import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
- import { createSafeContext as w, cn as C } from "../../../libs/utils-shared/dist/index.js";
3
- import { flexRender as m } from "@tanstack/react-table";
1
+ import { jsx as o, jsxs as m } from "react/jsx-runtime";
2
+ import { createSafeContext as f, cn as w } from "../../../libs/utils-shared/dist/index.js";
3
+ import { flexRender as d } from "@tanstack/react-table";
4
4
  import { useCallback as R, Fragment as x } from "react";
5
- import { TableRoot as B, Table as k, TableLoadingRow as y, TableHeader as H, TableHeaderRow as N, TableHeaderCell as S, TableSortButton as v, TableBody as b, TableGroupHeaderRow as G, TableRow as q, TableCell as I } from "../Table/Table.js";
6
- import { SearchInput as F } from "../SearchInput/SearchInput.js";
7
- const [M, u] = w("DataTableContext"), Q = ({
5
+ import { TableRoot as B, Table as N, TableLoadingRow as k, TableColGroup as y, TableCol as H, TableHeader as S, TableHeaderRow as G, TableHeaderCell as q, TableSortButton as v, TableBody as b, TableGroupHeaderRow as I, TableRow as F, TableCell as M } from "../Table/Table.js";
6
+ import { SearchInput as V } from "../SearchInput/SearchInput.js";
7
+ const [j, i] = f("DataTableContext"), X = ({
8
8
  table: l,
9
9
  appearance: n = "no-background",
10
- paginationMode: o = "none",
10
+ paginationMode: t = "none",
11
11
  loading: e = !1,
12
- onScrollBottom: t,
13
- onRowClick: i,
12
+ onScrollBottom: a,
13
+ onRowClick: s,
14
14
  groupBy: r,
15
15
  renderGroupHeader: c,
16
- hideHeader: s = !1,
16
+ hideHeader: u = !1,
17
17
  stickyHeader: T = !0,
18
18
  children: p,
19
19
  className: D,
20
- ref: f,
21
- ...h
22
- }) => /* @__PURE__ */ a(
23
- M,
20
+ ref: h,
21
+ ...C
22
+ }) => /* @__PURE__ */ o(
23
+ j,
24
24
  {
25
25
  value: {
26
- hideHeader: s,
26
+ hideHeader: u,
27
27
  stickyHeader: T,
28
- paginationMode: o,
28
+ paginationMode: t,
29
29
  table: l,
30
30
  appearance: n,
31
31
  loading: e,
32
- onScrollBottom: t,
33
- onRowClick: i,
32
+ onScrollBottom: a,
33
+ onRowClick: s,
34
34
  groupBy: r,
35
35
  renderGroupHeader: c
36
36
  },
37
- children: /* @__PURE__ */ a("div", { ref: f, className: C("flex flex-col", D), ...h, children: p })
37
+ children: /* @__PURE__ */ o("div", { ref: h, className: w("flex flex-col", D), ...C, children: p })
38
38
  }
39
- ), j = ({
39
+ ), L = () => {
40
+ const { table: l } = i({
41
+ consumerName: "DataTableColGroup",
42
+ contextRequired: !0
43
+ });
44
+ return /* @__PURE__ */ o(y, { children: l.getVisibleLeafColumns().map((n) => {
45
+ const t = n.columnDef.meta;
46
+ return /* @__PURE__ */ o(
47
+ H,
48
+ {
49
+ hideBelow: t?.hideBelow,
50
+ className: t?.className
51
+ },
52
+ n.id
53
+ );
54
+ }) });
55
+ }, P = ({
40
56
  className: l,
41
57
  ref: n,
42
- ...o
58
+ ...t
43
59
  }) => {
44
- const { table: e, stickyHeader: t } = u({
60
+ const { table: e, stickyHeader: a } = i({
45
61
  consumerName: "DataTableHeader",
46
62
  contextRequired: !0
47
63
  });
48
- return /* @__PURE__ */ a(H, { ref: n, className: l, ...o, children: e.getHeaderGroups().map((i) => /* @__PURE__ */ a(N, { stickyHeader: t, children: i.headers.map((r) => {
64
+ return /* @__PURE__ */ o(S, { ref: n, className: l, ...t, children: e.getHeaderGroups().map((s) => /* @__PURE__ */ o(G, { stickyHeader: a, children: s.headers.map((r) => {
49
65
  const c = r.column.columnDef.meta;
50
- return /* @__PURE__ */ a(
51
- S,
66
+ return /* @__PURE__ */ o(
67
+ q,
52
68
  {
53
69
  align: c?.align,
54
70
  hideBelow: c?.hideBelow,
55
71
  className: c?.className,
56
72
  trailingContent: c?.headerTrailingContent,
57
- children: r.isPlaceholder ? null : r.column.getCanSort() ? /* @__PURE__ */ a(
73
+ children: r.isPlaceholder ? null : r.column.getCanSort() ? /* @__PURE__ */ o(
58
74
  v,
59
75
  {
60
76
  sortDirection: r.column.getIsSorted() || void 0,
61
77
  onClick: r.column.getToggleSortingHandler(),
62
78
  align: c?.align,
63
- children: m(
79
+ children: d(
64
80
  r.column.columnDef.header,
65
81
  r.getContext()
66
82
  )
67
83
  }
68
- ) : m(
84
+ ) : d(
69
85
  r.column.columnDef.header,
70
86
  r.getContext()
71
87
  )
72
88
  },
73
89
  r.id
74
90
  );
75
- }) }, i.id)) });
76
- }, U = ({ className: l, ref: n, ...o }) => {
91
+ }) }, s.id)) });
92
+ }, Y = ({ className: l, ref: n, ...t }) => {
77
93
  const {
78
94
  appearance: e,
79
- paginationMode: t,
80
- hideHeader: i,
95
+ paginationMode: a,
96
+ hideHeader: s,
81
97
  loading: r,
82
98
  onScrollBottom: c,
83
- groupBy: s
84
- } = u({
99
+ groupBy: u
100
+ } = i({
85
101
  consumerName: "DataTable",
86
102
  contextRequired: !0
87
103
  });
88
- return /* @__PURE__ */ d(
104
+ return /* @__PURE__ */ m(
89
105
  B,
90
106
  {
91
107
  ref: n,
@@ -93,92 +109,93 @@ const [M, u] = w("DataTableContext"), Q = ({
93
109
  loading: r,
94
110
  onScrollBottom: c,
95
111
  className: l,
96
- ...o,
112
+ ...t,
97
113
  children: [
98
- /* @__PURE__ */ d(k, { children: [
99
- !i && /* @__PURE__ */ a(j, {}),
100
- s ? /* @__PURE__ */ a(z, {}) : /* @__PURE__ */ a(P, {})
114
+ /* @__PURE__ */ m(N, { children: [
115
+ /* @__PURE__ */ o(L, {}),
116
+ !s && /* @__PURE__ */ o(P, {}),
117
+ u ? /* @__PURE__ */ o(A, {}) : /* @__PURE__ */ o(U, {})
101
118
  ] }),
102
- t === "infinite-scroll" && /* @__PURE__ */ a(y, {})
119
+ a === "infinite-scroll" && /* @__PURE__ */ o(k, {})
103
120
  ]
104
121
  }
105
122
  );
106
- }, P = ({ className: l, ref: n, ...o }) => {
107
- const { table: e } = u({
123
+ }, U = ({ className: l, ref: n, ...t }) => {
124
+ const { table: e } = i({
108
125
  consumerName: "DataTableBody",
109
126
  contextRequired: !0
110
127
  });
111
- return /* @__PURE__ */ a(b, { ref: n, className: l, ...o, children: e.getRowModel().rows.map((t) => /* @__PURE__ */ a(g, { row: t }, t.id)) });
112
- }, V = (l, n) => {
113
- const o = [];
128
+ return /* @__PURE__ */ o(b, { ref: n, className: l, ...t, children: e.getRowModel().rows.map((a) => /* @__PURE__ */ o(g, { row: a }, a.id)) });
129
+ }, z = (l, n) => {
130
+ const t = [];
114
131
  let e = null;
115
- for (const t of l) {
116
- const i = n(t);
117
- (!e || e.key !== i) && (e = { key: i, rows: [], count: 0 }, o.push(e)), e.rows.push(t), e.count++;
132
+ for (const a of l) {
133
+ const s = n(a);
134
+ (!e || e.key !== s) && (e = { key: s, rows: [], count: 0 }, t.push(e)), e.rows.push(a), e.count++;
118
135
  }
119
- return o;
120
- }, z = ({
136
+ return t;
137
+ }, A = ({
121
138
  className: l,
122
139
  ref: n,
123
- ...o
140
+ ...t
124
141
  }) => {
125
- const { table: e, groupBy: t, renderGroupHeader: i } = u({
142
+ const { table: e, groupBy: a, renderGroupHeader: s } = i({
126
143
  consumerName: "DataTableGroupedBody",
127
144
  contextRequired: !0
128
- }), r = V(e.getRowModel().rows, t);
129
- return /* @__PURE__ */ a(b, { ref: n, className: l, ...o, children: r.map((c) => /* @__PURE__ */ d(x, { children: [
130
- /* @__PURE__ */ a(G, { colSpan: c.rows[0].getVisibleCells().length, children: i ? i({ row: c.rows[0], count: c.count }) : c.key }),
131
- c.rows.map((s) => /* @__PURE__ */ a(g, { row: s }, s.id))
145
+ }), r = z(e.getRowModel().rows, a);
146
+ return /* @__PURE__ */ o(b, { ref: n, className: l, ...t, children: r.map((c) => /* @__PURE__ */ m(x, { children: [
147
+ /* @__PURE__ */ o(I, { colSpan: c.rows[0].getVisibleCells().length, children: s ? s({ row: c.rows[0], count: c.count }) : c.key }),
148
+ c.rows.map((u) => /* @__PURE__ */ o(g, { row: u }, u.id))
132
149
  ] }, c.key)) });
133
150
  }, g = ({ row: l }) => {
134
- const { onRowClick: n } = u({
151
+ const { onRowClick: n } = i({
135
152
  consumerName: "DataTableRow",
136
153
  contextRequired: !0
137
- }), o = !!n;
138
- return /* @__PURE__ */ a(
139
- q,
154
+ }), t = !!n;
155
+ return /* @__PURE__ */ o(
156
+ F,
140
157
  {
141
- clickable: o,
142
- onClick: o ? () => n?.(l) : void 0,
158
+ clickable: t,
159
+ onClick: t ? () => n?.(l) : void 0,
143
160
  children: l.getVisibleCells().map((e) => {
144
- const t = e.column.columnDef.meta;
145
- return /* @__PURE__ */ a(
146
- I,
161
+ const a = e.column.columnDef.meta;
162
+ return /* @__PURE__ */ o(
163
+ M,
147
164
  {
148
- align: t?.align,
149
- hideBelow: t?.hideBelow,
150
- className: t?.className,
151
- children: m(e.column.columnDef.cell, e.getContext())
165
+ align: a?.align,
166
+ hideBelow: a?.hideBelow,
167
+ className: a?.className,
168
+ children: d(e.column.columnDef.cell, e.getContext())
152
169
  },
153
170
  e.id
154
171
  );
155
172
  })
156
173
  }
157
174
  );
158
- }, W = ({
175
+ }, Z = ({
159
176
  onChange: l,
160
177
  ...n
161
178
  }) => {
162
- const { table: o } = u({
179
+ const { table: t } = i({
163
180
  consumerName: "DataTableGlobalSearchInput",
164
181
  contextRequired: !0
165
182
  }), e = R(
166
- (t) => {
167
- o.setGlobalFilter(t.target.value), l?.(t);
183
+ (a) => {
184
+ t.setGlobalFilter(a.target.value), l?.(a);
168
185
  },
169
- [o, l]
186
+ [t, l]
170
187
  );
171
- return /* @__PURE__ */ a(
172
- F,
188
+ return /* @__PURE__ */ o(
189
+ V,
173
190
  {
174
- value: o.getState().globalFilter ?? "",
191
+ value: t.getState().globalFilter ?? "",
175
192
  onChange: e,
176
193
  ...n
177
194
  }
178
195
  );
179
196
  };
180
197
  export {
181
- U as DataTable,
182
- W as DataTableGlobalSearchInput,
183
- Q as DataTableRoot
198
+ Y as DataTable,
199
+ Z as DataTableGlobalSearchInput,
200
+ X as DataTableRoot
184
201
  };