@apipass/design-system 4.2.2 → 4.3.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.
@@ -1,89 +1,89 @@
1
1
  import { jsx as e, jsxs as m, Fragment as g } from "react/jsx-runtime";
2
- import { clsx as r } from "../../../vendor/clsx/dist/clsx.js";
3
- import { Table as N, Column as T, TableBody as p, useTableOptions as u, TableHeader as C, Collection as h, Row as v, Button as w, Cell as B } from "react-aria-components";
2
+ import { clsx as c } from "../../../vendor/clsx/dist/clsx.js";
3
+ import { Table as C, Column as T, TableBody as p, useTableOptions as h, TableHeader as x, Checkbox as u, Collection as N, Row as v, Button as w, Cell as B } from "react-aria-components";
4
4
  /* empty css */
5
- import { IconChevronUp as x } from "../../icons/IconChevronUp.js";
5
+ import { IconChevronUp as k } from "../../icons/IconChevronUp.js";
6
6
  import { IconChevronDown as $ } from "../../icons/IconChevronDown.js";
7
7
  import { Checkbox as f } from "../Checkbox/Checkbox.js";
8
- function F({
8
+ function M({
9
9
  bleed: l = !1,
10
10
  dense: a = !1,
11
- grid: n = !1,
12
- striped: s = !1,
11
+ grid: s = !1,
12
+ striped: n = !1,
13
13
  className: t,
14
14
  ...o
15
15
  }) {
16
- const c = r(
16
+ const r = c(
17
17
  t,
18
18
  "table-container",
19
19
  l && "table-container-bleed"
20
- ), i = r(
20
+ ), i = c(
21
21
  "table",
22
22
  l && "table-bleed",
23
23
  a && "table-dense",
24
- n && "table-grid",
25
- s && "table-striped"
24
+ s && "table-grid",
25
+ n && "table-striped"
26
26
  );
27
- return /* @__PURE__ */ e("div", { className: c, children: /* @__PURE__ */ e(N, { className: i, ...o }) });
27
+ return /* @__PURE__ */ e("div", { className: r, children: /* @__PURE__ */ e(C, { className: i, ...o }) });
28
28
  }
29
- function d({
29
+ function b({
30
30
  align: l = "start",
31
31
  className: a,
32
- ...n
32
+ ...s
33
33
  }) {
34
- const s = r(a, "table-column", `table-align-${l}`);
35
- return /* @__PURE__ */ e(T, { className: s, ...n, children: ({ allowsSorting: t, sortDirection: o }) => /* @__PURE__ */ e("div", { className: r("table-column-inner"), children: /* @__PURE__ */ m(g, { children: [
36
- n.children,
37
- t && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "sort-indicator", children: o === "ascending" ? /* @__PURE__ */ e(x, {}) : /* @__PURE__ */ e($, {}) })
34
+ const n = c(a, "table-column", `table-align-${l}`);
35
+ return /* @__PURE__ */ e(T, { className: n, ...s, children: ({ allowsSorting: t, sortDirection: o }) => /* @__PURE__ */ e("div", { className: c("table-column-inner"), children: /* @__PURE__ */ m(g, { children: [
36
+ s.children,
37
+ t && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "sort-indicator", children: o === "ascending" ? /* @__PURE__ */ e(k, {}) : /* @__PURE__ */ e($, {}) })
38
38
  ] }) }) });
39
39
  }
40
- function M({
40
+ function O({
41
41
  className: l,
42
42
  ...a
43
43
  }) {
44
44
  return /* @__PURE__ */ e(p, { ...a });
45
45
  }
46
- function O({
46
+ function U({
47
47
  className: l,
48
48
  columns: a,
49
- children: n,
50
- ...s
49
+ children: s,
50
+ ...n
51
51
  }) {
52
- const { selectionBehavior: t, selectionMode: o, allowsDragging: c } = u(), i = r(l, "table-head");
53
- return /* @__PURE__ */ m(C, { className: i, ...s, children: [
54
- c && /* @__PURE__ */ e(d, {}),
55
- t === "toggle" && /* @__PURE__ */ e(d, { children: o === "multiple" && /* @__PURE__ */ e(f, { slot: "selection" }) }),
56
- /* @__PURE__ */ e(h, { items: a, children: n })
52
+ const { selectionBehavior: t, selectionMode: o, allowsDragging: r } = h(), i = c(l, "table-head");
53
+ return /* @__PURE__ */ m(x, { className: i, ...n, children: [
54
+ r && /* @__PURE__ */ e(b, {}),
55
+ t === "toggle" && /* @__PURE__ */ e(b, { className: "table-selection-col", children: o === "multiple" && /* @__PURE__ */ e(u, { slot: "selection", className: "table-selection-checkbox", children: /* @__PURE__ */ e(f, {}) }) }),
56
+ /* @__PURE__ */ e(N, { items: a, children: s })
57
57
  ] });
58
58
  }
59
- function U({
59
+ function q({
60
60
  id: l,
61
61
  columns: a,
62
- children: n,
63
- className: s,
62
+ children: s,
63
+ className: n,
64
64
  ...t
65
65
  }) {
66
- const { selectionBehavior: o, allowsDragging: c } = u(), i = r(s, "table-row");
66
+ const { selectionBehavior: o, allowsDragging: r } = h(), i = c(n, "table-row");
67
67
  return /* @__PURE__ */ m(v, { id: l, ...t, className: i, children: [
68
- c && /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(w, { slot: "drag", children: "≡" }) }),
69
- o === "toggle" && /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(f, { slot: "selection" }) }),
70
- /* @__PURE__ */ e(h, { items: a, children: n })
68
+ r && /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(w, { slot: "drag", children: "≡" }) }),
69
+ o === "toggle" && /* @__PURE__ */ e(d, { className: "table-selection-cell", children: /* @__PURE__ */ e(u, { slot: "selection", className: "table-selection-checkbox", children: /* @__PURE__ */ e(f, {}) }) }),
70
+ /* @__PURE__ */ e(N, { items: a, children: s })
71
71
  ] });
72
72
  }
73
- function b({
73
+ function d({
74
74
  align: l = "start",
75
75
  className: a,
76
- ...n
76
+ ...s
77
77
  }) {
78
- const s = r(a, "table-cell", `table-align-${l}`);
79
- return /* @__PURE__ */ e(B, { className: s, ...n });
78
+ const n = c(a, "table-cell", `table-align-${l}`);
79
+ return /* @__PURE__ */ e(B, { className: n, ...s });
80
80
  }
81
81
  export {
82
- F as Table,
83
- M as TableBody,
84
- b as TableCell,
85
- d as TableColumn,
86
- O as TableHead,
87
- U as TableRow
82
+ M as Table,
83
+ O as TableBody,
84
+ d as TableCell,
85
+ b as TableColumn,
86
+ U as TableHead,
87
+ q as TableRow
88
88
  };
89
89
  //# sourceMappingURL=Table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox } from \"primitives\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n className,\n ...props\n}: TableProps) {\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n );\n const tableClassNames = clsx(\n \"table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"table-striped\",\n );\n return (\n <div className={containerClassNames}>\n <RACTable className={tableClassNames} {...props} />\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span aria-hidden=\"true\" className=\"sort-indicator\">\n {sortDirection === \"ascending\" ? (\n <IconChevronUp />\n ) : (\n <IconChevronDown />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn>\n {selectionMode === \"multiple\" && <Checkbox slot=\"selection\" />}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell>\n <Checkbox slot=\"selection\" />\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["Table","bleed","dense","grid","striped","className","props","containerClassNames","clsx","tableClassNames","jsx","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsxs","Fragment","IconChevronUp","IconChevronDown","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","RACTableHeader","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton","RACCell"],"mappings":";;;;;;;AA8BO,SAASA,EAAM;AAAA,EACpB,OAAAC,IAAQ;AAAA,EACR,OAAAC,IA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AC8B,GAAA,EAAQ,WAAW1B,GAAa,GAAGR,GAAO;AACpD;"}
1
+ {"version":3,"file":"Table.js","sources":["../../../../../src/ui/primitives/Table/Table.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { IconChevronDown, IconChevronUp } from \"icons\";\nimport { Checkbox } from \"primitives\";\nimport {\n Button as RACButton,\n Cell as RACCell,\n Checkbox as RACSelectionCheckbox,\n Collection as RACCollection,\n Column as RACColumn,\n Row as RACRow,\n Table as RACTable,\n TableBody as RACTableBody,\n TableHeader as RACTableHeader,\n useTableOptions,\n type CellProps as RACCellProps,\n type ColumnProps as RACColumnProps,\n type RowProps as RACRowProps,\n type TableBodyProps as RACTableBodyProps,\n type TableHeaderProps as RACTableHeaderProps,\n type TableProps as RACTableProps,\n} from \"react-aria-components\";\nimport \"./table.css\";\n\ntype TableAlign = \"start\" | \"center\" | \"right\";\n\nexport type TableProps = RACTableProps & {\n bleed?: boolean;\n dense?: boolean;\n grid?: boolean;\n striped?: boolean;\n};\nexport function Table({\n bleed = false,\n dense = false,\n grid = false,\n striped = false,\n className,\n ...props\n}: TableProps) {\n const containerClassNames = clsx(\n className,\n \"table-container\",\n bleed && \"table-container-bleed\",\n );\n const tableClassNames = clsx(\n \"table\",\n bleed && \"table-bleed\",\n dense && \"table-dense\",\n grid && \"table-grid\",\n striped && \"table-striped\",\n );\n return (\n <div className={containerClassNames}>\n <RACTable className={tableClassNames} {...props} />\n </div>\n );\n}\n\nexport type TableColumnProps = RACColumnProps & {\n align?: TableAlign;\n};\nexport function TableColumn({\n align = \"start\",\n className,\n ...props\n}: TableColumnProps) {\n const classNames = clsx(className, \"table-column\", `table-align-${align}`);\n return (\n <RACColumn className={classNames} {...props}>\n {({ allowsSorting, sortDirection }) => (\n <div className={clsx(\"table-column-inner\")}>\n <>\n {props.children}\n {allowsSorting && (\n <span aria-hidden=\"true\" className=\"sort-indicator\">\n {sortDirection === \"ascending\" ? (\n <IconChevronUp />\n ) : (\n <IconChevronDown />\n )}\n </span>\n )}\n </>\n </div>\n )}\n </RACColumn>\n );\n}\n\nexport type TableBodyProps<T> = RACTableBodyProps<T>;\nexport function TableBody<T extends object>({\n className,\n ...props\n}: TableBodyProps<T>) {\n return <RACTableBody {...props} />;\n}\n\nexport type TableHeadProps<T> = RACTableHeaderProps<T>;\nexport function TableHead<T extends object>({\n className,\n columns,\n children,\n ...props\n}: TableHeadProps<T>) {\n const { selectionBehavior, selectionMode, allowsDragging } =\n useTableOptions();\n const classNames = clsx(className, \"table-head\");\n return (\n <RACTableHeader className={classNames} {...props}>\n {/* Add extra columns for drag and drop and selection. */}\n {allowsDragging && <TableColumn />}\n {selectionBehavior === \"toggle\" && (\n <TableColumn className=\"table-selection-col\">\n {selectionMode === \"multiple\" && (\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n )}\n </TableColumn>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACTableHeader>\n );\n}\n\nexport type TableRowProps<T> = RACRowProps<T>;\nexport function TableRow<T extends object>({\n id,\n columns,\n children,\n className,\n ...otherProps\n}: TableRowProps<T>) {\n const { selectionBehavior, allowsDragging } = useTableOptions();\n const classNames = clsx(className, \"table-row\");\n return (\n <RACRow id={id} {...otherProps} className={classNames}>\n {allowsDragging && (\n <TableCell>\n <RACButton slot=\"drag\">≡</RACButton>\n </TableCell>\n )}\n {selectionBehavior === \"toggle\" && (\n <TableCell className=\"table-selection-cell\">\n <RACSelectionCheckbox slot=\"selection\" className=\"table-selection-checkbox\">\n <Checkbox />\n </RACSelectionCheckbox>\n </TableCell>\n )}\n <RACCollection items={columns}>{children}</RACCollection>\n </RACRow>\n );\n}\n\nexport type TableCellProps = RACCellProps & { align?: TableAlign };\nexport function TableCell({\n align = \"start\",\n className,\n ...props\n}: TableCellProps) {\n const classNames = clsx(className, \"table-cell\", `table-align-${align}`);\n return <RACCell className={classNames} {...props} />;\n}\n"],"names":["Table","bleed","dense","grid","striped","className","props","containerClassNames","clsx","tableClassNames","jsx","RACTable","TableColumn","align","classNames","RACColumn","allowsSorting","sortDirection","jsxs","Fragment","IconChevronUp","IconChevronDown","TableBody","RACTableBody","TableHead","columns","children","selectionBehavior","selectionMode","allowsDragging","useTableOptions","RACTableHeader","RACSelectionCheckbox","Checkbox","RACCollection","TableRow","id","otherProps","RACRow","TableCell","RACButton","RACCell"],"mappings":";;;;;;;AA+BO,SAASA,EAAM;AAAA,EACpB,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,WAAAC;AAAA,EACA,GAAGC;AACL,GAAe;AACb,QAAMC,IAAsBC;AAAA,IAC1BH;AAAA,IACA;AAAA,IACAJ,KAAS;AAAA,EAAA,GAELQ,IAAkBD;AAAA,IACtB;AAAA,IACAP,KAAS;AAAA,IACTC,KAAS;AAAA,IACTC,KAAQ;AAAA,IACRC,KAAW;AAAA,EAAA;AAEb,SACE,gBAAAM,EAAC,OAAA,EAAI,WAAWH,GACd,UAAA,gBAAAG,EAACC,KAAS,WAAWF,GAAkB,GAAGH,EAAA,CAAO,EAAA,CACnD;AAEJ;AAKO,SAASM,EAAY;AAAA,EAC1B,OAAAC,IAAQ;AAAA,EACR,WAAAR;AAAA,EACA,GAAGC;AACL,GAAqB;AACnB,QAAMQ,IAAaN,EAAKH,GAAW,gBAAgB,eAAeQ,CAAK,EAAE;AACzE,2BACGE,GAAA,EAAU,WAAWD,GAAa,GAAGR,GACnC,UAAA,CAAC,EAAE,eAAAU,GAAe,eAAAC,EAAA,MACjB,gBAAAP,EAAC,OAAA,EAAI,WAAWF,EAAK,oBAAoB,GACvC,UAAA,gBAAAU,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAb,EAAM;AAAA,IACNU,KACC,gBAAAN,EAAC,QAAA,EAAK,eAAY,QAAO,WAAU,kBAChC,UAAAO,MAAkB,cACjB,gBAAAP,EAACU,GAAA,CAA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,EAAA,CAC1B;AAAA,IAEDb,MAAsB,YACrB,gBAAAjB,EAAC6B,GAAA,EAAU,WAAU,wBACnB,UAAA,gBAAA7B,EAACsB,GAAA,EAAqB,MAAK,aAAY,WAAU,4BAC/C,UAAA,gBAAAtB,EAACuB,GAAA,CAAA,CAAS,GACZ,GACF;AAAA,IAEF,gBAAAvB,EAACwB,GAAA,EAAc,OAAOT,GAAU,UAAAC,EAAA,CAAS;AAAA,EAAA,GAC3C;AAEJ;AAGO,SAASa,EAAU;AAAA,EACxB,OAAA1B,IAAQ;AAAA,EACR,WAAAR;AAAA,EACA,GAAGC;AACL,GAAmB;AACjB,QAAMQ,IAAaN,EAAKH,GAAW,cAAc,eAAeQ,CAAK,EAAE;AACvE,SAAO,gBAAAH,EAAC+B,GAAA,EAAQ,WAAW3B,GAAa,GAAGR,GAAO;AACpD;"}
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { Selection } from "react-aria-components";
2
3
  import "./datatable.css";
3
4
  export interface Column<T> {
4
5
  key: keyof T | string;
@@ -30,6 +31,14 @@ export interface DataTableProps<T extends {
30
31
  rowActions?: RowActionDef<T>[] | ((item: T) => RowActionDef<T>[]);
31
32
  /** Label for the row actions column header. Defaults to empty string. */
32
33
  rowActionsLabel?: string;
34
+ /**
35
+ * When true, renders a checkbox column before the first data column — a per-row checkbox on
36
+ * every row, plus a "select all" checkbox in the header. Off by default.
37
+ */
38
+ selectable?: boolean;
39
+ /** Controlled selection state. Omit to let the table manage its own selection internally. */
40
+ selectedKeys?: Selection;
41
+ onSelectionChange?: (keys: Selection) => void;
33
42
  searchPlaceholder?: string;
34
43
  searchKeys?: (keyof T)[];
35
44
  isLoading?: boolean;
@@ -49,4 +58,4 @@ export interface DataTableProps<T extends {
49
58
  }
50
59
  export declare function DataTable<T extends {
51
60
  id: string;
52
- }>({ columns, data, actions, rowActions, rowActionsLabel, searchPlaceholder, searchKeys, isLoading, loadingMessage, emptyMessage, previousLabel, nextLabel, pageSize, nestedColumns, getNestedData, nestedLoadingMessage, nestedEmptyMessage, nestedSearchKeys, nestedSearchPlaceholder, nestedActions, nestedPageSize, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
61
+ }>({ columns, data, actions, rowActions, rowActionsLabel, selectable, selectedKeys, onSelectionChange, searchPlaceholder, searchKeys, isLoading, loadingMessage, emptyMessage, previousLabel, nextLabel, pageSize, nestedColumns, getNestedData, nestedLoadingMessage, nestedEmptyMessage, nestedSearchKeys, nestedSearchPlaceholder, nestedActions, nestedPageSize, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/design-system",
3
- "version": "4.2.2",
3
+ "version": "4.3.0",
4
4
  "type": "module",
5
5
  "description": "APIPass React Design System",
6
6
  "sideEffects": [