@ada-cx/lovelace 1.13.0 → 1.15.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/AttachmentChip/AttachmentChip.css.js.map +1 -1
- package/dist/components/Banner/Banner.css.d.ts +19 -1
- package/dist/components/Banner/Banner.css.js +12 -2
- package/dist/components/Banner/Banner.css.js.map +1 -1
- package/dist/components/Banner/Banner.d.ts +22 -40
- package/dist/components/Banner/Banner.js +22 -19
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Banner/BannerContainer.d.ts +35 -0
- package/dist/components/Banner/BannerContainer.js +38 -0
- package/dist/components/Banner/BannerContainer.js.map +1 -0
- package/dist/components/Banner/BannerContainerSlide.d.ts +15 -0
- package/dist/components/Banner/BannerContainerSlide.js +26 -0
- package/dist/components/Banner/BannerContainerSlide.js.map +1 -0
- package/dist/components/Banner/index.d.ts +2 -1
- package/dist/components/Button/Button.css.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.css.js.map +1 -1
- package/dist/components/Chip/Chip.css.js.map +1 -1
- package/dist/components/Dialog/Dialog.css.js.map +1 -1
- package/dist/components/Divider/Divider.css.js.map +1 -1
- package/dist/components/DropZone/DropZone.css.js.map +1 -1
- package/dist/components/Header/Header.css.js.map +1 -1
- package/dist/components/Header/HeaderTitle.d.ts +13 -4
- package/dist/components/Header/HeaderTitle.js +9 -7
- package/dist/components/Header/HeaderTitle.js.map +1 -1
- package/dist/components/Icon/icons/CheckmarkCircle.d.ts +2 -0
- package/dist/components/Icon/icons/CheckmarkCircle.js +14 -0
- package/dist/components/Icon/icons/CheckmarkCircle.js.map +1 -0
- package/dist/components/Icon/icons/index.d.ts +1 -0
- package/dist/components/Input/Input.css.js.map +1 -1
- package/dist/components/Link/Link.css.js.map +1 -1
- package/dist/components/MessageError/MessageError.css.js.map +1 -1
- package/dist/components/PillButton/PillButton.css.js.map +1 -1
- package/dist/components/ProactiveMessage/ProactiveMessage.css.js.map +1 -1
- package/dist/components/Radio/Radio.css.js.map +1 -1
- package/dist/components/ScrollMarker/ScrollMarker.css.js.map +1 -1
- package/dist/components/Sheet/Sheet.css.js.map +1 -1
- package/dist/components/Survey/SurveyRating/SurveyRating.css.js.map +1 -1
- package/dist/components/Text/Text.css.d.ts +13 -0
- package/dist/components/Text/Text.css.js +28 -0
- package/dist/components/Text/Text.css.js.map +1 -0
- package/dist/components/Text/Text.d.ts +30 -0
- package/dist/components/Text/Text.js +17 -0
- package/dist/components/Text/Text.js.map +1 -0
- package/dist/components/Text/index.d.ts +3 -0
- package/dist/components/ThinkingShimmer/ThinkingShimmer.css.js.map +1 -1
- package/dist/components/Toast/Toast.css.d.ts +36 -0
- package/dist/components/Toast/Toast.css.js +19 -0
- package/dist/components/Toast/Toast.css.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +52 -0
- package/dist/components/Toast/Toast.js +59 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/ToastContainer.d.ts +48 -0
- package/dist/components/Toast/ToastContainer.js +104 -0
- package/dist/components/Toast/ToastContainer.js.map +1 -0
- package/dist/components/{ToastRegion/ToastContent.d.ts → Toast/ToastItem.d.ts} +7 -2
- package/dist/components/Toast/index.d.ts +6 -0
- package/dist/components/{ToastRegion → Toast}/index.js +2 -1
- package/dist/components/Tooltip/Tooltip.css.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +70 -67
- package/dist/style.css +1 -1
- package/dist/styles/typography.d.ts +32 -0
- package/dist/utils/animation.d.ts +0 -16
- package/dist/utils/animation.js +24 -50
- package/dist/utils/animation.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/Banner/BannerSurface.d.ts +0 -17
- package/dist/components/Banner/BannerSurface.js +0 -65
- package/dist/components/Banner/BannerSurface.js.map +0 -1
- package/dist/components/ToastNotification/ToastNotification.css.d.ts +0 -17
- package/dist/components/ToastNotification/ToastNotification.css.js +0 -17
- package/dist/components/ToastNotification/ToastNotification.css.js.map +0 -1
- package/dist/components/ToastNotification/ToastNotification.d.ts +0 -55
- package/dist/components/ToastNotification/ToastNotification.js +0 -42
- package/dist/components/ToastNotification/ToastNotification.js.map +0 -1
- package/dist/components/ToastNotification/index.d.ts +0 -2
- package/dist/components/ToastRegion/ToastRegion.css.d.ts +0 -2
- package/dist/components/ToastRegion/ToastRegion.css.js +0 -7
- package/dist/components/ToastRegion/ToastRegion.css.js.map +0 -1
- package/dist/components/ToastRegion/ToastRegion.d.ts +0 -45
- package/dist/components/ToastRegion/ToastRegion.js +0 -38
- package/dist/components/ToastRegion/ToastRegion.js.map +0 -1
- package/dist/components/ToastRegion/ToastRegionItem.d.ts +0 -13
- package/dist/components/ToastRegion/ToastRegionItem.js +0 -49
- package/dist/components/ToastRegion/ToastRegionItem.js.map +0 -1
- package/dist/components/ToastRegion/ToastRegionLandmark.d.ts +0 -15
- package/dist/components/ToastRegion/ToastRegionLandmark.js +0 -62
- package/dist/components/ToastRegion/ToastRegionLandmark.js.map +0 -1
- package/dist/components/ToastRegion/index.d.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentChip.css.js","names":[],"sources":["../../../src/components/AttachmentChip/AttachmentChip.css.ts"],"sourcesContent":["import type { ComplexStyleRule } from \"@vanilla-extract/css\";\nimport { globalStyle, style } from \"@vanilla-extract/css\";\nimport type { RuntimeFn } from \"@vanilla-extract/recipes\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\nconst attachmentChipBase = style({});\n\n/**\n * Figma pins each chip's frame height, the way it pins other control heights —\n * literals, with no size tier to route them through. The file chip is 40px: its\n * 24px thumbnail plus the 8px padding leaves nothing to trim. The summary chip\n * carries a 22px icon instead, and the composer draws it at 36px.\n */\nconst FILE_CHIP_HEIGHT = \"40px\";\nconst SUMMARY_CHIP_HEIGHT = \"36px\";\n\n/**\n * The cap the filename ellipsises against. Figma pins it on the file chip only;\n * the summary sizes to its own label, so a count is never clipped.\n */\nconst FILE_CHIP_MAX_WIDTH = \"148px\";\n\n/**\n * Annotated `string` deliberately: `t()` returns a template-literal type per\n * token, and four of them concatenated exceed what tsc will represent\n * (TS2590).\n */\nconst CHIP_SHADOW: string = `0 ${t(\"elevation-2-offset-y\")} ${t(\"elevation-2-blur\")} ${t(\"elevation-2-spread\")} ${t(\"elevation-2-color\")}`;\n\nexport const attachmentChipRoot: RuntimeFn<{\n\tinteractive: Record<\"true\" | \"false\", ComplexStyleRule>;\n}> = recipe({\n\tbase: [\n\t\tattachmentChipBase,\n\t\t{\n\t\t\tdisplay: \"flex\",\n\t\t\talignItems: \"center\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tgap: t(\"gap-8\"),\n\t\t\tminWidth: 0,\n\t\t\tpadding: t(\"padding-8\"),\n\t\t\toverflow: \"hidden\",\n\t\t\tborderRadius: t(\"border-radius-6\"),\n\t\t\tborder: 0,\n\t\t\tbackgroundColor: t(\"color-background-quaternary\"),\n\t\t\tcolor: t(\"color-content-default\"),\n\t\t\
|
|
1
|
+
{"version":3,"file":"AttachmentChip.css.js","names":[],"sources":["../../../src/components/AttachmentChip/AttachmentChip.css.ts"],"sourcesContent":["import type { ComplexStyleRule } from \"@vanilla-extract/css\";\nimport { globalStyle, style } from \"@vanilla-extract/css\";\nimport type { RuntimeFn } from \"@vanilla-extract/recipes\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { typography } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\nconst attachmentChipBase = style({});\n\n/**\n * Figma pins each chip's frame height, the way it pins other control heights —\n * literals, with no size tier to route them through. The file chip is 40px: its\n * 24px thumbnail plus the 8px padding leaves nothing to trim. The summary chip\n * carries a 22px icon instead, and the composer draws it at 36px.\n */\nconst FILE_CHIP_HEIGHT = \"40px\";\nconst SUMMARY_CHIP_HEIGHT = \"36px\";\n\n/**\n * The cap the filename ellipsises against. Figma pins it on the file chip only;\n * the summary sizes to its own label, so a count is never clipped.\n */\nconst FILE_CHIP_MAX_WIDTH = \"148px\";\n\n/**\n * Annotated `string` deliberately: `t()` returns a template-literal type per\n * token, and four of them concatenated exceed what tsc will represent\n * (TS2590).\n */\nconst CHIP_SHADOW: string = `0 ${t(\"elevation-2-offset-y\")} ${t(\"elevation-2-blur\")} ${t(\"elevation-2-spread\")} ${t(\"elevation-2-color\")}`;\n\nexport const attachmentChipRoot: RuntimeFn<{\n\tinteractive: Record<\"true\" | \"false\", ComplexStyleRule>;\n}> = recipe({\n\tbase: [\n\t\tattachmentChipBase,\n\t\t{\n\t\t\tdisplay: \"flex\",\n\t\t\talignItems: \"center\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tgap: t(\"gap-8\"),\n\t\t\tminWidth: 0,\n\t\t\tpadding: t(\"padding-8\"),\n\t\t\toverflow: \"hidden\",\n\t\t\tborderRadius: t(\"border-radius-6\"),\n\t\t\tborder: 0,\n\t\t\tbackgroundColor: t(\"color-background-quaternary\"),\n\t\t\tcolor: t(\"color-content-default\"),\n\t\t\t...typography(\"body\", \"regular\"),\n\t\t\ttextAlign: \"start\",\n\t\t\tappearance: \"none\",\n\t\t\tboxShadow: CHIP_SHADOW,\n\t\t},\n\t],\n\tvariants: {\n\t\t/**\n\t\t * Off, the chip is a plain container whose trailing button is the only\n\t\t * control — Figma's file chip, capped so a long filename ellipsises. On,\n\t\t * the chip itself is the control — Figma's summary chip, which has no\n\t\t * trailing button, sizes to its label, and so takes the shared state\n\t\t * layer.\n\t\t */\n\t\tinteractive: {\n\t\t\ttrue: {\n\t\t\t\theight: SUMMARY_CHIP_HEIGHT,\n\t\t\t\tposition: \"relative\",\n\t\t\t\tisolation: \"isolate\",\n\t\t\t\tcursor: \"pointer\",\n\t\t\t\toutline: \"none\",\n\t\t\t\t\"::after\": {\n\t\t\t\t\tcontent: '\"\"',\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\tinset: 0,\n\t\t\t\t\tborderRadius: \"inherit\",\n\t\t\t\t\tbackgroundColor: \"currentColor\",\n\t\t\t\t\topacity: 0,\n\t\t\t\t\tpointerEvents: \"none\",\n\t\t\t\t\tzIndex: -1,\n\t\t\t\t\ttransition: `opacity ${t(\"duration-fast\")} ${t(\"easing-standard\")}`,\n\t\t\t\t},\n\t\t\t\tselectors: {\n\t\t\t\t\t\"&[data-hovered]::after\": { opacity: t(\"opacity-state-hover\") },\n\t\t\t\t\t\"&[data-focus-visible]::after\": { opacity: t(\"opacity-state-focus\") },\n\t\t\t\t\t\"&[data-pressed]::after\": { opacity: t(\"opacity-state-pressed\") },\n\t\t\t\t\t\"&[data-focus-visible]\": {\n\t\t\t\t\t\toutline: `2px solid ${t(\"color-border-focus\")}`,\n\t\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"@media\": {\n\t\t\t\t\t// A token-based ring is flattened away in High Contrast, so the\n\t\t\t\t\t// focus state needs a system colour to survive it.\n\t\t\t\t\t\"(forced-colors: active)\": {\n\t\t\t\t\t\tselectors: {\n\t\t\t\t\t\t\t\"&[data-focus-visible]\": {\n\t\t\t\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tfalse: {\n\t\t\t\theight: FILE_CHIP_HEIGHT,\n\t\t\t\tmaxWidth: FILE_CHIP_MAX_WIDTH,\n\t\t\t},\n\t\t},\n\t},\n\tdefaultVariants: { interactive: false },\n});\n\n/**\n * Fixed box for the leading slot so a thumbnail, a spinner and an icon all\n * occupy the same 24px square — otherwise the chip's contents shift as an\n * upload settles and the stand-in gives way to the image.\n */\nexport const attachmentChipMedia = style({\n\tdisplay: \"inline-flex\",\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tflexShrink: 0,\n\twidth: \"24px\",\n\theight: \"24px\",\n\tborderRadius: t(\"border-radius-6\"),\n\toverflow: \"hidden\",\n});\n\n/**\n * A thumbnail fills the box; an icon sits at 22px inside it, as Figma draws\n * it — and on the chip's own background, with no backing of its own.\n */\nglobalStyle(`${attachmentChipMedia} [data-slot=\"icon\"]`, {\n\tfontSize: t(\"icon-size-control\"),\n});\n\nexport const attachmentChipThumbnail = style({\n\twidth: \"100%\",\n\theight: \"100%\",\n\tobjectFit: \"cover\",\n});\n\nexport const attachmentChipLabel = style({\n\tminWidth: 0,\n\toverflow: \"hidden\",\n\ttextOverflow: \"ellipsis\",\n\twhiteSpace: \"nowrap\",\n\twordBreak: \"break-word\",\n});\n"],"mappings":""}
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const bannerRoot: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
2
|
+
status: {
|
|
3
|
+
success: {
|
|
4
|
+
backgroundColor: "var(--lovelace-color-background-success-light)";
|
|
5
|
+
color: "var(--lovelace-color-content-success)";
|
|
6
|
+
};
|
|
7
|
+
warning: {
|
|
8
|
+
backgroundColor: "var(--lovelace-color-background-warning-light)";
|
|
9
|
+
color: "var(--lovelace-color-content-warning)";
|
|
10
|
+
};
|
|
11
|
+
error: {
|
|
12
|
+
backgroundColor: "var(--lovelace-color-background-destructive-light)";
|
|
13
|
+
color: "var(--lovelace-color-content-destructive)";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export declare const bannerMessage: string;
|
|
18
|
+
export declare const bannerContainer: string;
|
|
19
|
+
export declare const bannerContainerSlide: string;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
+
import { createRuntimeFn as e } from "../../vendor/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js";
|
|
1
2
|
/* empty css */
|
|
2
3
|
//#region src/components/Banner/Banner.css.ts
|
|
3
|
-
var
|
|
4
|
+
var t = e({
|
|
5
|
+
defaultClassName: "fpbgjm1 fpbgjm0",
|
|
6
|
+
variantClassNames: { status: {
|
|
7
|
+
success: "fpbgjm2",
|
|
8
|
+
warning: "fpbgjm3",
|
|
9
|
+
error: "fpbgjm4"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { status: "success" },
|
|
12
|
+
compoundVariants: []
|
|
13
|
+
}), n = "fpbgjm5", r = "fpbgjm6", i = "fpbgjm7";
|
|
4
14
|
//#endregion
|
|
5
|
-
export {
|
|
15
|
+
export { r as bannerContainer, i as bannerContainerSlide, n as bannerMessage, t as bannerRoot };
|
|
6
16
|
|
|
7
17
|
//# sourceMappingURL=Banner.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.css.js","names":[],"sources":["../../../src/components/Banner/Banner.css.ts"],"sourcesContent":["import { style } from \"@vanilla-extract/css\";\nimport { t } from \"../../tokens/index.js\";\n\
|
|
1
|
+
{"version":3,"file":"Banner.css.js","names":[],"sources":["../../../src/components/Banner/Banner.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\nconst bannerBase = style({\n\tdisplay: \"flex\",\n\tgap: t(\"gap-8\"),\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tboxSizing: \"border-box\",\n\twidth: \"100%\",\n\tpaddingInline: t(\"padding-12\"),\n\tpaddingBlock: t(\"padding-8\"),\n\tfontFamily: t(\"font-family-body\"),\n\tfontWeight: t(\"font-weight-medium\"),\n\tfontSize: t(\"font-size-body\"),\n\tlineHeight: t(\"line-height-body\"),\n\toverflowWrap: \"break-word\",\n});\n\nexport const bannerRoot = recipe({\n\tbase: bannerBase,\n\tvariants: {\n\t\tstatus: {\n\t\t\tsuccess: {\n\t\t\t\tbackgroundColor: t(\"color-background-success-light\"),\n\t\t\t\tcolor: t(\"color-content-success\"),\n\t\t\t},\n\t\t\twarning: {\n\t\t\t\tbackgroundColor: t(\"color-background-warning-light\"),\n\t\t\t\tcolor: t(\"color-content-warning\"),\n\t\t\t},\n\t\t\terror: {\n\t\t\t\tbackgroundColor: t(\"color-background-destructive-light\"),\n\t\t\t\tcolor: t(\"color-content-destructive\"),\n\t\t\t},\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tstatus: \"success\",\n\t},\n});\n\n// Shrinks to its text rather than filling the row, so a message that fits sits\n// in a cluster the row centres. One that does not fill takes the width that is\n// left and wraps against its own leading edge, which is the multi-line variant.\nexport const bannerMessage = style({\n\tminWidth: 0,\n});\n\nglobalStyle(`${bannerBase} > [data-slot='icon']`, {\n\tfontSize: t(\"icon-size-control\"),\n\tflexShrink: 0,\n});\n\n// Clips the banner's travel. The banner slides in and out of the container's\n// leading edge, so whatever the container is anchored to needs no offset that\n// has to track the chrome above it.\nexport const bannerContainer = style({\n\toverflow: \"hidden\",\n});\n\n// Typed as a plain string: `t()` returns a union of every token name, and a\n// two-property template literal over two of them explodes past what tsc can\n// represent.\nconst slideTransition: string = `transform ${t(\"duration-medium\")} ${t(\n\t\"easing-standard\",\n)}, opacity ${t(\"duration-fast\")} ${t(\"easing-standard\")}`;\n\nexport const bannerContainerSlide = style({\n\tselectors: {\n\t\t\"&[data-entering]\": { transform: \"translateY(-100%)\" },\n\t\t\"&[data-exiting]\": { transform: \"translateY(-100%)\" },\n\t\t// One condition replacing another is a change of message on the same slot,\n\t\t// so the banner fades through the change instead of sliding. Sliding would\n\t\t// report a condition leaving and another arriving, which is not what the\n\t\t// chatter's situation did.\n\t\t\"&[data-swapping]\": { opacity: 0 },\n\t},\n\t\"@media\": {\n\t\t\"(prefers-reduced-motion: no-preference)\": {\n\t\t\ttransition: slideTransition,\n\t\t},\n\t},\n});\n"],"mappings":""}
|
|
@@ -1,51 +1,33 @@
|
|
|
1
|
-
import type { CSSProperties, Ref } from "react";
|
|
2
|
-
|
|
1
|
+
import type { CSSProperties, ReactNode, Ref } from "react";
|
|
2
|
+
export type BannerStatus = "success" | "warning" | "error";
|
|
3
3
|
export interface BannerProps {
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
5
|
+
* The outcome being reported. It selects the background and content color
|
|
6
|
+
* pair, and the urgency `BannerContainer` announces it with. Bind it to the
|
|
7
|
+
* result of the action, not the UI.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The outcome being reported. Also picks the urgency: `error` interrupts as an
|
|
11
|
-
* assertive `alert`, anything else waits its turn as a polite `status`.
|
|
12
|
-
*/
|
|
13
|
-
status?: ToastStatus;
|
|
14
|
-
/** Whether the condition currently holds. */
|
|
15
|
-
visible: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* A counter that advances whenever the condition is reported again. Pass it for
|
|
18
|
-
* a condition that can repeat with the same wording: without it the second
|
|
19
|
-
* report changes nothing in the live region, so a reader never hears it.
|
|
20
|
-
*/
|
|
21
|
-
revision?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Runs when the reader presses dismiss, and renders the button. Clear the state
|
|
24
|
-
* behind `visible` here, or the next change to that state raises the banner
|
|
25
|
-
* again. Omit it for a condition the reader cannot act on.
|
|
26
|
-
*/
|
|
27
|
-
onDismiss?: () => void;
|
|
28
|
-
/** Accessible name for the dismiss button. Localize it. */
|
|
29
|
-
dismissLabel?: string;
|
|
9
|
+
status?: BannerStatus;
|
|
30
10
|
className?: string;
|
|
31
11
|
style?: CSSProperties;
|
|
32
12
|
ref?: Ref<HTMLDivElement>;
|
|
13
|
+
/**
|
|
14
|
+
* The message to display. A status icon is rendered automatically, so the
|
|
15
|
+
* status is conveyed without color perception; for screen-reader users the
|
|
16
|
+
* icon is decorative, so include the status in the copy when the message
|
|
17
|
+
* alone wouldn't make the outcome clear.
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
33
20
|
}
|
|
34
21
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* Pass `onDismiss` only when the reader is meant to act on the condition; a banner
|
|
40
|
-
* bound purely to state offers no control, because only that state takes it down.
|
|
41
|
-
* Either way, read a durable field, never one a dismissal elsewhere can clear — a
|
|
42
|
-
* banner wired to a dismissible field disappears while its condition still holds.
|
|
22
|
+
* The full-width status-tinted strip for a lasting condition. The message stays
|
|
23
|
+
* while the condition holds, rather than the floating card `Toast` paints for a
|
|
24
|
+
* passing event. The two differ on purpose: a strip reads as part of the page, a
|
|
25
|
+
* card as passing through.
|
|
43
26
|
*
|
|
44
|
-
*
|
|
45
|
-
* so pick the condition to show rather than stacking them. For a finished event
|
|
46
|
-
* rather than a condition, use `ToastRegion`.
|
|
27
|
+
* It carries no control, because only the condition behind it takes it down.
|
|
47
28
|
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
29
|
+
* Purely presentational: it owns no live region, so rendering it standalone
|
|
30
|
+
* announces nothing. Put it in a `BannerContainer`, which owns the announcement
|
|
31
|
+
* and the motion.
|
|
50
32
|
*/
|
|
51
|
-
export declare function Banner({
|
|
33
|
+
export declare function Banner({ status, className, children, ...rest }: BannerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cx as e } from "../../utils/cx.js";
|
|
2
|
+
import { Checkmark as t } from "../Icon/icons/Checkmark.js";
|
|
3
|
+
import { ExclamationTriangle as n } from "../Icon/icons/ExclamationTriangle.js";
|
|
4
|
+
import { XmarkCircle as r } from "../Icon/icons/XmarkCircle.js";
|
|
5
|
+
import { bannerMessage as i, bannerRoot as a } from "./Banner.css.js";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
7
|
//#region src/components/Banner/Banner.tsx
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
var c = {
|
|
9
|
+
success: t,
|
|
10
|
+
warning: n,
|
|
11
|
+
error: r
|
|
12
|
+
};
|
|
13
|
+
function l({ status: t = "success", className: n, children: r, ...l }) {
|
|
14
|
+
let u = c[t];
|
|
15
|
+
return /* @__PURE__ */ s("div", {
|
|
16
|
+
...l,
|
|
17
|
+
"data-status": t,
|
|
18
|
+
className: e(a({ status: t }), n),
|
|
19
|
+
children: [/* @__PURE__ */ o(u, {}), /* @__PURE__ */ o("span", {
|
|
20
|
+
className: i,
|
|
21
|
+
children: r
|
|
22
|
+
})]
|
|
20
23
|
});
|
|
21
24
|
}
|
|
22
25
|
//#endregion
|
|
23
|
-
export {
|
|
26
|
+
export { l as Banner };
|
|
24
27
|
|
|
25
28
|
//# sourceMappingURL=Banner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","names":[],"sources":["../../../src/components/Banner/Banner.tsx"],"sourcesContent":["import type { CSSProperties, Ref } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"Banner.js","names":[],"sources":["../../../src/components/Banner/Banner.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode, Ref } from \"react\";\nimport { cx } from \"../../utils/cx.js\";\nimport {\n\tCheckmark,\n\tExclamationTriangle,\n\tXmarkCircle,\n} from \"../Icon/icons/index.js\";\nimport { bannerMessage, bannerRoot } from \"./Banner.css.js\";\n\nexport type BannerStatus = \"success\" | \"warning\" | \"error\";\n\nconst STATUS_ICON = {\n\tsuccess: Checkmark,\n\twarning: ExclamationTriangle,\n\terror: XmarkCircle,\n} as const;\n\nexport interface BannerProps {\n\t/**\n\t * The outcome being reported. It selects the background and content color\n\t * pair, and the urgency `BannerContainer` announces it with. Bind it to the\n\t * result of the action, not the UI.\n\t */\n\tstatus?: BannerStatus;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLDivElement>;\n\t/**\n\t * The message to display. A status icon is rendered automatically, so the\n\t * status is conveyed without color perception; for screen-reader users the\n\t * icon is decorative, so include the status in the copy when the message\n\t * alone wouldn't make the outcome clear.\n\t */\n\tchildren?: ReactNode;\n}\n\n/**\n * The full-width status-tinted strip for a lasting condition. The message stays\n * while the condition holds, rather than the floating card `Toast` paints for a\n * passing event. The two differ on purpose: a strip reads as part of the page, a\n * card as passing through.\n *\n * It carries no control, because only the condition behind it takes it down.\n *\n * Purely presentational: it owns no live region, so rendering it standalone\n * announces nothing. Put it in a `BannerContainer`, which owns the announcement\n * and the motion.\n */\nexport function Banner({\n\tstatus = \"success\",\n\tclassName,\n\tchildren,\n\t...rest\n}: BannerProps) {\n\tconst StatusIcon = STATUS_ICON[status];\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tdata-status={status}\n\t\t\tclassName={cx(bannerRoot({ status }), className)}\n\t\t>\n\t\t\t<StatusIcon />\n\t\t\t<span className={bannerMessage}>{children}</span>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAWA,IAAM,IAAc;CACnB,SAAS;CACT,SAAS;CACT,OAAO;CACP;AAiCD,SAAgB,EAAO,EACtB,YAAS,WACT,cACA,aACA,GAAG,KACY;CACf,IAAM,IAAa,EAAY;AAC/B,QACC,kBAAC,OAAD;EACC,GAAI;EACJ,eAAa;EACb,WAAW,EAAG,EAAW,EAAE,WAAQ,CAAC,EAAE,EAAU;YAHjD,CAKC,kBAAC,GAAD,EAAc,CAAA,EACd,kBAAC,QAAD;GAAM,WAAW;GAAgB;GAAgB,CAAA,CAC5C"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement, Ref } from "react";
|
|
2
|
+
import type { BannerProps } from "./Banner.js";
|
|
3
|
+
export interface BannerContainerProps {
|
|
4
|
+
/**
|
|
5
|
+
* The `Banner` for the condition that currently holds, or null when none
|
|
6
|
+
* does. Pick the one to show before handing it over: the container holds a
|
|
7
|
+
* single banner, and on a narrow surface a second one buries the content
|
|
8
|
+
* behind it.
|
|
9
|
+
*/
|
|
10
|
+
children: ReactElement<BannerProps> | null;
|
|
11
|
+
/**
|
|
12
|
+
* Identifies the condition on screen. Change it whenever the reader should
|
|
13
|
+
* hear the banner again: the same condition happening a second time with the
|
|
14
|
+
* same wording, a different condition taking the slot, or a change of status.
|
|
15
|
+
* A change hides the region for a frame and reveals it, which is what makes
|
|
16
|
+
* wording the reader has already heard read out again. Leaving it alone still
|
|
17
|
+
* replaces the text, and the live region reports that change on its own.
|
|
18
|
+
*/
|
|
19
|
+
occurrence?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
ref?: Ref<HTMLDivElement>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Announces and animates one `Banner`.
|
|
26
|
+
*
|
|
27
|
+
* It owns the live region, so the region is mounted and empty before any banner
|
|
28
|
+
* arrives. A live region that mounts with its text already in place is never
|
|
29
|
+
* announced. Urgency follows the banner's status: `error` interrupts as an
|
|
30
|
+
* assertive `alert`, anything else waits its turn as a polite `status`.
|
|
31
|
+
*
|
|
32
|
+
* Mount it for as long as the surface exists and drive it with `children`. It
|
|
33
|
+
* clips its own banner's travel, so the consumer needs no `overflow` rule.
|
|
34
|
+
*/
|
|
35
|
+
export declare function BannerContainer({ children, occurrence, className, style, ref, }: BannerContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cx as e } from "../../utils/cx.js";
|
|
2
|
+
import { bannerContainer as t } from "./Banner.css.js";
|
|
3
|
+
import { BannerContainerSlide as n } from "./BannerContainerSlide.js";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { useCallback as i, useEffect as a, useState as o } from "react";
|
|
6
|
+
//#region src/components/Banner/BannerContainer.tsx
|
|
7
|
+
function s({ children: s, occurrence: c, className: l, style: u, ref: d }) {
|
|
8
|
+
let f = s !== null, [p, m] = o(s), [h, g] = o(f), [_, v] = o(f ? "arrival" : "none"), [y, b] = o(c), x = h;
|
|
9
|
+
f && p !== s && m(s), f && !h && g(!0), y !== c && (b(c), f && x && v("swap")), a(() => {
|
|
10
|
+
if (_ === "none") return;
|
|
11
|
+
let e = 0, t = requestAnimationFrame(() => {
|
|
12
|
+
e = requestAnimationFrame(() => v("none"));
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
cancelAnimationFrame(t), cancelAnimationFrame(e);
|
|
16
|
+
};
|
|
17
|
+
}, [_]);
|
|
18
|
+
let S = i(() => g(!1), []), C = h && p?.props.status === "error", w = h ? "status" : void 0;
|
|
19
|
+
return /* @__PURE__ */ r("div", {
|
|
20
|
+
ref: d,
|
|
21
|
+
className: e(t, l),
|
|
22
|
+
style: u,
|
|
23
|
+
role: C ? "alert" : w,
|
|
24
|
+
"aria-live": C ? "assertive" : "polite",
|
|
25
|
+
"aria-atomic": "true",
|
|
26
|
+
"aria-hidden": _ === "none" ? void 0 : "true",
|
|
27
|
+
children: h && /* @__PURE__ */ r(n, {
|
|
28
|
+
isPresent: f,
|
|
29
|
+
isSwapping: _ === "swap",
|
|
30
|
+
onExited: S,
|
|
31
|
+
children: p
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { s as BannerContainer };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=BannerContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerContainer.js","names":[],"sources":["../../../src/components/Banner/BannerContainer.tsx"],"sourcesContent":["import type { CSSProperties, ReactElement, Ref } from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { cx } from \"../../utils/cx.js\";\nimport { bannerContainer } from \"./Banner.css.js\";\nimport type { BannerProps } from \"./Banner.js\";\nimport { BannerContainerSlide } from \"./BannerContainerSlide.js\";\n\nexport interface BannerContainerProps {\n\t/**\n\t * The `Banner` for the condition that currently holds, or null when none\n\t * does. Pick the one to show before handing it over: the container holds a\n\t * single banner, and on a narrow surface a second one buries the content\n\t * behind it.\n\t */\n\tchildren: ReactElement<BannerProps> | null;\n\t/**\n\t * Identifies the condition on screen. Change it whenever the reader should\n\t * hear the banner again: the same condition happening a second time with the\n\t * same wording, a different condition taking the slot, or a change of status.\n\t * A change hides the region for a frame and reveals it, which is what makes\n\t * wording the reader has already heard read out again. Leaving it alone still\n\t * replaces the text, and the live region reports that change on its own.\n\t */\n\toccurrence?: string;\n\tclassName?: string;\n\tstyle?: CSSProperties;\n\tref?: Ref<HTMLDivElement>;\n}\n\n/** Why the live region is hidden for a frame, or `none` while it is not. */\ntype Reveal = \"none\" | \"arrival\" | \"swap\";\n\n/**\n * Announces and animates one `Banner`.\n *\n * It owns the live region, so the region is mounted and empty before any banner\n * arrives. A live region that mounts with its text already in place is never\n * announced. Urgency follows the banner's status: `error` interrupts as an\n * assertive `alert`, anything else waits its turn as a polite `status`.\n *\n * Mount it for as long as the surface exists and drive it with `children`. It\n * clips its own banner's travel, so the consumer needs no `overflow` rule.\n */\nexport function BannerContainer({\n\tchildren,\n\toccurrence,\n\tclassName,\n\tstyle,\n\tref,\n}: BannerContainerProps) {\n\tconst isPresent = children !== null;\n\n\t// Derive during render rather than in an effect. An effect runs after the\n\t// commit that already dropped the banner, so its exit animation would be\n\t// missed. The previous values are state rather than refs because React can\n\t// discard a render, which would keep a ref write but drop the update beside\n\t// it.\n\tconst [held, setHeld] = useState(children);\n\tconst [isShowing, setIsShowing] = useState(isPresent);\n\tconst [reveal, setReveal] = useState<Reveal>(isPresent ? \"arrival\" : \"none\");\n\tconst [lastOccurrence, setLastOccurrence] = useState(occurrence);\n\n\tconst wasShowing = isShowing;\n\tif (isPresent && held !== children) {\n\t\tsetHeld(children);\n\t}\n\tif (isPresent && !isShowing) {\n\t\tsetIsShowing(true);\n\t}\n\tif (lastOccurrence !== occurrence) {\n\t\tsetLastOccurrence(occurrence);\n\t\t// A banner arriving into an empty region is already a mutation the reader\n\t\t// hears, so only one replacing another has to be re-announced.\n\t\tif (isPresent && wasShowing) {\n\t\t\tsetReveal(\"swap\");\n\t\t}\n\t}\n\n\tuseEffect(() => {\n\t\tif (reveal === \"none\") {\n\t\t\treturn;\n\t\t}\n\t\t// Two frames: the first is the one the hidden state paints in, and clearing\n\t\t// the flag before that paint leaves the fade with nothing to run from.\n\t\tlet secondFrame = 0;\n\t\tconst frame = requestAnimationFrame(() => {\n\t\t\tsecondFrame = requestAnimationFrame(() => setReveal(\"none\"));\n\t\t});\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tcancelAnimationFrame(secondFrame);\n\t\t};\n\t}, [reveal]);\n\n\tconst handleExited = useCallback(() => setIsShowing(false), []);\n\n\t// Read off the banner on screen rather than the last one held. A region that\n\t// keeps a role with nothing in it reports a condition that has cleared, and it\n\t// answers to a consumer looking for whichever banner does hold.\n\tconst isError = isShowing && held?.props.status === \"error\";\n\tconst politeRole = isShowing ? \"status\" : undefined;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cx(bannerContainer, className)}\n\t\t\tstyle={style}\n\t\t\trole={isError ? \"alert\" : politeRole}\n\t\t\taria-live={isError ? \"assertive\" : \"polite\"}\n\t\t\taria-atomic=\"true\"\n\t\t\taria-hidden={reveal === \"none\" ? undefined : \"true\"}\n\t\t>\n\t\t\t{isShowing && (\n\t\t\t\t<BannerContainerSlide\n\t\t\t\t\tisPresent={isPresent}\n\t\t\t\t\tisSwapping={reveal === \"swap\"}\n\t\t\t\t\tonExited={handleExited}\n\t\t\t\t>\n\t\t\t\t\t{held}\n\t\t\t\t</BannerContainerSlide>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AA2CA,SAAgB,EAAgB,EAC/B,aACA,eACA,cACA,UACA,UACwB;CACxB,IAAM,IAAY,MAAa,MAOzB,CAAC,GAAM,KAAW,EAAS,EAAS,EACpC,CAAC,GAAW,KAAgB,EAAS,EAAU,EAC/C,CAAC,GAAQ,KAAa,EAAiB,IAAY,YAAY,OAAO,EACtE,CAAC,GAAgB,KAAqB,EAAS,EAAW,EAE1D,IAAa;AAgBnB,CAfI,KAAa,MAAS,KACzB,EAAQ,EAAS,EAEd,KAAa,CAAC,KACjB,EAAa,GAAK,EAEf,MAAmB,MACtB,EAAkB,EAAW,EAGzB,KAAa,KAChB,EAAU,OAAO,GAInB,QAAgB;AACf,MAAI,MAAW,OACd;EAID,IAAI,IAAc,GACZ,IAAQ,4BAA4B;AACzC,OAAc,4BAA4B,EAAU,OAAO,CAAC;IAC3D;AACF,eAAa;AAEZ,GADA,qBAAqB,EAAM,EAC3B,qBAAqB,EAAY;;IAEhC,CAAC,EAAO,CAAC;CAEZ,IAAM,IAAe,QAAkB,EAAa,GAAM,EAAE,EAAE,CAAC,EAKzD,IAAU,KAAa,GAAM,MAAM,WAAW,SAC9C,IAAa,IAAY,WAAW,KAAA;AAE1C,QACC,kBAAC,OAAD;EACM;EACL,WAAW,EAAG,GAAiB,EAAU;EAClC;EACP,MAAM,IAAU,UAAU;EAC1B,aAAW,IAAU,cAAc;EACnC,eAAY;EACZ,eAAa,MAAW,SAAS,KAAA,IAAY;YAE5C,KACA,kBAAC,GAAD;GACY;GACX,YAAY,MAAW;GACvB,UAAU;aAET;GACqB,CAAA;EAEnB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface BannerContainerSlideProps {
|
|
3
|
+
/** False once the condition clears, which starts the exit animation. */
|
|
4
|
+
isPresent: boolean;
|
|
5
|
+
/** Whether the banner on screen is being replaced by another. */
|
|
6
|
+
isSwapping: boolean;
|
|
7
|
+
/** Runs when the exit animation finishes and the banner can be unmounted. */
|
|
8
|
+
onExited: () => void;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Carries the banner's motion. Mounted for as long as a banner is on screen, so
|
|
13
|
+
* the enter animation runs on each arrival rather than once per container.
|
|
14
|
+
*/
|
|
15
|
+
export declare function BannerContainerSlide({ isPresent, isSwapping, onExited, children, }: BannerContainerSlideProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { bannerContainerSlide as e } from "./Banner.css.js";
|
|
2
|
+
import { useEnterAnimation as t, useExitAnimation as n } from "../../utils/animation.js";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as i, useRef as a } from "react";
|
|
5
|
+
//#region src/components/Banner/BannerContainerSlide.tsx
|
|
6
|
+
function o({ isPresent: o, isSwapping: s, onExited: c, children: l }) {
|
|
7
|
+
let u = a(null), d = t(u), f = n(u, o);
|
|
8
|
+
return i(() => {
|
|
9
|
+
!o && !f && c();
|
|
10
|
+
}, [
|
|
11
|
+
o,
|
|
12
|
+
f,
|
|
13
|
+
c
|
|
14
|
+
]), /* @__PURE__ */ r("div", {
|
|
15
|
+
ref: u,
|
|
16
|
+
className: e,
|
|
17
|
+
"data-entering": d || void 0,
|
|
18
|
+
"data-exiting": f || void 0,
|
|
19
|
+
"data-swapping": s || void 0,
|
|
20
|
+
children: l
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { o as BannerContainerSlide };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=BannerContainerSlide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerContainerSlide.js","names":[],"sources":["../../../src/components/Banner/BannerContainerSlide.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useEffect, useRef } from \"react\";\nimport { useEnterAnimation, useExitAnimation } from \"../../utils/animation.js\";\nimport { bannerContainerSlide } from \"./Banner.css.js\";\n\nexport interface BannerContainerSlideProps {\n\t/** False once the condition clears, which starts the exit animation. */\n\tisPresent: boolean;\n\t/** Whether the banner on screen is being replaced by another. */\n\tisSwapping: boolean;\n\t/** Runs when the exit animation finishes and the banner can be unmounted. */\n\tonExited: () => void;\n\tchildren: ReactNode;\n}\n\n/**\n * Carries the banner's motion. Mounted for as long as a banner is on screen, so\n * the enter animation runs on each arrival rather than once per container.\n */\nexport function BannerContainerSlide({\n\tisPresent,\n\tisSwapping,\n\tonExited,\n\tchildren,\n}: BannerContainerSlideProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst isEntering = useEnterAnimation(ref);\n\tconst isExiting = useExitAnimation(ref, isPresent);\n\n\tuseEffect(() => {\n\t\tif (!isPresent && !isExiting) {\n\t\t\tonExited();\n\t\t}\n\t}, [isPresent, isExiting, onExited]);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={bannerContainerSlide}\n\t\t\tdata-entering={isEntering || undefined}\n\t\t\tdata-exiting={isExiting || undefined}\n\t\t\tdata-swapping={isSwapping || undefined}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;AAmBA,SAAgB,EAAqB,EACpC,cACA,eACA,aACA,eAC6B;CAC7B,IAAM,IAAM,EAAuB,KAAK,EAClC,IAAa,EAAkB,EAAI,EACnC,IAAY,EAAiB,GAAK,EAAU;AAQlD,QANA,QAAgB;AACf,EAAI,CAAC,KAAa,CAAC,KAClB,GAAU;IAET;EAAC;EAAW;EAAW;EAAS,CAAC,EAGnC,kBAAC,OAAD;EACM;EACL,WAAW;EACX,iBAAe,KAAc,KAAA;EAC7B,gBAAc,KAAa,KAAA;EAC3B,iBAAe,KAAc,KAAA;EAE5B;EACI,CAAA"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Banner, type BannerProps } from "./Banner.js";
|
|
1
|
+
export { Banner, type BannerProps, type BannerStatus } from "./Banner.js";
|
|
2
|
+
export { BannerContainer, type BannerContainerProps, } from "./BannerContainer.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.css.js","names":[],"sources":["../../../src/components/Button/Button.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\nconst buttonBase = style({});\n\nexport const buttonRoot = recipe({\n\tbase: [\n\t\tbuttonBase,\n\t\t{\n\t\t\tposition: \"relative\",\n\t\t\tisolation: \"isolate\",\n\t\t\tdisplay: \"inline-flex\",\n\t\t\talignItems: \"center\",\n\t\t\tjustifyContent: \"center\",\n\t\t\tgap: t(\"gap-8\"),\n\t\t\tpaddingInline: t(\"padding-12\"),\n\t\t\tboxSizing: \"border-box\",\n\t\t\tborder: `${t(\"border-width-default\")} solid transparent`,\n\t\t\tborderRadius: t(\"border-radius-button\"),\n\t\t\
|
|
1
|
+
{"version":3,"file":"Button.css.js","names":[],"sources":["../../../src/components/Button/Button.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { typography } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\nconst buttonBase = style({});\n\nexport const buttonRoot = recipe({\n\tbase: [\n\t\tbuttonBase,\n\t\t{\n\t\t\tposition: \"relative\",\n\t\t\tisolation: \"isolate\",\n\t\t\tdisplay: \"inline-flex\",\n\t\t\talignItems: \"center\",\n\t\t\tjustifyContent: \"center\",\n\t\t\tgap: t(\"gap-8\"),\n\t\t\tpaddingInline: t(\"padding-12\"),\n\t\t\tboxSizing: \"border-box\",\n\t\t\tborder: `${t(\"border-width-default\")} solid transparent`,\n\t\t\tborderRadius: t(\"border-radius-button\"),\n\t\t\t...typography(\"body\", \"medium\"),\n\t\t\twhiteSpace: \"nowrap\",\n\t\t\tcursor: \"pointer\",\n\t\t\tuserSelect: \"none\",\n\t\t\tappearance: \"none\",\n\t\t\ttextDecoration: \"none\",\n\t\t\toutline: \"none\",\n\t\t\ttransitionProperty: \"background-color, border-color\",\n\t\t\ttransitionDuration: t(\"duration-fast\"),\n\t\t\ttransitionTimingFunction: t(\"easing-standard\"),\n\t\t\t\"::after\": {\n\t\t\t\tcontent: '\"\"',\n\t\t\t\tposition: \"absolute\",\n\t\t\t\tinset: 0,\n\t\t\t\tborderRadius: \"inherit\",\n\t\t\t\tbackgroundColor: \"currentColor\",\n\t\t\t\topacity: 0,\n\t\t\t\tpointerEvents: \"none\",\n\t\t\t\tzIndex: -1,\n\t\t\t\ttransition: `opacity ${t(\"duration-fast\")} ${t(\"easing-standard\")}`,\n\t\t\t},\n\t\t\tselectors: {\n\t\t\t\t\"&[data-hovered]:not([data-disabled])::after\": {\n\t\t\t\t\topacity: t(\"opacity-state-hover\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-focus-visible]:not([data-disabled])::after\": {\n\t\t\t\t\topacity: t(\"opacity-state-focus\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-pressed]:not([data-disabled])::after\": {\n\t\t\t\t\topacity: t(\"opacity-state-pressed\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}`,\n\t\t\t\t},\n\t\t\t\t\"&[data-disabled]\": {\n\t\t\t\t\tcursor: \"not-allowed\",\n\t\t\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"@media\": {\n\t\t\t\t\"(forced-colors: active)\": {\n\t\t\t\t\tselectors: {\n\t\t\t\t\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tvariants: {\n\t\tintent: {\n\t\t\tprimary: {\n\t\t\t\tbackgroundColor: t(\"button-primary-background\"),\n\t\t\t\tcolor: t(\"button-primary-content\"),\n\t\t\t\tselectors: {\n\t\t\t\t\t\"&[data-disabled]\": {\n\t\t\t\t\t\tbackgroundColor: t(\"color-background-disabled\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"primary-destructive\": {\n\t\t\t\tbackgroundColor: t(\"color-background-destructive\"),\n\t\t\t\tcolor: t(\"color-content-on-destructive\"),\n\t\t\t\tselectors: {\n\t\t\t\t\t\"&[data-disabled]\": {\n\t\t\t\t\t\tbackgroundColor: t(\"color-background-disabled\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\tbackgroundColor: t(\"color-background-default\"),\n\t\t\t\tcolor: t(\"color-content-default\"),\n\t\t\t\tborderColor: t(\"color-border-default\"),\n\t\t\t},\n\t\t\t\"secondary-destructive\": {\n\t\t\t\tbackgroundColor: t(\"color-background-default\"),\n\t\t\t\tcolor: t(\"color-content-destructive\"),\n\t\t\t\tborderColor: t(\"color-border-destructive\"),\n\t\t\t},\n\t\t\ttertiary: {\n\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\tcolor: t(\"color-content-default\"),\n\t\t\t},\n\t\t\t\"tertiary-destructive\": {\n\t\t\t\tbackgroundColor: \"transparent\",\n\t\t\t\tcolor: t(\"color-content-destructive\"),\n\t\t\t},\n\t\t},\n\t\t// Hardcoded heights are correct.\n\t\tsize: {\n\t\t\tmd: { height: \"40px\" },\n\t\t\tsm: { height: \"32px\" },\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tintent: \"primary\",\n\t\tsize: \"md\",\n\t},\n});\n\nglobalStyle(`${buttonBase} [data-slot='icon']`, {\n\tflexShrink: 0,\n\tfontSize: t(\"icon-size-control\"),\n});\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.css.js","names":[],"sources":["../../../src/components/Checkbox/Checkbox.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport {\n\tcontrolRowFrame,\n\tcontrolRowSlotRules,\n} from \"../../styles/control-row.js\";\nimport { t } from \"../../tokens/index.js\";\n\n// 24px box + 16px glyph mirror Figma's fixed frame sizes (button-size/xs,\n// icon-size/md), which the token set does not expose as spacing values.\nconst BOX_SIZE = \"24px\";\nconst GLYPH_SIZE = \"16px\";\n\nexport const checkboxGroup = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tgap: t(\"gap-20\"),\n});\n\n// Empty handle classes: a recipe can't target a descendant, so the row variant's\n// slot rules are attached to a stable class instead (same trick as Button's base).\nconst checkboxRowBase = style({});\n\n/**\n * The RAC `Checkbox` label. `inline` lays the box out beside an optional label;\n * `row` is the 40px selectable row Figma draws for a menu item, for a\n * `CheckboxGroup` rendered as a list of options.\n */\nexport const checkboxRoot = recipe({\n\tbase: {\n\t\
|
|
1
|
+
{"version":3,"file":"Checkbox.css.js","names":[],"sources":["../../../src/components/Checkbox/Checkbox.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport {\n\tcontrolRowFrame,\n\tcontrolRowSlotRules,\n} from \"../../styles/control-row.js\";\nimport { typography } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\n// 24px box + 16px glyph mirror Figma's fixed frame sizes (button-size/xs,\n// icon-size/md), which the token set does not expose as spacing values.\nconst BOX_SIZE = \"24px\";\nconst GLYPH_SIZE = \"16px\";\n\nexport const checkboxGroup = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tgap: t(\"gap-20\"),\n});\n\n// Empty handle classes: a recipe can't target a descendant, so the row variant's\n// slot rules are attached to a stable class instead (same trick as Button's base).\nconst checkboxRowBase = style({});\n\n/**\n * The RAC `Checkbox` label. `inline` lays the box out beside an optional label;\n * `row` is the 40px selectable row Figma draws for a menu item, for a\n * `CheckboxGroup` rendered as a list of options.\n */\nexport const checkboxRoot = recipe({\n\tbase: {\n\t\t...typography(\"body\", \"regular\"),\n\t\tcolor: t(\"color-content-default\"),\n\t\tcursor: \"pointer\",\n\t\tuserSelect: \"none\",\n\t\toutline: \"none\",\n\t\tselectors: {\n\t\t\t\"&[data-disabled]\": {\n\t\t\t\tcursor: \"not-allowed\",\n\t\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t\t},\n\t\t},\n\t},\n\tvariants: {\n\t\tvariant: {\n\t\t\tinline: {\n\t\t\t\tdisplay: \"inline-flex\",\n\t\t\t\talignItems: \"center\",\n\t\t\t\tgap: t(\"gap-12\"),\n\t\t\t},\n\t\t\trow: [checkboxRowBase, controlRowFrame],\n\t\t},\n\t},\n\tdefaultVariants: { variant: \"inline\" },\n});\n\nglobalStyle(\n\t`${checkboxRowBase} > [data-slot=\"icon\"]`,\n\tcontrolRowSlotRules.icon,\n);\nglobalStyle(\n\t`${checkboxRowBase} > [data-slot=\"label\"]`,\n\tcontrolRowSlotRules.label,\n);\n\n/**\n * The 24px indicator. Its geometry is fixed in every state — a rigid `border-box`\n * square with an always-present 1px border (transparent when filled) and a\n * `box-shadow` focus ring — so selecting/focusing never reflows it.\n *\n * Selection/interaction state lives on the host element (the RAC label, or a\n * `MenuItem` row), so the state rules below are child selectors driven from\n * whichever host carries React Aria's `data-*`. `color` is the inverse content\n * color: it feeds both the glyph stroke and the `currentColor` state-layer\n * overlay, so the overlay is invisible over the light unchecked box (Figma changes\n * only the border on hover) yet lightens the dark filled box.\n */\nexport const checkboxBox = style({\n\tposition: \"relative\",\n\tisolation: \"isolate\",\n\tboxSizing: \"border-box\",\n\tflexShrink: 0,\n\twidth: BOX_SIZE,\n\theight: BOX_SIZE,\n\tborderRadius: t(\"border-radius-6\"),\n\tborderStyle: \"solid\",\n\tborderWidth: t(\"border-width-default\"),\n\tborderColor: t(\"color-border-default\"),\n\tbackgroundColor: t(\"color-background-default\"),\n\tcolor: t(\"color-content-inverse\"),\n\t// No background-color transition, so the fill flips instantly and lands with the glyph.\n\ttransitionProperty: \"border-color, box-shadow\",\n\ttransitionDuration: t(\"duration-fast\"),\n\ttransitionTimingFunction: t(\"easing-standard\"),\n\t\"::after\": {\n\t\tcontent: '\"\"',\n\t\tposition: \"absolute\",\n\t\tinset: 0,\n\t\tborderRadius: \"inherit\",\n\t\tbackgroundColor: \"currentColor\",\n\t\topacity: 0,\n\t\tpointerEvents: \"none\",\n\t\tzIndex: -1,\n\t\ttransition: `opacity ${t(\"duration-fast\")} ${t(\"easing-standard\")}`,\n\t},\n});\n\n/**\n * Checkmark / dash glyph — absolutely centered and toggled by opacity, never\n * in-flow, so revealing it can never shift the box.\n */\nexport const checkboxGlyph = style({\n\tposition: \"absolute\",\n\tinset: 0,\n\tmargin: \"auto\",\n\twidth: GLYPH_SIZE,\n\theight: GLYPH_SIZE,\n\tcolor: \"currentColor\",\n\topacity: 0,\n\tpointerEvents: \"none\",\n});\n\n// Selection and disabled are host-agnostic: any element carrying React Aria's\n// `data-*` drives the box directly below it. Interaction (hover border, state\n// layer, focus ring) additionally requires `[data-state-layer]`, which the\n// indicator sets only when it is the sole affordance — inside a row the row\n// paints those itself.\n\n// Border goes transparent when filled so it folds into the fill (no ring).\nglobalStyle(\n\t`[data-selected] > ${checkboxBox}, [data-indeterminate] > ${checkboxBox}`,\n\t{\n\t\tbackgroundColor: t(\"color-background-inverse\"),\n\t\tborderColor: \"transparent\",\n\t},\n);\n\n// Unchecked hover darkens the border (Figma color/border/medium).\nglobalStyle(\n\t`[data-hovered]:not([data-disabled]):not([data-selected]):not([data-indeterminate]) > ${checkboxBox}[data-state-layer]`,\n\t{ borderColor: t(\"color-border-medium\") },\n);\n\n// State layer — currentColor overlay at per-state opacity, tracking box content color.\nglobalStyle(\n\t`[data-hovered]:not([data-disabled]) > ${checkboxBox}[data-state-layer]::after`,\n\t{ opacity: t(\"opacity-state-hover\") },\n);\nglobalStyle(\n\t`[data-focus-visible]:not([data-disabled]) > ${checkboxBox}[data-state-layer]::after`,\n\t{ opacity: t(\"opacity-state-focus\") },\n);\nglobalStyle(\n\t`[data-pressed]:not([data-disabled]) > ${checkboxBox}[data-state-layer]::after`,\n\t{ opacity: t(\"opacity-state-pressed\") },\n);\n\n// Focus ring — box-shadow, so it never changes the box's size.\nglobalStyle(\n\t`[data-focus-visible]:not([data-disabled]) > ${checkboxBox}[data-state-layer]`,\n\t{ boxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}` },\n);\n\nglobalStyle(\n\t`[data-focus-visible]:not([data-disabled]) > ${checkboxBox}[data-state-layer]`,\n\t{\n\t\t\"@media\": {\n\t\t\t\"(forced-colors: active)\": {\n\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\toutlineOffset: \"2px\",\n\t\t\t},\n\t\t},\n\t},\n);\n\n// Disabled wins over the filled rule: light fill, default border, faded glyph\n// (Figma color/content/disabled).\nglobalStyle(`[data-disabled] > ${checkboxBox}`, {\n\tbackgroundColor: t(\"color-background-disabled\"),\n\tborderColor: t(\"color-border-default\"),\n\tcolor: t(\"color-content-disabled\"),\n});\n\n// Reveal the matching glyph. Dash wins for the mixed state; the check shows only\n// when selected and not indeterminate.\nglobalStyle(\n\t`[data-selected]:not([data-indeterminate]) > ${checkboxBox} > ${checkboxGlyph}[data-glyph=\"check\"]`,\n\t{ opacity: 1 },\n);\nglobalStyle(\n\t`[data-indeterminate] > ${checkboxBox} > ${checkboxGlyph}[data-glyph=\"dash\"]`,\n\t{ opacity: 1 },\n);\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.css.js","names":[],"sources":["../../../src/components/Chip/Chip.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\nconst chipBase = style({});\n\nexport const chipRoot = recipe({\n\tbase: [\n\t\tchipBase,\n\t\t{\n\t\t\tposition: \"relative\",\n\t\t\tisolation: \"isolate\",\n\t\t\tdisplay: \"inline-flex\",\n\t\t\talignItems: \"center\",\n\t\t\tjustifyContent: \"center\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tborder: `${t(\"border-width-default\")} solid transparent`,\n\t\t\
|
|
1
|
+
{"version":3,"file":"Chip.css.js","names":[],"sources":["../../../src/components/Chip/Chip.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { typography } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\nconst chipBase = style({});\n\nexport const chipRoot = recipe({\n\tbase: [\n\t\tchipBase,\n\t\t{\n\t\t\tposition: \"relative\",\n\t\t\tisolation: \"isolate\",\n\t\t\tdisplay: \"inline-flex\",\n\t\t\talignItems: \"center\",\n\t\t\tjustifyContent: \"center\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tborder: `${t(\"border-width-default\")} solid transparent`,\n\t\t\t...typography(\"body\", \"medium\"),\n\t\t\twhiteSpace: \"nowrap\",\n\t\t\tcursor: \"pointer\",\n\t\t\tuserSelect: \"none\",\n\t\t\tappearance: \"none\",\n\t\t\toutline: \"none\",\n\t\t\ttransitionProperty: \"background-color, border-color\",\n\t\t\ttransitionDuration: t(\"duration-fast\"),\n\t\t\ttransitionTimingFunction: t(\"easing-standard\"),\n\t\t\t\"::after\": {\n\t\t\t\tcontent: '\"\"',\n\t\t\t\tposition: \"absolute\",\n\t\t\t\tinset: 0,\n\t\t\t\tborderRadius: \"inherit\",\n\t\t\t\tbackgroundColor: \"currentColor\",\n\t\t\t\topacity: 0,\n\t\t\t\tpointerEvents: \"none\",\n\t\t\t\tzIndex: -1,\n\t\t\t\ttransition: `opacity ${t(\"duration-fast\")} ${t(\"easing-standard\")}`,\n\t\t\t},\n\t\t\tselectors: {\n\t\t\t\t\"&:not([data-selected])\": {\n\t\t\t\t\tbackgroundColor: t(\"color-background-default\"),\n\t\t\t\t\tcolor: t(\"color-content-default\"),\n\t\t\t\t\tborderColor: t(\"color-border-default\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-selected]\": {\n\t\t\t\t\tbackgroundColor: t(\"chip-background-selected\"),\n\t\t\t\t\tcolor: t(\"color-content-on-accent\"),\n\t\t\t\t\tborderColor: \"transparent\",\n\t\t\t\t},\n\t\t\t\t\"&[data-hovered]:not([data-disabled])::after\": {\n\t\t\t\t\topacity: t(\"opacity-state-hover\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-focus-visible]:not([data-disabled])::after\": {\n\t\t\t\t\topacity: t(\"opacity-state-focus\"),\n\t\t\t\t},\n\t\t\t\t\"&[data-pressed]:not([data-disabled])::after\": {\n\t\t\t\t\topacity: t(\"opacity-state-pressed\"),\n\t\t\t\t},\n\t\t\t\t// Focus: inner 1px accent border + outer 2px focus ring (Figma double ring).\n\t\t\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\t\t\tborderColor: t(\"color-border-accent\"),\n\t\t\t\t\tboxShadow: `0 0 0 ${t(\"border-width-focus\")} ${t(\"color-border-focus\")}`,\n\t\t\t\t},\n\t\t\t\t\"&[data-disabled]\": {\n\t\t\t\t\tcursor: \"not-allowed\",\n\t\t\t\t\tcolor: t(\"color-content-disabled\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"@media\": {\n\t\t\t\t\"(forced-colors: active)\": {\n\t\t\t\t\tselectors: {\n\t\t\t\t\t\t\"&[data-focus-visible]:not([data-disabled])\": {\n\t\t\t\t\t\t\toutline: \"2px solid Highlight\",\n\t\t\t\t\t\t\toutlineOffset: \"2px\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n\tvariants: {\n\t\tvariant: {\n\t\t\t// A flexible, min-80px pill; height comes from the size compound variants.\n\t\t\ttext: {\n\t\t\t\tminWidth: \"80px\",\n\t\t\t\tpaddingInline: t(\"padding-12\"),\n\t\t\t\tborderRadius: t(\"border-radius-pill\"),\n\t\t\t},\n\t\t\ticon: { borderRadius: t(\"border-radius-button\") },\n\t\t\tnumber: { borderRadius: t(\"border-radius-button\") },\n\t\t},\n\t\tsize: {\n\t\t\tmd: {},\n\t\t\tlg: {},\n\t\t},\n\t},\n\t// Dimensions per variant×size. Hardcoded px mirror Figma's fixed frame sizes;\n\t// text is a flexible pill (height only), icon/number are square. The large number\n\t// chip carries its own type size: at 48px the digit is the control's content, not\n\t// a label on it, so body type under-reads it.\n\tcompoundVariants: [\n\t\t{\n\t\t\tvariants: { variant: \"text\", size: \"md\" },\n\t\t\tstyle: { height: \"40px\" },\n\t\t},\n\t\t{\n\t\t\tvariants: { variant: \"text\", size: \"lg\" },\n\t\t\tstyle: { height: \"48px\" },\n\t\t},\n\t\t{\n\t\t\tvariants: { variant: \"icon\", size: \"md\" },\n\t\t\tstyle: { width: \"40px\", height: \"40px\" },\n\t\t},\n\t\t{\n\t\t\tvariants: { variant: \"icon\", size: \"lg\" },\n\t\t\tstyle: { width: \"48px\", height: \"48px\" },\n\t\t},\n\t\t{\n\t\t\tvariants: { variant: \"number\", size: \"md\" },\n\t\t\tstyle: { width: \"40px\", height: \"40px\" },\n\t\t},\n\t\t{\n\t\t\tvariants: { variant: \"number\", size: \"lg\" },\n\t\t\tstyle: {\n\t\t\t\twidth: \"48px\",\n\t\t\t\theight: \"48px\",\n\t\t\t\tfontSize: t(\"font-size-title-large\"),\n\t\t\t},\n\t\t},\n\t],\n\tdefaultVariants: {\n\t\tvariant: \"text\",\n\t\tsize: \"md\",\n\t},\n});\n\nglobalStyle(`${chipBase} [data-slot='icon']`, {\n\tfontSize: t(\"icon-size-control\"),\n\tflexShrink: 0,\n});\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.css.js","names":[],"sources":["../../../src/components/Dialog/Dialog.css.ts"],"sourcesContent":["import { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\n/* ── Content stack ────────────────────────────────────────────────────── */\n\n// Content arrangement for the icon → content → actions stack, wrapped by\n// DialogOverlay's focus-trap surface (which supplies the card + scroll): a\n// centered flex column with a single gap-16 between the three blocks.\n// Dialog.Content supplies the tighter title↔body gap-8 internally.\nexport const dialogContentSurface = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\talignItems: \"center\",\n\ttextAlign: \"center\",\n\tgap: t(\"gap-16\"),\n\tpadding: t(\"padding-16\"),\n\tbackgroundColor: t(\"elevation-2-background\"),\n});\n\n/* ── Parts ────────────────────────────────────────────────────────────── */\n\nexport const dialogIcon = recipe({\n\tbase: {\n\t\tdisplay: \"flex\",\n\t\tlineHeight: 0,\n\t\tfontSize: \"32px\",\n\t\tflexShrink: 0,\n\t},\n\tvariants: {\n\t\tintent: {\n\t\t\twarning: { color: t(\"color-content-warning\") },\n\t\t\tsuccess: { color: t(\"color-content-success\") },\n\t\t},\n\t},\n});\n\nexport const dialogContent = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\talignItems: \"center\",\n\tgap: t(\"gap-8\"),\n\twidth: \"100%\",\n});\n\nexport const dialogTitle = style({\n\tmargin: 0,\n\ttextAlign: \"center\",\n\twidth: \"100%\",\n\
|
|
1
|
+
{"version":3,"file":"Dialog.css.js","names":[],"sources":["../../../src/components/Dialog/Dialog.css.ts"],"sourcesContent":["import { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { typography } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\n/* ── Content stack ────────────────────────────────────────────────────── */\n\n// Content arrangement for the icon → content → actions stack, wrapped by\n// DialogOverlay's focus-trap surface (which supplies the card + scroll): a\n// centered flex column with a single gap-16 between the three blocks.\n// Dialog.Content supplies the tighter title↔body gap-8 internally.\nexport const dialogContentSurface = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\talignItems: \"center\",\n\ttextAlign: \"center\",\n\tgap: t(\"gap-16\"),\n\tpadding: t(\"padding-16\"),\n\tbackgroundColor: t(\"elevation-2-background\"),\n});\n\n/* ── Parts ────────────────────────────────────────────────────────────── */\n\nexport const dialogIcon = recipe({\n\tbase: {\n\t\tdisplay: \"flex\",\n\t\tlineHeight: 0,\n\t\tfontSize: \"32px\",\n\t\tflexShrink: 0,\n\t},\n\tvariants: {\n\t\tintent: {\n\t\t\twarning: { color: t(\"color-content-warning\") },\n\t\t\tsuccess: { color: t(\"color-content-success\") },\n\t\t},\n\t},\n});\n\nexport const dialogContent = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\talignItems: \"center\",\n\tgap: t(\"gap-8\"),\n\twidth: \"100%\",\n});\n\nexport const dialogTitle = style({\n\tmargin: 0,\n\ttextAlign: \"center\",\n\twidth: \"100%\",\n\t...typography(\"title-large\", \"medium\"),\n\t// The one heading-family consumer in the package, so the family stays a\n\t// local override rather than an axis on `typography()`.\n\tfontFamily: t(\"font-family-heading\"),\n\tcolor: t(\"color-content-default\"),\n});\n\nexport const dialogBody = style({\n\tmargin: 0,\n\ttextAlign: \"center\",\n\twidth: \"100%\",\n\t...typography(\"body\", \"regular\"),\n\tcolor: t(\"color-content-secondary\"),\n});\n\nexport const dialogActions = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\talignItems: \"stretch\",\n\tgap: t(\"gap-8\"),\n\twidth: \"100%\",\n});\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.css.js","names":[],"sources":["../../../src/components/Divider/Divider.css.ts"],"sourcesContent":["import { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { t } from \"../../tokens/index.js\";\n\nconst captionText = {\n\
|
|
1
|
+
{"version":3,"file":"Divider.css.js","names":[],"sources":["../../../src/components/Divider/Divider.css.ts"],"sourcesContent":["import { style } from \"@vanilla-extract/css\";\nimport { recipe } from \"@vanilla-extract/recipes\";\nimport { typographyVariant } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\n// Weight is not here: the three label variants below each set their own.\nconst captionText = {\n\t...typographyVariant(\"caption\"),\n\tcolor: t(\"color-content-secondary\"),\n} as const;\n\nexport const dividerRoot = recipe({\n\tbase: {\n\t\tboxSizing: \"border-box\",\n\t},\n\tvariants: {\n\t\tvariant: {\n\t\t\tline: {\n\t\t\t\tdisplay: \"block\",\n\t\t\t\twidth: \"100%\",\n\t\t\t},\n\t\t\tlabel: {\n\t\t\t\tdisplay: \"flex\",\n\t\t\t\talignItems: \"center\",\n\t\t\t\tjustifyContent: \"center\",\n\t\t\t\tgap: t(\"gap-8\"),\n\t\t\t\twidth: \"100%\",\n\t\t\t},\n\t\t\tmessage: {\n\t\t\t\tdisplay: \"flex\",\n\t\t\t\tflexDirection: \"column\",\n\t\t\t\talignItems: \"center\",\n\t\t\t\tjustifyContent: \"center\",\n\t\t\t\tgap: t(\"gap-4\"),\n\t\t\t\ttextAlign: \"center\",\n\t\t\t},\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"line\",\n\t},\n});\n\n// The horizontal rule for the `line` variant and the two flanking rules of `label`.\n// A zero-height element with only a top border renders as a 1px line. `flex: 1 1 0`\n// makes the flanking rules share the row equally in `label`; it's inert in `line`'s\n// block context, where `width: 100%` spans the full width instead.\nexport const dividerRule = style({\n\tborder: \"none\",\n\tborderTop: `${t(\"border-width-default\")} solid ${t(\"color-border-default\")}`,\n\tmargin: 0,\n\theight: 0,\n\twidth: \"100%\",\n\tflex: \"1 1 0\",\n\tminWidth: \"1px\",\n});\n\n// `label`'s inline marker stays on one line; message captions may wrap to a sentence.\nexport const dividerLabel = style({\n\t...captionText,\n\tfontWeight: t(\"font-weight-regular\"),\n\twhiteSpace: \"nowrap\",\n\tflexShrink: 0,\n\tmargin: 0,\n});\n\nexport const dividerHeading = style({\n\t...captionText,\n\tfontWeight: t(\"font-weight-medium\"),\n\tmargin: 0,\n});\n\nexport const dividerCaption = style({\n\t...captionText,\n\tfontWeight: t(\"font-weight-regular\"),\n\tmargin: 0,\n});\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropZone.css.js","names":[],"sources":["../../../src/components/DropZone/DropZone.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { t } from \"../../tokens/index.js\";\n\nexport const dropZoneRoot = style({\n\tposition: \"relative\",\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tflex: \"1 1 auto\",\n\tminHeight: 0,\n});\n\n// The panel covers the surface it is given rather than carrying the frame size\n// from Figma, so the same primitive works over a whole chat body or a smaller\n// region without the consumer overriding a fixed height.\nexport const dropZonePanel = style({\n\tposition: \"absolute\",\n\tinset: 0,\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tgap: t(\"gap-12\"),\n\tpadding: t(\"padding-16\"),\n\tborderRadius: t(\"border-radius-20\"),\n\tbackgroundColor: t(\"color-background-default\"),\n\t// The panel is a drag affordance, not a target: the drop is handled by the\n\t// zone underneath, and swallowing pointer events here would make the browser\n\t// fire dragleave the moment the panel appeared.\n\tpointerEvents: \"none\",\n});\n\n// 32px is the Figma frame size; the icon-size scale tops out at 24 (`icon-size-lg`).\nglobalStyle(`${dropZonePanel} [data-slot=\"icon\"]`, {\n\tfontSize: \"32px\",\n\tcolor: t(\"color-content-secondary\"),\n});\n\n// Figma ships two variants differing only in icon color. `active` is a drag actually\n// over the zone; `default` is the panel without one, which here is the keyboard path.\nglobalStyle(\n\t`${dropZoneRoot}[data-drop-target] ${dropZonePanel} [data-slot=\"icon\"]`,\n\t{\n\t\tcolor: t(\"color-content-highlight\"),\n\t},\n);\n\nexport const dropZoneText = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tgap: t(\"gap-8\"),\n\twidth: \"100%\",\n\ttextAlign: \"center\",\n\
|
|
1
|
+
{"version":3,"file":"DropZone.css.js","names":[],"sources":["../../../src/components/DropZone/DropZone.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { typography } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\nexport const dropZoneRoot = style({\n\tposition: \"relative\",\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tflex: \"1 1 auto\",\n\tminHeight: 0,\n});\n\n// The panel covers the surface it is given rather than carrying the frame size\n// from Figma, so the same primitive works over a whole chat body or a smaller\n// region without the consumer overriding a fixed height.\nexport const dropZonePanel = style({\n\tposition: \"absolute\",\n\tinset: 0,\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\talignItems: \"center\",\n\tjustifyContent: \"center\",\n\tgap: t(\"gap-12\"),\n\tpadding: t(\"padding-16\"),\n\tborderRadius: t(\"border-radius-20\"),\n\tbackgroundColor: t(\"color-background-default\"),\n\t// The panel is a drag affordance, not a target: the drop is handled by the\n\t// zone underneath, and swallowing pointer events here would make the browser\n\t// fire dragleave the moment the panel appeared.\n\tpointerEvents: \"none\",\n});\n\n// 32px is the Figma frame size; the icon-size scale tops out at 24 (`icon-size-lg`).\nglobalStyle(`${dropZonePanel} [data-slot=\"icon\"]`, {\n\tfontSize: \"32px\",\n\tcolor: t(\"color-content-secondary\"),\n});\n\n// Figma ships two variants differing only in icon color. `active` is a drag actually\n// over the zone; `default` is the panel without one, which here is the keyboard path.\nglobalStyle(\n\t`${dropZoneRoot}[data-drop-target] ${dropZonePanel} [data-slot=\"icon\"]`,\n\t{\n\t\tcolor: t(\"color-content-highlight\"),\n\t},\n);\n\nexport const dropZoneText = style({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tgap: t(\"gap-8\"),\n\twidth: \"100%\",\n\ttextAlign: \"center\",\n\t...typography(\"body\", \"regular\"),\n\twordBreak: \"break-word\",\n});\n\nexport const dropZoneLabel = style({\n\tmargin: 0,\n\tcolor: t(\"color-content-default\"),\n});\n\nexport const dropZoneDescription = style({\n\tmargin: 0,\n\tcolor: t(\"color-content-secondary\"),\n});\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.css.js","names":[],"sources":["../../../src/components/Header/Header.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { t } from \"../../tokens/index.js\";\n\nexport const headerRoot = style({\n\tbackgroundColor: t(\"header-background\"),\n\tcolor: t(\"header-content\"),\n\tdisplay: \"flex\",\n\talignItems: \"center\",\n\tposition: \"relative\",\n\theight: \"56px\",\n\tpadding: `0 ${t(\"padding-12\")}`,\n\tflexShrink: 0,\n\tgap: t(\"spacing-8\"),\n\toverflow: \"hidden\",\n});\n\nglobalStyle(`${headerRoot} [data-slot=\"icon\"]`, {\n\tcolor: t(\"header-content\"),\n});\n\nglobalStyle(`${headerRoot} [data-slot=\"avatar\"] [data-slot=\"icon\"]`, {\n\tcolor: t(\"avatar-content\"),\n});\n\nexport const headerTitle = style({\n\tmargin: 0,\n\tflex: 1,\n\tminWidth: 0,\n\toverflow: \"hidden\",\n\ttextOverflow: \"ellipsis\",\n\twhiteSpace: \"nowrap\",\n\
|
|
1
|
+
{"version":3,"file":"Header.css.js","names":[],"sources":["../../../src/components/Header/Header.css.ts"],"sourcesContent":["import { globalStyle, style } from \"@vanilla-extract/css\";\nimport { typography } from \"../../styles/typography.js\";\nimport { t } from \"../../tokens/index.js\";\n\nexport const headerRoot = style({\n\tbackgroundColor: t(\"header-background\"),\n\tcolor: t(\"header-content\"),\n\tdisplay: \"flex\",\n\talignItems: \"center\",\n\tposition: \"relative\",\n\theight: \"56px\",\n\tpadding: `0 ${t(\"padding-12\")}`,\n\tflexShrink: 0,\n\tgap: t(\"spacing-8\"),\n\toverflow: \"hidden\",\n});\n\nglobalStyle(`${headerRoot} [data-slot=\"icon\"]`, {\n\tcolor: t(\"header-content\"),\n});\n\nglobalStyle(`${headerRoot} [data-slot=\"avatar\"] [data-slot=\"icon\"]`, {\n\tcolor: t(\"avatar-content\"),\n});\n\nexport const headerTitle = style({\n\tmargin: 0,\n\tflex: 1,\n\tminWidth: 0,\n\toverflow: \"hidden\",\n\ttextOverflow: \"ellipsis\",\n\twhiteSpace: \"nowrap\",\n\t// Figma node 12861-6177 draws the bar title at the body tier, not a title\n\t// tier — it is a heading by role, not by size.\n\t...typography(\"body\", \"medium\"),\n});\n"],"mappings":""}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type { HTMLAttributes, Ref } from "react";
|
|
2
2
|
export interface HeaderTitleProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Heading level. Defaults to `1` — the surface's top-level heading, and what
|
|
5
|
+
* this rendered before it composed RAC. RAC's own default is `3`, so the
|
|
6
|
+
* default here is load-bearing, not decoration. A widget embedded in a
|
|
7
|
+
* customer's page may need to sit under that page's outline instead.
|
|
8
|
+
*/
|
|
9
|
+
level?: number;
|
|
3
10
|
ref?: Ref<HTMLHeadingElement>;
|
|
4
11
|
}
|
|
5
12
|
/**
|
|
6
|
-
* Header title text,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
13
|
+
* Header title text, the surface's heading. Grows to fill the bar and truncates
|
|
14
|
+
* with an ellipsis when the label is too long; inherits `header-content` from
|
|
15
|
+
* the surrounding Header.
|
|
16
|
+
*
|
|
17
|
+
* Figma draws it at the body tier — a heading by role, not by size.
|
|
9
18
|
*/
|
|
10
|
-
export declare function HeaderTitle({ className, children, ref, ...rest }: HeaderTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function HeaderTitle({ level, className, children, ref, ...rest }: HeaderTitleProps): import("react/jsx-runtime").JSX.Element;
|