@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.
- package/README.md +229 -0
- package/bin/create-registry.js +1 -1
- package/bin/test-mcp.sh +1 -1
- package/bin/update-registry.js +2 -2
- package/dist/index.d.mts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +9458 -0
- package/dist/index.mjs +9449 -0
- package/dist/lib/utils.d.mts +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +47 -0
- package/dist/lib/utils.mjs +28 -0
- package/dist/src/utils.d.mts +7 -0
- package/dist/src/utils.d.ts +7 -0
- package/dist/src/utils.js +47 -0
- package/dist/src/utils.mjs +28 -0
- package/dist/tailwind/index.d.mts +2 -0
- package/dist/tailwind/index.d.ts +2 -0
- package/dist/tailwind/index.js +2048 -0
- package/dist/tailwind/index.mjs +2017 -0
- package/dist/types/index.d.mts +12 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +79 -0
- package/dist/types/index.mjs +56 -0
- package/package.json +170 -23
- package/style/theme-provider.tsx +1 -1
- package/MCP-INSTRUCTIONS.md +0 -73
- package/README-MCP.md +0 -175
- package/blocks/components/accordian-block.tsx +0 -48
- package/blocks/components/block-component-props.ts +0 -11
- package/blocks/components/bullet-cards-block.tsx +0 -46
- package/blocks/components/card-block/index.tsx +0 -171
- package/blocks/components/card-block/link-out-button.tsx +0 -20
- package/blocks/components/card-block/util.ts +0 -28
- package/blocks/components/carte-blanche-block/index.tsx +0 -127
- package/blocks/components/carte-blanche-block/variant-content-left.tsx +0 -49
- package/blocks/components/content.tsx +0 -70
- package/blocks/components/cta-block.tsx +0 -115
- package/blocks/components/enh-heading-block.tsx +0 -204
- package/blocks/components/grid-block/grid-block-mutator.ts +0 -12
- package/blocks/components/grid-block/index.tsx +0 -83
- package/blocks/components/grid-block/mutator-registry.ts +0 -10
- package/blocks/components/grid-block/table-borders.mutator.ts +0 -47
- package/blocks/components/group-block.tsx +0 -83
- package/blocks/components/heading-block.tsx +0 -88
- package/blocks/components/image-block.tsx +0 -111
- package/blocks/components/index.ts +0 -30
- package/blocks/components/screenful-block/content.tsx +0 -123
- package/blocks/components/screenful-block/index.tsx +0 -107
- package/blocks/components/screenful-block/poster-background.tsx +0 -34
- package/blocks/components/screenful-block/video-background.tsx +0 -45
- package/blocks/components/space-block.tsx +0 -66
- package/blocks/components/video-block.tsx +0 -138
- package/blocks/def/accordian-block.ts +0 -14
- package/blocks/def/block.ts +0 -7
- package/blocks/def/bullet-cards-block.ts +0 -22
- package/blocks/def/card-block.ts +0 -22
- package/blocks/def/carte-blanche-block.ts +0 -21
- package/blocks/def/cta-block.ts +0 -19
- package/blocks/def/element-block.ts +0 -11
- package/blocks/def/enh-heading-block.ts +0 -44
- package/blocks/def/grid-block.ts +0 -16
- package/blocks/def/group-block.ts +0 -11
- package/blocks/def/heading-block.ts +0 -15
- package/blocks/def/image-block.ts +0 -31
- package/blocks/def/index.ts +0 -35
- package/blocks/def/screenful-block.ts +0 -54
- package/blocks/def/space-block.ts +0 -64
- package/blocks/def/video-block.ts +0 -9
- package/blocks/index.ts +0 -2
- package/dist/mcp/enhanced-server.d.ts +0 -29
- package/dist/mcp/enhanced-server.js +0 -1128
- package/dist/mcp/index.d.ts +0 -28
- package/dist/mcp/index.js +0 -436
- package/dist/registry/api.d.ts +0 -37
- package/dist/registry/api.js +0 -129
- package/dist/registry/index.d.ts +0 -353
- package/dist/registry/index.js +0 -45
- package/environment.d.ts +0 -6
- package/primitives/accordion.tsx +0 -66
- package/primitives/action-button.tsx +0 -42
- package/primitives/apply-typography.tsx +0 -55
- package/primitives/aspect-ratio.tsx +0 -5
- package/primitives/avatar.tsx +0 -49
- package/primitives/badge.tsx +0 -36
- package/primitives/breadcrumb.tsx +0 -115
- package/primitives/breakpoint-indicator.tsx +0 -19
- package/primitives/button.tsx +0 -85
- package/primitives/calendar.tsx +0 -72
- package/primitives/card.tsx +0 -83
- package/primitives/carousel.tsx +0 -237
- package/primitives/checkbox.tsx +0 -32
- package/primitives/combobox.tsx +0 -239
- package/primitives/command.tsx +0 -157
- package/primitives/context-menu.tsx +0 -200
- package/primitives/dialog-video-controller.tsx +0 -38
- package/primitives/dialog.tsx +0 -157
- package/primitives/drawer.tsx +0 -138
- package/primitives/form.tsx +0 -178
- package/primitives/icons/github.tsx +0 -14
- package/primitives/icons/index.ts +0 -18
- package/primitives/icons/youtube-logo.tsx +0 -59
- package/primitives/index-common.ts +0 -224
- package/primitives/index-next.ts +0 -2
- package/primitives/input-otp.tsx +0 -65
- package/primitives/input.tsx +0 -30
- package/primitives/label.tsx +0 -28
- package/primitives/list-adaptor.ts +0 -12
- package/primitives/list-box.tsx +0 -74
- package/primitives/loading-spinner.tsx +0 -33
- package/primitives/navigation-menu.tsx +0 -147
- package/primitives/next/image.tsx +0 -90
- package/primitives/next/index.ts +0 -7
- package/primitives/next/inline-icon.tsx +0 -36
- package/primitives/next/link-element.tsx +0 -109
- package/primitives/next/mdx-link.tsx +0 -22
- package/primitives/next/media-stack.tsx +0 -69
- package/primitives/next/nav-items.tsx +0 -45
- package/primitives/next/youtube-embed.tsx +0 -83
- package/primitives/popover.tsx +0 -37
- package/primitives/progress.tsx +0 -27
- package/primitives/radio-group.tsx +0 -56
- package/primitives/scroll-area.tsx +0 -47
- package/primitives/select.tsx +0 -169
- package/primitives/separator.tsx +0 -29
- package/primitives/sheet.tsx +0 -178
- package/primitives/skeleton.tsx +0 -20
- package/primitives/slider.tsx +0 -72
- package/primitives/sonner.tsx +0 -35
- package/primitives/step-indicator.tsx +0 -69
- package/primitives/switch.tsx +0 -35
- package/primitives/table.tsx +0 -117
- package/primitives/tabs.tsx +0 -60
- package/primitives/text-area.tsx +0 -26
- package/primitives/toggle-group.tsx +0 -63
- package/primitives/toggle.tsx +0 -73
- package/primitives/tooltip.tsx +0 -48
- package/primitives/video-player.tsx +0 -23
- package/public/r/accordion.json +0 -11
- package/public/r/alert.json +0 -11
- package/public/r/avatar.json +0 -11
- package/public/r/badge.json +0 -11
- package/public/r/button.json +0 -11
- package/public/r/card.json +0 -11
- package/public/r/checkbox.json +0 -11
- package/public/r/default.json +0 -6
- package/public/r/dialog.json +0 -11
- package/public/r/input.json +0 -11
- package/public/r/label.json +0 -11
- package/public/r/new-york.json +0 -6
- package/public/r/popover.json +0 -11
- package/public/r/select.json +0 -11
- package/public/r/table.json +0 -11
- package/public/r/tabs.json +0 -11
- package/public/r/toast.json +0 -11
- package/registry.json +0 -184
- package/src/mcp/README.md +0 -141
- package/src/mcp/enhanced-server.ts +0 -1208
- package/src/mcp/index.ts +0 -518
- package/src/mcp/package.json +0 -10
- package/src/registry/api.ts +0 -164
- package/src/registry/index.ts +0 -60
- package/src/registry/package.json +0 -10
- package/tailwind/colors.tailwind.js +0 -53
- package/tailwind/fontFamily.tailwind.ts +0 -7
- package/tailwind/fontSize.tailwind.ts +0 -13
- package/tailwind/index.ts +0 -7
- package/tailwind/safelist.tailwind.js +0 -26
- package/tailwind/screens.tailwind.js +0 -8
- package/tailwind/spacing.tailwind.js +0 -65
- package/tailwind/tailwind.config.hanzo-preset.d.ts +0 -5
- package/tailwind/tailwind.config.hanzo-preset.js +0 -915
- package/tailwind/tw-font-desc.ts +0 -15
- package/tailwind/typo-plugin/get-plugin-styles.js +0 -679
- package/tailwind/typo-plugin/index.d.ts +0 -9
- package/tailwind/typo-plugin/index.js +0 -141
- package/tailwind/typo-plugin/utils.js +0 -60
- package/tailwind/typography-test.mdx +0 -35
- package/tailwind/z-index.tailwind.js +0 -71
- package/test/test-registry.js +0 -73
- package/tsconfig.json +0 -22
- package/types/animation-def.ts +0 -3
- package/types/breakpoints.ts +0 -11
- package/types/bullet-item.ts +0 -10
- package/types/button-def.ts +0 -39
- package/types/dimensions.ts +0 -8
- package/types/grid-def.ts +0 -56
- package/types/image-def.ts +0 -32
- package/types/index.ts +0 -29
- package/types/link-def.ts +0 -56
- package/types/media-stack-def.ts +0 -31
- package/types/t-shirt-size.ts +0 -5
- package/types/tshirt-dimensions.ts +0 -20
- package/types/video-def.ts +0 -25
- package/util/format-and-abbreviate-as-currency.ts +0 -125
- package/util/format-to-max-char.ts +0 -68
- package/util/index-client.ts +0 -3
- package/util/index.ts +0 -78
- package/util/number-abbreviate.ts +0 -49
- package/util/specifier.ts +0 -43
- package/util/spread-to-transform.ts +0 -24
- package/util/step-animation.ts +0 -90
- package/util/two-way-map.ts +0 -19
package/primitives/select.tsx
DELETED
|
@@ -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
|
-
}
|
package/primitives/separator.tsx
DELETED
|
@@ -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
|
package/primitives/sheet.tsx
DELETED
|
@@ -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
|
-
}
|
package/primitives/skeleton.tsx
DELETED
|
@@ -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
|
package/primitives/slider.tsx
DELETED
|
@@ -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
|
package/primitives/sonner.tsx
DELETED
|
@@ -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
|
package/primitives/switch.tsx
DELETED
|
@@ -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
|