@traefik-labs/faency 13.2.0 → 13.4.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/Accordion/Accordion.cjs +24 -18
- package/dist/components/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/Accordion/Accordion.js +24 -18
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Alert/Alert.cjs.map +1 -1
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/AriaTable/AriaTable.cjs +47 -9
- package/dist/components/AriaTable/AriaTable.cjs.map +1 -1
- package/dist/components/AriaTable/AriaTable.js +48 -10
- package/dist/components/AriaTable/AriaTable.js.map +1 -1
- package/dist/components/Badge/Badge.vanilla.css.cjs.map +1 -1
- package/dist/components/Badge/Badge.vanilla.css.js.map +1 -1
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Combobox/Combobox.vanilla.cjs +170 -0
- package/dist/components/Combobox/Combobox.vanilla.cjs.map +1 -0
- package/dist/components/Combobox/Combobox.vanilla.css.cjs +33 -0
- package/dist/components/Combobox/Combobox.vanilla.css.cjs.map +1 -0
- package/dist/components/Combobox/Combobox.vanilla.css.js +29 -0
- package/dist/components/Combobox/Combobox.vanilla.css.js.map +1 -0
- package/dist/components/Combobox/Combobox.vanilla.js +167 -0
- package/dist/components/Combobox/Combobox.vanilla.js.map +1 -0
- package/dist/components/Dialog/Dialog.cjs +4 -3
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.js +4 -3
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Meter/Meter.vanilla.cjs +74 -0
- package/dist/components/Meter/Meter.vanilla.cjs.map +1 -0
- package/dist/components/Meter/Meter.vanilla.css.cjs +26 -0
- package/dist/components/Meter/Meter.vanilla.css.cjs.map +1 -0
- package/dist/components/Meter/Meter.vanilla.css.js +21 -0
- package/dist/components/Meter/Meter.vanilla.css.js.map +1 -0
- package/dist/components/Meter/Meter.vanilla.js +72 -0
- package/dist/components/Meter/Meter.vanilla.js.map +1 -0
- package/dist/components/Navigation/Navigation.cjs +4 -1
- package/dist/components/Navigation/Navigation.cjs.map +1 -1
- package/dist/components/Navigation/Navigation.js +4 -1
- package/dist/components/Navigation/Navigation.js.map +1 -1
- package/dist/components/RadioAccordion/RadioAccordion.cjs +10 -6
- package/dist/components/RadioAccordion/RadioAccordion.cjs.map +1 -1
- package/dist/components/RadioAccordion/RadioAccordion.js +10 -6
- package/dist/components/RadioAccordion/RadioAccordion.js.map +1 -1
- package/dist/components/RowLink/RowLink.cjs +95 -0
- package/dist/components/RowLink/RowLink.cjs.map +1 -0
- package/dist/components/RowLink/RowLink.js +90 -0
- package/dist/components/RowLink/RowLink.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs +57 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.cjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.cjs +35 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.cjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.js +34 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.css.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.js +53 -0
- package/dist/components/SegmentedControl/SegmentedControl.vanilla.js.map +1 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/SidePanel/SidePanel.cjs +3 -3
- package/dist/components/SidePanel/SidePanel.cjs.map +1 -1
- package/dist/components/SidePanel/SidePanel.js +3 -3
- package/dist/components/SidePanel/SidePanel.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.cjs +4 -0
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +4 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.css.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.vanilla.css.js.map +1 -1
- package/dist/components/Spinner/Spinner.vanilla.cjs +50 -0
- package/dist/components/Spinner/Spinner.vanilla.cjs.map +1 -0
- package/dist/components/Spinner/Spinner.vanilla.css.cjs +21 -0
- package/dist/components/Spinner/Spinner.vanilla.css.cjs.map +1 -0
- package/dist/components/Spinner/Spinner.vanilla.css.js +19 -0
- package/dist/components/Spinner/Spinner.vanilla.css.js.map +1 -0
- package/dist/components/Spinner/Spinner.vanilla.js +48 -0
- package/dist/components/Spinner/Spinner.vanilla.js.map +1 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.cjs +214 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.cjs.map +1 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.css.cjs +14 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.css.cjs.map +1 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.css.js +10 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.css.js.map +1 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.js +210 -0
- package/dist/components/SplitLayout/SplitLayout.vanilla.js.map +1 -0
- package/dist/components/Table/ExpandButton.cjs +18 -0
- package/dist/components/Table/ExpandButton.cjs.map +1 -0
- package/dist/components/Table/ExpandButton.js +19 -0
- package/dist/components/Table/ExpandButton.js.map +1 -0
- package/dist/components/Table/Table.cjs +39 -13
- package/dist/components/Table/Table.cjs.map +1 -1
- package/dist/components/Table/Table.js +40 -14
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Toast/Toast.vanilla.cjs +96 -0
- package/dist/components/Toast/Toast.vanilla.cjs.map +1 -0
- package/dist/components/Toast/Toast.vanilla.css.cjs +44 -0
- package/dist/components/Toast/Toast.vanilla.css.cjs.map +1 -0
- package/dist/components/Toast/Toast.vanilla.css.js +37 -0
- package/dist/components/Toast/Toast.vanilla.css.js.map +1 -0
- package/dist/components/Toast/Toast.vanilla.js +90 -0
- package/dist/components/Toast/Toast.vanilla.js.map +1 -0
- package/dist/components/Toast/ToastProvider.vanilla.cjs +98 -0
- package/dist/components/Toast/ToastProvider.vanilla.cjs.map +1 -0
- package/dist/components/Toast/ToastProvider.vanilla.js +94 -0
- package/dist/components/Toast/ToastProvider.vanilla.js.map +1 -0
- package/dist/faency.css +2311 -1340
- package/dist/index.cjs +33 -6
- package/dist/index.d.ts +1185 -10
- package/dist/index.js +16 -7
- package/dist/styles/cssProps.cjs +3 -10
- package/dist/styles/cssProps.cjs.map +1 -1
- package/dist/styles/cssProps.js +3 -10
- package/dist/styles/cssProps.js.map +1 -1
- package/dist/styles/resolveColor.cjs +18 -0
- package/dist/styles/resolveColor.cjs.map +1 -0
- package/dist/styles/resolveColor.js +18 -0
- package/dist/styles/resolveColor.js.map +1 -0
- package/dist/styles/themes.css.cjs.map +1 -1
- package/dist/styles/themes.css.js.map +1 -1
- package/dist/styles/tokens.css.cjs +484 -0
- package/dist/styles/tokens.css.cjs.map +1 -0
- package/dist/styles/tokens.css.js +484 -0
- package/dist/styles/tokens.css.js.map +1 -0
- package/package.json +3 -9
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_stitches_config = require("../../stitches.config.cjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_runtime.__toESM(react, 1);
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _radix_ui_react_slot = require("@radix-ui/react-slot");
|
|
7
|
+
// components/RowLink/RowLink.tsx
|
|
8
|
+
var ROW_LINK_ATTRIBUTE = "data-row-link";
|
|
9
|
+
var STITCHES_INTERNAL = Symbol.for("sxs.internal");
|
|
10
|
+
var ROW_LINK_Z_INDEX = 1;
|
|
11
|
+
var ROW_LINK_CONTROLS = `:where(a, button, input, select, textarea, [tabindex]):where(:not([${ROW_LINK_ATTRIBUTE}]))`;
|
|
12
|
+
var rowLinkStyles = {
|
|
13
|
+
color: "inherit",
|
|
14
|
+
textDecoration: "none",
|
|
15
|
+
outline: "none",
|
|
16
|
+
"&::after": {
|
|
17
|
+
content: "\"\"",
|
|
18
|
+
position: "absolute",
|
|
19
|
+
inset: 0,
|
|
20
|
+
zIndex: ROW_LINK_Z_INDEX
|
|
21
|
+
},
|
|
22
|
+
"&:focus-visible::after": {
|
|
23
|
+
outlineWidth: "2px",
|
|
24
|
+
outlineStyle: "solid",
|
|
25
|
+
outlineColor: "$focusOutline",
|
|
26
|
+
outlineOffset: "-2px"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var StyledRowLink = require_stitches_config.styled("a", rowLinkStyles);
|
|
30
|
+
var StyledRowLinkSlot = require_stitches_config.styled(_radix_ui_react_slot.Slot, rowLinkStyles);
|
|
31
|
+
/** Styles for a table that can hold a `RowLink`. */
|
|
32
|
+
var rowLinkTableStyles = { [`&:has([${ROW_LINK_ATTRIBUTE}])`]: { isolation: "isolate" } };
|
|
33
|
+
/** Styles for a table row that can hold a `RowLink`. */
|
|
34
|
+
var rowLinkRowStyles = {
|
|
35
|
+
[`&:has([${ROW_LINK_ATTRIBUTE}])`]: { position: "relative" },
|
|
36
|
+
[`&:has([${ROW_LINK_ATTRIBUTE}]) ${ROW_LINK_CONTROLS}`]: {
|
|
37
|
+
position: "relative",
|
|
38
|
+
zIndex: 2
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A link that covers its whole table row, so that a click on the row opens it.
|
|
43
|
+
* Other links and buttons in the row stay above it.
|
|
44
|
+
*/
|
|
45
|
+
var RowLink = react.default.forwardRef(({ asChild, ...props }, forwardedRef) => {
|
|
46
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? StyledRowLinkSlot : StyledRowLink, {
|
|
47
|
+
ref: forwardedRef,
|
|
48
|
+
[ROW_LINK_ATTRIBUTE]: "",
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
RowLink.displayName = "RowLink";
|
|
53
|
+
var isCellType = (type, cellType) => {
|
|
54
|
+
if (type === cellType) return true;
|
|
55
|
+
if (!type || typeof type !== "object" && typeof type !== "function") return false;
|
|
56
|
+
const { className, [STITCHES_INTERNAL]: internal } = type;
|
|
57
|
+
const cellClassName = cellType.className;
|
|
58
|
+
return internal?.type === cellType || !!cellClassName && className === cellClassName;
|
|
59
|
+
};
|
|
60
|
+
var warnedMessages = /* @__PURE__ */ new Set();
|
|
61
|
+
var warnOnce = (message) => {
|
|
62
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV === "production") return;
|
|
63
|
+
if (!warnedMessages.has(message)) {
|
|
64
|
+
warnedMessages.add(message);
|
|
65
|
+
console.warn(message);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/** Puts the content of the `cellType` cell at `linkCell` in a `RowLink` to `href`. */
|
|
69
|
+
var withRowLink = (children, { href, linkAs: LinkComponent = "a", linkCell = 0, linkProps }, cellType) => {
|
|
70
|
+
if (href === void 0) return children;
|
|
71
|
+
let cellIndex = -1;
|
|
72
|
+
let linked = false;
|
|
73
|
+
const mapped = react.Children.map(children, (child) => {
|
|
74
|
+
if (!(0, react.isValidElement)(child)) return child;
|
|
75
|
+
cellIndex += 1;
|
|
76
|
+
if (cellIndex !== linkCell || !isCellType(child.type, cellType)) return child;
|
|
77
|
+
linked = true;
|
|
78
|
+
return (0, react.cloneElement)(child, void 0, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowLink, {
|
|
79
|
+
asChild: true,
|
|
80
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkComponent, {
|
|
81
|
+
...linkProps,
|
|
82
|
+
href,
|
|
83
|
+
children: child.props.children
|
|
84
|
+
})
|
|
85
|
+
}));
|
|
86
|
+
});
|
|
87
|
+
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.`);
|
|
88
|
+
return mapped;
|
|
89
|
+
};
|
|
90
|
+
exports.RowLink = RowLink;
|
|
91
|
+
exports.rowLinkRowStyles = rowLinkRowStyles;
|
|
92
|
+
exports.rowLinkTableStyles = rowLinkTableStyles;
|
|
93
|
+
exports.withRowLink = withRowLink;
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=RowLink.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowLink.cjs","names":["styled","Slot","React","Children","isValidElement","cloneElement"],"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 ref={forwardedRef} {...{ [ROW_LINK_ATTRIBUTE]: '' }} {...props} />;\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};\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\nconst warnedMessages = new Set<string>();\n\n/** Clears the warnings that were already logged. For tests only. */\nexport const resetRowLinkWarnings = () => warnedMessages.clear();\n\nconst warnOnce = (message: string) => {\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') {\n return;\n }\n if (!warnedMessages.has(message)) {\n warnedMessages.add(message);\n console.warn(message);\n }\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 }: 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>\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"],"mappings":";;;;;;;AAKA,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;AACF;AAEA,IAAM,gBAAgBA,wBAAAA,OAAO,KAAK,aAAa;AAC/C,IAAM,oBAAoBA,wBAAAA,OAAOC,qBAAAA,MAAM,aAAa;;AAGpD,IAAa,qBAAqB,GAC/B,UAAU,mBAAmB,MAAM,EAClC,WAAW,UACb,EACF;;AAGA,IAAa,mBAAmB;EAC7B,UAAU,mBAAmB,MAAM,EAClC,UAAU,WACZ;EAEC,UAAU,mBAAmB,KAAK,sBAAsB;EACvD,UAAU;EACV,QAAA;CACF;AACF;;;;;AAWA,IAAa,UAAUC,MAAAA,QAAM,YAC1B,EAAE,SAAS,GAAG,SAAS,iBAAiB;CAGvC,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAFW,UAAU,oBAAoB,eAEzC;EAAW,KAAK;GAAqB,qBAAqB;EAAM,GAAI;CAAQ,CAAA;AACrF,CACF;AAEA,QAAQ,cAAc;AAmBtB,IAAM,cAAc,MAAe,aAA0B;CAC3D,IAAI,SAAS,UACX,OAAO;CAET,IAAI,CAAC,QAAS,OAAO,SAAS,YAAY,OAAO,SAAS,YACxD,OAAO;CAET,MAAM,EAAE,YAAY,oBAAoB,aAAa;CACrD,MAAM,gBAAiB,SAA0B;CACjD,OAAO,UAAU,SAAS,YAAa,CAAC,CAAC,iBAAiB,cAAc;AAC1E;AAEA,IAAM,iCAAiB,IAAI,IAAY;AAKvC,IAAM,YAAY,YAAoB;CACpC,IAAI,OAAO,YAAY,eAAA,QAAA,IAAA,aAAwC,cAC7D;CAEF,IAAI,CAAC,eAAe,IAAI,OAAO,GAAG;EAChC,eAAe,IAAI,OAAO;EAC1B,QAAQ,KAAK,OAAO;CACtB;AACF;;AAGA,IAAa,eACX,UACA,EAAE,MAAM,QAAQ,gBAAgB,KAAK,WAAW,GAAG,aACnD,aACG;CACH,IAAI,SAAS,KAAA,GACX,OAAO;CAGT,IAAI,YAAY;CAChB,IAAI,SAAS;CAEb,MAAM,SAASC,MAAAA,SAAS,IAAI,WAAW,UAAU;EAC/C,IAAI,EAAA,GAACC,MAAAA,eAAAA,CAAyC,KAAK,GACjD,OAAO;EAET,aAAa;EACb,IAAI,cAAc,YAAY,CAAC,WAAW,MAAM,MAAM,QAAQ,GAC5D,OAAO;EAET,SAAS;EAET,QAAA,GAAOC,MAAAA,aAAAA,CACL,OACA,KAAA,GACA,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;GAAS,SAAA;GACP,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,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"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { styled } from "../../stitches.config.js";
|
|
2
|
+
import React, { Children, cloneElement, isValidElement } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
+
// components/RowLink/RowLink.tsx
|
|
6
|
+
var ROW_LINK_ATTRIBUTE = "data-row-link";
|
|
7
|
+
var STITCHES_INTERNAL = Symbol.for("sxs.internal");
|
|
8
|
+
var ROW_LINK_Z_INDEX = 1;
|
|
9
|
+
var ROW_LINK_CONTROLS = `:where(a, button, input, select, textarea, [tabindex]):where(:not([${ROW_LINK_ATTRIBUTE}]))`;
|
|
10
|
+
var rowLinkStyles = {
|
|
11
|
+
color: "inherit",
|
|
12
|
+
textDecoration: "none",
|
|
13
|
+
outline: "none",
|
|
14
|
+
"&::after": {
|
|
15
|
+
content: "\"\"",
|
|
16
|
+
position: "absolute",
|
|
17
|
+
inset: 0,
|
|
18
|
+
zIndex: ROW_LINK_Z_INDEX
|
|
19
|
+
},
|
|
20
|
+
"&:focus-visible::after": {
|
|
21
|
+
outlineWidth: "2px",
|
|
22
|
+
outlineStyle: "solid",
|
|
23
|
+
outlineColor: "$focusOutline",
|
|
24
|
+
outlineOffset: "-2px"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var StyledRowLink = styled("a", rowLinkStyles);
|
|
28
|
+
var StyledRowLinkSlot = styled(Slot, rowLinkStyles);
|
|
29
|
+
/** Styles for a table that can hold a `RowLink`. */
|
|
30
|
+
var rowLinkTableStyles = { [`&:has([${ROW_LINK_ATTRIBUTE}])`]: { isolation: "isolate" } };
|
|
31
|
+
/** Styles for a table row that can hold a `RowLink`. */
|
|
32
|
+
var rowLinkRowStyles = {
|
|
33
|
+
[`&:has([${ROW_LINK_ATTRIBUTE}])`]: { position: "relative" },
|
|
34
|
+
[`&:has([${ROW_LINK_ATTRIBUTE}]) ${ROW_LINK_CONTROLS}`]: {
|
|
35
|
+
position: "relative",
|
|
36
|
+
zIndex: 2
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A link that covers its whole table row, so that a click on the row opens it.
|
|
41
|
+
* Other links and buttons in the row stay above it.
|
|
42
|
+
*/
|
|
43
|
+
var RowLink = React.forwardRef(({ asChild, ...props }, forwardedRef) => {
|
|
44
|
+
return /* @__PURE__ */ jsx(asChild ? StyledRowLinkSlot : StyledRowLink, {
|
|
45
|
+
ref: forwardedRef,
|
|
46
|
+
[ROW_LINK_ATTRIBUTE]: "",
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
RowLink.displayName = "RowLink";
|
|
51
|
+
var isCellType = (type, cellType) => {
|
|
52
|
+
if (type === cellType) return true;
|
|
53
|
+
if (!type || typeof type !== "object" && typeof type !== "function") return false;
|
|
54
|
+
const { className, [STITCHES_INTERNAL]: internal } = type;
|
|
55
|
+
const cellClassName = cellType.className;
|
|
56
|
+
return internal?.type === cellType || !!cellClassName && className === cellClassName;
|
|
57
|
+
};
|
|
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
|
+
/** 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) => {
|
|
68
|
+
if (href === void 0) return children;
|
|
69
|
+
let cellIndex = -1;
|
|
70
|
+
let linked = false;
|
|
71
|
+
const mapped = Children.map(children, (child) => {
|
|
72
|
+
if (!isValidElement(child)) return child;
|
|
73
|
+
cellIndex += 1;
|
|
74
|
+
if (cellIndex !== linkCell || !isCellType(child.type, cellType)) return child;
|
|
75
|
+
linked = true;
|
|
76
|
+
return cloneElement(child, void 0, /* @__PURE__ */ jsx(RowLink, {
|
|
77
|
+
asChild: true,
|
|
78
|
+
children: /* @__PURE__ */ jsx(LinkComponent, {
|
|
79
|
+
...linkProps,
|
|
80
|
+
href,
|
|
81
|
+
children: child.props.children
|
|
82
|
+
})
|
|
83
|
+
}));
|
|
84
|
+
});
|
|
85
|
+
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
|
+
return mapped;
|
|
87
|
+
};
|
|
88
|
+
export { RowLink, rowLinkRowStyles, rowLinkTableStyles, withRowLink };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=RowLink.js.map
|
|
@@ -0,0 +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 ref={forwardedRef} {...{ [ROW_LINK_ATTRIBUTE]: '' }} {...props} />;\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};\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\nconst warnedMessages = new Set<string>();\n\n/** Clears the warnings that were already logged. For tests only. */\nexport const resetRowLinkWarnings = () => warnedMessages.clear();\n\nconst warnOnce = (message: string) => {\n if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') {\n return;\n }\n if (!warnedMessages.has(message)) {\n warnedMessages.add(message);\n console.warn(message);\n }\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 }: 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>\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"],"mappings":";;;;;AAKA,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;AACF;AAEA,IAAM,gBAAgB,OAAO,KAAK,aAAa;AAC/C,IAAM,oBAAoB,OAAO,MAAM,aAAa;;AAGpD,IAAa,qBAAqB,GAC/B,UAAU,mBAAmB,MAAM,EAClC,WAAW,UACb,EACF;;AAGA,IAAa,mBAAmB;EAC7B,UAAU,mBAAmB,MAAM,EAClC,UAAU,WACZ;EAEC,UAAU,mBAAmB,KAAK,sBAAsB;EACvD,UAAU;EACV,QAAA;CACF;AACF;;;;;AAWA,IAAa,UAAU,MAAM,YAC1B,EAAE,SAAS,GAAG,SAAS,iBAAiB;CAGvC,OAAO,oBAFW,UAAU,oBAAoB,eAEzC;EAAW,KAAK;GAAqB,qBAAqB;EAAM,GAAI;CAAQ,CAAA;AACrF,CACF;AAEA,QAAQ,cAAc;AAmBtB,IAAM,cAAc,MAAe,aAA0B;CAC3D,IAAI,SAAS,UACX,OAAO;CAET,IAAI,CAAC,QAAS,OAAO,SAAS,YAAY,OAAO,SAAS,YACxD,OAAO;CAET,MAAM,EAAE,YAAY,oBAAoB,aAAa;CACrD,MAAM,gBAAiB,SAA0B;CACjD,OAAO,UAAU,SAAS,YAAa,CAAC,CAAC,iBAAiB,cAAc;AAC1E;AAEA,IAAM,iCAAiB,IAAI,IAAY;AAKvC,IAAM,YAAY,YAAoB;CACpC,IAAI,OAAO,YAAY,eAAA,QAAA,IAAA,aAAwC,cAC7D;CAEF,IAAI,CAAC,eAAe,IAAI,OAAO,GAAG;EAChC,eAAe,IAAI,OAAO;EAC1B,QAAQ,KAAK,OAAO;CACtB;AACF;;AAGA,IAAa,eACX,UACA,EAAE,MAAM,QAAQ,gBAAgB,KAAK,WAAW,GAAG,aACnD,aACG;CACH,IAAI,SAAS,KAAA,GACX,OAAO;CAGT,IAAI,YAAY;CAChB,IAAI,SAAS;CAEb,MAAM,SAAS,SAAS,IAAI,WAAW,UAAU;EAC/C,IAAI,CAAC,eAAyC,KAAK,GACjD,OAAO;EAET,aAAa;EACb,IAAI,cAAc,YAAY,CAAC,WAAW,MAAM,MAAM,QAAQ,GAC5D,OAAO;EAET,SAAS;EAET,OAAO,aACL,OACA,KAAA,GACA,oBAAC,SAAD;GAAS,SAAA;GACP,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"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_cssProps = require("../../styles/cssProps.cjs");
|
|
3
|
+
const require_themeContext = require("../../styles/themeContext.cjs");
|
|
4
|
+
const require_SegmentedControl_vanilla_css = require("./SegmentedControl.vanilla.css.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_runtime.__toESM(react, 1);
|
|
7
|
+
let _vanilla_extract_dynamic = require("@vanilla-extract/dynamic");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let _radix_ui_react_radio_group = require("@radix-ui/react-radio-group");
|
|
10
|
+
_radix_ui_react_radio_group = require_runtime.__toESM(_radix_ui_react_radio_group, 1);
|
|
11
|
+
// components/SegmentedControl/SegmentedControl.vanilla.tsx
|
|
12
|
+
var joinClassNames = (...classNames) => classNames.filter(Boolean).join(" ");
|
|
13
|
+
var useCssProp = (css, style) => {
|
|
14
|
+
const { colors } = require_themeContext.useVanillaExtractTheme();
|
|
15
|
+
const { style: cssStyles, vars } = require_cssProps.processCSSProp(css, colors);
|
|
16
|
+
return {
|
|
17
|
+
...cssStyles,
|
|
18
|
+
...style,
|
|
19
|
+
...(0, _vanilla_extract_dynamic.assignInlineVars)(vars)
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
var SegmentedControlContext = (0, react.createContext)({
|
|
23
|
+
size: "medium",
|
|
24
|
+
fullWidth: false
|
|
25
|
+
});
|
|
26
|
+
var SegmentedControlVanilla = (0, react.forwardRef)(({ size = "medium", fullWidth = false, className, css, style, children, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SegmentedControlContext.Provider, {
|
|
27
|
+
value: {
|
|
28
|
+
size,
|
|
29
|
+
fullWidth
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Root, {
|
|
32
|
+
ref,
|
|
33
|
+
orientation: "horizontal",
|
|
34
|
+
className: joinClassNames(require_SegmentedControl_vanilla_css.segmentedControlRecipe({ fullWidth }), className),
|
|
35
|
+
style: useCssProp(css, style),
|
|
36
|
+
...props,
|
|
37
|
+
children
|
|
38
|
+
})
|
|
39
|
+
}));
|
|
40
|
+
SegmentedControlVanilla.displayName = "SegmentedControlVanilla";
|
|
41
|
+
var SegmentedControlItemVanilla = (0, react.forwardRef)(({ className, css, style, ...props }, ref) => {
|
|
42
|
+
const { size, fullWidth } = (0, react.useContext)(SegmentedControlContext);
|
|
43
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_radio_group.Item, {
|
|
44
|
+
ref,
|
|
45
|
+
className: joinClassNames(require_SegmentedControl_vanilla_css.segmentedControlItemRecipe({
|
|
46
|
+
size,
|
|
47
|
+
fullWidth
|
|
48
|
+
}), className),
|
|
49
|
+
style: useCssProp(css, style),
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
SegmentedControlItemVanilla.displayName = "SegmentedControlItemVanilla";
|
|
54
|
+
exports.SegmentedControlItemVanilla = SegmentedControlItemVanilla;
|
|
55
|
+
exports.SegmentedControlVanilla = SegmentedControlVanilla;
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=SegmentedControl.vanilla.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.vanilla.cjs","names":["useVanillaExtractTheme","processCSSProp","assignInlineVars","createContext","forwardRef","RadioGroupPrimitive","segmentedControlRecipe","useContext","segmentedControlItemRecipe"],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ComponentPropsWithoutRef, createContext, forwardRef, useContext } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport {\n segmentedControlItemRecipe,\n segmentedControlRecipe,\n SegmentedControlSize,\n} from './SegmentedControl.vanilla.css';\n\nexport type { SegmentedControlSize };\n\nconst joinClassNames = (...classNames: (string | undefined)[]) =>\n classNames.filter(Boolean).join(' ');\n\nconst useCssProp = (css: CSSProps['css'], style?: React.CSSProperties) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n return { ...cssStyles, ...style, ...assignInlineVars(vars) };\n};\n\nconst SegmentedControlContext = createContext<{\n size: SegmentedControlSize;\n fullWidth: boolean;\n}>({ size: 'medium', fullWidth: false });\n\nexport interface SegmentedControlVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'asChild'>, CSSProps {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}\n\nexport const SegmentedControlVanilla = forwardRef<HTMLDivElement, SegmentedControlVanillaProps>(\n ({ size = 'medium', fullWidth = false, className, css, style, children, ...props }, ref) => (\n <SegmentedControlContext.Provider value={{ size, fullWidth }}>\n <RadioGroupPrimitive.Root\n ref={ref}\n orientation=\"horizontal\"\n className={joinClassNames(segmentedControlRecipe({ fullWidth }), className)}\n style={useCssProp(css, style)}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n </SegmentedControlContext.Provider>\n ),\n);\n\nSegmentedControlVanilla.displayName = 'SegmentedControlVanilla';\n\nexport interface SegmentedControlItemVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'>, CSSProps {}\n\nexport const SegmentedControlItemVanilla = forwardRef<\n HTMLButtonElement,\n SegmentedControlItemVanillaProps\n>(({ className, css, style, ...props }, ref) => {\n const { size, fullWidth } = useContext(SegmentedControlContext);\n\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={joinClassNames(segmentedControlItemRecipe({ size, fullWidth }), className)}\n style={useCssProp(css, style)}\n {...props}\n />\n );\n});\n\nSegmentedControlItemVanilla.displayName = 'SegmentedControlItemVanilla';\n"],"mappings":";;;;;;;;;;;AAcA,IAAM,kBAAkB,GAAG,eACzB,WAAW,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AAErC,IAAM,cAAc,KAAsB,UAAgC;CACxE,MAAM,EAAE,WAAWA,qBAAAA,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAASC,iBAAAA,eAAe,KAAK,MAAM;CAC7D,OAAO;EAAE,GAAG;EAAW,GAAG;EAAO,IAAA,GAAGC,yBAAAA,iBAAAA,CAAiB,IAAI;CAAE;AAC7D;AAEA,IAAM,2BAAA,GAA0BC,MAAAA,cAAAA,CAG7B;CAAE,MAAM;CAAU,WAAW;AAAM,CAAC;AAQvC,IAAa,2BAAA,GAA0BC,MAAAA,WAAAA,EACpC,EAAE,OAAO,UAAU,YAAY,OAAO,WAAW,KAAK,OAAO,UAAU,GAAG,SAAS,QAClF,iBAAA,GAAA,kBAAA,IAAA,CAAC,wBAAwB,UAAzB;CAAkC,OAAO;EAAE;EAAM;CAAU;CACzD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,4BAAoB,MAArB;EACO;EACL,aAAY;EACZ,WAAW,eAAeC,qCAAAA,uBAAuB,EAAE,UAAU,CAAC,GAAG,SAAS;EAC1E,OAAO,WAAW,KAAK,KAAK;EAC5B,GAAI;EAEH;CACuB,CAAA;AACM,CAAA,CAEtC;AAEA,wBAAwB,cAAc;AAKtC,IAAa,+BAAA,GAA8BF,MAAAA,WAAAA,EAGxC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC9C,MAAM,EAAE,MAAM,eAAA,GAAcG,MAAAA,WAAAA,CAAW,uBAAuB;CAE9D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,4BAAoB,MAArB;EACO;EACL,WAAW,eAAeG,qCAAAA,2BAA2B;GAAE;GAAM;EAAU,CAAC,GAAG,SAAS;EACpF,OAAO,WAAW,KAAK,KAAK;EAC5B,GAAI;CACL,CAAA;AAEL,CAAC;AAED,4BAA4B,cAAc"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
;/* empty css */
|
|
2
|
+
let _vanilla_extract_recipes_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
3
|
+
// components/SegmentedControl/SegmentedControl.vanilla.css.ts
|
|
4
|
+
var segmentedControlRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
|
|
5
|
+
defaultClassName: "mbhhyo0",
|
|
6
|
+
variantClassNames: { fullWidth: {
|
|
7
|
+
true: "mbhhyo1",
|
|
8
|
+
false: "mbhhyo2"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: { fullWidth: false },
|
|
11
|
+
compoundVariants: []
|
|
12
|
+
});
|
|
13
|
+
var segmentedControlItemRecipe = (0, _vanilla_extract_recipes_createRuntimeFn.createRuntimeFn)({
|
|
14
|
+
defaultClassName: "mbhhyo3",
|
|
15
|
+
variantClassNames: {
|
|
16
|
+
size: {
|
|
17
|
+
small: "mbhhyo4",
|
|
18
|
+
medium: "mbhhyo5",
|
|
19
|
+
large: "mbhhyo6"
|
|
20
|
+
},
|
|
21
|
+
fullWidth: {
|
|
22
|
+
true: "mbhhyo7",
|
|
23
|
+
false: "mbhhyo8"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "medium",
|
|
28
|
+
fullWidth: false
|
|
29
|
+
},
|
|
30
|
+
compoundVariants: []
|
|
31
|
+
});
|
|
32
|
+
exports.segmentedControlItemRecipe = segmentedControlItemRecipe;
|
|
33
|
+
exports.segmentedControlRecipe = segmentedControlRecipe;
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=SegmentedControl.vanilla.css.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.vanilla.css.cjs","names":["_7a468"],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.css.ts"],"sourcesContent":["import { recipe, RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\nexport const segmentedControlRecipe = recipe({\n base: {\n boxSizing: 'border-box',\n display: 'inline-flex',\n alignItems: 'stretch',\n border: `1px solid ${tokens.colors.segmentedControlBorder}`,\n borderRadius: tokens.radii['2'],\n overflow: 'hidden',\n fontFamily: tokens.fonts.rubik,\n },\n\n variants: {\n fullWidth: {\n true: { display: 'flex', width: '100%' },\n false: {},\n },\n },\n\n defaultVariants: {\n fullWidth: false,\n },\n});\n\nexport const segmentedControlItemRecipe = recipe({\n base: {\n boxSizing: 'border-box',\n appearance: 'none',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: tokens.space['2'],\n margin: 0,\n border: 0,\n backgroundColor: 'transparent',\n color: tokens.colors.textSubtle,\n fontFamily: 'inherit',\n fontWeight: tokens.fontWeights.regular,\n lineHeight: 1.3,\n textAlign: 'center',\n cursor: 'pointer',\n transition: 'background-color 120ms ease, color 120ms ease',\n\n selectors: {\n '& + &': {\n borderLeft: `1px solid ${tokens.colors.segmentedControlBorder}`,\n },\n '&:hover:not([data-state=\"checked\"]):not([data-disabled])': {\n backgroundColor: tokens.colors.segmentedControlHoverBg,\n },\n '&[data-state=\"checked\"]': {\n backgroundColor: tokens.colors.segmentedControlActiveBg,\n color: tokens.colors.segmentedControlActiveText,\n },\n '&:focus-visible': {\n outline: `2px solid ${tokens.colors.focusOutline}`,\n outlineOffset: '-2px',\n },\n '&[data-disabled]': {\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n },\n\n '@media': {\n [breakpoints.motion]: {\n transition: 'none',\n },\n },\n },\n\n variants: {\n size: {\n small: {\n minHeight: tokens.sizes['5'],\n paddingInline: tokens.space['2'],\n fontSize: tokens.fontSizes['1'],\n },\n medium: {\n minHeight: tokens.sizes['6'],\n paddingInline: tokens.space['3'],\n fontSize: tokens.fontSizes['2'],\n },\n large: {\n minHeight: tokens.sizes['7'],\n paddingInline: tokens.space['3'],\n fontSize: tokens.fontSizes['3'],\n },\n },\n fullWidth: {\n true: { flex: '1 1 0', minWidth: 0, whiteSpace: 'normal' },\n false: { whiteSpace: 'nowrap' },\n },\n },\n\n defaultVariants: {\n size: 'medium',\n fullWidth: false,\n },\n});\n\nexport type SegmentedControlSize = NonNullable<\n NonNullable<RecipeVariants<typeof segmentedControlItemRecipe>>['size']\n>;\n"],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
|
+
// components/SegmentedControl/SegmentedControl.vanilla.css.ts
|
|
4
|
+
var segmentedControlRecipe = createRuntimeFn({
|
|
5
|
+
defaultClassName: "mbhhyo0",
|
|
6
|
+
variantClassNames: { fullWidth: {
|
|
7
|
+
true: "mbhhyo1",
|
|
8
|
+
false: "mbhhyo2"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: { fullWidth: false },
|
|
11
|
+
compoundVariants: []
|
|
12
|
+
});
|
|
13
|
+
var segmentedControlItemRecipe = createRuntimeFn({
|
|
14
|
+
defaultClassName: "mbhhyo3",
|
|
15
|
+
variantClassNames: {
|
|
16
|
+
size: {
|
|
17
|
+
small: "mbhhyo4",
|
|
18
|
+
medium: "mbhhyo5",
|
|
19
|
+
large: "mbhhyo6"
|
|
20
|
+
},
|
|
21
|
+
fullWidth: {
|
|
22
|
+
true: "mbhhyo7",
|
|
23
|
+
false: "mbhhyo8"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
size: "medium",
|
|
28
|
+
fullWidth: false
|
|
29
|
+
},
|
|
30
|
+
compoundVariants: []
|
|
31
|
+
});
|
|
32
|
+
export { segmentedControlItemRecipe, segmentedControlRecipe };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=SegmentedControl.vanilla.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.vanilla.css.js","names":["_7a468"],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.css.ts"],"sourcesContent":["import { recipe, RecipeVariants } from '@vanilla-extract/recipes';\n\nimport { breakpoints } from '../../styles/breakpoints.css';\nimport { tokens } from '../../styles/tokens.css';\n\nexport const segmentedControlRecipe = recipe({\n base: {\n boxSizing: 'border-box',\n display: 'inline-flex',\n alignItems: 'stretch',\n border: `1px solid ${tokens.colors.segmentedControlBorder}`,\n borderRadius: tokens.radii['2'],\n overflow: 'hidden',\n fontFamily: tokens.fonts.rubik,\n },\n\n variants: {\n fullWidth: {\n true: { display: 'flex', width: '100%' },\n false: {},\n },\n },\n\n defaultVariants: {\n fullWidth: false,\n },\n});\n\nexport const segmentedControlItemRecipe = recipe({\n base: {\n boxSizing: 'border-box',\n appearance: 'none',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: tokens.space['2'],\n margin: 0,\n border: 0,\n backgroundColor: 'transparent',\n color: tokens.colors.textSubtle,\n fontFamily: 'inherit',\n fontWeight: tokens.fontWeights.regular,\n lineHeight: 1.3,\n textAlign: 'center',\n cursor: 'pointer',\n transition: 'background-color 120ms ease, color 120ms ease',\n\n selectors: {\n '& + &': {\n borderLeft: `1px solid ${tokens.colors.segmentedControlBorder}`,\n },\n '&:hover:not([data-state=\"checked\"]):not([data-disabled])': {\n backgroundColor: tokens.colors.segmentedControlHoverBg,\n },\n '&[data-state=\"checked\"]': {\n backgroundColor: tokens.colors.segmentedControlActiveBg,\n color: tokens.colors.segmentedControlActiveText,\n },\n '&:focus-visible': {\n outline: `2px solid ${tokens.colors.focusOutline}`,\n outlineOffset: '-2px',\n },\n '&[data-disabled]': {\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n },\n\n '@media': {\n [breakpoints.motion]: {\n transition: 'none',\n },\n },\n },\n\n variants: {\n size: {\n small: {\n minHeight: tokens.sizes['5'],\n paddingInline: tokens.space['2'],\n fontSize: tokens.fontSizes['1'],\n },\n medium: {\n minHeight: tokens.sizes['6'],\n paddingInline: tokens.space['3'],\n fontSize: tokens.fontSizes['2'],\n },\n large: {\n minHeight: tokens.sizes['7'],\n paddingInline: tokens.space['3'],\n fontSize: tokens.fontSizes['3'],\n },\n },\n fullWidth: {\n true: { flex: '1 1 0', minWidth: 0, whiteSpace: 'normal' },\n false: { whiteSpace: 'nowrap' },\n },\n },\n\n defaultVariants: {\n size: 'medium',\n fullWidth: false,\n },\n});\n\nexport type SegmentedControlSize = NonNullable<\n NonNullable<RecipeVariants<typeof segmentedControlItemRecipe>>['size']\n>;\n"],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { processCSSProp } from "../../styles/cssProps.js";
|
|
2
|
+
import { useVanillaExtractTheme } from "../../styles/themeContext.js";
|
|
3
|
+
import { segmentedControlItemRecipe, segmentedControlRecipe } from "./SegmentedControl.vanilla.css.js";
|
|
4
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
5
|
+
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
8
|
+
// components/SegmentedControl/SegmentedControl.vanilla.tsx
|
|
9
|
+
var joinClassNames = (...classNames) => classNames.filter(Boolean).join(" ");
|
|
10
|
+
var useCssProp = (css, style) => {
|
|
11
|
+
const { colors } = useVanillaExtractTheme();
|
|
12
|
+
const { style: cssStyles, vars } = processCSSProp(css, colors);
|
|
13
|
+
return {
|
|
14
|
+
...cssStyles,
|
|
15
|
+
...style,
|
|
16
|
+
...assignInlineVars(vars)
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
var SegmentedControlContext = createContext({
|
|
20
|
+
size: "medium",
|
|
21
|
+
fullWidth: false
|
|
22
|
+
});
|
|
23
|
+
var SegmentedControlVanilla = forwardRef(({ size = "medium", fullWidth = false, className, css, style, children, ...props }, ref) => /* @__PURE__ */ jsx(SegmentedControlContext.Provider, {
|
|
24
|
+
value: {
|
|
25
|
+
size,
|
|
26
|
+
fullWidth
|
|
27
|
+
},
|
|
28
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
29
|
+
ref,
|
|
30
|
+
orientation: "horizontal",
|
|
31
|
+
className: joinClassNames(segmentedControlRecipe({ fullWidth }), className),
|
|
32
|
+
style: useCssProp(css, style),
|
|
33
|
+
...props,
|
|
34
|
+
children
|
|
35
|
+
})
|
|
36
|
+
}));
|
|
37
|
+
SegmentedControlVanilla.displayName = "SegmentedControlVanilla";
|
|
38
|
+
var SegmentedControlItemVanilla = forwardRef(({ className, css, style, ...props }, ref) => {
|
|
39
|
+
const { size, fullWidth } = useContext(SegmentedControlContext);
|
|
40
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
41
|
+
ref,
|
|
42
|
+
className: joinClassNames(segmentedControlItemRecipe({
|
|
43
|
+
size,
|
|
44
|
+
fullWidth
|
|
45
|
+
}), className),
|
|
46
|
+
style: useCssProp(css, style),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
SegmentedControlItemVanilla.displayName = "SegmentedControlItemVanilla";
|
|
51
|
+
export { SegmentedControlItemVanilla, SegmentedControlVanilla };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=SegmentedControl.vanilla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControl.vanilla.js","names":[],"sources":["../../../components/SegmentedControl/SegmentedControl.vanilla.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport React, { ComponentPropsWithoutRef, createContext, forwardRef, useContext } from 'react';\n\nimport { CSSProps, processCSSProp } from '../../styles/cssProps';\nimport { useVanillaExtractTheme } from '../../styles/themeContext';\nimport {\n segmentedControlItemRecipe,\n segmentedControlRecipe,\n SegmentedControlSize,\n} from './SegmentedControl.vanilla.css';\n\nexport type { SegmentedControlSize };\n\nconst joinClassNames = (...classNames: (string | undefined)[]) =>\n classNames.filter(Boolean).join(' ');\n\nconst useCssProp = (css: CSSProps['css'], style?: React.CSSProperties) => {\n const { colors } = useVanillaExtractTheme();\n const { style: cssStyles, vars } = processCSSProp(css, colors);\n return { ...cssStyles, ...style, ...assignInlineVars(vars) };\n};\n\nconst SegmentedControlContext = createContext<{\n size: SegmentedControlSize;\n fullWidth: boolean;\n}>({ size: 'medium', fullWidth: false });\n\nexport interface SegmentedControlVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, 'asChild'>, CSSProps {\n size?: SegmentedControlSize;\n fullWidth?: boolean;\n}\n\nexport const SegmentedControlVanilla = forwardRef<HTMLDivElement, SegmentedControlVanillaProps>(\n ({ size = 'medium', fullWidth = false, className, css, style, children, ...props }, ref) => (\n <SegmentedControlContext.Provider value={{ size, fullWidth }}>\n <RadioGroupPrimitive.Root\n ref={ref}\n orientation=\"horizontal\"\n className={joinClassNames(segmentedControlRecipe({ fullWidth }), className)}\n style={useCssProp(css, style)}\n {...props}\n >\n {children}\n </RadioGroupPrimitive.Root>\n </SegmentedControlContext.Provider>\n ),\n);\n\nSegmentedControlVanilla.displayName = 'SegmentedControlVanilla';\n\nexport interface SegmentedControlItemVanillaProps\n extends Omit<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'asChild'>, CSSProps {}\n\nexport const SegmentedControlItemVanilla = forwardRef<\n HTMLButtonElement,\n SegmentedControlItemVanillaProps\n>(({ className, css, style, ...props }, ref) => {\n const { size, fullWidth } = useContext(SegmentedControlContext);\n\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={joinClassNames(segmentedControlItemRecipe({ size, fullWidth }), className)}\n style={useCssProp(css, style)}\n {...props}\n />\n );\n});\n\nSegmentedControlItemVanilla.displayName = 'SegmentedControlItemVanilla';\n"],"mappings":";;;;;;;;AAcA,IAAM,kBAAkB,GAAG,eACzB,WAAW,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AAErC,IAAM,cAAc,KAAsB,UAAgC;CACxE,MAAM,EAAE,WAAW,uBAAuB;CAC1C,MAAM,EAAE,OAAO,WAAW,SAAS,eAAe,KAAK,MAAM;CAC7D,OAAO;EAAE,GAAG;EAAW,GAAG;EAAO,GAAG,iBAAiB,IAAI;CAAE;AAC7D;AAEA,IAAM,0BAA0B,cAG7B;CAAE,MAAM;CAAU,WAAW;AAAM,CAAC;AAQvC,IAAa,0BAA0B,YACpC,EAAE,OAAO,UAAU,YAAY,OAAO,WAAW,KAAK,OAAO,UAAU,GAAG,SAAS,QAClF,oBAAC,wBAAwB,UAAzB;CAAkC,OAAO;EAAE;EAAM;CAAU;CACzD,UAAA,oBAAC,oBAAoB,MAArB;EACO;EACL,aAAY;EACZ,WAAW,eAAe,uBAAuB,EAAE,UAAU,CAAC,GAAG,SAAS;EAC1E,OAAO,WAAW,KAAK,KAAK;EAC5B,GAAI;EAEH;CACuB,CAAA;AACM,CAAA,CAEtC;AAEA,wBAAwB,cAAc;AAKtC,IAAa,8BAA8B,YAGxC,EAAE,WAAW,KAAK,OAAO,GAAG,SAAS,QAAQ;CAC9C,MAAM,EAAE,MAAM,cAAc,WAAW,uBAAuB;CAE9D,OACE,oBAAC,oBAAoB,MAArB;EACO;EACL,WAAW,eAAe,2BAA2B;GAAE;GAAM;EAAU,CAAC,GAAG,SAAS;EACpF,OAAO,WAAW,KAAK,KAAK;EAC5B,GAAI;CACL,CAAA;AAEL,CAAC;AAED,4BAA4B,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
3
|
const require_Elevation = require("../Elevation/Elevation.cjs");
|
|
4
|
-
const require_colorSchemeContext = require("../colorSchemeContext.cjs");
|
|
5
4
|
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
2
|
import { elevationVariants } from "../Elevation/Elevation.js";
|
|
3
|
-
import { useColorScheme } from "../colorSchemeContext.js";
|
|
4
3
|
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";
|
|
@@ -84,10 +84,10 @@ var SidePanelCloseIconButton = react.default.forwardRef((props, forwardedRef) =>
|
|
|
84
84
|
ref: forwardedRef,
|
|
85
85
|
css: { color: "$hiContrast" },
|
|
86
86
|
...props,
|
|
87
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.Cross1Icon, {})
|
|
87
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_icons.Cross1Icon, { "aria-hidden": true })
|
|
88
88
|
})
|
|
89
89
|
}));
|
|
90
|
-
var SidePanel = react.default.forwardRef(({ description, noOverlay = false, noCloseIcon = false, children, onOpenChange, open = false, defaultOpen = false, ...props }, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Root, {
|
|
90
|
+
var SidePanel = react.default.forwardRef(({ description, noOverlay = false, noCloseIcon = false, closeLabel = "Close", children, onOpenChange, open = false, defaultOpen = false, ...props }, forwardedRef) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Root, {
|
|
91
91
|
open,
|
|
92
92
|
onOpenChange,
|
|
93
93
|
defaultOpen,
|
|
@@ -100,7 +100,7 @@ var SidePanel = react.default.forwardRef(({ description, noOverlay = false, noCl
|
|
|
100
100
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_dialog.Description, { children: description })
|
|
101
101
|
}) : null,
|
|
102
102
|
children,
|
|
103
|
-
!noCloseIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidePanelCloseIconButton, {})
|
|
103
|
+
!noCloseIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SidePanelCloseIconButton, { "aria-label": closeLabel })
|
|
104
104
|
]
|
|
105
105
|
})] })
|
|
106
106
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.cjs","names":["keyframes","styled","DialogPrimitive","overlayStyles","React","IconButton","Cross1Icon","VisuallyHidden"],"sources":["../../../components/SidePanel/SidePanel.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, keyframes, styled, VariantProps } from '../../stitches.config';\nimport { IconButton } from '../IconButton';\nimport { overlayStyles } from '../Overlay';\n\nconst fadeIn = keyframes({\n from: { opacity: '0' },\n to: { opacity: '1' },\n});\n\nconst fadeOut = keyframes({\n from: { opacity: '1' },\n to: { opacity: '0' },\n});\n\nconst SidePanelOverlay = styled(DialogPrimitive.Overlay, overlayStyles, {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n\n '&[data-state=\"open\"]': {\n animation: `${fadeIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${fadeOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n});\n\nconst slideIn = keyframes({\n from: { transform: '$$transformValue' },\n to: { transform: 'translate3d(0,0,0)' },\n});\n\nconst slideOut = keyframes({\n from: { transform: 'translate3d(0,0,0)' },\n to: { transform: '$$transformValue' },\n});\n\nconst StyledContent = styled(DialogPrimitive.Content, {\n backgroundColor: '$sidePanelBackground',\n boxShadow: 'inset 0 0 0 1px $colors$deepBlue4',\n position: 'fixed',\n top: 0,\n bottom: 0,\n width: 375,\n p: '$4',\n\n '&[data-state=\"open\"]': {\n animation: `${slideIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${slideOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n variants: {\n side: {\n top: {\n $$transformValue: 'translate3d(0,-100%,0)',\n width: '100%',\n height: 250,\n bottom: 'auto',\n },\n right: {\n $$transformValue: 'translate3d(100%,0,0)',\n right: 0,\n maxWidth: '50%',\n },\n bottom: {\n $$transformValue: 'translate3d(0,100%,0)',\n width: '100%',\n height: 250,\n bottom: 0,\n top: 'auto',\n },\n left: {\n $$transformValue: 'translate3d(-100%,0,0)',\n left: 0,\n maxWidth: '50%',\n },\n },\n },\n\n defaultVariants: {\n side: 'right',\n },\n});\n\nconst StyledCloseButton = styled(DialogPrimitive.Close, {\n position: 'absolute',\n top: '$2',\n right: '$2',\n cursor: 'pointer',\n});\n\ninterface SidePanelCloseButtonProps\n extends VariantProps<typeof IconButton
|
|
1
|
+
{"version":3,"file":"SidePanel.cjs","names":["keyframes","styled","DialogPrimitive","overlayStyles","React","IconButton","Cross1Icon","VisuallyHidden"],"sources":["../../../components/SidePanel/SidePanel.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, keyframes, styled, VariantProps } from '../../stitches.config';\nimport { IconButton } from '../IconButton';\nimport { overlayStyles } from '../Overlay';\n\nconst fadeIn = keyframes({\n from: { opacity: '0' },\n to: { opacity: '1' },\n});\n\nconst fadeOut = keyframes({\n from: { opacity: '1' },\n to: { opacity: '0' },\n});\n\nconst SidePanelOverlay = styled(DialogPrimitive.Overlay, overlayStyles, {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n\n '&[data-state=\"open\"]': {\n animation: `${fadeIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${fadeOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n});\n\nconst slideIn = keyframes({\n from: { transform: '$$transformValue' },\n to: { transform: 'translate3d(0,0,0)' },\n});\n\nconst slideOut = keyframes({\n from: { transform: 'translate3d(0,0,0)' },\n to: { transform: '$$transformValue' },\n});\n\nconst StyledContent = styled(DialogPrimitive.Content, {\n backgroundColor: '$sidePanelBackground',\n boxShadow: 'inset 0 0 0 1px $colors$deepBlue4',\n position: 'fixed',\n top: 0,\n bottom: 0,\n width: 375,\n p: '$4',\n\n '&[data-state=\"open\"]': {\n animation: `${slideIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${slideOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n variants: {\n side: {\n top: {\n $$transformValue: 'translate3d(0,-100%,0)',\n width: '100%',\n height: 250,\n bottom: 'auto',\n },\n right: {\n $$transformValue: 'translate3d(100%,0,0)',\n right: 0,\n maxWidth: '50%',\n },\n bottom: {\n $$transformValue: 'translate3d(0,100%,0)',\n width: '100%',\n height: 250,\n bottom: 0,\n top: 'auto',\n },\n left: {\n $$transformValue: 'translate3d(-100%,0,0)',\n left: 0,\n maxWidth: '50%',\n },\n },\n },\n\n defaultVariants: {\n side: 'right',\n },\n});\n\nconst StyledCloseButton = styled(DialogPrimitive.Close, {\n position: 'absolute',\n top: '$2',\n right: '$2',\n cursor: 'pointer',\n});\n\ninterface SidePanelCloseButtonProps\n extends VariantProps<typeof IconButton>, ComponentProps<typeof IconButton> {}\n\nconst SidePanelCloseIconButton = React.forwardRef<\n React.ElementRef<typeof IconButton>,\n SidePanelCloseButtonProps\n>((props, forwardedRef) => (\n <StyledCloseButton asChild>\n <IconButton ref={forwardedRef} css={{ color: '$hiContrast' }} {...props}>\n <Cross1Icon aria-hidden />\n </IconButton>\n </StyledCloseButton>\n));\n\ntype SidePanelContentVariants = VariantProps<typeof StyledContent>;\ntype SidePanelContentPrimitiveProps = React.ComponentProps<typeof DialogPrimitive.Content>;\ntype SidePanelProps = SidePanelContentPrimitiveProps &\n SidePanelContentVariants & {\n css?: CSS;\n description?: string;\n noOverlay?: boolean;\n noCloseIcon?: boolean;\n closeLabel?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange(open: boolean): void;\n };\n\nexport const SidePanel = React.forwardRef<React.ElementRef<typeof StyledContent>, SidePanelProps>(\n (\n {\n description,\n noOverlay = false,\n noCloseIcon = false,\n closeLabel = 'Close',\n children,\n onOpenChange,\n open = false,\n defaultOpen = false,\n ...props\n },\n forwardedRef,\n ) => (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange} defaultOpen={defaultOpen}>\n <DialogPrimitive.Portal>\n {!noOverlay && <SidePanelOverlay />}\n <StyledContent {...props} ref={forwardedRef}>\n {description ? (\n <VisuallyHidden asChild>\n <DialogPrimitive.Description>{description}</DialogPrimitive.Description>\n </VisuallyHidden>\n ) : null}\n {children}\n {!noCloseIcon && <SidePanelCloseIconButton aria-label={closeLabel} />}\n </StyledContent>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n ),\n);\n"],"mappings":";;;;;;;;;;;;AASA,IAAM,SAASA,wBAAAA,UAAU;CACvB,MAAM,EAAE,SAAS,IAAI;CACrB,IAAI,EAAE,SAAS,IAAI;AACrB,CAAC;AAED,IAAM,UAAUA,wBAAAA,UAAU;CACxB,MAAM,EAAE,SAAS,IAAI;CACrB,IAAI,EAAE,SAAS,IAAI;AACrB,CAAC;AAED,IAAM,mBAAmBC,wBAAAA,OAAOC,uBAAgB,SAASC,gBAAAA,eAAe;CACtE,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CAEN,0BAAwB,EACtB,WAAW,GAAG,OAAO,uCACvB;CAEA,4BAA0B,EACxB,WAAW,GAAG,QAAQ,uCACxB;AACF,CAAC;AAED,IAAM,UAAUH,wBAAAA,UAAU;CACxB,MAAM,EAAE,WAAW,mBAAmB;CACtC,IAAI,EAAE,WAAW,qBAAqB;AACxC,CAAC;AAED,IAAM,WAAWA,wBAAAA,UAAU;CACzB,MAAM,EAAE,WAAW,qBAAqB;CACxC,IAAI,EAAE,WAAW,mBAAmB;AACtC,CAAC;AAED,IAAM,gBAAgBC,wBAAAA,OAAOC,uBAAgB,SAAS;CACpD,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,KAAK;CACL,QAAQ;CACR,OAAO;CACP,GAAG;CAEH,0BAAwB,EACtB,WAAW,GAAG,QAAQ,uCACxB;CAEA,4BAA0B,EACxB,WAAW,GAAG,SAAS,uCACzB;CAEA,UAAU,EACR,MAAM;EACJ,KAAK;GACH,kBAAkB;GAClB,OAAO;GACP,QAAQ;GACR,QAAQ;EACV;EACA,OAAO;GACL,kBAAkB;GAClB,OAAO;GACP,UAAU;EACZ;EACA,QAAQ;GACN,kBAAkB;GAClB,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,KAAK;EACP;EACA,MAAM;GACJ,kBAAkB;GAClB,MAAM;GACN,UAAU;EACZ;CACF,EACF;CAEA,iBAAiB,EACf,MAAM,QACR;AACF,CAAC;AAED,IAAM,oBAAoBD,wBAAAA,OAAOC,uBAAgB,OAAO;CACtD,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;AACV,CAAC;AAKD,IAAM,2BAA2BE,MAAAA,QAAM,YAGpC,OAAO,iBACR,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAD;CAAmB,SAAA;CACjB,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;EAAY,KAAK;EAAc,KAAK,EAAE,OAAO,cAAc;EAAG,GAAI;EAChE,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,YAAD,EAAY,eAAA,KAAa,CAAA;CACf,CAAA;AACK,CAAA,CACpB;AAgBD,IAAa,YAAYF,MAAAA,QAAM,YAE3B,EACE,aACA,YAAY,OACZ,cAAc,OACd,aAAa,SACb,UACA,cACA,OAAO,OACP,cAAc,OACd,GAAG,SAEL,iBAEA,iBAAA,GAAA,kBAAA,IAAA,CAACF,uBAAgB,MAAjB;CAA4B;CAAoB;CAA2B;CACzE,UAAA,iBAAA,GAAA,kBAAA,KAAA,CAACA,uBAAgB,QAAjB,EAAA,UAAA,CACG,CAAC,aAAa,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD,CAAmB,CAAA,GAClC,iBAAA,GAAA,kBAAA,KAAA,CAAC,eAAD;EAAe,GAAI;EAAO,KAAK;EAA/B,UAAA;GACG,cACC,iBAAA,GAAA,kBAAA,IAAA,CAACK,gCAAAA,gBAAD;IAAgB,SAAA;IACd,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACL,uBAAgB,aAAjB,EAAA,UAA8B,YAAyC,CAAA;GACzD,CAAA,IACd;GACH;GACA,CAAC,eAAe,iBAAA,GAAA,kBAAA,IAAA,CAAC,0BAAD,EAA0B,cAAY,WAAa,CAAA;EACvD;CACO,CAAA,CAAA,EAAA,CAAA;AACJ,CAAA,CAE1B"}
|
|
@@ -81,10 +81,10 @@ var SidePanelCloseIconButton = React.forwardRef((props, forwardedRef) => /* @__P
|
|
|
81
81
|
ref: forwardedRef,
|
|
82
82
|
css: { color: "$hiContrast" },
|
|
83
83
|
...props,
|
|
84
|
-
children: /* @__PURE__ */ jsx(Cross1Icon, {})
|
|
84
|
+
children: /* @__PURE__ */ jsx(Cross1Icon, { "aria-hidden": true })
|
|
85
85
|
})
|
|
86
86
|
}));
|
|
87
|
-
var SidePanel = React.forwardRef(({ description, noOverlay = false, noCloseIcon = false, children, onOpenChange, open = false, defaultOpen = false, ...props }, forwardedRef) => /* @__PURE__ */ jsx(DialogPrimitive.Root, {
|
|
87
|
+
var SidePanel = React.forwardRef(({ description, noOverlay = false, noCloseIcon = false, closeLabel = "Close", children, onOpenChange, open = false, defaultOpen = false, ...props }, forwardedRef) => /* @__PURE__ */ jsx(DialogPrimitive.Root, {
|
|
88
88
|
open,
|
|
89
89
|
onOpenChange,
|
|
90
90
|
defaultOpen,
|
|
@@ -97,7 +97,7 @@ var SidePanel = React.forwardRef(({ description, noOverlay = false, noCloseIcon
|
|
|
97
97
|
children: /* @__PURE__ */ jsx(DialogPrimitive.Description, { children: description })
|
|
98
98
|
}) : null,
|
|
99
99
|
children,
|
|
100
|
-
!noCloseIcon && /* @__PURE__ */ jsx(SidePanelCloseIconButton, {})
|
|
100
|
+
!noCloseIcon && /* @__PURE__ */ jsx(SidePanelCloseIconButton, { "aria-label": closeLabel })
|
|
101
101
|
]
|
|
102
102
|
})] })
|
|
103
103
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.js","names":[],"sources":["../../../components/SidePanel/SidePanel.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, keyframes, styled, VariantProps } from '../../stitches.config';\nimport { IconButton } from '../IconButton';\nimport { overlayStyles } from '../Overlay';\n\nconst fadeIn = keyframes({\n from: { opacity: '0' },\n to: { opacity: '1' },\n});\n\nconst fadeOut = keyframes({\n from: { opacity: '1' },\n to: { opacity: '0' },\n});\n\nconst SidePanelOverlay = styled(DialogPrimitive.Overlay, overlayStyles, {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n\n '&[data-state=\"open\"]': {\n animation: `${fadeIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${fadeOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n});\n\nconst slideIn = keyframes({\n from: { transform: '$$transformValue' },\n to: { transform: 'translate3d(0,0,0)' },\n});\n\nconst slideOut = keyframes({\n from: { transform: 'translate3d(0,0,0)' },\n to: { transform: '$$transformValue' },\n});\n\nconst StyledContent = styled(DialogPrimitive.Content, {\n backgroundColor: '$sidePanelBackground',\n boxShadow: 'inset 0 0 0 1px $colors$deepBlue4',\n position: 'fixed',\n top: 0,\n bottom: 0,\n width: 375,\n p: '$4',\n\n '&[data-state=\"open\"]': {\n animation: `${slideIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${slideOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n variants: {\n side: {\n top: {\n $$transformValue: 'translate3d(0,-100%,0)',\n width: '100%',\n height: 250,\n bottom: 'auto',\n },\n right: {\n $$transformValue: 'translate3d(100%,0,0)',\n right: 0,\n maxWidth: '50%',\n },\n bottom: {\n $$transformValue: 'translate3d(0,100%,0)',\n width: '100%',\n height: 250,\n bottom: 0,\n top: 'auto',\n },\n left: {\n $$transformValue: 'translate3d(-100%,0,0)',\n left: 0,\n maxWidth: '50%',\n },\n },\n },\n\n defaultVariants: {\n side: 'right',\n },\n});\n\nconst StyledCloseButton = styled(DialogPrimitive.Close, {\n position: 'absolute',\n top: '$2',\n right: '$2',\n cursor: 'pointer',\n});\n\ninterface SidePanelCloseButtonProps\n extends VariantProps<typeof IconButton
|
|
1
|
+
{"version":3,"file":"SidePanel.js","names":[],"sources":["../../../components/SidePanel/SidePanel.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport React, { ComponentProps } from 'react';\n\nimport { CSS, keyframes, styled, VariantProps } from '../../stitches.config';\nimport { IconButton } from '../IconButton';\nimport { overlayStyles } from '../Overlay';\n\nconst fadeIn = keyframes({\n from: { opacity: '0' },\n to: { opacity: '1' },\n});\n\nconst fadeOut = keyframes({\n from: { opacity: '1' },\n to: { opacity: '0' },\n});\n\nconst SidePanelOverlay = styled(DialogPrimitive.Overlay, overlayStyles, {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n\n '&[data-state=\"open\"]': {\n animation: `${fadeIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${fadeOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n});\n\nconst slideIn = keyframes({\n from: { transform: '$$transformValue' },\n to: { transform: 'translate3d(0,0,0)' },\n});\n\nconst slideOut = keyframes({\n from: { transform: 'translate3d(0,0,0)' },\n to: { transform: '$$transformValue' },\n});\n\nconst StyledContent = styled(DialogPrimitive.Content, {\n backgroundColor: '$sidePanelBackground',\n boxShadow: 'inset 0 0 0 1px $colors$deepBlue4',\n position: 'fixed',\n top: 0,\n bottom: 0,\n width: 375,\n p: '$4',\n\n '&[data-state=\"open\"]': {\n animation: `${slideIn} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n '&[data-state=\"closed\"]': {\n animation: `${slideOut} 150ms cubic-bezier(0.22, 1, 0.36, 1)`,\n },\n\n variants: {\n side: {\n top: {\n $$transformValue: 'translate3d(0,-100%,0)',\n width: '100%',\n height: 250,\n bottom: 'auto',\n },\n right: {\n $$transformValue: 'translate3d(100%,0,0)',\n right: 0,\n maxWidth: '50%',\n },\n bottom: {\n $$transformValue: 'translate3d(0,100%,0)',\n width: '100%',\n height: 250,\n bottom: 0,\n top: 'auto',\n },\n left: {\n $$transformValue: 'translate3d(-100%,0,0)',\n left: 0,\n maxWidth: '50%',\n },\n },\n },\n\n defaultVariants: {\n side: 'right',\n },\n});\n\nconst StyledCloseButton = styled(DialogPrimitive.Close, {\n position: 'absolute',\n top: '$2',\n right: '$2',\n cursor: 'pointer',\n});\n\ninterface SidePanelCloseButtonProps\n extends VariantProps<typeof IconButton>, ComponentProps<typeof IconButton> {}\n\nconst SidePanelCloseIconButton = React.forwardRef<\n React.ElementRef<typeof IconButton>,\n SidePanelCloseButtonProps\n>((props, forwardedRef) => (\n <StyledCloseButton asChild>\n <IconButton ref={forwardedRef} css={{ color: '$hiContrast' }} {...props}>\n <Cross1Icon aria-hidden />\n </IconButton>\n </StyledCloseButton>\n));\n\ntype SidePanelContentVariants = VariantProps<typeof StyledContent>;\ntype SidePanelContentPrimitiveProps = React.ComponentProps<typeof DialogPrimitive.Content>;\ntype SidePanelProps = SidePanelContentPrimitiveProps &\n SidePanelContentVariants & {\n css?: CSS;\n description?: string;\n noOverlay?: boolean;\n noCloseIcon?: boolean;\n closeLabel?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange(open: boolean): void;\n };\n\nexport const SidePanel = React.forwardRef<React.ElementRef<typeof StyledContent>, SidePanelProps>(\n (\n {\n description,\n noOverlay = false,\n noCloseIcon = false,\n closeLabel = 'Close',\n children,\n onOpenChange,\n open = false,\n defaultOpen = false,\n ...props\n },\n forwardedRef,\n ) => (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange} defaultOpen={defaultOpen}>\n <DialogPrimitive.Portal>\n {!noOverlay && <SidePanelOverlay />}\n <StyledContent {...props} ref={forwardedRef}>\n {description ? (\n <VisuallyHidden asChild>\n <DialogPrimitive.Description>{description}</DialogPrimitive.Description>\n </VisuallyHidden>\n ) : null}\n {children}\n {!noCloseIcon && <SidePanelCloseIconButton aria-label={closeLabel} />}\n </StyledContent>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n ),\n);\n"],"mappings":";;;;;;;;;AASA,IAAM,SAAS,UAAU;CACvB,MAAM,EAAE,SAAS,IAAI;CACrB,IAAI,EAAE,SAAS,IAAI;AACrB,CAAC;AAED,IAAM,UAAU,UAAU;CACxB,MAAM,EAAE,SAAS,IAAI;CACrB,IAAI,EAAE,SAAS,IAAI;AACrB,CAAC;AAED,IAAM,mBAAmB,OAAO,gBAAgB,SAAS,eAAe;CACtE,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;CACR,MAAM;CAEN,0BAAwB,EACtB,WAAW,GAAG,OAAO,uCACvB;CAEA,4BAA0B,EACxB,WAAW,GAAG,QAAQ,uCACxB;AACF,CAAC;AAED,IAAM,UAAU,UAAU;CACxB,MAAM,EAAE,WAAW,mBAAmB;CACtC,IAAI,EAAE,WAAW,qBAAqB;AACxC,CAAC;AAED,IAAM,WAAW,UAAU;CACzB,MAAM,EAAE,WAAW,qBAAqB;CACxC,IAAI,EAAE,WAAW,mBAAmB;AACtC,CAAC;AAED,IAAM,gBAAgB,OAAO,gBAAgB,SAAS;CACpD,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,KAAK;CACL,QAAQ;CACR,OAAO;CACP,GAAG;CAEH,0BAAwB,EACtB,WAAW,GAAG,QAAQ,uCACxB;CAEA,4BAA0B,EACxB,WAAW,GAAG,SAAS,uCACzB;CAEA,UAAU,EACR,MAAM;EACJ,KAAK;GACH,kBAAkB;GAClB,OAAO;GACP,QAAQ;GACR,QAAQ;EACV;EACA,OAAO;GACL,kBAAkB;GAClB,OAAO;GACP,UAAU;EACZ;EACA,QAAQ;GACN,kBAAkB;GAClB,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,KAAK;EACP;EACA,MAAM;GACJ,kBAAkB;GAClB,MAAM;GACN,UAAU;EACZ;CACF,EACF;CAEA,iBAAiB,EACf,MAAM,QACR;AACF,CAAC;AAED,IAAM,oBAAoB,OAAO,gBAAgB,OAAO;CACtD,UAAU;CACV,KAAK;CACL,OAAO;CACP,QAAQ;AACV,CAAC;AAKD,IAAM,2BAA2B,MAAM,YAGpC,OAAO,iBACR,oBAAC,mBAAD;CAAmB,SAAA;CACjB,UAAA,oBAAC,YAAD;EAAY,KAAK;EAAc,KAAK,EAAE,OAAO,cAAc;EAAG,GAAI;EAChE,UAAA,oBAAC,YAAD,EAAY,eAAA,KAAa,CAAA;CACf,CAAA;AACK,CAAA,CACpB;AAgBD,IAAa,YAAY,MAAM,YAE3B,EACE,aACA,YAAY,OACZ,cAAc,OACd,aAAa,SACb,UACA,cACA,OAAO,OACP,cAAc,OACd,GAAG,SAEL,iBAEA,oBAAC,gBAAgB,MAAjB;CAA4B;CAAoB;CAA2B;CACzE,UAAA,qBAAC,gBAAgB,QAAjB,EAAA,UAAA,CACG,CAAC,aAAa,oBAAC,kBAAD,CAAmB,CAAA,GAClC,qBAAC,eAAD;EAAe,GAAI;EAAO,KAAK;EAA/B,UAAA;GACG,cACC,oBAAC,gBAAD;IAAgB,SAAA;IACd,UAAA,oBAAC,gBAAgB,aAAjB,EAAA,UAA8B,YAAyC,CAAA;GACzD,CAAA,IACd;GACH;GACA,CAAC,eAAe,oBAAC,0BAAD,EAA0B,cAAY,WAAa,CAAA;EACvD;CACO,CAAA,CAAA,EAAA,CAAA;AACJ,CAAA,CAE1B"}
|
|
@@ -33,6 +33,10 @@ var Skeleton = require_stitches_config.styled("div", {
|
|
|
33
33
|
right: 0,
|
|
34
34
|
top: 0
|
|
35
35
|
},
|
|
36
|
+
"@motion": { "&::after": {
|
|
37
|
+
animation: "none",
|
|
38
|
+
opacity: 0
|
|
39
|
+
} },
|
|
36
40
|
variants: { variant: {
|
|
37
41
|
square: { borderRadius: "$2" },
|
|
38
42
|
circle: { borderRadius: "$round" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.cjs","names":["keyframes","styled"],"sources":["../../../components/Skeleton/Skeleton.tsx"],"sourcesContent":["import { keyframes, styled, VariantProps } from '../../stitches.config';\n\nconst pulse = keyframes({\n '0%': { opacity: 0 },\n '100%': { opacity: '100%' },\n});\n\nexport const Skeleton = styled('div', {\n backgroundColor: '$skeletonBackground',\n position: 'relative',\n overflow: 'hidden',\n borderRadius: '3px',\n height: 'auto',\n width: 'auto',\n '&:not(:empty)': {\n '& > *': {\n visibility: 'hidden',\n display: 'block',\n },\n maxWidth: 'fit-content',\n },\n\n '&::after': {\n animationName: `${pulse}`,\n animationDuration: '500ms',\n animationDirection: 'alternate',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'ease-in-out',\n backgroundColor: '$skeletonAnimation',\n borderRadius: 'inherit',\n bottom: 0,\n content: '\"\"',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n\n variants: {\n variant: {\n square: {\n borderRadius: '$2',\n },\n circle: {\n borderRadius: '$round',\n },\n badge: {\n borderRadius: '$pill',\n display: 'inline-flex',\n },\n button: {\n borderRadius: '$3',\n display: 'inline-flex',\n },\n text: {\n '&:empty:before': {\n content: '\"\\\\00a0\"', // adds a space character before element\n },\n },\n },\n },\n defaultVariants: {\n variant: 'text',\n },\n});\n\nexport type SkeletonVariants = VariantProps<typeof Skeleton>;\nexport type SkeletonProps = SkeletonVariants & NonNullable<unknown>;\n"],"mappings":";;AAEA,IAAM,QAAQA,wBAAAA,UAAU;CACtB,MAAM,EAAE,SAAS,EAAE;CACnB,QAAQ,EAAE,SAAS,OAAO;AAC5B,CAAC;AAED,IAAa,WAAWC,wBAAAA,OAAO,OAAO;CACpC,iBAAiB;CACjB,UAAU;CACV,UAAU;CACV,cAAc;CACd,QAAQ;CACR,OAAO;CACP,iBAAiB;EACf,SAAS;GACP,YAAY;GACZ,SAAS;EACX;EACA,UAAU;CACZ;CAEA,YAAY;EACV,eAAe,GAAG;EAClB,mBAAmB;EACnB,oBAAoB;EACpB,yBAAyB;EACzB,yBAAyB;EACzB,iBAAiB;EACjB,cAAc;EACd,QAAQ;EACR,SAAS;EACT,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;CACP;CAEA,UAAU,EACR,SAAS;EACP,QAAQ,EACN,cAAc,KAChB;EACA,QAAQ,EACN,cAAc,SAChB;EACA,OAAO;GACL,cAAc;GACd,SAAS;EACX;EACA,QAAQ;GACN,cAAc;GACd,SAAS;EACX;EACA,MAAM,EACJ,kBAAkB,EAChB,SAAS,aACX,EACF;CACF,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"Skeleton.cjs","names":["keyframes","styled"],"sources":["../../../components/Skeleton/Skeleton.tsx"],"sourcesContent":["import { keyframes, styled, VariantProps } from '../../stitches.config';\n\nconst pulse = keyframes({\n '0%': { opacity: 0 },\n '100%': { opacity: '100%' },\n});\n\nexport const Skeleton = styled('div', {\n backgroundColor: '$skeletonBackground',\n position: 'relative',\n overflow: 'hidden',\n borderRadius: '3px',\n height: 'auto',\n width: 'auto',\n '&:not(:empty)': {\n '& > *': {\n visibility: 'hidden',\n display: 'block',\n },\n maxWidth: 'fit-content',\n },\n\n '&::after': {\n animationName: `${pulse}`,\n animationDuration: '500ms',\n animationDirection: 'alternate',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'ease-in-out',\n backgroundColor: '$skeletonAnimation',\n borderRadius: 'inherit',\n bottom: 0,\n content: '\"\"',\n left: 0,\n position: 'absolute',\n right: 0,\n top: 0,\n },\n\n '@motion': {\n '&::after': {\n animation: 'none',\n opacity: 0,\n },\n },\n\n variants: {\n variant: {\n square: {\n borderRadius: '$2',\n },\n circle: {\n borderRadius: '$round',\n },\n badge: {\n borderRadius: '$pill',\n display: 'inline-flex',\n },\n button: {\n borderRadius: '$3',\n display: 'inline-flex',\n },\n text: {\n '&:empty:before': {\n content: '\"\\\\00a0\"', // adds a space character before element\n },\n },\n },\n },\n defaultVariants: {\n variant: 'text',\n },\n});\n\nexport type SkeletonVariants = VariantProps<typeof Skeleton>;\nexport type SkeletonProps = SkeletonVariants & NonNullable<unknown>;\n"],"mappings":";;AAEA,IAAM,QAAQA,wBAAAA,UAAU;CACtB,MAAM,EAAE,SAAS,EAAE;CACnB,QAAQ,EAAE,SAAS,OAAO;AAC5B,CAAC;AAED,IAAa,WAAWC,wBAAAA,OAAO,OAAO;CACpC,iBAAiB;CACjB,UAAU;CACV,UAAU;CACV,cAAc;CACd,QAAQ;CACR,OAAO;CACP,iBAAiB;EACf,SAAS;GACP,YAAY;GACZ,SAAS;EACX;EACA,UAAU;CACZ;CAEA,YAAY;EACV,eAAe,GAAG;EAClB,mBAAmB;EACnB,oBAAoB;EACpB,yBAAyB;EACzB,yBAAyB;EACzB,iBAAiB;EACjB,cAAc;EACd,QAAQ;EACR,SAAS;EACT,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;CACP;CAEA,WAAW,EACT,YAAY;EACV,WAAW;EACX,SAAS;CACX,EACF;CAEA,UAAU,EACR,SAAS;EACP,QAAQ,EACN,cAAc,KAChB;EACA,QAAQ,EACN,cAAc,SAChB;EACA,OAAO;GACL,cAAc;GACd,SAAS;EACX;EACA,QAAQ;GACN,cAAc;GACd,SAAS;EACX;EACA,MAAM,EACJ,kBAAkB,EAChB,SAAS,aACX,EACF;CACF,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC"}
|