@harpercollins/harpercollins-design-system 1.35.2 → 1.36.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.
Files changed (23) hide show
  1. package/dist/cjs/components/data-display/DataGrid/DataGrid.cjs +1 -1
  2. package/dist/cjs/components/data-display/DataGrid/ManageColumnsDropdown.cjs +1 -0
  3. package/dist/cjs/components/data-display/DataGrid/TableToolbar.cjs +3 -3
  4. package/dist/cjs/components/data-display/DataGrid/hooks/useDataGrid.cjs +1 -1
  5. package/dist/cjs/components/data-display/Table/TableBody.cjs +1 -1
  6. package/dist/cjs/components/data-display/Table/TableLayout.cjs +1 -1
  7. package/dist/cjs/components/global/Layout/Layout.cjs +3 -3
  8. package/dist/cjs/components/global/Sidebar/Sidebar.cjs +1 -1
  9. package/dist/cjs/index.cjs +1 -1
  10. package/dist/cjs/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.cjs +1 -1
  11. package/dist/esm/components/data-display/DataGrid/DataGrid.js +25 -24
  12. package/dist/esm/components/data-display/DataGrid/ManageColumnsDropdown.js +121 -0
  13. package/dist/esm/components/data-display/DataGrid/TableToolbar.js +25 -12
  14. package/dist/esm/components/data-display/DataGrid/hooks/useDataGrid.js +141 -120
  15. package/dist/esm/components/data-display/Table/TableBody.js +53 -47
  16. package/dist/esm/components/data-display/Table/TableLayout.js +46 -45
  17. package/dist/esm/components/global/Layout/Layout.js +28 -26
  18. package/dist/esm/components/global/Sidebar/Sidebar.js +1 -3
  19. package/dist/esm/index.js +192 -190
  20. package/dist/esm/node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js +38 -27
  21. package/dist/esm/node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Divider/dividerClasses.js +3 -3
  22. package/dist/index.d.ts +35 -1
  23. package/package.json +1 -1
@@ -1,94 +1,95 @@
1
- import { jsxs as u, Fragment as I, jsx as r } from "react/jsx-runtime";
2
- import { flexRender as G } from "../../../node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js";
1
+ import { jsxs as u, Fragment as C, jsx as r } from "react/jsx-runtime";
2
+ import { flexRender as I } from "../../../node_modules/.pnpm/@tanstack_react-table@8.21.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js";
3
3
  import c from "react";
4
- import M from "./StickyHorizontalScrollbar.js";
5
- import { TableWrapper as V, getTableStyles as W } from "./Table.styles.js";
4
+ import G from "./StickyHorizontalScrollbar.js";
5
+ import { TableWrapper as M, getTableStyles as W } from "./Table.styles.js";
6
6
  import { TableBody as j } from "./TableBody.js";
7
7
  import E from "./TableHeader.js";
8
- import { useStickyHeader as _ } from "./hooks/useStickyHeader.js";
9
- import { useStickyScrollbar as A } from "./hooks/useStickyScrollbar.js";
8
+ import { useStickyHeader as L } from "./hooks/useStickyHeader.js";
9
+ import { useStickyScrollbar as _ } from "./hooks/useStickyScrollbar.js";
10
10
  import D from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Table/Table.js";
