@websolutespa/ask-ui 1.0.1 → 1.0.3
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.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{utils-Dnvgforf.d.mts → lib/utils.d.mts} +1 -1
- package/dist/{utils-XdqGR1qq.mjs → lib/utils.mjs} +1 -1
- package/package.json +7 -7
- package/dist/exports/components.d.mts +0 -21
- package/dist/exports/components.mjs +0 -47
- package/dist/exports/hooks.d.mts +0 -4
- package/dist/exports/hooks.mjs +0 -18
- package/dist/exports/lib.d.mts +0 -2
- package/dist/exports/lib.mjs +0 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "./lib/utils.mjs";
|
|
2
2
|
export { cn };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "./lib/utils.mjs";
|
|
2
2
|
export { cn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websolutespa/ask-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Ask UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"types": "./dist/index.d.ts",
|
|
74
74
|
"default": "./dist/index.js"
|
|
75
75
|
},
|
|
76
|
-
"./components/*": "./dist/
|
|
77
|
-
"./hooks/*": "./dist/
|
|
78
|
-
"./lib/*": "./dist/
|
|
76
|
+
"./components/*": "./dist/components/*.mjs",
|
|
77
|
+
"./hooks/*": "./dist/hooks/*.mjs",
|
|
78
|
+
"./lib/*": "./dist/lib/*.mjs",
|
|
79
79
|
"./globals.css": "./dist/globals.css"
|
|
80
80
|
},
|
|
81
81
|
"main": "./dist/index.mjs",
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"types": "./dist/index.d.ts",
|
|
103
103
|
"default": "./dist/index.js"
|
|
104
104
|
},
|
|
105
|
-
"./components/*": "./dist/
|
|
106
|
-
"./hooks/*": "./dist/
|
|
107
|
-
"./lib/*": "./dist/
|
|
105
|
+
"./components/*": "./dist/components/*.mjs",
|
|
106
|
+
"./hooks/*": "./dist/hooks/*.mjs",
|
|
107
|
+
"./lib/*": "./dist/lib/*.mjs",
|
|
108
108
|
"./globals.css": "./dist/globals.css",
|
|
109
109
|
"./postcss.config": "./postcss.config.mjs"
|
|
110
110
|
},
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
-
|
|
6
|
-
//#region src/components/button.d.ts
|
|
7
|
-
declare const buttonVariants: (props?: ({
|
|
8
|
-
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
9
|
-
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
10
|
-
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
|
-
declare function Button({
|
|
12
|
-
className,
|
|
13
|
-
variant,
|
|
14
|
-
size,
|
|
15
|
-
asChild,
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
18
|
-
asChild?: boolean;
|
|
19
|
-
}): _$react_jsx_runtime0.JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { Button, buttonVariants };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { t as cn } from "../utils-XdqGR1qq.mjs";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import { Slot } from "radix-ui";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/button.tsx
|
|
7
|
-
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none cursor-pointer focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
11
|
-
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/0 dark:hover:bg-input/15",
|
|
12
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
13
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
14
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
15
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
19
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
20
|
-
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
21
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
22
|
-
icon: "size-9",
|
|
23
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
24
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
25
|
-
"icon-lg": "size-10"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
defaultVariants: {
|
|
29
|
-
variant: "default",
|
|
30
|
-
size: "default"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
34
|
-
return /* @__PURE__ */ jsx(asChild ? Slot.Root : "button", {
|
|
35
|
-
"data-slot": "button",
|
|
36
|
-
"data-variant": variant,
|
|
37
|
-
"data-size": size,
|
|
38
|
-
className: cn(buttonVariants({
|
|
39
|
-
variant,
|
|
40
|
-
size,
|
|
41
|
-
className
|
|
42
|
-
})),
|
|
43
|
-
...props
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { Button, buttonVariants };
|
package/dist/exports/hooks.d.mts
DELETED
package/dist/exports/hooks.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
//#region src/hooks/use-mobile.ts
|
|
3
|
-
const MOBILE_BREAKPOINT = 768;
|
|
4
|
-
function useIsMobile() {
|
|
5
|
-
const [isMobile, setIsMobile] = React.useState(void 0);
|
|
6
|
-
React.useEffect(() => {
|
|
7
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
8
|
-
const onChange = () => {
|
|
9
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
10
|
-
};
|
|
11
|
-
mql.addEventListener("change", onChange);
|
|
12
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
13
|
-
return () => mql.removeEventListener("change", onChange);
|
|
14
|
-
}, []);
|
|
15
|
-
return !!isMobile;
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { useIsMobile };
|
package/dist/exports/lib.d.mts
DELETED
package/dist/exports/lib.mjs
DELETED