@gentleduck/registry-ui 0.2.5 → 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-check-types.log +1 -0
- package/.turbo/turbo-test.log +23 -0
- package/CHANGELOG.md +21 -0
- package/package.json +9 -8
- package/src/_old/_table/index.ts +9 -0
- package/src/_old/_table/table.tsx +7 -7
- package/src/_old/_upload/index.ts +13 -0
- package/src/_old/_upload/upload-sonner.tsx +1 -1
- package/src/alert-dialog/alert-dialog.tsx +11 -4
- package/src/aspect-ratio/aspect-ratio.tsx +9 -11
- package/src/audio/audio-visualizer.tsx +28 -2
- package/src/audio/audio.types.ts +1 -2
- package/src/button/__test__/button.test.tsx +80 -0
- package/src/button/button.tsx +1 -1
- package/src/button-group/button-group.tsx +1 -0
- package/src/calendar/calendar.tsx +161 -141
- package/src/carousel/carousel.tsx +1 -0
- package/src/chart/__test__/chart.test.tsx +40 -0
- package/src/chart/chart.tsx +16 -7
- package/src/checkbox/checkbox.tsx +1 -0
- package/src/collapsible/collapsible.tsx +2 -1
- 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 +12 -1
- 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 +138 -109
- package/src/input-group/input-group.tsx +3 -0
- package/src/item/item.tsx +1 -0
- package/src/json-editor/json-editor.tsx +59 -60
- package/src/json-editor/json-editor.view.tsx +1 -0
- package/src/label/label.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/separator/separator.tsx +0 -1
- package/src/sheet/sheet.tsx +16 -4
- package/src/sidebar/sidebar.tsx +436 -378
- package/src/slider/slider.tsx +8 -10
- package/src/sonner/sonner.chunks.tsx +3 -0
- package/src/sonner/sonner.tsx +23 -20
- package/src/switch/switch.tsx +1 -0
- package/src/tabs/tabs.tsx +2 -2
- package/src/toggle/toggle.constants.ts +2 -2
- package/src/tooltip/tooltip.tsx +3 -0
- package/tsconfig.json +10 -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}
|
|
@@ -46,12 +42,14 @@ function Slider({
|
|
|
46
42
|
<SliderPrimitive.Thumb
|
|
47
43
|
data-orientation={orientation}
|
|
48
44
|
data-slot="slider-thumb"
|
|
45
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: thumbs are positional, index is the stable key
|
|
49
46
|
key={index}
|
|
50
47
|
className="relative block size-4 shrink-0 select-none rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] after:absolute after:-inset-2 hover:ring-3 focus-visible:outline-hidden focus-visible:ring-3 active:ring-3 disabled:pointer-events-none disabled:opacity-50"
|
|
51
48
|
/>
|
|
52
49
|
))}
|
|
53
50
|
</SliderPrimitive.Root>
|
|
54
51
|
)
|
|
55
|
-
}
|
|
52
|
+
})
|
|
53
|
+
Slider.displayName = 'Slider'
|
|
56
54
|
|
|
57
55
|
export { Slider }
|
|
@@ -31,6 +31,7 @@ const SonnerUpload = ({
|
|
|
31
31
|
)}
|
|
32
32
|
/>
|
|
33
33
|
<div className="flex w-full flex-col gap-2">
|
|
34
|
+
{/* biome-ignore lint/a11y/useSemanticElements: status role on div is intentional for live region announcements */}
|
|
34
35
|
<div className="flex w-full justify-between" role="status">
|
|
35
36
|
<p className="text-foreground text-sm">
|
|
36
37
|
{progress >= 100
|
|
@@ -77,4 +78,6 @@ const SonnerUpload = ({
|
|
|
77
78
|
)
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
SonnerUpload.displayName = 'SonnerUpload'
|
|
82
|
+
|
|
80
83
|
export { SonnerUpload }
|
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 }
|
package/src/switch/switch.tsx
CHANGED
package/src/tabs/tabs.tsx
CHANGED
|
@@ -35,7 +35,7 @@ const Tabs = React.forwardRef<HTMLDivElement, TabsProps>(
|
|
|
35
35
|
|
|
36
36
|
React.useEffect(() => {
|
|
37
37
|
if (onValueChange) onValueChange(activeItem)
|
|
38
|
-
}, [activeItem])
|
|
38
|
+
}, [activeItem, onValueChange])
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<TabsContext.Provider value={{ activeItem, setActiveItem, tabsId }}>
|
|
@@ -74,7 +74,7 @@ const TabsTrigger = React.forwardRef<HTMLButtonElement, TabsTriggerProps>(
|
|
|
74
74
|
|
|
75
75
|
React.useEffect(() => {
|
|
76
76
|
if (defaultChecked) setActiveItem(value)
|
|
77
|
-
}, [defaultChecked])
|
|
77
|
+
}, [defaultChecked, setActiveItem, value])
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
80
|
<button
|
|
@@ -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>,
|
package/tsconfig.json
CHANGED
|
@@ -19,7 +19,16 @@
|
|
|
19
19
|
],
|
|
20
20
|
"rootDir": "./"
|
|
21
21
|
},
|
|
22
|
-
"exclude": [
|
|
22
|
+
"exclude": [
|
|
23
|
+
"node_modules",
|
|
24
|
+
"dist",
|
|
25
|
+
"./src/_old",
|
|
26
|
+
"**/__test__/**",
|
|
27
|
+
"**/*.test.ts",
|
|
28
|
+
"**/*.test.tsx",
|
|
29
|
+
"**/*.tsbuildinfo",
|
|
30
|
+
"tsconfig.tsbuildinfo"
|
|
31
|
+
],
|
|
23
32
|
"extends": "@gentleduck/typescript-config/base.json",
|
|
24
33
|
"include": ["./**/*.ts", "./**/*.tsx"]
|
|
25
34
|
}
|