11
11
  function Y({
12
- ctx: p,
13
- maxHeight: d = !1,
14
- wrapText: f = !1,
12
+ ctx: f,
13
+ maxHeight: m = !1,
14
+ wrapText: p = !1,
15
15
  rowRender: g,
16
16
  showStickyScrollbar: S = !1,
17
- enableStickyHeader: h = !1,
18
- stickyHeaderOffset: b = 0,
17
+ enableStickyHeader: b = !1,
18
+ stickyHeaderOffset: h = 0,
19
19
  footer: z
20
20
  }) {
21
21
  const {
22
- id: a,
22
+ id: i,
23
23
  table: e,
24
24
  rows: T,
25
- isVirtual: i,
26
- virtualItems: R,
27
- paddingTop: v,
28
- paddingBottom: y,
25
+ isVirtual: l,
26
+ virtualItems: y,
27
+ paddingTop: R,
28
+ paddingBottom: v,
29
29
  measureElement: w,
30
30
  wrapperRef: n,
31
31
  toolbarRef: x,
32
32
  loading: H,
33
- fetchMoreOnBottomReached: k
34
- } = p, m = c.useRef(null), F = A(n), $ = _({
35
- enabled: h,
36
- stickyHeaderOffset: b,
33
+ fetchMoreOnBottomReached: V
34
+ } = f, d = c.useRef(null), k = _(n), F = L({
35
+ enabled: b,
36
+ stickyHeaderOffset: h,
37
37
  tableWrapperRef: n,
38
- theadRef: m,
38
+ theadRef: d,
39
39
  toolbarRef: x
40
- }), B = c.useMemo(() => {
40
+ }), $ = c.useMemo(() => {
41
41
  const o = e.getFlatHeaders(), t = {};
42
- for (let l = 0; l < o.length; l += 1) {
43
- const s = o[l];
44
- t[`--${a}-header-${s.id}-size`] = s.getSize(), t[`--${a}-col-${s.column.id}-size`] = s.column.getSize();
42
+ for (let a = 0; a < o.length; a += 1) {
43
+ const s = o[a];
44
+ t[`--${i}-header-${s.id}-size`] = s.getSize(), t[`--${i}-col-${s.column.id}-size`] = s.column.getSize();
45
45
  }
46
46
  return t;
47
- }, [a, e.getState().columnSizingInfo, e.getState().columnSizing]), C = c.useMemo(() => e.getFlatHeaders().reduce((t, l) => t + l.getSize(), 0), [e.getState().columnSizingInfo, e.getState().columnSizing]);
48
- return /* @__PURE__ */ u(I, { children: [
47
+ }, [i, e.getState().columnSizingInfo, e.getState().columnSizing]), B = c.useMemo(() => e.getFlatHeaders().reduce((t, a) => t + a.getSize(), 0), [e.getState().columnSizingInfo, e.getState().columnSizing]);
48
+ return /* @__PURE__ */ u(C, { children: [
49
49
  /* @__PURE__ */ r(
50
- V,
50
+ M,
51
51
  {
52
52
  ref: n,
53
53
  "data-testid": "table-wrapper",
54
- $maxHeight: d,
55
- onScroll: (o) => k(o.currentTarget),
54
+ $maxHeight: m,
55
+ onScroll: (o) => V(o.currentTarget),
56
56
  children: /* @__PURE__ */ u(
57
57
  D,
58
58
  {
59
59
  hoverRow: !0,
60
- "data-testid": a,
60
+ "data-testid": i,
61
61
  sx: W(
62
- B,
63
- C,
64
- f,
65
62
  $,
66
- d
63
+ B,
64
+ p,
65
+ F,
66
+ m
67
67
  ),
68
68
  children: [
69
69
  /* @__PURE__ */ r(
70
70
  E,
71
71
  {
72
72
  headerGroups: e.getHeaderGroups(),
73
- id: a,
74
- theadRef: m
73
+ id: i,
74
+ theadRef: d
75
75
  }
76
76
  ),
77
77
  /* @__PURE__ */ r(
78
78
  j,
79
79
  {
80
80
  rows: T,
81
- columns: e.getAllColumns(),
81
+ columns: e.getVisibleLeafColumns(),
82
+ columnVisibility: e.getState().columnVisibility,
82
83
  rowRender: g,
83
84
  loading: H,
84
85
  rowSelectionState: e.getState().rowSelection,
85
- virtualItems: i ? R : void 0,
86
- paddingTop: i ? v : void 0,
87
- paddingBottom: i ? y : void 0,
88
- measureElement: i ? w : void 0
86
+ virtualItems: l ? y : void 0,
87
+ paddingTop: l ? R : void 0,
88
+ paddingBottom: l ? v : void 0,
89
+ measureElement: l ? w : void 0
89
90
  }
90
91
  ),
91
- z && e.getFooterGroups().length > 0 && /* @__PURE__ */ r("tfoot", { children: e.getFooterGroups().map((o) => /* @__PURE__ */ r("tr", { children: o.headers.map((t) => /* @__PURE__ */ r("td", { colSpan: t.colSpan, children: G(
92
+ z && e.getFooterGroups().length > 0 && /* @__PURE__ */ r("tfoot", { children: e.getFooterGroups().map((o) => /* @__PURE__ */ r("tr", { children: o.headers.map((t) => /* @__PURE__ */ r("td", { colSpan: t.colSpan, children: I(
92
93
  t.column.columnDef.footer,
93
94
  t.getContext()
94
95
  ) }, t.id)) }, o.id)) })
@@ -98,10 +99,10 @@ function Y({
98
99
  }
99
100
  ),
100
101
  S && /* @__PURE__ */ r(
101
- M,
102
+ G,
102
103
  {
103
104
  scrollContainerRef: n,
104
- visible: F,
105
+ visible: k,
105
106
  constrainToContainer: "main"
106
107
  }
107
108
  )
@@ -1,18 +1,18 @@
1
- import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import n from "styled-components";
3
- import { useLocalStorage as g } from "../../../hooks/useLocalStorage.js";
1
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
+ import i from "styled-components";
3
+ import { useLocalStorage as h } from "../../../hooks/useLocalStorage.js";
4
4
  /* empty css */
5
- import h from "../Footer/Footer.js";
6
- import u from "../Sidebar/Sidebar.js";
7
- import b from "../ThemeProvider/ThemeProvider.js";
8
- import y from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
9
- import S from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Sheet/Sheet.js";
10
- const k = n.div`
5
+ import u from "../Footer/Footer.js";
6
+ import b from "../Sidebar/Sidebar.js";
7
+ import y from "../ThemeProvider/ThemeProvider.js";
8
+ import S from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
9
+ import k from "../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Sheet/Sheet.js";
10
+ const v = i.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  height: 100vh;
14
14
  width: 100%;
15
- `, v = n.a`
15
+ `, L = i.a`
16
16
  position: absolute;
17
17
  top: -100%;
18
18
  left: 0;
@@ -28,7 +28,7 @@ const k = n.div`
28
28
  top: 0;
29
29
  }
30
30
  `;
31
- function F({
31
+ function I({
32
32
  children: a,
33
33
  header: l,
34
34
  theme: m = "light_internal",
@@ -37,32 +37,34 @@ function F({
37
37
  sidebarWidth: r = 240,
38
38
  collapsedSidebarWidth: t = 60,
39
39
  sidebarHeaderContent: c,
40
- footerReleaseName: f,
41
- footerCopyright: s
40
+ sidebarFooterContent: f,
41
+ footerReleaseName: s,
42
+ footerCopyright: x
42
43
  }) {
43
- const [e, x] = g(
44
+ const [e, g] = h(
44
45
  "sidebarOpen",
45
46
  !0
46
47
  );
47
- return /* @__PURE__ */ o(b, { theme: m, children: /* @__PURE__ */ i(k, { children: [
48
- /* @__PURE__ */ o(v, { href: "#main", children: "Skip to content" }),
48
+ return /* @__PURE__ */ o(y, { theme: m, children: /* @__PURE__ */ n(v, { children: [
49
+ /* @__PURE__ */ o(L, { href: "#main", children: "Skip to content" }),
49
50
  l,
50
- /* @__PURE__ */ i(y, { sx: { display: "flex", flex: 1 }, children: [
51
+ /* @__PURE__ */ n(S, { sx: { display: "flex", flex: 1 }, children: [
51
52
  p ? /* @__PURE__ */ o(
52
- u,
53
+ b,
53
54
  {
54
55
  sidebarOpen: e,
55
56
  onSidebarToggle: () => {
56
- x(!e);
57
+ g(!e);
57
58
  },
58
59
  sidebarContent: d,
59
60
  sidebarWidth: r,
60
61
  collapsedSidebarWidth: t,
61
- headerContent: c
62
+ headerContent: c,
63
+ footerContent: f
62
64
  }
63
65
  ) : null,
64
- /* @__PURE__ */ i(
65
- S,
66
+ /* @__PURE__ */ n(
67
+ k,
66
68
  {
67
69
  component: "main",
68
70
  id: "main",
@@ -83,10 +85,10 @@ function F({
83
85
  children: [
84
86
  a,
85
87
  /* @__PURE__ */ o(
86
- h,
88
+ u,
87
89
  {
88
- releaseName: f,
89
- copyright: s
90
+ releaseName: s,
91
+ copyright: x
90
92
  }
91
93
  )
92
94
  ]
@@ -96,5 +98,5 @@ function F({
96
98
  ] }) });
97
99
  }
98
100
  export {
99
- F as default
101
+ I as default
100
102
  };
@@ -108,9 +108,7 @@ function B({
108
108
  px: 1,
109
109
  borderTop: "1px solid",
110
110
  borderColor: "divider",
111
- flexShrink: 0,
112
- position: "fixed",
113
- bottom: 0
111
+ flexShrink: 0
114
112
  },
115
113
  children: c
116
114
  }