@guardian/stand 0.0.69 → 0.0.71

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 (47) hide show
  1. package/dist/Table.cjs +10 -0
  2. package/dist/Table.d.cts +5 -0
  3. package/dist/Table.d.ts +5 -0
  4. package/dist/Table.js +3 -0
  5. package/dist/TextInput.d.cts +2 -2
  6. package/dist/TextInput.d.ts +2 -2
  7. package/dist/TextListInput.cjs +5 -0
  8. package/dist/TextListInput.d.cts +5 -0
  9. package/dist/TextListInput.d.ts +5 -0
  10. package/dist/TextListInput.js +3 -0
  11. package/dist/components/Table/Table.cjs +80 -0
  12. package/dist/components/Table/Table.d.cts +10 -0
  13. package/dist/components/Table/Table.d.ts +10 -0
  14. package/dist/components/Table/Table.js +75 -0
  15. package/dist/components/Table/styles.cjs +133 -0
  16. package/dist/components/Table/styles.d.cts +8 -0
  17. package/dist/components/Table/styles.d.ts +8 -0
  18. package/dist/components/Table/styles.js +126 -0
  19. package/dist/components/Table/types.d.cts +27 -0
  20. package/dist/components/Table/types.d.ts +27 -0
  21. package/dist/components/TextInput/styles.d.cts +3 -2
  22. package/dist/components/TextInput/styles.d.ts +3 -2
  23. package/dist/components/TextListInput/TextListInput.cjs +81 -0
  24. package/dist/components/TextListInput/TextListInput.d.cts +5 -0
  25. package/dist/components/TextListInput/TextListInput.d.ts +5 -0
  26. package/dist/components/TextListInput/TextListInput.js +81 -0
  27. package/dist/components/TextListInput/styles.cjs +28 -0
  28. package/dist/components/TextListInput/styles.d.cts +8 -0
  29. package/dist/components/TextListInput/styles.d.ts +8 -0
  30. package/dist/components/TextListInput/styles.js +25 -0
  31. package/dist/components/TextListInput/types.d.cts +33 -0
  32. package/dist/components/TextListInput/types.d.ts +33 -0
  33. package/dist/index.cjs +4 -0
  34. package/dist/index.d.cts +3 -1
  35. package/dist/index.d.ts +3 -1
  36. package/dist/index.js +3 -1
  37. package/dist/styleD/build/css/component/table.css +33 -0
  38. package/dist/styleD/build/css/component/textListInput.css +15 -0
  39. package/dist/styleD/build/typescript/component/table.cjs +51 -0
  40. package/dist/styleD/build/typescript/component/table.d.cts +54 -0
  41. package/dist/styleD/build/typescript/component/table.d.ts +54 -0
  42. package/dist/styleD/build/typescript/component/table.js +51 -0
  43. package/dist/styleD/build/typescript/component/textListInput.cjs +22 -0
  44. package/dist/styleD/build/typescript/component/textListInput.d.cts +25 -0
  45. package/dist/styleD/build/typescript/component/textListInput.d.ts +25 -0
  46. package/dist/styleD/build/typescript/component/textListInput.js +22 -0
  47. package/package.json +30 -2
package/dist/Table.cjs ADDED
@@ -0,0 +1,10 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_table = require("./styleD/build/typescript/component/table.cjs");
3
+ const require_Table = require("./components/Table/Table.cjs");
4
+ exports.Table = require_Table.Table;
5
+ exports.TableBody = require_Table.TableBody;
6
+ exports.TableCell = require_Table.TableCell;
7
+ exports.TableColumnHeader = require_Table.TableColumnHeader;
8
+ exports.TableHeader = require_Table.TableHeader;
9
+ exports.TableRow = require_Table.TableRow;
10
+ exports.componentTable = require_table.componentTable;
@@ -0,0 +1,5 @@
1
+ import { ComponentTable, componentTable } from "./styleD/build/typescript/component/table.cjs";
2
+ import { PartialTableTheme } from "./components/Table/styles.cjs";
3
+ import { ResponsiveTableValue, TableBodyProps, TableCellProps, TableColumnHeaderProps, TableHeaderProps, TableProps, TableRowProps } from "./components/Table/types.cjs";
4
+ import { Table, TableBody, TableCell, TableColumnHeader, TableHeader, TableRow } from "./components/Table/Table.cjs";
5
+ export { type ComponentTable, type ResponsiveTableValue, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumnHeader, type TableColumnHeaderProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, type PartialTableTheme as TableTheme, componentTable };
@@ -0,0 +1,5 @@
1
+ import { ComponentTable, componentTable } from "./styleD/build/typescript/component/table.js";
2
+ import { PartialTableTheme } from "./components/Table/styles.js";
3
+ import { ResponsiveTableValue, TableBodyProps, TableCellProps, TableColumnHeaderProps, TableHeaderProps, TableProps, TableRowProps } from "./components/Table/types.js";
4
+ import { Table, TableBody, TableCell, TableColumnHeader, TableHeader, TableRow } from "./components/Table/Table.js";
5
+ export { type ComponentTable, type ResponsiveTableValue, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumnHeader, type TableColumnHeaderProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, type PartialTableTheme as TableTheme, componentTable };
package/dist/Table.js ADDED
@@ -0,0 +1,3 @@
1
+ import { componentTable } from "./styleD/build/typescript/component/table.js";
2
+ import { Table, TableBody, TableCell, TableColumnHeader, TableHeader, TableRow } from "./components/Table/Table.js";
3
+ export { Table, TableBody, TableCell, TableColumnHeader, TableHeader, TableRow, componentTable };
@@ -1,5 +1,5 @@
1
1
  import { ComponentTextInput, componentTextInput } from "./styleD/build/typescript/component/textInput.cjs";
