@hanzo/ui 0.5.12 → 0.5.14
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/screenful-block/content.tsx +6 -1
- package/blocks/components/screenful-block/index.tsx +6 -4
- package/blocks/components/space-block.tsx +4 -4
- package/blocks/def/screenful-block.ts +3 -0
- package/package.json +2 -2
- package/tailwind/fonts.tailwind.ts +1 -1
- package/tailwind/spacing.tailwind.js +8 -0
- package/tailwind/tailwind.config.base.js +1 -0
- package/types/site-def.ts +3 -0
- package/util/index.ts +5 -0
|
@@ -58,7 +58,12 @@ const ContentColumn: React.FC<{
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
|
-
|
|
61
|
+
if (specified('mobile-vert-center')) {
|
|
62
|
+
modifiers += 'justify-center '
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
modifiers += 'justify-start '
|
|
66
|
+
}
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
if (agent === 'phone' && specified('mobile-center-headings')) {
|
|
@@ -42,7 +42,7 @@ const ScreenfulComponent: React.FC<{
|
|
|
42
42
|
// p&m-modifiers
|
|
43
43
|
// ]
|
|
44
44
|
const cwclx = [
|
|
45
|
-
'z-10
|
|
45
|
+
'z-10 xl:mx-auto max-w-screen-xl overflow-y-hidden ',
|
|
46
46
|
// desktop header: 80px / pt-20
|
|
47
47
|
// mobile header: 44px / pt-11
|
|
48
48
|
narrowGutters ?
|
|
@@ -53,9 +53,11 @@ 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(
|
|
58
|
-
<ApplyTypography className={
|
|
59
|
+
<section {...spreadId} className={cn((snapTile ? 'snap-start snap-always h-[100vh]' : 'min-h-screen'), className)}>
|
|
60
|
+
<ApplyTypography className={cn('w-full flex flex-row justify-center self-stretch', snapTile ? tileHeight : '')} >
|
|
59
61
|
<Poster banner={b.banner}>
|
|
60
62
|
{hasBannerVideo() && (
|
|
61
63
|
<Video
|
|
@@ -64,7 +66,7 @@ const ScreenfulComponent: React.FC<{
|
|
|
64
66
|
initialInView={initialInView}
|
|
65
67
|
/>
|
|
66
68
|
)}
|
|
67
|
-
<div className={cn(...cwclx)} >
|
|
69
|
+
<div className={cn(...cwclx, snapTile ? 'absolute left-0 right-0 top-0 bottom-0' : 'flex min-h-screen w-full')} >
|
|
68
70
|
<Content block={b} agent={agent} className='w-full'/>
|
|
69
71
|
{b.footer}
|
|
70
72
|
</div>
|
|
@@ -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
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.14",
|
|
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",
|
|
@@ -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/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 }
|