@fanvue/ui 3.45.0 → 3.46.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/dist/cjs/components/Icons/BookmarkIcon.cjs +65 -0
- package/dist/cjs/components/Icons/BookmarkIcon.cjs.map +1 -0
- package/dist/cjs/components/Table/Table.cjs +180 -50
- package/dist/cjs/components/Table/Table.cjs.map +1 -1
- package/dist/cjs/components/Table/TablePagination.cjs +78 -35
- package/dist/cjs/components/Table/TablePagination.cjs.map +1 -1
- package/dist/cjs/index.cjs +7 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Icons/BookmarkIcon.mjs +48 -0
- package/dist/components/Icons/BookmarkIcon.mjs.map +1 -0
- package/dist/components/Table/Table.mjs +181 -51
- package/dist/components/Table/Table.mjs.map +1 -1
- package/dist/components/Table/TablePagination.mjs +78 -35
- package/dist/components/Table/TablePagination.mjs.map +1 -1
- package/dist/index.d.ts +159 -69
- package/dist/index.mjs +9 -4
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +3 -0
- package/package.json +1 -1
|
@@ -2,52 +2,95 @@
|
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../../utils/cn.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
paginationSlot != null ? /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: paginationSlot }) : null
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
}
|
|
5
|
+
import { ChevronDownIcon } from "../Icons/ChevronDownIcon.mjs";
|
|
6
|
+
import { ChevronLeftIcon } from "../Icons/ChevronLeftIcon.mjs";
|
|
7
|
+
import { ChevronRightIcon } from "../Icons/ChevronRightIcon.mjs";
|
|
8
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } from "../DropdownMenu/DropdownMenuRoot.mjs";
|
|
9
|
+
import { DropdownMenuItem } from "../DropdownMenu/DropdownMenuItem.mjs";
|
|
10
|
+
const TableCardPagination = React.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
className,
|
|
13
|
+
page,
|
|
14
|
+
pageCount,
|
|
15
|
+
onPageChange,
|
|
16
|
+
pageSize,
|
|
17
|
+
pageSizeOptions,
|
|
18
|
+
onPageSizeChange,
|
|
19
|
+
formatPage = (current, total) => `${current} of ${total}`,
|
|
20
|
+
formatPageSize = (size) => `${size} rows`,
|
|
21
|
+
navigationLabel = "Pagination",
|
|
22
|
+
previousLabel = "Previous page",
|
|
23
|
+
nextLabel = "Next page",
|
|
24
|
+
pageSizeLabel = "Rows per page",
|
|
25
|
+
...props
|
|
26
|
+
}, ref) => {
|
|
27
|
+
const total = Math.max(pageCount, 1);
|
|
28
|
+
const stepButton = "inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-primary disabled:cursor-default disabled:opacity-40";
|
|
34
29
|
return /* @__PURE__ */ jsxs(
|
|
35
30
|
"div",
|
|
36
31
|
{
|
|
37
32
|
ref,
|
|
38
|
-
className: cn(
|
|
33
|
+
className: cn(
|
|
34
|
+
"typography-description-12px-regular flex h-8 shrink-0 items-center gap-6 border-border-primary border-t-[0.5px] bg-surface-table-row px-4 text-content-primary",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
39
37
|
...props,
|
|
40
38
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
/* @__PURE__ */ jsxs("nav", { "aria-label": navigationLabel, className: "flex items-center gap-2", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
type: "button",
|
|
44
|
+
"aria-label": previousLabel,
|
|
45
|
+
className: stepButton,
|
|
46
|
+
disabled: page <= 1,
|
|
47
|
+
onClick: () => onPageChange(page - 1),
|
|
48
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: 16 })
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: formatPage(page, total) }),
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
"aria-label": nextLabel,
|
|
57
|
+
className: stepButton,
|
|
58
|
+
disabled: page >= pageCount,
|
|
59
|
+
onClick: () => onPageChange(page + 1),
|
|
60
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { size: 16 })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
65
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
"aria-label": `${pageSizeLabel}, ${formatPageSize(pageSize)}`,
|
|
70
|
+
className: "typography-description-12px-regular inline-flex cursor-pointer items-center gap-2 whitespace-nowrap border-none bg-transparent p-0 text-content-primary",
|
|
71
|
+
children: [
|
|
72
|
+
formatPageSize(pageSize),
|
|
73
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { size: 16, className: "text-icons-primary", "aria-hidden": true })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
) }),
|
|
77
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx(
|
|
78
|
+
DropdownMenuItem,
|
|
79
|
+
{
|
|
80
|
+
selected: option === pageSize,
|
|
81
|
+
onSelect: () => onPageSizeChange(option),
|
|
82
|
+
children: formatPageSize(option)
|
|
83
|
+
},
|
|
84
|
+
option
|
|
85
|
+
)) })
|
|
86
|
+
] })
|
|
44
87
|
]
|
|
45
88
|
}
|
|
46
89
|
);
|
|
47
90
|
}
|
|
48
91
|
);
|
|
49
|
-
|
|
92
|
+
TableCardPagination.displayName = "TableCardPagination";
|
|
50
93
|
export {
|
|
51
|
-
|
|
94
|
+
TableCardPagination
|
|
52
95
|
};
|
|
53
96
|
//# sourceMappingURL=TablePagination.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePagination.mjs","sources":["../../../src/components/Table/TablePagination.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\
|
|
1
|
+
{"version":3,"file":"TablePagination.mjs","sources":["../../../src/components/Table/TablePagination.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"../DropdownMenu/DropdownMenu\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { ChevronLeftIcon } from \"../Icons/ChevronLeftIcon\";\nimport { ChevronRightIcon } from \"../Icons/ChevronRightIcon\";\n\nexport interface TableCardPaginationProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Current page, 1-based. */\n page: number;\n /** Total number of pages. */\n pageCount: number;\n /** Called with the 1-based page to show. */\n onPageChange: (page: number) => void;\n /** Rows per page currently shown. */\n pageSize: number;\n /** Choices offered in the rows-per-page menu. */\n pageSizeOptions: readonly number[];\n /** Called with the new rows-per-page choice. */\n onPageSizeChange: (pageSize: number) => void;\n /** Formats the page indicator. @default (page, pageCount) => `${page} of ${pageCount}` */\n formatPage?: (page: number, pageCount: number) => string;\n /** Formats a rows-per-page choice. @default (pageSize) => `${pageSize} rows` */\n formatPageSize?: (pageSize: number) => string;\n /** Accessible name of the page navigation. @default \"Pagination\" */\n navigationLabel?: string;\n /** Accessible name of the previous-page button. @default \"Previous page\" */\n previousLabel?: string;\n /** Accessible name of the next-page button. @default \"Next page\" */\n nextLabel?: string;\n /** Accessible name of the rows-per-page menu trigger, followed by the current choice (e.g. \"Rows per page, 10 rows\"). @default \"Rows per page\" */\n pageSizeLabel?: string;\n}\n\n/**\n * 32px footer that closes a {@link TableCard}: previous, \"1 of N\", next, then\n * a rows-per-page menu, on `surface-table-row`. Place it after\n * {@link TableScrollArea} inside the card.\n *\n * @example\n * ```tsx\n * <TableCard>\n * <TableScrollArea>…</TableScrollArea>\n * <TableCardPagination\n * page={page}\n * pageCount={12}\n * onPageChange={setPage}\n * pageSize={10}\n * pageSizeOptions={[10, 25, 50]}\n * onPageSizeChange={setPageSize}\n * />\n * </TableCard>\n * ```\n */\nexport const TableCardPagination = React.forwardRef<HTMLDivElement, TableCardPaginationProps>(\n (\n {\n className,\n page,\n pageCount,\n onPageChange,\n pageSize,\n pageSizeOptions,\n onPageSizeChange,\n formatPage = (current, total) => `${current} of ${total}`,\n formatPageSize = (size) => `${size} rows`,\n navigationLabel = \"Pagination\",\n previousLabel = \"Previous page\",\n nextLabel = \"Next page\",\n pageSizeLabel = \"Rows per page\",\n ...props\n },\n ref,\n ) => {\n const total = Math.max(pageCount, 1);\n const stepButton =\n \"inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-primary disabled:cursor-default disabled:opacity-40\";\n return (\n <div\n ref={ref}\n className={cn(\n \"typography-description-12px-regular flex h-8 shrink-0 items-center gap-6 border-border-primary border-t-[0.5px] bg-surface-table-row px-4 text-content-primary\",\n className,\n )}\n {...props}\n >\n <nav aria-label={navigationLabel} className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n aria-label={previousLabel}\n className={stepButton}\n disabled={page <= 1}\n onClick={() => onPageChange(page - 1)}\n >\n <ChevronLeftIcon size={16} />\n </button>\n <span className=\"whitespace-nowrap\">{formatPage(page, total)}</span>\n <button\n type=\"button\"\n aria-label={nextLabel}\n className={stepButton}\n disabled={page >= pageCount}\n onClick={() => onPageChange(page + 1)}\n >\n <ChevronRightIcon size={16} />\n </button>\n </nav>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n aria-label={`${pageSizeLabel}, ${formatPageSize(pageSize)}`}\n className=\"typography-description-12px-regular inline-flex cursor-pointer items-center gap-2 whitespace-nowrap border-none bg-transparent p-0 text-content-primary\"\n >\n {formatPageSize(pageSize)}\n <ChevronDownIcon size={16} className=\"text-icons-primary\" aria-hidden />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n {pageSizeOptions.map((option) => (\n <DropdownMenuItem\n key={option}\n selected={option === pageSize}\n onSelect={() => onPageSizeChange(option)}\n >\n {formatPageSize(option)}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n },\n);\nTableCardPagination.displayName = \"TableCardPagination\";\n"],"names":[],"mappings":";;;;;;;;;AA4DO,MAAM,sBAAsB,MAAM;AAAA,EACvC,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,CAAC,SAAS,UAAU,GAAG,OAAO,OAAO,KAAK;AAAA,IACvD,iBAAiB,CAAC,SAAS,GAAG,IAAI;AAAA,IAClC,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,QAAQ,KAAK,IAAI,WAAW,CAAC;AACnC,UAAM,aACJ;AACF,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,cAAY,iBAAiB,WAAU,2BAC1C,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,cAAY;AAAA,gBACZ,WAAW;AAAA,gBACX,UAAU,QAAQ;AAAA,gBAClB,SAAS,MAAM,aAAa,OAAO,CAAC;AAAA,gBAEpC,UAAA,oBAAC,iBAAA,EAAgB,MAAM,GAAA,CAAI;AAAA,cAAA;AAAA,YAAA;AAAA,gCAE5B,QAAA,EAAK,WAAU,qBAAqB,UAAA,WAAW,MAAM,KAAK,GAAE;AAAA,YAC7D;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,cAAY;AAAA,gBACZ,WAAW;AAAA,gBACX,UAAU,QAAQ;AAAA,gBAClB,SAAS,MAAM,aAAa,OAAO,CAAC;AAAA,gBAEpC,UAAA,oBAAC,kBAAA,EAAiB,MAAM,GAAA,CAAI;AAAA,cAAA;AAAA,YAAA;AAAA,UAC9B,GACF;AAAA,+BACC,cAAA,EACC,UAAA;AAAA,YAAA,oBAAC,qBAAA,EAAoB,SAAO,MAC1B,UAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,cAAY,GAAG,aAAa,KAAK,eAAe,QAAQ,CAAC;AAAA,gBACzD,WAAU;AAAA,gBAET,UAAA;AAAA,kBAAA,eAAe,QAAQ;AAAA,sCACvB,iBAAA,EAAgB,MAAM,IAAI,WAAU,sBAAqB,eAAW,KAAA,CAAC;AAAA,gBAAA;AAAA,cAAA;AAAA,YAAA,GAE1E;AAAA,gCACC,qBAAA,EAAoB,OAAM,SACxB,UAAA,gBAAgB,IAAI,CAAC,WACpB;AAAA,cAAC;AAAA,cAAA;AAAA,gBAEC,UAAU,WAAW;AAAA,gBACrB,UAAU,MAAM,iBAAiB,MAAM;AAAA,gBAEtC,yBAAe,MAAM;AAAA,cAAA;AAAA,cAJjB;AAAA,YAAA,CAMR,EAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACA,oBAAoB,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1062,6 +1062,19 @@ export declare const BoltIcon: React_2.ForwardRefExoticComponent<BaseIconProps &
|
|
|
1062
1062
|
/** Props for {@link BoltIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
1063
1063
|
export declare type BoltIconProps = BaseIconProps;
|
|
1064
1064
|
|
|
1065
|
+
/**
|
|
1066
|
+
* Bookmark icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.
|
|
1067
|
+
*
|
|
1068
|
+
* @example
|
|
1069
|
+
* ```tsx
|
|
1070
|
+
* <BookmarkIcon size={24} filled />
|
|
1071
|
+
* ```
|
|
1072
|
+
*/
|
|
1073
|
+
export declare const BookmarkIcon: React_2.ForwardRefExoticComponent<BaseIconProps & React_2.RefAttributes<SVGSVGElement>>;
|
|
1074
|
+
|
|
1075
|
+
/** Props for {@link BookmarkIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
1076
|
+
export declare type BookmarkIconProps = BaseIconProps;
|
|
1077
|
+
|
|
1065
1078
|
export declare const BottomNavigation: React_2.ForwardRefExoticComponent<BottomNavigationProps & React_2.RefAttributes<HTMLElement>>;
|
|
1066
1079
|
|
|
1067
1080
|
export declare const BottomNavigationAction: React_2.ForwardRefExoticComponent<BottomNavigationActionProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
@@ -6204,9 +6217,10 @@ export declare interface TableBodyProps extends React_2.HTMLAttributes<HTMLTable
|
|
|
6204
6217
|
}
|
|
6205
6218
|
|
|
6206
6219
|
/**
|
|
6207
|
-
* Surface wrapper for data tables:
|
|
6208
|
-
*
|
|
6209
|
-
*
|
|
6220
|
+
* Surface wrapper for data tables: 12px-radius container with a 0.5px
|
|
6221
|
+
* hairline border and no inner padding, so the header, rows and
|
|
6222
|
+
* {@link TableCardPagination} footer run edge to edge. Provides the size
|
|
6223
|
+
* context for {@link TableCell} descendants. Compose with {@link TableScrollArea}, {@link Table},
|
|
6210
6224
|
* {@link TableHeader}, {@link TableBody}, {@link TableRow},
|
|
6211
6225
|
* {@link TableHead}, and {@link TableCell}.
|
|
6212
6226
|
*
|
|
@@ -6232,23 +6246,72 @@ export declare interface TableBodyProps extends React_2.HTMLAttributes<HTMLTable
|
|
|
6232
6246
|
*/
|
|
6233
6247
|
export declare const TableCard: React_2.ForwardRefExoticComponent<TableCardProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
6234
6248
|
|
|
6249
|
+
/**
|
|
6250
|
+
* 32px footer that closes a {@link TableCard}: previous, "1 of N", next, then
|
|
6251
|
+
* a rows-per-page menu, on `surface-table-row`. Place it after
|
|
6252
|
+
* {@link TableScrollArea} inside the card.
|
|
6253
|
+
*
|
|
6254
|
+
* @example
|
|
6255
|
+
* ```tsx
|
|
6256
|
+
* <TableCard>
|
|
6257
|
+
* <TableScrollArea>…</TableScrollArea>
|
|
6258
|
+
* <TableCardPagination
|
|
6259
|
+
* page={page}
|
|
6260
|
+
* pageCount={12}
|
|
6261
|
+
* onPageChange={setPage}
|
|
6262
|
+
* pageSize={10}
|
|
6263
|
+
* pageSizeOptions={[10, 25, 50]}
|
|
6264
|
+
* onPageSizeChange={setPageSize}
|
|
6265
|
+
* />
|
|
6266
|
+
* </TableCard>
|
|
6267
|
+
* ```
|
|
6268
|
+
*/
|
|
6269
|
+
export declare const TableCardPagination: React_2.ForwardRefExoticComponent<TableCardPaginationProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
6270
|
+
|
|
6271
|
+
export declare interface TableCardPaginationProps extends Omit<React_2.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
6272
|
+
/** Current page, 1-based. */
|
|
6273
|
+
page: number;
|
|
6274
|
+
/** Total number of pages. */
|
|
6275
|
+
pageCount: number;
|
|
6276
|
+
/** Called with the 1-based page to show. */
|
|
6277
|
+
onPageChange: (page: number) => void;
|
|
6278
|
+
/** Rows per page currently shown. */
|
|
6279
|
+
pageSize: number;
|
|
6280
|
+
/** Choices offered in the rows-per-page menu. */
|
|
6281
|
+
pageSizeOptions: readonly number[];
|
|
6282
|
+
/** Called with the new rows-per-page choice. */
|
|
6283
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
6284
|
+
/** Formats the page indicator. @default (page, pageCount) => `${page} of ${pageCount}` */
|
|
6285
|
+
formatPage?: (page: number, pageCount: number) => string;
|
|
6286
|
+
/** Formats a rows-per-page choice. @default (pageSize) => `${pageSize} rows` */
|
|
6287
|
+
formatPageSize?: (pageSize: number) => string;
|
|
6288
|
+
/** Accessible name of the page navigation. @default "Pagination" */
|
|
6289
|
+
navigationLabel?: string;
|
|
6290
|
+
/** Accessible name of the previous-page button. @default "Previous page" */
|
|
6291
|
+
previousLabel?: string;
|
|
6292
|
+
/** Accessible name of the next-page button. @default "Next page" */
|
|
6293
|
+
nextLabel?: string;
|
|
6294
|
+
/** Accessible name of the rows-per-page menu trigger, followed by the current choice (e.g. "Rows per page, 10 rows"). @default "Rows per page" */
|
|
6295
|
+
pageSizeLabel?: string;
|
|
6296
|
+
}
|
|
6297
|
+
|
|
6235
6298
|
export declare interface TableCardProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
6236
6299
|
/** Row density applied to {@link TableCell} descendants. @default "md" */
|
|
6237
6300
|
size?: TableSize;
|
|
6238
6301
|
}
|
|
6239
6302
|
|
|
6240
6303
|
/**
|
|
6241
|
-
* Body cell
|
|
6242
|
-
* `size="lg"`
|
|
6243
|
-
*
|
|
6244
|
-
*
|
|
6304
|
+
* Body cell: 40px rows (56px when the parent {@link TableCard} uses
|
|
6305
|
+
* `size="lg"` or the row holds media), 12px type, transparent background and
|
|
6306
|
+
* a 0.5px rule that {@link TableBody} drops on the final row. Long text wraps
|
|
6307
|
+
* and the row grows; set `nowrap` on short columns to keep them on one line.
|
|
6245
6308
|
*/
|
|
6246
6309
|
export declare const TableCell: React_2.ForwardRefExoticComponent<TableCellProps & React_2.RefAttributes<HTMLTableCellElement>>;
|
|
6247
6310
|
|
|
6248
6311
|
/**
|
|
6249
|
-
* Two-line content slot matching Figma `V2 Table Content` — primary line
|
|
6250
|
-
* (semibold) over an optional secondary line (regular, muted)
|
|
6251
|
-
*
|
|
6312
|
+
* Two-line content slot matching Figma `V2 Table Content` — 12px primary line
|
|
6313
|
+
* (semibold) over an optional 12px secondary line (regular, muted), so both
|
|
6314
|
+
* fit a 40px row. Use inside {@link TableCell} for the common stacked-text pattern.
|
|
6252
6315
|
*/
|
|
6253
6316
|
export declare function TableCellContent({ primary, secondary, primaryAdornment, secondaryAdornment, className, }: TableCellContentProps): JSX.Element;
|
|
6254
6317
|
|
|
@@ -6286,6 +6349,8 @@ export declare interface TableCellProps extends React_2.TdHTMLAttributes<HTMLTab
|
|
|
6286
6349
|
cellVariant?: TableCellVariant;
|
|
6287
6350
|
/** Alignment and typography preset for common cell types. @default "default" */
|
|
6288
6351
|
intent?: TableCellIntent;
|
|
6352
|
+
/** Keeps the content on one line, for short values (dates, amounts, statuses). @default false */
|
|
6353
|
+
nowrap?: boolean;
|
|
6289
6354
|
}
|
|
6290
6355
|
|
|
6291
6356
|
/** Bottom border and padding preset for body cells (Figma table cell component). */
|
|
@@ -6297,9 +6362,9 @@ export declare interface TableFooterProps extends React_2.HTMLAttributes<HTMLTab
|
|
|
6297
6362
|
}
|
|
6298
6363
|
|
|
6299
6364
|
/**
|
|
6300
|
-
* Header cell
|
|
6301
|
-
*
|
|
6302
|
-
*
|
|
6365
|
+
* Header cell: 32px tall on `surface-table-row`, 12px secondary text and a
|
|
6366
|
+
* 0.5px bottom rule. Columns sit at least 40px apart, with 16px against the
|
|
6367
|
+
* card edges.
|
|
6303
6368
|
*/
|
|
6304
6369
|
export declare const TableHead: React_2.ForwardRefExoticComponent<TableHeadProps & React_2.RefAttributes<HTMLTableCellElement>>;
|
|
6305
6370
|
|
|
@@ -6327,8 +6392,9 @@ export declare interface TableLineClampProps extends React_2.HTMLAttributes<HTML
|
|
|
6327
6392
|
}
|
|
6328
6393
|
|
|
6329
6394
|
/**
|
|
6330
|
-
* Square
|
|
6331
|
-
*
|
|
6395
|
+
* Square photo that fills its frame, used inside {@link TableCell} for media
|
|
6396
|
+
* columns. At the 40px and 48px sizes its row grows to 56px; the 32px size
|
|
6397
|
+
* fits a regular 40px row.
|
|
6332
6398
|
*/
|
|
6333
6399
|
export declare const TableMediaThumbnail: React_2.ForwardRefExoticComponent<TableMediaThumbnailProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
6334
6400
|
|
|
@@ -6341,12 +6407,27 @@ export declare interface TableMediaThumbnailProps extends Omit<React_2.HTMLAttri
|
|
|
6341
6407
|
blurred?: boolean;
|
|
6342
6408
|
/** `center` uses the fixed media column width from the lg spec. @default "start" */
|
|
6343
6409
|
align?: "start" | "center";
|
|
6344
|
-
/** Pixel size of the square thumbnail
|
|
6410
|
+
/** Pixel size of the square thumbnail. At 40 or 48 its row grows to 56px; 32 fits a 40px row. @default "40" */
|
|
6345
6411
|
size?: TableMediaThumbnailSize;
|
|
6346
6412
|
}
|
|
6347
6413
|
|
|
6348
6414
|
/** Pixel size of the square {@link TableMediaThumbnail}. */
|
|
6349
|
-
export declare type TableMediaThumbnailSize = "48" | "32";
|
|
6415
|
+
export declare type TableMediaThumbnailSize = "48" | "40" | "32";
|
|
6416
|
+
|
|
6417
|
+
/**
|
|
6418
|
+
* 40px tile for a {@link TableCell}: a logo or icon (e.g. a social platform)
|
|
6419
|
+
* centred on `surface-table-row` with a 0.5px border, or, with `fill`, custom
|
|
6420
|
+
* media that fills it. Its row grows to 56px. For a plain image URL use
|
|
6421
|
+
* {@link TableMediaThumbnail}.
|
|
6422
|
+
*/
|
|
6423
|
+
export declare const TableMediaTile: React_2.ForwardRefExoticComponent<TableMediaTileProps & React_2.RefAttributes<HTMLSpanElement>>;
|
|
6424
|
+
|
|
6425
|
+
export declare interface TableMediaTileProps extends React_2.HTMLAttributes<HTMLSpanElement> {
|
|
6426
|
+
/** Logo or icon centred on the tile, or edge-to-edge media when `fill` is set. */
|
|
6427
|
+
children: React_2.ReactNode;
|
|
6428
|
+
/** Lets the child fill the tile edge to edge (e.g. a video preview) with no border or fill. @default false */
|
|
6429
|
+
fill?: boolean;
|
|
6430
|
+
}
|
|
6350
6431
|
|
|
6351
6432
|
/**
|
|
6352
6433
|
* Stacked row that stands in for a table row on narrow screens (Figma `V2 Table Mobile`):
|
|
@@ -6377,40 +6458,6 @@ export declare interface TableMobileRowProps extends Omit<React_2.HTMLAttributes
|
|
|
6377
6458
|
wrap?: boolean;
|
|
6378
6459
|
}
|
|
6379
6460
|
|
|
6380
|
-
/**
|
|
6381
|
-
* Footer bar for data tables: rows-per-page control, page navigation, and
|
|
6382
|
-
* range summary. Pair `paginationSlot` with {@link Pagination} for numbered
|
|
6383
|
-
* controls.
|
|
6384
|
-
*
|
|
6385
|
-
* v2 sits flush inside {@link TableCard} (`px-3` matches the card's inner
|
|
6386
|
-
* gutter); the chip styling now lives on the {@link TableRowsPerPageSelect}
|
|
6387
|
-
* trigger itself.
|
|
6388
|
-
*
|
|
6389
|
-
* @example
|
|
6390
|
-
* ```tsx
|
|
6391
|
-
* <TablePagination
|
|
6392
|
-
* leadingSlot={<TableRowsPerPageSelect />}
|
|
6393
|
-
* paginationSlot={<Pagination totalPages={5} currentPage={2} onPageChange={setPage} />}
|
|
6394
|
-
* summary="20–30 of 100 rows"
|
|
6395
|
-
* />
|
|
6396
|
-
* ```
|
|
6397
|
-
*/
|
|
6398
|
-
export declare const TablePagination: React_2.ForwardRefExoticComponent<TablePaginationProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
6399
|
-
|
|
6400
|
-
/** Layout preset for the pagination bar — desktop (range on the right) or stacked mobile. */
|
|
6401
|
-
export declare type TablePaginationLayout = "desktop" | "mobile";
|
|
6402
|
-
|
|
6403
|
-
export declare interface TablePaginationProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
6404
|
-
/** Layout preset. @default "desktop" */
|
|
6405
|
-
layout?: TablePaginationLayout;
|
|
6406
|
-
/** Left (desktop) or top row (mobile) content, e.g. rows-per-page {@link Select}. */
|
|
6407
|
-
leadingSlot?: React_2.ReactNode;
|
|
6408
|
-
/** Center (desktop) or bottom row (mobile) content, e.g. {@link Pagination}. */
|
|
6409
|
-
paginationSlot?: React_2.ReactNode;
|
|
6410
|
-
/** Summary text or node (e.g. current range and total). */
|
|
6411
|
-
summary: React_2.ReactNode;
|
|
6412
|
-
}
|
|
6413
|
-
|
|
6414
6461
|
/**
|
|
6415
6462
|
* Vertical layout for pill label + {@link TableProgressTrack} in a cell.
|
|
6416
6463
|
*/
|
|
@@ -6433,22 +6480,13 @@ export declare interface TableProgressTrackProps extends React_2.HTMLAttributes<
|
|
|
6433
6480
|
export declare interface TableProps extends React_2.TableHTMLAttributes<HTMLTableElement> {
|
|
6434
6481
|
}
|
|
6435
6482
|
|
|
6436
|
-
export declare const TableRow: React_2.ForwardRefExoticComponent<TableRowProps & React_2.RefAttributes<HTMLTableRowElement>>;
|
|
6437
|
-
|
|
6438
|
-
export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableRowElement> {
|
|
6439
|
-
}
|
|
6440
|
-
|
|
6441
6483
|
/**
|
|
6442
|
-
*
|
|
6443
|
-
*
|
|
6484
|
+
* Table row. A body row holding a {@link TableMediaThumbnail} or
|
|
6485
|
+
* {@link TableMediaTile} grows from 40px to 56px to keep 8px around it.
|
|
6444
6486
|
*/
|
|
6445
|
-
export declare
|
|
6487
|
+
export declare const TableRow: React_2.ForwardRefExoticComponent<TableRowProps & React_2.RefAttributes<HTMLTableRowElement>>;
|
|
6446
6488
|
|
|
6447
|
-
export declare interface
|
|
6448
|
-
/** Passed to the trigger for forms and labels. */
|
|
6449
|
-
id?: string;
|
|
6450
|
-
/** Accessible name for the trigger when no visible label. @default "Rows per page" */
|
|
6451
|
-
"aria-label"?: string;
|
|
6489
|
+
export declare interface TableRowProps extends React_2.HTMLAttributes<HTMLTableRowElement> {
|
|
6452
6490
|
}
|
|
6453
6491
|
|
|
6454
6492
|
/**
|
|
@@ -6488,8 +6526,8 @@ export declare type TableSize = "md" | "lg" | "condensed" | "default";
|
|
|
6488
6526
|
export declare type TableSortDirection = "asc" | "desc" | null;
|
|
6489
6527
|
|
|
6490
6528
|
/**
|
|
6491
|
-
* Sortable column label.
|
|
6492
|
-
*
|
|
6529
|
+
* Sortable column label. A sorted column reads primary with the Arrow Sort
|
|
6530
|
+
* Up / Down chevrons; an unsorted one keeps the header colour.
|
|
6493
6531
|
*/
|
|
6494
6532
|
export declare const TableSortLabel: React_2.ForwardRefExoticComponent<TableSortLabelProps & React_2.RefAttributes<HTMLSpanElement>>;
|
|
6495
6533
|
|
|
@@ -6497,8 +6535,8 @@ export declare interface TableSortLabelProps extends React_2.HTMLAttributes<HTML
|
|
|
6497
6535
|
children: React_2.ReactNode;
|
|
6498
6536
|
/**
|
|
6499
6537
|
* Visual indicator of the column's sort state. When set to `"asc"` or
|
|
6500
|
-
* `"desc"`,
|
|
6501
|
-
*
|
|
6538
|
+
* `"desc"`, the label turns primary and the Arrow Sort Up / Down chevrons
|
|
6539
|
+
* appear next to it, the active direction highlighted. @default null
|
|
6502
6540
|
*/
|
|
6503
6541
|
direction?: TableSortDirection;
|
|
6504
6542
|
}
|
|
@@ -6531,11 +6569,63 @@ export declare interface TableStatusDotProps extends React_2.HTMLAttributes<HTML
|
|
|
6531
6569
|
}
|
|
6532
6570
|
|
|
6533
6571
|
/**
|
|
6534
|
-
*
|
|
6572
|
+
* 40px action bar above a {@link TableCard}: search on the left, every other
|
|
6573
|
+
* control (menus, toggles, buttons) on the right, 24px apart. On phones
|
|
6574
|
+
* {@link TableToolbarAction} controls go icon-only so the bar fits.
|
|
6575
|
+
*
|
|
6576
|
+
* @example
|
|
6577
|
+
* ```tsx
|
|
6578
|
+
* <TableToolbar search={<TableToolbarSearch value={q} onValueChange={setQ} placeholder="Search" clearLabel="Clear search" />}>
|
|
6579
|
+
* <TableToolbarAction icon={<SettingsIcon />}>Filters</TableToolbarAction>
|
|
6580
|
+
* <TableToolbarButton>Create</TableToolbarButton>
|
|
6581
|
+
* </TableToolbar>
|
|
6582
|
+
* ```
|
|
6535
6583
|
*/
|
|
6536
6584
|
export declare const TableToolbar: React_2.ForwardRefExoticComponent<TableToolbarProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
6537
6585
|
|
|
6586
|
+
/**
|
|
6587
|
+
* Labelled control for {@link TableToolbar}: 12px label followed by a 16px
|
|
6588
|
+
* icon. Below the `md` breakpoint only the icon shows, and the label stays as
|
|
6589
|
+
* the accessible name, so a full bar still fits a phone. Works as a plain
|
|
6590
|
+
* button or as a `DropdownMenuTrigger` child.
|
|
6591
|
+
*/
|
|
6592
|
+
export declare const TableToolbarAction: React_2.ForwardRefExoticComponent<TableToolbarActionProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
6593
|
+
|
|
6594
|
+
export declare interface TableToolbarActionProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6595
|
+
/** 16px icon after the label. @default up/down arrows, for a menu trigger showing its current value */
|
|
6596
|
+
icon?: React_2.ReactNode;
|
|
6597
|
+
/** Tints the icon with the brand colour while a toggle or filter is on. @default false */
|
|
6598
|
+
active?: boolean;
|
|
6599
|
+
}
|
|
6600
|
+
|
|
6601
|
+
/**
|
|
6602
|
+
* Call to action for {@link TableToolbar} (e.g. "Create New"): a 24px
|
|
6603
|
+
* {@link Button} squared to the toolbar's 8px radius with 12px semibold type,
|
|
6604
|
+
* so it sits 8px from the bar's edges. Elsewhere use {@link Button}.
|
|
6605
|
+
*/
|
|
6606
|
+
export declare const TableToolbarButton: React_2.ForwardRefExoticComponent<TableToolbarButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
6607
|
+
|
|
6608
|
+
export declare interface TableToolbarButtonProps extends Omit<ButtonProps, "size"> {
|
|
6609
|
+
}
|
|
6610
|
+
|
|
6538
6611
|
export declare interface TableToolbarProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
6612
|
+
/** Left slot, usually a {@link TableToolbarSearch}. */
|
|
6613
|
+
search?: React_2.ReactNode;
|
|
6614
|
+
}
|
|
6615
|
+
|
|
6616
|
+
/**
|
|
6617
|
+
* Borderless search field for the left slot of {@link TableToolbar}:
|
|
6618
|
+
* 16px search icon, 12px text and a clear button once there is a query.
|
|
6619
|
+
*/
|
|
6620
|
+
export declare const TableToolbarSearch: React_2.ForwardRefExoticComponent<TableToolbarSearchProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
6621
|
+
|
|
6622
|
+
export declare interface TableToolbarSearchProps extends Omit<React_2.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "type"> {
|
|
6623
|
+
/** Current query. */
|
|
6624
|
+
value: string;
|
|
6625
|
+
/** Called with the new query, and with `""` when cleared. */
|
|
6626
|
+
onValueChange: (value: string) => void;
|
|
6627
|
+
/** Accessible name of the clear button. */
|
|
6628
|
+
clearLabel: string;
|
|
6539
6629
|
}
|
|
6540
6630
|
|
|
6541
6631
|
export declare const Tabs: React_2.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
package/dist/index.mjs
CHANGED
|
@@ -64,6 +64,7 @@ import { BankIcon } from "./components/Icons/BankIcon.mjs";
|
|
|
64
64
|
import { BellIcon } from "./components/Icons/BellIcon.mjs";
|
|
65
65
|
import { BellOffIcon } from "./components/Icons/BellOffIcon.mjs";
|
|
66
66
|
import { BoltIcon } from "./components/Icons/BoltIcon.mjs";
|
|
67
|
+
import { BookmarkIcon } from "./components/Icons/BookmarkIcon.mjs";
|
|
67
68
|
import { BulbIcon } from "./components/Icons/BulbIcon.mjs";
|
|
68
69
|
import { Calendar2Icon } from "./components/Icons/Calendar2Icon.mjs";
|
|
69
70
|
import { CalendarIcon } from "./components/Icons/CalendarIcon.mjs";
|
|
@@ -254,9 +255,9 @@ import { Switch } from "./components/Switch/Switch.mjs";
|
|
|
254
255
|
import { SwitchButton } from "./components/SwitchButton/SwitchButton.mjs";
|
|
255
256
|
import { SwitchField } from "./components/SwitchField/SwitchField.mjs";
|
|
256
257
|
import { SwitchToggle } from "./components/SwitchToggle/SwitchToggle.mjs";
|
|
257
|
-
import { Table, TableBody, TableCard, TableCell, TableCellContent, TableCellGroup, TableFooter, TableHead, TableHeader, TableLineClamp, TableMediaThumbnail, TablePillProgressLayout, TableProgressTrack, TableRow,
|
|
258
|
+
import { Table, TableBody, TableCard, TableCell, TableCellContent, TableCellGroup, TableFooter, TableHead, TableHeader, TableLineClamp, TableMediaThumbnail, TableMediaTile, TablePillProgressLayout, TableProgressTrack, TableRow, TableScrollArea, TableSortLabel, TableStackedText, TableStatusDot, TableToolbar, TableToolbarAction, TableToolbarButton, TableToolbarSearch } from "./components/Table/Table.mjs";
|
|
258
259
|
import { TableMobileRow } from "./components/Table/TableMobileRow.mjs";
|
|
259
|
-
import {
|
|
260
|
+
import { TableCardPagination } from "./components/Table/TablePagination.mjs";
|
|
260
261
|
import { Tabs } from "./components/Tabs/Tabs.mjs";
|
|
261
262
|
import { TabsContent } from "./components/Tabs/TabsContent.mjs";
|
|
262
263
|
import { TabsList } from "./components/Tabs/TabsList.mjs";
|
|
@@ -325,6 +326,7 @@ export {
|
|
|
325
326
|
BellIcon,
|
|
326
327
|
BellOffIcon,
|
|
327
328
|
BoltIcon,
|
|
329
|
+
BookmarkIcon,
|
|
328
330
|
BottomNavigation,
|
|
329
331
|
BottomNavigationAction,
|
|
330
332
|
Breadcrumb,
|
|
@@ -561,6 +563,7 @@ export {
|
|
|
561
563
|
Table,
|
|
562
564
|
TableBody,
|
|
563
565
|
TableCard,
|
|
566
|
+
TableCardPagination,
|
|
564
567
|
TableCell,
|
|
565
568
|
TableCellContent,
|
|
566
569
|
TableCellGroup,
|
|
@@ -569,17 +572,19 @@ export {
|
|
|
569
572
|
TableHeader,
|
|
570
573
|
TableLineClamp,
|
|
571
574
|
TableMediaThumbnail,
|
|
575
|
+
TableMediaTile,
|
|
572
576
|
TableMobileRow,
|
|
573
|
-
TablePagination,
|
|
574
577
|
TablePillProgressLayout,
|
|
575
578
|
TableProgressTrack,
|
|
576
579
|
TableRow,
|
|
577
|
-
TableRowsPerPageSelect,
|
|
578
580
|
TableScrollArea,
|
|
579
581
|
TableSortLabel,
|
|
580
582
|
TableStackedText,
|
|
581
583
|
TableStatusDot,
|
|
582
584
|
TableToolbar,
|
|
585
|
+
TableToolbarAction,
|
|
586
|
+
TableToolbarButton,
|
|
587
|
+
TableToolbarSearch,
|
|
583
588
|
Tabs,
|
|
584
589
|
TabsContent,
|
|
585
590
|
TabsList,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/styles/theme.css
CHANGED
|
@@ -192,6 +192,7 @@
|
|
|
192
192
|
--color-brand-secondary-hover: var(--primitives-color-purple-400);
|
|
193
193
|
--color-surface-primary: var(--primitives-color-gray-75);
|
|
194
194
|
--color-surface-secondary: var(--primitives-color-gray-150);
|
|
195
|
+
--color-surface-table-row: var(--primitives-color-gray-150);
|
|
195
196
|
--color-surface-primary-inverted: var(--primitives-color-gray-900);
|
|
196
197
|
--color-surface-tertiary: var(--primitives-color-gray-300);
|
|
197
198
|
--color-surface-purple-muted: var(--color-brand-secondary-muted);
|
|
@@ -669,6 +670,7 @@
|
|
|
669
670
|
--color-brand-secondary-hover: var(--primitives-color-purple-400);
|
|
670
671
|
--color-surface-primary: var(--primitives-color-gray-75);
|
|
671
672
|
--color-surface-secondary: var(--primitives-color-gray-150);
|
|
673
|
+
--color-surface-table-row: var(--primitives-color-gray-150);
|
|
672
674
|
--color-surface-primary-inverted: var(--primitives-color-gray-900);
|
|
673
675
|
--color-surface-tertiary: var(--primitives-color-gray-300);
|
|
674
676
|
--color-surface-purple-muted: var(--color-brand-secondary-muted);
|
|
@@ -967,6 +969,7 @@
|
|
|
967
969
|
--color-brand-secondary-hover: var(--primitives-color-purple-400);
|
|
968
970
|
--color-surface-primary: var(--primitives-color-gray-900);
|
|
969
971
|
--color-surface-secondary: var(--primitives-color-gray-850);
|
|
972
|
+
--color-surface-table-row: #1d1d1dff;
|
|
970
973
|
--color-surface-primary-inverted: var(--primitives-color-gray-75);
|
|
971
974
|
--color-surface-tertiary: var(--primitives-color-gray-600);
|
|
972
975
|
--color-surface-purple-muted: var(--color-brand-secondary-muted);
|