@gentleduck/registry-ui 0.2.8 → 0.2.9
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 +6 -0
- package/package.json +2 -2
- package/src/button/button.constants.ts +25 -1
- package/src/select/select.tsx +20 -18
package/.turbo/turbo-test.log
CHANGED
|
@@ -2,17 +2,17 @@ $ bun test
|
|
|
2
2
|
bun test v1.3.5 (1e86cebd)
|
|
3
3
|
|
|
4
4
|
::group::src/chart/__test__/chart.test.tsx:
|
|
5
|
-
(pass) registry-ui chart > ChartContainer server render does not emit invalid size warnings [
|
|
5
|
+
(pass) registry-ui chart > ChartContainer server render does not emit invalid size warnings [26.00ms]
|
|
6
6
|
|
|
7
7
|
::endgroup::
|
|
8
8
|
|
|
9
9
|
::group::src/button/__test__/button.test.tsx:
|
|
10
|
-
(pass) registry-ui button > buttonVariants returns the shared base styles and defaults
|
|
10
|
+
(pass) registry-ui button > buttonVariants returns the shared base styles and defaults
|
|
11
11
|
(pass) registry-ui button > buttonVariants applies explicit variant and size overrides
|
|
12
|
-
(pass) registry-ui button > button exports keep stable display names
|
|
13
|
-
(pass) registry-ui button > Button renders loading state as a busy disabled native button [
|
|
14
|
-
(pass) registry-ui button > Button preserves explicit disabled state even when loading is false
|
|
15
|
-
(pass) registry-ui button > Button collapses into icon-only mode and hides secondary content
|
|
12
|
+
(pass) registry-ui button > button exports keep stable display names [1.00ms]
|
|
13
|
+
(pass) registry-ui button > Button renders loading state as a busy disabled native button [2.00ms]
|
|
14
|
+
(pass) registry-ui button > Button preserves explicit disabled state even when loading is false
|
|
15
|
+
(pass) registry-ui button > Button collapses into icon-only mode and hides secondary content [1.00ms]
|
|
16
16
|
(pass) registry-ui button > AnimationIcon renders left and right placements around children [1.00ms]
|
|
17
17
|
|
|
18
18
|
::endgroup::
|
|
@@ -20,4 +20,4 @@ bun test v1.3.5 (1e86cebd)
|
|
|
20
20
|
8 pass
|
|
21
21
|
0 fail
|
|
22
22
|
25 expect() calls
|
|
23
|
-
Ran 8 tests across 2 files. [
|
|
23
|
+
Ran 8 tests across 2 files. [390.00ms]
|
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@gentleduck/variants": "^0.1.20",
|
|
12
12
|
"@gentleduck/vim": "^0.1.16",
|
|
13
13
|
"embla-carousel-react": "8.6.0",
|
|
14
|
-
"lucide-react": "0.
|
|
14
|
+
"lucide-react": "0.577.0",
|
|
15
15
|
"next-themes": "^0.4.6",
|
|
16
16
|
"react": "^19.2.4",
|
|
17
17
|
"react-day-picker": "^9.8.1",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"test": "bun test"
|
|
57
57
|
},
|
|
58
58
|
"type": "module",
|
|
59
|
-
"version": "0.2.
|
|
59
|
+
"version": "0.2.9"
|
|
60
60
|
}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { cva } from '@gentleduck/variants'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type ButtonClassValue = string | number | boolean | Record<string, boolean | undefined> | ButtonClassValue[]
|
|
4
|
+
|
|
5
|
+
export type ButtonBorder = 'default' | 'destructive' | 'primary' | 'secondary' | 'warning'
|
|
6
|
+
export type ButtonSize = 'default' | 'icon' | 'icon-lg' | 'icon-sm' | 'lg' | 'sm'
|
|
7
|
+
export type ButtonVariant =
|
|
8
|
+
| 'dashed'
|
|
9
|
+
| 'default'
|
|
10
|
+
| 'destructive'
|
|
11
|
+
| 'expand_icon'
|
|
12
|
+
| 'ghost'
|
|
13
|
+
| 'link'
|
|
14
|
+
| 'nothing'
|
|
15
|
+
| 'outline'
|
|
16
|
+
| 'secondary'
|
|
17
|
+
| 'warning'
|
|
18
|
+
|
|
19
|
+
export interface ButtonVariantOptions {
|
|
20
|
+
border?: ButtonBorder | ButtonBorder[]
|
|
21
|
+
class?: ButtonClassValue
|
|
22
|
+
className?: ButtonClassValue
|
|
23
|
+
size?: ButtonSize | ButtonSize[]
|
|
24
|
+
variant?: ButtonVariant | ButtonVariant[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const buttonVariants: (props?: ButtonVariantOptions) => string = cva(
|
|
4
28
|
"relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
5
29
|
|
|
6
30
|
{
|
package/src/select/select.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { cn } from '@gentleduck/libs/cn'
|
|
4
|
+
import type { SelectTriggerProps as PrimitiveSelectTriggerProps } from '@gentleduck/primitives/select'
|
|
4
5
|
import * as SelectPrimitive from '@gentleduck/primitives/select'
|
|
5
6
|
import { Check, ChevronDown, ChevronUp } from 'lucide-react'
|
|
6
7
|
import * as React from 'react'
|
|
@@ -14,24 +15,25 @@ SelectGroup.displayName = 'SelectGroup'
|
|
|
14
15
|
const SelectValue = SelectPrimitive.Value
|
|
15
16
|
SelectValue.displayName = 'SelectValue'
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
18
|
+
export interface SelectTriggerProps extends PrimitiveSelectTriggerProps {}
|
|
19
|
+
|
|
20
|
+
const SelectTrigger = React.forwardRef<React.ComponentRef<typeof SelectPrimitive.Trigger>, SelectTriggerProps>(
|
|
21
|
+
({ className, children, ...props }, ref) => (
|
|
22
|
+
<SelectPrimitive.Trigger
|
|
23
|
+
ref={ref}
|
|
24
|
+
data-slot="select-trigger"
|
|
25
|
+
className={cn(
|
|
26
|
+
'flex h-9 min-w-32 items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-placeholder:text-muted-foreground [&>span]:line-clamp-1',
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}>
|
|
30
|
+
{children}
|
|
31
|
+
<SelectPrimitive.Icon asChild>
|
|
32
|
+
<ChevronDown aria-hidden="true" className="size-4 opacity-50" />
|
|
33
|
+
</SelectPrimitive.Icon>
|
|
34
|
+
</SelectPrimitive.Trigger>
|
|
35
|
+
),
|
|
36
|
+
)
|
|
35
37
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
36
38
|
|
|
37
39
|
const SelectScrollUpButton = React.forwardRef<
|