@q9labsai/chalk-ui 4.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/LICENSE +21 -0
- package/dist/assets.d.ts +2 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/assets.js +2 -0
- package/dist/badge.d.ts +14 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +73 -0
- package/dist/button.d.ts +9 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +49 -0
- package/dist/card.d.ts +12 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +63 -0
- package/dist/icon-button.d.ts +9 -0
- package/dist/icon-button.d.ts.map +1 -0
- package/dist/icon-button.js +37 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +897 -0
- package/dist/input.d.ts +12 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +44 -0
- package/dist/lib/theme.d.ts +8 -0
- package/dist/lib/theme.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/logos/chalk-icon.svg +34 -0
- package/dist/logos/chalk-logo-on-dark.svg +35 -0
- package/dist/logos/chalk-logo.svg +45 -0
- package/dist/progress-bar.d.ts +13 -0
- package/dist/progress-bar.d.ts.map +1 -0
- package/dist/progress-bar.js +35 -0
- package/dist/reactions.d.ts +33 -0
- package/dist/reactions.d.ts.map +1 -0
- package/dist/reactions.js +179 -0
- package/dist/select.d.ts +26 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +49 -0
- package/dist/skeleton.d.ts +11 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +25 -0
- package/dist/spinner.d.ts +9 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +26 -0
- package/dist/status-badge.d.ts +9 -0
- package/dist/status-badge.d.ts.map +1 -0
- package/dist/status-badge.js +18 -0
- package/dist/styles.css +1461 -0
- package/dist/test-utils.d.ts +3 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/textarea.d.ts +10 -0
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +52 -0
- package/dist/toast.d.ts +45 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +131 -0
- package/dist/toggle-group.d.ts +11 -0
- package/dist/toggle-group.d.ts.map +1 -0
- package/dist/toggle-group.js +101 -0
- package/dist/toggle.d.ts +20 -0
- package/dist/toggle.d.ts.map +1 -0
- package/dist/toggle.js +48 -0
- package/dist/tooltip.d.ts +15 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +101 -0
- package/package.json +199 -0
package/dist/input.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface InputProps extends Omit<React.ComponentProps<"input">, "size"> {
|
|
3
|
+
readonly label?: React.ReactNode;
|
|
4
|
+
readonly error?: string;
|
|
5
|
+
readonly icon?: React.ReactNode;
|
|
6
|
+
readonly iconPosition?: "left" | "right";
|
|
7
|
+
readonly size?: "sm" | "md" | "lg";
|
|
8
|
+
readonly fullWidth?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function Input({ className, type, label, error, icon, iconPosition, size, fullWidth, id, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Input };
|
|
12
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../src/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC7E,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAeD,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,YAAqB,EAAE,IAAW,EAAE,SAAgB,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CA0BrI;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/input.tsx
|
|
2
|
+
import "react";
|
|
3
|
+
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
4
|
+
|
|
5
|
+
// src/lib/utils.ts
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// src/input.tsx
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function getInputClassName(className, size, fullWidth, icon, iconPosition, error) {
|
|
15
|
+
return cn(
|
|
16
|
+
"border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-muted h-8 rounded-lg border px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
17
|
+
fullWidth ? "w-full" : "w-auto",
|
|
18
|
+
size === "sm" && "h-7 text-sm",
|
|
19
|
+
size === "lg" && "h-10 text-lg",
|
|
20
|
+
icon && iconPosition === "left" && "pl-9",
|
|
21
|
+
icon && iconPosition === "right" && "pr-9",
|
|
22
|
+
error && "border-destructive",
|
|
23
|
+
className
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function Input({ className, type, label, error, icon, iconPosition = "left", size = "md", fullWidth = true, id, ...props }) {
|
|
27
|
+
const inputId = id ?? (label ? `chalk-input-${String(label).toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : void 0);
|
|
28
|
+
if (!label && !error && !icon && size === "md" && id === void 0) {
|
|
29
|
+
return /* @__PURE__ */ jsx(InputPrimitive, { type, "data-slot": "input", className: getInputClassName(className, size, fullWidth, icon, iconPosition, error), ...props });
|
|
30
|
+
}
|
|
31
|
+
const input = /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
32
|
+
icon && iconPosition === "left" ? /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: icon }) : null,
|
|
33
|
+
/* @__PURE__ */ jsx(InputPrimitive, { id: inputId, type, "data-slot": "input", className: getInputClassName(className, size, fullWidth, icon, iconPosition, error), "aria-invalid": Boolean(error), ...props }),
|
|
34
|
+
icon && iconPosition === "right" ? /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: icon }) : null
|
|
35
|
+
] });
|
|
36
|
+
return /* @__PURE__ */ jsxs("label", { className: cn("flex flex-col gap-1.5", fullWidth && "w-full"), htmlFor: inputId, children: [
|
|
37
|
+
label ? /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-muted-foreground", children: label }) : null,
|
|
38
|
+
input,
|
|
39
|
+
error ? /* @__PURE__ */ jsx("span", { className: "text-sm text-destructive", children: error }) : null
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
Input
|
|
44
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ThemeMode = "light" | "dark";
|
|
2
|
+
interface ResolveThemeOptions {
|
|
3
|
+
defaultTheme?: ThemeMode;
|
|
4
|
+
allowSystem?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const resolvePortalThemeFromDocument: ({ defaultTheme, allowSystem }?: ResolveThemeOptions) => ThemeMode;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/lib/theme.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAqBzC,UAAU,mBAAmB;IAC3B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAuBD,eAAO,MAAM,8BAA8B,GAAI,gCAAgD,mBAAwB,KAAG,SAOzH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="grn" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
4
|
+
<stop offset="0%" stop-color="#C5E5C0"/><stop offset="100%" stop-color="#80B879"/>
|
|
5
|
+
</linearGradient>
|
|
6
|
+
<linearGradient id="yel" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
7
|
+
<stop offset="0%" stop-color="#FCEAB3"/><stop offset="100%" stop-color="#D9B641"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="blu" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
10
|
+
<stop offset="0%" stop-color="#B2E0F0"/><stop offset="100%" stop-color="#55AAC9"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
<linearGradient id="pnk" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
13
|
+
<stop offset="0%" stop-color="#F8CACA"/><stop offset="100%" stop-color="#D67B7B"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
</defs>
|
|
16
|
+
<g transform="translate(5, 5) scale(0.85)">
|
|
17
|
+
<g transform="rotate(-20 16 48)">
|
|
18
|
+
<path d="M9,16 L19,16 L20,50 A6,6 0 0 1 8,50 Z" fill="url(#grn)"/>
|
|
19
|
+
<ellipse cx="14" cy="16" rx="5" ry="2" fill="#D8ECD4"/>
|
|
20
|
+
</g>
|
|
21
|
+
<g transform="rotate(-5 24 44)">
|
|
22
|
+
<path d="M19,12 L29,12 L30,50 A6,6 0 0 1 18,50 Z" fill="url(#yel)"/>
|
|
23
|
+
<ellipse cx="24" cy="12" rx="5" ry="2" fill="#FEF3D1"/>
|
|
24
|
+
</g>
|
|
25
|
+
<g transform="rotate(25 44 20)">
|
|
26
|
+
<path d="M29,4 L39,4 L40,40 A6,6 0 0 1 28,40 Z" fill="url(#blu)"/>
|
|
27
|
+
<ellipse cx="34" cy="4" rx="5" ry="2" fill="#D0EDF8"/>
|
|
28
|
+
</g>
|
|
29
|
+
<g transform="rotate(10 44 40)">
|
|
30
|
+
<path d="M39,56 L49,56 L50,24 A6,6 0 0 0 38,24 Z" fill="url(#pnk)"/>
|
|
31
|
+
<ellipse cx="44" cy="56" rx="5" ry="2" fill="#FBE4E4"/>
|
|
32
|
+
</g>
|
|
33
|
+
</g>
|
|
34
|
+
</svg>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 280 80" fill="none">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="grn" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
4
|
+
<stop offset="0%" stop-color="#C5E5C0"/><stop offset="100%" stop-color="#80B879"/>
|
|
5
|
+
</linearGradient>
|
|
6
|
+
<linearGradient id="yel" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
7
|
+
<stop offset="0%" stop-color="#FCEAB3"/><stop offset="100%" stop-color="#D9B641"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="blu" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
10
|
+
<stop offset="0%" stop-color="#B2E0F0"/><stop offset="100%" stop-color="#55AAC9"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
<linearGradient id="pnk" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
13
|
+
<stop offset="0%" stop-color="#F8CACA"/><stop offset="100%" stop-color="#D67B7B"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
</defs>
|
|
16
|
+
<g transform="translate(2, 2) scale(0.95)">
|
|
17
|
+
<g transform="rotate(-15 20 60)">
|
|
18
|
+
<path d="M9,20 L21,20 L22,63 A7,7 0 0 1 8,63 Z" fill="url(#grn)"/>
|
|
19
|
+
<ellipse cx="15" cy="20" rx="6" ry="2.5" fill="#D8ECD4"/>
|
|
20
|
+
</g>
|
|
21
|
+
<g transform="rotate(-8 32 55)">
|
|
22
|
+
<path d="M23,15 L35,15 L36,60 A7,7 0 0 1 22,60 Z" fill="url(#yel)"/>
|
|
23
|
+
<ellipse cx="29" cy="15" rx="6" ry="2.5" fill="#FEF3D1"/>
|
|
24
|
+
</g>
|
|
25
|
+
<g transform="rotate(12 60 30)">
|
|
26
|
+
<path d="M36,8 L48,8 L49,56 A7,7 0 0 1 35,56 Z" fill="url(#blu)"/>
|
|
27
|
+
<ellipse cx="42" cy="8" rx="6" ry="2.5" fill="#D0EDF8"/>
|
|
28
|
+
</g>
|
|
29
|
+
<g transform="rotate(5 55 50)">
|
|
30
|
+
<path d="M49,70 L61,70 L62,29 A7,7 0 0 0 48,29 Z" fill="url(#pnk)"/>
|
|
31
|
+
<ellipse cx="55" cy="70" rx="6" ry="2.5" fill="#FBE4E4"/>
|
|
32
|
+
</g>
|
|
33
|
+
</g>
|
|
34
|
+
<text x="90" y="52" font-family="system-ui, -apple-system, BlinkMacSystemFont, sans-serif" font-size="38" font-weight="600" letter-spacing="-0.02em" fill="#F4F3EE">chalk</text>
|
|
35
|
+
</svg>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 280 80" fill="none">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="grn" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
4
|
+
<stop offset="0%" stop-color="#C5E5C0"/><stop offset="100%" stop-color="#80B879"/>
|
|
5
|
+
</linearGradient>
|
|
6
|
+
<linearGradient id="yel" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
7
|
+
<stop offset="0%" stop-color="#FCEAB3"/><stop offset="100%" stop-color="#D9B641"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="blu" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
10
|
+
<stop offset="0%" stop-color="#B2E0F0"/><stop offset="100%" stop-color="#55AAC9"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
<linearGradient id="pnk" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
13
|
+
<stop offset="0%" stop-color="#F8CACA"/><stop offset="100%" stop-color="#D67B7B"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
</defs>
|
|
16
|
+
<!-- Chalk sticks arrangement -->
|
|
17
|
+
<g transform="translate(2, 2) scale(0.95)">
|
|
18
|
+
<!-- Green chalk -->
|
|
19
|
+
<g transform="rotate(-15 20 60)">
|
|
20
|
+
<path d="M9,20 L21,20 L22,63 A7,7 0 0 1 8,63 Z" fill="url(#grn)"/>
|
|
21
|
+
<ellipse cx="15" cy="20" rx="6" ry="2.5" fill="#D8ECD4"/>
|
|
22
|
+
</g>
|
|
23
|
+
|
|
24
|
+
<!-- Yellow chalk -->
|
|
25
|
+
<g transform="rotate(-8 32 55)">
|
|
26
|
+
<path d="M23,15 L35,15 L36,60 A7,7 0 0 1 22,60 Z" fill="url(#yel)"/>
|
|
27
|
+
<ellipse cx="29" cy="15" rx="6" ry="2.5" fill="#FEF3D1"/>
|
|
28
|
+
</g>
|
|
29
|
+
|
|
30
|
+
<!-- Blue chalk -->
|
|
31
|
+
<g transform="rotate(12 60 30)">
|
|
32
|
+
<path d="M36,8 L48,8 L49,56 A7,7 0 0 1 35,56 Z" fill="url(#blu)"/>
|
|
33
|
+
<ellipse cx="42" cy="8" rx="6" ry="2.5" fill="#D0EDF8"/>
|
|
34
|
+
</g>
|
|
35
|
+
|
|
36
|
+
<!-- Pink chalk -->
|
|
37
|
+
<g transform="rotate(5 55 50)">
|
|
38
|
+
<path d="M49,70 L61,70 L62,29 A7,7 0 0 0 48,29 Z" fill="url(#pnk)"/>
|
|
39
|
+
<ellipse cx="55" cy="70" rx="6" ry="2.5" fill="#FBE4E4"/>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
|
|
43
|
+
<!-- "chalk" text -->
|
|
44
|
+
<text x="90" y="52" font-family="system-ui, -apple-system, BlinkMacSystemFont, sans-serif" font-size="38" font-weight="600" letter-spacing="-0.02em" fill="currentColor">chalk</text>
|
|
45
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ProgressBarProps {
|
|
3
|
+
readonly value: number;
|
|
4
|
+
readonly max?: number;
|
|
5
|
+
readonly showLabel?: boolean;
|
|
6
|
+
readonly variant?: "default" | "success" | "warning" | "danger";
|
|
7
|
+
readonly size?: "sm" | "md" | "lg";
|
|
8
|
+
readonly animated?: boolean;
|
|
9
|
+
readonly className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function ProgressBar({ value, max, showLabel, variant, size, animated, className }: ProgressBarProps): React.JSX.Element;
|
|
12
|
+
export { ProgressBar };
|
|
13
|
+
//# sourceMappingURL=progress-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../src/progress-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAChE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,iBAAS,WAAW,CAAC,EAAE,KAAK,EAAE,GAAS,EAAE,SAAiB,EAAE,OAAmB,EAAE,IAAW,EAAE,QAAgB,EAAE,SAAS,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqBhK;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/progress-bar.tsx
|
|
2
|
+
import "react";
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/progress-bar.tsx
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
function ProgressBar({ value, max = 100, showLabel = false, variant = "default", size = "md", animated = false, className }) {
|
|
14
|
+
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), children: [
|
|
16
|
+
showLabel ? /* @__PURE__ */ jsx("div", { className: "mb-1 flex justify-between text-xs text-muted-foreground", children: /* @__PURE__ */ jsxs("span", { children: [
|
|
17
|
+
Math.round(percentage),
|
|
18
|
+
"%"
|
|
19
|
+
] }) }) : null,
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: cn("w-full overflow-hidden rounded-full bg-muted", size === "sm" && "h-1", size === "md" && "h-2", size === "lg" && "h-4"), children: /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
role: "progressbar",
|
|
24
|
+
"aria-valuenow": value,
|
|
25
|
+
"aria-valuemin": 0,
|
|
26
|
+
"aria-valuemax": max,
|
|
27
|
+
className: cn("h-full rounded-full bg-primary transition-all", variant === "success" && "bg-green-500", variant === "warning" && "bg-yellow-500", variant === "danger" && "bg-destructive", animated && "animate-pulse"),
|
|
28
|
+
style: { width: `${percentage}%` }
|
|
29
|
+
}
|
|
30
|
+
) })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
ProgressBar
|
|
35
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const DEFAULT_QUICK_REACTIONS: readonly ["👍", "❤️", "😂", "😮", "😢", "🎉"];
|
|
2
|
+
export declare const CELEBRATION_EMOJIS: readonly string[];
|
|
3
|
+
export declare const EMOJI_CATEGORIES: {
|
|
4
|
+
readonly smileys: {
|
|
5
|
+
readonly label: "😀";
|
|
6
|
+
readonly name: "Smileys";
|
|
7
|
+
readonly emojis: readonly ["😀", "😃", "😄", "😁", "😅", "😂", "🤣", "😊", "😇", "🙂", "😉", "😌", "😍", "🥰", "😘", "😋", "😛", "🤪", "🤨", "🧐", "🤓", "😎", "🥳", "😏", "😒", "🙄", "😬", "😮", "😯", "😲", "😳", "🥺", "😢", "😭", "😤", "😠", "🤯", "😱", "🥶", "🥵"];
|
|
8
|
+
};
|
|
9
|
+
readonly gestures: {
|
|
10
|
+
readonly label: "👋";
|
|
11
|
+
readonly name: "Gestures";
|
|
12
|
+
readonly emojis: readonly ["👋", "🤚", "🖐️", "✋", "🖖", "👌", "🤌", "🤏", "✌️", "🤞", "🤟", "🤘", "🤙", "👈", "👉", "👆", "👇", "☝️", "👍", "👎", "✊", "👊", "🤛", "🤜", "👏", "🙌", "👐", "🤲", "🤝", "🙏", "💪", "🦾"];
|
|
13
|
+
};
|
|
14
|
+
readonly hearts: {
|
|
15
|
+
readonly label: "❤️";
|
|
16
|
+
readonly name: "Hearts";
|
|
17
|
+
readonly emojis: readonly ["❤️", "🧡", "💛", "💚", "💙", "💜", "🖤", "🤍", "🤎", "💔", "❤️🔥", "❤️🩹", "💕", "💞", "💓", "💗", "💖", "💘", "💝", "💟", "♥️", "😍", "🥰", "😘", "😻"];
|
|
18
|
+
};
|
|
19
|
+
readonly celebration: {
|
|
20
|
+
readonly label: "🎉";
|
|
21
|
+
readonly name: "Celebration";
|
|
22
|
+
readonly emojis: readonly ["🎉", "🎊", "🥳", "🎈", "🎁", "🎀", "🏆", "🥇", "🏅", "⭐", "🌟", "✨", "💫", "🔥", "💥", "💯", "🙌", "👏", "🤩", "🥂", "🍾", "🎆", "🎇", "🪅", "🎯"];
|
|
23
|
+
};
|
|
24
|
+
readonly objects: {
|
|
25
|
+
readonly label: "💡";
|
|
26
|
+
readonly name: "Objects";
|
|
27
|
+
readonly emojis: readonly ["💡", "📌", "📍", "🔔", "🔕", "📢", "📣", "💬", "💭", "🗯️", "✅", "❌", "❓", "❗", "💤", "💢", "💦", "💨", "🕐", "⏰", "📅", "📆", "🔒", "🔓", "🔑"];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type ReactionCategoryKey = keyof typeof EMOJI_CATEGORIES;
|
|
31
|
+
export type ReactionCategory = (typeof EMOJI_CATEGORIES)[ReactionCategoryKey];
|
|
32
|
+
export declare const EMOJI_KEYWORDS: Record<string, string>;
|
|
33
|
+
//# sourceMappingURL=reactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactions.d.ts","sourceRoot":"","sources":["../src/reactions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,+CAAgD,CAAC;AAErF,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA6F,CAAC;AAE9I,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BnB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,mBAAmB,CAAC,CAAC;AAE9E,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8IjD,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// src/reactions.ts
|
|
2
|
+
var DEFAULT_QUICK_REACTIONS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F62E}", "\u{1F622}", "\u{1F389}"];
|
|
3
|
+
var CELEBRATION_EMOJIS = ["\u{1F389}", "\u{1F38A}", "\u{1F973}", "\u{1F388}", "\u{1F3C6}", "\u{1F947}", "\u2B50", "\u{1F31F}", "\u2728", "\u{1F4AB}", "\u{1F525}", "\u{1F4A5}", "\u{1F4AF}", "\u{1F386}", "\u{1F387}"];
|
|
4
|
+
var EMOJI_CATEGORIES = {
|
|
5
|
+
smileys: {
|
|
6
|
+
label: "\u{1F600}",
|
|
7
|
+
name: "Smileys",
|
|
8
|
+
emojis: ["\u{1F600}", "\u{1F603}", "\u{1F604}", "\u{1F601}", "\u{1F605}", "\u{1F602}", "\u{1F923}", "\u{1F60A}", "\u{1F607}", "\u{1F642}", "\u{1F609}", "\u{1F60C}", "\u{1F60D}", "\u{1F970}", "\u{1F618}", "\u{1F60B}", "\u{1F61B}", "\u{1F92A}", "\u{1F928}", "\u{1F9D0}", "\u{1F913}", "\u{1F60E}", "\u{1F973}", "\u{1F60F}", "\u{1F612}", "\u{1F644}", "\u{1F62C}", "\u{1F62E}", "\u{1F62F}", "\u{1F632}", "\u{1F633}", "\u{1F97A}", "\u{1F622}", "\u{1F62D}", "\u{1F624}", "\u{1F620}", "\u{1F92F}", "\u{1F631}", "\u{1F976}", "\u{1F975}"]
|
|
9
|
+
},
|
|
10
|
+
gestures: {
|
|
11
|
+
label: "\u{1F44B}",
|
|
12
|
+
name: "Gestures",
|
|
13
|
+
emojis: ["\u{1F44B}", "\u{1F91A}", "\u{1F590}\uFE0F", "\u270B", "\u{1F596}", "\u{1F44C}", "\u{1F90C}", "\u{1F90F}", "\u270C\uFE0F", "\u{1F91E}", "\u{1F91F}", "\u{1F918}", "\u{1F919}", "\u{1F448}", "\u{1F449}", "\u{1F446}", "\u{1F447}", "\u261D\uFE0F", "\u{1F44D}", "\u{1F44E}", "\u270A", "\u{1F44A}", "\u{1F91B}", "\u{1F91C}", "\u{1F44F}", "\u{1F64C}", "\u{1F450}", "\u{1F932}", "\u{1F91D}", "\u{1F64F}", "\u{1F4AA}", "\u{1F9BE}"]
|
|
14
|
+
},
|
|
15
|
+
hearts: {
|
|
16
|
+
label: "\u2764\uFE0F",
|
|
17
|
+
name: "Hearts",
|
|
18
|
+
emojis: ["\u2764\uFE0F", "\u{1F9E1}", "\u{1F49B}", "\u{1F49A}", "\u{1F499}", "\u{1F49C}", "\u{1F5A4}", "\u{1F90D}", "\u{1F90E}", "\u{1F494}", "\u2764\uFE0F\u200D\u{1F525}", "\u2764\uFE0F\u200D\u{1FA79}", "\u{1F495}", "\u{1F49E}", "\u{1F493}", "\u{1F497}", "\u{1F496}", "\u{1F498}", "\u{1F49D}", "\u{1F49F}", "\u2665\uFE0F", "\u{1F60D}", "\u{1F970}", "\u{1F618}", "\u{1F63B}"]
|
|
19
|
+
},
|
|
20
|
+
celebration: {
|
|
21
|
+
label: "\u{1F389}",
|
|
22
|
+
name: "Celebration",
|
|
23
|
+
emojis: ["\u{1F389}", "\u{1F38A}", "\u{1F973}", "\u{1F388}", "\u{1F381}", "\u{1F380}", "\u{1F3C6}", "\u{1F947}", "\u{1F3C5}", "\u2B50", "\u{1F31F}", "\u2728", "\u{1F4AB}", "\u{1F525}", "\u{1F4A5}", "\u{1F4AF}", "\u{1F64C}", "\u{1F44F}", "\u{1F929}", "\u{1F942}", "\u{1F37E}", "\u{1F386}", "\u{1F387}", "\u{1FA85}", "\u{1F3AF}"]
|
|
24
|
+
},
|
|
25
|
+
objects: {
|
|
26
|
+
label: "\u{1F4A1}",
|
|
27
|
+
name: "Objects",
|
|
28
|
+
emojis: ["\u{1F4A1}", "\u{1F4CC}", "\u{1F4CD}", "\u{1F514}", "\u{1F515}", "\u{1F4E2}", "\u{1F4E3}", "\u{1F4AC}", "\u{1F4AD}", "\u{1F5EF}\uFE0F", "\u2705", "\u274C", "\u2753", "\u2757", "\u{1F4A4}", "\u{1F4A2}", "\u{1F4A6}", "\u{1F4A8}", "\u{1F550}", "\u23F0", "\u{1F4C5}", "\u{1F4C6}", "\u{1F512}", "\u{1F513}", "\u{1F511}"]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var EMOJI_KEYWORDS = {
|
|
32
|
+
"\u{1F600}": "grinning smile happy face",
|
|
33
|
+
"\u{1F603}": "smiley happy face big eyes",
|
|
34
|
+
"\u{1F604}": "smile happy face",
|
|
35
|
+
"\u{1F601}": "grin teeth face",
|
|
36
|
+
"\u{1F605}": "sweat smile face",
|
|
37
|
+
"\u{1F602}": "cry tears joy laugh face",
|
|
38
|
+
"\u{1F923}": "rofl laughing face",
|
|
39
|
+
"\u{1F60A}": "blush happy face",
|
|
40
|
+
"\u{1F607}": "innocent angel face",
|
|
41
|
+
"\u{1F642}": "slightly smiling happy face",
|
|
42
|
+
"\u{1F609}": "wink face",
|
|
43
|
+
"\u{1F60C}": "relieved face",
|
|
44
|
+
"\u{1F60D}": "heart eyes love face",
|
|
45
|
+
"\u{1F970}": "hearts love face",
|
|
46
|
+
"\u{1F618}": "kissing heart face",
|
|
47
|
+
"\u{1F60B}": "yum tongue face",
|
|
48
|
+
"\u{1F61B}": "stuck out tongue face",
|
|
49
|
+
"\u{1F92A}": "zany crazy face",
|
|
50
|
+
"\u{1F928}": "raised eyebrow face",
|
|
51
|
+
"\u{1F9D0}": "monocle inspecting face",
|
|
52
|
+
"\u{1F913}": "nerd glasses face",
|
|
53
|
+
"\u{1F60E}": "sunglasses cool face",
|
|
54
|
+
"\u{1F973}": "partying face",
|
|
55
|
+
"\u{1F60F}": "smirk sly face",
|
|
56
|
+
"\u{1F612}": "unamused face",
|
|
57
|
+
"\u{1F644}": "roll eyes face",
|
|
58
|
+
"\u{1F62C}": "grimacing teeth face",
|
|
59
|
+
"\u{1F62E}": "open mouth surprise face",
|
|
60
|
+
"\u{1F62F}": "hushed surprise face",
|
|
61
|
+
"\u{1F632}": "astonished surprise face",
|
|
62
|
+
"\u{1F633}": "flushed embarrassed face",
|
|
63
|
+
"\u{1F97A}": "pleading puppy eyes face",
|
|
64
|
+
"\u{1F622}": "cry sad face",
|
|
65
|
+
"\u{1F62D}": "sob crying face",
|
|
66
|
+
"\u{1F624}": "triumph steam face",
|
|
67
|
+
"\u{1F620}": "angry mad face",
|
|
68
|
+
"\u{1F92F}": "exploding head mind blown",
|
|
69
|
+
"\u{1F631}": "scream scared face",
|
|
70
|
+
"\u{1F976}": "cold freezing face",
|
|
71
|
+
"\u{1F975}": "hot sweating face",
|
|
72
|
+
"\u{1F44B}": "wave hello hand",
|
|
73
|
+
"\u{1F91A}": "raised back hand",
|
|
74
|
+
"\u{1F590}\uFE0F": "raised hand fingers splayed",
|
|
75
|
+
"\u270B": "raised hand stop",
|
|
76
|
+
"\u{1F596}": "vulcan salute star trek",
|
|
77
|
+
"\u{1F44C}": "ok perfect hand",
|
|
78
|
+
"\u{1F90C}": "pinched fingers italian",
|
|
79
|
+
"\u{1F90F}": "pinching small hand",
|
|
80
|
+
"\u270C\uFE0F": "peace victory hand",
|
|
81
|
+
"\u{1F91E}": "crossed fingers luck",
|
|
82
|
+
"\u{1F91F}": "love you hand",
|
|
83
|
+
"\u{1F918}": "horns rock on hand",
|
|
84
|
+
"\u{1F919}": "call me shaka hand",
|
|
85
|
+
"\u{1F448}": "point left hand",
|
|
86
|
+
"\u{1F449}": "point right hand",
|
|
87
|
+
"\u{1F446}": "point up hand",
|
|
88
|
+
"\u{1F447}": "point down hand",
|
|
89
|
+
"\u261D\uFE0F": "point up index",
|
|
90
|
+
"\u{1F44D}": "thumbs up yes cool",
|
|
91
|
+
"\u{1F44E}": "thumbs down no",
|
|
92
|
+
"\u270A": "fist power",
|
|
93
|
+
"\u{1F44A}": "fist bump punch",
|
|
94
|
+
"\u{1F91B}": "left-facing fist",
|
|
95
|
+
"\u{1F91C}": "right-facing fist",
|
|
96
|
+
"\u{1F44F}": "clap applause hand",
|
|
97
|
+
"\u{1F64C}": "raise hands celebrate",
|
|
98
|
+
"\u{1F450}": "open hands",
|
|
99
|
+
"\u{1F932}": "palms up together",
|
|
100
|
+
"\u{1F91D}": "handshake agree",
|
|
101
|
+
"\u{1F64F}": "pray please thank you",
|
|
102
|
+
"\u{1F4AA}": "muscle flex strong",
|
|
103
|
+
"\u{1F9BE}": "mechanical arm robot",
|
|
104
|
+
"\u2764\uFE0F": "red heart love",
|
|
105
|
+
"\u{1F9E1}": "orange heart love",
|
|
106
|
+
"\u{1F49B}": "yellow heart love",
|
|
107
|
+
"\u{1F49A}": "green heart love",
|
|
108
|
+
"\u{1F499}": "blue heart love",
|
|
109
|
+
"\u{1F49C}": "purple heart love",
|
|
110
|
+
"\u{1F5A4}": "black heart love",
|
|
111
|
+
"\u{1F90D}": "white heart love",
|
|
112
|
+
"\u{1F90E}": "brown heart love",
|
|
113
|
+
"\u{1F494}": "broken heart sad",
|
|
114
|
+
"\u2764\uFE0F\u200D\u{1F525}": "heart on fire",
|
|
115
|
+
"\u2764\uFE0F\u200D\u{1FA79}": "mending heart heal",
|
|
116
|
+
"\u{1F495}": "two hearts love",
|
|
117
|
+
"\u{1F49E}": "revolving hearts love",
|
|
118
|
+
"\u{1F493}": "beating heart love",
|
|
119
|
+
"\u{1F497}": "growing heart love",
|
|
120
|
+
"\u{1F496}": "sparkling heart love",
|
|
121
|
+
"\u{1F498}": "heart with arrow love",
|
|
122
|
+
"\u{1F49D}": "heart with ribbon gift",
|
|
123
|
+
"\u{1F49F}": "heart decoration love",
|
|
124
|
+
"\u2665\uFE0F": "heart suit card",
|
|
125
|
+
"\u{1F63B}": "heart eyes cat love",
|
|
126
|
+
"\u{1F389}": "party popper celebrate",
|
|
127
|
+
"\u{1F38A}": "confetti ball celebrate",
|
|
128
|
+
"\u{1F388}": "balloon party celebrate",
|
|
129
|
+
"\u{1F381}": "gift present box",
|
|
130
|
+
"\u{1F380}": "ribbon bow pink",
|
|
131
|
+
"\u{1F3C6}": "trophy win first",
|
|
132
|
+
"\u{1F947}": "1st place medal gold",
|
|
133
|
+
"\u{1F3C5}": "sports medal win",
|
|
134
|
+
"\u2B50": "star yellow shine",
|
|
135
|
+
"\u{1F31F}": "glowing star shine",
|
|
136
|
+
"\u2728": "sparkles magic shine",
|
|
137
|
+
"\u{1F4AB}": "dizzy shooting star",
|
|
138
|
+
"\u{1F525}": "fire hot lit flame",
|
|
139
|
+
"\u{1F4A5}": "collision explosion boom",
|
|
140
|
+
"\u{1F4AF}": "hundred percent perfect",
|
|
141
|
+
"\u{1F929}": "star struck eyes",
|
|
142
|
+
"\u{1F942}": "clinking glasses cheers",
|
|
143
|
+
"\u{1F37E}": "champagne bottle pop",
|
|
144
|
+
"\u{1F386}": "fireworks celebrate night",
|
|
145
|
+
"\u{1F387}": "sparkler firework celebrate",
|
|
146
|
+
"\u{1FA85}": "pinata party celebrate",
|
|
147
|
+
"\u{1F3AF}": "bullseye target hit",
|
|
148
|
+
"\u{1F4A1}": "light bulb idea smart",
|
|
149
|
+
"\u{1F4CC}": "pushpin location pin",
|
|
150
|
+
"\u{1F4CD}": "round pushpin location",
|
|
151
|
+
"\u{1F514}": "bell notification alarm",
|
|
152
|
+
"\u{1F515}": "bell with slash silent",
|
|
153
|
+
"\u{1F4E2}": "loudspeaker announce",
|
|
154
|
+
"\u{1F4E3}": "megaphone cheer announce",
|
|
155
|
+
"\u{1F4AC}": "speech balloon chat",
|
|
156
|
+
"\u{1F4AD}": "thought balloon think",
|
|
157
|
+
"\u{1F5EF}\uFE0F": "anger right balloon mad",
|
|
158
|
+
"\u2705": "check mark button yes",
|
|
159
|
+
"\u274C": "cross mark no wrong",
|
|
160
|
+
"\u2753": "question mark ask",
|
|
161
|
+
"\u2757": "exclamation mark alert",
|
|
162
|
+
"\u{1F4A4}": "zzz sleep tired",
|
|
163
|
+
"\u{1F4A2}": "anger symbol mad",
|
|
164
|
+
"\u{1F4A6}": "sweat drops water",
|
|
165
|
+
"\u{1F4A8}": "dashing away wind speed",
|
|
166
|
+
"\u{1F550}": "one oclock time clock",
|
|
167
|
+
"\u23F0": "alarm clock time",
|
|
168
|
+
"\u{1F4C5}": "calendar date",
|
|
169
|
+
"\u{1F4C6}": "tear-off calendar date",
|
|
170
|
+
"\u{1F512}": "locked lock secure",
|
|
171
|
+
"\u{1F513}": "unlocked lock open",
|
|
172
|
+
"\u{1F511}": "key lock secure"
|
|
173
|
+
};
|
|
174
|
+
export {
|
|
175
|
+
CELEBRATION_EMOJIS,
|
|
176
|
+
DEFAULT_QUICK_REACTIONS,
|
|
177
|
+
EMOJI_CATEGORIES,
|
|
178
|
+
EMOJI_KEYWORDS
|
|
179
|
+
};
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
readonly value: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectProps {
|
|
8
|
+
readonly options: readonly SelectOption[];
|
|
9
|
+
readonly value?: string;
|
|
10
|
+
readonly onChange?: (event: {
|
|
11
|
+
readonly target: {
|
|
12
|
+
readonly value: string;
|
|
13
|
+
};
|
|
14
|
+
}) => void;
|
|
15
|
+
readonly label?: string;
|
|
16
|
+
readonly error?: string;
|
|
17
|
+
readonly size?: "sm" | "md" | "lg";
|
|
18
|
+
readonly fullWidth?: boolean;
|
|
19
|
+
readonly placeholder?: string;
|
|
20
|
+
readonly disabled?: boolean;
|
|
21
|
+
readonly className?: string;
|
|
22
|
+
readonly id?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
25
|
+
export { Select };
|
|
26
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE;YAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,uFAqCV,CAAC;AAIH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/select.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// src/select.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/select.tsx
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var Select = React.forwardRef(function Select2({ options, value, onChange, label, error, size = "md", fullWidth = false, placeholder = "Select\u2026", disabled = false, className, id }, ref) {
|
|
14
|
+
const generatedId = React.useId();
|
|
15
|
+
const selectId = id ?? generatedId;
|
|
16
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
17
|
+
return /* @__PURE__ */ jsxs("label", { className: cn("flex flex-col gap-1", fullWidth && "w-full"), htmlFor: selectId, children: [
|
|
18
|
+
label ? /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-muted-foreground", children: label }) : null,
|
|
19
|
+
/* @__PURE__ */ jsxs(
|
|
20
|
+
"select",
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
id: selectId,
|
|
24
|
+
value: value ?? "",
|
|
25
|
+
disabled,
|
|
26
|
+
onChange: (event) => onChange?.({ target: { value: event.target.value } }),
|
|
27
|
+
"aria-invalid": Boolean(error),
|
|
28
|
+
className: cn(
|
|
29
|
+
"border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-muted h-8 min-w-0 rounded-lg border px-2.5 py-1 text-sm outline-none transition-colors focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
30
|
+
size === "sm" && "h-7 text-xs",
|
|
31
|
+
size === "lg" && "h-10 text-base",
|
|
32
|
+
fullWidth && "w-full",
|
|
33
|
+
!selectedOption && "text-muted-foreground",
|
|
34
|
+
error && "border-destructive",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsx("option", { value: "", disabled: options.length > 0, children: placeholder }),
|
|
39
|
+
options.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value))
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
error ? /* @__PURE__ */ jsx("span", { className: "text-sm text-destructive", children: error }) : null
|
|
44
|
+
] });
|
|
45
|
+
});
|
|
46
|
+
Select.displayName = "Select";
|
|
47
|
+
export {
|
|
48
|
+
Select
|
|
49
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SkeletonProps {
|
|
3
|
+
readonly width?: string | number;
|
|
4
|
+
readonly height?: string | number;
|
|
5
|
+
readonly variant?: "text" | "circular" | "rectangular" | "rounded";
|
|
6
|
+
readonly animation?: "pulse" | "wave" | "none";
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function Skeleton({ width, height, variant, animation, className }: SkeletonProps): React.JSX.Element;
|
|
10
|
+
export { Skeleton };
|
|
11
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../src/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,iBAAS,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAgB,EAAE,SAAmB,EAAE,SAAS,EAAE,EAAE,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAQvH;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/skeleton.tsx
|
|
2
|
+
import "react";
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/skeleton.tsx
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
function Skeleton({ width, height, variant = "text", animation = "pulse", className }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: cn("bg-muted", variant === "text" && "rounded-sm", variant === "circular" && "rounded-full", variant === "rounded" && "rounded-md", animation === "pulse" && "animate-pulse", animation === "wave" && "animate-pulse", className),
|
|
18
|
+
style: { width: width ?? (variant === "text" ? "100%" : void 0), height: height ?? (variant === "text" ? "1em" : void 0) },
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
Skeleton
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SpinnerProps {
|
|
3
|
+
readonly size?: "sm" | "md" | "lg" | "xl";
|
|
4
|
+
readonly color?: string;
|
|
5
|
+
readonly className?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function Spinner({ size, color, className }: SpinnerProps): React.JSX.Element;
|
|
8
|
+
export { Spinner };
|
|
9
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../src/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,iBAAS,OAAO,CAAC,EAAE,IAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CASnF;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|