@hanzo/ui 1.0.14 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/blocks/components/card-block.tsx +1 -1
  2. package/package.json +2 -1
  3. package/primitives/icons/index.ts +18 -0
  4. package/primitives/index.ts +8 -0
  5. package/primitives/input-otp.tsx +65 -0
  6. package/primitives/toggle-group.tsx +1 -1
  7. package/primitives/youtube-embed.tsx +1 -1
  8. package/style/hanzo-default-colors.css +2 -2
  9. package/{context-providers → style}/theme-provider.tsx +2 -2
  10. package/tailwind/fontFamily.tailwind.ts +7 -0
  11. package/tailwind/{fonts.tailwind.ts → fontSize.tailwind.ts} +1 -19
  12. package/tailwind/index.ts +8 -5
  13. package/tailwind/{tailwind.config.base.js → tailwind.config.hanzo-preset.js} +3 -2
  14. package/tailwind/typo-plugin/get-plugin-styles.js +42 -42
  15. package/tailwind/typography-test.mdx +1 -1
  16. package/types/index.ts +5 -15
  17. package/assets/lux-site-icons/android-chrome-192x192.png +0 -0
  18. package/assets/lux-site-icons/android-chrome-512x512.png +0 -0
  19. package/assets/lux-site-icons/apple-touch-icon.png +0 -0
  20. package/assets/lux-site-icons/favicon-16x16.png +0 -0
  21. package/assets/lux-site-icons/favicon-32x32.png +0 -0
  22. package/assets/lux-site-icons/favicon.ico +0 -0
  23. package/assets/standard-docs/LUX-NFT-Terms-and-Conditions.pdf +0 -0
  24. package/assets/standard-docs/LUX-Privacy-Policy.pdf +0 -0
  25. package/common/chat-widget.tsx +0 -75
  26. package/common/contact-dialog/contact-form.tsx +0 -111
  27. package/common/contact-dialog/disclaimer.tsx +0 -13
  28. package/common/contact-dialog/index.tsx +0 -48
  29. package/common/copyright.tsx +0 -21
  30. package/common/drawer-menu.tsx +0 -54
  31. package/common/footer.tsx +0 -77
  32. package/common/head-metadata/from-next/metadata-types.ts +0 -158
  33. package/common/head-metadata/from-next/opengraph-types.ts +0 -267
  34. package/common/head-metadata/from-next/twitter-types.ts +0 -92
  35. package/common/head-metadata/index.tsx +0 -208
  36. package/common/header/index.tsx +0 -66
  37. package/common/header/mobile-nav.tsx +0 -72
  38. package/common/header/theme-toggle.tsx +0 -26
  39. package/common/icons/index.tsx +0 -34
  40. package/common/icons/lux-logo.tsx +0 -10
  41. package/common/icons/secure-delivery.tsx +0 -13
  42. package/common/icons/social-icon.tsx +0 -35
  43. package/common/index.ts +0 -14
  44. package/common/logo.tsx +0 -71
  45. package/common/mini-chart/index.tsx +0 -8
  46. package/common/mini-chart/mini-chart-props.ts +0 -44
  47. package/common/mini-chart/mini-chart.tsx +0 -76
  48. package/common/mini-chart/wrapper.tsx +0 -23
  49. package/context-providers/index.ts +0 -1
  50. package/next/README.md +0 -11
  51. package/next/analytics/fpixel.ts +0 -18
  52. package/next/analytics/pixel-analytics.tsx +0 -55
  53. package/next/determine-device-middleware.ts +0 -16
  54. package/next/fonts/DrukTextWide-Bold-Trial.otf +0 -0
  55. package/next/fonts/DrukTextWide-Heavy-Trial.otf +0 -0
  56. package/next/fonts/DrukTextWide-Medium-Trial.otf +0 -0
  57. package/next/fonts/DrukWide-Bold-Trial.otf +0 -0
  58. package/next/fonts/DrukWide-Heavy-Trial.otf +0 -0
  59. package/next/fonts/DrukWide-Medium-Trial.otf +0 -0
  60. package/next/get-app-router-font-classes.ts +0 -12
  61. package/next/load-and-return-lux-next-fonts-on-import.ts +0 -94
  62. package/next/next-font-desc.ts +0 -28
  63. package/next/not-found-content.mdx +0 -5
  64. package/next/not-found.tsx +0 -23
  65. package/next/pages-router-font-vars.tsx +0 -18
  66. package/next/root-layout.tsx +0 -62
  67. package/siteDef/footer/community.tsx +0 -67
  68. package/siteDef/footer/company.ts +0 -37
  69. package/siteDef/footer/ecosystem.ts +0 -37
  70. package/siteDef/footer/index.tsx +0 -26
  71. package/siteDef/footer/legal.ts +0 -28
  72. package/siteDef/footer/network.ts +0 -37
  73. package/siteDef/footer/svg/warpcast-logo.svg +0 -12
  74. package/siteDef/main-nav.ts +0 -35
  75. package/style/social-svg.css +0 -3
  76. package/tailwind/lux-tw-fonts.ts +0 -37
  77. package/types/site-def.ts +0 -36
  78. /package/{common → primitives}/icons/github.tsx +0 -0
  79. /package/{common → primitives}/icons/youtube-logo.tsx +0 -0
