@hanzo/ui 4.5.4 → 4.7.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.
Files changed (203) hide show
  1. package/README.md +229 -0
  2. package/bin/create-registry.js +1 -1
  3. package/bin/test-mcp.sh +1 -1
  4. package/bin/update-registry.js +2 -2
  5. package/dist/index.d.mts +16 -0
  6. package/dist/index.d.ts +16 -0
  7. package/dist/index.js +9458 -0
  8. package/dist/index.mjs +9449 -0
  9. package/dist/lib/utils.d.mts +2 -0
  10. package/dist/lib/utils.d.ts +2 -0
  11. package/dist/lib/utils.js +47 -0
  12. package/dist/lib/utils.mjs +28 -0
  13. package/dist/src/utils.d.mts +7 -0
  14. package/dist/src/utils.d.ts +7 -0
  15. package/dist/src/utils.js +47 -0
  16. package/dist/src/utils.mjs +28 -0
  17. package/dist/tailwind/index.d.mts +2 -0
  18. package/dist/tailwind/index.d.ts +2 -0
  19. package/dist/tailwind/index.js +2048 -0
  20. package/dist/tailwind/index.mjs +2017 -0
  21. package/dist/types/index.d.mts +12 -0
  22. package/dist/types/index.d.ts +12 -0
  23. package/dist/types/index.js +79 -0
  24. package/dist/types/index.mjs +56 -0
  25. package/package.json +170 -23
  26. package/style/theme-provider.tsx +1 -1
  27. package/MCP-INSTRUCTIONS.md +0 -73
  28. package/README-MCP.md +0 -175
  29. package/blocks/components/accordian-block.tsx +0 -48
  30. package/blocks/components/block-component-props.ts +0 -11
  31. package/blocks/components/bullet-cards-block.tsx +0 -46
  32. package/blocks/components/card-block/index.tsx +0 -171
  33. package/blocks/components/card-block/link-out-button.tsx +0 -20
  34. package/blocks/components/card-block/util.ts +0 -28
  35. package/blocks/components/carte-blanche-block/index.tsx +0 -127
  36. package/blocks/components/carte-blanche-block/variant-content-left.tsx +0 -49
  37. package/blocks/components/content.tsx +0 -70
  38. package/blocks/components/cta-block.tsx +0 -115
  39. package/blocks/components/enh-heading-block.tsx +0 -204
  40. package/blocks/components/grid-block/grid-block-mutator.ts +0 -12
  41. package/blocks/components/grid-block/index.tsx +0 -83
  42. package/blocks/components/grid-block/mutator-registry.ts +0 -10
  43. package/blocks/components/grid-block/table-borders.mutator.ts +0 -47
  44. package/blocks/components/group-block.tsx +0 -83
  45. package/blocks/components/heading-block.tsx +0 -88
  46. package/blocks/components/image-block.tsx +0 -111
  47. package/blocks/components/index.ts +0 -30
  48. package/blocks/components/screenful-block/content.tsx +0 -123
  49. package/blocks/components/screenful-block/index.tsx +0 -107
  50. package/blocks/components/screenful-block/poster-background.tsx +0 -34
  51. package/blocks/components/screenful-block/video-background.tsx +0 -45
  52. package/blocks/components/space-block.tsx +0 -66
  53. package/blocks/components/video-block.tsx +0 -138
  54. package/blocks/def/accordian-block.ts +0 -14
  55. package/blocks/def/block.ts +0 -7
  56. package/blocks/def/bullet-cards-block.ts +0 -22
  57. package/blocks/def/card-block.ts +0 -22
  58. package/blocks/def/carte-blanche-block.ts +0 -21
  59. package/blocks/def/cta-block.ts +0 -19
  60. package/blocks/def/element-block.ts +0 -11
  61. package/blocks/def/enh-heading-block.ts +0 -44
  62. package/blocks/def/grid-block.ts +0 -16
  63. package/blocks/def/group-block.ts +0 -11
  64. package/blocks/def/heading-block.ts +0 -15
  65. package/blocks/def/image-block.ts +0 -31
  66. package/blocks/def/index.ts +0 -35
  67. package/blocks/def/screenful-block.ts +0 -54
  68. package/blocks/def/space-block.ts +0 -64
  69. package/blocks/def/video-block.ts +0 -9
  70. package/blocks/index.ts +0 -2
  71. package/dist/mcp/enhanced-server.d.ts +0 -29
  72. package/dist/mcp/enhanced-server.js +0 -1128
  73. package/dist/mcp/index.d.ts +0 -28
  74. package/dist/mcp/index.js +0 -436
  75. package/dist/registry/api.d.ts +0 -37
  76. package/dist/registry/api.js +0 -129
  77. package/dist/registry/index.d.ts +0 -353
  78. package/dist/registry/index.js +0 -45
  79. package/environment.d.ts +0 -6
  80. package/primitives/accordion.tsx +0 -66
  81. package/primitives/action-button.tsx +0 -42
  82. package/primitives/apply-typography.tsx +0 -55
  83. package/primitives/aspect-ratio.tsx +0 -5
  84. package/primitives/avatar.tsx +0 -49
  85. package/primitives/badge.tsx +0 -36
  86. package/primitives/breadcrumb.tsx +0 -115
  87. package/primitives/breakpoint-indicator.tsx +0 -19
  88. package/primitives/button.tsx +0 -85
  89. package/primitives/calendar.tsx +0 -72
  90. package/primitives/card.tsx +0 -83
  91. package/primitives/carousel.tsx +0 -237
  92. package/primitives/checkbox.tsx +0 -32
  93. package/primitives/combobox.tsx +0 -239
  94. package/primitives/command.tsx +0 -157
  95. package/primitives/context-menu.tsx +0 -200
  96. package/primitives/dialog-video-controller.tsx +0 -38
  97. package/primitives/dialog.tsx +0 -157
  98. package/primitives/drawer.tsx +0 -138
  99. package/primitives/form.tsx +0 -178
  100. package/primitives/icons/github.tsx +0 -14
  101. package/primitives/icons/index.ts +0 -18
  102. package/primitives/icons/youtube-logo.tsx +0 -59
  103. package/primitives/index-common.ts +0 -224
  104. package/primitives/index-next.ts +0 -2
  105. package/primitives/input-otp.tsx +0 -65
  106. package/primitives/input.tsx +0 -30
  107. package/primitives/label.tsx +0 -28
  108. package/primitives/list-adaptor.ts +0 -12
  109. package/primitives/list-box.tsx +0 -74
  110. package/primitives/loading-spinner.tsx +0 -33
  111. package/primitives/navigation-menu.tsx +0 -147
  112. package/primitives/next/image.tsx +0 -90
  113. package/primitives/next/index.ts +0 -7
  114. package/primitives/next/inline-icon.tsx +0 -36
  115. package/primitives/next/link-element.tsx +0 -109
  116. package/primitives/next/mdx-link.tsx +0 -22
  117. package/primitives/next/media-stack.tsx +0 -69
  118. package/primitives/next/nav-items.tsx +0 -45
  119. package/primitives/next/youtube-embed.tsx +0 -83
  120. package/primitives/popover.tsx +0 -37
  121. package/primitives/progress.tsx +0 -27
  122. package/primitives/radio-group.tsx +0 -56
  123. package/primitives/scroll-area.tsx +0 -47
  124. package/primitives/select.tsx +0 -169
  125. package/primitives/separator.tsx +0 -29
  126. package/primitives/sheet.tsx +0 -178
  127. package/primitives/skeleton.tsx +0 -20
  128. package/primitives/slider.tsx +0 -72
  129. package/primitives/sonner.tsx +0 -35
  130. package/primitives/step-indicator.tsx +0 -69
  131. package/primitives/switch.tsx +0 -35
  132. package/primitives/table.tsx +0 -117
  133. package/primitives/tabs.tsx +0 -60
  134. package/primitives/text-area.tsx +0 -26
  135. package/primitives/toggle-group.tsx +0 -63
  136. package/primitives/toggle.tsx +0 -73
  137. package/primitives/tooltip.tsx +0 -48
  138. package/primitives/video-player.tsx +0 -23
  139. package/public/r/accordion.json +0 -11
  140. package/public/r/alert.json +0 -11
  141. package/public/r/avatar.json +0 -11
  142. package/public/r/badge.json +0 -11
  143. package/public/r/button.json +0 -11
  144. package/public/r/card.json +0 -11
  145. package/public/r/checkbox.json +0 -11
  146. package/public/r/default.json +0 -6
  147. package/public/r/dialog.json +0 -11
  148. package/public/r/input.json +0 -11
  149. package/public/r/label.json +0 -11
  150. package/public/r/new-york.json +0 -6
  151. package/public/r/popover.json +0 -11
  152. package/public/r/select.json +0 -11
  153. package/public/r/table.json +0 -11
  154. package/public/r/tabs.json +0 -11
  155. package/public/r/toast.json +0 -11
  156. package/registry.json +0 -184
  157. package/src/mcp/README.md +0 -141
  158. package/src/mcp/enhanced-server.ts +0 -1208
  159. package/src/mcp/index.ts +0 -518
  160. package/src/mcp/package.json +0 -10
  161. package/src/registry/api.ts +0 -164
  162. package/src/registry/index.ts +0 -60
  163. package/src/registry/package.json +0 -10
  164. package/tailwind/colors.tailwind.js +0 -53
  165. package/tailwind/fontFamily.tailwind.ts +0 -7
  166. package/tailwind/fontSize.tailwind.ts +0 -13
  167. package/tailwind/index.ts +0 -7
  168. package/tailwind/safelist.tailwind.js +0 -26
  169. package/tailwind/screens.tailwind.js +0 -8
  170. package/tailwind/spacing.tailwind.js +0 -65
  171. package/tailwind/tailwind.config.hanzo-preset.d.ts +0 -5
  172. package/tailwind/tailwind.config.hanzo-preset.js +0 -915
  173. package/tailwind/tw-font-desc.ts +0 -15
  174. package/tailwind/typo-plugin/get-plugin-styles.js +0 -679
  175. package/tailwind/typo-plugin/index.d.ts +0 -9
  176. package/tailwind/typo-plugin/index.js +0 -141
  177. package/tailwind/typo-plugin/utils.js +0 -60
  178. package/tailwind/typography-test.mdx +0 -35
  179. package/tailwind/z-index.tailwind.js +0 -71
  180. package/test/test-registry.js +0 -73
  181. package/tsconfig.json +0 -22
  182. package/types/animation-def.ts +0 -3
  183. package/types/breakpoints.ts +0 -11
  184. package/types/bullet-item.ts +0 -10
  185. package/types/button-def.ts +0 -39
  186. package/types/dimensions.ts +0 -8
  187. package/types/grid-def.ts +0 -56
  188. package/types/image-def.ts +0 -32
  189. package/types/index.ts +0 -29
  190. package/types/link-def.ts +0 -56
  191. package/types/media-stack-def.ts +0 -31
  192. package/types/t-shirt-size.ts +0 -5
  193. package/types/tshirt-dimensions.ts +0 -20
  194. package/types/video-def.ts +0 -25
  195. package/util/format-and-abbreviate-as-currency.ts +0 -125
  196. package/util/format-to-max-char.ts +0 -68
  197. package/util/index-client.ts +0 -3
  198. package/util/index.ts +0 -78
  199. package/util/number-abbreviate.ts +0 -49
  200. package/util/specifier.ts +0 -43
  201. package/util/spread-to-transform.ts +0 -24
  202. package/util/step-animation.ts +0 -90
  203. package/util/two-way-map.ts +0 -19
