@gentleduck/registry-ui 0.2.6 → 0.2.8
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/.turbo/turbo-test.log +7 -7
- package/CHANGELOG.md +8 -0
- package/package.json +7 -7
- package/src/alert-dialog/alert-dialog.tsx +11 -4
- package/src/aspect-ratio/aspect-ratio.tsx +9 -11
- package/src/audio/audio-visualizer.tsx +2 -0
- package/src/calendar/calendar.tsx +161 -141
- package/src/chart/chart.tsx +11 -6
- package/src/combobox/combobox.tsx +96 -69
- package/src/command/command.tsx +34 -37
- package/src/context-menu/context-menu.tsx +11 -3
- package/src/dialog/dialog-responsive.tsx +9 -0
- package/src/dialog/dialog.tsx +12 -4
- package/src/dropdown-menu/dropdown-menu.tsx +11 -3
- package/src/empty/empty.tsx +30 -17
- package/src/field/field.tsx +136 -109
- package/src/json-editor/json-editor.tsx +1 -0
- package/src/json-editor/json-editor.view.tsx +1 -0
- package/src/menubar/menubar.tsx +10 -3
- package/src/popover/popover.tsx +4 -0
- package/src/preview-panel/preview-panel-dialog.tsx +86 -80
- package/src/preview-panel/preview-panel.tsx +280 -273
- package/src/resizable/resizable.tsx +17 -15
- package/src/select/select.tsx +3 -0
- package/src/sheet/sheet.tsx +16 -4
- package/src/sidebar/sidebar.tsx +434 -376
- package/src/slider/slider.tsx +7 -10
- package/src/sonner/sonner.chunks.tsx +2 -0
- package/src/sonner/sonner.tsx +23 -20
- package/src/toggle/toggle.constants.ts +2 -2
- package/src/tooltip/tooltip.tsx +3 -0
- package/tsconfig.json +0 -1
package/src/slider/slider.tsx
CHANGED
|
@@ -4,15 +4,10 @@ import { cn } from '@gentleduck/libs/cn'
|
|
|
4
4
|
import * as SliderPrimitive from '@gentleduck/primitives/slider'
|
|
5
5
|
import * as React from 'react'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
value,
|
|
12
|
-
min = 0,
|
|
13
|
-
max = 100,
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
7
|
+
const Slider = React.forwardRef<
|
|
8
|
+
React.ComponentRef<typeof SliderPrimitive.Root>,
|
|
9
|
+
React.ComponentProps<typeof SliderPrimitive.Root>
|
|
10
|
+
>(({ className, defaultValue, orientation = 'horizontal', value, min = 0, max = 100, ...props }, ref) => {
|
|
16
11
|
const _values = React.useMemo(
|
|
17
12
|
() => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),
|
|
18
13
|
[value, defaultValue, min, max],
|
|
@@ -20,6 +15,7 @@ function Slider({
|
|
|
20
15
|
|
|
21
16
|
return (
|
|
22
17
|
<SliderPrimitive.Root
|
|
18
|
+
ref={ref}
|
|
23
19
|
data-slot="slider"
|
|
24
20
|
data-orientation={orientation}
|
|
25
21
|
defaultValue={defaultValue}
|
|
@@ -53,6 +49,7 @@ function Slider({
|
|
|
53
49
|
))}
|
|
54
50
|
</SliderPrimitive.Root>
|
|
55
51
|
)
|
|
56
|
-
}
|
|
52
|
+
})
|
|
53
|
+
Slider.displayName = 'Slider'
|
|
57
54
|
|
|
58
55
|
export { Slider }
|
package/src/sonner/sonner.tsx
CHANGED
|
@@ -3,29 +3,32 @@
|
|
|
3
3
|
import { cn } from '@gentleduck/libs/cn'
|
|
4
4
|
import { type Direction, useDirection } from '@gentleduck/primitives/direction'
|
|
5
5
|
import { useTheme } from 'next-themes'
|
|
6
|
-
import
|
|
6
|
+
import React from 'react'
|
|
7
7
|
import { Toaster as Sonner, type ToasterProps } from 'sonner'
|
|
8
8
|
|
|
9
|
-
const Toaster =
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const Toaster = React.forwardRef<React.ComponentRef<typeof Sonner>, ToasterProps>(
|
|
10
|
+
({ dir, className, ...props }, ref) => {
|
|
11
|
+
const { theme = 'system' } = useTheme()
|
|
12
|
+
const direction = useDirection(dir as Direction)
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
return (
|
|
15
|
+
<Sonner
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn('toaster group [&_li>div]:w-full', className)}
|
|
18
|
+
dir={direction}
|
|
19
|
+
style={
|
|
20
|
+
{
|
|
21
|
+
'--normal-bg': 'var(--popover)',
|
|
22
|
+
'--normal-border': 'var(--border)',
|
|
23
|
+
'--normal-text': 'var(--popover-foreground)',
|
|
24
|
+
} as React.CSSProperties
|
|
25
|
+
}
|
|
26
|
+
theme={theme as ToasterProps['theme']}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
},
|
|
31
|
+
)
|
|
29
32
|
Toaster.displayName = 'Toaster'
|
|
30
33
|
|
|
31
34
|
export { Toaster }
|
|
@@ -10,8 +10,8 @@ export const toggleVariants = cva(
|
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
12
12
|
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
|
13
|
-
lg: 'h-10 min-w-11 px-
|
|
14
|
-
sm: 'h-8 min-w-9 gap-1.5 px-
|
|
13
|
+
lg: 'h-10 min-w-11 px-6 has-[>svg]:px-4',
|
|
14
|
+
sm: 'h-8 min-w-9 gap-1.5 px-3 has-[>svg]:px-2.5',
|
|
15
15
|
},
|
|
16
16
|
variant: {
|
|
17
17
|
default: 'bg-transparent',
|
package/src/tooltip/tooltip.tsx
CHANGED
|
@@ -5,10 +5,13 @@ import * as TooltipPrimitive from '@gentleduck/primitives/tooltip'
|
|
|
5
5
|
import * as React from 'react'
|
|
6
6
|
|
|
7
7
|
const TooltipProvider = TooltipPrimitive.Provider
|
|
8
|
+
TooltipProvider.displayName = 'TooltipProvider'
|
|
8
9
|
|
|
9
10
|
const Tooltip = TooltipPrimitive.Root
|
|
11
|
+
Tooltip.displayName = 'Tooltip'
|
|
10
12
|
|
|
11
13
|
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
14
|
+
TooltipTrigger.displayName = 'TooltipTrigger'
|
|
12
15
|
|
|
13
16
|
const TooltipContent = React.forwardRef<
|
|
14
17
|
React.ComponentRef<typeof TooltipPrimitive.Content>,
|