@traefik-labs/faency 13.4.0 → 13.5.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/components/AriaTable/AriaTable.cjs +15 -5
- package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
- package/dist/components/AriaTable/AriaTable.js +16 -6
- package/dist/components/AriaTable/AriaTable.js.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
- package/dist/components/CodeBlock/CodeBlock.js +2 -2
- package/dist/components/CodeBlock/CodeBlock.vanilla.cjs +3 -3
- package/dist/components/CodeBlock/CodeBlock.vanilla.js +3 -3
- package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +1 -1
- package/dist/components/Dialog/Dialog.cjs +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Field/Field.cjs +80 -33
- package/dist/components/Field/Field.cjs.map +1 -1
- package/dist/components/Field/Field.js +80 -33
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/Field.vanilla.cjs +62 -32
- package/dist/components/Field/Field.vanilla.cjs.map +1 -1
- package/dist/components/Field/Field.vanilla.css.cjs +6 -0
- package/dist/components/Field/Field.vanilla.css.cjs.map +1 -1
- package/dist/components/Field/Field.vanilla.css.js +4 -1
- package/dist/components/Field/Field.vanilla.css.js.map +1 -1
- package/dist/components/Field/Field.vanilla.js +63 -33
- package/dist/components/Field/Field.vanilla.js.map +1 -1
- package/dist/components/Field/FieldContext.cjs +48 -10
- package/dist/components/Field/FieldContext.cjs.map +1 -1
- package/dist/components/Field/FieldContext.js +48 -10
- package/dist/components/Field/FieldContext.js.map +1 -1
- package/dist/components/List/List.cjs +1 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/Meter/Meter.vanilla.cjs +1 -1
- package/dist/components/Meter/Meter.vanilla.js +1 -1
- package/dist/components/NavigationTree/NavigationTreeItem.cjs +2 -2
- package/dist/components/NavigationTree/NavigationTreeItem.js +2 -2
- package/dist/components/RowLink/RowLink.cjs +35 -12
- package/dist/components/RowLink/RowLink.cjs.map +1 -1
- package/dist/components/RowLink/RowLink.js +34 -12
- package/dist/components/RowLink/RowLink.js.map +1 -1
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Spinner/Spinner.vanilla.cjs +1 -1
- package/dist/components/Spinner/Spinner.vanilla.js +1 -1
- package/dist/components/Table/Table.cjs +13 -4
- package/dist/components/Table/Table.cjs.map +1 -1
- package/dist/components/Table/Table.js +13 -4
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/TextField/TextField.cjs +1 -1
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/TextField/TextField.vanilla.cjs +1 -1
- package/dist/components/TextField/TextField.vanilla.js +1 -1
- package/dist/components/Textarea/Textarea.cjs +2 -2
- package/dist/components/Textarea/Textarea.js +2 -2
- package/dist/components/Textarea/Textarea.vanilla.cjs +2 -2
- package/dist/components/Textarea/Textarea.vanilla.js +2 -2
- package/dist/components/Toast/ToastProvider.vanilla.cjs +1 -1
- package/dist/components/Toast/ToastProvider.vanilla.js +1 -1
- package/dist/faency.css +1612 -1597
- package/dist/index.cjs +29 -29
- package/dist/index.d.ts +26 -7
- package/dist/index.js +29 -29
- package/dist/utils/warnOnce.cjs +13 -0
- package/dist/utils/warnOnce.cjs.map +1 -0
- package/dist/utils/warnOnce.js +13 -0
- package/dist/utils/warnOnce.js.map +1 -0
- package/package.json +10 -17
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { styled } from "../../stitches.config.js";
|
|
2
|
+
import { warnOnce } from "../../utils/warnOnce.js";
|
|
2
3
|
import React, { Children, cloneElement, isValidElement } from "react";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { Slot } from "@radix-ui/react-slot";
|
|
@@ -22,6 +23,13 @@ var rowLinkStyles = {
|
|
|
22
23
|
outlineStyle: "solid",
|
|
23
24
|
outlineColor: "$focusOutline",
|
|
24
25
|
outlineOffset: "-2px"
|
|
26
|
+
},
|
|
27
|
+
[`&[${ROW_LINK_ATTRIBUTE}="click"]::after`]: { content: "none" },
|
|
28
|
+
[`&[${ROW_LINK_ATTRIBUTE}="click"]:focus-visible`]: {
|
|
29
|
+
outlineWidth: "2px",
|
|
30
|
+
outlineStyle: "solid",
|
|
31
|
+
outlineColor: "$focusOutline",
|
|
32
|
+
outlineOffset: "2px"
|
|
25
33
|
}
|
|
26
34
|
};
|
|
27
35
|
var StyledRowLink = styled("a", rowLinkStyles);
|
|
@@ -40,10 +48,10 @@ var rowLinkRowStyles = {
|
|
|
40
48
|
* A link that covers its whole table row, so that a click on the row opens it.
|
|
41
49
|
* Other links and buttons in the row stay above it.
|
|
42
50
|
*/
|
|
43
|
-
var RowLink = React.forwardRef(({ asChild, ...props }, forwardedRef) => {
|
|
51
|
+
var RowLink = React.forwardRef(({ asChild, overlay = true, ...props }, forwardedRef) => {
|
|
44
52
|
return /* @__PURE__ */ jsx(asChild ? StyledRowLinkSlot : StyledRowLink, {
|
|
45
53
|
ref: forwardedRef,
|
|
46
|
-
[ROW_LINK_ATTRIBUTE]: "",
|
|
54
|
+
[ROW_LINK_ATTRIBUTE]: overlay ? "" : "click",
|
|
47
55
|
...props
|
|
48
56
|
});
|
|
49
57
|
});
|
|
@@ -55,16 +63,8 @@ var isCellType = (type, cellType) => {
|
|
|
55
63
|
const cellClassName = cellType.className;
|
|
56
64
|
return internal?.type === cellType || !!cellClassName && className === cellClassName;
|
|
57
65
|
};
|
|
58
|
-
var warnedMessages = /* @__PURE__ */ new Set();
|
|
59
|
-
var warnOnce = (message) => {
|
|
60
|
-
if (typeof process !== "undefined" && process.env.NODE_ENV === "production") return;
|
|
61
|
-
if (!warnedMessages.has(message)) {
|
|
62
|
-
warnedMessages.add(message);
|
|
63
|
-
console.warn(message);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
66
|
/** Puts the content of the `cellType` cell at `linkCell` in a `RowLink` to `href`. */
|
|
67
|
-
var withRowLink = (children, { href, linkAs: LinkComponent = "a", linkCell = 0, linkProps }, cellType) => {
|
|
67
|
+
var withRowLink = (children, { href, linkAs: LinkComponent = "a", linkCell = 0, linkProps, linkOverlay }, cellType) => {
|
|
68
68
|
if (href === void 0) return children;
|
|
69
69
|
let cellIndex = -1;
|
|
70
70
|
let linked = false;
|
|
@@ -75,6 +75,7 @@ var withRowLink = (children, { href, linkAs: LinkComponent = "a", linkCell = 0,
|
|
|
75
75
|
linked = true;
|
|
76
76
|
return cloneElement(child, void 0, /* @__PURE__ */ jsx(RowLink, {
|
|
77
77
|
asChild: true,
|
|
78
|
+
overlay: linkOverlay,
|
|
78
79
|
children: /* @__PURE__ */ jsx(LinkComponent, {
|
|
79
80
|
...linkProps,
|
|
80
81
|
href,
|
|
@@ -85,6 +86,27 @@ var withRowLink = (children, { href, linkAs: LinkComponent = "a", linkCell = 0,
|
|
|
85
86
|
if (!linked) warnOnce(`Tr: the child at linkCell ${linkCell} is not a Td, so the row has no link. Use a Td for that cell, or put a RowLink in it.`);
|
|
86
87
|
return mapped;
|
|
87
88
|
};
|
|
88
|
-
|
|
89
|
+
var NEW_TAB_PROTOCOLS = ["http:", "https:"];
|
|
90
|
+
var ROW_CLICK_CONTROLS = "a, button, input, select, textarea, label, summary, [role=\"button\"], [role=\"link\"], [role=\"checkbox\"], [role=\"switch\"], [role=\"menuitem\"], [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]";
|
|
91
|
+
/** Opens the `RowLink` without overlay of the row on a click or a middle click outside its controls. */
|
|
92
|
+
var openRowLink = (event) => {
|
|
93
|
+
const isAuxClick = event.type === "auxclick";
|
|
94
|
+
if (event.defaultPrevented || isAuxClick && event.button !== 1) return;
|
|
95
|
+
const row = event.currentTarget;
|
|
96
|
+
const target = event.target;
|
|
97
|
+
if (!(target instanceof Element) || !row.contains(target)) return;
|
|
98
|
+
const control = target.closest(ROW_CLICK_CONTROLS);
|
|
99
|
+
if (control && row.contains(control)) return;
|
|
100
|
+
const link = row.querySelector(`[${ROW_LINK_ATTRIBUTE}="click"]`);
|
|
101
|
+
if (!link) return;
|
|
102
|
+
const selection = window.getSelection();
|
|
103
|
+
if (selection && !selection.isCollapsed && row.contains(selection.anchorNode)) return;
|
|
104
|
+
if ((isAuxClick || event.metaKey || event.ctrlKey || event.shiftKey) && NEW_TAB_PROTOCOLS.includes(new URL(link.href, window.location.href).protocol)) {
|
|
105
|
+
window.open(link.href, "_blank", "noopener,noreferrer");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
link.click();
|
|
109
|
+
};
|
|
110
|
+
export { RowLink, openRowLink, rowLinkRowStyles, rowLinkTableStyles, withRowLink };
|
|
89
111
|
|
|
90
112
|
//# sourceMappingURL=RowLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowLink.js","names":[],"sources":["../../../components/RowLink/RowLink.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React, { Children, cloneElement, ElementType, isValidElement, ReactNode } from 'react';\n\nimport { CSS, styled } from '../../stitches.config';\n\nconst ROW_LINK_ATTRIBUTE = 'data-row-link';\nconst STITCHES_INTERNAL = Symbol.for('sxs.internal');\n\nconst ROW_LINK_Z_INDEX = 1;\nexport const ROW_LINK_CONTROL_Z_INDEX = 2;\nconst ROW_LINK_CONTROLS = `:where(a, button, input, select, textarea, [tabindex]):where(:not([${ROW_LINK_ATTRIBUTE}]))`;\n\nconst rowLinkStyles = {\n color: 'inherit',\n textDecoration: 'none',\n outline: 'none',\n\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n zIndex: ROW_LINK_Z_INDEX,\n },\n\n '&:focus-visible::after': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: '$focusOutline',\n outlineOffset: '-2px',\n },\n};\n\nconst StyledRowLink = styled('a', rowLinkStyles);\nconst StyledRowLinkSlot = styled(Slot, rowLinkStyles);\n\n/** Styles for a table that can hold a `RowLink`. */\nexport const rowLinkTableStyles = {\n [`&:has([${ROW_LINK_ATTRIBUTE}])`]: {\n isolation: 'isolate',\n },\n};\n\n/** Styles for a table row that can hold a `RowLink`. */\nexport const rowLinkRowStyles = {\n [`&:has([${ROW_LINK_ATTRIBUTE}])`]: {\n position: 'relative',\n },\n // Not at zero specificity, so that it wins over the `all: unset` of controls such as Checkbox.\n [`&:has([${ROW_LINK_ATTRIBUTE}]) ${ROW_LINK_CONTROLS}`]: {\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n },\n};\n\nexport type RowLinkProps = React.ComponentProps<typeof StyledRowLink> & {\n asChild?: boolean;\n css?: CSS;\n};\n\n/**\n * A link that covers its whole table row, so that a click on the row opens it.\n * Other links and buttons in the row stay above it.\n */\nexport const RowLink = React.forwardRef<HTMLAnchorElement, RowLinkProps>(\n ({ asChild, ...props }, forwardedRef) => {\n const Component = asChild ? StyledRowLinkSlot : StyledRowLink;\n\n return <Component
|
|
1
|
+
{"version":3,"file":"RowLink.js","names":[],"sources":["../../../components/RowLink/RowLink.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport React, { Children, cloneElement, ElementType, isValidElement, ReactNode } from 'react';\n\nimport { CSS, styled } from '../../stitches.config';\nimport { warnOnce } from '../../utils/warnOnce';\n\nconst ROW_LINK_ATTRIBUTE = 'data-row-link';\nconst STITCHES_INTERNAL = Symbol.for('sxs.internal');\n\nconst ROW_LINK_Z_INDEX = 1;\nexport const ROW_LINK_CONTROL_Z_INDEX = 2;\nconst ROW_LINK_CONTROLS = `:where(a, button, input, select, textarea, [tabindex]):where(:not([${ROW_LINK_ATTRIBUTE}]))`;\n\nconst rowLinkStyles = {\n color: 'inherit',\n textDecoration: 'none',\n outline: 'none',\n\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n zIndex: ROW_LINK_Z_INDEX,\n },\n\n '&:focus-visible::after': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: '$focusOutline',\n outlineOffset: '-2px',\n },\n\n [`&[${ROW_LINK_ATTRIBUTE}=\"click\"]::after`]: {\n content: 'none',\n },\n\n [`&[${ROW_LINK_ATTRIBUTE}=\"click\"]:focus-visible`]: {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: '$focusOutline',\n outlineOffset: '2px',\n },\n};\n\nconst StyledRowLink = styled('a', rowLinkStyles);\nconst StyledRowLinkSlot = styled(Slot, rowLinkStyles);\n\n/** Styles for a table that can hold a `RowLink`. */\nexport const rowLinkTableStyles = {\n [`&:has([${ROW_LINK_ATTRIBUTE}])`]: {\n isolation: 'isolate',\n },\n};\n\n/** Styles for a table row that can hold a `RowLink`. */\nexport const rowLinkRowStyles = {\n [`&:has([${ROW_LINK_ATTRIBUTE}])`]: {\n position: 'relative',\n },\n // Not at zero specificity, so that it wins over the `all: unset` of controls such as Checkbox.\n [`&:has([${ROW_LINK_ATTRIBUTE}]) ${ROW_LINK_CONTROLS}`]: {\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n },\n};\n\nexport type RowLinkProps = React.ComponentProps<typeof StyledRowLink> & {\n asChild?: boolean;\n css?: CSS;\n /**\n * With `false`, the link does not cover the row. The row opens it on a click instead, so the text of the\n * row keeps its hover, for example a tooltip, and can be selected.\n */\n overlay?: boolean;\n};\n\n/**\n * A link that covers its whole table row, so that a click on the row opens it.\n * Other links and buttons in the row stay above it.\n */\nexport const RowLink = React.forwardRef<HTMLAnchorElement, RowLinkProps>(\n ({ asChild, overlay = true, ...props }, forwardedRef) => {\n const Component = asChild ? StyledRowLinkSlot : StyledRowLink;\n\n return (\n <Component\n ref={forwardedRef}\n {...{ [ROW_LINK_ATTRIBUTE]: overlay ? '' : 'click' }}\n {...props}\n />\n );\n },\n);\n\nRowLink.displayName = 'RowLink';\n\nexport type RowLinkShortcutProps = {\n href?: string;\n /**\n * The link component, for example a router link. It must pass its props and ref to its `<a>`,\n * and it must be defined outside render, or the link mounts again on each render.\n */\n linkAs?: ElementType;\n /** Other props for the link component, for example `{ returnTo }`. */\n linkProps?: Record<string, unknown>;\n /** The index of the cell that holds the link, among the direct children of the row. */\n linkCell?: number;\n /** With `false`, the link does not cover the row: see `overlay` on `RowLink`. */\n linkOverlay?: boolean;\n};\n\ntype StitchesType = { className?: string; [STITCHES_INTERNAL]?: { type?: unknown } };\n\n// A Stitches `styled(Td)` keeps the class name of a Stitches Td, or renders a component Td.\n// This reads Stitches 1.x internals; the styled Td tests catch a change in them.\nconst isCellType = (type: unknown, cellType: ElementType) => {\n if (type === cellType) {\n return true;\n }\n if (!type || (typeof type !== 'object' && typeof type !== 'function')) {\n return false;\n }\n const { className, [STITCHES_INTERNAL]: internal } = type as StitchesType;\n const cellClassName = (cellType as StitchesType).className;\n return internal?.type === cellType || (!!cellClassName && className === cellClassName);\n};\n\n/** Puts the content of the `cellType` cell at `linkCell` in a `RowLink` to `href`. */\nexport const withRowLink = (\n children: ReactNode,\n { href, linkAs: LinkComponent = 'a', linkCell = 0, linkProps, linkOverlay }: RowLinkShortcutProps,\n cellType: ElementType,\n) => {\n if (href === undefined) {\n return children;\n }\n\n let cellIndex = -1;\n let linked = false;\n // eslint-disable-next-line @eslint-react/no-children-map\n const mapped = Children.map(children, (child) => {\n if (!isValidElement<{ children?: ReactNode }>(child)) {\n return child;\n }\n cellIndex += 1;\n if (cellIndex !== linkCell || !isCellType(child.type, cellType)) {\n return child;\n }\n linked = true;\n // eslint-disable-next-line @eslint-react/no-clone-element\n return cloneElement(\n child,\n undefined,\n <RowLink asChild overlay={linkOverlay}>\n <LinkComponent {...linkProps} href={href}>\n {child.props.children}\n </LinkComponent>\n </RowLink>,\n );\n });\n\n if (!linked) {\n warnOnce(\n `Tr: the child at linkCell ${linkCell} is not a Td, so the row has no link. Use a Td for that cell, or put a RowLink in it.`,\n );\n }\n\n return mapped;\n};\n\n// Only a web page opens in a new tab, never a script URL such as javascript: or data:.\n// Other links, such as tel: or mailto:, open as on a plain click.\nconst NEW_TAB_PROTOCOLS = ['http:', 'https:'];\n\nconst ROW_CLICK_CONTROLS =\n 'a, button, input, select, textarea, label, summary, [role=\"button\"], [role=\"link\"], [role=\"checkbox\"], [role=\"switch\"], [role=\"menuitem\"], [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\n/** Opens the `RowLink` without overlay of the row on a click or a middle click outside its controls. */\nexport const openRowLink = <T extends HTMLElement>(event: React.MouseEvent<T>) => {\n const isAuxClick = event.type === 'auxclick';\n if (event.defaultPrevented || (isAuxClick && event.button !== 1)) {\n return;\n }\n const row = event.currentTarget;\n const target = event.target;\n // A portal, such as a row menu, sends its clicks to the row through React, but it is not in the row.\n if (!(target instanceof Element) || !row.contains(target)) {\n return;\n }\n const control = target.closest(ROW_CLICK_CONTROLS);\n if (control && row.contains(control)) {\n return;\n }\n const link = row.querySelector<HTMLAnchorElement>(`[${ROW_LINK_ATTRIBUTE}=\"click\"]`);\n if (!link) {\n return;\n }\n // A drag that selects text in the row is not a click on the row.\n const selection = window.getSelection();\n if (selection && !selection.isCollapsed && row.contains(selection.anchorNode)) {\n return;\n }\n const newTab = isAuxClick || event.metaKey || event.ctrlKey || event.shiftKey;\n if (newTab && NEW_TAB_PROTOCOLS.includes(new URL(link.href, window.location.href).protocol)) {\n window.open(link.href, '_blank', 'noopener,noreferrer');\n return;\n }\n link.click();\n};\n"],"mappings":";;;;;;AAMA,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB,OAAO,IAAI,cAAc;AAEnD,IAAM,mBAAmB;AAEzB,IAAM,oBAAoB,sEAAsE,mBAAmB;AAEnH,IAAM,gBAAgB;CACpB,OAAO;CACP,gBAAgB;CAChB,SAAS;CAET,YAAY;EACV,SAAS;EACT,UAAU;EACV,OAAO;EACP,QAAQ;CACV;CAEA,0BAA0B;EACxB,cAAc;EACd,cAAc;EACd,cAAc;EACd,eAAe;CACjB;EAEC,KAAK,mBAAmB,oBAAoB,EAC3C,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S,SAAA;GAAQ,SAAS;GACxB,UAAA,oBAAC,eAAD;IAAe,GAAI;IAAiB;IACjC,UAAA,MAAM,MAAM;GACA,CAAA;EACR,CAAA,CACX;CACF,CAAC;CAED,IAAI,CAAC,QACH,SACE,6BAA6B,SAAS,sFACxC;CAGF,OAAO;AACT;AAIA,IAAM,oBAAoB,CAAC,SAAS,QAAQ;AAE5C,IAAM,qBACJ;;AAGF,IAAa,eAAsC,UAA+B;CAChF,MAAM,aAAa,MAAM,SAAS;CAClC,IAAI,MAAM,oBAAqB,cAAc,MAAM,WAAW,GAC5D;CAEF,MAAM,MAAM,MAAM;CAClB,MAAM,SAAS,MAAM;CAErB,IAAI,EAAE,kBAAkB,YAAY,CAAC,IAAI,SAAS,MAAM,GACtD;CAEF,MAAM,UAAU,OAAO,QAAQ,kBAAkB;CACjD,IAAI,WAAW,IAAI,SAAS,OAAO,GACjC;CAEF,MAAM,OAAO,IAAI,cAAiC,IAAI,mBAAmB,UAAU;CACnF,IAAI,CAAC,MACH;CAGF,MAAM,YAAY,OAAO,aAAa;CACtC,IAAI,aAAa,CAAC,UAAU,eAAe,IAAI,SAAS,UAAU,UAAU,GAC1E;CAGF,KADe,cAAc,MAAM,WAAW,MAAM,WAAW,MAAM,aACvD,kBAAkB,SAAS,IAAI,IAAI,KAAK,MAAM,OAAO,SAAS,IAAI,CAAC,CAAC,QAAQ,GAAG;EAC3F,OAAO,KAAK,KAAK,MAAM,UAAU,qBAAqB;EACtD;CACF;CACA,KAAK,MAAM;AACb"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_stitches_config = require("../../stitches.config.cjs");
|
|
3
|
+
const require_colorSchemeContext = require("../colorSchemeContext.cjs");
|
|
3
4
|
const require_Elevation = require("../Elevation/Elevation.cjs");
|
|
4
5
|
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
5
|
-
const require_colorSchemeContext = require("../colorSchemeContext.cjs");
|
|
6
6
|
let _radix_ui_react_icons = require("@radix-ui/react-icons");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_runtime.__toESM(react, 1);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "../../stitches.config.js";
|
|
2
|
+
import { useColorScheme } from "../colorSchemeContext.js";
|
|
2
3
|
import { elevationVariants } from "../Elevation/Elevation.js";
|
|
3
4
|
import { useFieldControl } from "../Field/FieldContext.js";
|
|
4
|
-
import { useColorScheme } from "../colorSchemeContext.js";
|
|
5
5
|
import { CaretSortIcon } from "@radix-ui/react-icons";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_resolveColor = require("../../styles/resolveColor.cjs");
|
|
3
2
|
const require_cssProps = require("../../styles/cssProps.cjs");
|
|
3
|
+
const require_resolveColor = require("../../styles/resolveColor.cjs");
|
|
4
4
|
const require_themeContext = require("../../styles/themeContext.cjs");
|
|
5
5
|
const require_Spinner_vanilla_css = require("./Spinner.vanilla.css.cjs");
|
|
6
6
|
let react = require("react");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveColor } from "../../styles/resolveColor.js";
|
|
2
1
|
import { processCSSProp } from "../../styles/cssProps.js";
|
|
2
|
+
import { resolveColor } from "../../styles/resolveColor.js";
|
|
3
3
|
import { useVanillaExtractTheme } from "../../styles/themeContext.js";
|
|
4
4
|
import { hiddenLabel, spinnerRecipe, svg, track } from "./Spinner.vanilla.css.js";
|
|
5
5
|
import { forwardRef } from "react";
|
|
@@ -2,10 +2,10 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
|
2
2
|
const require_stitches_config = require("../../stitches.config.cjs");
|
|
3
3
|
const require_Box = require("../Box/Box.cjs");
|
|
4
4
|
const require_Elevation = require("../Elevation/Elevation.cjs");
|
|
5
|
-
const require_RowLink = require("../RowLink/RowLink.cjs");
|
|
6
5
|
const require_Flex = require("../Flex/Flex.cjs");
|
|
7
|
-
const require_Text = require("../Text/Text.cjs");
|
|
8
6
|
const require_Label = require("../Label/Label.cjs");
|
|
7
|
+
const require_RowLink = require("../RowLink/RowLink.cjs");
|
|
8
|
+
const require_Text = require("../Text/Text.cjs");
|
|
9
9
|
const require_ExpandButton = require("./ExpandButton.cjs");
|
|
10
10
|
let _radix_ui_react_icons = require("@radix-ui/react-icons");
|
|
11
11
|
let react = require("react");
|
|
@@ -106,7 +106,7 @@ var AnimatedTr = ({ id, collapsedContentColSpan, isOpen, children }) => {
|
|
|
106
106
|
})
|
|
107
107
|
}) });
|
|
108
108
|
};
|
|
109
|
-
var Tr = (0, react.forwardRef)(({ children, collapsedContent, expandLabel = "Expand row", emptyFirstColumn = false, tableHead = false, collapsedContentColSpan = 1, css, href, linkAs, linkCell, linkProps, interactive, ...props }, ref) => {
|
|
109
|
+
var Tr = (0, react.forwardRef)(({ children, collapsedContent, expandLabel = "Expand row", emptyFirstColumn = false, tableHead = false, collapsedContentColSpan = 1, css, href, linkAs, linkCell, linkProps, linkOverlay, interactive, onClick, onAuxClick, ...props }, ref) => {
|
|
110
110
|
const [isCollapsed, setIsCollapsed] = (0, react.useState)(false);
|
|
111
111
|
const contentId = (0, react.useId)();
|
|
112
112
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledTr, {
|
|
@@ -116,6 +116,14 @@ var Tr = (0, react.forwardRef)(({ children, collapsedContent, expandLabel = "Exp
|
|
|
116
116
|
[`&:nth-last-child(2) > ${Td}`]: { borderBottom: "none" }
|
|
117
117
|
} : { ...css },
|
|
118
118
|
interactive: interactive ?? (href !== void 0 || void 0),
|
|
119
|
+
onClick: (event) => {
|
|
120
|
+
onClick?.(event);
|
|
121
|
+
require_RowLink.openRowLink(event);
|
|
122
|
+
},
|
|
123
|
+
onAuxClick: (event) => {
|
|
124
|
+
onAuxClick?.(event);
|
|
125
|
+
require_RowLink.openRowLink(event);
|
|
126
|
+
},
|
|
119
127
|
...props,
|
|
120
128
|
children: [
|
|
121
129
|
emptyFirstColumn ? tableHead ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Th, { css: { width: 24 } }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Td, {}) : null,
|
|
@@ -158,7 +166,8 @@ var Tr = (0, react.forwardRef)(({ children, collapsedContent, expandLabel = "Exp
|
|
|
158
166
|
href,
|
|
159
167
|
linkAs,
|
|
160
168
|
linkCell,
|
|
161
|
-
linkProps
|
|
169
|
+
linkProps,
|
|
170
|
+
linkOverlay
|
|
162
171
|
}, Td)
|
|
163
172
|
]
|
|
164
173
|
}), !!collapsedContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnimatedTr, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.cjs","names":["styled","Text","Label","rowLinkRowStyles","useMemo","Box","forwardRef","useState","useId","_Fragment","Flex","ExpandButton","ChevronRightIcon","withRowLink","rowLinkTableStyles","elevationVariants"],"sources":["../../../components/Table/Table.tsx"],"sourcesContent":["import { ChevronRightIcon } from '@radix-ui/react-icons';\nimport React, {\n ComponentProps,\n ElementRef,\n forwardRef,\n ReactNode,\n useId,\n useMemo,\n useState,\n} from 'react';\n\nimport { styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\nimport { Label } from '../Label';\nimport {\n ROW_LINK_CONTROL_Z_INDEX,\n rowLinkRowStyles,\n RowLinkShortcutProps,\n rowLinkTableStyles,\n withRowLink,\n} from '../RowLink';\nimport { Text } from '../Text';\nimport { ExpandButton } from './ExpandButton';\n\nexport const Caption = styled('caption', Text, {\n display: 'table-caption',\n textAlign: 'start',\n fontVariantNumeric: 'proportional-nums',\n fontWeight: '$medium',\n lineHeight: '1.25',\n});\n\nexport const Tbody = styled('tbody', {\n width: '100%',\n verticalAlign: 'middle',\n});\n\nexport const Th = styled('th', Label, {\n // override Label\n display: 'table-cell',\n verticalAlign: 'inherit',\n\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n\n textAlign: 'start',\n p: '$2 $3',\n borderBottom: '1px solid $tableRowBorder',\n\n variants: {\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n transform: {\n capitalize: {\n display: 'table-cell', // revert Label enforced value\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const Td = styled('td', {\n boxSizing: 'border-box',\n p: '$5 $3',\n borderBottom: '1px solid $tableRowBorder',\n fontSize: '$3',\n lineHeight: '16px',\n verticalAlign: 'inherit',\n variants: {\n subtle: {\n true: {\n fontWeight: '$regular',\n color: '$tableSubtleText',\n },\n },\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const StyledTr = styled('tr', rowLinkRowStyles, {\n verticalAlign: 'inherit',\n '&:hover': {\n color: '$tableHoverText',\n },\n [`&:last-child > ${Td}`]: {\n borderBottom: 'none',\n },\n\n variants: {\n interactive: {\n true: {\n '&:hover': {\n backgroundColor: '$tableHoverBackground',\n cursor: 'pointer',\n },\n },\n },\n active: {\n true: {\n backgroundColor: '$tableHoverBackground',\n color: '$tableActiveText',\n fontWeight: '$semiBold',\n },\n },\n },\n compoundVariants: [\n {\n interactive: true,\n active: true,\n css: {\n '&:hover': {\n color: '$tableActiveHoverText',\n },\n },\n },\n ],\n});\n\nconst AnimatedTr = ({\n id,\n collapsedContentColSpan,\n isOpen,\n children,\n}: {\n id: string;\n collapsedContentColSpan: number;\n isOpen: boolean;\n children: ReactNode;\n}) => {\n const appliedStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'padding 0.2s ease-out, visibility 0s' }\n : {\n transition: 'padding 0.2s ease-out, visibility 0s 0.2s',\n visibility: 'hidden',\n lineHeight: 0,\n fontSize: 0,\n padding: '0px 16px',\n border: 'none',\n },\n [isOpen],\n );\n\n const containerStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'all 0.2s ease-out' }\n : {\n transition: 'all 0.2s ease-out',\n height: 0,\n overflow: 'hidden',\n },\n [isOpen],\n );\n\n return (\n <Tr>\n <Td id={id} colSpan={collapsedContentColSpan} css={appliedStyle}>\n <Box css={containerStyle}>{children}</Box>\n </Td>\n </Tr>\n );\n};\nexport type TrProps = ComponentProps<typeof StyledTr> &\n VariantProps<typeof StyledTr> & {\n children: React.ReactNode;\n collapsedContent?: React.ReactNode;\n expandLabel?: string;\n emptyFirstColumn?: boolean;\n tableHead?: boolean;\n collapsedContentColSpan?: number;\n } & RowLinkShortcutProps;\n\nexport const Tr = forwardRef<ElementRef<typeof StyledTr>, TrProps>(\n (\n {\n children,\n collapsedContent,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n collapsedContentColSpan = 1,\n css,\n href,\n linkAs,\n linkCell,\n linkProps,\n interactive,\n ...props\n },\n ref,\n ) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n const contentId = useId();\n\n return (\n <>\n <StyledTr\n ref={ref}\n css={\n !!collapsedContent && !isCollapsed\n ? {\n ...css,\n [`&:nth-last-child(2) > ${Td}`]: {\n borderBottom: 'none',\n },\n }\n : { ...css }\n }\n interactive={interactive ?? (href !== undefined || undefined)}\n {...props}\n >\n {emptyFirstColumn ? tableHead ? <Th css={{ width: 24 }} /> : <Td /> : null}\n {!!collapsedContent && (\n <Td\n css={{ padding: '0 0 0 $3' }}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n >\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n height: '40px',\n '&:hover': {\n color: '$tableActiveText',\n },\n }}\n >\n <ExpandButton\n type=\"button\"\n css={{ width: '100%', height: '100%' }}\n aria-label={expandLabel}\n aria-expanded={isCollapsed}\n aria-controls={contentId}\n onClick={() => setIsCollapsed(!isCollapsed)}\n >\n <ChevronRightIcon\n aria-hidden\n style={{\n transition: 'transform 0.2s ease-out',\n transform: isCollapsed ? 'rotate(90deg)' : 'initial',\n }}\n />\n </ExpandButton>\n </Flex>\n </Td>\n )}\n {withRowLink(children, { href, linkAs, linkCell, linkProps }, Td)}\n </StyledTr>\n {!!collapsedContent && (\n <AnimatedTr\n id={contentId}\n isOpen={isCollapsed}\n collapsedContentColSpan={collapsedContentColSpan}\n >\n {collapsedContent}\n </AnimatedTr>\n )}\n </>\n );\n },\n);\n\nexport const Tfoot = styled('tfoot', {\n verticalAlign: 'middle',\n position: 'relative',\n borderRadius: 'inherit',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableFooterLayerBackground',\n borderRadius: 'inherit',\n },\n\n [`& ${Td}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n p: '$2 $3',\n },\n});\n\nexport const Thead = styled('thead', {\n position: 'relative',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n verticalAlign: 'middle',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableHeaderLayerBackground',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n },\n\n [`& ${Th}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n },\n});\n\nexport const Table = styled('table', rowLinkTableStyles, {\n width: '100%',\n tableLayout: 'fixed',\n boxSizing: 'border-box',\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: '$rubik',\n color: '$tableText',\n borderRadius: '$3',\n overflow: 'hidden',\n [`& ${Tbody}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n [`& ${Td}`]: {\n borderTop: '1px solid $tableRowBorder',\n },\n },\n [`& ${Thead}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 1,\n },\n});\n\nexport type TableVariants = VariantProps<typeof Table>;\nexport type TableProps = TableVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAa,UAAUA,wBAAAA,OAAO,WAAWC,aAAAA,MAAM;CAC7C,SAAS;CACT,WAAW;CACX,oBAAoB;CACpB,YAAY;CACZ,YAAY;AACd,CAAC;AAED,IAAa,QAAQD,wBAAAA,OAAO,SAAS;CACnC,OAAO;CACP,eAAe;AACjB,CAAC;AAED,IAAa,KAAKA,wBAAAA,OAAO,MAAME,cAAAA,OAAO;CAEpC,SAAS;CACT,eAAe;CAEf,qBAAqB;CACrB,sBAAsB;CAEtB,WAAW;CACX,GAAG;CACH,cAAc;CAEd,UAAU;EACR,OAAO;GACL,OAAO,EACL,WAAW,QACb;GACA,QAAQ,EACN,WAAW,SACb;GACA,KAAK,EACH,WAAW,MACb;EACF;EACA,WAAW,EACT,YAAY,EACV,SAAS,aACX,EACF;CACF;CACA,iBAAiB,EACf,OAAO,QACT;AACF,CAAC;AAED,IAAa,KAAKF,wBAAAA,OAAO,MAAM;CAC7B,WAAW;CACX,GAAG;CACH,cAAc;CACd,UAAU;CACV,YAAY;CACZ,eAAe;CACf,UAAU;EACR,QAAQ,EACN,MAAM;GACJ,YAAY;GACZ,OAAO;EACT,EACF;EACA,OAAO;GACL,OAAO,EACL,WAAW,QACb;GACA,QAAQ,EACN,WAAW,SACb;GACA,KAAK,EACH,WAAW,MACb;EACF;CACF;CACA,iBAAiB,EACf,OAAO,QACT;AACF,CAAC;AAED,IAAa,WAAWA,wBAAAA,OAAO,MAAMG,gBAAAA,k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,CAAC,oBACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;EACE,IAAI;EACJ,QAAQ;EACiB;EAExB,UAAA;CACS,CAAA,CAEd,EAAA,CAAA;AAEN,CACF;AAEA,IAAa,QAAQb,wBAAAA,OAAO,SAAS;CACnC,eAAe;CACf,UAAU;CACV,cAAc;CAEd,YAAY;EACV,eAAe;EACf,SAAS;EACT,UAAU;EACV,OAAO;EACP,iBAAiB;EACjB,cAAc;CAChB;EAEC,KAAK,OAAO;EACX,UAAU;EACV,OAAO;EACP,YAAY;EACZ,GAAG;CACL;AACF,CAAC;AAED,IAAa,QAAQA,wBAAAA,OAAO,SAAS;CACnC,UAAU;CACV,qBAAqB;CACrB,sBAAsB;CACtB,eAAe;CAEf,YAAY;EACV,eAAe;EACf,SAAS;EACT,UAAU;EACV,OAAO;EACP,iBAAiB;EACjB,qBAAqB;EACrB,sBAAsB;CACxB;EAEC,KAAK,OAAO;EACX,UAAU;EACV,OAAO;EACP,YAAY;CACd;AACF,CAAC;AAED,IAAa,QAAQA,wBAAAA,OAAO,SAASc,gBAAAA,oBAAoB;CACvD,OAAO;CACP,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,eAAe;CACf,YAAY;CACZ,OAAO;CACP,cAAc;CACd,UAAU;EACT,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;GACrB,KAAK,OAAO,EACX,WAAW,4BACb;CACF;EACC,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;CACxB;CAEA,UAAU,EACR,WAAWC,kBAAAA,kBACb;CACA,iBAAiB,EACf,WAAW,EACb;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"Table.cjs","names":["styled","Text","Label","rowLinkRowStyles","useMemo","Box","forwardRef","useState","useId","_Fragment","Flex","ExpandButton","ChevronRightIcon","withRowLink","rowLinkTableStyles","elevationVariants"],"sources":["../../../components/Table/Table.tsx"],"sourcesContent":["import { ChevronRightIcon } from '@radix-ui/react-icons';\nimport React, {\n ComponentProps,\n ElementRef,\n forwardRef,\n ReactNode,\n useId,\n useMemo,\n useState,\n} from 'react';\n\nimport { styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\nimport { Label } from '../Label';\nimport {\n openRowLink,\n ROW_LINK_CONTROL_Z_INDEX,\n rowLinkRowStyles,\n RowLinkShortcutProps,\n rowLinkTableStyles,\n withRowLink,\n} from '../RowLink';\nimport { Text } from '../Text';\nimport { ExpandButton } from './ExpandButton';\n\nexport const Caption = styled('caption', Text, {\n display: 'table-caption',\n textAlign: 'start',\n fontVariantNumeric: 'proportional-nums',\n fontWeight: '$medium',\n lineHeight: '1.25',\n});\n\nexport const Tbody = styled('tbody', {\n width: '100%',\n verticalAlign: 'middle',\n});\n\nexport const Th = styled('th', Label, {\n // override Label\n display: 'table-cell',\n verticalAlign: 'inherit',\n\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n\n textAlign: 'start',\n p: '$2 $3',\n borderBottom: '1px solid $tableRowBorder',\n\n variants: {\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n transform: {\n capitalize: {\n display: 'table-cell', // revert Label enforced value\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const Td = styled('td', {\n boxSizing: 'border-box',\n p: '$5 $3',\n borderBottom: '1px solid $tableRowBorder',\n fontSize: '$3',\n lineHeight: '16px',\n verticalAlign: 'inherit',\n variants: {\n subtle: {\n true: {\n fontWeight: '$regular',\n color: '$tableSubtleText',\n },\n },\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const StyledTr = styled('tr', rowLinkRowStyles, {\n verticalAlign: 'inherit',\n '&:hover': {\n color: '$tableHoverText',\n },\n [`&:last-child > ${Td}`]: {\n borderBottom: 'none',\n },\n\n variants: {\n interactive: {\n true: {\n '&:hover': {\n backgroundColor: '$tableHoverBackground',\n cursor: 'pointer',\n },\n },\n },\n active: {\n true: {\n backgroundColor: '$tableHoverBackground',\n color: '$tableActiveText',\n fontWeight: '$semiBold',\n },\n },\n },\n compoundVariants: [\n {\n interactive: true,\n active: true,\n css: {\n '&:hover': {\n color: '$tableActiveHoverText',\n },\n },\n },\n ],\n});\n\nconst AnimatedTr = ({\n id,\n collapsedContentColSpan,\n isOpen,\n children,\n}: {\n id: string;\n collapsedContentColSpan: number;\n isOpen: boolean;\n children: ReactNode;\n}) => {\n const appliedStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'padding 0.2s ease-out, visibility 0s' }\n : {\n transition: 'padding 0.2s ease-out, visibility 0s 0.2s',\n visibility: 'hidden',\n lineHeight: 0,\n fontSize: 0,\n padding: '0px 16px',\n border: 'none',\n },\n [isOpen],\n );\n\n const containerStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'all 0.2s ease-out' }\n : {\n transition: 'all 0.2s ease-out',\n height: 0,\n overflow: 'hidden',\n },\n [isOpen],\n );\n\n return (\n <Tr>\n <Td id={id} colSpan={collapsedContentColSpan} css={appliedStyle}>\n <Box css={containerStyle}>{children}</Box>\n </Td>\n </Tr>\n );\n};\nexport type TrProps = ComponentProps<typeof StyledTr> &\n VariantProps<typeof StyledTr> & {\n children: React.ReactNode;\n collapsedContent?: React.ReactNode;\n expandLabel?: string;\n emptyFirstColumn?: boolean;\n tableHead?: boolean;\n collapsedContentColSpan?: number;\n } & RowLinkShortcutProps;\n\nexport const Tr = forwardRef<ElementRef<typeof StyledTr>, TrProps>(\n (\n {\n children,\n collapsedContent,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n collapsedContentColSpan = 1,\n css,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n const contentId = useId();\n\n return (\n <>\n <StyledTr\n ref={ref}\n css={\n !!collapsedContent && !isCollapsed\n ? {\n ...css,\n [`&:nth-last-child(2) > ${Td}`]: {\n borderBottom: 'none',\n },\n }\n : { ...css }\n }\n interactive={interactive ?? (href !== undefined || undefined)}\n onClick={(event) => {\n onClick?.(event);\n openRowLink(event);\n }}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn ? tableHead ? <Th css={{ width: 24 }} /> : <Td /> : null}\n {!!collapsedContent && (\n <Td\n css={{ padding: '0 0 0 $3' }}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n >\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n height: '40px',\n '&:hover': {\n color: '$tableActiveText',\n },\n }}\n >\n <ExpandButton\n type=\"button\"\n css={{ width: '100%', height: '100%' }}\n aria-label={expandLabel}\n aria-expanded={isCollapsed}\n aria-controls={contentId}\n onClick={() => setIsCollapsed(!isCollapsed)}\n >\n <ChevronRightIcon\n aria-hidden\n style={{\n transition: 'transform 0.2s ease-out',\n transform: isCollapsed ? 'rotate(90deg)' : 'initial',\n }}\n />\n </ExpandButton>\n </Flex>\n </Td>\n )}\n {withRowLink(children, { href, linkAs, linkCell, linkProps, linkOverlay }, Td)}\n </StyledTr>\n {!!collapsedContent && (\n <AnimatedTr\n id={contentId}\n isOpen={isCollapsed}\n collapsedContentColSpan={collapsedContentColSpan}\n >\n {collapsedContent}\n </AnimatedTr>\n )}\n </>\n );\n },\n);\n\nexport const Tfoot = styled('tfoot', {\n verticalAlign: 'middle',\n position: 'relative',\n borderRadius: 'inherit',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableFooterLayerBackground',\n borderRadius: 'inherit',\n },\n\n [`& ${Td}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n p: '$2 $3',\n },\n});\n\nexport const Thead = styled('thead', {\n position: 'relative',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n verticalAlign: 'middle',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableHeaderLayerBackground',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n },\n\n [`& ${Th}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n },\n});\n\nexport const Table = styled('table', rowLinkTableStyles, {\n width: '100%',\n tableLayout: 'fixed',\n boxSizing: 'border-box',\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: '$rubik',\n color: '$tableText',\n borderRadius: '$3',\n overflow: 'hidden',\n [`& ${Tbody}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n [`& ${Td}`]: {\n borderTop: '1px solid $tableRowBorder',\n },\n },\n [`& ${Thead}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 1,\n },\n});\n\nexport type TableVariants = VariantProps<typeof Table>;\nexport type TableProps = TableVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAa,UAAUA,wBAAAA,OAAO,WAAWC,aAAAA,MAAM;CAC7C,SAAS;CACT,WAAW;CACX,oBAAoB;CACpB,YAAY;CACZ,YAAY;AACd,CAAC;AAED,IAAa,QAAQD,wBAAAA,OAAO,SAAS;CACnC,OAAO;CACP,eAAe;AACjB,CAAC;AAED,IAAa,KAAKA,wBAAAA,OAAO,MAAME,cAAAA,OAAO;CAEpC,SAAS;CACT,eAAe;CAEf,qBAAqB;CACrB,sBAAsB;CAEtB,WAA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EACT,UAAU;EACV,OAAO;EACP,iBAAiB;EACjB,qBAAqB;EACrB,sBAAsB;CACxB;EAEC,KAAK,OAAO;EACX,UAAU;EACV,OAAO;EACP,YAAY;CACd;AACF,CAAC;AAED,IAAa,QAAQA,wBAAAA,OAAO,SAASc,gBAAAA,oBAAoB;CACvD,OAAO;CACP,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,eAAe;CACf,YAAY;CACZ,OAAO;CACP,cAAc;CACd,UAAU;EACT,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;GACrB,KAAK,OAAO,EACX,WAAW,4BACb;CACF;EACC,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;CACxB;CAEA,UAAU,EACR,WAAWC,kBAAAA,kBACb;CACA,iBAAiB,EACf,WAAW,EACb;AACF,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { styled } from "../../stitches.config.js";
|
|
2
2
|
import { Box } from "../Box/Box.js";
|
|
3
3
|
import { elevationVariants } from "../Elevation/Elevation.js";
|
|
4
|
-
import { rowLinkRowStyles, rowLinkTableStyles, withRowLink } from "../RowLink/RowLink.js";
|
|
5
4
|
import { Flex } from "../Flex/Flex.js";
|
|
6
|
-
import { Text } from "../Text/Text.js";
|
|
7
5
|
import { Label } from "../Label/Label.js";
|
|
6
|
+
import { openRowLink, rowLinkRowStyles, rowLinkTableStyles, withRowLink } from "../RowLink/RowLink.js";
|
|
7
|
+
import { Text } from "../Text/Text.js";
|
|
8
8
|
import { ExpandButton } from "./ExpandButton.js";
|
|
9
9
|
import { ChevronRightIcon } from "@radix-ui/react-icons";
|
|
10
10
|
import { forwardRef, useId, useMemo, useState } from "react";
|
|
@@ -104,7 +104,7 @@ var AnimatedTr = ({ id, collapsedContentColSpan, isOpen, children }) => {
|
|
|
104
104
|
})
|
|
105
105
|
}) });
|
|
106
106
|
};
|
|
107
|
-
var Tr = forwardRef(({ children, collapsedContent, expandLabel = "Expand row", emptyFirstColumn = false, tableHead = false, collapsedContentColSpan = 1, css, href, linkAs, linkCell, linkProps, interactive, ...props }, ref) => {
|
|
107
|
+
var Tr = forwardRef(({ children, collapsedContent, expandLabel = "Expand row", emptyFirstColumn = false, tableHead = false, collapsedContentColSpan = 1, css, href, linkAs, linkCell, linkProps, linkOverlay, interactive, onClick, onAuxClick, ...props }, ref) => {
|
|
108
108
|
const [isCollapsed, setIsCollapsed] = useState(false);
|
|
109
109
|
const contentId = useId();
|
|
110
110
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(StyledTr, {
|
|
@@ -114,6 +114,14 @@ var Tr = forwardRef(({ children, collapsedContent, expandLabel = "Expand row", e
|
|
|
114
114
|
[`&:nth-last-child(2) > ${Td}`]: { borderBottom: "none" }
|
|
115
115
|
} : { ...css },
|
|
116
116
|
interactive: interactive ?? (href !== void 0 || void 0),
|
|
117
|
+
onClick: (event) => {
|
|
118
|
+
onClick?.(event);
|
|
119
|
+
openRowLink(event);
|
|
120
|
+
},
|
|
121
|
+
onAuxClick: (event) => {
|
|
122
|
+
onAuxClick?.(event);
|
|
123
|
+
openRowLink(event);
|
|
124
|
+
},
|
|
117
125
|
...props,
|
|
118
126
|
children: [
|
|
119
127
|
emptyFirstColumn ? tableHead ? /* @__PURE__ */ jsx(Th, { css: { width: 24 } }) : /* @__PURE__ */ jsx(Td, {}) : null,
|
|
@@ -156,7 +164,8 @@ var Tr = forwardRef(({ children, collapsedContent, expandLabel = "Expand row", e
|
|
|
156
164
|
href,
|
|
157
165
|
linkAs,
|
|
158
166
|
linkCell,
|
|
159
|
-
linkProps
|
|
167
|
+
linkProps,
|
|
168
|
+
linkOverlay
|
|
160
169
|
}, Td)
|
|
161
170
|
]
|
|
162
171
|
}), !!collapsedContent && /* @__PURE__ */ jsx(AnimatedTr, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","names":["_Fragment"],"sources":["../../../components/Table/Table.tsx"],"sourcesContent":["import { ChevronRightIcon } from '@radix-ui/react-icons';\nimport React, {\n ComponentProps,\n ElementRef,\n forwardRef,\n ReactNode,\n useId,\n useMemo,\n useState,\n} from 'react';\n\nimport { styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\nimport { Label } from '../Label';\nimport {\n ROW_LINK_CONTROL_Z_INDEX,\n rowLinkRowStyles,\n RowLinkShortcutProps,\n rowLinkTableStyles,\n withRowLink,\n} from '../RowLink';\nimport { Text } from '../Text';\nimport { ExpandButton } from './ExpandButton';\n\nexport const Caption = styled('caption', Text, {\n display: 'table-caption',\n textAlign: 'start',\n fontVariantNumeric: 'proportional-nums',\n fontWeight: '$medium',\n lineHeight: '1.25',\n});\n\nexport const Tbody = styled('tbody', {\n width: '100%',\n verticalAlign: 'middle',\n});\n\nexport const Th = styled('th', Label, {\n // override Label\n display: 'table-cell',\n verticalAlign: 'inherit',\n\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n\n textAlign: 'start',\n p: '$2 $3',\n borderBottom: '1px solid $tableRowBorder',\n\n variants: {\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n transform: {\n capitalize: {\n display: 'table-cell', // revert Label enforced value\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const Td = styled('td', {\n boxSizing: 'border-box',\n p: '$5 $3',\n borderBottom: '1px solid $tableRowBorder',\n fontSize: '$3',\n lineHeight: '16px',\n verticalAlign: 'inherit',\n variants: {\n subtle: {\n true: {\n fontWeight: '$regular',\n color: '$tableSubtleText',\n },\n },\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const StyledTr = styled('tr', rowLinkRowStyles, {\n verticalAlign: 'inherit',\n '&:hover': {\n color: '$tableHoverText',\n },\n [`&:last-child > ${Td}`]: {\n borderBottom: 'none',\n },\n\n variants: {\n interactive: {\n true: {\n '&:hover': {\n backgroundColor: '$tableHoverBackground',\n cursor: 'pointer',\n },\n },\n },\n active: {\n true: {\n backgroundColor: '$tableHoverBackground',\n color: '$tableActiveText',\n fontWeight: '$semiBold',\n },\n },\n },\n compoundVariants: [\n {\n interactive: true,\n active: true,\n css: {\n '&:hover': {\n color: '$tableActiveHoverText',\n },\n },\n },\n ],\n});\n\nconst AnimatedTr = ({\n id,\n collapsedContentColSpan,\n isOpen,\n children,\n}: {\n id: string;\n collapsedContentColSpan: number;\n isOpen: boolean;\n children: ReactNode;\n}) => {\n const appliedStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'padding 0.2s ease-out, visibility 0s' }\n : {\n transition: 'padding 0.2s ease-out, visibility 0s 0.2s',\n visibility: 'hidden',\n lineHeight: 0,\n fontSize: 0,\n padding: '0px 16px',\n border: 'none',\n },\n [isOpen],\n );\n\n const containerStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'all 0.2s ease-out' }\n : {\n transition: 'all 0.2s ease-out',\n height: 0,\n overflow: 'hidden',\n },\n [isOpen],\n );\n\n return (\n <Tr>\n <Td id={id} colSpan={collapsedContentColSpan} css={appliedStyle}>\n <Box css={containerStyle}>{children}</Box>\n </Td>\n </Tr>\n );\n};\nexport type TrProps = ComponentProps<typeof StyledTr> &\n VariantProps<typeof StyledTr> & {\n children: React.ReactNode;\n collapsedContent?: React.ReactNode;\n expandLabel?: string;\n emptyFirstColumn?: boolean;\n tableHead?: boolean;\n collapsedContentColSpan?: number;\n } & RowLinkShortcutProps;\n\nexport const Tr = forwardRef<ElementRef<typeof StyledTr>, TrProps>(\n (\n {\n children,\n collapsedContent,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n collapsedContentColSpan = 1,\n css,\n href,\n linkAs,\n linkCell,\n linkProps,\n interactive,\n ...props\n },\n ref,\n ) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n const contentId = useId();\n\n return (\n <>\n <StyledTr\n ref={ref}\n css={\n !!collapsedContent && !isCollapsed\n ? {\n ...css,\n [`&:nth-last-child(2) > ${Td}`]: {\n borderBottom: 'none',\n },\n }\n : { ...css }\n }\n interactive={interactive ?? (href !== undefined || undefined)}\n {...props}\n >\n {emptyFirstColumn ? tableHead ? <Th css={{ width: 24 }} /> : <Td /> : null}\n {!!collapsedContent && (\n <Td\n css={{ padding: '0 0 0 $3' }}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n >\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n height: '40px',\n '&:hover': {\n color: '$tableActiveText',\n },\n }}\n >\n <ExpandButton\n type=\"button\"\n css={{ width: '100%', height: '100%' }}\n aria-label={expandLabel}\n aria-expanded={isCollapsed}\n aria-controls={contentId}\n onClick={() => setIsCollapsed(!isCollapsed)}\n >\n <ChevronRightIcon\n aria-hidden\n style={{\n transition: 'transform 0.2s ease-out',\n transform: isCollapsed ? 'rotate(90deg)' : 'initial',\n }}\n />\n </ExpandButton>\n </Flex>\n </Td>\n )}\n {withRowLink(children, { href, linkAs, linkCell, linkProps }, Td)}\n </StyledTr>\n {!!collapsedContent && (\n <AnimatedTr\n id={contentId}\n isOpen={isCollapsed}\n collapsedContentColSpan={collapsedContentColSpan}\n >\n {collapsedContent}\n </AnimatedTr>\n )}\n </>\n );\n },\n);\n\nexport const Tfoot = styled('tfoot', {\n verticalAlign: 'middle',\n position: 'relative',\n borderRadius: 'inherit',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableFooterLayerBackground',\n borderRadius: 'inherit',\n },\n\n [`& ${Td}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n p: '$2 $3',\n },\n});\n\nexport const Thead = styled('thead', {\n position: 'relative',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n verticalAlign: 'middle',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableHeaderLayerBackground',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n },\n\n [`& ${Th}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n },\n});\n\nexport const Table = styled('table', rowLinkTableStyles, {\n width: '100%',\n tableLayout: 'fixed',\n boxSizing: 'border-box',\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: '$rubik',\n color: '$tableText',\n borderRadius: '$3',\n overflow: 'hidden',\n [`& ${Tbody}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n [`& ${Td}`]: {\n borderTop: '1px solid $tableRowBorder',\n },\n },\n [`& ${Thead}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 1,\n },\n});\n\nexport type TableVariants = VariantProps<typeof Table>;\nexport type TableProps = TableVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAa,UAAU,OAAO,WAAW,MAAM;CAC7C,SAAS;CACT,WAAW;CACX,oBAAoB;CACpB,YAAY;CACZ,YAAY;AACd,CAAC;AAED,IAAa,QAAQ,OAAO,SAAS;CACnC,OAAO;CACP,eAAe;AACjB,CAAC;AAED,IAAa,KAAK,OAAO,MAAM,OAAO;CAEpC,SAAS;CACT,eAAe;CAEf,qBAAqB;CACrB,sBAAsB;CAEtB,WAAW;CACX,GAAG;CACH,cAAc;CAEd,UAAU;EACR,OAAO;GACL,OAAO,EACL,WAAW,QACb;GACA,QAAQ,EACN,WAAW,SACb;GACA,KAAK,EACH,WAAW,MACb;EACF;EACA,WAAW,EACT,YAAY,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I;EACJ,QAAQ;EACiB;EAExB,UAAA;CACS,CAAA,CAEd,EAAA,CAAA;AAEN,CACF;AAEA,IAAa,QAAQ,OAAO,SAAS;CACnC,eAAe;CACf,UAAU;CACV,cAAc;CAEd,YAAY;EACV,eAAe;EACf,SAAS;EACT,UAAU;EACV,OAAO;EACP,iBAAiB;EACjB,cAAc;CAChB;EAEC,KAAK,OAAO;EACX,UAAU;EACV,OAAO;EACP,YAAY;EACZ,GAAG;CACL;AACF,CAAC;AAED,IAAa,QAAQ,OAAO,SAAS;CACnC,UAAU;CACV,qBAAqB;CACrB,sBAAsB;CACtB,eAAe;CAEf,YAAY;EACV,eAAe;EACf,SAAS;EACT,UAAU;EACV,OAAO;EACP,iBAAiB;EACjB,qBAAqB;EACrB,sBAAsB;CACxB;EAEC,KAAK,OAAO;EACX,UAAU;EACV,OAAO;EACP,YAAY;CACd;AACF,CAAC;AAED,IAAa,QAAQ,OAAO,SAAS,oBAAoB;CACvD,OAAO;CACP,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,eAAe;CACf,YAAY;CACZ,OAAO;CACP,cAAc;CACd,UAAU;EACT,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;GACrB,KAAK,OAAO,EACX,WAAW,4BACb;CACF;EACC,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;CACxB;CAEA,UAAU,EACR,WAAW,kBACb;CACA,iBAAiB,EACf,WAAW,EACb;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"Table.js","names":["_Fragment"],"sources":["../../../components/Table/Table.tsx"],"sourcesContent":["import { ChevronRightIcon } from '@radix-ui/react-icons';\nimport React, {\n ComponentProps,\n ElementRef,\n forwardRef,\n ReactNode,\n useId,\n useMemo,\n useState,\n} from 'react';\n\nimport { styled, VariantProps } from '../../stitches.config';\nimport { Box } from '../Box';\nimport { elevationVariants } from '../Elevation';\nimport { Flex } from '../Flex';\nimport { Label } from '../Label';\nimport {\n openRowLink,\n ROW_LINK_CONTROL_Z_INDEX,\n rowLinkRowStyles,\n RowLinkShortcutProps,\n rowLinkTableStyles,\n withRowLink,\n} from '../RowLink';\nimport { Text } from '../Text';\nimport { ExpandButton } from './ExpandButton';\n\nexport const Caption = styled('caption', Text, {\n display: 'table-caption',\n textAlign: 'start',\n fontVariantNumeric: 'proportional-nums',\n fontWeight: '$medium',\n lineHeight: '1.25',\n});\n\nexport const Tbody = styled('tbody', {\n width: '100%',\n verticalAlign: 'middle',\n});\n\nexport const Th = styled('th', Label, {\n // override Label\n display: 'table-cell',\n verticalAlign: 'inherit',\n\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n\n textAlign: 'start',\n p: '$2 $3',\n borderBottom: '1px solid $tableRowBorder',\n\n variants: {\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n transform: {\n capitalize: {\n display: 'table-cell', // revert Label enforced value\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const Td = styled('td', {\n boxSizing: 'border-box',\n p: '$5 $3',\n borderBottom: '1px solid $tableRowBorder',\n fontSize: '$3',\n lineHeight: '16px',\n verticalAlign: 'inherit',\n variants: {\n subtle: {\n true: {\n fontWeight: '$regular',\n color: '$tableSubtleText',\n },\n },\n align: {\n start: {\n textAlign: 'start',\n },\n center: {\n textAlign: 'center',\n },\n end: {\n textAlign: 'end',\n },\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n\nexport const StyledTr = styled('tr', rowLinkRowStyles, {\n verticalAlign: 'inherit',\n '&:hover': {\n color: '$tableHoverText',\n },\n [`&:last-child > ${Td}`]: {\n borderBottom: 'none',\n },\n\n variants: {\n interactive: {\n true: {\n '&:hover': {\n backgroundColor: '$tableHoverBackground',\n cursor: 'pointer',\n },\n },\n },\n active: {\n true: {\n backgroundColor: '$tableHoverBackground',\n color: '$tableActiveText',\n fontWeight: '$semiBold',\n },\n },\n },\n compoundVariants: [\n {\n interactive: true,\n active: true,\n css: {\n '&:hover': {\n color: '$tableActiveHoverText',\n },\n },\n },\n ],\n});\n\nconst AnimatedTr = ({\n id,\n collapsedContentColSpan,\n isOpen,\n children,\n}: {\n id: string;\n collapsedContentColSpan: number;\n isOpen: boolean;\n children: ReactNode;\n}) => {\n const appliedStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'padding 0.2s ease-out, visibility 0s' }\n : {\n transition: 'padding 0.2s ease-out, visibility 0s 0.2s',\n visibility: 'hidden',\n lineHeight: 0,\n fontSize: 0,\n padding: '0px 16px',\n border: 'none',\n },\n [isOpen],\n );\n\n const containerStyle = useMemo(\n () =>\n isOpen\n ? { transition: 'all 0.2s ease-out' }\n : {\n transition: 'all 0.2s ease-out',\n height: 0,\n overflow: 'hidden',\n },\n [isOpen],\n );\n\n return (\n <Tr>\n <Td id={id} colSpan={collapsedContentColSpan} css={appliedStyle}>\n <Box css={containerStyle}>{children}</Box>\n </Td>\n </Tr>\n );\n};\nexport type TrProps = ComponentProps<typeof StyledTr> &\n VariantProps<typeof StyledTr> & {\n children: React.ReactNode;\n collapsedContent?: React.ReactNode;\n expandLabel?: string;\n emptyFirstColumn?: boolean;\n tableHead?: boolean;\n collapsedContentColSpan?: number;\n } & RowLinkShortcutProps;\n\nexport const Tr = forwardRef<ElementRef<typeof StyledTr>, TrProps>(\n (\n {\n children,\n collapsedContent,\n expandLabel = 'Expand row',\n emptyFirstColumn = false,\n tableHead = false,\n collapsedContentColSpan = 1,\n css,\n href,\n linkAs,\n linkCell,\n linkProps,\n linkOverlay,\n interactive,\n onClick,\n onAuxClick,\n ...props\n },\n ref,\n ) => {\n const [isCollapsed, setIsCollapsed] = useState(false);\n const contentId = useId();\n\n return (\n <>\n <StyledTr\n ref={ref}\n css={\n !!collapsedContent && !isCollapsed\n ? {\n ...css,\n [`&:nth-last-child(2) > ${Td}`]: {\n borderBottom: 'none',\n },\n }\n : { ...css }\n }\n interactive={interactive ?? (href !== undefined || undefined)}\n onClick={(event) => {\n onClick?.(event);\n openRowLink(event);\n }}\n onAuxClick={(event) => {\n onAuxClick?.(event);\n openRowLink(event);\n }}\n {...props}\n >\n {emptyFirstColumn ? tableHead ? <Th css={{ width: 24 }} /> : <Td /> : null}\n {!!collapsedContent && (\n <Td\n css={{ padding: '0 0 0 $3' }}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n >\n <Flex\n align=\"center\"\n justify=\"center\"\n css={{\n position: 'relative',\n zIndex: ROW_LINK_CONTROL_Z_INDEX,\n height: '40px',\n '&:hover': {\n color: '$tableActiveText',\n },\n }}\n >\n <ExpandButton\n type=\"button\"\n css={{ width: '100%', height: '100%' }}\n aria-label={expandLabel}\n aria-expanded={isCollapsed}\n aria-controls={contentId}\n onClick={() => setIsCollapsed(!isCollapsed)}\n >\n <ChevronRightIcon\n aria-hidden\n style={{\n transition: 'transform 0.2s ease-out',\n transform: isCollapsed ? 'rotate(90deg)' : 'initial',\n }}\n />\n </ExpandButton>\n </Flex>\n </Td>\n )}\n {withRowLink(children, { href, linkAs, linkCell, linkProps, linkOverlay }, Td)}\n </StyledTr>\n {!!collapsedContent && (\n <AnimatedTr\n id={contentId}\n isOpen={isCollapsed}\n collapsedContentColSpan={collapsedContentColSpan}\n >\n {collapsedContent}\n </AnimatedTr>\n )}\n </>\n );\n },\n);\n\nexport const Tfoot = styled('tfoot', {\n verticalAlign: 'middle',\n position: 'relative',\n borderRadius: 'inherit',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableFooterLayerBackground',\n borderRadius: 'inherit',\n },\n\n [`& ${Td}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n p: '$2 $3',\n },\n});\n\nexport const Thead = styled('thead', {\n position: 'relative',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n verticalAlign: 'middle',\n\n '&::after': {\n pointerEvents: 'none',\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n backgroundColor: '$tableHeaderLayerBackground',\n borderTopLeftRadius: 'inherit',\n borderTopRightRadius: 'inherit',\n },\n\n [`& ${Th}`]: {\n fontSize: '$1',\n color: '$tableHeaderText',\n fontWeight: '$light',\n },\n});\n\nexport const Table = styled('table', rowLinkTableStyles, {\n width: '100%',\n tableLayout: 'fixed',\n boxSizing: 'border-box',\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: '$rubik',\n color: '$tableText',\n borderRadius: '$3',\n overflow: 'hidden',\n [`& ${Tbody}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n [`& ${Td}`]: {\n borderTop: '1px solid $tableRowBorder',\n },\n },\n [`& ${Thead}:not(:empty) ~ ${Tfoot}`]: {\n borderTopLeftRadius: '0',\n borderTopRightRadius: '0',\n },\n\n variants: {\n elevation: elevationVariants,\n },\n defaultVariants: {\n elevation: 1,\n },\n});\n\nexport type TableVariants = VariantProps<typeof Table>;\nexport type TableProps = TableVariants & NonNullable<unknown>;\n"],"mappings":";;;;;;;;;;;;AA2BA,IAAa,UAAU,OAAO,WAAW,MAAM;CAC7C,SAAS;CACT,WAAW;CACX,oBAAoB;CACpB,YAAY;CACZ,YAAY;AACd,CAAC;AAED,IAAa,QAAQ,OAAO,SAAS;CACnC,OAAO;CACP,eAAe;AACjB,CAAC;AAED,IAAa,KAAK,OAAO,MAAM,OAAO;CAEpC,SAAS;CACT,eAAe;CAEf,qBAAqB;CACrB,sBAAsB;CAEtB,WAAW;CACX,GAAG;CACH,cAAc;CAEd,UAAU;EACR,OAAO;GACL,OAAO,EACL,WAAW,QACb;GACA,QAAQ,EACN,WAAW,SACb;GACA,KAAK,EACH,WAAW,MACb;EACF;EACA,WAAW,EACT,YAAY,EACV,SAAS,aACX,EACF;CACF;CACA,iBAAiB,EACf,OAAO,QACT;AACF,CAAC;AAED,IAAa,KAAK,OAAO,MAAM;CAC7B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AAC,CAAC,oBACD,oBAAC,YAAD;EACE,IAAI;EACJ,QAAQ;EACiB;EAExB,UAAA;CACS,CAAA,CAEd,EAAA,CAAA;AAEN,CACF;AAEA,IAAa,QAAQ,OAAO,SAAS;CACnC,eAAe;CACf,UAAU;CACV,cAAc;CAEd,YAAY;EACV,eAAe;EACf,SAAS;EACT,UAAU;EACV,OAAO;EACP,iBAAiB;EACjB,cAAc;CAChB;EAEC,KAAK,OAAO;EACX,UAAU;EACV,OAAO;EACP,YAAY;EACZ,GAAG;CACL;AACF,CAAC;AAED,IAAa,QAAQ,OAAO,SAAS;CACnC,UAAU;CACV,qBAAqB;CACrB,sBAAsB;CACtB,eAAe;CAEf,YAAY;EACV,eAAe;EACf,SAAS;EACT,UAAU;EACV,OAAO;EACP,iBAAiB;EACjB,qBAAqB;EACrB,sBAAsB;CACxB;EAEC,KAAK,OAAO;EACX,UAAU;EACV,OAAO;EACP,YAAY;CACd;AACF,CAAC;AAED,IAAa,QAAQ,OAAO,SAAS,oBAAoB;CACvD,OAAO;CACP,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,eAAe;CACf,YAAY;CACZ,OAAO;CACP,cAAc;CACd,UAAU;EACT,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;GACrB,KAAK,OAAO,EACX,WAAW,4BACb;CACF;EACC,KAAK,MAAM,iBAAiB,UAAU;EACrC,qBAAqB;EACrB,sBAAsB;CACxB;CAEA,UAAU,EACR,WAAW,kBACb;CACA,iBAAiB,EACf,WAAW,EACb;AACF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_stitches_config = require("../../stitches.config.cjs");
|
|
3
|
+
const require_Field = require("../Field/Field.cjs");
|
|
3
4
|
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
4
5
|
const require_Input = require("../Input/Input.cjs");
|
|
5
|
-
const require_Field = require("../Field/Field.cjs");
|
|
6
6
|
const require_Tooltip = require("../Tooltip/Tooltip.cjs");
|
|
7
7
|
let _radix_ui_react_icons = require("@radix-ui/react-icons");
|
|
8
8
|
let react = require("react");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "../../stitches.config.js";
|
|
2
|
+
import { Field } from "../Field/Field.js";
|
|
2
3
|
import { useFieldContext } from "../Field/FieldContext.js";
|
|
3
4
|
import { Input } from "../Input/Input.js";
|
|
4
|
-
import { Field } from "../Field/Field.js";
|
|
5
5
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
6
6
|
import { CrossCircledIcon, ExclamationTriangleIcon, EyeClosedIcon, EyeOpenIcon } from "@radix-ui/react-icons";
|
|
7
7
|
import React from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_Field_vanilla = require("../Field/Field.vanilla.cjs");
|
|
2
3
|
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
3
4
|
const require_Input_vanilla = require("../Input/Input.vanilla.cjs");
|
|
4
|
-
const require_Field_vanilla = require("../Field/Field.vanilla.cjs");
|
|
5
5
|
const require_Tooltip = require("../Tooltip/Tooltip.cjs");
|
|
6
6
|
require("./TextField.vanilla.css.cjs");
|
|
7
7
|
let _radix_ui_react_icons = require("@radix-ui/react-icons");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { FieldVanilla } from "../Field/Field.vanilla.js";
|
|
1
2
|
import { useFieldContext } from "../Field/FieldContext.js";
|
|
2
3
|
import { InputVanilla } from "../Input/Input.vanilla.js";
|
|
3
|
-
import { FieldVanilla } from "../Field/Field.vanilla.js";
|
|
4
4
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
5
5
|
import "./TextField.vanilla.css.js";
|
|
6
6
|
import { CrossCircledIcon, ExclamationTriangleIcon, EyeClosedIcon, EyeOpenIcon } from "@radix-ui/react-icons";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_stitches_config = require("../../stitches.config.cjs");
|
|
3
3
|
const require_Elevation = require("../Elevation/Elevation.cjs");
|
|
4
|
-
const require_Label = require("../Label/Label.cjs");
|
|
5
|
-
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
6
4
|
const require_Field = require("../Field/Field.cjs");
|
|
5
|
+
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
6
|
+
const require_Label = require("../Label/Label.cjs");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_runtime.__toESM(react, 1);
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { styled } from "../../stitches.config.js";
|
|
2
2
|
import { elevationVariants } from "../Elevation/Elevation.js";
|
|
3
|
-
import { Label } from "../Label/Label.js";
|
|
4
|
-
import { useFieldControl } from "../Field/FieldContext.js";
|
|
5
3
|
import { Field } from "../Field/Field.js";
|
|
4
|
+
import { useFieldControl } from "../Field/FieldContext.js";
|
|
5
|
+
import { Label } from "../Label/Label.js";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
// components/Textarea/Textarea.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_cssProps = require("../../styles/cssProps.cjs");
|
|
3
3
|
const require_themeContext = require("../../styles/themeContext.cjs");
|
|
4
|
-
const require_Label_vanilla = require("../Label/Label.vanilla.cjs");
|
|
5
|
-
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
6
4
|
const require_Field_vanilla = require("../Field/Field.vanilla.cjs");
|
|
5
|
+
const require_FieldContext = require("../Field/FieldContext.cjs");
|
|
6
|
+
const require_Label_vanilla = require("../Label/Label.vanilla.cjs");
|
|
7
7
|
const require_Textarea_vanilla_css = require("./Textarea.vanilla.css.cjs");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
react = require_runtime.__toESM(react, 1);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { processCSSProp } from "../../styles/cssProps.js";
|
|
2
2
|
import { useVanillaExtractTheme } from "../../styles/themeContext.js";
|
|
3
|
-
import { LabelVanilla } from "../Label/Label.vanilla.js";
|
|
4
|
-
import { useFieldControl } from "../Field/FieldContext.js";
|
|
5
3
|
import { FieldVanilla } from "../Field/Field.vanilla.js";
|
|
4
|
+
import { useFieldControl } from "../Field/FieldContext.js";
|
|
5
|
+
import { LabelVanilla } from "../Label/Label.vanilla.js";
|
|
6
6
|
import { styledTextareaRecipe, textareaWrapperRecipe } from "./Textarea.vanilla.css.js";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_Toast_vanilla_css = require("./Toast.vanilla.css.cjs");
|
|
3
2
|
const require_Toast_vanilla = require("./Toast.vanilla.cjs");
|
|
3
|
+
const require_Toast_vanilla_css = require("./Toast.vanilla.css.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
react = require_runtime.__toESM(react, 1);
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toastViewportRecipe } from "./Toast.vanilla.css.js";
|
|
2
1
|
import { ToastActionVanilla, ToastDescriptionVanilla, ToastTitleVanilla, ToastVanilla } from "./Toast.vanilla.js";
|
|
2
|
+
import { toastViewportRecipe } from "./Toast.vanilla.css.js";
|
|
3
3
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|