@ledgerhq/lumen-ui-react 0.0.83 → 0.0.84

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 (34) hide show
  1. package/ai-rules/RULES.md +1 -0
  2. package/dist/index.js +134 -128
  3. package/dist/lib/Components/Button/BaseButton.js +9 -9
  4. package/dist/lib/Components/DataTable/DataTable.d.ts +39 -0
  5. package/dist/lib/Components/DataTable/DataTable.d.ts.map +1 -0
  6. package/dist/lib/Components/DataTable/DataTable.js +195 -0
  7. package/dist/lib/Components/DataTable/index.d.ts +4 -0
  8. package/dist/lib/Components/DataTable/index.d.ts.map +1 -0
  9. package/dist/lib/Components/DataTable/types.d.ts +111 -0
  10. package/dist/lib/Components/DataTable/types.d.ts.map +1 -0
  11. package/dist/lib/Components/DataTable/useLumenDataTable/index.d.ts +2 -0
  12. package/dist/lib/Components/DataTable/useLumenDataTable/index.d.ts.map +1 -0
  13. package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.d.ts +38 -0
  14. package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.d.ts.map +1 -0
  15. package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js +10 -0
  16. package/dist/lib/Components/Skeleton/Skeleton.d.ts +4 -1
  17. package/dist/lib/Components/Skeleton/Skeleton.d.ts.map +1 -1
  18. package/dist/lib/Components/Skeleton/Skeleton.js +84 -98
  19. package/dist/lib/Components/Skeleton/types.d.ts +3 -3
  20. package/dist/lib/Components/Skeleton/types.d.ts.map +1 -1
  21. package/dist/lib/Components/Spot/Spot.d.ts +4 -1
  22. package/dist/lib/Components/Spot/Spot.d.ts.map +1 -1
  23. package/dist/lib/Components/Spot/Spot.js +23 -23
  24. package/dist/lib/Components/Spot/types.d.ts +2 -2
  25. package/dist/lib/Components/Spot/types.d.ts.map +1 -1
  26. package/dist/lib/Components/Table/Table.d.ts +65 -81
  27. package/dist/lib/Components/Table/Table.d.ts.map +1 -1
  28. package/dist/lib/Components/Table/Table.js +306 -267
  29. package/dist/lib/Components/Table/types.d.ts +17 -17
  30. package/dist/lib/Components/Table/types.d.ts.map +1 -1
  31. package/dist/lib/Components/index.d.ts +1 -0
  32. package/dist/lib/Components/index.d.ts.map +1 -1
  33. package/dist/package.json +1 -1
  34. package/package.json +2 -2
