@ledgerhq/lumen-ui-react 0.0.83 → 0.0.85
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/ai-rules/RULES.md +1 -0
- package/dist/index.js +134 -128
- package/dist/lib/Components/Button/BaseButton.js +9 -9
- package/dist/lib/Components/CardButton/CardButton.js +12 -12
- package/dist/lib/Components/DataTable/DataTable.d.ts +39 -0
- package/dist/lib/Components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/DataTable.js +195 -0
- package/dist/lib/Components/DataTable/index.d.ts +4 -0
- package/dist/lib/Components/DataTable/index.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/types.d.ts +111 -0
- package/dist/lib/Components/DataTable/types.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/index.d.ts +2 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/index.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.d.ts +38 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.d.ts.map +1 -0
- package/dist/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.js +10 -0
- package/dist/lib/Components/Skeleton/Skeleton.d.ts +4 -1
- package/dist/lib/Components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/lib/Components/Skeleton/Skeleton.js +84 -98
- package/dist/lib/Components/Skeleton/types.d.ts +3 -3
- package/dist/lib/Components/Skeleton/types.d.ts.map +1 -1
- package/dist/lib/Components/Spot/Spot.d.ts +4 -1
- package/dist/lib/Components/Spot/Spot.d.ts.map +1 -1
- package/dist/lib/Components/Spot/Spot.js +23 -23
- package/dist/lib/Components/Spot/types.d.ts +2 -2
- package/dist/lib/Components/Spot/types.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.d.ts +65 -81
- package/dist/lib/Components/Table/Table.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.js +306 -267
- package/dist/lib/Components/Table/types.d.ts +17 -17
- package/dist/lib/Components/Table/types.d.ts.map +1 -1
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/libs/utils-shared/dist/index.js +59 -59
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Row, RowData, Table } from '@tanstack/react-table';
|
|
2
|
+
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
3
|
+
import { Breakpoints } from '../../../types';
|
|
4
|
+
import { TableRootProps } from '../Table/types';
|
|
5
|
+
/**
|
|
6
|
+
* Lumen-specific column metadata that extends TanStack's ColumnMeta.
|
|
7
|
+
* These properties are picked up by DataTable's auto-rendering logic.
|
|
8
|
+
*/
|
|
9
|
+
export type LumenColumnMeta = {
|
|
10
|
+
/**
|
|
11
|
+
* Text alignment within the column cells and header.
|
|
12
|
+
* @default 'start'
|
|
13
|
+
*/
|
|
14
|
+
align?: 'start' | 'end';
|
|
15
|
+
/**
|
|
16
|
+
* Hides the column when the screen width is below the specified breakpoint.
|
|
17
|
+
*/
|
|
18
|
+
hideBelow?: Breakpoints;
|
|
19
|
+
/**
|
|
20
|
+
* Custom className applied to each cell in this column including the header cell.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Trailing content rendered in the header cell for additional content.
|
|
25
|
+
* Shown only on hover.
|
|
26
|
+
*/
|
|
27
|
+
headerTrailingContent?: ReactNode;
|
|
28
|
+
};
|
|
29
|
+
declare module '@tanstack/react-table' {
|
|
30
|
+
interface ColumnMeta<TData extends RowData, TValue> extends LumenColumnMeta {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export type DataTableRootProps<TData extends RowData = RowData> = {
|
|
34
|
+
/**
|
|
35
|
+
* The TanStack table instance returned by `useLumenDataTable`.
|
|
36
|
+
*/
|
|
37
|
+
table: Table<TData>;
|
|
38
|
+
/**
|
|
39
|
+
* The appearance of the table.
|
|
40
|
+
* @default 'no-background'
|
|
41
|
+
*/
|
|
42
|
+
appearance?: TableRootProps['appearance'];
|
|
43
|
+
/**
|
|
44
|
+
* The pagination mode of the table.
|
|
45
|
+
* @default 'none'
|
|
46
|
+
*/
|
|
47
|
+
paginationMode?: 'infinite-scroll' | 'pagination' | 'none';
|
|
48
|
+
/**
|
|
49
|
+
* When true, displays loading indicator and disables onScrollBottom.
|
|
50
|
+
*/
|
|
51
|
+
loading?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Callback fired when scroll reaches the bottom of the table container.
|
|
54
|
+
*/
|
|
55
|
+
onScrollBottom?: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Content rendered inside the DataTableRoot (e.g. DataTableActionBar, DataTable).
|
|
58
|
+
*/
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Custom className for the root wrapper.
|
|
62
|
+
*/
|
|
63
|
+
className?: string;
|
|
64
|
+
/**
|
|
65
|
+
* When true, hides the header section.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
hideHeader?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Callback fired when a row is clicked.
|
|
71
|
+
* Return the data of the given row from the callback function.
|
|
72
|
+
* @default undefined
|
|
73
|
+
*/
|
|
74
|
+
onRowClick?: (row: Row<TData>) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Extracts a group key from a row. When provided, rows are visually
|
|
77
|
+
* separated by group header rows whenever the key changes.
|
|
78
|
+
* Data must be pre-sorted by the grouping field.
|
|
79
|
+
* @default undefined
|
|
80
|
+
*/
|
|
81
|
+
groupBy?: (row: Row<TData>) => string;
|
|
82
|
+
/**
|
|
83
|
+
* Custom renderer for group header content.
|
|
84
|
+
* Receives the first row of the group and the number of rows in the group.
|
|
85
|
+
* When omitted, defaults to rendering the group key string.
|
|
86
|
+
* @default undefined
|
|
87
|
+
*/
|
|
88
|
+
renderGroupHeader?: (info: {
|
|
89
|
+
row: Row<TData>;
|
|
90
|
+
count: number;
|
|
91
|
+
}) => ReactNode;
|
|
92
|
+
} & Omit<ComponentPropsWithRef<'div'>, 'children'>;
|
|
93
|
+
export type DataTableProps = {
|
|
94
|
+
/**
|
|
95
|
+
* Custom className for the scrollable table container (TableRoot).
|
|
96
|
+
*/
|
|
97
|
+
className?: string;
|
|
98
|
+
} & Omit<ComponentPropsWithRef<'div'>, 'children'>;
|
|
99
|
+
export type DataTableHeaderProps = {
|
|
100
|
+
/**
|
|
101
|
+
* Custom className for the header section.
|
|
102
|
+
*/
|
|
103
|
+
className?: string;
|
|
104
|
+
} & ComponentPropsWithRef<'thead'>;
|
|
105
|
+
export type DataTableBodyProps = {
|
|
106
|
+
/**
|
|
107
|
+
* Custom className for the body section.
|
|
108
|
+
*/
|
|
109
|
+
className?: string;
|
|
110
|
+
} & ComponentPropsWithRef<'tbody'>;
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DataTable/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,SAAS,CAAC;CACnC,CAAC;AAGF,OAAO,QAAQ,uBAAuB,CAAC;IAErC,UAAU,UAAU,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM,CAAE,SAAQ,eAAe;KAAG;CAC/E;AAED,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,OAAO,GAAG,OAAO,IAAI;IAChE;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC1C;;;OAGG;IACH,cAAc,CAAC,EAAE,iBAAiB,GAAG,YAAY,GAAG,MAAM,CAAC;IAC3D;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACvC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC;IACtC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;CAC7E,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAEnC,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/DataTable/useLumenDataTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TableOptions, Table } from '@tanstack/react-table';
|
|
2
|
+
type UseLumenDataTableOptions<TData> = Omit<TableOptions<TData>, 'getCoreRowModel' | 'getSortedRowModel' | 'getFilteredRowModel'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Override the default getCoreRowModel if needed.
|
|
5
|
+
* @default getCoreRowModel()
|
|
6
|
+
*/
|
|
7
|
+
getCoreRowModel?: TableOptions<TData>['getCoreRowModel'];
|
|
8
|
+
/**
|
|
9
|
+
* Override the default getSortedRowModel if needed.
|
|
10
|
+
* @default getSortedRowModel()
|
|
11
|
+
*/
|
|
12
|
+
getSortedRowModel?: TableOptions<TData>['getSortedRowModel'];
|
|
13
|
+
/**
|
|
14
|
+
* Override the default getFilteredRowModel if needed.
|
|
15
|
+
* @default getFilteredRowModel()
|
|
16
|
+
*/
|
|
17
|
+
getFilteredRowModel?: TableOptions<TData>['getFilteredRowModel'];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Hook wrapping TanStack's `useReactTable` with opinionated defaults.
|
|
21
|
+
*
|
|
22
|
+
* - Injects `getCoreRowModel` automatically.
|
|
23
|
+
* - Injects `getFilteredRowModel` automatically for client-side filtering.
|
|
24
|
+
* - Injects `getSortedRowModel` automatically for client-side sorting.
|
|
25
|
+
* - Returns the TanStack `Table` instance.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const table = useLumenDataTable({
|
|
29
|
+
* data,
|
|
30
|
+
* columns: [
|
|
31
|
+
* { accessorKey: 'name', header: 'Name' },
|
|
32
|
+
* { accessorKey: 'price', header: 'Price', meta: { align: 'end' } },
|
|
33
|
+
* ],
|
|
34
|
+
* });
|
|
35
|
+
*/
|
|
36
|
+
export declare const useLumenDataTable: <TData>(options: UseLumenDataTableOptions<TData>) => Table<TData>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=useLumenDataTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLumenDataTable.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/DataTable/useLumenDataTable/useLumenDataTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACZ,KAAK,EAEN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,UAAU,CAAC;AAElB,KAAK,wBAAwB,CAAC,KAAK,IAAI,IAAI,CACzC,YAAY,CAAC,KAAK,CAAC,EACnB,iBAAiB,GAAG,mBAAmB,GAAG,qBAAqB,CAChE,GAAG;IACF;;;OAGG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAAC;IACzD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAC7D;;;OAGG;IACH,mBAAmB,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,CAAC;CAClE,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,WAC5B,wBAAwB,CAAC,KAAK,CAAC,KACvC,KAAK,CAAC,KAAK,CAOb,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useReactTable as o, getSortedRowModel as t, getFilteredRowModel as d, getCoreRowModel as l } from "@tanstack/react-table";
|
|
2
|
+
const R = (e) => o({
|
|
3
|
+
...e,
|
|
4
|
+
getCoreRowModel: e.getCoreRowModel ?? l(),
|
|
5
|
+
getFilteredRowModel: e.getFilteredRowModel ?? d(),
|
|
6
|
+
getSortedRowModel: e.getSortedRowModel ?? t()
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
R as useLumenDataTable
|
|
10
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { SkeletonProps } from './types';
|
|
2
|
-
declare const Skeleton:
|
|
2
|
+
declare const Skeleton: {
|
|
3
|
+
({ className, component, ref, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
3
6
|
export { Skeleton };
|
|
4
7
|
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Skeleton/Skeleton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Skeleton/Skeleton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA8F7C,QAAA,MAAM,QAAQ;8CAA6C,aAAa;;CAkBvE,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,109 +1,95 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"animate-pulse rounded-md bg-muted-transparent",
|
|
11
|
-
a
|
|
12
|
-
),
|
|
13
|
-
...s
|
|
14
|
-
}
|
|
15
|
-
)
|
|
2
|
+
import { cn as d } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
const l = ({ className: a, ref: s, ...t }) => /* @__PURE__ */ e(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
ref: s,
|
|
7
|
+
className: d("animate-pulse rounded-md bg-muted-transparent", a),
|
|
8
|
+
...t
|
|
9
|
+
}
|
|
16
10
|
);
|
|
17
11
|
l.displayName = "BaseSkeleton";
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
)
|
|
12
|
+
const r = ({ className: a, ref: s, ...t }) => /* @__PURE__ */ n(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
ref: s,
|
|
16
|
+
"data-slot": "skeleton",
|
|
17
|
+
className: d("flex w-full items-center gap-16 py-8", a),
|
|
18
|
+
...t,
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ e(l, { className: "size-48 shrink-0 rounded-full" }),
|
|
21
|
+
/* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-10", children: [
|
|
22
|
+
/* @__PURE__ */ e(l, { className: "h-12 w-176 rounded-full" }),
|
|
23
|
+
/* @__PURE__ */ e(l, { className: "h-12 w-112 rounded-full" })
|
|
24
|
+
] })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
35
27
|
);
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
)
|
|
28
|
+
r.displayName = "ListItemSkeleton";
|
|
29
|
+
const o = ({ className: a, ref: s, ...t }) => /* @__PURE__ */ n(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: s,
|
|
33
|
+
"data-slot": "skeleton",
|
|
34
|
+
className: d(
|
|
35
|
+
"flex w-112 flex-col items-center gap-12 rounded-md px-8 py-16",
|
|
36
|
+
a
|
|
37
|
+
),
|
|
38
|
+
...t,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ e(l, { className: "size-48 shrink-0 rounded-full" }),
|
|
41
|
+
/* @__PURE__ */ n("div", { className: "flex w-full flex-col items-center gap-8", children: [
|
|
42
|
+
/* @__PURE__ */ e(l, { className: "h-12 w-48 rounded-full" }),
|
|
43
|
+
/* @__PURE__ */ e(l, { className: "h-12 w-64 rounded-full" })
|
|
44
|
+
] })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
57
47
|
);
|
|
58
|
-
|
|
59
|
-
const u =
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
o.displayName = "TileSkeleton";
|
|
49
|
+
const u = ({ className: a, ref: s, ...t }) => /* @__PURE__ */ n(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref: s,
|
|
53
|
+
"data-slot": "skeleton",
|
|
54
|
+
className: d("flex w-full flex-col", a),
|
|
55
|
+
...t,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ e("div", { className: "flex h-40 w-full items-center", children: /* @__PURE__ */ e(l, { className: "h-12 w-full" }) }),
|
|
58
|
+
/* @__PURE__ */ n("div", { className: "flex h-64 items-center gap-14 opacity-90", children: [
|
|
59
|
+
/* @__PURE__ */ e(l, { className: "size-40 rounded-full" }),
|
|
60
|
+
/* @__PURE__ */ e("div", { className: "grow", children: /* @__PURE__ */ e(l, { className: "h-12 w-11/12" }) })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ n("div", { className: "flex h-64 items-center gap-14 opacity-80", children: [
|
|
63
|
+
/* @__PURE__ */ e(l, { className: "size-40 rounded-full" }),
|
|
64
|
+
/* @__PURE__ */ e("div", { className: "grow", children: /* @__PURE__ */ e(l, { className: "h-12 w-10/12" }) })
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ n("div", { className: "flex h-64 items-center gap-14 opacity-70", children: [
|
|
67
|
+
/* @__PURE__ */ e(l, { className: "size-40 rounded-full" }),
|
|
68
|
+
/* @__PURE__ */ e("div", { className: "grow", children: /* @__PURE__ */ e(l, { className: "h-12 w-9/12" }) })
|
|
69
|
+
] })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
), i = {
|
|
73
|
+
"list-item": r,
|
|
74
|
+
tile: o,
|
|
75
|
+
table: u
|
|
76
|
+
}, f = ({ className: a, component: s, ref: t, ...c }) => {
|
|
77
|
+
if (s && i[s]) {
|
|
78
|
+
const m = i[s];
|
|
79
|
+
return /* @__PURE__ */ e(m, { ...c, ref: t, className: a });
|
|
80
|
+
}
|
|
81
|
+
return /* @__PURE__ */ e(
|
|
82
|
+
l,
|
|
62
83
|
{
|
|
63
84
|
ref: t,
|
|
85
|
+
"data-testid": "skeleton",
|
|
86
|
+
className: a,
|
|
64
87
|
"data-slot": "skeleton",
|
|
65
|
-
|
|
66
|
-
...s,
|
|
67
|
-
children: [
|
|
68
|
-
/* @__PURE__ */ e("div", { className: "flex h-40 w-full items-center", children: /* @__PURE__ */ e(l, { className: "h-12 w-full" }) }),
|
|
69
|
-
/* @__PURE__ */ n("div", { className: "flex h-64 items-center gap-14 opacity-90", children: [
|
|
70
|
-
/* @__PURE__ */ e(l, { className: "size-40 rounded-full" }),
|
|
71
|
-
/* @__PURE__ */ e("div", { className: "grow", children: /* @__PURE__ */ e(l, { className: "h-12 w-11/12" }) })
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ n("div", { className: "flex h-64 items-center gap-14 opacity-80", children: [
|
|
74
|
-
/* @__PURE__ */ e(l, { className: "size-40 rounded-full" }),
|
|
75
|
-
/* @__PURE__ */ e("div", { className: "grow", children: /* @__PURE__ */ e(l, { className: "h-12 w-10/12" }) })
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ n("div", { className: "flex h-64 items-center gap-14 opacity-70", children: [
|
|
78
|
-
/* @__PURE__ */ e(l, { className: "size-40 rounded-full" }),
|
|
79
|
-
/* @__PURE__ */ e("div", { className: "grow", children: /* @__PURE__ */ e(l, { className: "h-12 w-9/12" }) })
|
|
80
|
-
] })
|
|
81
|
-
]
|
|
88
|
+
...c
|
|
82
89
|
}
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
tile: m,
|
|
87
|
-
table: u
|
|
88
|
-
}, N = d(
|
|
89
|
-
({ className: a, component: s, ...t }, c) => {
|
|
90
|
-
if (s && r[s]) {
|
|
91
|
-
const f = r[s];
|
|
92
|
-
return /* @__PURE__ */ e(f, { ...t, ref: c, className: a });
|
|
93
|
-
}
|
|
94
|
-
return /* @__PURE__ */ e(
|
|
95
|
-
l,
|
|
96
|
-
{
|
|
97
|
-
ref: c,
|
|
98
|
-
"data-testid": "skeleton",
|
|
99
|
-
className: a,
|
|
100
|
-
"data-slot": "skeleton",
|
|
101
|
-
...t
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
N.displayName = "Skeleton";
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
f.displayName = "Skeleton";
|
|
107
93
|
export {
|
|
108
|
-
|
|
94
|
+
f as Skeleton
|
|
109
95
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type SkeletonProps =
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
type SkeletonProps = {
|
|
3
3
|
/**
|
|
4
4
|
* Pre-built skeleton component variant
|
|
5
5
|
* - `list-item`: Horizontal layout with circle and two text lines
|
|
6
6
|
* - `tile`: Vertical centered layout with circle and two text lines in a rounded container
|
|
7
7
|
*/
|
|
8
8
|
component?: 'list-item' | 'tile' | 'table';
|
|
9
|
-
}
|
|
9
|
+
} & ComponentPropsWithRef<'div'>;
|
|
10
10
|
export type { SkeletonProps };
|
|
11
11
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Skeleton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAE9C,KAAK,aAAa,GAAG;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;CAC5C,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEjC,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -33,5 +33,8 @@ import { SpotProps } from './types';
|
|
|
33
33
|
* <Spot appearance="bluetooth" />
|
|
34
34
|
* <Spot appearance="bluetooth" disabled />
|
|
35
35
|
*/
|
|
36
|
-
export declare const Spot:
|
|
36
|
+
export declare const Spot: {
|
|
37
|
+
(props: SpotProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
37
40
|
//# sourceMappingURL=Spot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spot.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Spot/Spot.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAY,MAAM,SAAS,CAAC;AA8B9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Spot.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Spot/Spot.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAY,MAAM,SAAS,CAAC;AA8B9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,IAAI;YAAW,SAAS;;CAyDpC,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cn as h } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import { cva as
|
|
4
|
-
import {
|
|
5
|
-
import { Spinner as
|
|
6
|
-
import { InformationFill as
|
|
7
|
-
import { WarningFill as
|
|
8
|
-
import { DeleteCircleFill as
|
|
9
|
-
import { CheckmarkCircleFill as
|
|
10
|
-
import { BluetoothCircleFill as
|
|
11
|
-
const
|
|
3
|
+
import { cva as b } from "class-variance-authority";
|
|
4
|
+
import { useMemo as f } from "react";
|
|
5
|
+
import { Spinner as g } from "../Spinner/Spinner.js";
|
|
6
|
+
import { InformationFill as x } from "../../Symbols/Icons/InformationFill.js";
|
|
7
|
+
import { WarningFill as z } from "../../Symbols/Icons/WarningFill.js";
|
|
8
|
+
import { DeleteCircleFill as w } from "../../Symbols/Icons/DeleteCircleFill.js";
|
|
9
|
+
import { CheckmarkCircleFill as y } from "../../Symbols/Icons/CheckmarkCircleFill.js";
|
|
10
|
+
import { BluetoothCircleFill as F } from "../../Symbols/Icons/BluetoothCircleFill.js";
|
|
11
|
+
const C = b(
|
|
12
12
|
"flex items-center justify-center rounded-full bg-muted-transparent",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
@@ -34,8 +34,8 @@ const N = f(
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
),
|
|
38
|
-
const { appearance:
|
|
37
|
+
), N = (r) => {
|
|
38
|
+
const { appearance: s, className: a, disabled: i, size: o = 48, ref: c, ...l } = r, m = {
|
|
39
39
|
32: 12,
|
|
40
40
|
40: 16,
|
|
41
41
|
48: 20,
|
|
@@ -47,7 +47,7 @@ const N = f(
|
|
|
47
47
|
48: "heading-5",
|
|
48
48
|
56: "heading-4",
|
|
49
49
|
72: "heading-2"
|
|
50
|
-
}, t = m[o] ?? 20, n = p[o] ?? "heading-5", d =
|
|
50
|
+
}, t = m[o] ?? 20, n = p[o] ?? "heading-5", d = f(() => {
|
|
51
51
|
switch (r.appearance) {
|
|
52
52
|
case "icon": {
|
|
53
53
|
const { icon: u } = r;
|
|
@@ -56,30 +56,30 @@ const N = f(
|
|
|
56
56
|
case "number":
|
|
57
57
|
return /* @__PURE__ */ e("span", { className: n, children: r.number });
|
|
58
58
|
case "bluetooth":
|
|
59
|
-
return /* @__PURE__ */ e(C, { size: t });
|
|
60
|
-
case "check":
|
|
61
59
|
return /* @__PURE__ */ e(F, { size: t });
|
|
62
|
-
case "
|
|
60
|
+
case "check":
|
|
63
61
|
return /* @__PURE__ */ e(y, { size: t });
|
|
64
|
-
case "
|
|
62
|
+
case "error":
|
|
65
63
|
return /* @__PURE__ */ e(w, { size: t });
|
|
66
|
-
case "
|
|
64
|
+
case "warning":
|
|
67
65
|
return /* @__PURE__ */ e(z, { size: t });
|
|
68
|
-
case "
|
|
66
|
+
case "info":
|
|
69
67
|
return /* @__PURE__ */ e(x, { size: t });
|
|
68
|
+
case "loader":
|
|
69
|
+
return /* @__PURE__ */ e(g, { size: t });
|
|
70
70
|
}
|
|
71
71
|
}, [r, t, n]);
|
|
72
72
|
return /* @__PURE__ */ e(
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
|
-
ref:
|
|
76
|
-
className: h(
|
|
75
|
+
ref: c,
|
|
76
|
+
className: h(a, C({ appearance: s, disabled: i, size: o })),
|
|
77
77
|
...l,
|
|
78
78
|
children: d
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
}
|
|
82
|
-
|
|
81
|
+
};
|
|
82
|
+
N.displayName = "Spot";
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
N as Spot
|
|
85
85
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithRef, ComponentType } from 'react';
|
|
2
2
|
import { IconSize } from '../Icon/types';
|
|
3
3
|
export type SpotAppearance = 'icon' | 'bluetooth' | 'check' | 'error' | 'warning' | 'info' | 'loader' | 'number';
|
|
4
4
|
type SpotIconProps = {
|
|
@@ -50,6 +50,6 @@ export type SpotProps = DiscriminatedSpotProps & {
|
|
|
50
50
|
* @default 48
|
|
51
51
|
*/
|
|
52
52
|
size?: SpotSize;
|
|
53
|
-
} &
|
|
53
|
+
} & ComponentPropsWithRef<'div'>;
|
|
54
54
|
export {};
|
|
55
55
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Spot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Spot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,WAAW,GACX,OAAO,GACP,OAAO,GACP,SAAS,GACT,MAAM,GACN,QAAQ,GACR,QAAQ,CAAC;AAEb,KAAK,aAAa,GAAG;IACnB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9D,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,UAAU,EAAE,QAAQ,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC/C,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;CACxD,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC9B,aAAa,GACb,eAAe,GACf,eAAe,CAAC;AAEpB,MAAM,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9C,MAAM,MAAM,SAAS,GAAG,sBAAsB,GAAG;IAC/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
|