@twintag/twintag-form 1.4.1 → 1.5.0
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-build.log +16 -14
- package/CHANGELOG.md +6 -0
- package/dev/main.tsx +1 -1
- package/dist/common/form.d.ts +7 -7
- package/dist/common/input.d.ts +14 -14
- package/dist/common/textarea.d.ts +7 -7
- package/dist/components/provider.d.ts +4 -6
- package/dist/react.cjs +89 -0
- package/dist/{twintag-form.react.js → react.js} +3532 -3522
- package/dist/types/index.d.ts +1 -1
- package/dist/webcomponent.cjs +1 -0
- package/dist/{twintag-form.webcomponent.js → webcomponent.js} +1 -1
- package/lib/common/form.tsx +1 -1
- package/lib/common/input.tsx +1 -1
- package/lib/common/textarea.tsx +1 -1
- package/lib/components/containers/accordion.tsx +2 -2
- package/lib/components/containers/category.tsx +1 -1
- package/lib/components/fields/checkbox.tsx +1 -1
- package/lib/components/fields/date-picker.tsx +2 -2
- package/lib/components/fields/file.tsx +1 -1
- package/lib/components/fields/input.tsx +1 -1
- package/lib/components/fields/radiogroup.tsx +1 -1
- package/lib/components/fields/textarea.tsx +1 -1
- package/lib/components/fields/toggle.tsx +1 -1
- package/lib/types/index.ts +1 -1
- package/package.json +3 -6
- package/tsconfig.json +5 -3
- package/vite.config.ts +5 -8
- package/dist/common/scroll-area.d.ts +0 -5
- package/dist/common/select.d.ts +0 -13
- package/lib/common/scroll-area.tsx +0 -46
- package/lib/common/select.tsx +0 -159
package/lib/common/select.tsx
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CaretSortIcon } from '@radix-ui/react-icons';
|
|
3
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
|
-
import { Check, ChevronDown, ChevronUp } from 'lucide-react';
|
|
5
|
-
|
|
6
|
-
import { cn } from '../utils/style';
|
|
7
|
-
|
|
8
|
-
const Select = SelectPrimitive.Root;
|
|
9
|
-
|
|
10
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
11
|
-
|
|
12
|
-
const SelectValue = SelectPrimitive.Value;
|
|
13
|
-
|
|
14
|
-
const SelectTrigger = React.forwardRef<
|
|
15
|
-
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
16
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
17
|
-
>(({ className, children, ...props }, ref) => (
|
|
18
|
-
<SelectPrimitive.Trigger
|
|
19
|
-
ref={ref}
|
|
20
|
-
className={cn(
|
|
21
|
-
'flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
|
|
22
|
-
className,
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
>
|
|
26
|
-
{children}
|
|
27
|
-
<SelectPrimitive.Icon asChild>
|
|
28
|
-
<CaretSortIcon className='h-4 w-4 opacity-50' />
|
|
29
|
-
</SelectPrimitive.Icon>
|
|
30
|
-
</SelectPrimitive.Trigger>
|
|
31
|
-
));
|
|
32
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
33
|
-
|
|
34
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
35
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
36
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
37
|
-
>(({ className, ...props }, ref) => (
|
|
38
|
-
<SelectPrimitive.ScrollUpButton
|
|
39
|
-
ref={ref}
|
|
40
|
-
className={cn(
|
|
41
|
-
'flex cursor-default items-center justify-center py-1',
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
<ChevronUp className='h-4 w-4' />
|
|
47
|
-
</SelectPrimitive.ScrollUpButton>
|
|
48
|
-
));
|
|
49
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
50
|
-
|
|
51
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
52
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
53
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
54
|
-
>(({ className, ...props }, ref) => (
|
|
55
|
-
<SelectPrimitive.ScrollDownButton
|
|
56
|
-
ref={ref}
|
|
57
|
-
className={cn(
|
|
58
|
-
'flex cursor-default items-center justify-center py-1',
|
|
59
|
-
className,
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
<ChevronDown className='h-4 w-4' />
|
|
64
|
-
</SelectPrimitive.ScrollDownButton>
|
|
65
|
-
));
|
|
66
|
-
SelectScrollDownButton.displayName =
|
|
67
|
-
SelectPrimitive.ScrollDownButton.displayName;
|
|
68
|
-
|
|
69
|
-
const SelectContent = React.forwardRef<
|
|
70
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
71
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
72
|
-
>(({ className, children, position = 'popper', ...props }, ref) => {
|
|
73
|
-
return (
|
|
74
|
-
<SelectPrimitive.Content
|
|
75
|
-
ref={ref}
|
|
76
|
-
className={cn(
|
|
77
|
-
'relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-background text-foreground shadow-md',
|
|
78
|
-
position === 'popper' &&
|
|
79
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
80
|
-
className,
|
|
81
|
-
)}
|
|
82
|
-
position={position}
|
|
83
|
-
{...props}
|
|
84
|
-
>
|
|
85
|
-
<SelectScrollUpButton />
|
|
86
|
-
<SelectPrimitive.Viewport
|
|
87
|
-
className={cn(
|
|
88
|
-
'p-1',
|
|
89
|
-
position === 'popper' &&
|
|
90
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',
|
|
91
|
-
)}
|
|
92
|
-
>
|
|
93
|
-
{children}
|
|
94
|
-
</SelectPrimitive.Viewport>
|
|
95
|
-
<SelectScrollDownButton />
|
|
96
|
-
</SelectPrimitive.Content>
|
|
97
|
-
);
|
|
98
|
-
});
|
|
99
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
100
|
-
|
|
101
|
-
const SelectLabel = React.forwardRef<
|
|
102
|
-
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
103
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
104
|
-
>(({ className, ...props }, ref) => (
|
|
105
|
-
<SelectPrimitive.Label
|
|
106
|
-
ref={ref}
|
|
107
|
-
className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
));
|
|
111
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
112
|
-
|
|
113
|
-
const SelectItem = React.forwardRef<
|
|
114
|
-
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
115
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
116
|
-
>(({ className, children, ...props }, ref) => (
|
|
117
|
-
<SelectPrimitive.Item
|
|
118
|
-
ref={ref}
|
|
119
|
-
className={cn(
|
|
120
|
-
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
121
|
-
className,
|
|
122
|
-
)}
|
|
123
|
-
{...props}
|
|
124
|
-
>
|
|
125
|
-
<span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
126
|
-
<SelectPrimitive.ItemIndicator>
|
|
127
|
-
<Check className='h-4 w-4' />
|
|
128
|
-
</SelectPrimitive.ItemIndicator>
|
|
129
|
-
</span>
|
|
130
|
-
|
|
131
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
132
|
-
</SelectPrimitive.Item>
|
|
133
|
-
));
|
|
134
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
135
|
-
|
|
136
|
-
const SelectSeparator = React.forwardRef<
|
|
137
|
-
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
138
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
139
|
-
>(({ className, ...props }, ref) => (
|
|
140
|
-
<SelectPrimitive.Separator
|
|
141
|
-
ref={ref}
|
|
142
|
-
className={cn('-mx-1 my-1 h-px bg-muted', className)}
|
|
143
|
-
{...props}
|
|
144
|
-
/>
|
|
145
|
-
));
|
|
146
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
147
|
-
|
|
148
|
-
export {
|
|
149
|
-
Select,
|
|
150
|
-
SelectGroup,
|
|
151
|
-
SelectValue,
|
|
152
|
-
SelectTrigger,
|
|
153
|
-
SelectContent,
|
|
154
|
-
SelectLabel,
|
|
155
|
-
SelectItem,
|
|
156
|
-
SelectSeparator,
|
|
157
|
-
SelectScrollUpButton,
|
|
158
|
-
SelectScrollDownButton,
|
|
159
|
-
};
|