Skip to content

Commit 47acc94

Browse files
committed
refactor: rename data-attr
1 parent c4ba268 commit 47acc94

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

.changeset/two-monkeys-watch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@zag-js/scroll-area": patch
3+
---
4+
5+
Rename `data-hovering` to `data-hover` for consistency

packages/docs/data/data-attr.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@
12451245
"data-part": "scrollbar",
12461246
"data-orientation": "The orientation of the scrollbar",
12471247
"data-scrolling": "Present when scrolling",
1248-
"data-hovering": "Present when hovering",
1248+
"data-hover": "Present when hovering",
12491249
"data-overflow-x": "Present when the content overflows the x-axis",
12501250
"data-overflow-y": "Present when the content overflows the y-axis"
12511251
},
@@ -1971,4 +1971,4 @@
19711971
"data-disabled": "Present when disabled"
19721972
}
19731973
}
1974-
}
1974+
}

packages/machines/scroll-area/src/scroll-area.connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function connect<T extends PropTypes>(
125125
"data-ownedby": dom.getRootId(scope),
126126
"data-orientation": orientation,
127127
"data-scrolling": dataAttr(context.get(orientation === "horizontal" ? "scrollingX" : "scrollingY")),
128-
"data-hovering": dataAttr(context.get("hovering")),
128+
"data-hover": dataAttr(context.get("hovering")),
129129
"data-overflow-x": dataAttr(!hiddenState.scrollbarXHidden),
130130
"data-overflow-y": dataAttr(!hiddenState.scrollbarYHidden),
131131
onPointerUp() {

scripts/data-attr.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const docsMap = {
5151
"data-loading": "Present when loading",
5252
"data-activedescendant": "The id the active descendant of the {{widget}}",
5353
"data-scrolling": "Present when scrolling",
54-
"data-hovering": "Present when hovering",
5554
"data-at-top": "Present when scrolled to the top edge",
5655
"data-at-bottom": "Present when scrolled to the bottom edge",
5756
"data-at-left": "Present when scrolled to the left edge",

shared/src/css/scroll-area.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
opacity: 0;
4343
transition: opacity 150ms 300ms;
4444

45-
&[data-hovering],
45+
&[data-hover],
4646
&[data-scrolling] {
4747
opacity: 1;
4848
transition-duration: 75ms;

website/data/components/scroll-area.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@ scrollbar elements:
200200

201201
### Hover state
202202

203-
When hovering over the scroll area or scrollbar, a `data-hovering` attribute is
203+
When hovering over the scroll area or scrollbar, a `data-hover` attribute is
204204
applied:
205205

206206
```css
207-
[data-part="root"][data-hovering] {
207+
[data-part="root"][data-hover] {
208208
/* styles when hovering over scroll area */
209209
}
210210

211-
[data-part="scrollbar"][data-hovering] {
211+
[data-part="scrollbar"][data-hover] {
212212
/* styles when hovering over scrollbar */
213213
}
214214
```

website/styles/machines/scroll-area.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
position: absolute;
4949

5050
&:hover,
51-
&[data-hovering] {
51+
&[data-hover] {
5252
opacity: 1;
5353
}
5454
&[data-scrolling] {
@@ -81,7 +81,7 @@
8181
}
8282

8383
[data-scope="scroll-area"][data-part="thumb"]:hover,
84-
[data-scope="scroll-area"][data-part="thumb"][data-hovering] {
84+
[data-scope="scroll-area"][data-part="thumb"][data-hover] {
8585
background: var(--colors-text);
8686
}
8787

0 commit comments

Comments
 (0)