@snurls/react 0.0.1

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.
Files changed (44) hide show
  1. package/dist/SUIT-Bold-XZA7XGDX.woff2 +0 -0
  2. package/dist/SUIT-ExtraBold-FAP7MIVZ.woff2 +0 -0
  3. package/dist/SUIT-Medium-AINVSZ7R.woff2 +0 -0
  4. package/dist/SUIT-SemiBold-SSH2OWZI.woff2 +0 -0
  5. package/dist/components/accordion/Accordion.d.ts +6 -0
  6. package/dist/components/accordion/AccordionContext.d.ts +7 -0
  7. package/dist/components/accordion/AccordionItem.d.ts +6 -0
  8. package/dist/components/accordion/index.d.ts +3 -0
  9. package/dist/components/accordion/style.css.d.ts +5 -0
  10. package/dist/components/accordion/types.d.ts +15 -0
  11. package/dist/components/button/Button.d.ts +6 -0
  12. package/dist/components/button/index.d.ts +2 -0
  13. package/dist/components/button/style.css.d.ts +85 -0
  14. package/dist/components/button/types.d.ts +11 -0
  15. package/dist/components/core/styles.css.d.ts +23 -0
  16. package/dist/components/core/types.d.ts +13 -0
  17. package/dist/components/layout/Box.d.ts +7 -0
  18. package/dist/components/layout/Divider.d.ts +7 -0
  19. package/dist/components/layout/Flex.d.ts +7 -0
  20. package/dist/components/layout/Grid.d.ts +7 -0
  21. package/dist/components/layout/GridItem.d.ts +7 -0
  22. package/dist/components/layout/index.d.ts +6 -0
  23. package/dist/components/layout/types.d.ts +52 -0
  24. package/dist/components/typography/Text.d.ts +7 -0
  25. package/dist/components/typography/index.d.ts +2 -0
  26. package/dist/components/typography/style.css.d.ts +92 -0
  27. package/dist/components/typography/types.d.ts +9 -0
  28. package/dist/components/utils/properties.d.ts +1 -0
  29. package/dist/hooks/button/index.d.ts +3 -0
  30. package/dist/hooks/button/types.d.ts +36 -0
  31. package/dist/hooks/button/useButton.d.ts +3 -0
  32. package/dist/hooks/button/useToggleButton.d.ts +3 -0
  33. package/dist/hooks/toggle/index.d.ts +2 -0
  34. package/dist/hooks/toggle/types.d.ts +8 -0
  35. package/dist/hooks/toggle/useToggle.d.ts +3 -0
  36. package/dist/index.cjs +2 -0
  37. package/dist/index.cjs.map +7 -0
  38. package/dist/index.css +2 -0
  39. package/dist/index.css.map +7 -0
  40. package/dist/index.d.ts +6 -0
  41. package/dist/index.js +2 -0
  42. package/dist/index.js.map +7 -0
  43. package/dist/styles/global.css.d.ts +3 -0
  44. package/package.json +48 -0