package/ai-rules/RULES.md CHANGED
@@ -267,6 +267,7 @@ Below is a complete list of all available Lumen components. Click any component
267
267
  - [Stepper](https://ldls.vercel.app/?path=/docs/feedback-stepper--docs) - Multi-step progress indicator
268
268
  - [Subheader](https://ldls.vercel.app/?path=/docs/communication-subheader--docs) - Section subheader component
269
269
  - [Switch](https://ldls.vercel.app/?path=/docs/selection-switch--docs) - Toggle switch component
270
+ - [Table](https://ldls.vercel.app/?path=/docs/communication-tag--docs) - Table component
270
271
  - [Tag](https://ldls.vercel.app/?path=/docs/communication-tag--docs) - Label and tag component
271
272
  - [TextInput](https://ldls.vercel.app/?path=/docs/input-textinput--docs) - Text input field
272
273
  - [Tile](https://ldls.vercel.app/?path=/docs/containment-tile--docs) - Content container tile
package/dist/index.js CHANGED
@@ -1,40 +1,42 @@
1
- import { Languages as r } from "./i18n/languages.js";
1
+ import { Languages as t } from "./i18n/languages.js";
2
2
  import { AddressInput as a } from "./lib/Components/AddressInput/AddressInput.js";
3
3
  import { AmountInput as i } from "./lib/Components/AmountInput/AmountInput.js";
4
4
  import { AmountDisplay as p } from "./lib/Components/AmountDisplay/AmountDisplay.js";
5
5
  import { Avatar as T } from "./lib/Components/Avatar/Avatar.js";
6
6
  import { Banner as x } from "./lib/Components/Banner/Banner.js";
7
7
  import { BaseInput as S } from "./lib/Components/BaseInput/BaseInput.js";
8
- import { Button as b } from "./lib/Components/Button/Button.js";
8
+ import { Button as d } from "./lib/Components/Button/Button.js";
9
9
  import { BaseButton as c } from "./lib/Components/Button/BaseButton.js";
10
10
  import { CardButton as B } from "./lib/Components/CardButton/CardButton.js";
11
11
  import { Checkbox as C } from "./lib/Components/Checkbox/Checkbox.js";
12
- import { Dialog as h, DialogBody as M, DialogContent as D, DialogFooter as v, DialogTrigger as A } from "./lib/Components/Dialog/Dialog.js";
13
- import { DialogHeader as w } from "./lib/Components/Dialog/DialogHeader/DialogHeader.js";
14
- import { Divider as H } from "./lib/Components/Divider/Divider.js";
15
- import { IconButton as y } from "./lib/Components/IconButton/IconButton.js";
16
- import { InteractiveIcon as P } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
17
- import { Link as j } from "./lib/Components/Link/Link.js";
18
- import { ListItem as z, ListItemContent as E, ListItemDescription as J, ListItemIcon as K, ListItemLeading as O, ListItemSpot as Q, ListItemTitle as U, ListItemTrailing as V, ListItemTruncate as W } from "./lib/Components/ListItem/ListItem.js";
19
- import { Menu as Y, MenuCheckboxItem as Z, MenuContent as _, MenuGroup as $, MenuItem as ee, MenuLabel as oe, MenuPortal as re, MenuRadioGroup as te, MenuRadioItem as ae, MenuSeparator as ne, MenuSub as ie, MenuSubContent as le, MenuSubTrigger as pe, MenuTrigger as me } from "./lib/Components/Menu/Menu.js";
20
- import { NavBar as ue, NavBarBackButton as xe, NavBarCoinCapsule as fe, NavBarTitle as Se, NavBarTrailing as de } from "./lib/Components/NavBar/NavBar.js";
21
- import { PageIndicator as ge } from "./lib/Components/PageIndicator/PageIndicator.js";
22
- import { SearchInput as Ie } from "./lib/Components/SearchInput/SearchInput.js";
23
- import { Select as se, SelectContent as Ce, SelectGroup as Le, SelectItem as he, SelectItemText as Me, SelectLabel as De, SelectSeparator as ve, SelectTrigger as Ae } from "./lib/Components/Select/Select.js";
24
- import { SideBar as we, SideBarCollapseToggle as ke, SideBarItem as He, SideBarLeading as Ne, SideBarTrailing as ye } from "./lib/Components/SideBar/SideBar.js";
25
- import { Skeleton as Pe } from "./lib/Components/Skeleton/Skeleton.js";
26
- import { Spinner as je } from "./lib/Components/Spinner/Spinner.js";
27
- import { Spot as ze } from "./lib/Components/Spot/Spot.js";
28
- import { Stepper as Je } from "./lib/Components/Stepper/Stepper.js";
29
- import { Subheader as Oe, SubheaderAction as Qe, SubheaderCount as Ue, SubheaderDescription as Ve, SubheaderInfo as We, SubheaderRow as Xe, SubheaderShowMore as Ye, SubheaderTitle as Ze } from "./lib/Components/Subheader/Subheader.js";
30
- import { Switch as $e } from "./lib/Components/Switch/Switch.js";
31
- import { Table as oo, TableActionBar as ro, TableActionBarLeading as to, TableActionBarTrailing as ao, TableBody as no, TableCell as io, TableCellContent as lo, TableGroupHeaderRow as po, TableHeader as mo, TableHeaderCell as To, TableHeaderRow as uo, TableInfoIcon as xo, TableLoadingRow as fo, TableRoot as So, TableRow as bo, TableSortButton as go } from "./lib/Components/Table/Table.js";
32
- import { Tag as Io } from "./lib/Components/Tag/Tag.js";
33
- import { TextInput as so } from "./lib/Components/TextInput/TextInput.js";
34
- import { Tile as Lo, TileContent as ho, TileDescription as Mo, TileSecondaryAction as Do, TileSpot as vo, TileTitle as Ao, TileTrailingContent as Ro } from "./lib/Components/Tile/Tile.js";
35
- import { TileButton as ko } from "./lib/Components/TileButton/TileButton.js";
36
- import { Tooltip as No, TooltipContent as yo, TooltipProvider as Go, TooltipTrigger as Po } from "./lib/Components/Tooltip/Tooltip.js";
37
- import { ThemeProvider as jo, useTheme as qo } from "./lib/Components/ThemeProvider/ThemeProvider.js";
12
+ import { DataTable as h, DataTableGlobalSearchInput as D, DataTableRoot as M } from "./lib/Components/DataTable/DataTable.js";
13
+ import { useLumenDataTable as A } from "./lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js";
14
+ import { Dialog as w, DialogBody as k, DialogContent as G, DialogFooter as H, DialogTrigger as N } from "./lib/Components/Dialog/Dialog.js";
15
+ import { DialogHeader as P } from "./lib/Components/Dialog/DialogHeader/DialogHeader.js";
16
+ import { Divider as j } from "./lib/Components/Divider/Divider.js";
17
+ import { IconButton as z } from "./lib/Components/IconButton/IconButton.js";
18
+ import { InteractiveIcon as J } from "./lib/Components/InteractiveIcon/InteractiveIcon.js";
19
+ import { Link as O } from "./lib/Components/Link/Link.js";
20
+ import { ListItem as U, ListItemContent as V, ListItemDescription as W, ListItemIcon as X, ListItemLeading as Y, ListItemSpot as Z, ListItemTitle as _, ListItemTrailing as $, ListItemTruncate as ee } from "./lib/Components/ListItem/ListItem.js";
21
+ import { Menu as te, MenuCheckboxItem as re, MenuContent as ae, MenuGroup as ne, MenuItem as ie, MenuLabel as le, MenuPortal as pe, MenuRadioGroup as me, MenuRadioItem as Te, MenuSeparator as ue, MenuSub as xe, MenuSubContent as fe, MenuSubTrigger as Se, MenuTrigger as be } from "./lib/Components/Menu/Menu.js";
22
+ import { NavBar as ge, NavBarBackButton as ce, NavBarCoinCapsule as Ie, NavBarTitle as Be, NavBarTrailing as se } from "./lib/Components/NavBar/NavBar.js";
23
+ import { PageIndicator as Le } from "./lib/Components/PageIndicator/PageIndicator.js";
24
+ import { SearchInput as De } from "./lib/Components/SearchInput/SearchInput.js";
25
+ import { Select as ve, SelectContent as Ae, SelectGroup as Re, SelectItem as we, SelectItemText as ke, SelectLabel as Ge, SelectSeparator as He, SelectTrigger as Ne } from "./lib/Components/Select/Select.js";
26
+ import { SideBar as Pe, SideBarCollapseToggle as Fe, SideBarItem as je, SideBarLeading as qe, SideBarTrailing as ze } from "./lib/Components/SideBar/SideBar.js";
27
+ import { Skeleton as Je } from "./lib/Components/Skeleton/Skeleton.js";
28
+ import { Spinner as Oe } from "./lib/Components/Spinner/Spinner.js";
29
+ import { Spot as Ue } from "./lib/Components/Spot/Spot.js";
30
+ import { Stepper as We } from "./lib/Components/Stepper/Stepper.js";
31
+ import { Subheader as Ye, SubheaderAction as Ze, SubheaderCount as _e, SubheaderDescription as $e, SubheaderInfo as eo, SubheaderRow as oo, SubheaderShowMore as to, SubheaderTitle as ro } from "./lib/Components/Subheader/Subheader.js";
32
+ import { Switch as no } from "./lib/Components/Switch/Switch.js";
33
+ import { Table as lo, TableActionBar as po, TableActionBarLeading as mo, TableActionBarTrailing as To, TableBody as uo, TableCell as xo, TableCellContent as fo, TableGroupHeaderRow as So, TableHeader as bo, TableHeaderCell as go, TableHeaderRow as co, TableInfoIcon as Io, TableLoadingRow as Bo, TableRoot as so, TableRow as Co, TableSortButton as Lo } from "./lib/Components/Table/Table.js";
34
+ import { Tag as Do } from "./lib/Components/Tag/Tag.js";
35
+ import { TextInput as vo } from "./lib/Components/TextInput/TextInput.js";
36
+ import { Tile as Ro, TileContent as wo, TileDescription as ko, TileSecondaryAction as Go, TileSpot as Ho, TileTitle as No, TileTrailingContent as yo } from "./lib/Components/Tile/Tile.js";
37
+ import { TileButton as Fo } from "./lib/Components/TileButton/TileButton.js";
38
+ import { Tooltip as qo, TooltipContent as zo, TooltipProvider as Eo, TooltipTrigger as Jo } from "./lib/Components/Tooltip/Tooltip.js";
39
+ import { ThemeProvider as Oo, useTheme as Qo } from "./lib/Components/ThemeProvider/ThemeProvider.js";
38
40
  export {
39
41
  a as AddressInput,
40
42
  p as AmountDisplay,
@@ -43,106 +45,110 @@ export {
43
45
  x as Banner,
44
46
  c as BaseButton,
45
47
  S as BaseInput,
46
- b as Button,
48
+ d as Button,
47
49
  B as CardButton,
48
50
  C as Checkbox,
49
- h as Dialog,
50
- M as DialogBody,
51
- D as DialogContent,
52
- v as DialogFooter,
53
- w as DialogHeader,
54
- A as DialogTrigger,
55
- H as Divider,
56
- y as IconButton,
57
- P as InteractiveIcon,
58
- r as Languages,
59
- j as Link,
60
- z as ListItem,
61
- E as ListItemContent,
62
- J as ListItemDescription,
63
- K as ListItemIcon,
64
- O as ListItemLeading,
65
- Q as ListItemSpot,
66
- U as ListItemTitle,
67
- V as ListItemTrailing,
68
- W as ListItemTruncate,
69
- Y as Menu,
70
- Z as MenuCheckboxItem,
71
- _ as MenuContent,
72
- $ as MenuGroup,
73
- ee as MenuItem,
74
- oe as MenuLabel,
75
- re as MenuPortal,
76
- te as MenuRadioGroup,
77
- ae as MenuRadioItem,
78
- ne as MenuSeparator,
79
- ie as MenuSub,
80
- le as MenuSubContent,
81
- pe as MenuSubTrigger,
82
- me as MenuTrigger,
83
- ue as NavBar,
84
- xe as NavBarBackButton,
85
- fe as NavBarCoinCapsule,
86
- Se as NavBarTitle,
87
- de as NavBarTrailing,
88
- ge as PageIndicator,
89
- Ie as SearchInput,
90
- se as Select,
91
- Ce as SelectContent,
92
- Le as SelectGroup,
93
- he as SelectItem,
94
- Me as SelectItemText,
95
- De as SelectLabel,
96
- ve as SelectSeparator,
97
- Ae as SelectTrigger,
98
- we as SideBar,
99
- ke as SideBarCollapseToggle,
100
- He as SideBarItem,
101
- Ne as SideBarLeading,
102
- ye as SideBarTrailing,
103
- Pe as Skeleton,
104
- je as Spinner,
105
- ze as Spot,
106
- Je as Stepper,
107
- Oe as Subheader,
108
- Qe as SubheaderAction,
109
- Ue as SubheaderCount,
110
- Ve as SubheaderDescription,
111
- We as SubheaderInfo,
112
- Xe as SubheaderRow,
113
- Ye as SubheaderShowMore,
114
- Ze as SubheaderTitle,
115
- $e as Switch,
116
- oo as Table,
117
- ro as TableActionBar,
118
- to as TableActionBarLeading,
119
- ao as TableActionBarTrailing,
120
- no as TableBody,
121
- io as TableCell,
122
- lo as TableCellContent,
123
- po as TableGroupHeaderRow,
124
- mo as TableHeader,
125
- To as TableHeaderCell,
126
- uo as TableHeaderRow,
127
- xo as TableInfoIcon,
128
- fo as TableLoadingRow,
129
- So as TableRoot,
130
- bo as TableRow,
131
- go as TableSortButton,
132
- Io as Tag,
133
- so as TextInput,
134
- jo as ThemeProvider,
135
- Lo as Tile,
136
- ko as TileButton,
137
- ho as TileContent,
138
- Mo as TileDescription,
139
- Do as TileSecondaryAction,
140
- vo as TileSpot,
141
- Ao as TileTitle,
142
- Ro as TileTrailingContent,
143
- No as Tooltip,
144
- yo as TooltipContent,
145
- Go as TooltipProvider,
146
- Po as TooltipTrigger,
147
- qo as useTheme
51
+ h as DataTable,
52
+ D as DataTableGlobalSearchInput,
53
+ M as DataTableRoot,
54
+ w as Dialog,
55
+ k as DialogBody,
56
+ G as DialogContent,
57
+ H as DialogFooter,
58
+ P as DialogHeader,
59
+ N as DialogTrigger,
60
+ j as Divider,
61
+ z as IconButton,
62
+ J as InteractiveIcon,
63
+ t as Languages,
64
+ O as Link,
65
+ U as ListItem,
66
+ V as ListItemContent,
67
+ W as ListItemDescription,
68
+ X as ListItemIcon,
69
+ Y as ListItemLeading,
70
+ Z as ListItemSpot,
71
+ _ as ListItemTitle,
72
+ $ as ListItemTrailing,
73
+ ee as ListItemTruncate,
74
+ te as Menu,
75
+ re as MenuCheckboxItem,
76
+ ae as MenuContent,
77
+ ne as MenuGroup,
78
+ ie as MenuItem,
79
+ le as MenuLabel,
80
+ pe as MenuPortal,
81
+ me as MenuRadioGroup,
82
+ Te as MenuRadioItem,
83
+ ue as MenuSeparator,
84
+ xe as MenuSub,
85
+ fe as MenuSubContent,
86
+ Se as MenuSubTrigger,
87
+ be as MenuTrigger,
88
+ ge as NavBar,
89
+ ce as NavBarBackButton,
90
+ Ie as NavBarCoinCapsule,
91
+ Be as NavBarTitle,
92
+ se as NavBarTrailing,
93
+ Le as PageIndicator,
94
+ De as SearchInput,
95
+ ve as Select,
96
+ Ae as SelectContent,
97
+ Re as SelectGroup,
98
+ we as SelectItem,
99
+ ke as SelectItemText,
100
+ Ge as SelectLabel,
101
+ He as SelectSeparator,
102
+ Ne as SelectTrigger,
103
+ Pe as SideBar,
104
+ Fe as SideBarCollapseToggle,
105
+ je as SideBarItem,
106
+ qe as SideBarLeading,
107
+ ze as SideBarTrailing,
108
+ Je as Skeleton,
109
+ Oe as Spinner,
110
+ Ue as Spot,
111
+ We as Stepper,
112
+ Ye as Subheader,
113
+ Ze as SubheaderAction,
114
+ _e as SubheaderCount,
115
+ $e as SubheaderDescription,
116
+ eo as SubheaderInfo,
117
+ oo as SubheaderRow,
118
+ to as SubheaderShowMore,
119
+ ro as SubheaderTitle,
120
+ no as Switch,
121
+ lo as Table,
122
+ po as TableActionBar,
123
+ mo as TableActionBarLeading,
124
+ To as TableActionBarTrailing,
125
+ uo as TableBody,
126
+ xo as TableCell,
127
+ fo as TableCellContent,
128
+ So as TableGroupHeaderRow,
129
+ bo as TableHeader,
130
+ go as TableHeaderCell,
131
+ co as TableHeaderRow,
132
+ Io as TableInfoIcon,
133
+ Bo as TableLoadingRow,
134
+ so as TableRoot,
135
+ Co as TableRow,
136
+ Lo as TableSortButton,
137
+ Do as Tag,
138
+ vo as TextInput,
139
+ Oo as ThemeProvider,
140
+ Ro as Tile,
141
+ Fo as TileButton,
142
+ wo as TileContent,
143
+ ko as TileDescription,
144
+ Go as TileSecondaryAction,
145
+ Ho as TileSpot,
146
+ No as TileTitle,
147
+ yo as TileTrailingContent,
148
+ qo as Tooltip,
149
+ zo as TooltipContent,
150
+ Eo as TooltipProvider,
151
+ Jo as TooltipTrigger,
152
+ A as useLumenDataTable,
153
+ Qo as useTheme
148
154
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { cn as f } from "../../../libs/utils-shared/dist/index.js";
3
- import { Slot as x, Slottable as h } from "@radix-ui/react-slot";
2
+ import { cn as x } from "../../../libs/utils-shared/dist/index.js";
3
+ import { Slot as f, Slottable as h } from "@radix-ui/react-slot";
4
4
  import { cva as d } from "class-variance-authority";
5
5
  import { Spinner as z } from "../Spinner/Spinner.js";
6
6
  const S = d(
@@ -37,12 +37,12 @@ const S = d(
37
37
  {
38
38
  disabled: !0,
39
39
  loading: !1,
40
- class: "cursor-default bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"
40
+ class: "cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"
41
41
  },
42
42
  {
43
43
  disabled: !0,
44
44
  loading: !0,
45
- class: "cursor-default bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"
45
+ class: "cursor-not-allowed bg-disabled text-disabled hover:bg-disabled hover:text-disabled active:bg-disabled active:text-disabled"
46
46
  }
47
47
  ],
48
48
  defaultVariants: {
@@ -72,10 +72,10 @@ const S = d(
72
72
  size: s,
73
73
  isFull: v,
74
74
  disabled: e = !1,
75
- asChild: o = !1,
75
+ asChild: i = !1,
76
76
  icon: n,
77
77
  loading: r = !1,
78
- children: i,
78
+ children: o,
79
79
  onClick: p,
80
80
  ...g
81
81
  }) => {
@@ -86,9 +86,9 @@ const S = d(
86
86
  lg: 24
87
87
  }[s] : 24;
88
88
  return /* @__PURE__ */ m(
89
- o ? x : "button",
89
+ i ? f : "button",
90
90
  {
91
- className: f(
91
+ className: x(
92
92
  S({ disabled: e, loading: r, appearance: a, size: s, isFull: v }),
93
93
  u
94
94
  ),
@@ -112,7 +112,7 @@ const S = d(
112
112
  className: c({ appearance: a, disabled: e })
113
113
  }
114
114
  ),
115
- i && (o ? /* @__PURE__ */ t(h, { children: i }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: i }))
115
+ o && (i ? /* @__PURE__ */ t(h, { children: o }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: o }))
116
116
  ]
117
117
  }
118
118
  );
@@ -0,0 +1,39 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { SearchInputProps } from '../SearchInput';
3
+ import { DataTableProps, DataTableRootProps } from './types';
4
+ /**
5
+ * Context provider for the DataTable compound.
6
+ * Accepts a TanStack table instance and visual options, then makes them
7
+ * available to `DataTable` and future children like `DataTableActionBar`.
8
+ *
9
+ * @example
10
+ * <DataTableRoot table={table} appearance="plain">
11
+ * <DataTable />
12
+ * </DataTableRoot>
13
+ */
14
+ export declare const DataTableRoot: {
15
+ <TData extends RowData>({ table, appearance, paginationMode, loading, onScrollBottom, onRowClick, groupBy, renderGroupHeader, hideHeader, children, className, ref, ...props }: DataTableRootProps<TData>): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ /**
19
+ * Renders the full table (header + body) from the TanStack table instance
20
+ * provided by `DataTableRoot`. Internally composes the pure-UI Table building blocks.
21
+ *
22
+ * @example
23
+ * <DataTableRoot table={table}>
24
+ * <DataTable />
25
+ * </DataTableRoot>
26
+ */
27
+ export declare const DataTable: {
28
+ ({ className, ref, ...props }: DataTableProps): import("react/jsx-runtime").JSX.Element;
29
+ displayName: string;
30
+ };
31
+ /**
32
+ * A search input that connects to the TanStack table's `globalFilter` state
33
+ * via the `DataTableRoot` context. No external state management is required.
34
+ */
35
+ export declare const DataTableGlobalSearchInput: {
36
+ ({ onChange, ...props }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
37
+ displayName: string;
38
+ };
39
+ //# sourceMappingURL=DataTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/DataTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,OAAO,EAER,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAe/D,OAAO,EAGL,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAcjB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;KAAI,KAAK,SAAS,OAAO,0JAchD,kBAAkB,CAAC,KAAK,CAAC;;CAoB3B,CAAC;AA2DF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS;mCAAkC,cAAc;;CA6BrE,CAAC;AA0HF;;;GAGG;AACH,eAAO,MAAM,0BAA0B;6BAGpC,gBAAgB;;CAqBlB,CAAC"}
@@ -0,0 +1,195 @@
1
+ import { jsx as c, jsxs as u } from "react/jsx-runtime";
2
+ import { createSafeContext as h, cn as x } from "../../../libs/utils-shared/dist/index.js";
3
+ import { flexRender as b } from "@tanstack/react-table";
4
+ import { useCallback as N, Fragment as B } from "react";
5
+ import { TableRoot as C, Table as S, TableLoadingRow as H, TableHeader as k, TableHeaderRow as G, TableHeaderCell as v, TableSortButton as q, TableBody as T, TableGroupHeaderRow as I, TableRow as F, TableCell as M } from "../Table/Table.js";
6
+ import { SearchInput as j } from "../SearchInput/SearchInput.js";
7
+ const [P, d] = h("DataTableContext"), V = ({
8
+ table: t,
9
+ appearance: r = "no-background",
10
+ paginationMode: n = "none",
11
+ loading: a = !1,
12
+ onScrollBottom: e,
13
+ onRowClick: l,
14
+ groupBy: o,
15
+ renderGroupHeader: s,
16
+ hideHeader: i = !1,
17
+ children: f,
18
+ className: y,
19
+ ref: w,
20
+ ...R
21
+ }) => /* @__PURE__ */ c(
22
+ P,
23
+ {
24
+ value: {
25
+ hideHeader: i,
26
+ paginationMode: n,
27
+ table: t,
28
+ appearance: r,
29
+ loading: a,
30
+ onScrollBottom: e,
31
+ onRowClick: l,
32
+ groupBy: o,
33
+ renderGroupHeader: s
34
+ },
35
+ children: /* @__PURE__ */ c("div", { ref: w, className: x("flex flex-col", y), ...R, children: f })
36
+ }
37
+ );
38
+ V.displayName = "DataTableRoot";
39
+ const p = ({
40
+ className: t,
41
+ ref: r,
42
+ ...n
43
+ }) => {
44
+ const { table: a } = d({
45
+ consumerName: "DataTableHeader",
46
+ contextRequired: !0
47
+ });
48
+ return /* @__PURE__ */ c(k, { ref: r, className: t, ...n, children: a.getHeaderGroups().map((e) => /* @__PURE__ */ c(G, { children: e.headers.map((l) => {
49
+ const o = l.column.columnDef.meta;
50
+ return /* @__PURE__ */ c(
51
+ v,
52
+ {
53
+ align: o == null ? void 0 : o.align,
54
+ hideBelow: o == null ? void 0 : o.hideBelow,
55
+ className: o == null ? void 0 : o.className,
56
+ trailingContent: o == null ? void 0 : o.headerTrailingContent,
57
+ children: l.isPlaceholder ? null : l.column.getCanSort() ? /* @__PURE__ */ c(
58
+ q,
59
+ {
60
+ sortDirection: l.column.getIsSorted() || void 0,
61
+ onClick: l.column.getToggleSortingHandler(),
62
+ align: o == null ? void 0 : o.align,
63
+ children: b(
64
+ l.column.columnDef.header,
65
+ l.getContext()
66
+ )
67
+ }
68
+ ) : b(
69
+ l.column.columnDef.header,
70
+ l.getContext()
71
+ )
72
+ },
73
+ l.id
74
+ );
75
+ }) }, e.id)) });
76
+ };
77
+ p.displayName = "DataTableHeader";
78
+ const J = ({ className: t, ref: r, ...n }) => {
79
+ const {
80
+ appearance: a,
81
+ paginationMode: e,
82
+ hideHeader: l,
83
+ loading: o,
84
+ onScrollBottom: s,
85
+ groupBy: i
86
+ } = d({
87
+ consumerName: "DataTable",
88
+ contextRequired: !0
89
+ });
90
+ return /* @__PURE__ */ u(
91
+ C,
92
+ {
93
+ ref: r,
94
+ appearance: a,
95
+ loading: o,
96
+ onScrollBottom: s,
97
+ className: t,
98
+ ...n,
99
+ children: [
100
+ /* @__PURE__ */ u(S, { children: [
101
+ !l && /* @__PURE__ */ c(p, {}),
102
+ i ? /* @__PURE__ */ c(g, {}) : /* @__PURE__ */ c(D, {})
103
+ ] }),
104
+ e === "infinite-scroll" && /* @__PURE__ */ c(H, {})
105
+ ]
106
+ }
107
+ );
108
+ };
109
+ J.displayName = "DataTable";
110
+ const D = ({ className: t, ref: r, ...n }) => {
111
+ const { table: a } = d({
112
+ consumerName: "DataTableBody",
113
+ contextRequired: !0
114
+ });
115
+ return /* @__PURE__ */ c(T, { ref: r, className: t, ...n, children: a.getRowModel().rows.map((e) => /* @__PURE__ */ c(m, { row: e }, e.id)) });
116
+ };
117
+ D.displayName = "DataTableBody";
118
+ const K = (t, r) => {
119
+ const n = [];
120
+ let a = null;
121
+ for (const e of t) {
122
+ const l = r(e);
123
+ (!a || a.key !== l) && (a = { key: l, rows: [], count: 0 }, n.push(a)), a.rows.push(e), a.count++;
124
+ }
125
+ return n;
126
+ }, g = ({
127
+ className: t,
128
+ ref: r,
129
+ ...n
130
+ }) => {
131
+ const { table: a, groupBy: e, renderGroupHeader: l } = d({
132
+ consumerName: "DataTableGroupedBody",
133
+ contextRequired: !0
134
+ }), o = K(a.getRowModel().rows, e);
135
+ return /* @__PURE__ */ c(T, { ref: r, className: t, ...n, children: o.map((s) => /* @__PURE__ */ u(B, { children: [
136
+ /* @__PURE__ */ c(I, { colSpan: s.rows[0].getVisibleCells().length, children: l ? l({ row: s.rows[0], count: s.count }) : s.key }),
137
+ s.rows.map((i) => /* @__PURE__ */ c(m, { row: i }, i.id))
138
+ ] }, s.key)) });
139
+ };
140
+ g.displayName = "DataTableGroupedBody";
141
+ const m = ({ row: t }) => {
142
+ const { onRowClick: r } = d({
143
+ consumerName: "DataTableRow",
144
+ contextRequired: !0
145
+ }), n = !!r;
146
+ return /* @__PURE__ */ c(
147
+ F,
148
+ {
149
+ clickable: n,
150
+ onClick: n ? () => r == null ? void 0 : r(t) : void 0,
151
+ children: t.getVisibleCells().map((a) => {
152
+ const e = a.column.columnDef.meta;
153
+ return /* @__PURE__ */ c(
154
+ M,
155
+ {
156
+ align: e == null ? void 0 : e.align,
157
+ hideBelow: e == null ? void 0 : e.hideBelow,
158
+ className: e == null ? void 0 : e.className,
159
+ children: b(a.column.columnDef.cell, a.getContext())
160
+ },
161
+ a.id
162
+ );
163
+ })
164
+ }
165
+ );
166
+ };
167
+ m.displayName = "DataTableRow";
168
+ const L = ({
169
+ onChange: t,
170
+ ...r
171
+ }) => {
172
+ const { table: n } = d({
173
+ consumerName: "DataTableGlobalSearchInput",
174
+ contextRequired: !0
175
+ }), a = N(
176
+ (e) => {
177
+ n.setGlobalFilter(e.target.value), t == null || t(e);
178
+ },
179
+ [n, t]
180
+ );
181
+ return /* @__PURE__ */ c(
182
+ j,
183
+ {
184
+ value: n.getState().globalFilter ?? "",
185
+ onChange: a,
186
+ ...r
187
+ }
188
+ );
189
+ };
190
+ L.displayName = "DataTableGlobalSearchInput";
191
+ export {
192
+ J as DataTable,
193
+ L as DataTableGlobalSearchInput,
194
+ V as DataTableRoot
195
+ };
@@ -0,0 +1,4 @@
1
+ export * from './DataTable';
2
+ export * from './types';
3
+ export * from './useLumenDataTable/useLumenDataTable';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,uCAAuC,CAAC"}