@atom63/widgets 0.1.0-beta.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.
@@ -0,0 +1,112 @@
1
+ import React__default, { CSSProperties } from 'react';
2
+ import { W as WidgetSize } from './types-C0zDKyo1.js';
3
+
4
+ interface WidgetCardProps extends React__default.HTMLAttributes<HTMLDivElement> {
5
+ children: React__default.ReactNode;
6
+ /** Grid size fed into the surface context for chrome-less content to read. */
7
+ size: WidgetSize;
8
+ }
9
+ /**
10
+ * @deprecated Prefer `widgetInsetStyle(size, 'body')`. Kept as a thin alias so
11
+ * existing call sites can migrate without a flag day.
12
+ */
13
+ declare const WIDGET_BODY_INSET_CLASS: Record<WidgetSize, string>;
14
+ /**
15
+ * Widget Card - Base container for widgets
16
+ * Uses design system tokens for consistent styling.
17
+ * Direct-child spacing follows the widget footprint: compact for one-row
18
+ * surfaces and comfortable for the large canvas.
19
+ */
20
+ declare function WidgetCard({ children, className, size, ...props }: WidgetCardProps): React__default.JSX.Element;
21
+ interface WidgetCardHeaderProps {
22
+ children: React__default.ReactNode;
23
+ className?: string;
24
+ style?: CSSProperties;
25
+ }
26
+ /**
27
+ * Widget Card Header - Title/header section for widgets
28
+ * Composed of left (icon + label) and right (optional badge/button) sections
29
+ */
30
+ declare function WidgetCardHeader({ children, className, style }: WidgetCardHeaderProps): React__default.JSX.Element;
31
+ interface WidgetCardHeaderLeftProps {
32
+ children: React__default.ReactNode;
33
+ className?: string;
34
+ }
35
+ /**
36
+ * Widget Card Header Left - Left side of header (icon + label)
37
+ */
38
+ declare function WidgetCardHeaderLeft({ children, className }: WidgetCardHeaderLeftProps): React__default.JSX.Element;
39
+ interface WidgetCardHeaderRightProps {
40
+ children: React__default.ReactNode;
41
+ className?: string;
42
+ }
43
+ /**
44
+ * Widget Card Header Right - Right side of header (optional badge/button)
45
+ */
46
+ declare function WidgetCardHeaderRight({ children, className }: WidgetCardHeaderRightProps): React__default.JSX.Element;
47
+ interface WidgetCardContentProps {
48
+ children: React__default.ReactNode;
49
+ className?: string;
50
+ style?: CSSProperties;
51
+ }
52
+ /**
53
+ * Widget Card Content - Main content area for widgets.
54
+ * Padding/gap come from `widgetInsetStyle(size, 'body')`.
55
+ */
56
+ declare function WidgetCardContent({ children, className, style }: WidgetCardContentProps): React__default.JSX.Element;
57
+ interface WidgetBlockProps {
58
+ children: React__default.ReactNode;
59
+ className?: string;
60
+ style?: CSSProperties;
61
+ }
62
+ /**
63
+ * Widget block — stacks optional header, content, and footer regions.
64
+ * Pass `style={widgetInsetStyle(size, 'body')}` when the block owns padding.
65
+ */
66
+ declare function WidgetBlock({ children, className, style }: WidgetBlockProps): React__default.JSX.Element;
67
+ interface WidgetBlockRegionProps {
68
+ children: React__default.ReactNode;
69
+ className?: string;
70
+ }
71
+ /** Optional top region inside a widget block (title, metadata, controls). */
72
+ declare function WidgetBlockHeader({ children, className }: WidgetBlockRegionProps): React__default.JSX.Element;
73
+ /** Primary widget body — grows to fill space between header and footer. */
74
+ declare function WidgetBlockContent({ children, className }: WidgetBlockRegionProps): React__default.JSX.Element;
75
+ /** Optional bottom region (actions, status, pagination). */
76
+ declare function WidgetBlockFooter({ children, className }: WidgetBlockRegionProps): React__default.JSX.Element;
77
+ interface WidgetCardTitleProps {
78
+ children: React__default.ReactNode;
79
+ className?: string;
80
+ icon?: React__default.ReactNode;
81
+ }
82
+ /**
83
+ * Widget Card Title - Quiet chrome identity with optional leading icon.
84
+ * Icon slot tracks the chrome type ramp (design 12 → ~10px at OS63) so the
85
+ * pair stays optically matched when the label steps down.
86
+ */
87
+ declare function WidgetCardTitle({ children, icon, className }: WidgetCardTitleProps): React__default.JSX.Element;
88
+ interface WidgetCardTextProps {
89
+ children: React__default.ReactNode;
90
+ className?: string;
91
+ }
92
+ /**
93
+ * Widget Card Text Group - Flex column that clips content instead of wrapping.
94
+ * Use around text blocks that should truncate during widget size transitions.
95
+ */
96
+ declare function WidgetCardTextGroup({ children, className }: WidgetCardTextProps): React__default.JSX.Element;
97
+ /**
98
+ * Widget Card Row - Inline row that stays on one line and clips overflow.
99
+ * Use for metadata rows (location, stats, labels) that shouldn't wrap.
100
+ */
101
+ declare function WidgetCardRow({ children, className }: WidgetCardTextProps): React__default.JSX.Element;
102
+ interface WidgetShellProps extends Omit<WidgetCardProps, 'children' | 'title'> {
103
+ children: React__default.ReactNode;
104
+ contentClassName?: string;
105
+ headerClassName?: string;
106
+ headerEnd?: React__default.ReactNode;
107
+ icon?: React__default.ReactNode;
108
+ title: React__default.ReactNode;
109
+ }
110
+ declare function WidgetShell({ children, className, contentClassName, headerClassName, headerEnd, icon, title, ...props }: WidgetShellProps): React__default.JSX.Element;
111
+
112
+ export { WIDGET_BODY_INSET_CLASS as W, WidgetBlock as a, WidgetBlockContent as b, WidgetBlockFooter as c, WidgetBlockHeader as d, WidgetCard as e, WidgetCardContent as f, WidgetCardHeader as g, WidgetCardHeaderLeft as h, WidgetCardHeaderRight as i, WidgetCardRow as j, WidgetCardTextGroup as k, WidgetCardTitle as l, WidgetShell as m };
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "@atom63/widgets",
3
+ "version": "0.1.0-beta.0",
4
+ "description": "The Atom63 widget foundation: widget units and scale, the widget card and surface, loading, empty and error states, and the hosted shell",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/atom63/atom63-design-system.git",
9
+ "directory": "packages/widgets"
10
+ },
11
+ "homepage": "https://github.com/atom63/atom63-design-system/tree/main/packages/widgets#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/atom63/atom63-design-system/issues"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "keywords": [
19
+ "atom63",
20
+ "design-system",
21
+ "widgets",
22
+ "react"
23
+ ],
24
+ "type": "module",
25
+ "sideEffects": [
26
+ "*.css",
27
+ "**/*.css"
28
+ ],
29
+ "main": "./dist/index.js",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "@atom63/source": "./src/index.ts",
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ },
38
+ "./primitives": {
39
+ "@atom63/source": "./src/primitives/index.ts",
40
+ "types": "./dist/primitives/index.d.ts",
41
+ "import": "./dist/primitives/index.js"
42
+ },
43
+ "./state": {
44
+ "@atom63/source": "./src/state/index.ts",
45
+ "types": "./dist/state/index.d.ts",
46
+ "import": "./dist/state/index.js"
47
+ },
48
+ "./runtime": {
49
+ "@atom63/source": "./src/runtime/index.ts",
50
+ "types": "./dist/runtime/index.d.ts",
51
+ "import": "./dist/runtime/index.js"
52
+ },
53
+ "./styles.css": "./src/styles.css"
54
+ },
55
+ "files": [
56
+ "dist",
57
+ "src/**/*.css"
58
+ ],
59
+ "dependencies": {
60
+ "lucide-react": "^1.34.0",
61
+ "motion": "^13.1.1",
62
+ "@atom63/ui-react": "0.2.0-beta.9"
63
+ },
64
+ "peerDependencies": {
65
+ "react": "^19.1.0",
66
+ "react-dom": "^19.1.0"
67
+ },
68
+ "devDependencies": {
69
+ "@storybook/react-vite": "^10.6.0",
70
+ "@testing-library/jest-dom": "6.9.1",
71
+ "@testing-library/react": "16.3.2",
72
+ "@testing-library/user-event": "14.6.1",
73
+ "@types/node": "^26.3.0",
74
+ "@types/react": "^19.2.17",
75
+ "@types/react-dom": "^19.1.9",
76
+ "@vitejs/plugin-react": "^6.1.0",
77
+ "axe-core": "^4.12.1",
78
+ "eslint": "10.7.0",
79
+ "jsdom": "29.1.1",
80
+ "react": "^19.2.7",
81
+ "react-dom": "^19.2.7",
82
+ "storybook": "^10.6.0",
83
+ "tsup": "^8.3.5",
84
+ "typescript": "~5.8.3",
85
+ "vitest": "4.1.11",
86
+ "vitest-axe": "^0.1.0",
87
+ "@atom63/eslint-config": "0.1.0",
88
+ "@atom63/tsconfig": "0.1.0"
89
+ },
90
+ "scripts": {
91
+ "build": "tsup",
92
+ "dev": "tsup --watch",
93
+ "typecheck": "tsc --noEmit",
94
+ "lint": "eslint . --cache --max-warnings 0",
95
+ "test": "vitest run",
96
+ "test:watch": "vitest"
97
+ }
98
+ }
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Widget layout: the viewport that publishes the design unit, and WidgetImage.
3
+ * The grid and the presentation canvas are inline styles, because their values
4
+ * are computed per footprint and per host cell.
5
+ */
6
+
7
+ /* The viewport is a size container: tile content resolves `cqi` against it. */
8
+ .a63-WidgetViewport {
9
+ position: relative;
10
+ min-inline-size: 0;
11
+ container-type: inline-size;
12
+ }
13
+
14
+ .a63-WidgetViewport-fill {
15
+ inline-size: 100%;
16
+ block-size: 100%;
17
+ }
18
+
19
+ /* ── WidgetImage ───────────────────────────────────────────────────────── */
20
+ .a63-WidgetImage {
21
+ position: relative;
22
+ overflow: hidden;
23
+ }
24
+
25
+ :is(.a63-WidgetImage, .a63-WidgetImage-empty)[data-aspect='1/1'] {
26
+ aspect-ratio: 1 / 1;
27
+ }
28
+
29
+ :is(.a63-WidgetImage, .a63-WidgetImage-empty)[data-aspect='16/9'] {
30
+ aspect-ratio: 16 / 9;
31
+ }
32
+
33
+ :is(.a63-WidgetImage, .a63-WidgetImage-empty)[data-aspect='2/3'] {
34
+ aspect-ratio: 2 / 3;
35
+ }
36
+
37
+ .a63-WidgetImage-empty {
38
+ display: flex;
39
+ box-sizing: border-box;
40
+ align-items: center;
41
+ justify-content: center;
42
+ padding: var(--a63-space-4);
43
+ background-color: var(--a63-surface-muted);
44
+ color: var(--a63-text-secondary);
45
+ font-size: var(--typography-sm-font-size);
46
+ line-height: var(--typography-sm-line-height);
47
+ text-align: center;
48
+ }
49
+
50
+ .a63-WidgetImage-skeleton,
51
+ .a63-WidgetImage-img {
52
+ position: absolute;
53
+ inset: 0;
54
+ inline-size: 100%;
55
+ block-size: 100%;
56
+ }
57
+
58
+ .a63-WidgetImage-img {
59
+ object-fit: cover;
60
+ }
61
+
62
+ /* The incoming frame fades in over the held one, then replaces it. */
63
+ .a63-WidgetImage-incoming {
64
+ opacity: 0;
65
+ transition: opacity var(--duration-333) var(--ease-standard);
66
+ }
67
+
68
+ .a63-WidgetImage-incoming[data-shown] {
69
+ opacity: 1;
70
+ }
71
+
72
+ @media (prefers-reduced-motion: reduce) {
73
+ .a63-WidgetImage-incoming {
74
+ transition: none;
75
+ }
76
+ }
@@ -0,0 +1,153 @@
1
+ /*
2
+ * Widget avatar: a ui-react Avatar with a presence dot and an optional shuffle
3
+ * overlay. Geometry is per size; the dot sits on the circle's lower-end arc
4
+ * (a percentage inset), not in the bounding-box corner.
5
+ */
6
+ .a63-WidgetAvatar {
7
+ --widget-avatar-size: calc(var(--a63-space-1) * 16);
8
+ --widget-avatar-dot: var(--a63-space-3_5);
9
+ --widget-avatar-dot-inset: 6%;
10
+ --widget-avatar-icon: calc(var(--a63-space-1) * 4.5);
11
+
12
+ position: relative;
13
+ flex-shrink: 0;
14
+ inline-size: var(--widget-avatar-size);
15
+ block-size: var(--widget-avatar-size);
16
+ }
17
+
18
+ .a63-WidgetAvatar[data-widget-avatar-size='sm'] {
19
+ --widget-avatar-size: calc(var(--a63-space-1) * 12);
20
+ --widget-avatar-dot: var(--a63-space-3);
21
+ --widget-avatar-dot-inset: 5%;
22
+ --widget-avatar-icon: var(--a63-space-4);
23
+ }
24
+
25
+ .a63-WidgetAvatar[data-widget-avatar-size='lg'] {
26
+ --widget-avatar-size: calc(var(--a63-space-1) * 20);
27
+ --widget-avatar-dot: var(--a63-space-4);
28
+ --widget-avatar-dot-inset: 7%;
29
+ --widget-avatar-icon: var(--a63-space-5);
30
+ }
31
+
32
+ .a63-WidgetAvatar[data-widget-avatar-size='xl'] {
33
+ --widget-avatar-size: calc(var(--a63-space-1) * 24);
34
+ --widget-avatar-dot: calc(var(--a63-space-1) * 4.5);
35
+ --widget-avatar-dot-inset: 7%;
36
+ --widget-avatar-icon: var(--a63-space-6);
37
+ }
38
+
39
+ /* The avatar fills the root and rings itself against the page. */
40
+ .a63-WidgetAvatar-avatar {
41
+ --avatar-size: 100%;
42
+
43
+ background-color: var(--a63-surface-muted);
44
+ box-shadow:
45
+ 0 0 0 2px var(--a63-surface-page),
46
+ var(--shadow-sm);
47
+ transition: outline-color var(--duration-normal) var(--ease-standard);
48
+ }
49
+
50
+ .a63-WidgetAvatar-avatar[data-outline] {
51
+ outline: 2px solid color-mix(in oklab, var(--a63-action-primary) 70%, transparent);
52
+ outline-offset: 2px;
53
+ }
54
+
55
+ .a63-WidgetAvatar-busyRing {
56
+ position: absolute;
57
+ inset: 0;
58
+ border-radius: var(--a63-avatar-radius, var(--radius-full));
59
+ box-shadow:
60
+ 0 0 0 2px var(--a63-surface-page),
61
+ 0 0 0 4px color-mix(in oklab, var(--a63-action-primary) 60%, transparent);
62
+ animation: a63-widget-pulse calc(var(--duration-slower) * 2) var(--ease-inout) infinite;
63
+ pointer-events: none;
64
+ }
65
+
66
+ /*
67
+ * The shuffle affordance is drawn over a photo, so it uses the on-media
68
+ * tokens, which hold contrast on any image. It shows on hover, on keyboard
69
+ * focus and while busy.
70
+ */
71
+ .a63-WidgetAvatar-shuffle {
72
+ position: absolute;
73
+ inset: 0;
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ margin: 0;
78
+ padding: 0;
79
+ border: 0;
80
+ border-radius: var(--a63-avatar-radius, var(--radius-full));
81
+ background-color: transparent;
82
+ background-image: linear-gradient(
83
+ to top,
84
+ var(--a63-on-media-surface),
85
+ color-mix(in oklab, var(--a63-on-media-surface-strong) 50%, transparent)
86
+ );
87
+ color: var(--a63-on-media-foreground);
88
+ opacity: 0;
89
+ cursor: pointer;
90
+ backdrop-filter: blur(1px);
91
+ transition: opacity var(--duration-normal) var(--ease-standard);
92
+ }
93
+
94
+ .a63-WidgetAvatar-shuffle:disabled {
95
+ cursor: default;
96
+ }
97
+
98
+ .a63-WidgetAvatar[data-busy] .a63-WidgetAvatar-shuffle,
99
+ .a63-WidgetAvatar-shuffle:focus-visible {
100
+ opacity: 1;
101
+ }
102
+
103
+ .a63-WidgetAvatar-shuffle:focus-visible {
104
+ outline: 2px solid var(--a63-on-media-ring);
105
+ outline-offset: 1px;
106
+ }
107
+
108
+ .a63-WidgetAvatar-shuffleIcon {
109
+ inline-size: var(--widget-avatar-icon);
110
+ block-size: var(--widget-avatar-icon);
111
+ filter: drop-shadow(0 1px 1px var(--a63-on-media-veil-strong));
112
+ transition: transform var(--duration-333) var(--ease-standard);
113
+ }
114
+
115
+ @media (hover: hover) {
116
+ .a63-WidgetAvatar:hover .a63-WidgetAvatar-shuffle {
117
+ opacity: 1;
118
+ }
119
+
120
+ .a63-WidgetAvatar:hover .a63-WidgetAvatar-shuffleIcon:not(.a63-Widget-spin) {
121
+ transform: rotate(180deg);
122
+ }
123
+ }
124
+
125
+ .a63-WidgetAvatar-status {
126
+ position: absolute;
127
+ inset-block-end: var(--widget-avatar-dot-inset);
128
+ inset-inline-end: var(--widget-avatar-dot-inset);
129
+ box-sizing: border-box;
130
+ inline-size: var(--widget-avatar-dot);
131
+ block-size: var(--widget-avatar-dot);
132
+ border: 2px solid var(--a63-surface-panel);
133
+ border-radius: var(--a63-avatar-radius, var(--radius-full));
134
+ background-color: var(--a63-status-success);
135
+ box-shadow: var(--shadow-sm);
136
+ }
137
+
138
+ @keyframes a63-widget-pulse {
139
+ 50% {
140
+ opacity: 0.5;
141
+ }
142
+ }
143
+
144
+ @media (prefers-reduced-motion: reduce) {
145
+ .a63-WidgetAvatar-busyRing {
146
+ animation: none;
147
+ }
148
+
149
+ .a63-WidgetAvatar-shuffle,
150
+ .a63-WidgetAvatar-shuffleIcon {
151
+ transition: none;
152
+ }
153
+ }
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Widget card anatomy: header, content, blocks, title and text rows.
3
+ *
4
+ * Horizontal insets and type sizes are inline styles authored in design px
5
+ * (`widgetInsetStyle`, `widgetTypeStyle`), because they resolve against the
6
+ * host's `--widget-u`. This sheet holds the layout and the fixed rhythm.
7
+ */
8
+
9
+ /* Direct-child spacing follows the footprint: one-row tiles are tighter. */
10
+ .a63-WidgetCard {
11
+ gap: var(--a63-space-2);
12
+ }
13
+
14
+ [data-widget-surface-size='large'] > .a63-WidgetCard {
15
+ gap: var(--a63-space-3);
16
+ }
17
+
18
+ /* A hosted shell with a header anchors title and body to opposite ends. */
19
+ .a63-WidgetHostedShell-anchored {
20
+ justify-content: space-between;
21
+ }
22
+
23
+ .a63-WidgetCardHeader {
24
+ display: flex;
25
+ flex-shrink: 0;
26
+ box-sizing: border-box;
27
+ align-items: center;
28
+ justify-content: space-between;
29
+ inline-size: 100%;
30
+ min-inline-size: 0;
31
+ block-size: calc(var(--a63-space-1) * 11);
32
+ overflow: hidden;
33
+ }
34
+
35
+ .a63-WidgetCardHeader[data-size='large'] {
36
+ block-size: calc(var(--a63-space-1) * 12);
37
+ }
38
+
39
+ .a63-WidgetCardHeader-start {
40
+ display: flex;
41
+ flex-grow: 1;
42
+ align-items: center;
43
+ gap: var(--a63-space-1);
44
+ min-inline-size: 0;
45
+ }
46
+
47
+ .a63-WidgetCardHeader-end {
48
+ display: flex;
49
+ flex-shrink: 0;
50
+ align-items: center;
51
+ gap: var(--a63-space-2);
52
+ }
53
+
54
+ .a63-WidgetCardContent {
55
+ display: flex;
56
+ flex-direction: column;
57
+ min-inline-size: 0;
58
+ overflow: hidden;
59
+ }
60
+
61
+ .a63-WidgetBlock {
62
+ display: flex;
63
+ flex: 1 1 0%;
64
+ flex-direction: column;
65
+ min-block-size: 0;
66
+ }
67
+
68
+ .a63-WidgetBlock-header,
69
+ .a63-WidgetBlock-footer {
70
+ flex-shrink: 0;
71
+ }
72
+
73
+ .a63-WidgetBlock-content {
74
+ display: flex;
75
+ flex: 1 1 0%;
76
+ flex-direction: column;
77
+ min-inline-size: 0;
78
+ min-block-size: 0;
79
+ }
80
+
81
+ /* Quiet chrome identity: the label and its icon share one muted color. */
82
+ .a63-WidgetCardTitle {
83
+ display: flex;
84
+ align-items: center;
85
+ gap: var(--a63-space-0_5);
86
+ min-inline-size: 0;
87
+ overflow: hidden;
88
+ }
89
+
90
+ .a63-WidgetCardTitle-icon,
91
+ .a63-WidgetCardTitle-text {
92
+ color: color-mix(in oklab, var(--a63-text-secondary) 70%, transparent);
93
+ }
94
+
95
+ .a63-WidgetCardTitle-icon {
96
+ display: flex;
97
+ flex-shrink: 0;
98
+ align-items: center;
99
+ justify-content: center;
100
+ }
101
+
102
+ .a63-WidgetCardTitle-icon > svg {
103
+ inline-size: 100%;
104
+ block-size: 100%;
105
+ }
106
+
107
+ .a63-WidgetCardTitle-text {
108
+ min-inline-size: 0;
109
+ overflow: hidden;
110
+ text-overflow: ellipsis;
111
+ white-space: nowrap;
112
+ }
113
+
114
+ .a63-WidgetCardTextGroup {
115
+ display: flex;
116
+ flex: 1 1 0%;
117
+ flex-direction: column;
118
+ gap: var(--a63-space-1);
119
+ min-inline-size: 0;
120
+ }
121
+
122
+ .a63-WidgetCardRow {
123
+ display: flex;
124
+ align-items: center;
125
+ gap: var(--a63-space-1);
126
+ min-inline-size: 0;
127
+ white-space: nowrap;
128
+ }
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Widget surface — the rim shell and the card face, drawn from the widget
3
+ * contract (`--a63-widget-*` in @atom63/styles contracts/widget.css). Themes and
4
+ * widget kinds restyle the surface by setting those tokens, not these rules.
5
+ */
6
+
7
+ /*
8
+ * The rim shell. The rim is a border, not padding: only a border follows
9
+ * `border-radius`, mitring around each corner arc with a per-side color, so a
10
+ * bevel theme holds up at any radius. `background-origin: border-box` paints a
11
+ * gradient rim under the border instead of inside it. The drop shadow casts
12
+ * from this, the true tile edge. The z-index scopes the face's material pseudo
13
+ * to this surface; unlike `isolation` it creates no backdrop root, so the
14
+ * face's backdrop-filter still samples the page.
15
+ */
16
+ .a63-WidgetSurface {
17
+ position: relative;
18
+ z-index: var(--z-layer-default);
19
+ box-sizing: border-box;
20
+ overflow: hidden;
21
+ border-width: var(--a63-widget-rim-width);
22
+ border-style: solid;
23
+ border-color: var(--a63-widget-rim-border-color);
24
+ border-radius: var(--a63-widget-radius);
25
+ background-color: var(--a63-widget-rim-color);
26
+ background-image: var(--a63-widget-rim-image);
27
+ background-origin: border-box;
28
+ box-shadow: var(--a63-widget-shadow);
29
+ backdrop-filter: var(--a63-widget-rim-backdrop);
30
+ }
31
+
32
+ /*
33
+ * The card face. Its radius is the outer radius less the rim width, so the two
34
+ * curves stay concentric. `--a63-widget-radius` has no fallback of its own at
35
+ * the root, so the calc carries one. Not positioned: a host can compose this
36
+ * class with its own absolute positioning.
37
+ */
38
+ .a63-WidgetSurface-face {
39
+ box-sizing: border-box;
40
+ inline-size: 100%;
41
+ block-size: 100%;
42
+ overflow: hidden;
43
+ border-width: var(--a63-widget-border-width);
44
+ border-style: var(--a63-widget-border-style);
45
+ border-color: var(--a63-widget-border-color);
46
+ border-radius: calc(var(--a63-widget-radius, var(--radius-xl)) - var(--a63-widget-rim-width));
47
+ color: var(--a63-widget-foreground);
48
+ }
49
+
50
+ /*
51
+ * The material sits on an isolated layer behind the content, not on the face
52
+ * itself: decoupling the blur from the content paint avoids Chrome's
53
+ * backdrop-filter flicker and radius bleed. Only the standard backdrop-filter
54
+ * is authored.
55
+ */
56
+ .a63-WidgetSurface-face::before {
57
+ position: absolute;
58
+ inset: 0;
59
+ z-index: var(--z-layer-below);
60
+ border-radius: inherit;
61
+ background-color: var(--a63-widget-background-color);
62
+ background-image: var(--a63-widget-background-image);
63
+ background-blend-mode: var(--a63-widget-background-blend);
64
+ backdrop-filter: var(--a63-widget-backdrop);
65
+ content: '';
66
+ pointer-events: none;
67
+ }
68
+
69
+ /* The face as WidgetSurface renders it: positioned, so it anchors ::before. */
70
+ .a63-WidgetSurface-body {
71
+ position: relative;
72
+ display: flex;
73
+ flex-direction: column;
74
+ min-inline-size: 0;
75
+ }