Skip to content

Commit 812fc1a

Browse files
author
Andrew Jiang
committedFeb 9, 2024
update content
1 parent 5e9e8c9 commit 812fc1a

File tree

4 files changed

+90
-62
lines changed

4 files changed

+90
-62
lines changed
 
File renamed without changes.

‎custom-app/src/NavHeader.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import NavigationMenuDemo from "./NavMenu"
55
function NavHeader() {
66
return (
77
<Transition as={Fragment} show={true} appear={true} enter="tw-transition-opacity" enterFrom="tw-opacity-0" enterTo="tw-opacity-100">
8-
<header className="tw-relative tw-w-full">
9-
<h1>Custom Header</h1>
10-
<div className="tw-absolute tw-left-1/2 -tw-translate-x-1/2 tw-h-full tw-top-0 tw-flex tw-items-center">
8+
<header className="tw-relative tw-w-full flex justify-between items-center">
9+
<h2 className="tw-whitespace-nowrap m-0">Custom Header</h2>
10+
<div className="tw-absolute tw-w-full sm:tw-left-1/2 sm:-tw-translate-x-1/2 tw-h-full sm:tw-top-0 sm:tw-flex sm:tw-items-center">
1111
<NavigationMenuDemo />
1212
</div>
1313
</header>

‎custom-app/src/NavMenu.tsx

+82-54
Original file line numberDiff line numberDiff line change
@@ -5,103 +5,133 @@ import { CaretDownIcon } from '@radix-ui/react-icons'
55

66
const NavigationMenuDemo = () => {
77
return (
8-
<NavigationMenu.Root className="tw-relative tw-z-[1] tw-flex tw-w-screen tw-justify-center">
8+
<NavigationMenu.Root className="tw-relative tw-z-[1] tw-flex tw-w-full tw-justify-end sm:tw-justify-center">
99
<NavigationMenu.List className="tw-center tw-m-0 tw-flex tw-list-none tw-p-1">
1010
<NavigationMenu.Item>
11-
<NavigationMenu.Trigger className="tw-text-violet11 hover:tw-bg-violet3 focus:tw-shadow-violet7 tw-group tw-flex tw-select-none tw-items-center tw-justify-between tw-gap-[2px] tw-rounded-[4px] tw-px-3 tw-py-2 tw-text-[15px] tw-font-medium tw-leading-none tw-outline-none focus:tw-shadow-[0_0_0_2px]">
11+
<NavigationMenu.Trigger className="tw-text-grass11 hover:tw-bg-grass3 focus:tw-shadow-grass7 tw-group tw-flex tw-select-none tw-items-center tw-justify-between tw-gap-[2px] tw-rounded-[4px] tw-px-3 tw-py-2 tw-text-[15px] tw-font-medium tw-leading-none tw-outline-none focus:tw-shadow-[0_0_0_2px]">
1212
Learn{' '}
1313
<CaretDownIcon
14-
className="tw-text-violet10 tw-relative tw-top-[1px] tw-transition-transform tw-duration-[250] tw-ease-in tw-group-data-[state=open]:-tw-rotate-180"
14+
className="tw-text-grass10 tw-relative tw-top-[1px] tw-transition-transform tw-duration-[250] tw-ease-in tw-group-data-[state=open]:-tw-rotate-180"
1515
aria-hidden
1616
/>
1717
</NavigationMenu.Trigger>
18-
<NavigationMenu.Content className="data-[motion=from-start]:tw-animate-enterFromLeft data-[motion=from-end]:tw-animate-enterFromRight data-[motion=to-start]:tw-animate-exitToLeft data-[motion=to-end]:tw-animate-exitToRight tw-absolute tw-top-0 tw-left-0 tw-w-full sm:tw-w-auto tw-shadow-xl">
18+
<NavigationMenu.Content className="data-[motion=from-start]:tw-animate-enterFromLeft data-[motion=from-end]:tw-animate-enterFromRight data-[motion=to-start]:tw-animate-exitToLeft data-[motion=to-end]:tw-animate-exitToRight tw-absolute tw-top-0 tw-left-0 tw-w-full sm:tw-w-auto">
1919
<ul className="tw-one tw-m-0 tw-grid tw-list-none tw-gap-x-[10px] tw-p-[22px] sm:tw-w-[500px] sm:tw-grid-cols-[0.75fr_1fr]">
2020
<li className="tw-row-span-3 tw-grid">
2121
<NavigationMenu.Link asChild>
2222
<a
23-
className="!hover:tw-no-underline focus:tw-shadow-violet7 tw-from-purple9 tw-to-indigo9 tw-flex tw-h-full tw-w-full tw-select-none tw-flex-col tw-justify-end tw-rounded-[6px] tw-bg-gradient-to-b tw-p-[25px] tw-no-underline tw-outline-none focus:tw-shadow-[0_0_0_2px]"
23+
className="hover:tw-no-underline focus:tw-shadow-grass7 tw-from-lime9 tw-to-grass9 tw-flex tw-h-full tw-w-full tw-select-none tw-flex-col tw-justify-end tw-rounded-[6px] tw-bg-gradient-to-b tw-p-[25px] tw-no-underline tw-outline-none focus:tw-shadow-[0_0_0_2px]"
2424
href="/">
2525
<svg
26-
aria-hidden
2726
width="38"
2827
height="38"
29-
viewBox="0 0 25 25"
30-
fill="white">
31-
<path d="M12 25C7.58173 25 4 21.4183 4 17C4 12.5817 7.58173 9 12 9V25Z"></path>
32-
<path d="M12 0H4V8H12V0Z"></path>
33-
<path d="M17 8C19.2091 8 21 6.20914 21 4C21 1.79086 19.2091 0 17 0C14.7909 0 13 1.79086 13 4C13 6.20914 14.7909 8 17 8Z"></path>
28+
viewBox="0 0 513 512"
29+
fill="white"
30+
xmlns="http://www.w3.org/2000/svg">
31+
<g clip-path="url(#clip0_42_160)">
32+
<path
33+
d="M131.418 386.784C130.924 386.191 130.436 385.604 129.952 385.025C132.222 383.149 134.537 381.177 136.872 379.188C138.147 378.103 139.427 377.012 140.71 375.929C146.838 370.754 153.308 365.486 160.393 360.728C174.501 351.254 190.76 344 210.644 344C227.259 344 243.37 346.862 258.357 355.108C272.424 362.849 286.039 375.63 298.218 396.361C286.98 413.246 257.425 439.73 212.539 437.91C172.635 436.293 148.736 407.586 131.418 386.784Z"
34+
fill="white"
35+
stroke="white"
36+
stroke-width="16"
37+
/>
38+
<path
39+
d="M368.606 139.763C352.891 136.193 338.783 130.075 327.67 125.2C328 124.298 328.335 123.378 328.675 122.443C332.319 112.435 336.621 100.622 342.983 88.7881C351.515 72.9177 363.071 58.4917 379.846 50.7665C394.282 44.1184 410.488 39.5607 427.934 40.3648C444.321 41.1201 462.306 46.6265 481.424 60.392C479.842 79.3757 469.123 111.548 426.804 134.312C408.09 144.378 387.718 144.106 368.606 139.763Z"
40+
fill="white"
41+
stroke="white"
42+
stroke-width="16"
43+
/>
44+
<path
45+
d="M223.562 256.316C222.597 255.076 221.659 253.87 220.744 252.704C222.355 251.366 223.992 249.985 225.665 248.575C233.565 241.917 242.252 234.595 252.595 227.905C267.624 218.184 284.45 211.102 303.119 211.991C333.252 213.426 369.242 227.211 392.401 273.092C387.545 280.254 378.34 289.398 365.217 297.182C350.111 306.141 330.298 313 307 313C284.865 313 266.355 301.849 250.949 287.518C239.684 277.038 230.868 265.706 223.562 256.316Z"
46+
fill="white"
47+
stroke="white"
48+
stroke-width="16"
49+
/>
50+
<path
51+
d="M205.195 205.836C206.835 206.705 208.426 207.546 209.958 208.366C211.233 205.962 212.593 203.453 213.988 200.879C215.319 198.423 216.682 195.909 218.033 193.37C222.476 185.023 227.051 175.96 230.901 166.358C238.63 147.082 243.144 126.344 238.231 105.739C230.263 72.3252 203.507 31.7795 153.789 19.1027C133.44 39.2208 117.714 75.3501 127.199 125.128C131.926 149.936 147.862 168.175 166.305 182.162C179.801 192.397 193.721 199.764 205.195 205.836Z"
52+
fill="white"
53+
stroke="white"
54+
stroke-width="16"
55+
/>
56+
<path
57+
d="M127.112 299.473C128.328 299.565 129.526 299.657 130.705 299.751C130.803 298.729 130.904 297.7 131.006 296.661C131.818 288.387 132.683 279.574 132.446 270.032C132.107 256.432 129.445 243.052 121.439 231.577C113.663 220.429 104.29 211.405 92.1618 205.723C80.9232 200.459 66.7662 197.806 48.378 199.588C42.3793 214.142 38.6281 243.173 58.9822 271.311C69.1113 285.313 83.3755 292.057 98.1951 295.579C108.665 298.067 118.353 298.805 127.112 299.473Z"
58+
fill="white"
59+
stroke="white"
60+
stroke-width="16"
61+
/>
62+
<path
63+
d="M165 265C77.5002 361.5 51.8334 449.833 50.5001 480.5C50.2827 485.5 52.0003 494.763 67.0002 498C82.0002 501.237 93.0002 495.499 94.5001 485.5C99.7256 450.662 120 377.5 189 283.5C258 189.5 325 145 330 134.5C335 124 325.333 118.5 318.5 121.5C304.167 128.167 254.571 166.216 165 265Z"
64+
fill="white"
65+
/>
66+
</g>
67+
<defs>
68+
<clipPath id="clip0_42_160">
69+
<rect
70+
width="512"
71+
height="512"
72+
fill="white"
73+
transform="translate(0.5)"
74+
/>
75+
</clipPath>
76+
</defs>
3477
</svg>
78+
3579
<div className="tw-mt-4 tw-mb-[7px] tw-text-[18px] tw-font-medium tw-leading-[1.2] tw-text-white">
36-
Radix Primitives
80+
Fern Docs Demo
3781
</div>
38-
<p className="tw-text-mauve4 tw-text-[14px] tw-leading-[1.3]">
39-
Unstyled, accessible components for React.
40-
</p>
4182
</a>
4283
</NavigationMenu.Link>
4384
</li>
4485

45-
<ListItem href="https://stitches.dev/" title="Stitches">
46-
CSS-in-JS with best-in-class developer experience.
86+
<ListItem href="/" title="Link 1">
87+
Link 1 description
4788
</ListItem>
48-
<ListItem href="/colors" title="Colors">
49-
Beautiful, thought-out palettes with auto dark mode.
89+
<ListItem href="/" title="Link 2">
90+
Link 2 description
5091
</ListItem>
51-
<ListItem href="https://icons.radix-ui.com/" title="Icons">
52-
A crisp set of 15x15 icons, balanced and consistent.
92+
<ListItem href="/" title="Link 3">
93+
Link 3 description
5394
</ListItem>
5495
</ul>
5596
</NavigationMenu.Content>
5697
</NavigationMenu.Item>
5798

5899
<NavigationMenu.Item>
59-
<NavigationMenu.Trigger className="tw-text-violet11 hover:tw-bg-violet3 focus:tw-shadow-violet7 tw-group tw-flex tw-select-none tw-items-center tw-justify-between tw-gap-[2px] tw-rounded-[4px] tw-px-3 tw-py-2 tw-text-[15px] tw-font-medium tw-leading-none tw-outline-none focus:tw-shadow-[0_0_0_2px]">
100+
<NavigationMenu.Trigger className="tw-text-grass11 hover:tw-bg-grass3 focus:tw-shadow-grass7 tw-group tw-flex tw-select-none tw-items-center tw-justify-between tw-gap-[2px] tw-rounded-[4px] tw-px-3 tw-py-2 tw-text-[15px] tw-font-medium tw-leading-none tw-outline-none focus:tw-shadow-[0_0_0_2px]">
60101
Overview{' '}
61102
<CaretDownIcon
62-
className="tw-text-violet10 tw-relative tw-top-[1px] tw-transition-transform tw-duration-[250] tw-ease-in tw-group-data-[state=open]:-tw-rotate-180"
103+
className="tw-text-grass10 tw-relative tw-top-[1px] tw-transition-transform tw-duration-[250] tw-ease-in tw-group-data-[state=open]:-tw-rotate-180"
63104
aria-hidden
64105
/>
65106
</NavigationMenu.Trigger>
66107
<NavigationMenu.Content className="tw-absolute tw-top-0 tw-left-0 tw-w-full sm:tw-w-auto">
67108
<ul className="tw-m-0 tw-grid tw-list-none tw-gap-x-[10px] tw-p-[22px] sm:tw-w-[600px] sm:tw-grid-flow-col sm:tw-grid-rows-3">
68-
<ListItem
69-
title="Introduction"
70-
href="/primitives/docs/overview/introduction">
71-
Build high-quality, accessible design systems and web apps.
109+
<ListItem title="Introduction" href="/">
110+
Link 1 description
72111
</ListItem>
73-
<ListItem
74-
title="Getting started"
75-
href="/primitives/docs/overview/getting-started">
76-
A quick tutorial to get you up and running with Radix
77-
Primitives.
112+
<ListItem title="Quickstart" href="/">
113+
Link 2 description
78114
</ListItem>
79-
<ListItem title="Styling" href="/primitives/docs/guides/styling">
80-
Unstyled and compatible with any styling solution.
115+
<ListItem title="API Reference" href="/">
116+
Link 3 description
81117
</ListItem>
82-
<ListItem
83-
title="Animation"
84-
href="/primitives/docs/guides/animation">
85-
Use CSS keyframes or any animation library of your choice.
118+
<ListItem title="Link 4" href="/">
119+
Link 4 description
86120
</ListItem>
87-
<ListItem
88-
title="Accessibility"
89-
href="/primitives/docs/overview/accessibility">
90-
Tested in a range of browsers and assistive technologies.
121+
<ListItem title="Link 5" href="/">
122+
Link 5 description
91123
</ListItem>
92-
<ListItem
93-
title="Releases"
94-
href="/primitives/docs/overview/releases">
95-
Radix Primitives releases and their changelogs.
124+
<ListItem title="Link 6" href="/">
125+
Link 6 description
96126
</ListItem>
97127
</ul>
98128
</NavigationMenu.Content>
99129
</NavigationMenu.Item>
100130

101131
<NavigationMenu.Item>
102132
<NavigationMenu.Link
103-
className="tw-text-violet11 hover:tw-bg-violet3 focus:tw-shadow-violet7 tw-block tw-select-none tw-rounded-[4px] tw-px-3 tw-py-2 tw-text-[15px] tw-font-medium tw-leading-none tw-no-underline tw-outline-none focus:tw-shadow-[0_0_0_2px]"
104-
href="https://github.com/radix-ui">
133+
className="hover:tw-no-underline hover:tw-text-grass11 tw-text-grass11 hover:tw-bg-grass3 focus:tw-shadow-grass7 tw-block tw-select-none tw-rounded-[4px] tw-px-3 tw-py-2 tw-text-[15px] tw-font-medium tw-leading-none tw-no-underline tw-outline-none focus:tw-shadow-[0_0_0_2px]"
134+
href="/">
105135
Github
106136
</NavigationMenu.Link>
107137
</NavigationMenu.Item>
@@ -118,9 +148,7 @@ const NavigationMenuDemo = () => {
118148
)
119149
}
120150

121-
122-
123-
interface ListItemProps {
151+
interface ListItemProps {
124152
title: string
125153
href: string
126154
className?: string
@@ -133,15 +161,15 @@ const ListItem = React.forwardRef<
133161
<NavigationMenu.Link asChild>
134162
<a
135163
className={classNames(
136-
'!hover:tw-no-underline focus:tw-shadow-[0_0_0_2px] focus:tw-shadow-violet7 hover:tw-bg-mauve3 tw-block tw-select-none tw-rounded-[6px] tw-p-3 tw-text-[15px] tw-leading-none tw-no-underline tw-outline-none tw-transition-colors',
164+
'hover:tw-no-underline focus:tw-shadow-[0_0_0_2px] focus:tw-shadow-grass7 hover:tw-bg-sage3 tw-block tw-select-none tw-rounded-[6px] tw-p-3 tw-text-[15px] tw-leading-none tw-no-underline tw-outline-none tw-transition-colors',
137165
className,
138166
)}
139167
{...props}
140168
ref={forwardedRef}>
141-
<div className="tw-text-violet12 tw-mb-[5px] tw-font-medium tw-leading-[1.2]">
169+
<div className="tw-text-grass12 tw-mb-[5px] tw-font-medium tw-leading-[1.2]">
142170
{title}
143171
</div>
144-
<p className="tw-text-mauve11 tw-leading-[1.4]">{children}</p>
172+
<p className="tw-text-sage11 tw-leading-[1.4]">{children}</p>
145173
</a>
146174
</NavigationMenu.Link>
147175
</li>

‎custom-app/tailwind.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable no-undef */
22
/* eslint-disable @typescript-eslint/no-var-requires */
33

4-
const { blackA, mauve, violet, indigo, purple } = require('@radix-ui/colors');
4+
const { blackA, green, grass, sage, lime } = require('@radix-ui/colors');
55

66
/** @type {import('tailwindcss').Config} */
77
module.exports = {
@@ -12,10 +12,10 @@ module.exports = {
1212
extend: {
1313
colors: {
1414
...blackA,
15-
...mauve,
16-
...violet,
17-
...purple,
18-
...indigo,
15+
...sage,
16+
...green,
17+
...grass,
18+
...lime,
1919
},
2020
keyframes: {
2121
enterFromRight: {

0 commit comments

Comments
 (0)
Please sign in to comment.