@quarklab/rad-ui 0.1.4 → 0.2.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/dist/index.js +1141 -14
- package/package.json +37 -28
- package/templates/web/aspect-ratio.tsx +5 -0
- package/templates/web/avatar.tsx +47 -0
- package/templates/web/badge.tsx +35 -0
- package/templates/web/button.tsx +54 -0
- package/templates/web/checkbox.tsx +34 -0
- package/templates/web/field.tsx +291 -0
- package/templates/web/input-group.tsx +209 -0
- package/templates/web/input-otp.tsx +85 -0
- package/templates/web/input.tsx +103 -0
- package/templates/web/kbd.tsx +37 -0
- package/templates/web/label.tsx +23 -0
- package/templates/web/lib/utils.ts +7 -0
- package/templates/web/native-select.tsx +71 -0
- package/templates/web/radio-group.tsx +43 -0
- package/templates/web/separator.tsx +29 -0
- package/templates/web/skeleton.tsx +15 -0
- package/templates/web/slider.tsx +46 -0
- package/templates/web/spinner.tsx +44 -0
- package/templates/web/switch.tsx +32 -0
- package/templates/web/textarea.tsx +28 -0
- package/templates/web/toggle-group.tsx +58 -0
- package/templates/web/toggle.tsx +45 -0
- package/README.md +0 -39
- package/dist/index.css +0 -1
- package/dist/index.d.mts +0 -56
- package/dist/index.d.ts +0 -56
- package/dist/index.mjs +0 -14
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Loader } from "lucide-react";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
const spinnerVariants = cva("animate-spin", {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: "size-4",
|
|
10
|
+
default: "size-6",
|
|
11
|
+
lg: "size-8",
|
|
12
|
+
xl: "size-12",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
size: "default",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export interface SpinnerProps
|
|
21
|
+
extends React.SVGProps<SVGSVGElement>,
|
|
22
|
+
VariantProps<typeof spinnerVariants> {
|
|
23
|
+
srText?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const Spinner = React.forwardRef<SVGSVGElement, SpinnerProps>(
|
|
27
|
+
({ className, size, srText = "Loading...", ...props }, ref) => {
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<Loader
|
|
31
|
+
ref={ref}
|
|
32
|
+
className={cn(spinnerVariants({ size }), className)}
|
|
33
|
+
role="status"
|
|
34
|
+
aria-label={srText}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
<span className="sr-only">{srText}</span>
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
Spinner.displayName = "Spinner";
|
|
43
|
+
|
|
44
|
+
export { Spinner, spinnerVariants };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
|
|
5
|
+
const Switch = React.forwardRef<
|
|
6
|
+
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
7
|
+
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
8
|
+
>(({ className, ...props }, ref) => (
|
|
9
|
+
<SwitchPrimitives.Root
|
|
10
|
+
className={cn(
|
|
11
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors",
|
|
12
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
13
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
+
"data-[state=checked]:bg-primary data-[state=unchecked]:bg-gray-200",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
ref={ref}
|
|
19
|
+
>
|
|
20
|
+
<SwitchPrimitives.Thumb
|
|
21
|
+
className={cn(
|
|
22
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
23
|
+
"data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
24
|
+
"rtl:data-[state=checked]:-translate-x-5 rtl:data-[state=unchecked]:translate-x-0"
|
|
25
|
+
)}
|
|
26
|
+
/>
|
|
27
|
+
</SwitchPrimitives.Root>
|
|
28
|
+
));
|
|
29
|
+
|
|
30
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
31
|
+
|
|
32
|
+
export { Switch };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
|
|
4
|
+
export interface TextareaProps
|
|
5
|
+
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
6
|
+
|
|
7
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
8
|
+
({ className, ...props }, ref) => {
|
|
9
|
+
return (
|
|
10
|
+
<textarea
|
|
11
|
+
className={cn(
|
|
12
|
+
"flex min-h-[60px] w-full rounded-md border border-border bg-background px-3 py-2 text-sm shadow-sm transition-colors",
|
|
13
|
+
"placeholder:text-muted-foreground",
|
|
14
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
|
|
15
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
|
+
"resize-y",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
ref={ref}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
Textarea.displayName = "Textarea";
|
|
27
|
+
|
|
28
|
+
export { Textarea };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { toggleVariants } from "./toggle";
|
|
6
|
+
|
|
7
|
+
const ToggleGroupContext = React.createContext<
|
|
8
|
+
VariantProps<typeof toggleVariants>
|
|
9
|
+
>({
|
|
10
|
+
size: "md",
|
|
11
|
+
variant: "default",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const ToggleGroup = React.forwardRef<
|
|
15
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
16
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
|
17
|
+
VariantProps<typeof toggleVariants>
|
|
18
|
+
>(({ className, variant, size, children, ...props }, ref) => (
|
|
19
|
+
<ToggleGroupPrimitive.Root
|
|
20
|
+
ref={ref}
|
|
21
|
+
className={cn("flex items-center justify-center gap-1", className)}
|
|
22
|
+
{...props}
|
|
23
|
+
>
|
|
24
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
25
|
+
{children}
|
|
26
|
+
</ToggleGroupContext.Provider>
|
|
27
|
+
</ToggleGroupPrimitive.Root>
|
|
28
|
+
));
|
|
29
|
+
|
|
30
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
31
|
+
|
|
32
|
+
const ToggleGroupItem = React.forwardRef<
|
|
33
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
34
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
|
35
|
+
VariantProps<typeof toggleVariants>
|
|
36
|
+
>(({ className, children, variant, size, ...props }, ref) => {
|
|
37
|
+
const context = React.useContext(ToggleGroupContext);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<ToggleGroupPrimitive.Item
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn(
|
|
43
|
+
toggleVariants({
|
|
44
|
+
variant: context.variant || variant,
|
|
45
|
+
size: context.size || size,
|
|
46
|
+
}),
|
|
47
|
+
className
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</ToggleGroupPrimitive.Item>
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
57
|
+
|
|
58
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
const toggleVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-transparent",
|
|
12
|
+
outline:
|
|
13
|
+
"border border-border bg-transparent hover:bg-muted hover:text-foreground",
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
sm: "h-9 px-2.5 min-w-9 text-xs",
|
|
17
|
+
md: "h-10 px-3 min-w-10",
|
|
18
|
+
lg: "h-11 px-5 min-w-11 text-base",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "default",
|
|
23
|
+
size: "md",
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export interface ToggleProps
|
|
29
|
+
extends React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>,
|
|
30
|
+
VariantProps<typeof toggleVariants> {}
|
|
31
|
+
|
|
32
|
+
const Toggle = React.forwardRef<
|
|
33
|
+
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
34
|
+
ToggleProps
|
|
35
|
+
>(({ className, variant, size, ...props }, ref) => (
|
|
36
|
+
<TogglePrimitive.Root
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
));
|
|
42
|
+
|
|
43
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
44
|
+
|
|
45
|
+
export { Toggle, toggleVariants };
|
package/README.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# @quarklab/rad-ui
|
|
2
|
-
|
|
3
|
-
A set of high-quality React components built with Radix UI and Tailwind CSS.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @quarklab/rad-ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
Import components directly:
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import { Button } from "@quarklab/rad-ui";
|
|
17
|
-
|
|
18
|
-
export default function Home() {
|
|
19
|
-
return <Button>Click me</Button>;
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Tailwind Setup
|
|
24
|
-
|
|
25
|
-
To use the components, you need to add the package's paths to your `tailwind.config.js` `content` array. This ensures that Tailwind generates the necessary CSS classes for the components.
|
|
26
|
-
|
|
27
|
-
```js
|
|
28
|
-
// tailwind.config.js
|
|
29
|
-
module.exports = {
|
|
30
|
-
content: [
|
|
31
|
-
// ... your other content paths
|
|
32
|
-
"./node_modules/@quarklab/rad-ui/dist/**/*.js",
|
|
33
|
-
],
|
|
34
|
-
// ... rest of your config
|
|
35
|
-
};
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Make sure you also have the necessary theme variables (colors, border radius, etc.) defined in your CSS to match the design system.
|
|
39
|
-
|
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 40 20% 98%;--foreground: 220 15% 15%;--primary: 175 100% 31%;--primary-foreground: 0 0% 100%;--secondary: 40 10% 92%;--secondary-foreground: 220 15% 15%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 100%;--card: 40 20% 96%;--card-foreground: 220 15% 15%;--border: 40 10% 88%;--muted: 40 10% 92%;--muted-foreground: 220 10% 40%;--ring: 175 100% 31%;--radius: .5rem}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:var(--font-vazirmatn),var(--font-inter),sans-serif}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.relative{position:relative}.flex{display:flex}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1 / 1}.size-12{width:3rem;height:3rem}.size-4{width:1rem;height:1rem}.size-6{width:1.5rem;height:1.5rem}.size-8{width:2rem;height:2rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-6{height:1.5rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-full{height:100%}.w-10{width:2.5rem}.w-\[1px\]{width:1px}.w-full{width:100%}.shrink-0{flex-shrink:0}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-border{border-color:hsl(var(--border))}.border-transparent{border-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-border{background-color:hsl(var(--border))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.underline-offset-4{text-underline-offset:4px}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:underline:hover{text-decoration-line:underline}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\:bg-destructive\/80:active{background-color:hsl(var(--destructive) / .8)}.active\:bg-muted\/80:active{background-color:hsl(var(--muted) / .8)}.active\:bg-primary\/80:active{background-color:hsl(var(--primary) / .8)}.active\:text-primary\/80:active{color:hsl(var(--primary) / .8)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}
|
package/dist/index.d.mts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ClassValue } from 'clsx';
|
|
2
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
-
import * as React$1 from 'react';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
6
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
7
|
-
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
8
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
|
-
|
|
11
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
12
|
-
|
|
13
|
-
declare const buttonVariants: (props?: ({
|
|
14
|
-
variant?: "default" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
15
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
-
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
18
|
-
asChild?: boolean;
|
|
19
|
-
}
|
|
20
|
-
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
21
|
-
|
|
22
|
-
declare const Separator: React$1.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
|
|
24
|
-
declare const Avatar: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
25
|
-
declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
|
|
26
|
-
declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
27
|
-
|
|
28
|
-
declare const AspectRatio: React$1.ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
|
|
30
|
-
interface KbdProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
31
|
-
}
|
|
32
|
-
declare const Kbd: React$1.ForwardRefExoticComponent<KbdProps & React$1.RefAttributes<HTMLElement>>;
|
|
33
|
-
interface KbdGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
34
|
-
}
|
|
35
|
-
declare const KbdGroup: React$1.ForwardRefExoticComponent<KbdGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
36
|
-
|
|
37
|
-
declare const badgeVariants: (props?: ({
|
|
38
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
39
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
40
|
-
interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
41
|
-
}
|
|
42
|
-
declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
43
|
-
|
|
44
|
-
declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
|
|
45
|
-
|
|
46
|
-
declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
47
|
-
|
|
48
|
-
declare const spinnerVariants: (props?: ({
|
|
49
|
-
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
50
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
51
|
-
interface SpinnerProps extends React$1.SVGProps<SVGSVGElement>, VariantProps<typeof spinnerVariants> {
|
|
52
|
-
srText?: string;
|
|
53
|
-
}
|
|
54
|
-
declare const Spinner: React$1.ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
55
|
-
|
|
56
|
-
export { AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Kbd, KbdGroup, type KbdGroupProps, type KbdProps, Label, Separator, Skeleton, Spinner, type SpinnerProps, badgeVariants, buttonVariants, cn, spinnerVariants };
|
package/dist/index.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ClassValue } from 'clsx';
|
|
2
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
-
import * as React$1 from 'react';
|
|
4
|
-
import { VariantProps } from 'class-variance-authority';
|
|
5
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
6
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
7
|
-
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
8
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
|
-
|
|
11
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
12
|
-
|
|
13
|
-
declare const buttonVariants: (props?: ({
|
|
14
|
-
variant?: "default" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
15
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
-
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
18
|
-
asChild?: boolean;
|
|
19
|
-
}
|
|
20
|
-
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
21
|
-
|
|
22
|
-
declare const Separator: React$1.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
|
|
24
|
-
declare const Avatar: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
25
|
-
declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React$1.RefAttributes<HTMLImageElement>, "ref"> & React$1.RefAttributes<HTMLImageElement>>;
|
|
26
|
-
declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
27
|
-
|
|
28
|
-
declare const AspectRatio: React$1.ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
|
|
30
|
-
interface KbdProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
31
|
-
}
|
|
32
|
-
declare const Kbd: React$1.ForwardRefExoticComponent<KbdProps & React$1.RefAttributes<HTMLElement>>;
|
|
33
|
-
interface KbdGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
34
|
-
}
|
|
35
|
-
declare const KbdGroup: React$1.ForwardRefExoticComponent<KbdGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
36
|
-
|
|
37
|
-
declare const badgeVariants: (props?: ({
|
|
38
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
39
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
40
|
-
interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
41
|
-
}
|
|
42
|
-
declare function Badge({ className, variant, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
43
|
-
|
|
44
|
-
declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
|
|
45
|
-
|
|
46
|
-
declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
47
|
-
|
|
48
|
-
declare const spinnerVariants: (props?: ({
|
|
49
|
-
size?: "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
50
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
51
|
-
interface SpinnerProps extends React$1.SVGProps<SVGSVGElement>, VariantProps<typeof spinnerVariants> {
|
|
52
|
-
srText?: string;
|
|
53
|
-
}
|
|
54
|
-
declare const Spinner: React$1.ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
55
|
-
|
|
56
|
-
export { AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Kbd, KbdGroup, type KbdGroupProps, type KbdProps, Label, Separator, Skeleton, Spinner, type SpinnerProps, badgeVariants, buttonVariants, cn, spinnerVariants };
|
package/dist/index.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{clsx as W}from"clsx";import{twMerge as N}from"tailwind-merge";function o(...e){return N(W(e))}import*as L from"react";import{cva as X}from"class-variance-authority";import{jsx as K}from"react/jsx-runtime";var x=X("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/80",outline:"border border-border bg-background hover:bg-muted hover:text-foreground active:bg-muted/80",ghost:"hover:bg-muted hover:text-foreground active:bg-muted/80",link:"text-primary underline-offset-4 hover:underline active:text-primary/80"},size:{sm:"h-9 px-3 text-xs rounded-md",md:"h-10 px-4 py-2",lg:"h-11 px-8 text-base rounded-lg"}},defaultVariants:{variant:"default",size:"md"}}),I=L.forwardRef(({className:e,variant:a,size:t,...l},d)=>K("button",{className:o(x({variant:a,size:t,className:e})),ref:d,...l}));I.displayName="Button";import*as g from"react";import*as i from"@radix-ui/react-separator";import{jsx as Z}from"react/jsx-runtime";var h=g.forwardRef(({className:e,orientation:a="horizontal",decorative:t=!0,...l},d)=>Z(i.Root,{ref:d,decorative:t,orientation:a,className:o("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...l}));h.displayName=i.Root.displayName;import*as f from"react";import*as u from"@radix-ui/react-avatar";import{jsx as n}from"react/jsx-runtime";var C=f.forwardRef(({className:e,...a},t)=>n(u.Root,{ref:t,className:o("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...a}));C.displayName=u.Root.displayName;var S=f.forwardRef(({className:e,...a},t)=>n(u.Image,{ref:t,className:o("aspect-square h-full w-full",e),...a}));S.displayName=u.Image.displayName;var w=f.forwardRef(({className:e,...a},t)=>n(u.Fallback,{ref:t,className:o("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...a}));w.displayName=u.Fallback.displayName;import*as k from"@radix-ui/react-aspect-ratio";var J=k.Root;import*as c from"react";import{jsx as y}from"react/jsx-runtime";var b=c.forwardRef(({className:e,...a},t)=>y("kbd",{ref:t,className:o("pointer-events-none inline-flex h-6 select-none items-center gap-1 rounded border border-border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground shadow-sm",e),...a}));b.displayName="Kbd";var P=c.forwardRef(({className:e,...a},t)=>y("div",{ref:t,className:o("inline-flex items-center gap-1",e),...a}));P.displayName="KbdGroup";import{cva as Q}from"class-variance-authority";import{jsx as Y}from"react/jsx-runtime";var B=Q("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",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function j({className:e,variant:a,...t}){return Y("div",{className:o(B({variant:a}),e),...t})}import*as F from"react";import*as p from"@radix-ui/react-label";import{cva as $}from"class-variance-authority";import{jsx as ee}from"react/jsx-runtime";var _=$("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),A=F.forwardRef(({className:e,...a},t)=>ee(p.Root,{ref:t,className:o(_(),e),...a}));A.displayName=p.Root.displayName;import{jsx as te}from"react/jsx-runtime";function ae({className:e,...a}){return te("div",{className:o("animate-pulse rounded-md bg-muted",e),...a})}import*as T from"react";import{forwardRef as oe,createElement as M}from"react";var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var de=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),D=(e,a)=>{let t=oe(({color:l="currentColor",size:d=24,strokeWidth:m=2,absoluteStrokeWidth:H,className:O="",children:s,...z},G)=>M("svg",{ref:G,...v,width:d,height:d,stroke:l,strokeWidth:H?Number(m)*24/Number(d):m,className:["lucide",`lucide-${de(e)}`,O].join(" "),...z},[...a.map(([V,E])=>M(V,E)),...Array.isArray(s)?s:[s]]));return t.displayName=`${e}`,t};var r=D("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);import{cva as ue}from"class-variance-authority";import{Fragment as le,jsx as R,jsxs as re}from"react/jsx-runtime";var U=ue("animate-spin",{variants:{size:{sm:"size-4",default:"size-6",lg:"size-8",xl:"size-12"}},defaultVariants:{size:"default"}}),q=T.forwardRef(({className:e,size:a,srText:t="Loading...",...l},d)=>re(le,{children:[R(r,{ref:d,className:o(U({size:a}),e),role:"status","aria-label":t,...l}),R("span",{className:"sr-only",children:t})]}));q.displayName="Spinner";export{J as AspectRatio,C as Avatar,w as AvatarFallback,S as AvatarImage,j as Badge,I as Button,b as Kbd,P as KbdGroup,A as Label,h as Separator,ae as Skeleton,q as Spinner,B as badgeVariants,x as buttonVariants,o as cn,U as spinnerVariants};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
lucide-react/dist/esm/defaultAttributes.js:
|
|
5
|
-
lucide-react/dist/esm/createLucideIcon.js:
|
|
6
|
-
lucide-react/dist/esm/icons/loader.js:
|
|
7
|
-
lucide-react/dist/esm/lucide-react.js:
|
|
8
|
-
(**
|
|
9
|
-
* @license lucide-react v0.309.0 - ISC
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the ISC license.
|
|
12
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
*/
|