@hanzo/ui 3.0.9 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
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/",
@@ -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 [&[data-state=open]>svg]:rotate-180",
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
  ))
@@ -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
  ))
@@ -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