@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.
@@ -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 [53.00ms]
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 [1.00ms]
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 [3.00ms]
14
- (pass) registry-ui button > Button preserves explicit disabled state even when loading is false [1.00ms]
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. [574.00ms]
23
+ Ran 8 tests across 2 files. [390.00ms]
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @gentleduck/registry-ui
2
2
 
3
+ ## 0.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 80f8c4c: Fix declaration output for shared docs and registry UI components so consumer apps keep valid props during production typechecking.
8
+
3
9
  ## 0.2.8
4
10
 
5
11
  ### Patch Changes
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.576.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.8"
59
+ "version": "0.2.9"
60
60
  }
@@ -1,6 +1,30 @@
1
1
  import { cva } from '@gentleduck/variants'
2
2
 
3
- export const buttonVariants = cva(
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
  {
@@ -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
- const SelectTrigger = React.forwardRef<
18
- React.ComponentRef<typeof SelectPrimitive.Trigger>,
19
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
20
- >(({ className, children, ...props }, ref) => (
21
- <SelectPrimitive.Trigger
22
- ref={ref}
23
- data-slot="select-trigger"
24
- className={cn(
25
- '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',
26
- className,
27
- )}
28
- {...props}>
29
- {children}
30
- <SelectPrimitive.Icon asChild>
31
- <ChevronDown aria-hidden="true" className="size-4 opacity-50" />
32
- </SelectPrimitive.Icon>
33
- </SelectPrimitive.Trigger>
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<