@@ -10,7 +10,7 @@ export function App() {
10
10
return (
11
11
< >
12
12
< h1 className = "text-center text-4xl font-serif font-semibold mb-8" > React Aria Components 🤝 Tailwind CSS</ h1 >
13
- < div className = "grid gap-4 grid-cols-[repeat(auto-fit,theme(width.96))] auto-rows-fr justify-center" >
13
+ < div className = "grid gap-4 grid-cols-1 md:grid-cols- [repeat(auto-fit,theme(width.96))] auto-rows-fr justify-center" >
14
14
< MenuExample />
15
15
< SelectExample />
16
16
< DatePickerExample />
@@ -53,27 +53,27 @@ function MenuExample() {
53
53
54
54
function MenuItem ( props ) {
55
55
return < Item { ...props } className = { ( { isFocused } ) => `
56
- group flex w-full items-center rounded-md px-3 py-2 text-sm outline-none cursor-default
56
+ group flex w-full items-center rounded-md px-3 py-2 sm: text-sm outline-none cursor-default
57
57
${ isFocused ? 'bg-violet-500 text-white' : 'text-gray-900' }
58
58
` } /> ;
59
59
}
60
60
61
61
function OverlayButton ( props ) {
62
- return < Button { ...props } className = "inline-flex items-center justify-center rounded-md bg-black bg-opacity-20 bg-clip-padding border border-white/20 px-3.5 py-2 text-sm font-medium text-white data-[hovered]:bg-opacity-30 data-[pressed]:bg-opacity-40 transition-colors cursor-default outline-none data-[focus-visible]:ring-2 data-[focus-visible]:ring-white/75" /> ;
62
+ return < Button { ...props } className = "inline-flex items-center justify-center rounded-md bg-black bg-opacity-20 bg-clip-padding border border-white/20 px-3.5 py-2 sm: text-sm font-medium text-white data-[hovered]:bg-opacity-30 data-[pressed]:bg-opacity-40 transition-colors cursor-default outline-none data-[focus-visible]:ring-2 data-[focus-visible]:ring-white/75" /> ;
63
63
}
64
64
65
65
function SelectExample ( ) {
66
66
return (
67
67
< div className = "bg-gradient-to-r from-amber-500 to-rose-500 p-8 rounded-lg flex justify-center" >
68
68
< Select className = "flex flex-col gap-1 w-5/6" >
69
69
< Label className = "text-sm" > Favorite Animal</ Label >
70
- < Button className = "flex relative w-full cursor-default rounded-lg bg-white bg-white bg-opacity-90 data-[pressed]:bg-opacity-100 transition py-2 pl-3 pr-2 text-left shadow-md text-gray-700 focus:outline-none data-[focus-visible]:border-indigo-500 data-[focus-visible]:ring-2 data-[focus-visible]:ring-black text-sm" >
70
+ < Button className = "flex relative w-full cursor-default rounded-lg bg-white bg-white bg-opacity-90 data-[pressed]:bg-opacity-100 transition py-2 pl-3 pr-2 text-left shadow-md text-gray-700 focus:outline-none data-[focus-visible]:border-indigo-500 data-[focus-visible]:ring-2 data-[focus-visible]:ring-black sm: text-sm" >
71
71
< SelectValue className = "flex-1 truncate data-[placeholder]:italic" />
72
72
< ChevronUpDownIcon
73
73
className = "h-5 w-5 text-gray-500"
74
74
aria-hidden = "true" />
75
75
</ Button >
76
- < Popover className = "max-h-60 w-[--trigger-width] overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 text-sm data-[entering]:animate-in data-[entering]:fade-in data-[exiting]:animate-out data-[exiting]:fade-out fill-mode-forwards" >
76
+ < Popover className = "max-h-60 w-[--trigger-width] overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 sm: text-sm data-[entering]:animate-in data-[entering]:fade-in data-[exiting]:animate-out data-[exiting]:fade-out fill-mode-forwards" >
77
77
< ListBox className = "outline-none p-1 [--focus-bg:theme(colors.rose.600)]" >
78
78
< ListBoxItem > Aardvark</ ListBoxItem >
79
79
< ListBoxItem > Cat</ ListBoxItem >
@@ -116,7 +116,7 @@ function ComboBoxExample() {
116
116
< ComboBox className = "flex flex-col gap-1 w-5/6" >
117
117
< Label className = "text-sm text-black" > Favorite Animal</ Label >
118
118
< div className = "relative w-full cursor-default overflow-hidden rounded-lg bg-white bg-opacity-90 focus-within:bg-opacity-100 transition text-left shadow-md [&:has([data-focus-visible])]:ring-2 [&:has([data-focus-visible])]:ring-black sm:text-sm" >
119
- < Input className = "w-full border-none py-2 pl-3 pr-10 text-sm leading-5 text-gray-900 bg-transparent outline-none" />
119
+ < Input className = "w-full border-none py-2 pl-3 pr-10 sm: text-sm leading-5 text-gray-900 bg-transparent outline-none" />
120
120
< Button className = "absolute inset-y-0 right-0 flex items-center px-2 cursor-default transition border-l border-l-sky-200 data-[pressed]:bg-sky-100" >
121
121
< ChevronUpDownIcon
122
122
className = "h-5 w-5 text-gray-500"
@@ -179,9 +179,9 @@ function MyTab(props) {
179
179
< Tab
180
180
{ ...props }
181
181
className = { ( { isSelected, isFocusVisible} ) => `
182
- w-full rounded-full py-2.5 text-sm font-medium leading-5 text-center cursor-default ring-black outline-none transition-colors
182
+ w-full rounded-full py-2.5 sm: text-sm font-medium leading-5 text-center cursor-default ring-black outline-none transition-colors
183
183
${ isFocusVisible ? 'ring-2' : '' }
184
- ${ isSelected ? 'text-emerald-700 bg-white shadow' : 'text-lime-50 hover :bg-white/[0.12] hover :text-white' }
184
+ ${ isSelected ? 'text-emerald-700 bg-white shadow' : 'text-lime-50 data-[hovered] :bg-white/[0.12] data-[hovered]:text-white data-[pressed]:bg-white/[0.12] data-[pressed] :text-white' }
185
185
` } />
186
186
) ;
187
187
}
@@ -355,7 +355,7 @@ function SliderExample() {
355
355
return (
356
356
< div className = "bg-gradient-to-r from-purple-500 to-pink-500 p-8 rounded-lg flex items-center justify-center" >
357
357
< Slider defaultValue = { 30 } className = "w-5/6" >
358
- < div className = "flex text-sm" >
358
+ < div className = "flex sm: text-sm" >
359
359
< Label className = "flex-1" > Opacity</ Label >
360
360
< SliderOutput />
361
361
</ div >
@@ -395,7 +395,7 @@ function DatePickerExample() {
395
395
< DatePicker className = "flex flex-col gap-1 w-5/6" >
396
396
< Label className = "text-sm" > Date</ Label >
397
397
< Group className = "flex rounded-lg bg-white/90 focus-within:bg-white [&:has([data-pressed])]:bg-white transition pl-3 text-left shadow-md text-gray-700 focus:outline-none data-[focus-visible]:[&:not(:has(button[data-focus-visible]))]:ring-2 data-[focus-visible]:ring-black" >
398
- < DateInput className = "flex flex-1 py-2 text-sm input" >
398
+ < DateInput className = "flex flex-1 py-2 sm: text-sm input" >
399
399
{ ( segment ) => < DateSegment segment = { segment } className = "px-0.5 box-content tabular-nums text-right outline-none rounded-sm focus:bg-violet-700 focus:text-white group caret-transparent data-[placeholder]:italic" /> }
400
400
</ DateInput >
401
401
< Button className = "cursor-default outline-none px-2 transition border-l border-l-purple-200 rounded-r-lg data-[pressed]:bg-purple-100 data-[focus-visible]:ring-2 data-[focus-visible]:ring-black" >
@@ -510,7 +510,7 @@ function TableExample() {
510
510
} , [ sortDescriptor ] ) ;
511
511
512
512
return (
513
- < div className = "bg-gradient-to-r from-indigo-500 to-violet-500 p-8 rounded-lg flex items-center justify-center col-span-2" >
513
+ < div className = "bg-gradient-to-r from-indigo-500 to-violet-500 p-8 rounded-lg flex items-center justify-center md: col-span-2" >
514
514
< div className = "max-h-[280px] overflow-auto relative bg-white rounded-lg shadow text-gray-600" >
515
515
< Table aria-label = "Stocks" selectionMode = "single" selectionBehavior = "replace" sortDescriptor = { sortDescriptor } onSortChange = { setSortDescriptor } className = "border-separate border-spacing-0" >
516
516
< TableHeader >
0 commit comments