2
- import { TextInputTheme } from "./components/TextInput/styles.cjs";
2
+ import { PartialTextInputTheme } from "./components/TextInput/styles.cjs";
3
3
  import { TextInputProps } from "./components/TextInput/types.cjs";
4
4
  import { TextInput } from "./components/TextInput/TextInput.cjs";
5
- export { type ComponentTextInput, TextInput, type TextInputProps, type TextInputTheme, componentTextInput };
5
+ export { type ComponentTextInput, TextInput, type TextInputProps, type PartialTextInputTheme as TextInputTheme, componentTextInput };
@@ -1,5 +1,5 @@
1
1
  import { ComponentTextInput, componentTextInput } from "./styleD/build/typescript/component/textInput.js";
2
- import { TextInputTheme } from "./components/TextInput/styles.js";
2
+ import { PartialTextInputTheme } from "./components/TextInput/styles.js";
3
3
  import { TextInputProps } from "./components/TextInput/types.js";
4
4
  import { TextInput } from "./components/TextInput/TextInput.js";
5
- export { type ComponentTextInput, TextInput, type TextInputProps, type TextInputTheme, componentTextInput };
5
+ export { type ComponentTextInput, TextInput, type TextInputProps, type PartialTextInputTheme as TextInputTheme, componentTextInput };
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_textListInput = require("./styleD/build/typescript/component/textListInput.cjs");
3
+ const require_TextListInput = require("./components/TextListInput/TextListInput.cjs");
4
+ exports.TextListInput = require_TextListInput.TextListInput;
5
+ exports.componentTextListInput = require_textListInput.componentTextListInput;
@@ -0,0 +1,5 @@
1
+ import { ComponentTextListInput, componentTextListInput } from "./styleD/build/typescript/component/textListInput.cjs";
2
+ import { PartialTextListInputTheme } from "./components/TextListInput/styles.cjs";
3
+ import { TextListInputProps } from "./components/TextListInput/types.cjs";
4
+ import { TextListInput } from "./components/TextListInput/TextListInput.cjs";
5
+ export { type ComponentTextListInput, TextListInput, type TextListInputProps, type PartialTextListInputTheme as TextListInputTheme, componentTextListInput };
@@ -0,0 +1,5 @@
1
+ import { ComponentTextListInput, componentTextListInput } from "./styleD/build/typescript/component/textListInput.js";
2
+ import { PartialTextListInputTheme } from "./components/TextListInput/styles.js";
3
+ import { TextListInputProps } from "./components/TextListInput/types.js";
4
+ import { TextListInput } from "./components/TextListInput/TextListInput.js";
5
+ export { type ComponentTextListInput, TextListInput, type TextListInputProps, type PartialTextListInputTheme as TextListInputTheme, componentTextListInput };
@@ -0,0 +1,3 @@
1
+ import { componentTextListInput } from "./styleD/build/typescript/component/textListInput.js";
2
+ import { TextListInput } from "./components/TextListInput/TextListInput.js";
3
+ export { TextListInput, componentTextListInput };
@@ -0,0 +1,80 @@
1
+ const require_mergeDeep = require("../../util/mergeDeep.cjs");
2
+ const require_styles = require("./styles.cjs");
3
+ let react = require("react");
4
+ let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
5
+ let react_aria_components = require("react-aria-components");
6
+ //#region src/components/Table/Table.tsx
7
+ const TableContext = (0, react.createContext)({
8
+ columns: { sm: "minmax(0, 1fr)" },
9
+ headerVisibleFrom: "lg",
10
+ theme: require_styles.defaultTableTheme
11
+ });
12
+ function Table({ columns, headerVisibleFrom = "lg", theme = {}, cssOverrides, children, ...props }) {
13
+ const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultTableTheme, theme);
14
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(TableContext.Provider, {
15
+ value: {
16
+ columns,
17
+ headerVisibleFrom,
18
+ theme: mergedTheme
19
+ },
20
+ children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.Table, {
21
+ css: [require_styles.tableStyles(mergedTheme), cssOverrides],
22
+ ...props,
23
+ children
24
+ })
25
+ });
26
+ }
27
+ function TableHeader({ theme = {}, cssOverrides, children, ...props }) {
28
+ const context = (0, react.useContext)(TableContext);
29
+ const mergedTheme = require_mergeDeep.mergeDeep(context.theme, theme);
30
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.TableHeader, {
31
+ css: [require_styles.tableHeaderStyles(mergedTheme, context.columns, context.headerVisibleFrom), cssOverrides],
32
+ ...props,
33
+ children
34
+ });
35
+ }
36
+ function TableBody({ cssOverrides, children, ...props }) {
37
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.TableBody, {
38
+ css: [require_styles.tableBodyStyles, cssOverrides],
39
+ ...props,
40
+ children
41
+ });
42
+ }
43
+ function TableRow({ theme = {}, cssOverrides, children, ...props }) {
44
+ const context = (0, react.useContext)(TableContext);
45
+ const mergedTheme = require_mergeDeep.mergeDeep(context.theme, theme);
46
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.Row, {
47
+ css: [require_styles.tableRowStyles(mergedTheme, context.columns), cssOverrides],
48
+ ...props,
49
+ children
50
+ });
51
+ }
52
+ function TableColumnHeader({ theme = {}, cssOverrides, children, ...props }) {
53
+ const context = (0, react.useContext)(TableContext);
54
+ const mergedTheme = require_mergeDeep.mergeDeep(context.theme, theme);
55
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.Column, {
56
+ css: [require_styles.tableColumnHeaderStyles(mergedTheme), cssOverrides],
57
+ ...props,
58
+ children
59
+ });
60
+ }
61
+ function TableCell({ compactLabel, gridColumn, gridRow, theme = {}, cssOverrides, children, ...props }) {
62
+ const context = (0, react.useContext)(TableContext);
63
+ const mergedTheme = require_mergeDeep.mergeDeep(context.theme, theme);
64
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.Cell, {
65
+ css: [require_styles.tableCellStyles(mergedTheme, gridColumn, gridRow), cssOverrides],
66
+ ...props,
67
+ children: (0, react_aria_components.composeRenderProps)(children, (children) => /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(_emotion_react_jsx_runtime.Fragment, { children: [compactLabel && /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("span", {
68
+ css: require_styles.compactLabelStyles(mergedTheme, context.headerVisibleFrom),
69
+ "aria-hidden": "true",
70
+ children: compactLabel
71
+ }), children] }))
72
+ });
73
+ }
74
+ //#endregion
75
+ exports.Table = Table;
76
+ exports.TableBody = TableBody;
77
+ exports.TableCell = TableCell;
78
+ exports.TableColumnHeader = TableColumnHeader;
79
+ exports.TableHeader = TableHeader;
80
+ exports.TableRow = TableRow;
@@ -0,0 +1,10 @@
1
+ import { TableBodyProps, TableCellProps, TableColumnHeaderProps, TableHeaderProps, TableProps, TableRowProps } from "./types.cjs";
2
+ //#region src/components/Table/Table.d.ts
3
+ declare function Table({ columns, headerVisibleFrom, theme, cssOverrides, children, ...props }: TableProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ declare function TableHeader<T extends object = object>({ theme, cssOverrides, children, ...props }: TableHeaderProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
5
+ declare function TableBody<T extends object = object>({ cssOverrides, children, ...props }: TableBodyProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
6
+ declare function TableRow<T extends object = object>({ theme, cssOverrides, children, ...props }: TableRowProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
7
+ declare function TableColumnHeader({ theme, cssOverrides, children, ...props }: TableColumnHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
8
+ declare function TableCell({ compactLabel, gridColumn, gridRow, theme, cssOverrides, children, ...props }: TableCellProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
+ //#endregion
10
+ export { Table, TableBody, TableCell, TableColumnHeader, TableHeader, TableRow };
@@ -0,0 +1,10 @@
1
+ import { TableBodyProps, TableCellProps, TableColumnHeaderProps, TableHeaderProps, TableProps, TableRowProps } from "./types.js";
2
+ //#region src/components/Table/Table.d.ts
3
+ declare function Table({ columns, headerVisibleFrom, theme, cssOverrides, children, ...props }: TableProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ declare function TableHeader<T extends object = object>({ theme, cssOverrides, children, ...props }: TableHeaderProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
5
+ declare function TableBody<T extends object = object>({ cssOverrides, children, ...props }: TableBodyProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
6
+ declare function TableRow<T extends object = object>({ theme, cssOverrides, children, ...props }: TableRowProps<T>): import("@emotion/react/jsx-runtime").JSX.Element;
7
+ declare function TableColumnHeader({ theme, cssOverrides, children, ...props }: TableColumnHeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
8
+ declare function TableCell({ compactLabel, gridColumn, gridRow, theme, cssOverrides, children, ...props }: TableCellProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
+ //#endregion
10
+ export { Table, TableBody, TableCell, TableColumnHeader, TableHeader, TableRow };
@@ -0,0 +1,75 @@
1
+ import { mergeDeep } from "../../util/mergeDeep.js";
2
+ import { compactLabelStyles, defaultTableTheme, tableBodyStyles, tableCellStyles, tableColumnHeaderStyles, tableHeaderStyles, tableRowStyles, tableStyles } from "./styles.js";
3
+ import { createContext, useContext } from "react";
4
+ import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
5
+ import { Cell, Column, Row, Table, TableBody, TableHeader, composeRenderProps } from "react-aria-components";
6
+ //#region src/components/Table/Table.tsx
7
+ const TableContext = createContext({
8
+ columns: { sm: "minmax(0, 1fr)" },
9
+ headerVisibleFrom: "lg",
10
+ theme: defaultTableTheme
11
+ });
12
+ function Table$1({ columns, headerVisibleFrom = "lg", theme = {}, cssOverrides, children, ...props }) {
13
+ const mergedTheme = mergeDeep(defaultTableTheme, theme);
14
+ return /* @__PURE__ */ jsx(TableContext.Provider, {
15
+ value: {
16
+ columns,
17
+ headerVisibleFrom,
18
+ theme: mergedTheme
19
+ },
20
+ children: /* @__PURE__ */ jsx(Table, {
21
+ css: [tableStyles(mergedTheme), cssOverrides],
22
+ ...props,
23
+ children
24
+ })
25
+ });
26
+ }
27
+ function TableHeader$1({ theme = {}, cssOverrides, children, ...props }) {
28
+ const context = useContext(TableContext);
29
+ const mergedTheme = mergeDeep(context.theme, theme);
30
+ return /* @__PURE__ */ jsx(TableHeader, {
31
+ css: [tableHeaderStyles(mergedTheme, context.columns, context.headerVisibleFrom), cssOverrides],
32
+ ...props,
33
+ children
34
+ });
35
+ }
36
+ function TableBody$1({ cssOverrides, children, ...props }) {
37
+ return /* @__PURE__ */ jsx(TableBody, {
38
+ css: [tableBodyStyles, cssOverrides],
39
+ ...props,
40
+ children
41
+ });
42
+ }
43
+ function TableRow({ theme = {}, cssOverrides, children, ...props }) {
44
+ const context = useContext(TableContext);
45
+ const mergedTheme = mergeDeep(context.theme, theme);
46
+ return /* @__PURE__ */ jsx(Row, {
47
+ css: [tableRowStyles(mergedTheme, context.columns), cssOverrides],
48
+ ...props,
49
+ children
50
+ });
51
+ }
52
+ function TableColumnHeader({ theme = {}, cssOverrides, children, ...props }) {
53
+ const context = useContext(TableContext);
54
+ const mergedTheme = mergeDeep(context.theme, theme);
55
+ return /* @__PURE__ */ jsx(Column, {
56
+ css: [tableColumnHeaderStyles(mergedTheme), cssOverrides],
57
+ ...props,
58
+ children
59
+ });
60
+ }
61
+ function TableCell({ compactLabel, gridColumn, gridRow, theme = {}, cssOverrides, children, ...props }) {
62
+ const context = useContext(TableContext);
63
+ const mergedTheme = mergeDeep(context.theme, theme);
64
+ return /* @__PURE__ */ jsx(Cell, {
65
+ css: [tableCellStyles(mergedTheme, gridColumn, gridRow), cssOverrides],
66
+ ...props,
67
+ children: composeRenderProps(children, (children) => /* @__PURE__ */ jsxs(Fragment, { children: [compactLabel && /* @__PURE__ */ jsx("span", {
68
+ css: compactLabelStyles(mergedTheme, context.headerVisibleFrom),
69
+ "aria-hidden": "true",
70
+ children: compactLabel
71
+ }), children] }))
72
+ });
73
+ }
74
+ //#endregion
75
+ export { Table$1 as Table, TableBody$1 as TableBody, TableCell, TableColumnHeader, TableHeader$1 as TableHeader, TableRow };
@@ -0,0 +1,133 @@
1
+ const require_typography = require("../../styleD/utils/semantic/typography.cjs");
2
+ const require_mq = require("../../styleD/utils/semantic/mq.cjs");
3
+ const require_table = require("../../styleD/build/typescript/component/table.cjs");
4
+ let _emotion_react = require("@emotion/react");
5
+ //#region src/components/Table/styles.ts
6
+ const defaultTableTheme = require_table.componentTable;
7
+ const responsiveValue = (value, breakpoint) => {
8
+ if (breakpoint === "lg") return value.lg ?? value.md ?? value.sm;
9
+ if (breakpoint === "md") return value.md ?? value.sm;
10
+ return value.sm;
11
+ };
12
+ const gridTemplateStyles = (columns) => _emotion_react.css`
13
+ grid-template-columns: ${responsiveValue(columns, "sm") ?? "minmax(0, 1fr)"};
14
+
15
+ ${require_mq.from.md} {
16
+ grid-template-columns: ${responsiveValue(columns, "md") ?? "minmax(0, 1fr)"};
17
+ }
18
+
19
+ ${require_mq.from.lg} {
20
+ grid-template-columns: ${responsiveValue(columns, "lg") ?? "minmax(0, 1fr)"};
21
+ }
22
+ `;
23
+ const visuallyHiddenStyles = _emotion_react.css`
24
+ position: absolute;
25
+ width: 1px;
26
+ height: 1px;
27
+ padding: 0;
28
+ margin: -1px;
29
+ overflow: hidden;
30
+ clip: rect(0, 0, 0, 0);
31
+ white-space: nowrap;
32
+ border: 0;
33
+ `;
34
+ const tableStyles = (theme) => _emotion_react.css`
35
+ display: block;
36
+ box-sizing: border-box;
37
+ width: ${theme.table.width};
38
+ border: ${theme.table.border};
39
+ border-radius: ${theme.table.borderRadius};
40
+ border-collapse: collapse;
41
+ border-spacing: 0;
42
+ overflow: hidden;
43
+ background-color: ${theme.table.backgroundColor};
44
+ color: ${theme.table.color};
45
+ `;
46
+ const tableHeaderStyles = (theme, columns, headerVisibleFrom) => _emotion_react.css`
47
+ display: block;
48
+ background-color: ${theme.header.backgroundColor};
49
+ border-bottom: ${theme.header.border};
50
+
51
+ & > tr {
52
+ display: grid;
53
+ ${gridTemplateStyles(columns)}
54
+ }
55
+
56
+ ${headerVisibleFrom === "sm" ? "" : _emotion_react.css`
57
+ ${require_mq.until[headerVisibleFrom]} {
58
+ ${visuallyHiddenStyles}
59
+ }
60
+ `}
61
+ `;
62
+ const tableBodyStyles = _emotion_react.css`
63
+ display: block;
64
+ `;
65
+ const tableRowStyles = (theme, columns) => _emotion_react.css`
66
+ display: grid;
67
+ ${gridTemplateStyles(columns)}
68
+ align-items: center;
69
+ background-color: ${theme.row.backgroundColor};
70
+ border-bottom: ${theme.row.border};
71
+ outline: none;
72
+
73
+ &:last-child {
74
+ border-bottom: 0;
75
+ }
76
+
77
+ &[data-hovered] {
78
+ background-color: ${theme.row.hoverBackgroundColor};
79
+ }
80
+
81
+ &[data-focus-visible] {
82
+ outline: ${theme.row.focusVisible.outline};
83
+ outline-offset: ${theme.row.focusVisible.outlineOffset};
84
+ }
85
+ `;
86
+ const tableColumnHeaderStyles = (theme) => _emotion_react.css`
87
+ min-width: 0;
88
+ padding: ${theme.cell.paddingBlock} ${theme.cell.paddingInline};
89
+ ${require_typography.convertTypographyToEmotionStringStyle(theme.columnHeader.typography)}
90
+
91
+ text-align: left;
92
+ `;
93
+ const responsivePlacementStyles = (gridColumn, gridRow) => _emotion_react.css`
94
+ ${gridColumn?.sm ? `grid-column: ${gridColumn.sm};` : ""}
95
+ ${gridRow?.sm ? `grid-row: ${gridRow.sm};` : ""}
96
+
97
+ ${require_mq.from.md} {
98
+ ${responsiveValue(gridColumn ?? {}, "md") ? `grid-column: ${responsiveValue(gridColumn ?? {}, "md")};` : ""}
99
+ ${responsiveValue(gridRow ?? {}, "md") ? `grid-row: ${responsiveValue(gridRow ?? {}, "md")};` : ""}
100
+ }
101
+
102
+ ${require_mq.from.lg} {
103
+ ${responsiveValue(gridColumn ?? {}, "lg") ? `grid-column: ${responsiveValue(gridColumn ?? {}, "lg")};` : ""}
104
+ ${responsiveValue(gridRow ?? {}, "lg") ? `grid-row: ${responsiveValue(gridRow ?? {}, "lg")};` : ""}
105
+ }
106
+ `;
107
+ const tableCellStyles = (theme, gridColumn, gridRow) => _emotion_react.css`
108
+ min-width: 0;
109
+ box-sizing: border-box;
110
+ overflow-wrap: anywhere;
111
+ padding: ${theme.cell.paddingBlock} ${theme.cell.paddingInline};
112
+ ${require_typography.convertTypographyToEmotionStringStyle(theme.cell.typography)}
113
+ ${responsivePlacementStyles(gridColumn, gridRow)}
114
+ `;
115
+ const compactLabelStyles = (theme, headerVisibleFrom) => _emotion_react.css`
116
+ display: inline;
117
+ margin-right: ${theme.compactLabel.gap};
118
+ color: ${theme.compactLabel.color};
119
+ ${require_typography.convertTypographyToEmotionStringStyle(theme.compactLabel.typography)}
120
+
121
+ ${require_mq.from[headerVisibleFrom]} {
122
+ display: none;
123
+ }
124
+ `;
125
+ //#endregion
126
+ exports.compactLabelStyles = compactLabelStyles;
127
+ exports.defaultTableTheme = defaultTableTheme;
128
+ exports.tableBodyStyles = tableBodyStyles;
129
+ exports.tableCellStyles = tableCellStyles;
130
+ exports.tableColumnHeaderStyles = tableColumnHeaderStyles;
131
+ exports.tableHeaderStyles = tableHeaderStyles;
132
+ exports.tableRowStyles = tableRowStyles;
133
+ exports.tableStyles = tableStyles;
@@ -0,0 +1,8 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.cjs";
2
+ import { ComponentTable } from "../../styleD/build/typescript/component/table.cjs";
3
+ import { SerializedStyles } from "@emotion/react";
4
+ //#region src/components/Table/styles.d.ts
5
+ type TableTheme = Prettify<ComponentTable>;
6
+ type PartialTableTheme = Prettify<DeepPartial<TableTheme>>;
7
+ //#endregion
8
+ export { PartialTableTheme, TableTheme };
@@ -0,0 +1,8 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.js";
2
+ import { ComponentTable } from "../../styleD/build/typescript/component/table.js";
3
+ import { SerializedStyles } from "@emotion/react";
4
+ //#region src/components/Table/styles.d.ts
5
+ type TableTheme = Prettify<ComponentTable>;
6
+ type PartialTableTheme = Prettify<DeepPartial<TableTheme>>;
7
+ //#endregion
8
+ export { PartialTableTheme, TableTheme };
@@ -0,0 +1,126 @@
1
+ import { convertTypographyToEmotionStringStyle } from "../../styleD/utils/semantic/typography.js";
2
+ import { from, until } from "../../styleD/utils/semantic/mq.js";
3
+ import { componentTable } from "../../styleD/build/typescript/component/table.js";
4
+ import { css } from "@emotion/react";
5
+ //#region src/components/Table/styles.ts
6
+ const defaultTableTheme = componentTable;
7
+ const responsiveValue = (value, breakpoint) => {
8
+ if (breakpoint === "lg") return value.lg ?? value.md ?? value.sm;
9
+ if (breakpoint === "md") return value.md ?? value.sm;
10
+ return value.sm;
11
+ };
12
+ const gridTemplateStyles = (columns) => css`
13
+ grid-template-columns: ${responsiveValue(columns, "sm") ?? "minmax(0, 1fr)"};
14
+
15
+ ${from.md} {
16
+ grid-template-columns: ${responsiveValue(columns, "md") ?? "minmax(0, 1fr)"};
17
+ }
18
+
19
+ ${from.lg} {
20
+ grid-template-columns: ${responsiveValue(columns, "lg") ?? "minmax(0, 1fr)"};
21
+ }
22
+ `;
23
+ const visuallyHiddenStyles = css`
24
+ position: absolute;
25
+ width: 1px;
26
+ height: 1px;
27
+ padding: 0;
28
+ margin: -1px;
29
+ overflow: hidden;
30
+ clip: rect(0, 0, 0, 0);
31
+ white-space: nowrap;
32
+ border: 0;
33
+ `;
34
+ const tableStyles = (theme) => css`
35
+ display: block;
36
+ box-sizing: border-box;
37
+ width: ${theme.table.width};
38
+ border: ${theme.table.border};
39
+ border-radius: ${theme.table.borderRadius};
40
+ border-collapse: collapse;
41
+ border-spacing: 0;
42
+ overflow: hidden;
43
+ background-color: ${theme.table.backgroundColor};
44
+ color: ${theme.table.color};
45
+ `;
46
+ const tableHeaderStyles = (theme, columns, headerVisibleFrom) => css`
47
+ display: block;
48
+ background-color: ${theme.header.backgroundColor};
49
+ border-bottom: ${theme.header.border};
50
+
51
+ & > tr {
52
+ display: grid;
53
+ ${gridTemplateStyles(columns)}
54
+ }
55
+
56
+ ${headerVisibleFrom === "sm" ? "" : css`
57
+ ${until[headerVisibleFrom]} {
58
+ ${visuallyHiddenStyles}
59
+ }
60
+ `}
61
+ `;
62
+ const tableBodyStyles = css`
63
+ display: block;
64
+ `;
65
+ const tableRowStyles = (theme, columns) => css`
66
+ display: grid;
67
+ ${gridTemplateStyles(columns)}
68
+ align-items: center;
69
+ background-color: ${theme.row.backgroundColor};
70
+ border-bottom: ${theme.row.border};
71
+ outline: none;
72
+
73
+ &:last-child {
74
+ border-bottom: 0;
75
+ }
76
+
77
+ &[data-hovered] {
78
+ background-color: ${theme.row.hoverBackgroundColor};
79
+ }
80
+
81
+ &[data-focus-visible] {
82
+ outline: ${theme.row.focusVisible.outline};
83
+ outline-offset: ${theme.row.focusVisible.outlineOffset};
84
+ }
85
+ `;
86
+ const tableColumnHeaderStyles = (theme) => css`
87
+ min-width: 0;
88
+ padding: ${theme.cell.paddingBlock} ${theme.cell.paddingInline};
89
+ ${convertTypographyToEmotionStringStyle(theme.columnHeader.typography)}
90
+
91
+ text-align: left;
92
+ `;
93
+ const responsivePlacementStyles = (gridColumn, gridRow) => css`
94
+ ${gridColumn?.sm ? `grid-column: ${gridColumn.sm};` : ""}
95
+ ${gridRow?.sm ? `grid-row: ${gridRow.sm};` : ""}
96
+
97
+ ${from.md} {
98
+ ${responsiveValue(gridColumn ?? {}, "md") ? `grid-column: ${responsiveValue(gridColumn ?? {}, "md")};` : ""}
99
+ ${responsiveValue(gridRow ?? {}, "md") ? `grid-row: ${responsiveValue(gridRow ?? {}, "md")};` : ""}
100
+ }
101
+
102
+ ${from.lg} {
103
+ ${responsiveValue(gridColumn ?? {}, "lg") ? `grid-column: ${responsiveValue(gridColumn ?? {}, "lg")};` : ""}
104
+ ${responsiveValue(gridRow ?? {}, "lg") ? `grid-row: ${responsiveValue(gridRow ?? {}, "lg")};` : ""}
105
+ }
106
+ `;
107
+ const tableCellStyles = (theme, gridColumn, gridRow) => css`
108
+ min-width: 0;
109
+ box-sizing: border-box;
110
+ overflow-wrap: anywhere;
111
+ padding: ${theme.cell.paddingBlock} ${theme.cell.paddingInline};
112
+ ${convertTypographyToEmotionStringStyle(theme.cell.typography)}
113
+ ${responsivePlacementStyles(gridColumn, gridRow)}
114
+ `;
115
+ const compactLabelStyles = (theme, headerVisibleFrom) => css`
116
+ display: inline;
117
+ margin-right: ${theme.compactLabel.gap};
118
+ color: ${theme.compactLabel.color};
119
+ ${convertTypographyToEmotionStringStyle(theme.compactLabel.typography)}
120
+
121
+ ${from[headerVisibleFrom]} {
122
+ display: none;
123
+ }
124
+ `;
125
+ //#endregion
126
+ export { compactLabelStyles, defaultTableTheme, tableBodyStyles, tableCellStyles, tableColumnHeaderStyles, tableHeaderStyles, tableRowStyles, tableStyles };
@@ -0,0 +1,27 @@
1
+ import { DefaultPropsWithChildren } from "../../util/types.cjs";
2
+ import { Breakpoint } from "../../styleD/utils/semantic/mq.cjs";
3
+ import { TableTheme } from "./styles.cjs";
4
+ import { CellProps, ColumnProps, RowProps, TableBodyProps, TableHeaderProps, TableProps } from "react-aria-components";
5
+ import { ReactNode } from "react";
6
+ //#region src/components/Table/types.d.ts
7
+ type ResponsiveTableValue<T> = Partial<Record<Breakpoint, T>>;
8
+ interface TableProps$1 extends DefaultPropsWithChildren<TableTheme>, Omit<TableProps, 'children' | 'className'> {
9
+ /** CSS grid tracks for each responsive breakpoint. Values cascade upward. */
10
+ columns: ResponsiveTableValue<string>;
11
+ /** Breakpoint at which the visible column header is restored. */
12
+ headerVisibleFrom?: Breakpoint;
13
+ }
14
+ interface TableHeaderProps$1<T extends object = object> extends DefaultPropsWithChildren<TableTheme, undefined, TableHeaderProps<T>['children']>, Omit<TableHeaderProps<T>, 'children' | 'className'> {}
15
+ interface TableBodyProps$1<T extends object = object> extends Omit<DefaultPropsWithChildren<TableTheme, undefined, TableBodyProps<T>['children']>, 'theme'>, Omit<TableBodyProps<T>, 'children' | 'className'> {}
16
+ interface TableRowProps<T extends object = object> extends DefaultPropsWithChildren<TableTheme, undefined, RowProps<T>['children']>, Omit<RowProps<T>, 'children' | 'className'> {}
17
+ interface TableColumnHeaderProps extends DefaultPropsWithChildren<TableTheme, undefined, ColumnProps['children']>, Omit<ColumnProps, 'children' | 'className'> {}
18
+ interface TableCellProps extends DefaultPropsWithChildren<TableTheme, undefined, CellProps['children']>, Omit<CellProps, 'children' | 'className'> {
19
+ /** Visual label shown while the column header is visually hidden. */
20
+ compactLabel?: ReactNode;
21
+ /** Responsive CSS `grid-column` placement. */
22
+ gridColumn?: ResponsiveTableValue<string>;
23
+ /** Responsive CSS `grid-row` placement. */
24
+ gridRow?: ResponsiveTableValue<string>;
25
+ }
26
+ //#endregion
27
+ export { ResponsiveTableValue, TableBodyProps$1 as TableBodyProps, TableCellProps, TableColumnHeaderProps, TableHeaderProps$1 as TableHeaderProps, TableProps$1 as TableProps, TableRowProps };
@@ -0,0 +1,27 @@
1
+ import { DefaultPropsWithChildren } from "../../util/types.js";
2
+ import { Breakpoint } from "../../styleD/utils/semantic/mq.js";
3
+ import { TableTheme } from "./styles.js";
4
+ import { ReactNode } from "react";
5
+ import { CellProps, ColumnProps, RowProps, TableBodyProps, TableHeaderProps, TableProps } from "react-aria-components";
6
+ //#region src/components/Table/types.d.ts
7
+ type ResponsiveTableValue<T> = Partial<Record<Breakpoint, T>>;
8
+ interface TableProps$1 extends DefaultPropsWithChildren<TableTheme>, Omit<TableProps, 'children' | 'className'> {
9
+ /** CSS grid tracks for each responsive breakpoint. Values cascade upward. */
10
+ columns: ResponsiveTableValue<string>;
11
+ /** Breakpoint at which the visible column header is restored. */
12
+ headerVisibleFrom?: Breakpoint;
13
+ }
14
+ interface TableHeaderProps$1<T extends object = object> extends DefaultPropsWithChildren<TableTheme, undefined, TableHeaderProps<T>['children']>, Omit<TableHeaderProps<T>, 'children' | 'className'> {}
15
+ interface TableBodyProps$1<T extends object = object> extends Omit<DefaultPropsWithChildren<TableTheme, undefined, TableBodyProps<T>['children']>, 'theme'>, Omit<TableBodyProps<T>, 'children' | 'className'> {}
16
+ interface TableRowProps<T extends object = object> extends DefaultPropsWithChildren<TableTheme, undefined, RowProps<T>['children']>, Omit<RowProps<T>, 'children' | 'className'> {}
17
+ interface TableColumnHeaderProps extends DefaultPropsWithChildren<TableTheme, undefined, ColumnProps['children']>, Omit<ColumnProps, 'children' | 'className'> {}
18
+ interface TableCellProps extends DefaultPropsWithChildren<TableTheme, undefined, CellProps['children']>, Omit<CellProps, 'children' | 'className'> {
19
+ /** Visual label shown while the column header is visually hidden. */
20
+ compactLabel?: ReactNode;
21
+ /** Responsive CSS `grid-column` placement. */
22
+ gridColumn?: ResponsiveTableValue<string>;
23
+ /** Responsive CSS `grid-row` placement. */
24
+ gridRow?: ResponsiveTableValue<string>;
25
+ }
26
+ //#endregion
27
+ export { ResponsiveTableValue, TableBodyProps$1 as TableBodyProps, TableCellProps, TableColumnHeaderProps, TableHeaderProps$1 as TableHeaderProps, TableProps$1 as TableProps, TableRowProps };
@@ -1,8 +1,9 @@
1
- import { Prettify } from "../../util/types.cjs";
1
+ import { DeepPartial, Prettify } from "../../util/types.cjs";
2
2
  import { ComponentTextInput } from "../../styleD/build/typescript/component/textInput.cjs";
3
3
  import "./types.cjs";
4
4
  import { SerializedStyles } from "@emotion/react";
5
5
  //#region src/components/TextInput/styles.d.ts
6
6
  type TextInputTheme = Prettify<ComponentTextInput>;
7
+ type PartialTextInputTheme = Prettify<DeepPartial<ComponentTextInput>>;
7
8
  //#endregion
8
- export { TextInputTheme };
9
+ export { PartialTextInputTheme, TextInputTheme };
@@ -1,8 +1,9 @@
1
- import { Prettify } from "../../util/types.js";
1
+ import { DeepPartial, Prettify } from "../../util/types.js";
2
2
  import { ComponentTextInput } from "../../styleD/build/typescript/component/textInput.js";
3
3
  import "./types.js";
4
4
  import { SerializedStyles } from "@emotion/react";
5
5
  //#region src/components/TextInput/styles.d.ts
6
6
  type TextInputTheme = Prettify<ComponentTextInput>;
7
+ type PartialTextInputTheme = Prettify<DeepPartial<ComponentTextInput>>;
7
8
  //#endregion
8
- export { TextInputTheme };
9
+ export { PartialTextInputTheme, TextInputTheme };