@hanzo/ui 4.4.3 → 4.5.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.
- package/blocks/components/enh-heading-block.tsx +1 -2
- package/blocks/def/card-block.ts +1 -3
- package/blocks/def/enh-heading-block.ts +1 -2
- package/package.json +11 -11
- package/primitives/next/inline-icon.tsx +2 -3
- package/primitives/next/link-element.tsx +2 -2
- package/tailwind/typography-test.mdx +0 -1
- package/types/bullet-item.ts +2 -2
- package/types/index.ts +0 -1
- package/types/link-def.ts +8 -14
- package/types/icon.ts +0 -10
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, {type ElementType} from 'react'
|
|
2
2
|
|
|
3
|
-
import type { Icon } from '../../types'
|
|
4
3
|
import type { EnhHeadingBlock } from '../def'
|
|
5
4
|
import { ApplyTypography } from '../../primitives/index-common'
|
|
6
5
|
import { cn, containsToken } from '../../util'
|
|
@@ -50,7 +49,7 @@ const tagFromLevel = (level: number): ElementType => {
|
|
|
50
49
|
const Element: React.FC<{
|
|
51
50
|
asTag: ElementType
|
|
52
51
|
text: string
|
|
53
|
-
icon?:
|
|
52
|
+
icon?: React.ReactNode
|
|
54
53
|
iconLeft?: boolean
|
|
55
54
|
className?: string
|
|
56
55
|
}> = ({
|
package/blocks/def/card-block.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import { type Icon } from '../../types'
|
|
4
|
-
|
|
5
3
|
import type CTABlock from './cta-block'
|
|
6
4
|
import type Block from './block'
|
|
7
5
|
import type ImageBlock from './image-block'
|
|
@@ -12,7 +10,7 @@ interface CardBlock extends Block {
|
|
|
12
10
|
specifiers?: string // 'media-left' or 'appear-disabled' or 'no-borders', etc... can be combined
|
|
13
11
|
title?: string
|
|
14
12
|
byline?: string
|
|
15
|
-
icon?:
|
|
13
|
+
icon?: React.ReactNode // for title area
|
|
16
14
|
iconAfter?: boolean
|
|
17
15
|
media?: ImageBlock | VideoBlock // TODO: Media Stack
|
|
18
16
|
content?: React.ReactNode
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type Icon from '../../types/icon'
|
|
2
1
|
import type Block from './block'
|
|
3
2
|
|
|
4
3
|
// level is heading tag level. 1 renders as <h1>, etc... 0 renders as <p>
|
|
@@ -22,7 +21,7 @@ interface EnhHeadingBlock extends Block {
|
|
|
22
21
|
specifiers?: string
|
|
23
22
|
// By default, appears inline to left of first element (preheading or heading)
|
|
24
23
|
// unless indicated otherwise in specifiers
|
|
25
|
-
icon?:
|
|
24
|
+
icon?: React.ReactNode // ReactNode or url string to asset
|
|
26
25
|
iconSize?: number // if url string, this sets the size
|
|
27
26
|
preheading?: {
|
|
28
27
|
text: string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
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/",
|
|
@@ -92,13 +92,13 @@
|
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"@hookform/resolvers": "^3.3.2",
|
|
94
94
|
"embla-carousel": "^8.1.6",
|
|
95
|
-
"lucide-react": "
|
|
95
|
+
"lucide-react": "catalog:",
|
|
96
96
|
"mobx": "^6.12.3",
|
|
97
|
-
"next": "
|
|
97
|
+
"next": "catalog:",
|
|
98
98
|
"next-themes": "^0.2.1",
|
|
99
|
-
"react": "
|
|
100
|
-
"react-dom": "
|
|
101
|
-
"react-hook-form": "
|
|
99
|
+
"react": "catalog:",
|
|
100
|
+
"react-dom": "catalog:",
|
|
101
|
+
"react-hook-form": "catalog:",
|
|
102
102
|
"validator": "^13.11.0",
|
|
103
103
|
"zod": "3.23.8"
|
|
104
104
|
},
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
"@types/gtag.js": "^0.0.19",
|
|
111
111
|
"@types/lodash.merge": "^4.6.9",
|
|
112
112
|
"@types/mdx": "^2.0.13",
|
|
113
|
-
"@types/node": "
|
|
114
|
-
"@types/react": "
|
|
115
|
-
"@types/react-dom": "
|
|
116
|
-
"tailwindcss": "
|
|
117
|
-
"typescript": "
|
|
113
|
+
"@types/node": "catalog:",
|
|
114
|
+
"@types/react": "catalog:",
|
|
115
|
+
"@types/react-dom": "catalog:",
|
|
116
|
+
"tailwindcss": "catalog:",
|
|
117
|
+
"typescript": "catalog:"
|
|
118
118
|
}
|
|
119
119
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Image from 'next/image'
|
|
3
3
|
|
|
4
|
-
import type { Icon } from '../../types'
|
|
5
4
|
|
|
6
5
|
const InlineIcon: React.FC<{
|
|
7
6
|
/**
|
|
8
7
|
* If a ReactNode is passed in, it should be set to 'w-full h-auto' so that it can be sized
|
|
9
8
|
* according to width of parent.
|
|
10
9
|
*/
|
|
11
|
-
icon:
|
|
10
|
+
icon: React.ReactNode
|
|
12
11
|
/** default should be handled by calling code. */
|
|
13
12
|
size?: number
|
|
14
13
|
|
|
@@ -29,7 +28,7 @@ const InlineIcon: React.FC<{
|
|
|
29
28
|
}
|
|
30
29
|
return (
|
|
31
30
|
<div className={className}>
|
|
32
|
-
{icon
|
|
31
|
+
{icon}
|
|
33
32
|
</div>
|
|
34
33
|
)
|
|
35
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react'
|
|
2
2
|
import Link from 'next/link'
|
|
3
3
|
|
|
4
|
-
import type { LinkDef
|
|
4
|
+
import type { LinkDef } from '../../types'
|
|
5
5
|
import { buttonVariants } from '../button'
|
|
6
6
|
import { cn, type VariantProps } from '../../util'
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ const LinkElement: React.FC<
|
|
|
23
23
|
onClick?: () => void
|
|
24
24
|
|
|
25
25
|
/** overrides def (eg, for title area)*/
|
|
26
|
-
icon?:
|
|
26
|
+
icon?: React.ReactNode
|
|
27
27
|
/** overrides def */
|
|
28
28
|
iconAfter?: boolean
|
|
29
29
|
className?: string,
|
package/types/bullet-item.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -20,7 +20,6 @@ export {
|
|
|
20
20
|
COMMON_GRID_4_COL
|
|
21
21
|
} from './grid-def'
|
|
22
22
|
|
|
23
|
-
export type { default as Icon } from './icon'
|
|
24
23
|
export type { default as ImageDef } from './image-def'
|
|
25
24
|
export type { default as LinkDef } from './link-def'
|
|
26
25
|
export type { default as TShirtDimensions } from './tshirt-dimensions'
|
package/types/link-def.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { VariantProps } from 'class-variance-authority'
|
|
2
2
|
import type { buttonVariants } from '../primitives/button'
|
|
3
|
-
import type Icon from './icon'
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A Conf object for the LinkElement primitive.
|
|
7
|
+
*/
|
|
10
8
|
interface LinkDef extends VariantProps<typeof buttonVariants> {
|
|
11
9
|
/**
|
|
12
10
|
* If the LinkElement is rendered directly and has children,
|
|
@@ -20,7 +18,7 @@ interface LinkDef extends VariantProps<typeof buttonVariants> {
|
|
|
20
18
|
* the title, icon, iconAfter fields in the supplied LinkDef
|
|
21
19
|
* will be ignored.
|
|
22
20
|
*/
|
|
23
|
-
icon?:
|
|
21
|
+
icon?: React.ReactNode
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* If the LinkElement is rendered directly and has children,
|
|
@@ -31,13 +29,6 @@ interface LinkDef extends VariantProps<typeof buttonVariants> {
|
|
|
31
29
|
|
|
32
30
|
href: string
|
|
33
31
|
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated This field no longer has an effect as
|
|
36
|
-
* the related logic just checks for the presence of 'http'
|
|
37
|
-
* at the start of the URL string
|
|
38
|
-
*/
|
|
39
|
-
external?: boolean
|
|
40
|
-
|
|
41
32
|
/**
|
|
42
33
|
* External links will open in a new tab (via target='_blank') by default,
|
|
43
34
|
* while internal ones will open in the same tab.
|
|
@@ -55,8 +46,11 @@ interface LinkDef extends VariantProps<typeof buttonVariants> {
|
|
|
55
46
|
*/
|
|
56
47
|
contents?: string
|
|
57
48
|
|
|
49
|
+
childMenu?: LinkDef[]
|
|
50
|
+
groupName?: string
|
|
58
51
|
}
|
|
59
52
|
|
|
53
|
+
|
|
60
54
|
export {
|
|
61
55
|
type LinkDef as default
|
|
62
56
|
}
|
package/types/icon.ts
DELETED