@dilipod/ui 0.2.13 → 0.2.14
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/dist/components/select.d.ts +7 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107 -83
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +106 -83
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/select.tsx +35 -0
- package/src/index.ts +3 -0
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { cn } from '../lib/utils'
|
|
5
|
+
|
|
6
|
+
export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
7
|
+
error?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
11
|
+
({ className, error, children, ...props }, ref) => {
|
|
12
|
+
return (
|
|
13
|
+
<select
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
'flex h-10 w-full rounded-sm border bg-white px-3 py-2 text-base text-[var(--black)] ring-offset-background',
|
|
17
|
+
'placeholder:text-gray-500',
|
|
18
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
|
|
19
|
+
'disabled:cursor-not-allowed disabled:opacity-50 md:text-sm transition-colors',
|
|
20
|
+
error
|
|
21
|
+
? 'border-red-500 focus-visible:ring-red-500'
|
|
22
|
+
: 'border-gray-300 focus-visible:ring-[var(--cyan)]',
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
aria-invalid={error ? 'true' : undefined}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</select>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
Select.displayName = 'Select'
|
|
34
|
+
|
|
35
|
+
export { Select }
|
package/src/index.ts
CHANGED
|
@@ -62,6 +62,9 @@ export type { LabelProps } from '@radix-ui/react-label'
|
|
|
62
62
|
export { Textarea } from './components/textarea'
|
|
63
63
|
export type { TextareaProps } from './components/textarea'
|
|
64
64
|
|
|
65
|
+
export { Select } from './components/select'
|
|
66
|
+
export type { SelectProps } from './components/select'
|
|
67
|
+
|
|
65
68
|
export { Checkbox } from './components/checkbox'
|
|
66
69
|
export type { CheckboxProps } from './components/checkbox'
|
|
67
70
|
|