@@ -1,267 +0,0 @@
1
- import type { AbsoluteTemplateString, TemplateString } from './metadata-types'
2
-
3
- export type OpenGraphType =
4
- | 'article'
5
- | 'book'
6
- | 'music.song'
7
- | 'music.album'
8
- | 'music.playlist'
9
- | 'music.radio_station'
10
- | 'profile'
11
- | 'website'
12
- | 'video.tv_show'
13
- | 'video.other'
14
- | 'video.movie'
15
- | 'video.episode'
16
-
17
- export type OpenGraph =
18
- | OpenGraphWebsite
19
- | OpenGraphArticle
20
- | OpenGraphBook
21
- | OpenGraphProfile
22
- | OpenGraphMusicSong
23
- | OpenGraphMusicAlbum
24
- | OpenGraphMusicPlaylist
25
- | OpenGraphRadioStation
26
- | OpenGraphVideoMovie
27
- | OpenGraphVideoEpisode
28
- | OpenGraphVideoTVShow
29
- | OpenGraphVideoOther
30
- | OpenGraphMetadata
31
-
32
- // update this type to reflect actual locales
33
- type Locale = string
34
-
35
- type OpenGraphMetadata = {
36
- determiner?: 'a' | 'an' | 'the' | 'auto' | ''
37
- title?: string | TemplateString
38
- description?: string
39
- emails?: string | Array<string>
40
- phoneNumbers?: string | Array<string>
41
- faxNumbers?: string | Array<string>
42
- siteName?: string
43
- locale?: Locale
44
- alternateLocale?: Locale | Array<Locale>
45
- images?: OGImage | Array<OGImage>
46
- audio?: OGAudio | Array<OGAudio>
47
- videos?: OGVideo | Array<OGVideo>
48
- url?: string | URL
49
- countryName?: string
50
- ttl?: number
51
- }
52
- export type OpenGraphWebsite = OpenGraphMetadata & {
53
- type: 'website'
54
- }
55
- type OpenGraphArticle = OpenGraphMetadata & {
56
- type: 'article'
57
- publishedTime?: string // datetime
58
- modifiedTime?: string // datetime
59
- expirationTime?: string // datetime
60
- authors?: null | string | URL | Array<string | URL>
61
- section?: null | string
62
- tags?: null | string | Array<string>
63
- }
64
- type OpenGraphBook = OpenGraphMetadata & {
65
- type: 'book'
66
- isbn?: null | string
67
- releaseDate?: null | string // datetime
68
- authors?: null | string | URL | Array<string | URL>
69
- tags?: null | string | Array<string>
70
- }
71
- type OpenGraphProfile = OpenGraphMetadata & {
72
- type: 'profile'
73
- firstName?: null | string
74
- lastName?: null | string
75
- username?: null | string
76
- gender?: null | string
77
- }
78
- type OpenGraphMusicSong = OpenGraphMetadata & {
79
- type: 'music.song'
80
- duration?: null | number
81
- albums?: null | string | URL | OGAlbum | Array<string | URL | OGAlbum>
82
- musicians?: null | string | URL | Array<string | URL>
83
- }
84
- type OpenGraphMusicAlbum = OpenGraphMetadata & {
85
- type: 'music.album'
86
- songs?: null | string | URL | OGSong | Array<string | URL | OGSong>
87
- musicians?: null | string | URL | Array<string | URL>
88
- releaseDate?: null | string // datetime
89
- }
90
- type OpenGraphMusicPlaylist = OpenGraphMetadata & {
91
- type: 'music.playlist'
92
- songs?: null | string | URL | OGSong | Array<string | URL | OGSong>
93
- creators?: null | string | URL | Array<string | URL>
94
- }
95
- type OpenGraphRadioStation = OpenGraphMetadata & {
96
- type: 'music.radio_station'
97
- creators?: null | string | URL | Array<string | URL>
98
- }
99
- type OpenGraphVideoMovie = OpenGraphMetadata & {
100
- type: 'video.movie'
101
- actors?: null | string | URL | OGActor | Array<string | URL | OGActor>
102
- directors?: null | string | URL | Array<string | URL>
103
- writers?: null | string | URL | Array<string | URL>
104
- duration?: null | number
105
- releaseDate?: null | string // datetime
106
- tags?: null | string | Array<string>
107
- }
108
- type OpenGraphVideoEpisode = OpenGraphMetadata & {
109
- type: 'video.episode'
110
- actors?: null | string | URL | OGActor | Array<string | URL | OGActor>
111
- directors?: null | string | URL | Array<string | URL>
112
- writers?: null | string | URL | Array<string | URL>
113
- duration?: null | number
114
- releaseDate?: null | string // datetime
115
- tags?: null | string | Array<string>
116
- series?: null | string | URL
117
- }
118
- type OpenGraphVideoTVShow = OpenGraphMetadata & {
119
- type: 'video.tv_show'
120
- }
121
- type OpenGraphVideoOther = OpenGraphMetadata & {
122
- type: 'video.other'
123
- }
124
-
125
- export type OGImage = string | OGImageDescriptor | URL
126
- type OGImageDescriptor = {
127
- url: string | URL
128
- secureUrl?: string | URL
129
- alt?: string
130
- type?: string
131
- width?: string | number
132
- height?: string | number
133
- }
134
- type OGAudio = string | OGAudioDescriptor | URL
135
- type OGAudioDescriptor = {
136
- url: string | URL
137
- secureUrl?: string | URL
138
- type?: string
139
- }
140
- type OGVideo = string | OGVideoDescriptor | URL
141
- type OGVideoDescriptor = {
142
- url: string | URL
143
- secureUrl?: string | URL
144
- type?: string
145
- width?: string | number
146
- height?: string | number
147
- }
148
-
149
- export type ResolvedOpenGraph =
150
- | ResolvedOpenGraphWebsite
151
- | ResolvedOpenGraphArticle
152
- | ResolvedOpenGraphBook
153
- | ResolvedOpenGraphProfile
154
- | ResolvedOpenGraphMusicSong
155
- | ResolvedOpenGraphMusicAlbum
156
- | ResolvedOpenGraphMusicPlaylist
157
- | ResolvedOpenGraphRadioStation
158
- | ResolvedOpenGraphVideoMovie
159
- | ResolvedOpenGraphVideoEpisode
160
- | ResolvedOpenGraphVideoTVShow
161
- | ResolvedOpenGraphVideoOther
162
- | ResolvedOpenGraphMetadata
163
-
164
- type ResolvedOpenGraphMetadata = {
165
- determiner?: 'a' | 'an' | 'the' | 'auto' | ''
166
- title: AbsoluteTemplateString
167
- description?: string
168
- emails?: Array<string>
169
- phoneNumbers?: Array<string>
170
- faxNumbers?: Array<string>
171
- siteName?: string
172
- locale?: Locale
173
- alternateLocale?: Array<Locale>
174
- images?: Array<OGImage>
175
- audio?: Array<OGAudio>
176
- videos?: Array<OGVideo>
177
- url: null | URL | string
178
- countryName?: string
179
- ttl?: number
180
- }
181
- type ResolvedOpenGraphWebsite = ResolvedOpenGraphMetadata & {
182
- type: 'website'
183
- }
184
- type ResolvedOpenGraphArticle = ResolvedOpenGraphMetadata & {
185
- type: 'article'
186
- publishedTime?: string // datetime
187
- modifiedTime?: string // datetime
188
- expirationTime?: string // datetime
189
- authors?: Array<string>
190
- section?: string
191
- tags?: Array<string>
192
- }
193
- type ResolvedOpenGraphBook = ResolvedOpenGraphMetadata & {
194
- type: 'book'
195
- isbn?: string
196
- releaseDate?: string // datetime
197
- authors?: Array<string>
198
- tags?: Array<string>
199
- }
200
- type ResolvedOpenGraphProfile = ResolvedOpenGraphMetadata & {
201
- type: 'profile'
202
- firstName?: string
203
- lastName?: string
204
- username?: string
205
- gender?: string
206
- }
207
- type ResolvedOpenGraphMusicSong = ResolvedOpenGraphMetadata & {
208
- type: 'music.song'
209
- duration?: number
210
- albums?: Array<OGAlbum>
211
- musicians?: Array<string | URL>
212
- }
213
- type ResolvedOpenGraphMusicAlbum = ResolvedOpenGraphMetadata & {
214
- type: 'music.album'
215
- songs?: Array<string | URL | OGSong>
216
- musicians?: Array<string | URL>
217
- releaseDate?: string // datetime
218
- }
219
- type ResolvedOpenGraphMusicPlaylist = ResolvedOpenGraphMetadata & {
220
- type: 'music.playlist'
221
- songs?: Array<string | URL | OGSong>
222
- creators?: Array<string | URL>
223
- }
224
- type ResolvedOpenGraphRadioStation = ResolvedOpenGraphMetadata & {
225
- type: 'music.radio_station'
226
- creators?: Array<string | URL>
227
- }
228
- type ResolvedOpenGraphVideoMovie = ResolvedOpenGraphMetadata & {
229
- type: 'video.movie'
230
- actors?: Array<string | URL | OGActor>
231
- directors?: Array<string | URL>
232
- writers?: Array<string | URL>
233
- duration?: number
234
- releaseDate?: string // datetime
235
- tags?: Array<string>
236
- }
237
- type ResolvedOpenGraphVideoEpisode = ResolvedOpenGraphMetadata & {
238
- type: 'video.episode'
239
- actors?: Array<string | URL | OGActor>
240
- directors?: Array<string | URL>
241
- writers?: Array<string | URL>
242
- duration?: number
243
- releaseDate?: string // datetime
244
- tags?: Array<string>
245
- series?: string | URL
246
- }
247
- type ResolvedOpenGraphVideoTVShow = ResolvedOpenGraphMetadata & {
248
- type: 'video.tv_show'
249
- }
250
- type ResolvedOpenGraphVideoOther = ResolvedOpenGraphMetadata & {
251
- type: 'video.other'
252
- }
253
-
254
- type OGSong = {
255
- url: string | URL
256
- disc?: number
257
- track?: number
258
- }
259
- type OGAlbum = {
260
- url: string | URL
261
- disc?: number
262
- track?: number
263
- }
264
- type OGActor = {
265
- url: string | URL
266
- role?: string
267
- }
@@ -1,92 +0,0 @@
1
- // Reference: https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup
2
-
3
- import type { AbsoluteTemplateString, TemplateString } from './metadata-types'
4
-
5
- export type Twitter =
6
- | TwitterSummary
7
- | TwitterSummaryLargeImage
8
- | TwitterPlayer
9
- | TwitterApp
10
- | TwitterMetadata
11
-
12
- type TwitterMetadata = {
13
- // defaults to card="summary"
14
- site?: string // username for account associated to the site itself
15
- siteId?: string // id for account associated to the site itself
16
- creator?: string // username for the account associated to the creator of the content on the site
17
- creatorId?: string // id for the account associated to the creator of the content on the site
18
- description?: string
19
- title?: string | TemplateString
20
- images?: TwitterImage | Array<TwitterImage>
21
- }
22
- type TwitterSummary = TwitterMetadata & {
23
- card: 'summary'
24
- }
25
- type TwitterSummaryLargeImage = TwitterMetadata & {
26
- card: 'summary_large_image'
27
- }
28
- type TwitterPlayer = TwitterMetadata & {
29
- card: 'player'
30
- players: TwitterPlayerDescriptor | Array<TwitterPlayerDescriptor>
31
- }
32
- type TwitterApp = TwitterMetadata & {
33
- card: 'app'
34
- app: TwitterAppDescriptor
35
- }
36
- export type TwitterAppDescriptor = {
37
- id: {
38
- iphone?: string | number
39
- ipad?: string | number
40
- googleplay?: string
41
- }
42
- url?: {
43
- iphone?: string | URL
44
- ipad?: string | URL
45
- googleplay?: string | URL
46
- }
47
- name?: string
48
- }
49
-
50
- export type TwitterImage = string | TwitterImageDescriptor | URL
51
- type TwitterImageDescriptor = {
52
- url: string | URL
53
- alt?: string
54
- secureUrl?: string | URL
55
- type?: string
56
- width?: string | number
57
- height?: string | number
58
- }
59
- type TwitterPlayerDescriptor = {
60
- playerUrl: string | URL
61
- streamUrl: string | URL
62
- width: number
63
- height: number
64
- }
65
-
66
- type ResolvedTwitterImage = {
67
- url: string | URL
68
- alt?: string
69
- secureUrl?: string | URL
70
- type?: string
71
- width?: string | number
72
- height?: string | number
73
- }
74
- type ResolvedTwitterSummary = {
75
- site: string | null
76
- siteId: string | null
77
- creator: string | null
78
- creatorId: string | null
79
- description: string | null
80
- title: AbsoluteTemplateString
81
- images?: Array<ResolvedTwitterImage>
82
- }
83
- type ResolvedTwitterPlayer = ResolvedTwitterSummary & {
84
- players: Array<TwitterPlayerDescriptor>
85
- }
86
- type ResolvedTwitterApp = ResolvedTwitterSummary & { app: TwitterAppDescriptor }
87
-
88
- export type ResolvedTwitterMetadata =
89
- | ({ card: 'summary' } & ResolvedTwitterSummary)
90
- | ({ card: 'summary_large_image' } & ResolvedTwitterSummary)
91
- | ({ card: 'player' } & ResolvedTwitterPlayer)
92
- | ({ card: 'app' } & ResolvedTwitterApp)
@@ -1,208 +0,0 @@
1
- import React from 'react'
2
-
3
- import type { Metadata } from 'next'
4
- import Head from "next/head"
5
-
6
- import type {
7
- IconDescriptor,
8
- TemplateString,
9
- Author,
10
- ThemeColorDescriptor
11
- } from './from-next/metadata-types'
12
-
13
- import type { OpenGraph, OGImage } from './from-next/opengraph-types'
14
- import type { Twitter, TwitterImage } from './from-next/twitter-types'
15
-
16
- /*
17
- NOTE: This is ONLY for sites that use the pages router in next.
18
- The app router does this automatically
19
- */
20
-
21
- const getURLasString = (url: string | URL) => {
22
- return (
23
- (typeof url === 'string') ? (url as string) : (url.href)
24
- )
25
- }
26
-
27
- // https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
28
- const Icons: React.FC<{icons: IconDescriptor[]}> = ({
29
- icons
30
- }) => {
31
- return <Head>
32
- {icons.map(({url, ...rest}: IconDescriptor, index) => (
33
- <link {...rest} href={getURLasString(url)} key={`icons-${index}`}/>
34
- ))}
35
- </Head>
36
- }
37
-
38
- export const getTitleFromTemplateString = (title: string | TemplateString | null | undefined): string | null => {
39
-
40
- if (!title) {
41
- return null
42
- }
43
- if (typeof title === 'object') {
44
- if ('default' in title) {
45
- return title.default
46
- }
47
- else if ('absolute' in title) {
48
- return title.absolute
49
- }
50
- }
51
- return title as string
52
- }
53
-
54
- const Authors: React.FC<{
55
- authors: null | undefined | Author | Array<Author>
56
- }> = ({
57
- authors
58
- }) => {
59
-
60
- const Author: React.FC<{author: Author}> = ({author}) => (<>
61
- {author.name && <meta name="author" content={author.name} />}
62
- {author.url && <link rel="author" href={getURLasString(author.url)}/>}
63
- </>)
64
-
65
- if (!authors) {
66
- return null
67
- }
68
-
69
- if (Array.isArray(authors)) {
70
- return (<>
71
- {authors.map((el: Author, index) => (
72
- <Author author={el} key={`authors-${index}`} />
73
- ))}
74
- </>)
75
- }
76
- return (<Author author={authors as Author} />)
77
- }
78
-
79
- const Keywords: React.FC<{keywords: undefined | null | string | Array<string>}> = ({
80
- keywords
81
- }) => {
82
- if (!keywords) return null
83
- const content = (Array.isArray(keywords) ? keywords.join(', ') : keywords as string)
84
- return (<meta name="keywords" content={content} />)
85
- }
86
-
87
- const ThemeColor: React.FC<{
88
- thColors: null | undefined | string | ThemeColorDescriptor | ThemeColorDescriptor[]
89
- }> = ({
90
- thColors
91
- }) => {
92
-
93
- const ThColor: React.FC<{thColor: ThemeColorDescriptor}> = ({thColor}) => {
94
- const toSpread: any = {
95
- content: thColor.color
96
- }
97
-
98
- if ('media' in thColor) {
99
- toSpread.media = thColor.media
100
- }
101
-
102
- return <meta name="theme-color" {...toSpread}/>
103
- }
104
-
105
- if (!thColors) {
106
- return null
107
- }
108
-
109
- if (Array.isArray(thColors)) {
110
- return (<>
111
- {thColors.map((el: ThemeColorDescriptor, index) => (
112
- <ThColor thColor={el} key={`theme-colors-${index}`} />
113
- ))}
114
- </>)
115
- }
116
- else if (typeof thColors === 'string') {
117
- <meta name="theme-color" content={thColors as string}/>
118
- }
119
- return (<ThColor thColor={thColors as ThemeColorDescriptor} />)
120
- }
121
-
122
- const Manifest: React.FC<{
123
- manifest: undefined | null | string | URL
124
- }> = ({
125
- manifest
126
- }) => (
127
- manifest && (<link rel="manifest" href={getURLasString(manifest)}/>)
128
- )
129
-
130
- const getOGImageURL = (img: OGImage | undefined): string | null => {
131
-
132
- if (!img) {
133
- return null
134
- }
135
- if (typeof img === 'object' && 'url' in img) { // this is a OGImageDescriptor
136
- return getURLasString(img.url)
137
- }
138
- return getURLasString(img) // this is a URL or string
139
- }
140
-
141
- const getTwitterImageURL = (img: TwitterImage | undefined): string | null => {
142
-
143
- if (!img) {
144
- return null
145
- }
146
- if (typeof img === 'object' && 'url' in img) { // this is a TwitterImageDescriptor
147
- return getURLasString(img.url)
148
- }
149
- return getURLasString(img) // this is a URL or string
150
- }
151
-
152
- // https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
153
- const OpenGraphComponent: React.FC<{
154
- og: OpenGraph | undefined | null
155
- }> = ({
156
- og
157
- }) => (og && (<Head>
158
- {og.url && (<meta property="og:url" content={(typeof og.url === 'string') ? (og.url as string) : (og.url.href)} />)}
159
- {(og as any).type && (<meta property="og:type" content={(og as any).type} />)}
160
- {og.title && (<meta property="og:title" content={getTitleFromTemplateString(og.title)!} />)}
161
- {og.description && (<meta property="og:description" content={og.description} />)}
162
- {og.images && (<meta property="og:image" content={getOGImageURL(Array.isArray(og.images) ? og.images[0] : og.images)!} />)}
163
- </Head>))
164
-
165
- // https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
166
- export const TwitterComponent: React.FC<{
167
- tw: Twitter | undefined | null
168
- }> = ({
169
- tw
170
- }) => (tw && (<Head>
171
- {(tw as any).card && (<meta name="twitter:card" content={(tw as any).card} />)}
172
- {tw.title && (<meta name="twitter:title" content={getTitleFromTemplateString(tw.title)!} />)}
173
- {tw.description && (<meta name="twitter:description" content={tw.description} />)}
174
- {tw.images && (<meta name="twitter:image" content={getTwitterImageURL(Array.isArray(tw.images) ? tw.images[0] : tw.images)!} />)}
175
- {tw.site && (<meta name="twitter:site" content={tw.site} />)}
176
- </Head>))
177
-
178
- /* See NOTE at top of file! */
179
- // https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
180
- const HeadMetadataComponent: React.FC<{
181
- metadata: Metadata
182
- }> = ({
183
- metadata
184
- }) => {
185
- const mainTitle = getTitleFromTemplateString(metadata.title)
186
-
187
- return (<>
188
- <Head>
189
- {mainTitle && (<title>{mainTitle}</title>) /* must be here, directly under Head component */}
190
- {metadata.description && (
191
- <meta name="description" content={metadata.description} />
192
- )}
193
- {metadata.applicationName && (
194
- <meta name="application-name" content={metadata.applicationName} />
195
- )}
196
- <Authors authors={metadata.authors} />
197
- <Keywords keywords={metadata.keywords} />
198
- <ThemeColor thColors={metadata.themeColor} />
199
- <Manifest manifest={metadata.manifest} />
200
- </Head>
201
- {/* Icons: We only support this format for now */}
202
- <Icons icons={metadata.icons as IconDescriptor[]} />
203
- <OpenGraphComponent og={metadata.openGraph} />
204
- <TwitterComponent tw={metadata.twitter} />
205
- </>)
206
- }
207
-
208
- export default HeadMetadataComponent
@@ -1,66 +0,0 @@
1
- import React from 'react'
2
-
3
- import type { SiteDef } from '../../types'
4
- import { NavItems } from '../../primitives'
5
- import { Icons, DrawerMenu, Logo } from '..'
6
- import { cn } from '../../util'
7
-
8
- import MobileNav from './mobile-nav'
9
-
10
- const Header: React.FC<{
11
- siteDef: SiteDef
12
- className?: string
13
- }> = ({
14
- siteDef,
15
- className = ''
16
- }) => {
17
-
18
- const { nav: { common, featured }} = siteDef
19
- const allElements = (featured) ? [...common, ...featured] : common
20
- // TODO move 13px into a size class and configure twMerge to recognize say, 'text-size-nav'
21
- // (vs be beat out by 'text-color-nav')
22
- const navItemClx = 'font-nav h-8 !text-[13px]/[13px]'
23
-
24
- return (
25
- <header className={cn('bg-background sticky z-10 top-0 ', className)} >
26
- {/* md or larger */}
27
- <div className={
28
- 'hidden md:flex flex-row md:h-[80px] items-center justify-between ' +
29
- 'px-[32px] 2xl:mx-auto max-w-screen-2xl'
30
- }>
31
- <Logo size='md' className='hidden lg:flex' key='two'/>
32
- <Logo size='sm' className='hidden md:flex lg:hidden' key='one'/>
33
- {/* md or larger */}
34
- <div className='flex gap-7 items-center'>
35
- <NavItems
36
- currentAs={siteDef.currentAs}
37
- items={allElements}
38
- className='hidden md:flex md:gap-4 lg:justify-between lg:gap-7 '
39
- itemClx={navItemClx}
40
- key='three'
41
- />
42
- {siteDef.nav.cart}
43
- </div>
44
- </div>
45
- {/* smaller than md: mobile style drawer menu */}
46
- <div className="flex md:hidden h-[44px] items-center justify-between px-2">
47
- <Logo size='sm' />
48
- <div className='flex gap-4'>
49
- {siteDef.nav.cart}
50
- <DrawerMenu
51
- className='p-0 text-primary' // ui has 'text-inherit', so need this for close buttons to appear.
52
- trigger={<Icons.burger className='h-7 w-7'/>}
53
- >
54
- <MobileNav
55
- siteDef={siteDef}
56
- className='pt-12'
57
- commonItemClx='px-10 text-l h-10 justify-start border-b rounded-none'
58
- />
59
- </DrawerMenu>
60
- </div>
61
- </div>
62
- </header>
63
- )
64
- }
65
-
66
- export default Header
@@ -1,72 +0,0 @@
1
- 'use client'
2
- import React from 'react'
3
-
4
- import { type ButtonVariants, LinkElement } from '../../primitives'
5
- import type { LinkDef, SiteDef } from '../../types'
6
- import { cn } from '../../util'
7
-
8
- const MobileNav: React.FC<{
9
- siteDef: SiteDef
10
- className?: string
11
- commonItemClx?: string | ((def: LinkDef) => string),
12
- /**
13
- * This is called *in addition* to the link's actual navigation
14
- * action. eg, I link is clicked, and the modal menu is closes
15
- */
16
- onAction?: () => void
17
- }> = ({
18
- siteDef,
19
- onAction,
20
- className='',
21
- commonItemClx,
22
- }) => {
23
-
24
- const { nav: { common, featured }} = siteDef
25
-
26
- return (common.length || featured?.length) ? (
27
- <nav className={className} >
28
- {common.map((el, index) => {
29
- const variant = el.variant ?? 'link'
30
- let internalClx = ''
31
- // note that linkFG (or any other variant of 'link')
32
- // will not get assigned these classes,
33
- // and will remain styles is 'foreground' (hence the name)
34
- if (variant === 'link') {
35
- internalClx+= ' text-nav hover:text-nav-hover active:text-nav-hover '
36
- if (siteDef.currentAs && siteDef.currentAs === el.href) {
37
- internalClx += ' text-nav-current'
38
- }
39
- }
40
- else {
41
- internalClx+= ' min-w-0'
42
- }
43
- if (siteDef.currentAs && siteDef.currentAs === el.href) {
44
- internalClx += ' pointer-events-none'
45
- }
46
- const itemClx = (commonItemClx) ? (typeof commonItemClx === 'string' ? commonItemClx : commonItemClx(el)) : ''
47
-
48
- return (
49
- <LinkElement
50
- def={el}
51
- key={`common-${index}`}
52
- size='lg'
53
- className={cn(internalClx, itemClx)}
54
- onClick = {onAction}
55
- />
56
- )
57
- })}
58
- {featured?.length && (featured.map((el, index) => (
59
- <LinkElement
60
- def={el}
61
- key={`featured-${index}`}
62
- size='lg'
63
- className='mt-6 w-4/5 mx-auto'
64
- onClick={onAction}
65
- />
66
- )))}
67
- </nav>
68
- )
69
- : null
70
- }
71
-
72
- export default MobileNav