@glasshome/ui 0.5.1 → 0.5.2
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.ts +1 -0
- package/dist/index.js +9 -9
- package/dist/lib/button-variants.d.ts +20 -0
- package/dist/solid/button.d.ts +2 -11
- package/dist/solid/index.js +5077 -5144
- package/dist/solid/item.d.ts +1 -1
- package/dist/{utils-DFpagEar.js → utils-BRD6YbhO.js} +655 -586
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { n as e, t } from "./utils-BRD6YbhO.js";
|
|
2
|
+
import { createSignal as n, onCleanup as r, onMount as i } from "solid-js";
|
|
3
3
|
//#region src/lib/use-is-mobile.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
let [e,
|
|
7
|
-
return
|
|
8
|
-
let e = window.matchMedia(`(max-width: ${
|
|
9
|
-
e.addEventListener("change",
|
|
4
|
+
var a = 768;
|
|
5
|
+
function o() {
|
|
6
|
+
let [e, t] = n(void 0);
|
|
7
|
+
return i(() => {
|
|
8
|
+
let e = window.matchMedia(`(max-width: ${a - 1}px)`), n = () => t(window.innerWidth < a);
|
|
9
|
+
e.addEventListener("change", n), t(window.innerWidth < a), r(() => e.removeEventListener("change", n));
|
|
10
10
|
}), e;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
|
-
export { e as cn,
|
|
13
|
+
export { e as buttonVariants, t as cn, o as createIsMobile };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button class recipe. Pure (only `cva`, no Solid/Kobalte), so it can be
|
|
3
|
+
* imported server-side and from framework-agnostic entry points — Astro
|
|
4
|
+
* frontmatter pulls this to build class strings without hydrating a component.
|
|
5
|
+
* The Solid `<Button>` and the hub's marketing pill tokens share this one recipe.
|
|
6
|
+
*
|
|
7
|
+
* Buttons are pills: `rounded-full` is the base shape everywhere. `size: none`
|
|
8
|
+
* is sizeless (color + shape only) for callers that supply their own height and
|
|
9
|
+
* padding.
|
|
10
|
+
*/
|
|
11
|
+
export declare const buttonVariants: (props?: ({
|
|
12
|
+
variant?: "default" | "gradient" | "destructive" | "outline" | "secondary" | "ghost" | "link" | undefined;
|
|
13
|
+
size?: "default" | "sm" | "lg" | "icon" | "none" | undefined;
|
|
14
|
+
} & ({
|
|
15
|
+
class?: import("cva").ClassValue;
|
|
16
|
+
className?: never;
|
|
17
|
+
} | {
|
|
18
|
+
class?: never;
|
|
19
|
+
className?: import("cva").ClassValue;
|
|
20
|
+
})) | undefined) => string;
|
package/dist/solid/button.d.ts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { Button as KobalteButton } from "@kobalte/core/button";
|
|
2
|
-
import {
|
|
2
|
+
import type { VariantProps } from "cva";
|
|
3
3
|
import { type ComponentProps } from "solid-js";
|
|
4
|
-
|
|
5
|
-
variant?: "link" | "default" | "gradient" | "destructive" | "outline" | "secondary" | "ghost" | undefined;
|
|
6
|
-
size?: "default" | "sm" | "lg" | "icon" | "none" | undefined;
|
|
7
|
-
} & ({
|
|
8
|
-
class?: import("cva").ClassValue;
|
|
9
|
-
className?: never;
|
|
10
|
-
} | {
|
|
11
|
-
class?: never;
|
|
12
|
-
className?: import("cva").ClassValue;
|
|
13
|
-
})) | undefined) => string;
|
|
4
|
+
import { buttonVariants } from "../lib/button-variants";
|
|
14
5
|
type ButtonProps = ComponentProps<typeof KobalteButton> & VariantProps<typeof buttonVariants>;
|
|
15
6
|
declare function Button(props: ButtonProps): import("solid-js").JSX.Element;
|
|
16
7
|
export { Button, buttonVariants };
|