@hanzo/ui 0.5.11 → 0.5.12
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/bullet-cards-block.tsx +5 -3
- package/blocks/components/card-block.tsx +1 -1
- package/blocks/components/carte-blanche-block/index.tsx +15 -2
- package/blocks/components/enh-heading-block.tsx +4 -3
- package/blocks/components/grid-block/table-borders.mutator.ts +1 -1
- package/blocks/components/video-block.tsx +2 -2
- package/blocks/def/bullet-cards-block.ts +1 -0
- package/blocks/def/carte-blanche-block.ts +1 -0
- package/common/chat-widget.tsx +2 -2
- package/package.json +1 -1
- package/siteDef/main-nav.ts +5 -5
- package/types/grid-def.ts +20 -1
- package/types/index.ts +1 -1
|
@@ -19,20 +19,22 @@ const BulletCardsBlockComponent: React.FC<BlockComponentProps> = ({
|
|
|
19
19
|
const b = block as BulletCardsBlock
|
|
20
20
|
const specified = (s: string) => (containsToken(b.specifiers, s))
|
|
21
21
|
|
|
22
|
+
const noBorder = specified('no-card-border') ? 'border-0' : 'md:border'
|
|
23
|
+
|
|
22
24
|
const borderclx = specified('border-muted-3') ?
|
|
23
25
|
'md:border-muted-3'
|
|
24
26
|
:
|
|
25
27
|
(specified('border-muted-1') ? 'md:border-muted-1' : 'md:border-muted-2')
|
|
26
28
|
|
|
27
|
-
|
|
28
29
|
return (
|
|
29
30
|
<GridBlockComponent block={{blockType: 'grid', grid: b.grid} as Block} className={className} agent={agent}>
|
|
30
31
|
{b.cards.map((card, index) => (
|
|
31
|
-
<div key={index} className={cn('px-0 sm:px-4 py-1 md:py-4
|
|
32
|
+
<div key={index} className={cn('px-0 sm:px-4 py-1 md:py-4 rounded-lg ' +
|
|
32
33
|
'flex flex-row justify-start items-center not-typography text-foreground',
|
|
34
|
+
noBorder,
|
|
33
35
|
borderclx
|
|
34
36
|
)}>
|
|
35
|
-
<InlineIcon icon={card.icon} size={b.iconSize ?? 28} agent={agent} className='shrink-0 mr-2
|
|
37
|
+
<InlineIcon icon={card.icon} size={b.iconSize ?? 28} agent={agent} className='shrink-0 mr-2 md:mr-4 '/>
|
|
36
38
|
<p className='m-0 text-sm sm:text-base'>{card.text}</p>
|
|
37
39
|
</div>
|
|
38
40
|
))}
|
|
@@ -83,7 +83,7 @@ const CardBlockComponent: React.FC<
|
|
|
83
83
|
|
|
84
84
|
const ghost = has('ghost') // no outer padding, no borders, larger title, all left-aligned bg is same (default)
|
|
85
85
|
|
|
86
|
-
const contentclx = (has('content-left') ? 'items-start ' : 'items-center ') + contentClassName
|
|
86
|
+
const contentclx = (has('content-left') ? 'items-start ' : ' items-center ') + (has('content-top') ? '!justify-start' : '') + contentClassName
|
|
87
87
|
const disabledBorder = (has('appear-disabled' ) ? ' border-muted-4' : ' border-muted-3')
|
|
88
88
|
const outerBorder = ((has('no-outer-border') || ghost) ? ' border-0' : '')
|
|
89
89
|
const innerBorder = (ghost ? ' border-0' : '')
|
|
@@ -34,6 +34,13 @@ const _getClx = (specifier: string, section: CardSection): string => {
|
|
|
34
34
|
} break
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
if (specifier === 'big-padding-content') {
|
|
38
|
+
switch (section) {
|
|
39
|
+
case 'content': {
|
|
40
|
+
result = 'md:p-8 lg:p-12 xl:p-16'
|
|
41
|
+
} break
|
|
42
|
+
}
|
|
43
|
+
}
|
|
37
44
|
else if (specifier === 'no-inner-borders') {
|
|
38
45
|
switch (section) {
|
|
39
46
|
case 'header': {
|
|
@@ -71,8 +78,14 @@ const CarteBlancheBlockComponent: React.FC<
|
|
|
71
78
|
getClx('no-inner-borders', 'header'),
|
|
72
79
|
].join(' ')
|
|
73
80
|
|
|
81
|
+
const contentclx = [
|
|
82
|
+
getClx('big-padding-content', 'content'),
|
|
83
|
+
].join(' ')
|
|
84
|
+
|
|
85
|
+
const noOuterBorders = specified('no-outer-borders')
|
|
86
|
+
|
|
74
87
|
return (
|
|
75
|
-
<Card className={cn('flex flex-col ', className)} >
|
|
88
|
+
<Card className={cn('flex flex-col ', className, noOuterBorders ? 'border-none' : '')} >
|
|
76
89
|
{b.heading && (
|
|
77
90
|
<CardHeader className={cn('typography-img:m-0', headingclx)} >
|
|
78
91
|
{b.topContent && (
|
|
@@ -82,7 +95,7 @@ const CarteBlancheBlockComponent: React.FC<
|
|
|
82
95
|
</CardHeader>
|
|
83
96
|
)}
|
|
84
97
|
{b.content && (
|
|
85
|
-
<CardContent className={cn('typography flex flex-col justify-center', className)}>
|
|
98
|
+
<CardContent className={cn('typography flex flex-col justify-center', contentclx, className)}>
|
|
86
99
|
<Content blocks={b.content} agent={agent}/>
|
|
87
100
|
</CardContent>
|
|
88
101
|
)}
|
|
@@ -124,6 +124,7 @@ const EnhHeadingBlockComponent: React.FC<
|
|
|
124
124
|
const specified = (s: string) => (containsToken(b.specifiers + extraSpecifiers, s))
|
|
125
125
|
const preheadingHeadingFont = specified('preheading-heading-font')
|
|
126
126
|
const phFontClx = preheadingHeadingFont ? 'font-heading' : ''
|
|
127
|
+
const alignMiddleClx = specified('align-middle') ? 'my-auto' : ''
|
|
127
128
|
|
|
128
129
|
const positionclx = getPositionClx(specified, agent)
|
|
129
130
|
|
|
@@ -167,7 +168,7 @@ const EnhHeadingBlockComponent: React.FC<
|
|
|
167
168
|
if (b.icon && !iconRendered) {
|
|
168
169
|
iconRendered = true
|
|
169
170
|
return (
|
|
170
|
-
<div className={cn('flex flex-row items-center', clx)} key={`div-${index}`}>
|
|
171
|
+
<div className={cn('flex flex-row items-center gap-2 sm:gap-4', clx)} key={`div-${index}`}>
|
|
171
172
|
<InlineIcon icon={b.icon} size={b.iconSize ?? 32} agent={agent}/>
|
|
172
173
|
<Element asTag={tag} text={text} />
|
|
173
174
|
</div>
|
|
@@ -181,11 +182,11 @@ const EnhHeadingBlockComponent: React.FC<
|
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
return applyTypography ? (
|
|
184
|
-
<ApplyTypography className={cn('flex flex-col w-full !gap-0', className)}>
|
|
185
|
+
<ApplyTypography className={cn('flex flex-col w-full !gap-0', className, alignMiddleClx)}>
|
|
185
186
|
<Inner />
|
|
186
187
|
</ApplyTypography>
|
|
187
188
|
) : (
|
|
188
|
-
<div className={cn('flex flex-col w-full gap-0', className)}>
|
|
189
|
+
<div className={cn('flex flex-col w-full gap-0', className, alignMiddleClx)}>
|
|
189
190
|
<Inner />
|
|
190
191
|
</div>
|
|
191
192
|
)
|
|
@@ -108,7 +108,7 @@ const VideoBlockComponent: React.FC<BlockComponentProps & {
|
|
|
108
108
|
}
|
|
109
109
|
return ((
|
|
110
110
|
<VideoPlayer
|
|
111
|
-
className={className}
|
|
111
|
+
className={cn('mx-auto', className)}
|
|
112
112
|
sources={b.sources}
|
|
113
113
|
width={dim.w}
|
|
114
114
|
height={dim.h}
|
|
@@ -125,7 +125,7 @@ const VideoBlockComponent: React.FC<BlockComponentProps & {
|
|
|
125
125
|
<Image src={b.poster!} alt='image' width={conDim.w} height={conDim.h} className={className}/>
|
|
126
126
|
) : (
|
|
127
127
|
<VideoPlayer
|
|
128
|
-
className={className}
|
|
128
|
+
className={cn('mx-auto', className)}
|
|
129
129
|
sources={b.sources}
|
|
130
130
|
width={conDim.w}
|
|
131
131
|
height={conDim.h}
|
|
@@ -6,6 +6,7 @@ import type EnhHeadingBlock from './enh-heading-block'
|
|
|
6
6
|
interface CarteBlancheBlock extends Block {
|
|
7
7
|
blockType: 'carte-blanche'
|
|
8
8
|
// big-padding
|
|
9
|
+
// no-outer-borders
|
|
9
10
|
// no-internal-borders
|
|
10
11
|
// style-ghost (no-internal-borders, no outer border, no padding)
|
|
11
12
|
specifiers?: string
|
package/common/chat-widget.tsx
CHANGED
|
@@ -47,7 +47,7 @@ const ChatWidget: React.FC<{
|
|
|
47
47
|
return (<>
|
|
48
48
|
<div className={
|
|
49
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-[
|
|
50
|
+
'sm:max-w-[400px] sm:max-h-[550px] sm:px-4 z-[1002] ' +
|
|
51
51
|
(showChatbot ? 'flex' : 'hidden')
|
|
52
52
|
}>
|
|
53
53
|
<Card className='flex flex-col h-full w-full'>
|
|
@@ -65,7 +65,7 @@ const ChatWidget: React.FC<{
|
|
|
65
65
|
variant='outline'
|
|
66
66
|
size='link'
|
|
67
67
|
onClick={onClick}
|
|
68
|
-
className='fixed bottom-4 right-0 h-12 w-12 mx-4 rounded-full'
|
|
68
|
+
className='fixed bottom-4 right-0 h-12 w-12 mx-4 rounded-full z-[1001]'
|
|
69
69
|
>
|
|
70
70
|
{showChatbot ? <X /> : <LuxLogo width={24} height={24} className='mt-2' />}
|
|
71
71
|
</Button>
|
package/package.json
CHANGED
package/siteDef/main-nav.ts
CHANGED
|
@@ -11,6 +11,11 @@ export default [
|
|
|
11
11
|
href: "https://lux.credit",
|
|
12
12
|
newTab: false,
|
|
13
13
|
},
|
|
14
|
+
{
|
|
15
|
+
title: "Exchange",
|
|
16
|
+
href: "https://lux.exchange",
|
|
17
|
+
newTab: false,
|
|
18
|
+
},
|
|
14
19
|
{
|
|
15
20
|
title: "Finance",
|
|
16
21
|
href: "https://lux.finance",
|
|
@@ -26,10 +31,5 @@ export default [
|
|
|
26
31
|
href: "https://lux.network",
|
|
27
32
|
newTab: false,
|
|
28
33
|
},
|
|
29
|
-
{
|
|
30
|
-
title: "Exchange",
|
|
31
|
-
href: "https://lux.exchange",
|
|
32
|
-
newTab: false,
|
|
33
|
-
},
|
|
34
34
|
] satisfies LinkDef[]
|
|
35
35
|
|
package/types/grid-def.ts
CHANGED
|
@@ -10,6 +10,15 @@ interface GridDef {
|
|
|
10
10
|
mobile?: GridColumnSpec
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
const COMMON_GRID_1_COL = {
|
|
14
|
+
at: {
|
|
15
|
+
xs: { columns: 1, gap: 2 },
|
|
16
|
+
md: { columns: 1, gap: 3 },
|
|
17
|
+
lg: { columns: 1, gap: 6 }
|
|
18
|
+
},
|
|
19
|
+
mobile: { columns: 1, gap: 2 }
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
const COMMON_GRID_2_COL = {
|
|
14
23
|
at: {
|
|
15
24
|
xs: {columns: 1, gap: 2},
|
|
@@ -28,10 +37,20 @@ const COMMON_GRID_3_COL = {
|
|
|
28
37
|
mobile: {columns: 1, gap: 2}
|
|
29
38
|
} as GridDef
|
|
30
39
|
|
|
40
|
+
const COMMON_GRID_4_COL = {
|
|
41
|
+
at: {
|
|
42
|
+
xs: {columns: 1, gap: 2},
|
|
43
|
+
md: {columns: 2, gap: 3},
|
|
44
|
+
lg: {columns: 4, gap: 6}
|
|
45
|
+
},
|
|
46
|
+
mobile: {columns: 1, gap: 2}
|
|
47
|
+
} as GridDef
|
|
31
48
|
|
|
32
49
|
export {
|
|
33
50
|
type GridDef as default,
|
|
34
51
|
type GridColumnSpec,
|
|
52
|
+
COMMON_GRID_1_COL,
|
|
35
53
|
COMMON_GRID_2_COL,
|
|
36
|
-
COMMON_GRID_3_COL
|
|
54
|
+
COMMON_GRID_3_COL,
|
|
55
|
+
COMMON_GRID_4_COL
|
|
37
56
|
}
|
package/types/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export {
|
|
|
6
6
|
type ButtonModalDef,
|
|
7
7
|
} from './button-def'
|
|
8
8
|
|
|
9
|
-
export { COMMON_GRID_2_COL, COMMON_GRID_3_COL } from './grid-def'
|
|
9
|
+
export { COMMON_GRID_1_COL, COMMON_GRID_2_COL, COMMON_GRID_3_COL, COMMON_GRID_4_COL } from './grid-def'
|
|
10
10
|
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'
|