Binary file
Binary file
@@ -0,0 +1,6 @@
1
+ import { AccordionProps } from "./types";
2
+ interface Props extends AccordionProps {
3
+ ref?: React.Ref<HTMLDivElement>;
4
+ }
5
+ declare const Accordion: (props: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default Accordion;
@@ -0,0 +1,7 @@
1
+ export type AccordionContextType = {
2
+ activeItems: string[];
3
+ setActiveItem: (item: string) => void;
4
+ };
5
+ export declare const AccordionContext: import("react").Context<AccordionContextType>;
6
+ export declare const useAccordionContext: () => AccordionContextType;
7
+ export default AccordionContext;
@@ -0,0 +1,6 @@
1
+ import { AccordionItemProps } from "./types";
2
+ interface Props extends AccordionItemProps {
3
+ ref?: React.Ref<HTMLDivElement>;
4
+ }
5
+ declare const AccordionItem: (props: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default AccordionItem;
@@ -0,0 +1,3 @@
1
+ export { default as Accordion } from "./Accordion";
2
+ export { default as AccordionItem } from "./AccordionItem";
3
+ export { AccordionButtonProps, AccordionItemProps, AccordionPanelProps, AccordionProps, } from "./types";
@@ -0,0 +1,5 @@
1
+ export declare const accordionStyle: string;
2
+ export declare const accordionItemStyle: string;
3
+ export declare const accordionButtonStyle: string;
4
+ export declare const panelHeight: `var(--${string})`;
5
+ export declare const accordionPanelStyle: string;
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ export type AccordionProps = {
3
+ defaultActiveItems?: string[];
4
+ children: React.ReactNode | React.ReactNode[];
5
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
6
+ export type AccordionItemProps = {
7
+ children: React.ReactNode[];
8
+ itemName: string;
9
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "children">;
10
+ export type AccordionButtonProps = {
11
+ itemName?: string;
12
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
13
+ export type AccordionPanelProps = {
14
+ itemName?: string;
15
+ } & React.HTMLAttributes<HTMLDivElement>;
@@ -0,0 +1,6 @@
1
+ import { ButtonProps } from "./types";
2
+ interface Props extends ButtonProps {
3
+ ref?: React.Ref<HTMLButtonElement>;
4
+ }
5
+ declare const Button: (props: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default Button;
@@ -0,0 +1,2 @@
1
+ export { default as Button } from "./Button";
2
+ export { ButtonProps } from "./types";
@@ -0,0 +1,85 @@
1
+ export declare const enableColorVariant: `var(--${string})`;
2
+ export declare const hoverColorVariant: `var(--${string})`;
3
+ export declare const activeColorVariant: `var(--${string})`;
4
+ export declare const borderColorVariant: `var(--${string})`;
5
+ export declare const buttonStyle: import("@vanilla-extract/recipes").RuntimeFn<{
6
+ size: {
7
+ "56": {
8
+ height: "3.5rem";
9
+ };
10
+ "48": {
11
+ height: "3rem";
12
+ };
13
+ "40": {
14
+ height: "2.5rem";
15
+ };
16
+ };
17
+ variant: {
18
+ solid: {
19
+ backgroundColor: `var(--${string})`;
20
+ color: string;
21
+ "&:hover:not([disabled])": {
22
+ backgroundColor: `var(--${string})`;
23
+ };
24
+ "&:active:not([disabled])": {
25
+ backgroundColor: `var(--${string})`;
26
+ };
27
+ fontSize: string;
28
+ fontWeight: string;
29
+ lineHeight: string;
30
+ };
31
+ outline: {
32
+ border: `1px solid var(--${string})`;
33
+ color: string;
34
+ "&:hover:not([disabled])": {
35
+ backgroundColor: `var(--${string})`;
36
+ };
37
+ "&:active:not([disabled])": {
38
+ backgroundColor: `var(--${string})`;
39
+ };
40
+ fontSize: string;
41
+ fontWeight: string;
42
+ lineHeight: string;
43
+ };
44
+ ghost: {
45
+ color: string;
46
+ "&:hover:not([disabled])": {
47
+ backgroundColor: `var(--${string})`;
48
+ };
49
+ "&:active:not([disabled])": {
50
+ backgroundColor: string;
51
+ };
52
+ "&[disabled]": {
53
+ background: string;
54
+ color: string;
55
+ cursor: string;
56
+ };
57
+ };
58
+ };
59
+ }>;
60
+ export declare const spanStyle: import("@vanilla-extract/recipes").RuntimeFn<{
61
+ size: {
62
+ "56": {};
63
+ "48": {};
64
+ "40": {};
65
+ };
66
+ }>;
67
+ export declare const spinnerStyle: import("@vanilla-extract/recipes").RuntimeFn<{
68
+ size: {
69
+ "56": {
70
+ width: string;
71
+ height: string;
72
+ left: `calc(50% - ${string}/2)`;
73
+ };
74
+ "48": {
75
+ width: string;
76
+ height: string;
77
+ left: `calc(50% - ${string}/2)`;
78
+ };
79
+ "40": {
80
+ width: string;
81
+ height: string;
82
+ left: `calc(50% - ${string}/2)`;
83
+ };
84
+ };
85
+ }>;
@@ -0,0 +1,11 @@
1
+ import { vars } from "@snurls/themes";
2
+ export type ButtonProps = {
3
+ color?: keyof typeof vars.colors.$scale;
4
+ isDisabled?: boolean;
5
+ isLoading?: boolean;
6
+ leftIcon?: React.ReactNode;
7
+ rightIcon?: React.ReactNode;
8
+ width?: number;
9
+ size?: "56" | "48" | "40";
10
+ variant?: "solid" | "outline" | "ghost";
11
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>;
@@ -0,0 +1,23 @@
1
+ export declare const BaseStyle: string;
2
+ export declare const StyleSprinkles: ((props: {
3
+ marginTop?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
4
+ marginRight?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
5
+ marginBottom?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
6
+ marginLeft?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
7
+ paddingTop?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
8
+ paddingRight?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
9
+ paddingBottom?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
10
+ paddingLeft?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
11
+ margin?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
12
+ padding?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
13
+ marginX?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
14
+ marginY?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
15
+ paddingX?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
16
+ paddingY?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
17
+ } & {
18
+ borderRadius?: "none" | "sm" | "base" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | undefined;
19
+ } & {
20
+ boxShadow?: "outline" | "sm" | "base" | "md" | "lg" | "xl" | "2xl" | "xs" | "inner" | "darkLg" | undefined;
21
+ }) => string) & {
22
+ properties: Set<"padding" | "boxShadow" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "borderRadius" | "margin" | "marginX" | "marginY" | "paddingX" | "paddingY">;
23
+ };
@@ -0,0 +1,13 @@
1
+ import { vars } from "@snurls/themes";
2
+ import { StyleSprinkles } from "./styles.css";
3
+ type AsProps = {
4
+ as?: Exclude<keyof React.JSX.IntrinsicElements, keyof SVGElementTagNameMap>;
5
+ };
6
+ type ElementProps = Omit<React.HTMLAttributes<HTMLElement>, "as">;
7
+ export type AsElementProps = AsProps & ElementProps;
8
+ export type ColorProps = {
9
+ color?: keyof typeof vars.colors.$scale;
10
+ background?: keyof typeof vars.colors.$scale;
11
+ };
12
+ export type StyleProps = Parameters<typeof StyleSprinkles>[0] & ColorProps;
13
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ReactElement, Ref } from "react";
2
+ import { BoxProps } from "./types";
3
+ interface Props extends BoxProps {
4
+ ref?: Ref<HTMLElement>;
5
+ }
6
+ declare const Box: (props: Props) => ReactElement;
7
+ export default Box;
@@ -0,0 +1,7 @@
1
+ import { Ref } from "react";
2
+ import { DividerProps } from "./types";
3
+ interface Props extends DividerProps {
4
+ ref?: Ref<HTMLHRElement>;
5
+ }
6
+ declare const Divider: ({ ref, color, variant, size, orientation, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Divider;
@@ -0,0 +1,7 @@
1
+ import { ReactElement, Ref } from "react";
2
+ import { FlexProps } from "./types";
3
+ interface Props extends FlexProps {
4
+ ref?: Ref<HTMLElement>;
5
+ }
6
+ declare const Flex: (props: Props) => ReactElement;
7
+ export default Flex;
@@ -0,0 +1,7 @@
1
+ import { ReactElement, Ref } from "react";
2
+ import { GridProps } from "./types";
3
+ interface Props extends GridProps {
4
+ ref?: Ref<HTMLElement>;
5
+ }
6
+ declare const Grid: (props: Props) => ReactElement;
7
+ export default Grid;
@@ -0,0 +1,7 @@
1
+ import { ReactElement, Ref } from "react";
2
+ import { GridItemProps } from "./types";
3
+ interface Props extends GridItemProps {
4
+ ref?: Ref<HTMLElement>;
5
+ }
6
+ declare const GridItem: (props: Props) => ReactElement;
7
+ export default GridItem;
@@ -0,0 +1,6 @@
1
+ export { default as Box } from "./Box";
2
+ export { default as Divider } from "./Divider";
3
+ export { default as Flex } from "./Flex";
4
+ export { default as Grid } from "./Grid";
5
+ export { default as GridItem } from "./GridItem";
6
+ export { BoxProps, DividerProps, FlexProps, GridProps, GridItemProps, } from "./types";
@@ -0,0 +1,52 @@
1
+ import { vars } from "@snurls/themes";
2
+ import { AsElementProps, StyleProps } from "../core/types";
3
+ import { CSSProperties } from "@vanilla-extract/css";
4
+ import { TextProps } from "../typography";
5
+ export type BoxProps = AsElementProps & StyleProps;
6
+ export type DividerProps = {
7
+ orientation?: "horizontal" | "vertical";
8
+ color?: keyof typeof vars.colors.$scale;
9
+ size?: number;
10
+ variant?: "solid" | "dashed";
11
+ } & React.HTMLAttributes<HTMLHRElement>;
12
+ export type FlexProps = {
13
+ align?: CSSProperties["alignItems"];
14
+ basis?: CSSProperties["flexBasis"];
15
+ direction?: CSSProperties["flexDirection"];
16
+ grow?: CSSProperties["flexGrow"];
17
+ justify?: CSSProperties["justifyContent"];
18
+ shrink?: CSSProperties["flexShrink"];
19
+ wrap?: CSSProperties["flexWrap"];
20
+ gap?: CSSProperties["gap"];
21
+ } & BoxProps;
22
+ export type GridProps = {
23
+ autoColumns?: CSSProperties["gridAutoColumns"];
24
+ autoFlow?: CSSProperties["gridAutoFlow"];
25
+ autoRows?: CSSProperties["gridAutoRows"];
26
+ column?: CSSProperties["gridColumn"];
27
+ columnGap?: CSSProperties["columnGap"];
28
+ gap?: CSSProperties["gap"];
29
+ row?: CSSProperties["gridRow"];
30
+ rowGap?: CSSProperties["rowGap"];
31
+ templateAreas?: CSSProperties["gridTemplateAreas"];
32
+ templateColumns?: CSSProperties["gridTemplateColumns"];
33
+ templateRows?: CSSProperties["gridTemplateRows"];
34
+ } & BoxProps;
35
+ export type GridItemProps = {
36
+ area?: CSSProperties["gridArea"];
37
+ colEnd?: CSSProperties["gridColumnEnd"];
38
+ colStart?: CSSProperties["gridColumnStart"];
39
+ colSpan?: CSSProperties["gridColumn"];
40
+ rowEnd?: CSSProperties["gridRowEnd"];
41
+ rowStart?: CSSProperties["gridRowStart"];
42
+ rowSpan?: CSSProperties["gridRow"];
43
+ } & BoxProps;
44
+ export type ListProps = {
45
+ variant?: "ordered" | "unordered";
46
+ spacing?: keyof typeof vars.box.spacing;
47
+ } & BoxProps;
48
+ export type OrderListProps = Omit<ListProps, "variant">;
49
+ export type ListItemProps = TextProps;
50
+ export type UnorderedListProps = Omit<ListProps, "variant"> & {
51
+ listStyleType?: CSSProperties["listStyleType"];
52
+ };
@@ -0,0 +1,7 @@
1
+ import { ReactElement, Ref } from "react";
2
+ import { TextProps } from "./types";
3
+ interface Props extends TextProps {
4
+ ref?: Ref<HTMLElement>;
5
+ }
6
+ declare const Text: (props: Props) => ReactElement;
7
+ export default Text;
@@ -0,0 +1,2 @@
1
+ export { default as Text } from "./Text";
2
+ export { TextProps } from "./types";
@@ -0,0 +1,92 @@
1
+ export declare const textStyle: import("@vanilla-extract/recipes").RuntimeFn<{
2
+ variant: {
3
+ display1: {
4
+ fontSize: string;
5
+ fontWeight: string;
6
+ lineHeight: string;
7
+ };
8
+ display2: {
9
+ fontSize: string;
10
+ fontWeight: string;
11
+ lineHeight: string;
12
+ };
13
+ title1: {
14
+ fontSize: string;
15
+ fontWeight: string;
16
+ lineHeight: string;
17
+ };
18
+ title2: {
19
+ fontSize: string;
20
+ fontWeight: string;
21
+ lineHeight: string;
22
+ };
23
+ title3: {
24
+ fontSize: string;
25
+ fontWeight: string;
26
+ lineHeight: string;
27
+ };
28
+ heading1: {
29
+ fontSize: string;
30
+ fontWeight: string;
31
+ lineHeight: string;
32
+ };
33
+ heading2: {
34
+ fontSize: string;
35
+ fontWeight: string;
36
+ lineHeight: string;
37
+ };
38
+ headline1: {
39
+ fontSize: string;
40
+ fontWeight: string;
41
+ lineHeight: string;
42
+ };
43
+ headline2: {
44
+ fontSize: string;
45
+ fontWeight: string;
46
+ lineHeight: string;
47
+ };
48
+ body1: {
49
+ fontSize: string;
50
+ fontWeight: string;
51
+ lineHeight: string;
52
+ };
53
+ body1Reading: {
54
+ fontSize: string;
55
+ fontWeight: string;
56
+ lineHeight: string;
57
+ };
58
+ body2: {
59
+ fontSize: string;
60
+ fontWeight: string;
61
+ lineHeight: string;
62
+ };
63
+ body2Reading: {
64
+ fontSize: string;
65
+ fontWeight: string;
66
+ lineHeight: string;
67
+ };
68
+ label1: {
69
+ fontSize: string;
70
+ fontWeight: string;
71
+ lineHeight: string;
72
+ };
73
+ label2: {
74
+ fontSize: string;
75
+ fontWeight: string;
76
+ lineHeight: string;
77
+ };
78
+ caption1: {
79
+ fontSize: string;
80
+ fontWeight: string;
81
+ lineHeight: string;
82
+ };
83
+ caption2: {
84
+ fontSize: string;
85
+ fontWeight: string;
86
+ lineHeight: string;
87
+ };
88
+ };
89
+ defaultVariants: {
90
+ variant: string;
91
+ };
92
+ }>;
@@ -0,0 +1,9 @@
1
+ import { classes } from "@snurls/themes";
2
+ import { AsElementProps, StyleProps } from "../core/types";
3
+ import { CSSProperties } from "@vanilla-extract/css";
4
+ export type TextProps = AsElementProps & StyleProps & {
5
+ variant: keyof typeof classes.typography.text;
6
+ align?: CSSProperties["textAlign"];
7
+ casing?: CSSProperties["textTransform"];
8
+ decoration?: CSSProperties["textDecoration"];
9
+ };
@@ -0,0 +1 @@
1
+ export declare const extractSprinkleProps: <T extends Object>(props: T, keys: (keyof T)[]) => any;
@@ -0,0 +1,3 @@
1
+ export { default as useButton } from "./useButton";
2
+ export { default as useToggleButton } from "./useToggleButton";
3
+ export { BaseButtonProps, ButtonElementType, OverloadedButtonFunction, OverloadedToggleButtonFunction, UseButtonReturn, UseToggleButtonReturn, } from "./types";
@@ -0,0 +1,36 @@
1
+ import { ComponentProps, HTMLAttributes } from "react";
2
+ export type ButtonElementType = "button" | "a" | "div" | "span" | "input";
3
+ export type BaseButtonProps<T extends ButtonElementType = "button"> = {
4
+ elementType?: T;
5
+ role?: string;
6
+ type?: "button" | "submit" | "reset";
7
+ isDisabled?: boolean;
8
+ isLoading?: boolean;
9
+ tabIndex?: number;
10
+ } & ComponentProps<T>;
11
+ export type UseButtonReturn<T> = {
12
+ buttonProps: HTMLAttributes<T> & {
13
+ role?: string;
14
+ type?: "button" | "submit" | "reset";
15
+ tabIndex?: number;
16
+ disabled?: boolean;
17
+ "data-loading": boolean;
18
+ };
19
+ };
20
+ export type OverloadedButtonFunction = {
21
+ (props: BaseButtonProps<"button">): UseButtonReturn<HTMLButtonElement>;
22
+ (props: BaseButtonProps<"a">): UseButtonReturn<HTMLAnchorElement>;
23
+ (props: BaseButtonProps<"div">): UseButtonReturn<HTMLDivElement>;
24
+ (props: BaseButtonProps<"input">): UseButtonReturn<HTMLInputElement>;
25
+ (props: BaseButtonProps<"span">): UseButtonReturn<HTMLSpanElement>;
26
+ };
27
+ export type UseToggleButtonReturn<T> = UseButtonReturn<T> & {
28
+ isSelected: boolean;
29
+ };
30
+ export type OverloadedToggleButtonFunction = {
31
+ (props: BaseButtonProps<"button">, isSelected?: boolean): UseToggleButtonReturn<HTMLButtonElement>;
32
+ (props: BaseButtonProps<"a">, isSelected?: boolean): UseToggleButtonReturn<HTMLAnchorElement>;
33
+ (props: BaseButtonProps<"div">, isSelected?: boolean): UseToggleButtonReturn<HTMLDivElement>;
34
+ (props: BaseButtonProps<"input">, isSelected?: boolean): UseToggleButtonReturn<HTMLInputElement>;
35
+ (props: BaseButtonProps<"span">, isSelected?: boolean): UseToggleButtonReturn<HTMLSpanElement>;
36
+ };
@@ -0,0 +1,3 @@
1
+ import { OverloadedButtonFunction } from "./types";
2
+ declare const useButton: OverloadedButtonFunction;
3
+ export default useButton;
@@ -0,0 +1,3 @@
1
+ import { OverloadedToggleButtonFunction } from "./types";
2
+ declare const useToggleButton: OverloadedToggleButtonFunction;
3
+ export default useToggleButton;
@@ -0,0 +1,2 @@
1
+ export { default as useToggle } from "./useToggle";
2
+ export { ToggleProps, UseToggleReturn } from "./types";
@@ -0,0 +1,8 @@
1
+ export type ToggleProps = {
2
+ isSelected?: boolean;
3
+ };
4
+ export interface UseToggleReturn {
5
+ readonly isSelected: boolean;
6
+ setSelected(isSelected: boolean): void;
7
+ toggle(): void;
8
+ }
@@ -0,0 +1,3 @@
1
+ import { ToggleProps, UseToggleReturn } from "./types";
2
+ declare const useToggle: ({ isSelected }: ToggleProps) => UseToggleReturn;
3
+ export default useToggle;
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var V=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var qe=Object.prototype.hasOwnProperty;var Be=(e,t)=>{for(var r in t)V(e,r,{get:t[r],enumerable:!0})},_e=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ve(t))!qe.call(e,i)&&i!==r&&V(e,i,{get:()=>t[i],enumerable:!(a=Re(t,i))||a.enumerable});return e};var Ne=e=>_e(V({},"__esModule",{value:!0}),e);var et={};Be(et,{Box:()=>K,Button:()=>be,Divider:()=>Y,Flex:()=>ee,Grid:()=>ie,GridItem:()=>ne,Text:()=>Pe,useButton:()=>S,useToggle:()=>R,useToggleButton:()=>Ce});module.exports=Ne(et);var zr=require("@snurls/themes/themes.css");var H=require("react"),M=require("clsx");function ze(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ae(e){var t=ze(e,"string");return typeof t=="symbol"?t:String(t)}function De(e,t,r){return t=Ae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,a)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?G(Object(r),!0).forEach(function(a){De(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var U=e=>function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var i=Object.assign({},...r.map(n=>n.styles)),l=Object.keys(i),o=l.filter(n=>"mappings"in i[n]),s=n=>{var d=[],f={},v=q({},n),m=!1;for(var w of o){var p=n[w];if(p!=null){var k=i[w];m=!0;for(var h of k.mappings)f[h]=p,v[h]==null&&delete v[h]}}var C=m?q(q({},f),v):n,E=function(){var b=C[A],P=i[A];try{if(P.mappings)return 1;if(typeof b=="string"||typeof b=="number")d.push(P.values[b].defaultClass);else if(Array.isArray(b))for(var T=0;T<b.length;T++){var D=b[T];if(D!=null){var Ee=P.responsiveArray[T];d.push(P.values[D].conditions[Ee])}}else for(var L in b){var F=b[L];F!=null&&d.push(P.values[F].conditions[L])}}catch(Te){if(0){var rt,at;if(typeof b=="object")if(Array.isArray(b)){var it;for(var lt of b);}else for(var ot in b)var st}throw Te}};for(var A in C)E();return e(d.join(" "))};return Object.assign(s,{properties:new Set(l)})};var Le=e=>e,$=function(){return U(Le)(...arguments)};var g="iw0v6k0",u=$({conditions:void 0,styles:{margin:{mappings:["marginTop","marginRight","marginBottom","marginLeft"]},padding:{mappings:["paddingTop","paddingRight","paddingBottom","paddingLeft"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},marginTop:{values:{0:{defaultClass:"iw0v6k1"},1:{defaultClass:"iw0v6k2"},2:{defaultClass:"iw0v6k3"},3:{defaultClass:"iw0v6k4"},4:{defaultClass:"iw0v6k5"},5:{defaultClass:"iw0v6k6"},6:{defaultClass:"iw0v6k7"},7:{defaultClass:"iw0v6k8"},8:{defaultClass:"iw0v6k9"},9:{defaultClass:"iw0v6ka"},10:{defaultClass:"iw0v6kb"},11:{defaultClass:"iw0v6kc"},12:{defaultClass:"iw0v6kd"},14:{defaultClass:"iw0v6ke"},16:{defaultClass:"iw0v6kf"},20:{defaultClass:"iw0v6kg"},24:{defaultClass:"iw0v6kh"},28:{defaultClass:"iw0v6ki"},32:{defaultClass:"iw0v6kj"},36:{defaultClass:"iw0v6kk"},40:{defaultClass:"iw0v6kl"},44:{defaultClass:"iw0v6km"},48:{defaultClass:"iw0v6kn"},52:{defaultClass:"iw0v6ko"},56:{defaultClass:"iw0v6kp"},60:{defaultClass:"iw0v6kq"},64:{defaultClass:"iw0v6kr"},72:{defaultClass:"iw0v6ks"},80:{defaultClass:"iw0v6kt"},96:{defaultClass:"iw0v6ku"}}},marginRight:{values:{0:{defaultClass:"iw0v6kv"},1:{defaultClass:"iw0v6kw"},2:{defaultClass:"iw0v6kx"},3:{defaultClass:"iw0v6ky"},4:{defaultClass:"iw0v6kz"},5:{defaultClass:"iw0v6k10"},6:{defaultClass:"iw0v6k11"},7:{defaultClass:"iw0v6k12"},8:{defaultClass:"iw0v6k13"},9:{defaultClass:"iw0v6k14"},10:{defaultClass:"iw0v6k15"},11:{defaultClass:"iw0v6k16"},12:{defaultClass:"iw0v6k17"},14:{defaultClass:"iw0v6k18"},16:{defaultClass:"iw0v6k19"},20:{defaultClass:"iw0v6k1a"},24:{defaultClass:"iw0v6k1b"},28:{defaultClass:"iw0v6k1c"},32:{defaultClass:"iw0v6k1d"},36:{defaultClass:"iw0v6k1e"},40:{defaultClass:"iw0v6k1f"},44:{defaultClass:"iw0v6k1g"},48:{defaultClass:"iw0v6k1h"},52:{defaultClass:"iw0v6k1i"},56:{defaultClass:"iw0v6k1j"},60:{defaultClass:"iw0v6k1k"},64:{defaultClass:"iw0v6k1l"},72:{defaultClass:"iw0v6k1m"},80:{defaultClass:"iw0v6k1n"},96:{defaultClass:"iw0v6k1o"}}},marginBottom:{values:{0:{defaultClass:"iw0v6k1p"},1:{defaultClass:"iw0v6k1q"},2:{defaultClass:"iw0v6k1r"},3:{defaultClass:"iw0v6k1s"},4:{defaultClass:"iw0v6k1t"},5:{defaultClass:"iw0v6k1u"},6:{defaultClass:"iw0v6k1v"},7:{defaultClass:"iw0v6k1w"},8:{defaultClass:"iw0v6k1x"},9:{defaultClass:"iw0v6k1y"},10:{defaultClass:"iw0v6k1z"},11:{defaultClass:"iw0v6k20"},12:{defaultClass:"iw0v6k21"},14:{defaultClass:"iw0v6k22"},16:{defaultClass:"iw0v6k23"},20:{defaultClass:"iw0v6k24"},24:{defaultClass:"iw0v6k25"},28:{defaultClass:"iw0v6k26"},32:{defaultClass:"iw0v6k27"},36:{defaultClass:"iw0v6k28"},40:{defaultClass:"iw0v6k29"},44:{defaultClass:"iw0v6k2a"},48:{defaultClass:"iw0v6k2b"},52:{defaultClass:"iw0v6k2c"},56:{defaultClass:"iw0v6k2d"},60:{defaultClass:"iw0v6k2e"},64:{defaultClass:"iw0v6k2f"},72:{defaultClass:"iw0v6k2g"},80:{defaultClass:"iw0v6k2h"},96:{defaultClass:"iw0v6k2i"}}},marginLeft:{values:{0:{defaultClass:"iw0v6k2j"},1:{defaultClass:"iw0v6k2k"},2:{defaultClass:"iw0v6k2l"},3:{defaultClass:"iw0v6k2m"},4:{defaultClass:"iw0v6k2n"},5:{defaultClass:"iw0v6k2o"},6:{defaultClass:"iw0v6k2p"},7:{defaultClass:"iw0v6k2q"},8:{defaultClass:"iw0v6k2r"},9:{defaultClass:"iw0v6k2s"},10:{defaultClass:"iw0v6k2t"},11:{defaultClass:"iw0v6k2u"},12:{defaultClass:"iw0v6k2v"},14:{defaultClass:"iw0v6k2w"},16:{defaultClass:"iw0v6k2x"},20:{defaultClass:"iw0v6k2y"},24:{defaultClass:"iw0v6k2z"},28:{defaultClass:"iw0v6k30"},32:{defaultClass:"iw0v6k31"},36:{defaultClass:"iw0v6k32"},40:{defaultClass:"iw0v6k33"},44:{defaultClass:"iw0v6k34"},48:{defaultClass:"iw0v6k35"},52:{defaultClass:"iw0v6k36"},56:{defaultClass:"iw0v6k37"},60:{defaultClass:"iw0v6k38"},64:{defaultClass:"iw0v6k39"},72:{defaultClass:"iw0v6k3a"},80:{defaultClass:"iw0v6k3b"},96:{defaultClass:"iw0v6k3c"}}},paddingTop:{values:{0:{defaultClass:"iw0v6k3d"},1:{defaultClass:"iw0v6k3e"},2:{defaultClass:"iw0v6k3f"},3:{defaultClass:"iw0v6k3g"},4:{defaultClass:"iw0v6k3h"},5:{defaultClass:"iw0v6k3i"},6:{defaultClass:"iw0v6k3j"},7:{defaultClass:"iw0v6k3k"},8:{defaultClass:"iw0v6k3l"},9:{defaultClass:"iw0v6k3m"},10:{defaultClass:"iw0v6k3n"},11:{defaultClass:"iw0v6k3o"},12:{defaultClass:"iw0v6k3p"},14:{defaultClass:"iw0v6k3q"},16:{defaultClass:"iw0v6k3r"},20:{defaultClass:"iw0v6k3s"},24:{defaultClass:"iw0v6k3t"},28:{defaultClass:"iw0v6k3u"},32:{defaultClass:"iw0v6k3v"},36:{defaultClass:"iw0v6k3w"},40:{defaultClass:"iw0v6k3x"},44:{defaultClass:"iw0v6k3y"},48:{defaultClass:"iw0v6k3z"},52:{defaultClass:"iw0v6k40"},56:{defaultClass:"iw0v6k41"},60:{defaultClass:"iw0v6k42"},64:{defaultClass:"iw0v6k43"},72:{defaultClass:"iw0v6k44"},80:{defaultClass:"iw0v6k45"},96:{defaultClass:"iw0v6k46"}}},paddingRight:{values:{0:{defaultClass:"iw0v6k47"},1:{defaultClass:"iw0v6k48"},2:{defaultClass:"iw0v6k49"},3:{defaultClass:"iw0v6k4a"},4:{defaultClass:"iw0v6k4b"},5:{defaultClass:"iw0v6k4c"},6:{defaultClass:"iw0v6k4d"},7:{defaultClass:"iw0v6k4e"},8:{defaultClass:"iw0v6k4f"},9:{defaultClass:"iw0v6k4g"},10:{defaultClass:"iw0v6k4h"},11:{defaultClass:"iw0v6k4i"},12:{defaultClass:"iw0v6k4j"},14:{defaultClass:"iw0v6k4k"},16:{defaultClass:"iw0v6k4l"},20:{defaultClass:"iw0v6k4m"},24:{defaultClass:"iw0v6k4n"},28:{defaultClass:"iw0v6k4o"},32:{defaultClass:"iw0v6k4p"},36:{defaultClass:"iw0v6k4q"},40:{defaultClass:"iw0v6k4r"},44:{defaultClass:"iw0v6k4s"},48:{defaultClass:"iw0v6k4t"},52:{defaultClass:"iw0v6k4u"},56:{defaultClass:"iw0v6k4v"},60:{defaultClass:"iw0v6k4w"},64:{defaultClass:"iw0v6k4x"},72:{defaultClass:"iw0v6k4y"},80:{defaultClass:"iw0v6k4z"},96:{defaultClass:"iw0v6k50"}}},paddingBottom:{values:{0:{defaultClass:"iw0v6k51"},1:{defaultClass:"iw0v6k52"},2:{defaultClass:"iw0v6k53"},3:{defaultClass:"iw0v6k54"},4:{defaultClass:"iw0v6k55"},5:{defaultClass:"iw0v6k56"},6:{defaultClass:"iw0v6k57"},7:{defaultClass:"iw0v6k58"},8:{defaultClass:"iw0v6k59"},9:{defaultClass:"iw0v6k5a"},10:{defaultClass:"iw0v6k5b"},11:{defaultClass:"iw0v6k5c"},12:{defaultClass:"iw0v6k5d"},14:{defaultClass:"iw0v6k5e"},16:{defaultClass:"iw0v6k5f"},20:{defaultClass:"iw0v6k5g"},24:{defaultClass:"iw0v6k5h"},28:{defaultClass:"iw0v6k5i"},32:{defaultClass:"iw0v6k5j"},36:{defaultClass:"iw0v6k5k"},40:{defaultClass:"iw0v6k5l"},44:{defaultClass:"iw0v6k5m"},48:{defaultClass:"iw0v6k5n"},52:{defaultClass:"iw0v6k5o"},56:{defaultClass:"iw0v6k5p"},60:{defaultClass:"iw0v6k5q"},64:{defaultClass:"iw0v6k5r"},72:{defaultClass:"iw0v6k5s"},80:{defaultClass:"iw0v6k5t"},96:{defaultClass:"iw0v6k5u"}}},paddingLeft:{values:{0:{defaultClass:"iw0v6k5v"},1:{defaultClass:"iw0v6k5w"},2:{defaultClass:"iw0v6k5x"},3:{defaultClass:"iw0v6k5y"},4:{defaultClass:"iw0v6k5z"},5:{defaultClass:"iw0v6k60"},6:{defaultClass:"iw0v6k61"},7:{defaultClass:"iw0v6k62"},8:{defaultClass:"iw0v6k63"},9:{defaultClass:"iw0v6k64"},10:{defaultClass:"iw0v6k65"},11:{defaultClass:"iw0v6k66"},12:{defaultClass:"iw0v6k67"},14:{defaultClass:"iw0v6k68"},16:{defaultClass:"iw0v6k69"},20:{defaultClass:"iw0v6k6a"},24:{defaultClass:"iw0v6k6b"},28:{defaultClass:"iw0v6k6c"},32:{defaultClass:"iw0v6k6d"},36:{defaultClass:"iw0v6k6e"},40:{defaultClass:"iw0v6k6f"},44:{defaultClass:"iw0v6k6g"},48:{defaultClass:"iw0v6k6h"},52:{defaultClass:"iw0v6k6i"},56:{defaultClass:"iw0v6k6j"},60:{defaultClass:"iw0v6k6k"},64:{defaultClass:"iw0v6k6l"},72:{defaultClass:"iw0v6k6m"},80:{defaultClass:"iw0v6k6n"},96:{defaultClass:"iw0v6k6o"}}}}},{conditions:void 0,styles:{borderRadius:{values:{none:{defaultClass:"iw0v6k6p"},sm:{defaultClass:"iw0v6k6q"},base:{defaultClass:"iw0v6k6r"},md:{defaultClass:"iw0v6k6s"},lg:{defaultClass:"iw0v6k6t"},xl:{defaultClass:"iw0v6k6u"},"2xl":{defaultClass:"iw0v6k6v"},"3xl":{defaultClass:"iw0v6k6w"},full:{defaultClass:"iw0v6k6x"}}}}},{conditions:void 0,styles:{boxShadow:{values:{xs:{defaultClass:"iw0v6k6y"},sm:{defaultClass:"iw0v6k6z"},base:{defaultClass:"iw0v6k70"},md:{defaultClass:"iw0v6k71"},lg:{defaultClass:"iw0v6k72"},xl:{defaultClass:"iw0v6k73"},"2xl":{defaultClass:"iw0v6k74"},inner:{defaultClass:"iw0v6k75"},darkLg:{defaultClass:"iw0v6k76"},outline:{defaultClass:"iw0v6k77"}}}}});var c=(e,t)=>{let r={};return t.forEach(a=>{e!=null&&e[a]&&(r[a]=e[a])}),r};var W=require("@snurls/themes"),Fe=e=>{var n,d;let{as:t="div",color:r,background:a,ref:i,className:l,style:o,children:s}=e;return(0,H.createElement)(t,{...e,ref:i,className:(0,M.clsx)([g,u(c(e,Array.from(u.properties))),l]),style:{color:r&&((d=(n=W.vars.colors.$scale)==null?void 0:n.gray)==null?void 0:d[800]),background:a,...o}},s)},K=Fe;var B=require("@snurls/themes"),X=require("react/jsx-runtime"),Ie=({ref:e,color:t="gray",variant:r="solid",size:a=1,orientation:i="horizontal",...l})=>{var s,n,d,f;let o=i==="horizontal"?{width:"100%",borderBottomWidth:a,borderBottomStyle:r,borderBottomColor:t?(n=(s=B.vars.colors.$scale)==null?void 0:s[t])==null?void 0:n[200]:void 0,borderTopWidth:0,borderLeftWidth:0,borderRightWidth:0}:{height:"100%",borderLeftWidth:a,borderLeftStyle:r,borderLeftColor:t?(f=(d=B.vars.colors.$scale)==null?void 0:d[t])==null?void 0:f[200]:void 0,borderTopWidth:0,borderBottomWidth:0,borderRightWidth:0};return(0,X.jsx)("hr",{...l,ref:e,style:{...o,...l.style}})},Y=Ie;var J=require("react"),Q=require("clsx");var Z=require("@snurls/themes"),Ge=e=>{var h,C;let{as:t="div",color:r,background:a,ref:i,className:l,style:o,children:s,align:n,basis:d,direction:f,grow:v,justify:m,wrap:w,gap:p,shrink:k}=e;return(0,J.createElement)(t,{...e,ref:i,className:(0,Q.clsx)([g,u(c(e,Array.from(u.properties))),l]),style:{display:"flex",alignItems:n,justifyContent:m,flexDirection:f,flexWrap:w,flexGrow:v,flexShrink:k,flexBasis:d,gap:p,color:r&&((C=(h=Z.vars.colors.$scale)==null?void 0:h.gray)==null?void 0:C[800]),background:a,...o}},s)},ee=Ge;var te=require("react"),re=require("clsx");var ae=require("@snurls/themes"),Ue=e=>{var C,E;let{ref:t,as:r="div",color:a,background:i,children:l,autoColumns:o,autoFlow:s,autoRows:n,columnGap:d,column:f,gap:v,row:m,rowGap:w,templateColumns:p,templateRows:k,templateAreas:h}=e;return(0,te.createElement)(r,{...e,ref:t,className:(0,re.clsx)([g,u(c(e,Array.from(u.properties))),e.className]),style:{display:"grid",gridAutoColumns:o,gridAutoFlow:s,gridAutoRows:n,gridColumnGap:d,gridGap:v,gridRowGap:w,gridTemplateColumns:p,gridTemplateRows:k,gridTemplateAreas:h,gridColumn:f,gridRow:m,color:a&&((E=(C=ae.vars.colors.$scale)==null?void 0:C.gray)==null?void 0:E[800]),background:i,...e.style}},l)},ie=Ue;var le=require("react"),oe=require("clsx");var se=require("@snurls/themes"),$e=e=>{var p,k;let{ref:t,as:r="div",color:a,background:i,children:l,area:o,colEnd:s,colStart:n,colSpan:d,rowEnd:f,rowStart:v,rowSpan:m}=e,w={gridArea:o,...n!==void 0&&s!==void 0?{gridColumnStart:n,gridColumnEnd:s}:d!==void 0?{gridColumn:`span ${d}`}:{},...v!==void 0&&f!==void 0?{gridRowStart:v,gridRowEnd:f}:m!==void 0?{gridRow:`span ${m}`}:{},color:a&&((k=(p=se.vars.colors.$scale)==null?void 0:p.gray)==null?void 0:k[800]),background:i,...e.style};return(0,le.createElement)(r,{...e,ref:t,className:(0,oe.clsx)([g,u(c(e,Array.from(u.properties))),e.className]),style:w},l)},ne=$e;function _(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function de(e,t){var r=e;for(var a of t){if(!(a in r))throw new Error("Path ".concat(t.join(" -> ")," does not exist in object"));r=r[a]}return r}function N(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a={};for(var i in e){var l=e[i],o=[...r,i];typeof l=="string"||typeof l=="number"||l==null?a[i]=t(l,o):typeof l=="object"&&!Array.isArray(l)?a[i]=N(l,t,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(l)?"Array":typeof l,'"'))}return a}function me(e,t){var r={};if(typeof t=="object"){var a=e;N(t,(s,n)=>{if(s!=null){var d=de(a,n);r[_(d)]=String(s)}})}else{var i=e;for(var l in i){var o=i[l];o!=null&&(r[_(l)]=o)}}return Object.defineProperty(r,"toString",{value:function(){return Object.keys(this).map(n=>"".concat(n,":").concat(this[n])).join(";")},writable:!1}),r}function He(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Me(e){var t=He(e,"string");return typeof t=="symbol"?t:String(t)}function We(e,t,r){return t=Me(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,a)}return r}function ve(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fe(Object(r),!0).forEach(function(a){We(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ue(e,t){var r={};for(var a in e)r[a]=t(e[a],a);return r}var Ke=(e,t,r)=>{for(var a of Object.keys(e)){var i;if(e[a]!==((i=t[a])!==null&&i!==void 0?i:r[a]))return!1}return!0},x=e=>{var t=r=>{var a=e.defaultClassName,i=ve(ve({},e.defaultVariants),r);for(var l in i){var o,s=(o=i[l])!==null&&o!==void 0?o:e.defaultVariants[l];if(s!=null){var n=s;typeof n=="boolean"&&(n=n===!0?"true":"false");var d=e.variantClassNames[l][n];d&&(a+=" "+d)}}for(var[f,v]of e.compoundVariants)Ke(f,i,e.defaultVariants)&&(a+=" "+v);return a};return t.variants=()=>Object.keys(e.variantClassNames),t.classNames={get base(){return e.defaultClassName.split(" ")[0]},get variants(){return ue(e.variantClassNames,r=>ue(r,a=>a.split(" ")[0]))}},t};var pe="var(--lthqn72)",we="var(--lthqn73)",ke=x({defaultClassName:"lthqn74",variantClassNames:{size:{40:"lthqn75",48:"lthqn76",56:"lthqn77"},variant:{solid:"lthqn78",outline:"lthqn79",ghost:"lthqn7a"}},defaultVariants:{},compoundVariants:[]}),ge="var(--lthqn70)",ce="var(--lthqn71)",z=x({defaultClassName:"lthqn7b",variantClassNames:{size:{40:"lthqn7c",48:"lthqn7d",56:"lthqn7e"}},defaultVariants:{},compoundVariants:[]}),he=x({defaultClassName:"lthqn7g",variantClassNames:{size:{40:"lthqn7h",48:"lthqn7i",56:"lthqn7j"}},defaultVariants:{},compoundVariants:[]});var y=require("@snurls/themes");var Ye=e=>{let{elementType:t="button",isDisabled:r,isLoading:a,tabIndex:i,onKeyDown:l,type:o="button"}=e,s=r||a,n=m=>{if(l==null||l(m),m.key===" "||m.key==="Spacebar"||m.key==="32"){if(s||m.defaultPrevented||t==="button")return;m.preventDefault(),m.currentTarget.click();return}if(m.key==="Enter"||m.key==="13"){if(s||m.defaultPrevented||t==="input"&&o!=="button")return;m.preventDefault(),m.currentTarget.click();return}},d={...e,"data-loading":a,tabIndex:s?void 0:i!=null?i:0,onKeyDown:n},f={};switch(t){case"button":{f={type:o!=null?o:"button",disabled:s};break}case"a":{let{href:m,target:w,rel:p}=e;f={role:"button",href:s?void 0:m,target:s?void 0:w,rel:s?void 0:p,"area-disabled":r};break}case"input":{f={role:"button",type:e.type,disabled:s,"area-disabled":void 0};break}default:{f={role:"button",type:o!=null?o:"button","area-disabled":r};break}}return{buttonProps:{...d,...f}}},S=Ye;var O=require("react"),Xe=({isSelected:e=!1})=>{let[t,r]=(0,O.useState)(e),a=(0,O.useCallback)(()=>{r(i=>!i)},[]);return{isSelected:t,setSelected:r,toggle:a}},R=Xe;var Je=(e,t)=>{let{isSelected:r,toggle:a}=R({isSelected:t}),i=o=>{var s;a(),(s=e==null?void 0:e.onClick)==null||s.call(e,o)},{buttonProps:l}=S({...e,onClick:i});return{buttonProps:l,isSelected:r}},Ce=Je;var j=require("react/jsx-runtime"),Qe=e=>{let{buttonProps:t}=S(e),{variant:r="solid",size:a="56",color:i="",width:l,leftIcon:o,rightIcon:s,isLoading:n,children:d,style:f,ref:v}=e,m=y.vars.colors.$scale.primary[400],w=r==="solid"?y.vars.colors.$scale.primary[300]:y.vars.colors.$scale.gray[100],p=r==="solid"?y.vars.colors.$scale.primary[500]:y.vars.colors.$scale.gray[500],k=r==="outline"?y.vars.colors.$scale.gray[400]:"";return(0,j.jsxs)("button",{...t,ref:v,className:ke({size:a,variant:r}),style:{...me({[ge]:m,[ce]:w,[pe]:p,[we]:k}),background:i,width:l,...f},children:[n&&(0,j.jsx)("div",{className:he({size:a})}),o&&(0,j.jsx)("span",{className:z({size:a}),children:o}),(0,j.jsx)("span",{children:d}),s&&(0,j.jsx)("span",{className:z({size:a}),children:s})]})},be=Qe;var ye=require("react");var je=require("clsx");var Se=require("@snurls/themes");var xe=x({defaultClassName:"_12xh8aj0",variantClassNames:{variant:{display1:"_12xh8aj1",display2:"_12xh8aj2",title1:"_12xh8aj3",title2:"_12xh8aj4",title3:"_12xh8aj5",heading1:"_12xh8aj6",heading2:"_12xh8aj7",headline1:"_12xh8aj8",headline2:"_12xh8aj9",body1:"_12xh8aja",body1Reading:"_12xh8ajb",body2:"_12xh8ajc",body2Reading:"_12xh8ajd",label1:"_12xh8aje",label2:"_12xh8ajf",caption1:"_12xh8ajg",caption2:"_12xh8ajh"},defaultVariants:{variant:"body1"}},defaultVariants:{},compoundVariants:[]});var Ze=e=>{var d,f;let{as:t="p",color:r,background:a,ref:i,className:l,style:o,children:s,variant:n}=e;return(0,ye.createElement)(t,{...e,ref:i,className:(0,je.clsx)([g,u(c(e,Array.from(u.properties))),xe({variant:n}),l]),style:{color:r!=null?r:(f=(d=Se.vars.colors.$scale)==null?void 0:d.gray)==null?void 0:f[800],background:a,...o}},s)},Pe=Ze;
2
+ //# sourceMappingURL=index.cjs.map