@hanzo/ui 4.4.2 → 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.
@@ -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?: Icon
52
+ icon?: React.ReactNode
54
53
  iconLeft?: boolean
55
54
  className?: string
56
55
  }> = ({
@@ -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?: Icon // for title area
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?: Icon | string // ReactNode or url string to asset
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.4.2",
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": "0.456.0",
95
+ "lucide-react": "catalog:",
96
96
  "mobx": "^6.12.3",
97
- "next": "14.2.16",
97
+ "next": "catalog:",
98
98
  "next-themes": "^0.2.1",
99
- "react": "18.3.1",
100
- "react-dom": "18.3.1",
101
- "react-hook-form": "7.51.4",
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
  },
@@ -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: Icon | string
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 as 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, Icon } from '../../types'
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?: Icon
26
+ icon?: React.ReactNode
27
27
  /** overrides def */
28
28
  iconAfter?: boolean
29
29
  className?: string,
@@ -29,7 +29,6 @@ Lorem ipsum dolor sit [amet]('/'), adipiscing elit, sed do eiusmod tempor incidi
29
29
  def={{
30
30
  title: 'Enter App',
31
31
  href: 'https://app.lux.market',
32
- external: 'true',
33
32
  variant: 'primary',
34
33
  }}
35
34
  size='lg'
@@ -1,8 +1,8 @@
1
- import type Icon from './icon'
1
+ import React from 'react'
2
2
 
3
3
  interface BulletItem {
4
4
  text: string,
5
- icon?: Icon | string // Icon = ReactNode; ReactNode can be a string
5
+ icon?: React.ReactNode // Icon = ReactNode; ReactNode can be a string
6
6
  }
7
7
 
8
8
  export {
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
- * A Conf object for the LinkElement primitive.
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?: 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
@@ -1,10 +0,0 @@
1
- import type { ReactNode } from 'react'
2
-
3
- //import type { LucideIcon} from 'lucide-react'
4
- //import type { SocialIconProps } from '@/components/icons/social-icon'
5
-
6
- type Icon = ReactNode
7
-
8
- export {
9
- type Icon as default
10
- }