Skip to content

Commit 427c05e

Browse files
authored
refactor: scroll-spy api (#169)
* refactor: component api * chore: update test
1 parent bdb192f commit 427c05e

30 files changed

+146
-147
lines changed

docs/components/data-attributes-table.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ import {
88
} from "@/components/ui/table";
99

1010
interface DataAttributesTableProps {
11-
attributes?: {
11+
data?: {
1212
title: string;
1313
value: string | string[];
1414
}[];
1515
slot?: string;
1616
}
1717

18-
export function DataAttributesTable({
19-
attributes,
20-
slot,
21-
}: DataAttributesTableProps) {
18+
export function DataAttributesTable({ data, slot }: DataAttributesTableProps) {
2219
const allAttributes = [
23-
...(attributes ?? []),
20+
...(data ?? []),
2421
...(slot ? [{ title: "[data-slot]", value: `"${slot}"` }] : []),
2522
];
2623

docs/content/docs/components/angle-slider.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ The main container component for the angle slider.
130130
/>
131131

132132
<DataAttributesTable
133-
attributes={[
133+
data={[
134134
{
135135
title: "[data-disabled]",
136136
value: "Present when the angle slider is disabled.",
@@ -148,7 +148,7 @@ The circular track that represents the full range of possible values.
148148
/>
149149

150150
<DataAttributesTable
151-
attributes={[
151+
data={[
152152
{
153153
title: "[data-disabled]",
154154
value: "Present when the angle slider is disabled.",
@@ -170,7 +170,7 @@ The portion of the track that represents the selected range.
170170
/>
171171

172172
<DataAttributesTable
173-
attributes={[
173+
data={[
174174
{
175175
title: "[data-disabled]",
176176
value: "Present when the angle slider is disabled.",
@@ -188,7 +188,7 @@ The draggable handle for selecting values.
188188
/>
189189

190190
<DataAttributesTable
191-
attributes={[
191+
data={[
192192
{
193193
title: "[data-disabled]",
194194
value: "Present when the angle slider is disabled.",
@@ -206,7 +206,7 @@ Displays the current value(s) with customizable formatting.
206206
/>
207207

208208
<DataAttributesTable
209-
attributes={[
209+
data={[
210210
{
211211
title: "[data-disabled]",
212212
value: "Present when the angle slider is disabled.",

docs/content/docs/components/checkbox-group.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Container for the checkbox group.
120120
/>
121121

122122
<DataAttributesTable
123-
attributes={[
123+
data={[
124124
{
125125
title: "[data-invalid]",
126126
value: "Present when invalid.",
@@ -146,7 +146,7 @@ Label for the checkbox group.
146146
/>
147147

148148
<DataAttributesTable
149-
attributes={[
149+
data={[
150150
{
151151
title: "[data-disabled]",
152152
value: "Present when disabled.",
@@ -164,7 +164,7 @@ Container for checkbox items.
164164
/>
165165

166166
<DataAttributesTable
167-
attributes={[
167+
data={[
168168
{
169169
title: "[data-orientation]",
170170
value: ["vertical", "horizontal"],
@@ -186,7 +186,7 @@ Individual checkbox item.
186186
/>
187187

188188
<DataAttributesTable
189-
attributes={[
189+
data={[
190190
{
191191
title: "[data-state]",
192192
value: ["checked", "unchecked"],
@@ -216,7 +216,7 @@ Visual indicator for the checkbox state.
216216
/>
217217

218218
<DataAttributesTable
219-
attributes={[
219+
data={[
220220
{
221221
title: "[data-state]",
222222
value: ["checked", "unchecked"],
@@ -238,7 +238,7 @@ Optional description text for the checkbox group.
238238
/>
239239

240240
<DataAttributesTable
241-
attributes={[
241+
data={[
242242
{
243243
title: "[data-disabled]",
244244
value: "Present when disabled.",
@@ -260,7 +260,7 @@ Error or validation message for the checkbox group.
260260
/>
261261

262262
<DataAttributesTable
263-
attributes={[
263+
data={[
264264
{
265265
title: "[data-disabled]",
266266
value: "Present when disabled.",

docs/content/docs/components/circular-progress.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ The main container component for the circular progress.
129129
/>
130130

131131
<DataAttributesTable
132-
attributes={[
132+
data={[
133133
{
134134
title: "[data-state]",
135135
value: ["indeterminate", "loading", "complete"],
@@ -163,7 +163,7 @@ The SVG container that holds the circular progress tracks and ranges.
163163
/>
164164

165165
<DataAttributesTable
166-
attributes={[
166+
data={[
167167
{
168168
title: "[data-state]",
169169
value: ["indeterminate", "loading", "complete"],
@@ -197,7 +197,7 @@ The background circle that represents the full range of possible values.
197197
/>
198198

199199
<DataAttributesTable
200-
attributes={[
200+
data={[
201201
{
202202
title: "[data-state]",
203203
value: ["indeterminate", "loading", "complete"],
@@ -215,7 +215,7 @@ The portion of the circle that represents the current progress value.
215215
/>
216216

217217
<DataAttributesTable
218-
attributes={[
218+
data={[
219219
{
220220
title: "[data-state]",
221221
value: ["indeterminate", "loading", "complete"],
@@ -245,7 +245,7 @@ The text element that displays the current progress value or custom content.
245245
/>
246246

247247
<DataAttributesTable
248-
attributes={[
248+
data={[
249249
{
250250
title: "[data-state]",
251251
value: ["indeterminate", "loading", "complete"],

docs/content/docs/components/color-picker.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ A button that activates the browser's native eye dropper tool to pick colors fro
176176
/>
177177

178178
<DataAttributesTable
179-
attributes={[
179+
data={[
180180
{
181181
title: "[data-disabled]",
182182
value: "Present when the component is disabled.",

docs/content/docs/components/color-swatch.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ A color swatch component that displays a color value with optional transparency
7070
/>
7171

7272
<DataAttributesTable
73-
attributes={[
73+
data={[
7474
{
7575
title: "[data-disabled]",
7676
value: "Present when the component is disabled.",

docs/content/docs/components/combobox.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The container for all combobox parts.
116116
/>
117117

118118
<DataAttributesTable
119-
attributes={[
119+
data={[
120120
{
121121
title: "[data-state]",
122122
value: ["open", "closed"],
@@ -147,7 +147,7 @@ A wrapper element that positions the combobox popover relative to the input and
147147
/>
148148

149149
<DataAttributesTable
150-
attributes={[
150+
data={[
151151
{
152152
title: "[data-state]",
153153
value: ["open", "closed"],
@@ -177,7 +177,7 @@ A button that toggles the combobox popover. Handles focus management and keyboar
177177
/>
178178

179179
<DataAttributesTable
180-
attributes={[
180+
data={[
181181
{
182182
title: "[data-state]",
183183
value: ["open", "closed"],
@@ -208,7 +208,7 @@ A container for displaying selected items as badges in a multi-select combobox.
208208
/>
209209

210210
<DataAttributesTable
211-
attributes={[
211+
data={[
212212
{
213213
title: "[data-orientation]",
214214
value: ["horizontal", "vertical"],
@@ -226,7 +226,7 @@ An individual badge representing a selected item in a multi-select combobox.
226226
/>
227227

228228
<DataAttributesTable
229-
attributes={[
229+
data={[
230230
{
231231
title: "[data-disabled]",
232232
value: "Present when the badge is disabled",
@@ -252,7 +252,7 @@ A button to remove a selected item from the multi-select combobox.
252252
/>
253253

254254
<DataAttributesTable
255-
attributes={[
255+
data={[
256256
{
257257
title: "[data-disabled]",
258258
value: "Present when the parent badge is disabled",
@@ -275,7 +275,7 @@ A button that clears the input value and resets the filter.
275275
/>
276276

277277
<DataAttributesTable
278-
attributes={[
278+
data={[
279279
{
280280
title: "[data-disabled]",
281281
value: "Present when disabled",
@@ -304,7 +304,7 @@ The popover container for combobox items. Positions the combobox popover relativ
304304
/>
305305

306306
<DataAttributesTable
307-
attributes={[
307+
data={[
308308
{
309309
title: "[data-state]",
310310
value: ["open", "closed"],
@@ -400,7 +400,7 @@ An interactive item in the combobox list.
400400
/>
401401

402402
<DataAttributesTable
403-
attributes={[
403+
data={[
404404
{
405405
title: "[data-highlighted]",
406406
value: "Present when the item is highlighted",

docs/content/docs/components/editable.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The label component for the editable field.
112112
/>
113113

114114
<DataAttributesTable
115-
attributes={[
115+
data={[
116116
{
117117
title: "[data-disabled]",
118118
value: "Present when the editable field is disabled",
@@ -138,7 +138,7 @@ Container for the preview and input components.
138138
/>
139139

140140
<DataAttributesTable
141-
attributes={[
141+
data={[
142142
{
143143
title: "[data-disabled]",
144144
value: "Present when the editable field is disabled",
@@ -160,7 +160,7 @@ The preview component that displays the current value.
160160
/>
161161

162162
<DataAttributesTable
163-
attributes={[
163+
data={[
164164
{
165165
title: "[data-empty]",
166166
value: "Present when the field has no value",
@@ -195,7 +195,7 @@ Button to trigger edit mode.
195195
/>
196196

197197
<DataAttributesTable
198-
attributes={[
198+
data={[
199199
{
200200
title: "[data-disabled]",
201201
value: "Present when the editable field is disabled",

docs/content/docs/components/file-upload.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ A container for drag and drop functionality.
122122
/>
123123

124124
<DataAttributesTable
125-
attributes={[
125+
data={[
126126
{
127127
title: "[data-disabled]",
128128
value: "Present when the dropzone is disabled.",
@@ -148,7 +148,7 @@ A button that opens the file selection dialog.
148148
/>
149149

150150
<DataAttributesTable
151-
attributes={[
151+
data={[
152152
{
153153
title: "[data-disabled]",
154154
value: "Present when the trigger is disabled.",
@@ -166,7 +166,7 @@ A container for displaying uploaded files.
166166
/>
167167

168168
<DataAttributesTable
169-
attributes={[
169+
data={[
170170
{
171171
title: "[data-orientation]",
172172
value: ["horizontal", "vertical"],
@@ -233,7 +233,7 @@ A button to clear all files from the list.
233233
/>
234234

235235
<DataAttributesTable
236-
attributes={[
236+
data={[
237237
{
238238
title: "[data-disabled]",
239239
value: "Present when the clear button is disabled.",

docs/content/docs/components/kanban.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Individual kanban column component.
100100
/>
101101

102102
<DataAttributesTable
103-
attributes={[
103+
data={[
104104
{
105105
title: "[data-disabled]",
106106
value: "Present when the column is disabled.",
@@ -122,7 +122,7 @@ A button component that acts as a drag handle for kanban columns.
122122
/>
123123

124124
<DataAttributesTable
125-
attributes={[
125+
data={[
126126
{
127127
title: "[data-disabled]",
128128
value: "Present when the column is disabled.",
@@ -144,7 +144,7 @@ Individual kanban item component.
144144
/>
145145

146146
<DataAttributesTable
147-
attributes={[
147+
data={[
148148
{
149149
title: "[data-disabled]",
150150
value: "Present when the item is disabled.",
@@ -166,7 +166,7 @@ A button component that acts as a drag handle for kanban items.
166166
/>
167167

168168
<DataAttributesTable
169-
attributes={[
169+
data={[
170170
{
171171
title: "[data-disabled]",
172172
value: "Present when the item is disabled.",

0 commit comments

Comments
 (0)