Skip to content

Commit 30a4280

Browse files
dmytrokirpaclaude
andauthored
feat(react-headless-components-preview): update stories styles to use CSS modules (#36097)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 05f0d7e commit 30a4280

19 files changed

Lines changed: 238 additions & 106 deletions

packages/react-components/react-headless-components-preview/stories/src/Card/card.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020

2121
.card:focus-visible {
22-
outline: var(--stroke-thick) solid var(--text);
22+
outline: var(--stroke-thick) solid var(--accent);
2323
outline-offset: 2px;
2424
}
2525

@@ -131,7 +131,7 @@
131131
}
132132

133133
.iconButton:focus-visible {
134-
outline: var(--stroke-thick) solid var(--text);
134+
outline: var(--stroke-thick) solid var(--accent);
135135
outline-offset: 2px;
136136
}
137137

@@ -171,7 +171,7 @@
171171
}
172172

173173
.footerButton:focus-visible {
174-
outline: var(--stroke-thick) solid var(--text);
174+
outline: var(--stroke-thick) solid var(--accent);
175175
outline-offset: 2px;
176176
}
177177

@@ -186,7 +186,7 @@
186186
}
187187

188188
.checkbox:focus-visible {
189-
outline: var(--stroke-thick) solid var(--text);
189+
outline: var(--stroke-thick) solid var(--accent);
190190
outline-offset: 2px;
191191
}
192192

packages/react-components/react-headless-components-preview/stories/src/Dialog/dialog.module.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
transition: background var(--duration-fast) var(--ease-standard);
6666
}
6767

68+
.btn:focus {
69+
outline: none;
70+
}
71+
72+
.btn:focus-visible {
73+
box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--accent);
74+
}
75+
6876
.btn:hover {
6977
background: var(--surface-sunken);
7078
}

packages/react-components/react-headless-components-preview/stories/src/Drawer/InlineDrawer.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Inline = (): React.ReactNode => {
3636
</Drawer>
3737

3838
<main className={styles.inlineMain}>
39-
<button className={styles.secondaryButton} onClick={toggleDrawer}>
39+
<button className={styles.primaryButton} onClick={toggleDrawer}>
4040
{open ? 'Hide inline drawer' : 'Show inline drawer'}
4141
</button>
4242
</main>

packages/react-components/react-headless-components-preview/stories/src/Drawer/drawer.module.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
}
126126

127127
.closeButton:focus-visible {
128-
outline: var(--stroke-thick) solid var(--text);
128+
outline: var(--stroke-thick) solid var(--accent);
129129
outline-offset: 2px;
130130
}
131131

@@ -135,20 +135,20 @@
135135
height: 32px;
136136
padding: 0 var(--space-3);
137137
border: 0;
138-
border-radius: var(--radius-md);
139-
background: var(--text);
140-
color: var(--text-on-accent);
138+
border-radius: var(--radius-pill);
139+
background: var(--accent);
140+
color: var(--accent-contrast);
141141
font-size: 13.5px;
142142
font-weight: 500;
143143
cursor: pointer;
144144
}
145145

146146
.primaryButton:hover {
147-
background: var(--text-muted);
147+
background: var(--accent-strong);
148148
}
149149

150150
.primaryButton:focus-visible {
151-
outline: var(--stroke-thick) solid var(--text);
151+
outline: var(--stroke-thick) solid var(--accent);
152152
outline-offset: 2px;
153153
}
154154

@@ -170,7 +170,7 @@
170170
}
171171

172172
.secondaryButton:focus-visible {
173-
outline: var(--stroke-thick) solid var(--text);
173+
outline: var(--stroke-thick) solid var(--accent);
174174
outline-offset: 2px;
175175
}
176176

packages/react-components/react-headless-components-preview/stories/src/Input/input.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
.wrap:has(:focus-visible),
1818
.wrap:focus-within {
19-
border-color: var(--text);
20-
box-shadow: 0 0 0 3px var(--surface-muted);
19+
box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--accent);
2120
}
2221

2322
.wrap[data-disabled],

packages/react-components/react-headless-components-preview/stories/src/MessageBar/MessageBarDefault.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const Default = (): React.ReactNode => (
2626
<button type="button" className={styles.actionBtn}>
2727
Action
2828
</button>
29-
<button type="button" className={styles.iconBtn} aria-label="Dismiss">
29+
<button type="button" className={`${styles.actionBtn} ${styles.iconBtn}`} aria-label="Dismiss">
3030
<DismissRegular aria-hidden />
3131
</button>
3232
</MessageBarActions>

packages/react-components/react-headless-components-preview/stories/src/Popover/popover.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
.trigger:focus-visible {
21-
outline: var(--stroke-thick) solid var(--text);
21+
outline: var(--stroke-thick) solid var(--accent);
2222
outline-offset: 2px;
2323
}
2424

@@ -54,7 +54,7 @@
5454
}
5555

5656
.contextTrigger:focus-visible {
57-
outline: var(--stroke-thick) solid var(--text);
57+
outline: var(--stroke-thick) solid var(--accent);
5858
outline-offset: 2px;
5959
}
6060

@@ -129,7 +129,7 @@
129129
}
130130

131131
.actionButton:focus-visible {
132-
outline: var(--stroke-thick) solid var(--text);
132+
outline: var(--stroke-thick) solid var(--accent);
133133
outline-offset: 2px;
134134
}
135135

packages/react-components/react-headless-components-preview/stories/src/Rating/rating.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
.item {
99
position: relative;
1010
display: inline-flex;
11+
border-radius: var(--radius-sm);
12+
}
13+
14+
.item:has(:focus-within) {
15+
box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--accent);
1116
}
1217

1318
.input {

packages/react-components/react-headless-components-preview/stories/src/Select/select.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525

2626
.select:focus-visible {
2727
outline: none;
28-
border-color: var(--text);
29-
box-shadow: 0 0 0 3px var(--surface-muted);
28+
box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--accent);
3029
}
3130

3231
.select:disabled {

packages/react-components/react-headless-components-preview/stories/src/SpinButton/spin-button.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
}
1717

1818
.wrap:has(:focus-visible) {
19-
border-color: var(--text);
20-
box-shadow: 0 0 0 3px var(--surface-muted);
19+
box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--accent);
2120
}
2221

2322
.input {

0 commit comments

Comments
 (0)