@@ -1,169 +0,0 @@
1
- 'use client'
2
-
3
- import React from 'react'
4
- import * as SelectPrimitive from '@radix-ui/react-select'
5
- import { Check, ChevronDown, ChevronUp } from 'lucide-react'
6
-
7
- import { cn } from '../util'
8
-
9
- const Select = SelectPrimitive.Root
10
- const SelectGroup = SelectPrimitive.Group
11
- const SelectValue = SelectPrimitive.Value
12
-
13
- const SelectTrigger = React.forwardRef<
14
- React.ElementRef<typeof SelectPrimitive.Trigger>,
15
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
- >(({ className, children, ...props }, ref) => (
17
- <SelectPrimitive.Trigger
18
- ref={ref}
19
- className={cn(
20
- 'flex h-10 w-full items-center justify-between rounded-md border border-muted-3 ' +
21
- 'bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-2 ' +
22
- 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 ' +
23
- 'disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
24
- className
25
- )}
26
- {...props}
27
- >
28
- {children}
29
- <SelectPrimitive.Icon asChild>
30
- <ChevronDown className='h-4 w-4 opacity-50' />
31
- </SelectPrimitive.Icon>
32
- </SelectPrimitive.Trigger>
33
- ))
34
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
35
-
36
- const SelectScrollUpButton = React.forwardRef<
37
- React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
38
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
39
- >(({ className, ...props }, ref) => (
40
- <SelectPrimitive.ScrollUpButton
41
- ref={ref}
42
- className={cn(
43
- 'flex cursor-default items-center justify-center py-1',
44
- className
45
- )}
46
- {...props}
47
- >
48
- <ChevronUp className='h-4 w-4' />
49
- </SelectPrimitive.ScrollUpButton>
50
- ))
51
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
52
-
53
- const SelectScrollDownButton = React.forwardRef<
54
- React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
55
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
56
- >(({ className, ...props }, ref) => (
57
- <SelectPrimitive.ScrollDownButton
58
- ref={ref}
59
- className={cn(
60
- 'flex cursor-default items-center justify-center py-1',
61
- className
62
- )}
63
- {...props}
64
- >
65
- <ChevronDown className='h-4 w-4' />
66
- </SelectPrimitive.ScrollDownButton>
67
- ))
68
- SelectScrollDownButton.displayName =
69
- SelectPrimitive.ScrollDownButton.displayName
70
-
71
- const SelectContent = React.forwardRef<
72
- React.ElementRef<typeof SelectPrimitive.Content>,
73
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
74
- >(({ className, children, position = 'popper', ...props }, ref) => (
75
- <SelectPrimitive.Portal>
76
- <SelectPrimitive.Content
77
- ref={ref}
78
- className={cn(
79
- 'relative z-popup max-h-96 min-w-[8rem] overflow-hidden rounded-md border ' +
80
- 'bg-level-1 text-foreground shadow-md data-[state=open]:animate-in ' +
81
- 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 ' +
82
- 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 ' +
83
- 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 ' +
84
- 'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
85
- (position === 'popper') &&
86
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 ' +
87
- 'data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
88
- className
89
- )}
90
- position={position}
91
- {...props}
92
- >
93
- <SelectScrollUpButton />
94
- <SelectPrimitive.Viewport
95
- className={cn(
96
- 'p-1',
97
- position === 'popper' &&
98
- 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'
99
- )}
100
- >
101
- {children}
102
- </SelectPrimitive.Viewport>
103
- <SelectScrollDownButton />
104
- </SelectPrimitive.Content>
105
- </SelectPrimitive.Portal>
106
- ))
107
- SelectContent.displayName = SelectPrimitive.Content.displayName
108
-
109
- const SelectLabel = React.forwardRef<
110
- React.ElementRef<typeof SelectPrimitive.Label>,
111
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
112
- >(({ className, ...props }, ref) => (
113
- <SelectPrimitive.Label
114
- ref={ref}
115
- className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}
116
- {...props}
117
- />
118
- ))
119
- SelectLabel.displayName = SelectPrimitive.Label.displayName
120
-
121
- const SelectItem = React.forwardRef<
122
- React.ElementRef<typeof SelectPrimitive.Item>,
123
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
124
- >(({ className, children, ...props }, ref) => (
125
- <SelectPrimitive.Item
126
- ref={ref}
127
- className={cn(
128
- 'relative flex w-full cursor-default select-none items-center rounded-sm ' +
129
- 'py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-level-2 focus:text-accent ' +
130
- 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
131
- className
132
- )}
133
- {...props}
134
- >
135
- <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
136
- <SelectPrimitive.ItemIndicator>
137
- <Check className='h-4 w-4' />
138
- </SelectPrimitive.ItemIndicator>
139
- </span>
140
-
141
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
142
- </SelectPrimitive.Item>
143
- ))
144
- SelectItem.displayName = SelectPrimitive.Item.displayName
145
-
146
- const SelectSeparator = React.forwardRef<
147
- React.ElementRef<typeof SelectPrimitive.Separator>,
148
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
149
- >(({ className, ...props }, ref) => (
150
- <SelectPrimitive.Separator
151
- ref={ref}
152
- className={cn('-mx-1 my-1 h-px bg-level-1', className)}
153
- {...props}
154
- />
155
- ))
156
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName
157
-
158
- export {
159
- Select,
160
- SelectGroup,
161
- SelectValue,
162
- SelectTrigger,
163
- SelectContent,
164
- SelectLabel,
165
- SelectItem,
166
- SelectSeparator,
167
- SelectScrollUpButton,
168
- SelectScrollDownButton,
169
- }
@@ -1,29 +0,0 @@
1
- 'use client'
2
- import React from 'react'
3
- import * as SeparatorPrimitive from '@radix-ui/react-separator'
4
-
5
- import { cn } from '../util'
6
-
7
- const Separator = React.forwardRef<
8
- React.ElementRef<typeof SeparatorPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
10
- >((
11
- { className, orientation = 'horizontal', decorative = true, ...props },
12
- ref
13
- ) => (
14
- <SeparatorPrimitive.Root
15
- ref={ref}
16
- decorative={decorative}
17
- orientation={orientation}
18
- className={cn(
19
- 'shrink-0 bg-muted-2',
20
- orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
21
- className
22
- )}
23
- {...props}
24
- />
25
- )
26
- )
27
- Separator.displayName = SeparatorPrimitive.Root.displayName
28
-
29
- export default Separator
@@ -1,178 +0,0 @@
1
- // @ts-nocheck
2
-
3
- 'use client'
4
-
5
- import * as React from 'react'
6
- import * as SheetPrimitive from '@radix-ui/react-dialog'
7
- import { cva, type VariantProps } from 'class-variance-authority'
8
-
9
- import { cn } from '../util'
10
-
11
- const Sheet = SheetPrimitive.Root
12
-
13
- const SheetTrigger = SheetPrimitive.Trigger
14
-
15
- const SheetClose = SheetPrimitive.Close
16
-
17
- const SheetPortal = SheetPrimitive.Portal
18
-
19
- const SheetOverlay = React.forwardRef<
20
- React.ElementRef<typeof SheetPrimitive.Overlay>,
21
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
22
- >(({ className, ...props }, ref) => (
23
- <SheetPrimitive.Overlay
24
- className={cn(
25
- 'fixed inset-0 z-below-modal bg-overlay backdrop-blur-sm',
26
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
27
- className
28
- )}
29
- {...props}
30
- ref={ref}
31
- />
32
- ))
33
- SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
34
-
35
- const sheetVariants = cva(
36
- 'fixed z-modal gap-4 bg-background p-3 sm:p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-300',
37
- {
38
- variants: {
39
- side: {
40
- top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
41
- bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
42
- left: 'inset-y-0 left-0 h-full w-5/6 sm:w-2/3 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
43
- right:
44
- 'inset-y-0 right-0 h-full w-5/6 sm:w-2/3 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
45
- },
46
- },
47
- defaultVariants: {
48
- side: 'right',
49
- },
50
- }
51
- )
52
-
53
- interface SheetContentProps
54
- extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
55
- VariantProps<typeof sheetVariants> {}
56
-
57
- const closeUIclx = 'rounded-sm opacity-70 ring-offset-background ' +
58
- 'transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-primary'
59
-
60
- const SheetContent = React.forwardRef<
61
- React.ElementRef<typeof SheetPrimitive.Content>,
62
- SheetContentProps &
63
- {
64
- closeButtonClass? : string
65
- closeElement?: ReactNode
66
- centerElement?: ReactNode
67
- duplicateCloseOnBottom?: boolean
68
- }
69
- >(({
70
- side = 'right',
71
- className,
72
- children,
73
- closeElement,
74
- centerElement,
75
- duplicateCloseOnBottom=false,
76
- closeButtonClass,
77
- ...props
78
- }, ref ) => {
79
-
80
- const xOfCloseUIClass = (side === 'right') ? 'left-2' : 'right-2'
81
-
82
- return (
83
- <SheetPortal>
84
- <SheetOverlay />
85
- <SheetPrimitive.Content
86
- ref={ref}
87
- className={cn(sheetVariants({ side }), className)}
88
- {...props}
89
- >
90
- {children}
91
-
92
- {closeElement && (
93
- <SheetPrimitive.Close className={cn(closeUIclx, 'absolute z-above-content top-3', xOfCloseUIClass, closeButtonClass)}>
94
- {closeElement}
95
- </SheetPrimitive.Close>
96
- )}
97
- {closeElement && duplicateCloseOnBottom && (
98
- <SheetPrimitive.Close className={cn(closeUIclx, 'absolute z-above-content bottom-3', xOfCloseUIClass, closeButtonClass)}>
99
- {closeElement}
100
- </SheetPrimitive.Close>
101
- )}
102
- {centerElement && (
103
- <div className={'absolute z-content top-3 left-0 right-0 flex flex-row justify-center align-start'} >
104
- {centerElement}
105
- </div>
106
- )}
107
- </SheetPrimitive.Content>
108
- </SheetPortal>
109
- )
110
- }
111
- )
112
-
113
- SheetContent.displayName = SheetPrimitive.Content.displayName
114
-
115
- const SheetHeader = ({
116
- className,
117
- ...props
118
- }: React.HTMLAttributes<HTMLDivElement>) => (
119
- <div
120
- className={cn(
121
- 'flex flex-col space-y-2 text-center sm:text-left',
122
- className
123
- )}
124
- {...props}
125
- />
126
- )
127
- SheetHeader.displayName = 'SheetHeader'
128
-
129
- const SheetFooter = ({
130
- className,
131
- ...props
132
- }: React.HTMLAttributes<HTMLDivElement>) => (
133
- <div
134
- className={cn(
135
- 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
136
- className
137
- )}
138
- {...props}
139
- />
140
- )
141
- SheetFooter.displayName = 'SheetFooter'
142
-
143
- const SheetTitle = React.forwardRef<
144
- React.ElementRef<typeof SheetPrimitive.Title>,
145
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
146
- >(({ className, ...props }, ref) => (
147
- <SheetPrimitive.Title
148
- ref={ref}
149
- className={cn('text-lg font-semibold text-foreground', className)}
150
- {...props}
151
- />
152
- ))
153
- SheetTitle.displayName = SheetPrimitive.Title.displayName
154
-
155
- const SheetDescription = React.forwardRef<
156
- React.ElementRef<typeof SheetPrimitive.Description>,
157
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
158
- >(({ className, ...props }, ref) => (
159
- <SheetPrimitive.Description
160
- ref={ref}
161
- className={cn('text-sm text-muted-1', className)}
162
- {...props}
163
- />
164
- ))
165
- SheetDescription.displayName = SheetPrimitive.Description.displayName
166
-
167
- export {
168
- Sheet,
169
- SheetPortal,
170
- SheetOverlay,
171
- SheetTrigger,
172
- SheetClose,
173
- SheetContent,
174
- SheetHeader,
175
- SheetFooter,
176
- SheetTitle,
177
- SheetDescription,
178
- }
@@ -1,20 +0,0 @@
1
- import { cn } from '../util'
2
-
3
- const Skeleton: React.FC<{
4
- reverse?: boolean
5
- } & React.HTMLAttributes<HTMLDivElement>> = ({
6
- reverse=false,
7
- className,
8
- ...props
9
- }) => (
10
- <div
11
- className={cn(
12
- 'rounded-md bg-level-2',
13
- reverse ? 'animate-pulsereverse' : 'animate-pulse',
14
- className
15
- )}
16
- {...props}
17
- />
18
- )
19
-
20
- export default Skeleton
@@ -1,72 +0,0 @@
1
- 'use client'
2
- import * as React from 'react'
3
- import * as SliderPrimitive from '@radix-ui/react-slider'
4
-
5
- import { cn } from '../util'
6
- import { useState } from 'react'
7
-
8
- const Slider = React.forwardRef<
9
- React.ElementRef<typeof SliderPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> & {
11
- trackBgClx?: string
12
- rangeBgClx?: string
13
- thumbClx?: string
14
- thumbSlidingClx?: string
15
- }
16
- >(({
17
- className,
18
- trackBgClx='bg-level-2',
19
- rangeBgClx='bg-primary',
20
- thumbClx='',
21
- thumbSlidingClx='',
22
- onValueChange,
23
- onValueCommit,
24
- ...rest
25
- }, ref) => {
26
-
27
- const [sliding, setSliding] = useState<boolean>(false)
28
-
29
- const _onChange = (value: number[]): void => {
30
- if (!sliding) {
31
- setSliding(true)
32
- }
33
- if (onValueChange) {
34
- onValueChange(value)
35
- }
36
- }
37
-
38
- const _onCommit = (value: number[]): void => {
39
- setSliding(false)
40
- if (onValueCommit) {
41
- onValueCommit(value)
42
- }
43
- }
44
-
45
- return (
46
- <SliderPrimitive.Root
47
- ref={ref}
48
- className={cn(
49
- 'relative flex w-full touch-none select-none items-center',
50
- className
51
- )}
52
- onValueChange={_onChange}
53
- onValueCommit={_onCommit}
54
- {...rest}
55
- >
56
- <SliderPrimitive.Track data-vaul-no-drag className={'relative h-2 w-full grow overflow-hidden rounded-full ' + trackBgClx}>
57
- <SliderPrimitive.Range data-vaul-no-drag className={'absolute h-full ' + rangeBgClx} />
58
- </SliderPrimitive.Track>
59
- <SliderPrimitive.Thumb data-vaul-no-drag className={cn(
60
- 'block h-5 w-5 rounded-full border-2 border-primary bg-background ',
61
- 'ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-1 ',
62
- 'focus-visible:ring-muted-2 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-50',
63
- thumbClx,
64
- (sliding ? thumbSlidingClx : '')
65
- )}/>
66
- </SliderPrimitive.Root>
67
- )
68
- })
69
-
70
- Slider.displayName = SliderPrimitive.Root.displayName
71
-
72
- export default Slider
@@ -1,35 +0,0 @@
1
- 'use client'
2
-
3
- import { useTheme } from 'next-themes'
4
- import { Toaster as Sonner } from 'sonner'
5
- import { toast } from 'sonner'
6
-
7
- type ToasterProps = React.ComponentProps<typeof Sonner>
8
-
9
- const Toaster = ({ ...props }: ToasterProps) => {
10
- const { theme = 'system' } = useTheme()
11
-
12
- return (
13
- <Sonner
14
- theme={theme as ToasterProps['theme']}
15
- className='toaster group'
16
- toastOptions={{
17
- classNames: {
18
- toast:
19
- 'group toast group-[.toaster]:bg-level-2 group-[.toaster]:text-foreground group-[.toaster]:border-muted-3 group-[.toaster]:shadow-lg',
20
- description: 'group-[.toast]:text-foreground',
21
- actionButton:
22
- 'group-[.toast]:bg-primary group-[.toast]:text-primary-fg',
23
- cancelButton:
24
- 'group-[.toast]:bg-transparent group-[.toast]:text-foreground',
25
- },
26
- }}
27
- {...props}
28
- />
29
- )
30
- }
31
-
32
- export {
33
- toast,
34
- Toaster
35
- }
@@ -1,69 +0,0 @@
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
- // This code current throws 'Warning: Each child in a list should have a unique "key" prop.'
22
- // As is evident, we supply keys that should suffice. < shrug >
23
- return (
24
- <div className={cn('flex flex-col', className)}>
25
- <div
26
- key='one'
27
- /* id='FOO' */
28
- className='flex flex-row items-center justify-start w-full'
29
- style={{ paddingLeft: pX, paddingRight: pX }}
30
- >
31
- {steps.map((ignore, index) => (<>
32
- {index !== 0 && (
33
- <div
34
- key={`sep-${index}`}
35
- className={cn(
36
- 'h-[1px] grow',
37
- currentStep >= index ? (muted ? 'bg-muted' : 'bg-foreground') : (muted ? 'bg-muted-3' : 'bg-level-3'),
38
- )}
39
- />
40
- )}
41
- <div
42
- key={`circle-${index}`}
43
- style={{width: `${dotSizeRem}rem`, height: `${dotSizeRem}rem`}}
44
- className={cn(
45
- 'shrink-0 rounded-full border-[1.5px]',
46
- currentStep >= index ? (muted ? 'bg-muted border-muted' : 'bg-foreground border-foreground') : '',
47
- //currentStep > index || currentStep === steps.length - 1 ? (muted ? 'bg-muted border-muted' : 'bg-foreground border-foreground') : ''
48
- )}
49
- />
50
- </>))}
51
- </div>
52
- <div key='two' className={'grid ' + `grid-cols-${steps.length}` /* These are white listed already */} >
53
- {steps.map((label, index) => (
54
- <div
55
- key={index}
56
- className={cn(
57
- 'text-center whitespace-nowrap',
58
- (muted ? 'text-muted' : 'text-foreground')
59
- )}
60
- >
61
- {label}
62
- </div>
63
- ))}
64
- </div>
65
- </div>
66
- )
67
- }
68
-
69
- export default StepIndicator
@@ -1,35 +0,0 @@
1
- 'use client'
2
- import React from 'react'
3
- import * as SwitchPrimitives from '@radix-ui/react-switch'
4
-
5
- import { cn } from '../util'
6
-
7
- const Switch = React.forwardRef<
8
- React.ElementRef<typeof SwitchPrimitives.Root>,
9
- React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> &
10
- { thumbClx?: string }
11
- >(({ className, thumbClx='', ...props }, ref) => (
12
- <SwitchPrimitives.Root
13
- className={cn(
14
- 'peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full ' +
15
- 'border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none ' +
16
- 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ' +
17
- 'focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 ' +
18
- 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-level-3',
19
- className
20
- )}
21
- {...props}
22
- ref={ref}
23
- >
24
- <SwitchPrimitives.Thumb
25
- className={cn(
26
- 'pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ' +
27
- 'ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0',
28
- thumbClx
29
- )}
30
- />
31
- </SwitchPrimitives.Root>
32
- ))
33
- Switch.displayName = SwitchPrimitives.Root.displayName
34
-
35
- export default Switch