@hanzo/ui 1.0.15 → 2.0.1
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.
- package/blocks/components/card-block.tsx +1 -1
- package/package.json +8 -10
- package/primitives/icons/index.ts +18 -0
- package/primitives/index.ts +1 -0
- package/primitives/toggle-group.tsx +1 -1
- package/primitives/youtube-embed.tsx +1 -1
- package/style/hanzo-default-colors.css +2 -2
- package/{context-providers → style}/theme-provider.tsx +2 -2
- package/tailwind/fontFamily.tailwind.ts +7 -0
- package/tailwind/{fonts.tailwind.ts → fontSize.tailwind.ts} +1 -19
- package/tailwind/index.ts +8 -5
- package/tailwind/{tailwind.config.base.js → tailwind.config.hanzo-preset.js} +3 -2
- package/tailwind/typo-plugin/get-plugin-styles.js +42 -42
- package/tailwind/typography-test.mdx +1 -1
- package/types/index.ts +5 -15
- package/assets/lux-site-icons/android-chrome-192x192.png +0 -0
- package/assets/lux-site-icons/android-chrome-512x512.png +0 -0
- package/assets/lux-site-icons/apple-touch-icon.png +0 -0
- package/assets/lux-site-icons/favicon-16x16.png +0 -0
- package/assets/lux-site-icons/favicon-32x32.png +0 -0
- package/assets/lux-site-icons/favicon.ico +0 -0
- package/assets/standard-docs/LUX-NFT-Terms-and-Conditions.pdf +0 -0
- package/assets/standard-docs/LUX-Privacy-Policy.pdf +0 -0
- package/common/chat-widget.tsx +0 -75
- package/common/contact-dialog/contact-form.tsx +0 -111
- package/common/contact-dialog/disclaimer.tsx +0 -13
- package/common/contact-dialog/index.tsx +0 -48
- package/common/copyright.tsx +0 -21
- package/common/drawer-menu.tsx +0 -54
- package/common/footer.tsx +0 -77
- package/common/head-metadata/from-next/metadata-types.ts +0 -158
- package/common/head-metadata/from-next/opengraph-types.ts +0 -267
- package/common/head-metadata/from-next/twitter-types.ts +0 -92
- package/common/head-metadata/index.tsx +0 -208
- package/common/header/index.tsx +0 -66
- package/common/header/mobile-nav.tsx +0 -72
- package/common/header/theme-toggle.tsx +0 -26
- package/common/icons/index.tsx +0 -34
- package/common/icons/lux-logo.tsx +0 -10
- package/common/icons/secure-delivery.tsx +0 -13
- package/common/icons/social-icon.tsx +0 -35
- package/common/index.ts +0 -14
- package/common/logo.tsx +0 -71
- package/common/mini-chart/index.tsx +0 -8
- package/common/mini-chart/mini-chart-props.ts +0 -44
- package/common/mini-chart/mini-chart.tsx +0 -76
- package/common/mini-chart/wrapper.tsx +0 -23
- package/context-providers/index.ts +0 -1
- package/next/README.md +0 -11
- package/next/analytics/fpixel.ts +0 -18
- package/next/analytics/pixel-analytics.tsx +0 -55
- package/next/determine-device-middleware.ts +0 -16
- package/next/fonts/DrukTextWide-Bold-Trial.otf +0 -0
- package/next/fonts/DrukTextWide-Heavy-Trial.otf +0 -0
- package/next/fonts/DrukTextWide-Medium-Trial.otf +0 -0
- package/next/fonts/DrukWide-Bold-Trial.otf +0 -0
- package/next/fonts/DrukWide-Heavy-Trial.otf +0 -0
- package/next/fonts/DrukWide-Medium-Trial.otf +0 -0
- package/next/get-app-router-font-classes.ts +0 -12
- package/next/load-and-return-lux-next-fonts-on-import.ts +0 -94
- package/next/next-font-desc.ts +0 -28
- package/next/not-found-content.mdx +0 -5
- package/next/not-found.tsx +0 -23
- package/next/pages-router-font-vars.tsx +0 -18
- package/next/root-layout.tsx +0 -62
- package/siteDef/footer/community.tsx +0 -67
- package/siteDef/footer/company.ts +0 -37
- package/siteDef/footer/ecosystem.ts +0 -37
- package/siteDef/footer/index.tsx +0 -26
- package/siteDef/footer/legal.ts +0 -28
- package/siteDef/footer/network.ts +0 -37
- package/siteDef/footer/svg/warpcast-logo.svg +0 -12
- package/siteDef/main-nav.ts +0 -35
- package/style/social-svg.css +0 -3
- package/tailwind/lux-tw-fonts.ts +0 -37
- package/types/site-def.ts +0 -36
- /package/{common → primitives}/icons/github.tsx +0 -0
- /package/{common → primitives}/icons/youtube-logo.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"clean": "rm -rf dist && rm -rf node_modules"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hookform/resolvers": "^3.3.2",
|
|
33
32
|
"@next/third-parties": "^14.1.0",
|
|
34
33
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
35
34
|
"@radix-ui/react-aspect-ratio": "^1.0.3",
|
|
@@ -58,24 +57,23 @@
|
|
|
58
57
|
"lodash.castarray": "^4.4.0",
|
|
59
58
|
"lodash.isplainobject": "^4.0.6",
|
|
60
59
|
"lodash.merge": "^4.6.2",
|
|
61
|
-
"lucide-react": "^0.344.0",
|
|
62
60
|
"markdown-to-jsx": "^7.3.2",
|
|
63
61
|
"postcss-selector-parser": "^6.0.13",
|
|
64
62
|
"react-day-picker": "^8.7.1",
|
|
65
|
-
"react-device-detect": "^2.2.3",
|
|
66
|
-
"react-hook-form": "^7.47.0",
|
|
67
63
|
"react-intersection-observer": "^9.7.0",
|
|
68
|
-
"react-social-icons": "^6.4.0",
|
|
69
64
|
"tailwind-merge": "^2.2.0",
|
|
70
|
-
"tailwindcss-interaction-media": "^0.1.0"
|
|
71
|
-
"validator": "^13.11.0",
|
|
72
|
-
"zod": "3.21.4"
|
|
65
|
+
"tailwindcss-interaction-media": "^0.1.0"
|
|
73
66
|
},
|
|
74
67
|
"peerDependencies": {
|
|
68
|
+
"@hookform/resolvers": "^3.3.2",
|
|
69
|
+
"lucide-react": "^0.344.0",
|
|
75
70
|
"next": "^14.1.0",
|
|
76
71
|
"next-themes": "^0.2.1",
|
|
77
72
|
"react": "^18.2.0",
|
|
78
|
-
"react-dom": "^18.2.0"
|
|
73
|
+
"react-dom": "^18.2.0",
|
|
74
|
+
"react-hook-form": "^7.47.0",
|
|
75
|
+
"validator": "^13.11.0",
|
|
76
|
+
"zod": "3.21.4"
|
|
79
77
|
},
|
|
80
78
|
"devDependencies": {
|
|
81
79
|
"@mdx-js/loader": "^3.0.0",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Moon as moon,
|
|
3
|
+
SunMedium as sun,
|
|
4
|
+
Menu as burger,
|
|
5
|
+
ArrowUpRight as linkOut,
|
|
6
|
+
} from 'lucide-react'
|
|
7
|
+
|
|
8
|
+
import youtube from './youtube-logo'
|
|
9
|
+
import gitHub from './github'
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
sun,
|
|
13
|
+
moon,
|
|
14
|
+
burger,
|
|
15
|
+
gitHub,
|
|
16
|
+
linkOut,
|
|
17
|
+
youtube,
|
|
18
|
+
}
|
package/primitives/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
@layer base {
|
|
5
5
|
|
|
6
|
-
:root, .
|
|
6
|
+
:root, .hanzo-ui-light-theme {
|
|
7
7
|
--hz-ui-fg-0: hsl(0 0% 0%);
|
|
8
8
|
--hz-ui-fg-body: hsl(0 0% 10%);
|
|
9
9
|
--hz-ui-fg-1: hsl(0 0% 20%);
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
--hz-ui-radius: 0.5rem;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.
|
|
52
|
+
.hanzo-ui-dark-theme {
|
|
53
53
|
|
|
54
54
|
--hz-ui-fg-0: hsl(0 0% 100%);
|
|
55
55
|
--hz-ui-fg-body: hsl(0, 0%, 97%);
|
|
@@ -9,8 +9,8 @@ const ThemeProvider: React.FC<ThemeProviderProps> = ({ children, ...props }) =>
|
|
|
9
9
|
attribute="class"
|
|
10
10
|
{...props}
|
|
11
11
|
value={{
|
|
12
|
-
light: '
|
|
13
|
-
dark: '
|
|
12
|
+
light: 'hanzo-ui-light-theme',
|
|
13
|
+
dark: 'hanzo-ui-dark-theme'
|
|
14
14
|
}}
|
|
15
15
|
>
|
|
16
16
|
{children}
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type TwFontDesc from './tw-font-desc'
|
|
3
|
-
|
|
4
|
-
export const fontFamily = (ignoreTheme: any): {
|
|
5
|
-
[key: string]: string[]
|
|
6
|
-
} => {
|
|
7
|
-
|
|
8
|
-
let result: any = {}
|
|
9
|
-
luxTwFonts.forEach((font: TwFontDesc) => {
|
|
10
|
-
result[font.twName] = font.fontFamily
|
|
11
|
-
// eg: heading: ['var(--font-druk-text-wide)']
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
return result as {
|
|
15
|
-
[key: string]: string[]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const fontSize = {
|
|
1
|
+
export default {
|
|
20
2
|
xxs: ['0.65rem', { lineHeight: '0.8rem' }], // very fine print
|
|
21
3
|
xs: ['0.8rem', { lineHeight: '1rem' }], // fine print
|
|
22
4
|
sm: ['0.9rem', { lineHeight: '1.2rem' }], // 'standard' some news article cards (set manually when using typography-sm)
|
package/tailwind/index.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import colors from './colors.tailwind'
|
|
2
|
-
import
|
|
2
|
+
import fontSize from './fontSize.tailwind'
|
|
3
|
+
import fontFamily from './fontFamily.tailwind'
|
|
3
4
|
import safelist from './safelist.tailwind'
|
|
4
5
|
import screens from './screens.tailwind'
|
|
5
6
|
import spacing from './spacing.tailwind'
|
|
6
7
|
import typographyPlugin from './typo-plugin'
|
|
7
|
-
import
|
|
8
|
+
import preset from './tailwind.config.hanzo-preset'
|
|
9
|
+
import type TwFontDesc from './tw-font-desc'
|
|
8
10
|
|
|
9
11
|
export {
|
|
10
12
|
colors,
|
|
11
|
-
|
|
12
|
-
fontFamily,
|
|
13
|
+
preset,
|
|
13
14
|
fontSize,
|
|
15
|
+
fontFamily,
|
|
14
16
|
safelist,
|
|
15
17
|
screens,
|
|
16
18
|
spacing,
|
|
17
|
-
typographyPlugin
|
|
19
|
+
typographyPlugin,
|
|
20
|
+
type TwFontDesc
|
|
18
21
|
}
|
|
@@ -6,7 +6,8 @@ import colors from './colors.tailwind'
|
|
|
6
6
|
import safelist from './safelist.tailwind'
|
|
7
7
|
import screens from './screens.tailwind'
|
|
8
8
|
import spacing from './spacing.tailwind'
|
|
9
|
-
import
|
|
9
|
+
import fontSize from './fontSize.tailwind'
|
|
10
|
+
import fontFamily from './fontFamily.tailwind'
|
|
10
11
|
import typographyPlugin from './typo-plugin'
|
|
11
12
|
|
|
12
13
|
export default {
|
|
@@ -296,7 +297,7 @@ export default {
|
|
|
296
297
|
0: '0',
|
|
297
298
|
DEFAULT: '1',
|
|
298
299
|
},
|
|
299
|
-
fontFamily,
|
|
300
|
+
fontFamily,
|
|
300
301
|
fontSize,
|
|
301
302
|
fontWeight: {
|
|
302
303
|
thin: '100',
|
|
@@ -7,29 +7,29 @@ import {
|
|
|
7
7
|
const typographyColorTheme = {
|
|
8
8
|
// vars are defined in global.css
|
|
9
9
|
// and dark mode is handled at that level.
|
|
10
|
-
'--tw-
|
|
11
|
-
'--tw-
|
|
12
|
-
'--tw-
|
|
13
|
-
'--tw-
|
|
14
|
-
'--tw-
|
|
15
|
-
'--tw-
|
|
16
|
-
'--tw-
|
|
17
|
-
'--tw-
|
|
18
|
-
'--tw-
|
|
19
|
-
'--tw-
|
|
20
|
-
'--tw-
|
|
21
|
-
'--tw-
|
|
22
|
-
'--tw-
|
|
23
|
-
'--tw-
|
|
24
|
-
'--tw-
|
|
25
|
-
'--tw-
|
|
26
|
-
'--tw-
|
|
27
|
-
'--tw-
|
|
10
|
+
'--tw-typo-plugin-body': "var(--hz-ui-fg-body)",
|
|
11
|
+
'--tw-typo-plugin-headings': "var(--hz-ui-fg-0)",
|
|
12
|
+
'--tw-typo-plugin-links': "var(--hz-ui-fg-0)",
|
|
13
|
+
'--tw-typo-plugin-links-hover': "var(--hz-ui-fg-2)",
|
|
14
|
+
'--tw-typo-plugin-bold': "var(--hz-ui-fg-0)",
|
|
15
|
+
'--tw-typo-plugin-counters': "var(--hz-ui-fg-4)",
|
|
16
|
+
'--tw-typo-plugin-bullets': "var(--hz-ui-fg-2)",
|
|
17
|
+
'--tw-typo-plugin-hr': "var(--hz-ui-fg-2)",
|
|
18
|
+
'--tw-typo-plugin-quotes': "var(--hz-ui-fg-body)",
|
|
19
|
+
'--tw-typo-plugin-quote-borders': "var(--hz-ui-fg-3)",
|
|
20
|
+
'--tw-typo-plugin-captions': "var(--hz-ui-fg-2)",
|
|
21
|
+
'--tw-typo-plugin-kbd': "var(--hz-ui-fg-0)",
|
|
22
|
+
'--tw-typo-plugin-kbd-shadows': "var(--hz-ui-fg-1)",
|
|
23
|
+
'--tw-typo-plugin-code': "var(--hz-ui-fg-0)",
|
|
24
|
+
'--tw-typo-plugin-pre-code': "var(--hz-ui-fg-1)",
|
|
25
|
+
'--tw-typo-plugin-pre-bg': "var(--hz-ui-bg-1)",
|
|
26
|
+
'--tw-typo-plugin-th-borders': "var(--hz-ui-fg-2)",
|
|
27
|
+
'--tw-typo-plugin-td-borders': "var(--hz-ui-fg-3)",
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const defaultCSS = {
|
|
31
31
|
|
|
32
|
-
color: 'var(--tw-
|
|
32
|
+
color: 'var(--tw-typo-plugin-body)',
|
|
33
33
|
// YUCK maxWidth: '65ch',
|
|
34
34
|
p: {
|
|
35
35
|
textAlign: 'inherit'
|
|
@@ -37,17 +37,17 @@ const defaultCSS = {
|
|
|
37
37
|
'p:first-child': {},
|
|
38
38
|
'p:last-child': {},
|
|
39
39
|
a: {
|
|
40
|
-
color: 'var(--tw-
|
|
40
|
+
color: 'var(--tw-typo-plugin-links)',
|
|
41
41
|
textDecoration: 'underline',
|
|
42
42
|
fontWeight: '400',
|
|
43
43
|
},
|
|
44
44
|
'a:hover': {
|
|
45
|
-
color: 'var(--tw-
|
|
45
|
+
color: 'var(--tw-typo-plugin-links-hover)',
|
|
46
46
|
},
|
|
47
47
|
blockquote: {
|
|
48
48
|
fontWeight: '400',
|
|
49
49
|
fontStyle: 'italic',
|
|
50
|
-
color: 'var(--tw-
|
|
50
|
+
color: 'var(--tw-typo-plugin-quotes)',
|
|
51
51
|
quotes: '"\\201C""\\201D""\\2018""\\2019"',
|
|
52
52
|
},
|
|
53
53
|
//'blockquote::before': {},
|
|
@@ -65,7 +65,7 @@ const defaultCSS = {
|
|
|
65
65
|
display: 'block',
|
|
66
66
|
fontStyle: 'normal',
|
|
67
67
|
textAlign: 'right',
|
|
68
|
-
color: 'var(--tw-
|
|
68
|
+
color: 'var(--tw-typo-plugin-quotes)',
|
|
69
69
|
},
|
|
70
70
|
ol: {
|
|
71
71
|
listStyleType: 'decimal',
|
|
@@ -75,44 +75,44 @@ const defaultCSS = {
|
|
|
75
75
|
},
|
|
76
76
|
'ol > li::marker': {
|
|
77
77
|
fontWeight: '400',
|
|
78
|
-
color: 'var(--tw-
|
|
78
|
+
color: 'var(--tw-typo-plugin-counters)',
|
|
79
79
|
},
|
|
80
80
|
'ul > li::marker': {
|
|
81
|
-
color: 'var(--tw-
|
|
81
|
+
color: 'var(--tw-typo-plugin-bullets)',
|
|
82
82
|
},
|
|
83
83
|
'ul > li::before': {
|
|
84
84
|
},
|
|
85
85
|
hr: {
|
|
86
|
-
borderColor: 'var(--tw-
|
|
86
|
+
borderColor: 'var(--tw-typo-plugin-hr)',
|
|
87
87
|
borderTopWidth: 1,
|
|
88
88
|
},
|
|
89
89
|
h1: {
|
|
90
|
-
color: 'var(--tw-
|
|
90
|
+
color: 'var(--tw-typo-plugin-headings)',
|
|
91
91
|
fontWeight: '800',
|
|
92
92
|
textAlign: 'inherit'
|
|
93
93
|
},
|
|
94
94
|
h2: {
|
|
95
|
-
color: 'var(--tw-
|
|
95
|
+
color: 'var(--tw-typo-plugin-headings)',
|
|
96
96
|
fontWeight: '700',
|
|
97
97
|
textAlign: 'inherit'
|
|
98
98
|
},
|
|
99
99
|
h3: {
|
|
100
|
-
color: 'var(--tw-
|
|
100
|
+
color: 'var(--tw-typo-plugin-headings)',
|
|
101
101
|
fontWeight: '600',
|
|
102
102
|
textAlign: 'inherit'
|
|
103
103
|
},
|
|
104
104
|
h4: {
|
|
105
|
-
color: 'var(--tw-
|
|
105
|
+
color: 'var(--tw-typo-plugin-headings)',
|
|
106
106
|
fontWeight: '600',
|
|
107
107
|
textAlign: 'inherit'
|
|
108
108
|
},
|
|
109
109
|
h5: {
|
|
110
|
-
color: 'var(--tw-
|
|
110
|
+
color: 'var(--tw-typo-plugin-headings)',
|
|
111
111
|
fontWeight: '600',
|
|
112
112
|
textAlign: 'inherit'
|
|
113
113
|
},
|
|
114
114
|
h6: {
|
|
115
|
-
color: 'var(--tw-
|
|
115
|
+
color: 'var(--tw-typo-plugin-headings)',
|
|
116
116
|
textAlign: 'inherit'
|
|
117
117
|
},
|
|
118
118
|
img: {},
|
|
@@ -124,19 +124,19 @@ const defaultCSS = {
|
|
|
124
124
|
display: 'block',
|
|
125
125
|
},
|
|
126
126
|
strong: {
|
|
127
|
-
color: 'var(--tw-
|
|
127
|
+
color: 'var(--tw-typo-plugin-bold)',
|
|
128
128
|
fontWeight: '600',
|
|
129
129
|
},
|
|
130
130
|
video: {},
|
|
131
131
|
kbd: {
|
|
132
132
|
fontWeight: '500',
|
|
133
133
|
fontFamily: 'inherit',
|
|
134
|
-
color: 'var(--tw-
|
|
134
|
+
color: 'var(--tw-typo-plugin-kbd)',
|
|
135
135
|
boxShadow:
|
|
136
|
-
'0 0 0 1px rgb(var(--tw-
|
|
136
|
+
'0 0 0 1px rgb(var(--tw-typo-plugin-kbd-shadows) / 10%), 0 3px 0 rgb(var(--tw-typo-plugin-kbd-shadows) / 10%)',
|
|
137
137
|
},
|
|
138
138
|
code: {
|
|
139
|
-
color: 'var(--tw-
|
|
139
|
+
color: 'var(--tw-typo-plugin-code)',
|
|
140
140
|
fontWeight: '500',
|
|
141
141
|
},
|
|
142
142
|
'code::before': {
|
|
@@ -173,8 +173,8 @@ const defaultCSS = {
|
|
|
173
173
|
color: 'inherit',
|
|
174
174
|
},
|
|
175
175
|
pre: {
|
|
176
|
-
color: 'var(--tw-
|
|
177
|
-
backgroundColor: 'var(--tw-
|
|
176
|
+
color: 'var(--tw-typo-plugin-pre-code)',
|
|
177
|
+
backgroundColor: 'var(--tw-typo-plugin-pre-bg)',
|
|
178
178
|
overflowX: 'auto',
|
|
179
179
|
fontWeight: '400',
|
|
180
180
|
},
|
|
@@ -202,10 +202,10 @@ const defaultCSS = {
|
|
|
202
202
|
},
|
|
203
203
|
thead: {
|
|
204
204
|
borderBottomWidth: '1px',
|
|
205
|
-
borderBottomColor: 'var(--tw-
|
|
205
|
+
borderBottomColor: 'var(--tw-typo-plugin-th-borders)',
|
|
206
206
|
},
|
|
207
207
|
'thead th': {
|
|
208
|
-
color: 'var(--tw-
|
|
208
|
+
color: 'var(--tw-typo-plugin-headings)',
|
|
209
209
|
fontWeight: '600',
|
|
210
210
|
verticalAlign: 'bottom',
|
|
211
211
|
},
|
|
@@ -218,7 +218,7 @@ const defaultCSS = {
|
|
|
218
218
|
},
|
|
219
219
|
tfoot: {
|
|
220
220
|
borderTopWidth: '1px',
|
|
221
|
-
borderTopColor: 'var(--tw-
|
|
221
|
+
borderTopColor: 'var(--tw-typo-plugin-th-borders)',
|
|
222
222
|
},
|
|
223
223
|
'tfoot td': {
|
|
224
224
|
verticalAlign: 'top',
|
|
@@ -244,7 +244,7 @@ const defaultModifiers = (base) => ({
|
|
|
244
244
|
a: {},
|
|
245
245
|
'a:hover': {},
|
|
246
246
|
blockquote: {
|
|
247
|
-
//color: 'blue', //var(--tw-
|
|
247
|
+
//color: 'blue', //var(--tw-typo-plugin-quotes)',
|
|
248
248
|
//marginTop: pxToEm(32, 20),
|
|
249
249
|
//marginBottom: pxToEm(32, 20),
|
|
250
250
|
//paddingLeft: pxToEm(20, 20),
|
package/types/index.ts
CHANGED
|
@@ -11,19 +11,9 @@ export type {default as GridDef, GridColumnSpec} from './grid-def'
|
|
|
11
11
|
export type { TShirtDimensions, Dimensions } from './dimensions'
|
|
12
12
|
export type { ContactInfo, ContactInfoFields } from './contact-info'
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import type TShirtSize from './t-shirt-size'
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
type BulletItem,
|
|
23
|
-
type Icon,
|
|
24
|
-
type ImageDef,
|
|
25
|
-
type LinkDef,
|
|
26
|
-
type SiteDef,
|
|
27
|
-
type TShirtSize,
|
|
28
|
-
}
|
|
14
|
+
export type { default as BulletItem } from './bullet-item'
|
|
15
|
+
export type { default as Icon } from './icon'
|
|
16
|
+
export type { default as ImageDef } from './image-def'
|
|
17
|
+
export type { default as LinkDef } from './link-def'
|
|
18
|
+
export type { default as TShirtSize } from './t-shirt-size'
|
|
29
19
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/common/chat-widget.tsx
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { X } from 'lucide-react'
|
|
5
|
-
|
|
6
|
-
import LuxLogo from './icons/lux-logo'
|
|
7
|
-
import { Button, Card } from '../primitives'
|
|
8
|
-
|
|
9
|
-
const ChatWidget: React.FC<{
|
|
10
|
-
title: string,
|
|
11
|
-
chatbotUrl: string,
|
|
12
|
-
subtitle?: string,
|
|
13
|
-
question?: string,
|
|
14
|
-
/*
|
|
15
|
-
Currently supports these icons from remix icons (https://remixicon.com/):
|
|
16
|
-
GlobalLineIcon,
|
|
17
|
-
ShieldFlashLineIcon,
|
|
18
|
-
BankCardLineIcon,
|
|
19
|
-
GroupLineIcon,
|
|
20
|
-
QuestionnaireLineIcon
|
|
21
|
-
*/
|
|
22
|
-
suggestedQuestions?: { heading: string, message: string, icon?: string }[]
|
|
23
|
-
}> = ({
|
|
24
|
-
title,
|
|
25
|
-
chatbotUrl,
|
|
26
|
-
subtitle,
|
|
27
|
-
question,
|
|
28
|
-
suggestedQuestions
|
|
29
|
-
}) => {
|
|
30
|
-
|
|
31
|
-
const [showChatbot, setShowChatbot] = React.useState<boolean>(false)
|
|
32
|
-
|
|
33
|
-
const onClick = () => { setShowChatbot(!showChatbot) }
|
|
34
|
-
|
|
35
|
-
const searchParams = new URLSearchParams()
|
|
36
|
-
if (question) {
|
|
37
|
-
searchParams.append('question', question)
|
|
38
|
-
}
|
|
39
|
-
if (suggestedQuestions) {
|
|
40
|
-
searchParams.append('sQuestions', suggestedQuestions.map(({ message }) => message).join(','))
|
|
41
|
-
searchParams.append('sHeadings', suggestedQuestions.map(({ heading }) => heading).join(','))
|
|
42
|
-
searchParams.append('sIcons', suggestedQuestions.map(({ icon }) => icon).join(','))
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const iframeSrc = `${chatbotUrl}?${searchParams.toString()}`
|
|
46
|
-
|
|
47
|
-
return (<>
|
|
48
|
-
<div className={
|
|
49
|
-
'fixed bottom-0 sm:bottom-20 right-0 w-full h-full ' +
|
|
50
|
-
'sm:max-w-[400px] sm:max-h-[550px] sm:px-4 z-[1002] ' +
|
|
51
|
-
(showChatbot ? 'flex' : 'hidden')
|
|
52
|
-
}>
|
|
53
|
-
<Card className='flex flex-col h-full w-full'>
|
|
54
|
-
<div className='flex px-4 py-2 h-12 bg-level-0 items-center justify-between'>
|
|
55
|
-
<h3 className='font-semibold font-heading'>{title} <span className='opacity-60'>{subtitle}</span></h3>
|
|
56
|
-
<Button onClick={onClick} variant='link' size='icon' className='w-fit sm:hidden'>
|
|
57
|
-
<X />
|
|
58
|
-
</Button>
|
|
59
|
-
</div>
|
|
60
|
-
<iframe src={iframeSrc} className='h-full' />
|
|
61
|
-
</Card>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<Button
|
|
65
|
-
variant='outline'
|
|
66
|
-
size='link'
|
|
67
|
-
onClick={onClick}
|
|
68
|
-
className='fixed bottom-4 right-0 h-12 w-12 mx-4 rounded-full z-[1001]'
|
|
69
|
-
>
|
|
70
|
-
{showChatbot ? <X /> : <LuxLogo width={24} height={24} className='mt-2' />}
|
|
71
|
-
</Button>
|
|
72
|
-
</>)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export default ChatWidget
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import React, { useTransition } from 'react'
|
|
4
|
-
|
|
5
|
-
import { zodResolver } from '@hookform/resolvers/zod'
|
|
6
|
-
import { useForm, type SubmitHandler, type ControllerRenderProps } from 'react-hook-form'
|
|
7
|
-
import * as z from 'zod'
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
import validator from 'validator'
|
|
10
|
-
|
|
11
|
-
import { Loader2 } from 'lucide-react'
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
Button,
|
|
15
|
-
Input,
|
|
16
|
-
Form,
|
|
17
|
-
FormControl,
|
|
18
|
-
FormField,
|
|
19
|
-
FormItem,
|
|
20
|
-
FormMessage,
|
|
21
|
-
} from '../../primitives'
|
|
22
|
-
|
|
23
|
-
import type { ContactInfo, SubmitServerAction } from '../../types'
|
|
24
|
-
|
|
25
|
-
const ValidationSchema = z.object({
|
|
26
|
-
email: z
|
|
27
|
-
.string()
|
|
28
|
-
.min(1, { message: "Email must be provided." })
|
|
29
|
-
.email("Invalid email."),
|
|
30
|
-
phone: z
|
|
31
|
-
.string()
|
|
32
|
-
.min(1, { message: "Telephone must be provided." })
|
|
33
|
-
.refine(validator.isMobilePhone, { message: "Invalid format." })
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
const ContactForm: React.FC<{
|
|
37
|
-
onSubmit: SubmitServerAction
|
|
38
|
-
enclosure: any
|
|
39
|
-
}> = ({
|
|
40
|
-
onSubmit,
|
|
41
|
-
enclosure
|
|
42
|
-
}) => {
|
|
43
|
-
|
|
44
|
-
const form = useForm<ContactInfo>({
|
|
45
|
-
// @ts-ignore (pnpm linking / tsc bug )
|
|
46
|
-
resolver: zodResolver(ValidationSchema),
|
|
47
|
-
defaultValues: {
|
|
48
|
-
email: '',
|
|
49
|
-
phone: '',
|
|
50
|
-
},
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const [isPending, startTransition] = useTransition()
|
|
54
|
-
|
|
55
|
-
const onFormSubmit: SubmitHandler<ContactInfo> = (data) => {
|
|
56
|
-
// https://github.com/orgs/react-hook-form/discussions/10757#discussioncomment-6672403
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
startTransition(async () => {
|
|
59
|
-
await onSubmit(data, enclosure)
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const MyFormItem: React.FC<{
|
|
64
|
-
field: ControllerRenderProps<ContactInfo, 'email'> | ControllerRenderProps<ContactInfo, 'phone'>
|
|
65
|
-
placeholder: string
|
|
66
|
-
}> = ({
|
|
67
|
-
field,
|
|
68
|
-
placeholder
|
|
69
|
-
}) => (
|
|
70
|
-
<FormItem className="space-y-0" >
|
|
71
|
-
<FormControl>
|
|
72
|
-
<Input placeholder={placeholder} {...field} className="mt-0 text-foreground"/>
|
|
73
|
-
</FormControl>
|
|
74
|
-
<div className="flex flex-row justify-start items-stretch gap-2">
|
|
75
|
-
<FormMessage />
|
|
76
|
-
</div>
|
|
77
|
-
</FormItem>
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<Form {...form}>
|
|
82
|
-
<form onSubmit={form.handleSubmit(onFormSubmit)} className="w-3/4">
|
|
83
|
-
<div className='flex flex-col justify-start items-stretch mt-4'>
|
|
84
|
-
<FormField
|
|
85
|
-
control={form.control}
|
|
86
|
-
name='email'
|
|
87
|
-
// @ts-ignore
|
|
88
|
-
render={({ field }) => ( <MyFormItem field={field} placeholder='email'/> )}
|
|
89
|
-
/>
|
|
90
|
-
<FormField
|
|
91
|
-
control={form.control}
|
|
92
|
-
name='phone'
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
render={({ field }) => ( <MyFormItem field={field} placeholder='phone'/> )}
|
|
95
|
-
/>
|
|
96
|
-
<Button disabled={isPending} type='submit' className='bg-primary text-primary-fg hover:bg-primary-hover'>
|
|
97
|
-
{isPending ? (<>
|
|
98
|
-
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
99
|
-
Please wait
|
|
100
|
-
</>
|
|
101
|
-
) : (
|
|
102
|
-
<>Submit</>
|
|
103
|
-
)}
|
|
104
|
-
</Button>
|
|
105
|
-
</div>
|
|
106
|
-
</form>
|
|
107
|
-
</Form>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export default ContactForm
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
const Disclaimer: React.FC = () => (
|
|
4
|
-
<div>
|
|
5
|
-
By entering your mobile number and submitting, you consent to receive text messages from Lux at the number provided.
|
|
6
|
-
Message and data rates may apply. Message frequency varies.
|
|
7
|
-
You can unsubscribe at any time by replying STOP.
|
|
8
|
-
View our <a href='/privacy'>Privacy Policy</a> and <a href='/terms'>Terms & conditions</a>.
|
|
9
|
-
</div>
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
export default Disclaimer
|
|
13
|
-
|