Skip to content

Commit 3baed19

Browse files
authored
feat: add scroller (#27)
* feat: add scroller * feat: update scroller * chore: cleanpu * feat: better docs * feat: add data-slot * feat: update scroller * feat: build registry * feat: update scroller * feat: add scroll button * chore: cleanup * feat: update scroller * feat: update scroller * feat: update scroller again * feat: update scroll
1 parent 14b150d commit 3baed19

33 files changed

+985
-146
lines changed

docs/__registry__/index.tsx

+84
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,26 @@ export const Index: Record<string, any> = {
129129
subcategory: "",
130130
chunks: []
131131
},
132+
"scroller": {
133+
name: "scroller",
134+
description: "",
135+
type: "registry:ui",
136+
registryDependencies: undefined,
137+
files: [{
138+
path: "registry/default/ui/scroller.tsx",
139+
type: "registry:ui",
140+
target: ""
141+
},{
142+
path: "registry/default/lib/composition.ts",
143+
type: "registry:lib",
144+
target: ""
145+
}],
146+
component: React.lazy(() => import("@/registry/default/ui/scroller.tsx")),
147+
source: "",
148+
category: "",
149+
subcategory: "",
150+
chunks: []
151+
},
132152
"sortable": {
133153
name: "sortable",
134154
description: "",
@@ -649,6 +669,70 @@ export const Index: Record<string, any> = {
649669
subcategory: "",
650670
chunks: []
651671
},
672+
"scroller-demo": {
673+
name: "scroller-demo",
674+
description: "",
675+
type: "registry:example",
676+
registryDependencies: undefined,
677+
files: [{
678+
path: "registry/default/examples/scroller-demo.tsx",
679+
type: "registry:example",
680+
target: ""
681+
}],
682+
component: React.lazy(() => import("@/registry/default/examples/scroller-demo.tsx")),
683+
source: "",
684+
category: "",
685+
subcategory: "",
686+
chunks: []
687+
},
688+
"scroller-horizontal-demo": {
689+
name: "scroller-horizontal-demo",
690+
description: "",
691+
type: "registry:example",
692+
registryDependencies: undefined,
693+
files: [{
694+
path: "registry/default/examples/scroller-horizontal-demo.tsx",
695+
type: "registry:example",
696+
target: ""
697+
}],
698+
component: React.lazy(() => import("@/registry/default/examples/scroller-horizontal-demo.tsx")),
699+
source: "",
700+
category: "",
701+
subcategory: "",
702+
chunks: []
703+
},
704+
"scroller-hidden-demo": {
705+
name: "scroller-hidden-demo",
706+
description: "",
707+
type: "registry:example",
708+
registryDependencies: undefined,
709+
files: [{
710+
path: "registry/default/examples/scroller-hidden-demo.tsx",
711+
type: "registry:example",
712+
target: ""
713+
}],
714+
component: React.lazy(() => import("@/registry/default/examples/scroller-hidden-demo.tsx")),
715+
source: "",
716+
category: "",
717+
subcategory: "",
718+
chunks: []
719+
},
720+
"scroller-navigation-demo": {
721+
name: "scroller-navigation-demo",
722+
description: "",
723+
type: "registry:example",
724+
registryDependencies: undefined,
725+
files: [{
726+
path: "registry/default/examples/scroller-navigation-demo.tsx",
727+
type: "registry:example",
728+
target: ""
729+
}],
730+
component: React.lazy(() => import("@/registry/default/examples/scroller-navigation-demo.tsx")),
731+
source: "",
732+
category: "",
733+
subcategory: "",
734+
chunks: []
735+
},
652736
"sortable-dynamic-overlay-demo": {
653737
name: "sortable-dynamic-overlay-demo",
654738
description: "",

docs/app/(lobby)/pg/page.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
} from "@/components/ui/select";
2626
import { Textarea } from "@/components/ui/textarea";
2727
import { tricks } from "@/lib/data";
28+
import ScrollerDemo from "@/registry/default/examples/scroller-demo";
2829
import {
2930
Combobox,
3031
ComboboxAnchor,
@@ -40,6 +41,7 @@ import { ChevronDown } from "lucide-react";
4041
export default function PlaygroundPage() {
4142
return (
4243
<Shell>
44+
<ScrollerDemo />
4345
<Combobox className="w-[15rem]">
4446
<ComboboxAnchor>
4547
<ComboboxInput placeholder="Search tricks..." />
@@ -115,7 +117,7 @@ export default function PlaygroundPage() {
115117
<SelectTrigger className="w-[11.25rem]">
116118
<SelectValue placeholder="Select a trick" />
117119
</SelectTrigger>
118-
<SelectContent>
120+
<SelectContent className="max-h-20">
119121
<SelectGroup>
120122
<SelectLabel>Tricks</SelectLabel>
121123
{tricks.map((trick) => (

docs/content/docs/components/combobox.mdx

+10-10
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The container for all combobox parts.
121121
},
122122
{
123123
title: "[data-disabled]",
124-
value: "Present when disabled.",
124+
value: "Present when disabled",
125125
},
126126
]}
127127
/>
@@ -152,15 +152,15 @@ A wrapper element that positions the combobox popover relative to the input and
152152
},
153153
{
154154
title: "[data-anchor]",
155-
value: "Present when the anchor is present.",
155+
value: "Present when the anchor is present",
156156
},
157157
{
158158
title: "[data-disabled]",
159-
value: "Present when disabled.",
159+
value: "Present when disabled",
160160
},
161161
{
162162
title: "[data-focused]",
163-
value: "Present when the anchor is focused.",
163+
value: "Present when the anchor is focused",
164164
},
165165
]}
166166
/>
@@ -227,11 +227,11 @@ An individual badge representing a selected item in a multi-select combobox.
227227
attributes={[
228228
{
229229
title: "[data-disabled]",
230-
value: "Present when the badge is disabled.",
230+
value: "Present when the badge is disabled",
231231
},
232232
{
233233
title: "[data-highlighted]",
234-
value: "Present when the badge is highlighted.",
234+
value: "Present when the badge is highlighted",
235235
},
236236
{
237237
title: "[data-orientation]",
@@ -253,11 +253,11 @@ A button to remove a selected item from the multi-select combobox.
253253
attributes={[
254254
{
255255
title: "[data-disabled]",
256-
value: "Present when the parent badge is disabled.",
256+
value: "Present when the parent badge is disabled",
257257
},
258258
{
259259
title: "[data-highlighted]",
260-
value: "Present when the parent badge is highlighted.",
260+
value: "Present when the parent badge is highlighted",
261261
},
262262
]}
263263
/>
@@ -392,11 +392,11 @@ An interactive item in the combobox list.
392392
attributes={[
393393
{
394394
title: "[data-highlighted]",
395-
value: "Present when the item is highlighted.",
395+
value: "Present when the item is highlighted",
396396
},
397397
{
398398
title: "[data-disabled]",
399-
value: "Present when the item is disabled.",
399+
value: "Present when the item is disabled",
400400
},
401401
{
402402
title: "[data-state]",

docs/content/docs/components/editable.mdx

+61
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ The main container component for editable functionality.
9595
name="RootProps"
9696
/>
9797

98+
<DataAttributesTable
99+
attributes={[
100+
{
101+
title: "[data-slot]",
102+
value: ["editable"],
103+
},
104+
]}
105+
/>
106+
98107
### Label
99108

100109
The label component for the editable field.
@@ -106,6 +115,10 @@ The label component for the editable field.
106115

107116
<DataAttributesTable
108117
attributes={[
118+
{
119+
title: "[data-slot]",
120+
value: ["editable-label"],
121+
},
109122
{
110123
title: "[data-disabled]",
111124
value: "Present when the editable field is disabled",
@@ -132,6 +145,10 @@ Container for the preview and input components.
132145

133146
<DataAttributesTable
134147
attributes={[
148+
{
149+
title: "[data-slot]",
150+
value: ["editable-area"],
151+
},
135152
{
136153
title: "[data-disabled]",
137154
value: "Present when the editable field is disabled",
@@ -154,6 +171,10 @@ The preview component that displays the current value.
154171

155172
<DataAttributesTable
156173
attributes={[
174+
{
175+
title: "[data-slot]",
176+
value: ["editable-preview"],
177+
},
157178
{
158179
title: "[data-empty]",
159180
value: "Present when the field has no value",
@@ -178,6 +199,15 @@ The input component for editing the value.
178199
name="InputProps"
179200
/>
180201

202+
<DataAttributesTable
203+
attributes={[
204+
{
205+
title: "[data-slot]",
206+
value: ["editable-input"],
207+
},
208+
]}
209+
/>
210+
181211
### Trigger
182212

183213
Button to trigger edit mode.
@@ -189,6 +219,10 @@ Button to trigger edit mode.
189219

190220
<DataAttributesTable
191221
attributes={[
222+
{
223+
title: "[data-slot]",
224+
value: ["editable-trigger"],
225+
},
192226
{
193227
title: "[data-disabled]",
194228
value: "Present when the editable field is disabled",
@@ -209,6 +243,15 @@ Container for action buttons.
209243
name="ToolbarProps"
210244
/>
211245

246+
<DataAttributesTable
247+
attributes={[
248+
{
249+
title: "[data-slot]",
250+
value: ["editable-toolbar"],
251+
},
252+
]}
253+
/>
254+
212255
### Submit
213256

214257
Button to submit changes.
@@ -218,6 +261,15 @@ Button to submit changes.
218261
name="SubmitProps"
219262
/>
220263

264+
<DataAttributesTable
265+
attributes={[
266+
{
267+
title: "[data-slot]",
268+
value: ["editable-submit"],
269+
},
270+
]}
271+
/>
272+
221273
### Cancel
222274

223275
Button to cancel changes.
@@ -227,6 +279,15 @@ Button to cancel changes.
227279
name="CancelProps"
228280
/>
229281

282+
<DataAttributesTable
283+
attributes={[
284+
{
285+
title: "[data-slot]",
286+
value: ["editable-cancel"],
287+
},
288+
]}
289+
/>
290+
230291
## Accessibility
231292

232293
### Keyboard Interactions

docs/content/docs/components/kbd.mdx

+33-6
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ import * as Kbd from "@/components/ui/kbd";
4747
</Kbd.Root>
4848
```
4949

50-
### Built-in Key Descriptions
50+
### Built-in Key Titles
5151

52-
The component includes built-in descriptions for common keyboard symbols:
52+
The component includes built-in titles for common keyboard symbols:
5353

5454
```tsx
5555
<Kbd.Root>
@@ -59,15 +59,15 @@ The component includes built-in descriptions for common keyboard symbols:
5959
</Kbd.Root>
6060
```
6161

62-
### Custom Key Descriptions
62+
### Custom Key Titles
6363

64-
You can provide custom descriptions for any key:
64+
You can provide custom titles for any key:
6565

6666
```tsx
6767
<Kbd.Root>
68-
<Kbd.Key description="Windows key">⊞</Kbd.Key>
68+
<Kbd.Key title="Windows key">⊞</Kbd.Key>
6969
<Kbd.Separator />
70-
<Kbd.Key description="Lock screen">L</Kbd.Key>
70+
<Kbd.Key title="Lock screen">L</Kbd.Key>
7171
</Kbd.Root>
7272
```
7373

@@ -92,6 +92,15 @@ The main container component for keyboard shortcuts.
9292
name="RootProps"
9393
/>
9494

95+
<DataAttributesTable
96+
attributes={[
97+
{
98+
title: "[data-slot]",
99+
value: ["kbd"],
100+
},
101+
]}
102+
/>
103+
95104
### Key
96105

97106
The component that represents a single keyboard key.
@@ -101,6 +110,15 @@ The component that represents a single keyboard key.
101110
name="KeyProps"
102111
/>
103112

113+
<DataAttributesTable
114+
attributes={[
115+
{
116+
title: "[data-slot]",
117+
value: ["kbd-key"],
118+
},
119+
]}
120+
/>
121+
104122
### Separator
105123

106124
The component that represents the separator between keyboard keys.
@@ -109,3 +127,12 @@ The component that represents the separator between keyboard keys.
109127
path="./types/docs/kbd.ts"
110128
name="SeparatorProps"
111129
/>
130+
131+
<DataAttributesTable
132+
attributes={[
133+
{
134+
title: "[data-slot]",
135+
value: ["kbd-separator"],
136+
},
137+
]}
138+
/>

0 commit comments

Comments
 (0)