@agroshine/ags-web-ui-kit 1.0.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/README.md +75 -0
- package/dist/atoms/index.cjs +134 -0
- package/dist/atoms/index.cjs.map +1 -0
- package/dist/atoms/index.d.cts +583 -0
- package/dist/atoms/index.d.ts +583 -0
- package/dist/atoms/index.js +9 -0
- package/dist/atoms/index.js.map +1 -0
- package/dist/chunk-2KRMLIJQ.cjs +52 -0
- package/dist/chunk-2KRMLIJQ.cjs.map +1 -0
- package/dist/chunk-2TBYPKQ3.cjs +79 -0
- package/dist/chunk-2TBYPKQ3.cjs.map +1 -0
- package/dist/chunk-5FWELSEZ.js +1296 -0
- package/dist/chunk-5FWELSEZ.js.map +1 -0
- package/dist/chunk-5PEOJVY7.cjs +1502 -0
- package/dist/chunk-5PEOJVY7.cjs.map +1 -0
- package/dist/chunk-6LUGTNMH.js +259 -0
- package/dist/chunk-6LUGTNMH.js.map +1 -0
- package/dist/chunk-6O2IDBTX.js +112 -0
- package/dist/chunk-6O2IDBTX.js.map +1 -0
- package/dist/chunk-6YUNWKT3.js +26 -0
- package/dist/chunk-6YUNWKT3.js.map +1 -0
- package/dist/chunk-7R6OXNES.cjs +321 -0
- package/dist/chunk-7R6OXNES.cjs.map +1 -0
- package/dist/chunk-A3A7PJWG.cjs +13 -0
- package/dist/chunk-A3A7PJWG.cjs.map +1 -0
- package/dist/chunk-A7TDGQAB.js +557 -0
- package/dist/chunk-A7TDGQAB.js.map +1 -0
- package/dist/chunk-C4LX3XTN.cjs +1187 -0
- package/dist/chunk-C4LX3XTN.cjs.map +1 -0
- package/dist/chunk-DZW4GS2T.cjs +1340 -0
- package/dist/chunk-DZW4GS2T.cjs.map +1 -0
- package/dist/chunk-E3BTK736.cjs +174 -0
- package/dist/chunk-E3BTK736.cjs.map +1 -0
- package/dist/chunk-ERGKCXM2.cjs +267 -0
- package/dist/chunk-ERGKCXM2.cjs.map +1 -0
- package/dist/chunk-FOA46NSG.cjs +574 -0
- package/dist/chunk-FOA46NSG.cjs.map +1 -0
- package/dist/chunk-JTFCE6RA.js +1156 -0
- package/dist/chunk-JTFCE6RA.js.map +1 -0
- package/dist/chunk-KINOE57L.js +225 -0
- package/dist/chunk-KINOE57L.js.map +1 -0
- package/dist/chunk-MOED3QPY.js +11 -0
- package/dist/chunk-MOED3QPY.js.map +1 -0
- package/dist/chunk-NVR34DY2.cjs +4 -0
- package/dist/chunk-NVR34DY2.cjs.map +1 -0
- package/dist/chunk-PI3IJWBG.js +79 -0
- package/dist/chunk-PI3IJWBG.js.map +1 -0
- package/dist/chunk-PXAMTGYY.js +3 -0
- package/dist/chunk-PXAMTGYY.js.map +1 -0
- package/dist/chunk-QAZMI5VH.js +151 -0
- package/dist/chunk-QAZMI5VH.js.map +1 -0
- package/dist/chunk-QEG27NX6.js +30 -0
- package/dist/chunk-QEG27NX6.js.map +1 -0
- package/dist/chunk-THTOUSMG.cjs +52 -0
- package/dist/chunk-THTOUSMG.cjs.map +1 -0
- package/dist/chunk-UAXKB6IH.cjs +32 -0
- package/dist/chunk-UAXKB6IH.cjs.map +1 -0
- package/dist/chunk-W5IHWAMM.js +48 -0
- package/dist/chunk-W5IHWAMM.js.map +1 -0
- package/dist/chunk-X2UJQVZJ.cjs +139 -0
- package/dist/chunk-X2UJQVZJ.cjs.map +1 -0
- package/dist/chunk-X43C5OJD.js +1460 -0
- package/dist/chunk-X43C5OJD.js.map +1 -0
- package/dist/chunk-XCYSBWV4.js +56 -0
- package/dist/chunk-XCYSBWV4.js.map +1 -0
- package/dist/chunk-XX4CBCEB.cjs +102 -0
- package/dist/chunk-XX4CBCEB.cjs.map +1 -0
- package/dist/hooks/index.cjs +33 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +59 -0
- package/dist/hooks/index.d.ts +59 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs +366 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/interface-DnK5S6ww.d.cts +51 -0
- package/dist/interface-DnK5S6ww.d.ts +51 -0
- package/dist/lib/index.cjs +13 -0
- package/dist/lib/index.cjs.map +1 -0
- package/dist/lib/index.d.cts +5 -0
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/index.js +4 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/molecules/index.cjs +123 -0
- package/dist/molecules/index.cjs.map +1 -0
- package/dist/molecules/index.d.cts +449 -0
- package/dist/molecules/index.d.ts +449 -0
- package/dist/molecules/index.js +10 -0
- package/dist/molecules/index.js.map +1 -0
- package/dist/organisms/index.cjs +102 -0
- package/dist/organisms/index.cjs.map +1 -0
- package/dist/organisms/index.d.cts +396 -0
- package/dist/organisms/index.d.ts +396 -0
- package/dist/organisms/index.js +9 -0
- package/dist/organisms/index.js.map +1 -0
- package/dist/tooltip-Bl2ZTtfg.d.cts +16 -0
- package/dist/tooltip-Bl2ZTtfg.d.ts +16 -0
- package/dist/ui/index.cjs +955 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +252 -0
- package/dist/ui/index.d.ts +252 -0
- package/dist/ui/index.js +642 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +200 -0
- package/tailwind.preset.cjs +134 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkA3A7PJWG_cjs = require('./chunk-A3A7PJWG.cjs');
|
|
4
|
+
var React9 = require('react');
|
|
5
|
+
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
8
|
+
var lucideReact = require('lucide-react');
|
|
9
|
+
var RadioGroupPrimitive = require('@radix-ui/react-radio-group');
|
|
10
|
+
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
11
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
12
|
+
var TogglePrimitive = require('@radix-ui/react-toggle');
|
|
13
|
+
var ToggleGroupPrimitive = require('@radix-ui/react-toggle-group');
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n.default = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var React9__namespace = /*#__PURE__*/_interopNamespace(React9);
|
|
34
|
+
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
35
|
+
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
36
|
+
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
37
|
+
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
38
|
+
var TogglePrimitive__namespace = /*#__PURE__*/_interopNamespace(TogglePrimitive);
|
|
39
|
+
var ToggleGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(ToggleGroupPrimitive);
|
|
40
|
+
|
|
41
|
+
var Avatar = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
AvatarPrimitive__namespace.Root,
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
className: chunkA3A7PJWG_cjs.cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
));
|
|
49
|
+
Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
50
|
+
var AvatarImage = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
AvatarPrimitive__namespace.Image,
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
className: chunkA3A7PJWG_cjs.cn("aspect-square h-full w-full", className),
|
|
55
|
+
...props
|
|
56
|
+
}
|
|
57
|
+
));
|
|
58
|
+
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
59
|
+
var AvatarFallback = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
AvatarPrimitive__namespace.Fallback,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
64
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
65
|
+
className
|
|
66
|
+
),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
));
|
|
70
|
+
AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
|
|
71
|
+
var Checkbox = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
CheckboxPrimitive__namespace.Root,
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
76
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...props,
|
|
80
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(CheckboxPrimitive__namespace.Indicator, { className: chunkA3A7PJWG_cjs.cn("flex items-center justify-center text-current"), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) })
|
|
81
|
+
}
|
|
82
|
+
));
|
|
83
|
+
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
84
|
+
var Input = React9__namespace.forwardRef(
|
|
85
|
+
({ className, type, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"input",
|
|
87
|
+
{
|
|
88
|
+
ref,
|
|
89
|
+
type,
|
|
90
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
91
|
+
"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm text-foreground transition-colors",
|
|
92
|
+
"placeholder:text-muted-foreground",
|
|
93
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
94
|
+
"aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
|
|
95
|
+
"disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60",
|
|
96
|
+
"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
);
|
|
103
|
+
Input.displayName = "Input";
|
|
104
|
+
var RadioGroup = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Root, { ref, className: chunkA3A7PJWG_cjs.cn("grid gap-2", className), ...props }));
|
|
105
|
+
RadioGroup.displayName = RadioGroupPrimitive__namespace.Root.displayName;
|
|
106
|
+
var RadioGroupItem = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
RadioGroupPrimitive__namespace.Item,
|
|
108
|
+
{
|
|
109
|
+
ref,
|
|
110
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
111
|
+
"aspect-square h-4 w-4 rounded-full border border-border text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
...props,
|
|
115
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-2.5 w-2.5 fill-current text-current" }) })
|
|
116
|
+
}
|
|
117
|
+
));
|
|
118
|
+
RadioGroupItem.displayName = RadioGroupPrimitive__namespace.Item.displayName;
|
|
119
|
+
var Separator = React9__namespace.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
120
|
+
SeparatorPrimitive__namespace.Root,
|
|
121
|
+
{
|
|
122
|
+
ref,
|
|
123
|
+
decorative,
|
|
124
|
+
orientation,
|
|
125
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
126
|
+
"shrink-0 bg-border",
|
|
127
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
128
|
+
className
|
|
129
|
+
),
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
));
|
|
133
|
+
Separator.displayName = SeparatorPrimitive__namespace.Root.displayName;
|
|
134
|
+
var Skeleton = React9__namespace.forwardRef(
|
|
135
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
ref,
|
|
139
|
+
className: chunkA3A7PJWG_cjs.cn("animate-pulse rounded-md bg-default-200", className),
|
|
140
|
+
...props
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
);
|
|
144
|
+
Skeleton.displayName = "Skeleton";
|
|
145
|
+
var badgeVariants = classVarianceAuthority.cva(
|
|
146
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
147
|
+
{
|
|
148
|
+
variants: {
|
|
149
|
+
variant: {
|
|
150
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
151
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
152
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
153
|
+
outline: "text-foreground",
|
|
154
|
+
success: "border-transparent bg-success-50 text-success-800",
|
|
155
|
+
warning: "border-transparent bg-warning-50 text-warning-800",
|
|
156
|
+
danger: "border-transparent bg-danger-50 text-danger-800",
|
|
157
|
+
info: "border-transparent bg-primary-50 text-primary-700 hover:bg-primary-50/80"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
defaultVariants: {
|
|
161
|
+
variant: "default"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
function Badge({ className, variant, ...props }) {
|
|
166
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkA3A7PJWG_cjs.cn(badgeVariants({ variant }), className), ...props });
|
|
167
|
+
}
|
|
168
|
+
var Textarea = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
169
|
+
"textarea",
|
|
170
|
+
{
|
|
171
|
+
ref,
|
|
172
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
173
|
+
"flex w-full min-h-20 resize-y rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground transition-colors",
|
|
174
|
+
"placeholder:text-muted-foreground",
|
|
175
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
176
|
+
"aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive",
|
|
177
|
+
"disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60",
|
|
178
|
+
className
|
|
179
|
+
),
|
|
180
|
+
...props
|
|
181
|
+
}
|
|
182
|
+
));
|
|
183
|
+
Textarea.displayName = "Textarea";
|
|
184
|
+
var toggleVariants = classVarianceAuthority.cva(
|
|
185
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-default-200 data-[state=on]:text-default-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",
|
|
186
|
+
{
|
|
187
|
+
variants: {
|
|
188
|
+
variant: {
|
|
189
|
+
default: "bg-transparent",
|
|
190
|
+
outline: "border border-border bg-transparent hover:bg-default-100 hover:text-default-700"
|
|
191
|
+
},
|
|
192
|
+
size: {
|
|
193
|
+
default: "h-10 px-3 min-w-10",
|
|
194
|
+
sm: "h-9 px-2.5 min-w-9",
|
|
195
|
+
lg: "h-11 px-5 min-w-11"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
defaultVariants: {
|
|
199
|
+
variant: "default",
|
|
200
|
+
size: "default"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
var Toggle = React9__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
205
|
+
TogglePrimitive__namespace.Root,
|
|
206
|
+
{
|
|
207
|
+
ref,
|
|
208
|
+
className: chunkA3A7PJWG_cjs.cn(toggleVariants({ variant, size, className })),
|
|
209
|
+
...props
|
|
210
|
+
}
|
|
211
|
+
));
|
|
212
|
+
Toggle.displayName = TogglePrimitive__namespace.Root.displayName;
|
|
213
|
+
var ToggleGroupContext = React9__namespace.createContext({
|
|
214
|
+
size: "default",
|
|
215
|
+
variant: "default"
|
|
216
|
+
});
|
|
217
|
+
var ToggleGroup = React9__namespace.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
218
|
+
ToggleGroupPrimitive__namespace.Root,
|
|
219
|
+
{
|
|
220
|
+
ref,
|
|
221
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
222
|
+
"inline-flex items-center justify-center gap-1 rounded-md border border-border bg-muted p-[3px]",
|
|
223
|
+
className
|
|
224
|
+
),
|
|
225
|
+
...props,
|
|
226
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
227
|
+
}
|
|
228
|
+
));
|
|
229
|
+
ToggleGroup.displayName = ToggleGroupPrimitive__namespace.Root.displayName;
|
|
230
|
+
var ToggleGroupItem = React9__namespace.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
231
|
+
const context = React9__namespace.useContext(ToggleGroupContext);
|
|
232
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
233
|
+
ToggleGroupPrimitive__namespace.Item,
|
|
234
|
+
{
|
|
235
|
+
ref,
|
|
236
|
+
className: chunkA3A7PJWG_cjs.cn(
|
|
237
|
+
toggleVariants({
|
|
238
|
+
variant: context.variant || variant,
|
|
239
|
+
size: context.size || size
|
|
240
|
+
}),
|
|
241
|
+
"rounded-sm",
|
|
242
|
+
className
|
|
243
|
+
),
|
|
244
|
+
...props,
|
|
245
|
+
children
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
});
|
|
249
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive__namespace.Item.displayName;
|
|
250
|
+
|
|
251
|
+
exports.Avatar = Avatar;
|
|
252
|
+
exports.AvatarFallback = AvatarFallback;
|
|
253
|
+
exports.AvatarImage = AvatarImage;
|
|
254
|
+
exports.Badge = Badge;
|
|
255
|
+
exports.Checkbox = Checkbox;
|
|
256
|
+
exports.Input = Input;
|
|
257
|
+
exports.RadioGroup = RadioGroup;
|
|
258
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
259
|
+
exports.Separator = Separator;
|
|
260
|
+
exports.Skeleton = Skeleton;
|
|
261
|
+
exports.Textarea = Textarea;
|
|
262
|
+
exports.Toggle = Toggle;
|
|
263
|
+
exports.ToggleGroup = ToggleGroup;
|
|
264
|
+
exports.ToggleGroupItem = ToggleGroupItem;
|
|
265
|
+
exports.toggleVariants = toggleVariants;
|
|
266
|
+
//# sourceMappingURL=chunk-ERGKCXM2.cjs.map
|
|
267
|
+
//# sourceMappingURL=chunk-ERGKCXM2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/avatar.tsx","../src/ui/checkbox.tsx","../src/ui/input.tsx","../src/ui/radio-group.tsx","../src/ui/separator.tsx","../src/ui/skeleton.tsx","../src/ui/badge.tsx","../src/ui/textarea.tsx","../src/ui/toggle.tsx","../src/ui/toggle-group.tsx"],"names":["React","jsx","AvatarPrimitive","cn","React2","CheckboxPrimitive","Check","React3","React4","RadioGroupPrimitive","Circle","React5","SeparatorPrimitive","React6","cva","React7","React8","TogglePrimitive","React9","ToggleGroupPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAM,MAAA,GAAeA,6BAGnB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1BC,cAAA;AAAA,EAAiBC,0BAAA,CAAA,IAAA;AAAA,EAAhB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAWC,oBAAA,CAAG,+DAAA,EAAiE,SAAS,CAAA;AAAA,IACvF,GAAG;AAAA;AACN,CACD;AACD,MAAA,CAAO,cAA8BD,0BAAA,CAAA,IAAA,CAAK,WAAA;AAE1C,IAAM,WAAA,GAAoBF,6BAGxB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1BC,cAAA;AAAA,EAAiBC,0BAAA,CAAA,KAAA;AAAA,EAAhB;AAAA,IACC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from '@radix-ui/react-avatar';\n\nimport { cn } from '../lib/cn';\n\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn('aspect-square h-full w-full', className)}\n {...props}\n />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n 'flex h-full w-full items-center justify-center rounded-full bg-muted',\n className,\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarFallback, AvatarImage };\n","import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Check } from 'lucide-react';\n\nimport { cn } from '../lib/cn';\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'peer h-4 w-4 shrink-0 rounded-sm border border-border ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","import * as React from 'react';\n\nimport { cn } from '../lib/cn';\n\n/**\n * Input primitive shadcn-style.\n * Canon Components.html: height 36px, padding 0 12px,\n * border-radius `calc(var(--radius) - 2px)` = 6px (via `rounded-md`),\n * border `border-input`, focus ring sobre `ring`, disabled `bg-muted`.\n */\nconst Input = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(\n ({ className, type, ...props }, ref) => (\n <input\n ref={ref}\n type={type}\n className={cn(\n 'flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm text-foreground transition-colors',\n 'placeholder:text-muted-foreground',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0',\n 'aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive',\n 'disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60',\n 'file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',\n className,\n )}\n {...props}\n />\n ),\n);\nInput.displayName = 'Input';\n\nexport { Input };\n","import * as React from 'react';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { Circle } from 'lucide-react';\n\nimport { cn } from '../lib/cn';\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root ref={ref} className={cn('grid gap-2', className)} {...props} />\n));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'aspect-square h-4 w-4 rounded-full border border-border text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary',\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","import * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport { cn } from '../lib/cn';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","import * as React from 'react';\n\nimport { cn } from '../lib/cn';\n\nconst Skeleton = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('animate-pulse rounded-md bg-default-200', className)}\n {...props}\n />\n ),\n);\nSkeleton.displayName = 'Skeleton';\n\nexport { Skeleton };\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/cn';\n\nconst badgeVariants = cva(\n 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n {\n variants: {\n variant: {\n default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',\n secondary:\n 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive:\n 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n outline: 'text-foreground',\n success: 'border-transparent bg-success-50 text-success-800',\n warning: 'border-transparent bg-warning-50 text-warning-800',\n danger: 'border-transparent bg-danger-50 text-danger-800',\n info: 'border-transparent bg-primary-50 text-primary-700 hover:bg-primary-50/80',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />;\n}\n\nexport { Badge };\n","import * as React from 'react';\n\nimport { cn } from '../lib/cn';\n\n/**\n * Textarea primitive shadcn-style.\n * Canon Components.html: padding 8px 12px,\n * border-radius `calc(var(--radius) - 2px)` = 6px (via `rounded-md`),\n * border `border-input`, focus ring sobre `ring`, disabled `bg-muted`.\n * Min-height 80px (5rem), resize vertical.\n */\nconst Textarea = React.forwardRef<\n HTMLTextAreaElement,\n React.TextareaHTMLAttributes<HTMLTextAreaElement>\n>(({ className, ...props }, ref) => (\n <textarea\n ref={ref}\n className={cn(\n 'flex w-full min-h-20 resize-y rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground transition-colors',\n 'placeholder:text-muted-foreground',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0',\n 'aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive',\n 'disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60',\n className,\n )}\n {...props}\n />\n));\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","import * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/cn';\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-default-100 hover:text-default-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-default-200 data-[state=on]:text-default-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2',\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n outline: 'border border-border bg-transparent hover:bg-default-100 hover:text-default-700',\n },\n size: {\n default: 'h-10 px-3 min-w-10',\n sm: 'h-9 px-2.5 min-w-9',\n lg: 'h-11 px-5 min-w-11',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n));\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n","import * as React from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/cn';\n\nimport { toggleVariants } from './toggle';\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: 'default',\n variant: 'default',\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center gap-1 rounded-md border border-border bg-muted p-[3px]',\n className,\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n 'rounded-sm',\n className,\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n"]}
|