@hanzo/ui 0.5.11 → 0.5.13
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/screenful-block/index.tsx +3 -1
- package/blocks/components/space-block.tsx +4 -4
- 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/blocks/def/screenful-block.ts +3 -0
- package/common/chat-widget.tsx +2 -2
- package/package.json +2 -2
- package/siteDef/main-nav.ts +5 -5
- package/tailwind/fonts.tailwind.ts +1 -1
- package/tailwind/spacing.tailwind.js +8 -0
- package/types/grid-def.ts +20 -1
- package/types/index.ts +1 -1
- package/types/site-def.ts +3 -0
- package/util/index.ts +5 -0
|
@@ -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
|
)
|
|
@@ -53,8 +53,10 @@ const ScreenfulComponent: React.FC<{
|
|
|
53
53
|
(agent && agent !== 'desktop') ? 'pt-15 sm:pt-17 pb-0 px-3 sm:px-8' : ''
|
|
54
54
|
]
|
|
55
55
|
|
|
56
|
+
const spreadId = (b.anchorId) ? {id: b.anchorId} : {}
|
|
57
|
+
|
|
56
58
|
return (
|
|
57
|
-
<section className={cn('h-[100vh]', (snapTile ? 'snap-start snap-always' : ''), className)}>
|
|
59
|
+
<section {...spreadId} className={cn('h-[100vh]', (snapTile ? 'snap-start snap-always' : ''), className)}>
|
|
58
60
|
<ApplyTypography className={tileHeight + 'w-full flex flex-row justify-center self-stretch'} >
|
|
59
61
|
<Poster banner={b.banner}>
|
|
60
62
|
{hasBannerVideo() && (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import { ldMerge } from '../../util'
|
|
3
|
+
import { ldMerge, cn } from '../../util'
|
|
4
4
|
|
|
5
5
|
import type { Breakpoint } from '../../types'
|
|
6
6
|
import { SPACE_DEFAULTS , type TWSpaceUnit, type HeadingLevel} from '../def/space-block'
|
|
@@ -33,7 +33,7 @@ const SpaceBlockComponent: React.FC<BlockComponentProps> = ({
|
|
|
33
33
|
// This code path should handle a undefined or empty sizes field.
|
|
34
34
|
if (!b.level) {
|
|
35
35
|
if (typeof b.sizes == 'number') {
|
|
36
|
-
return <div className={`invisible w-[1px] h-${b.sizes}
|
|
36
|
+
return <div className={cn(`invisible w-[1px] h-${b.sizes}`, className) } />
|
|
37
37
|
}
|
|
38
38
|
const _sizes: {
|
|
39
39
|
[key in (Breakpoint)]?: TWSpaceUnit
|
|
@@ -50,14 +50,14 @@ const SpaceBlockComponent: React.FC<BlockComponentProps> = ({
|
|
|
50
50
|
console.log(clx)
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
return <div className={'invisible w-[1px] ' + clx} />
|
|
53
|
+
return <div className={cn('invisible w-[1px] ' + clx, className)} />
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const Tag = TAGS[b.level]
|
|
57
57
|
const heightClx = (b.level === (0 satisfies HeadingLevel as HeadingLevel)) ? 'h-4' : ''
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
|
-
<ApplyTypography>
|
|
60
|
+
<ApplyTypography className={className}>
|
|
61
61
|
<Tag className={'invisible m-0 ' + heightClx} > </Tag>
|
|
62
62
|
</ApplyTypography>
|
|
63
63
|
)
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
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/",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"hanzo"
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
|
-
"
|
|
39
|
+
"lat": "npm show @hanzo/ui version",
|
|
40
40
|
"pub": "npm publish",
|
|
41
41
|
"build": "tsc",
|
|
42
42
|
"tc": "tsc",
|
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
|
|
|
@@ -17,7 +17,7 @@ export const fontFamily = (ignoreTheme: any): {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const fontSize = {
|
|
20
|
-
xxs: ['0.
|
|
20
|
+
xxs: ['0.6.5rem', { lineHeight: '0.8rem' }], // very fine print
|
|
21
21
|
xs: ['0.8rem', { lineHeight: '1rem' }], // fine print
|
|
22
22
|
sm: ['0.9rem', { lineHeight: '1.2rem' }], // 'standard' some news article cards (set manually when using typography-sm)
|
|
23
23
|
base: ['1rem', { lineHeight: 1.4 }],
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
const percentages = {}
|
|
2
|
+
for (let i = 0; i <= 100; i++) {
|
|
3
|
+
percentages[`pr-${i}`] = `${i}%`
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
|
|
1
7
|
export default {
|
|
8
|
+
...percentages,
|
|
2
9
|
px: '1px',
|
|
3
10
|
0: '0px',
|
|
4
11
|
0.5: '0.125rem',
|
|
@@ -55,3 +62,4 @@ export default {
|
|
|
55
62
|
80: '20rem',
|
|
56
63
|
96: '24rem',
|
|
57
64
|
}
|
|
65
|
+
|
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'
|
package/types/site-def.ts
CHANGED
|
@@ -26,6 +26,9 @@ interface SiteDef {
|
|
|
26
26
|
/** default (undefined or absent): @ui/sideDef/footer/legal are rendered */
|
|
27
27
|
/** [] renders nothing above the copyright */
|
|
28
28
|
aboveCopyright?: LinkDef[]
|
|
29
|
+
|
|
30
|
+
/** any site-specific stuff we'd like access to (link urls, etc) */
|
|
31
|
+
ext?: any
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
export { type SiteDef as default }
|