@hanzo/ui 3.0.7 → 3.0.10
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/card-block/index.tsx +3 -3
- package/blocks/def/video-block.ts +2 -21
- package/package.json +1 -1
- package/primitives/accordion.tsx +1 -2
- package/primitives/carousel.tsx +3 -5
- package/primitives/drawer.tsx +1 -1
- package/primitives/index.ts +1 -0
- package/primitives/step-indicator.tsx +50 -0
- package/types/bullet-item.ts +1 -1
- package/types/index.ts +1 -0
- package/types/link-def.ts +1 -1
- package/types/video-def.ts +25 -0
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
type TypographySize
|
|
14
14
|
} from '../../../primitives'
|
|
15
15
|
|
|
16
|
-
import type { CardBlock } from '../../def'
|
|
16
|
+
import type { CardBlock, VideoBlock } from '../../def'
|
|
17
17
|
|
|
18
18
|
import ImageBlockComponent from '../image-block'
|
|
19
19
|
import VideoBlockComponent from '../video-block'
|
|
@@ -93,8 +93,8 @@ const CardBlockComponent: React.FC<BlockComponentProps & {
|
|
|
93
93
|
<CardContent className={'flex flex-row justify-start items-stretch p-0 grow ' + disabledBorder + bgclx + contentclx + className}>
|
|
94
94
|
{card.media && (
|
|
95
95
|
<div className={'box-content grow-0 not-typography' + paddingclx} style={{
|
|
96
|
-
// If this layout has been specified, assume video, and that the 'sm'
|
|
97
|
-
width: (card.media
|
|
96
|
+
// If this layout has been specified, assume media is video, and that the 'sm' dim exists.
|
|
97
|
+
width: (card.media as VideoBlock).dim.sm!.w
|
|
98
98
|
}}>
|
|
99
99
|
<VideoBlockComponent
|
|
100
100
|
block={card.media}
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type Block from './block'
|
|
1
|
+
import type { VideoDef } from '../../types'
|
|
3
2
|
|
|
4
|
-
interface VideoBlock extends
|
|
3
|
+
interface VideoBlock extends VideoDef {
|
|
5
4
|
blockType: 'video'
|
|
6
|
-
videoProps?: any // For example,
|
|
7
|
-
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
8
|
-
videoProps: {
|
|
9
|
-
autoPlay: true,
|
|
10
|
-
loop: true,
|
|
11
|
-
muted: true,
|
|
12
|
-
playsInline: true
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
Valueless props are boolean.
|
|
16
|
-
NOTE: Must be camalCase as per React conventions! (playsinline => playsInline)
|
|
17
|
-
~~~~~~~~~~~~~~~~~~~~~~~~ */
|
|
18
|
-
|
|
19
|
-
poster?: string
|
|
20
|
-
sources?: string[]
|
|
21
|
-
dim: TShirtDimensions
|
|
22
|
-
// These are suppored so far: { vh: 60, mobile: {vw: 70} }
|
|
23
|
-
sizing?: any
|
|
24
5
|
}
|
|
25
6
|
|
|
26
7
|
export {
|
package/package.json
CHANGED
package/primitives/accordion.tsx
CHANGED
|
@@ -29,13 +29,12 @@ const AccordionTrigger = React.forwardRef<
|
|
|
29
29
|
<AccordionPrimitive.Trigger
|
|
30
30
|
ref={ref}
|
|
31
31
|
className={cn(
|
|
32
|
-
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline
|
|
32
|
+
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline ",
|
|
33
33
|
className
|
|
34
34
|
)}
|
|
35
35
|
{...props}
|
|
36
36
|
>
|
|
37
37
|
{children}
|
|
38
|
-
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
39
38
|
</AccordionPrimitive.Trigger>
|
|
40
39
|
</AccordionPrimitive.Header>
|
|
41
40
|
))
|
package/primitives/carousel.tsx
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
|
-
import useEmblaCarousel, {
|
|
5
|
-
type UseEmblaCarouselType,
|
|
6
|
-
} from 'embla-carousel-react'
|
|
7
|
-
import { ArrowLeft, ArrowRight } from 'lucide-react'
|
|
4
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'
|
|
8
5
|
import Autoplay from "embla-carousel-autoplay"
|
|
6
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react'
|
|
9
7
|
|
|
10
8
|
import { cn } from '../util'
|
|
11
|
-
import
|
|
9
|
+
import Button from './button'
|
|
12
10
|
|
|
13
11
|
type CarouselApi = UseEmblaCarouselType[1]
|
|
14
12
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
package/primitives/drawer.tsx
CHANGED
|
@@ -26,7 +26,7 @@ const DrawerOverlay = React.forwardRef<
|
|
|
26
26
|
>(({ className, ...props }, ref) => (
|
|
27
27
|
<DrawerPrimitive.Overlay
|
|
28
28
|
ref={ref}
|
|
29
|
-
className={cn('fixed inset-0 z-20 bg-background', className)}
|
|
29
|
+
className={cn('fixed inset-0 z-20 bg-background opacity-60 backdrop-blur-sm', className)}
|
|
30
30
|
{...props}
|
|
31
31
|
/>
|
|
32
32
|
))
|
package/primitives/index.ts
CHANGED
|
@@ -169,5 +169,6 @@ export { default as InlineIcon } from './inline-icon'
|
|
|
169
169
|
export { default as NavItems} from './nav-items'
|
|
170
170
|
export { default as Main } from './main'
|
|
171
171
|
export { default as ListBox } from './list-box'
|
|
172
|
+
export { default as StepIndicator } from './step-indicator'
|
|
172
173
|
|
|
173
174
|
export * as Icons from './icons'
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { cn } from '../util'
|
|
4
|
+
|
|
5
|
+
const StepIndicator: React.FC<{
|
|
6
|
+
steps: string[]
|
|
7
|
+
currentStep: number
|
|
8
|
+
dotSizeRem: number
|
|
9
|
+
className?: string
|
|
10
|
+
muted?: boolean
|
|
11
|
+
}> = ({
|
|
12
|
+
steps,
|
|
13
|
+
currentStep,
|
|
14
|
+
dotSizeRem,
|
|
15
|
+
className='',
|
|
16
|
+
muted=false
|
|
17
|
+
}) => {
|
|
18
|
+
|
|
19
|
+
const pX = `calc(${1 / (steps.length * 2) * 100}% - ${dotSizeRem / 2}rem)`
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className={cn('flex flex-col', className)}>
|
|
23
|
+
<div
|
|
24
|
+
key='one'
|
|
25
|
+
/* id='FOO' */
|
|
26
|
+
className='flex flex-row items-center justify-start w-full'
|
|
27
|
+
style={{ paddingLeft: pX, paddingRight: pX }}
|
|
28
|
+
>
|
|
29
|
+
{steps.map((ignore, index) => (<>
|
|
30
|
+
{index !== 0 && (<div key={`sep-${index}`} className={'h-[1px] grow ' + (muted ? 'bg-muted' : 'bg-foreground')}/>)}
|
|
31
|
+
<div
|
|
32
|
+
key={`circle-${index}`}
|
|
33
|
+
style={{width: `${dotSizeRem}rem`, height: `${dotSizeRem}rem`}}
|
|
34
|
+
className={cn(
|
|
35
|
+
'shrink-0 rounded-full border-[1.5px] ' + (muted ? 'border-muted' : 'border-foreground') ,
|
|
36
|
+
currentStep === index ? (muted ? 'bg-muted' : 'bg-foreground') : ''
|
|
37
|
+
)}
|
|
38
|
+
/>
|
|
39
|
+
</>))}
|
|
40
|
+
</div>
|
|
41
|
+
<div key='two' className={'grid ' + `grid-cols-${steps.length}` /* These are white listed already */} >
|
|
42
|
+
{steps.map((label, index) => (
|
|
43
|
+
<div key={index} className={'text-center whitespace-nowrap ' + (muted ? 'text-muted' : 'text-foreground')} >{label}</div>
|
|
44
|
+
))}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default StepIndicator
|
package/types/bullet-item.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -16,4 +16,5 @@ export type { default as Icon } from './icon'
|
|
|
16
16
|
export type { default as ImageDef } from './image-def'
|
|
17
17
|
export type { default as LinkDef } from './link-def'
|
|
18
18
|
export type { default as TShirtSize } from './t-shirt-size'
|
|
19
|
+
export type { default as VideoDef } from './video-def'
|
|
19
20
|
|
package/types/link-def.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TShirtDimensions } from './dimensions'
|
|
2
|
+
|
|
3
|
+
interface VideoDef {
|
|
4
|
+
videoProps?: any // For example,
|
|
5
|
+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
6
|
+
videoProps: {
|
|
7
|
+
autoPlay: true,
|
|
8
|
+
loop: true,
|
|
9
|
+
muted: true,
|
|
10
|
+
playsInline: true
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
Valueless props are boolean.
|
|
14
|
+
NOTE: Must be camalCase as per React conventions! (playsinline => playsInline)
|
|
15
|
+
~~~~~~~~~~~~~~~~~~~~~~~~ */
|
|
16
|
+
poster?: string
|
|
17
|
+
sources?: string[]
|
|
18
|
+
dim: TShirtDimensions
|
|
19
|
+
// These are suppored so far: { vh: 60, mobile: {vw: 70} }
|
|
20
|
+
sizing?: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
type VideoDef as default
|
|
25
|
+
}
|