@simpli-route/apollo-ds 0.0.4 → 0.0.6
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/components/Button/types.d.ts +1 -1
- package/dist/components/Button/variants.d.ts +1 -1
- package/dist/components/Loader/Loader.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs6.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +4 -6
- package/dist/index.es2.js +4 -4
- package/dist/index.es3.js +50 -6
- package/dist/index.es4.js +6 -6
- package/dist/index.es5.js +6 -170
- package/dist/index.es6.js +170 -49
- package/dist/stories/Loader.stories.d.ts +16 -0
- package/dist/style.css +8 -6
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const buttonVariants: (props?: ({
|
|
2
2
|
intent?: "primary" | "secondary" | "tertiary" | "outline" | "success" | "error" | "orangeWarning" | "yellowWarning" | "info" | null | undefined;
|
|
3
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
3
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
4
4
|
isDisabled?: boolean | null | undefined;
|
|
5
5
|
isHovered?: boolean | null | undefined;
|
|
6
6
|
isActive?: boolean | null | undefined;
|
|
@@ -3,4 +3,4 @@ export interface LoaderProps {
|
|
|
3
3
|
label?: string;
|
|
4
4
|
size?: "xs" | "sm" | "md" | "lg";
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare const Loader: ({ className, label, size }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs2.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs2.js"),t=require("./index.cjs3.js");exports.Button=e.Button;exports.Loader=t.Loader;
|
package/dist/index.cjs2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index.cjs4.js"),E=require("react-aria-components"),b=require("./index.cjs5.js"),q=require("./index.cjs6.js"),N=require("./index.cjs3.js"),p=({renderPosition:e,leftIcon:u,rightIcon:c,isLoading:n,loaderPosition:r,loaderProps:s})=>{const a=e==="left"?u:e==="right"?c:null;return a||n&&r===e?t.jsxRuntimeExports.jsx("span",{className:e==="left"?"mr-1":"ml-1",children:n&&r===e?t.jsxRuntimeExports.jsx(N.Loader,{size:"sm",...s}):a}):null},y=e=>{const{intent:u="primary",size:c="md",leftIcon:n,rightIcon:r,isDisabled:s,children:a,className:h,isLoading:i,loaderPosition:x="left",loaderProps:f,fullWidth:R=!1,unstyled:d=!1,focus:j=!0,...g}=e,v=(m,l,o)=>b.cn(d?"":q.buttonVariants({intent:u,size:c,isHovered:l||(j||!d?o:!1),isActive:m,isDisabled:s,isFocused:j||!d?o:!1,fullWidth:R,isLoading:i}),h);return t.jsxRuntimeExports.jsxs(E.Button,{"data-disabled":s||void 0,"data-loading":i||void 0,isDisabled:s,className:({isPressed:m,isHovered:l,isFocusVisible:o})=>v(m,l,o),...g,children:[t.jsxRuntimeExports.jsx(p,{renderPosition:"left",loaderPosition:x,loaderProps:f,isLoading:i,leftIcon:n}),t.jsxRuntimeExports.jsx("span",{className:"flex h-full items-center overflow-hidden whitespace-nowrap",children:a}),t.jsxRuntimeExports.jsx(p,{renderPosition:"right",loaderPosition:x,loaderProps:f,isLoading:i,rightIcon:r})]})};exports.Button=y;
|
package/dist/index.cjs3.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs4.js"),a=require("react-aria"),l=require("./index.cjs5.js"),u=({className:t,label:s,size:r="sm"})=>{const n=(()=>{switch(r){case"xs":return"h-4 w-4 ";case"sm":return"h-8 w-8";case"md":return"h-12 w-12";case"lg":return"h-16 w-16";default:return"h-8 w-8"}})(),{visuallyHiddenProps:i}=a.useVisuallyHidden();return e.jsxRuntimeExports.jsxs("div",{role:"status",className:"flex flex-col items-center justify-center gap-1",children:[e.jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",className:l.cn(n,"mr-2 animate-spin fill-primary-500 text-neutral-500",t),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),s&&e.jsxRuntimeExports.jsx("span",{className:"text-base leading-6 text-primary-900",children:s}),e.jsxRuntimeExports.jsx("span",{...i,children:"..."})]})};exports.Loader=u;
|
package/dist/index.cjs4.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs7.js"),r=require("./index.cjs8.js"),t=require("./index.cjs9.js");process.env.NODE_ENV==="production"?e.__module.exports=r.__require():e.__module.exports=t.__require();var o=e.__module.exports;exports.jsxRuntimeExports=o;
|
package/dist/index.cjs5.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("clsx"),t=require("tailwind-merge");function n(...e){return t.twMerge(r.clsx(e))}exports.cn=n;
|
package/dist/index.cjs6.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("class-variance-authority"),e=r.cva("inline-flex select-none items-center justify-center text-center text-base font-semibold leading-6 transition duration-150 ease-in-out focus:outline-none",{variants:{intent:{primary:"bg-primary-500 text-primary-50",secondary:"border border-primary-500 bg-primary-50 text-primary-500",tertiary:"text-primary-500",outline:"border border-primary-500 text-primary-500",success:"border border-success-800 text-success-800",error:"border border-error-800 text-error-800",orangeWarning:"border border-orange-warning-800 text-orange-warning-800",yellowWarning:"border border-yellow-warning-800 text-yellow-warning-800",info:"border border-primary-800 text-primary-800"},size:{xs:"rounded px-3 py-1",sm:"rounded px-3 py-2",md:"rounded-lg px-4 py-3",lg:"rounded-lg px-6 py-4"},isDisabled:{true:"pointer-events-none cursor-not-allowed border-none bg-neutral-400 text-neutral-600"},isHovered:{true:""},isActive:{true:""},fullWidth:{true:"w-full",false:"w-fit"},isLoading:{true:"pointer-events-none cursor-not-allowed opacity-70"},isFocused:{true:"focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-[0.4px] border-none",false:""}},defaultVariants:{intent:"primary",size:"md"},compoundVariants:[{intent:"primary",isHovered:!0,class:"bg-primary-700"},{intent:"secondary",isHovered:!0,class:"bg-primary-200"},{intent:"tertiary",isHovered:!0,class:"bg-primary-300 text-primary-800"},{intent:"outline",isHovered:!0,class:"bg-primary-500 text-primary-50"},{intent:"success",isHovered:!0,class:"bg-success-600 text-neutral-50"},{intent:"error",isHovered:!0,class:"bg-error-600 text-neutral-50"},{intent:"orangeWarning",isHovered:!0,class:"bg-orange-warning-600 text-neutral-50"},{intent:"yellowWarning",isHovered:!0,class:"bg-yellow-warning-600 text-neutral-50"},{intent:"info",isHovered:!0,class:"bg-primary-600 text-neutral-50"},{intent:"success",isFocused:!0,class:"border-[1.5px] focus:ring-success-800"},{intent:"error",isFocused:!0,class:"border-[1.5px] focus:ring-error-800"},{intent:"orangeWarning",isFocused:!0,class:"border-[1.5px] focus:ring-orange-800"},{intent:"yellowWarning",isFocused:!0,class:"border-[1.5px] focus:ring-yellow-800"},{intent:"info",isFocused:!0,class:"border-[1.5px] focus:ring-primary-800"},{intent:"primary",isActive:!0,class:"bg-primary-900"},{intent:"secondary",isActive:!0,class:"bg-primary-300"},{intent:"tertiary",isActive:!0,class:"bg-primary-500 text-white"},{intent:"outline",isActive:!0,class:"border border-primary-500 bg-primary-300 text-primary-500"},{intent:"success",isActive:!0,class:"border border-transparent bg-success-300 text-success-600"},{intent:"error",isActive:!0,class:"border border-transparent bg-error-300 text-error-600"},{intent:"orangeWarning",isActive:!0,class:"border border-transparent bg-orange-warning-300 text-orange-warning-600"},{intent:"yellowWarning",isActive:!0,class:"border border-transparent bg-yellow-warning-300 text-yellow-warning-600"},{intent:"info",isActive:!0,class:"border border-transparent bg-primary-300 text-primary-600"}]});exports.buttonVariants=e;
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Button, type
|
|
1
|
+
export { type BtnProps, Button, Loader, type LoaderProps } from './components';
|
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import "./index.es3.js";
|
|
3
|
-
import "react-aria";
|
|
4
|
-
import "clsx";
|
|
5
|
-
import "tailwind-merge";
|
|
1
|
+
import { Button as t } from "./index.es2.js";
|
|
2
|
+
import { Loader as f } from "./index.es3.js";
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
t as Button,
|
|
5
|
+
f as Loader
|
|
8
6
|
};
|
package/dist/index.es2.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as t } from "./index.
|
|
1
|
+
import { j as t } from "./index.es4.js";
|
|
2
2
|
import { Button as I } from "react-aria-components";
|
|
3
|
-
import { cn as b } from "./index.
|
|
4
|
-
import { buttonVariants as w } from "./index.
|
|
5
|
-
import { Loader as B } from "./index.
|
|
3
|
+
import { cn as b } from "./index.es5.js";
|
|
4
|
+
import { buttonVariants as w } from "./index.es6.js";
|
|
5
|
+
import { Loader as B } from "./index.es3.js";
|
|
6
6
|
const x = ({
|
|
7
7
|
renderPosition: s,
|
|
8
8
|
leftIcon: m,
|
package/dist/index.es3.js
CHANGED
|
@@ -1,8 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { j as e } from "./index.es4.js";
|
|
2
|
+
import { useVisuallyHidden as a } from "react-aria";
|
|
3
|
+
import { cn as l } from "./index.es5.js";
|
|
4
|
+
const d = ({ className: s, label: r, size: t = "sm" }) => {
|
|
5
|
+
const i = (() => {
|
|
6
|
+
switch (t) {
|
|
7
|
+
case "xs":
|
|
8
|
+
return "h-4 w-4 ";
|
|
9
|
+
case "sm":
|
|
10
|
+
return "h-8 w-8";
|
|
11
|
+
case "md":
|
|
12
|
+
return "h-12 w-12";
|
|
13
|
+
case "lg":
|
|
14
|
+
return "h-16 w-16";
|
|
15
|
+
default:
|
|
16
|
+
return "h-8 w-8";
|
|
17
|
+
}
|
|
18
|
+
})(), { visuallyHiddenProps: n } = a();
|
|
19
|
+
return /* @__PURE__ */ e.jsxs("div", { role: "status", className: "flex flex-col items-center justify-center gap-1", children: [
|
|
20
|
+
/* @__PURE__ */ e.jsxs(
|
|
21
|
+
"svg",
|
|
22
|
+
{
|
|
23
|
+
"aria-hidden": "true",
|
|
24
|
+
className: l(i, "mr-2 animate-spin fill-primary-500 text-neutral-500", s),
|
|
25
|
+
viewBox: "0 0 100 101",
|
|
26
|
+
fill: "none",
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ e.jsx(
|
|
30
|
+
"path",
|
|
31
|
+
{
|
|
32
|
+
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
33
|
+
fill: "currentColor"
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ e.jsx(
|
|
37
|
+
"path",
|
|
38
|
+
{
|
|
39
|
+
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
40
|
+
fill: "currentFill"
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "text-base leading-6 text-primary-900", children: r }),
|
|
47
|
+
/* @__PURE__ */ e.jsx("span", { ...n, children: "..." })
|
|
48
|
+
] });
|
|
49
|
+
};
|
|
6
50
|
export {
|
|
7
|
-
|
|
51
|
+
d as Loader
|
|
8
52
|
};
|
package/dist/index.es4.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { __module as e } from "./index.es7.js";
|
|
2
|
+
import { __require as r } from "./index.es8.js";
|
|
3
|
+
import { __require as o } from "./index.es9.js";
|
|
4
|
+
process.env.NODE_ENV === "production" ? e.exports = r() : e.exports = o();
|
|
5
|
+
var m = e.exports;
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as j
|
|
8
8
|
};
|
package/dist/index.es5.js
CHANGED
|
@@ -1,172 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
intent: {
|
|
7
|
-
primary: "bg-primary-500 text-primary-50",
|
|
8
|
-
secondary: "border border-primary-500 bg-primary-50 text-primary-500",
|
|
9
|
-
tertiary: "text-primary-500",
|
|
10
|
-
outline: "border border-primary-500 text-primary-500",
|
|
11
|
-
success: "border border-success-800 text-success-800",
|
|
12
|
-
error: "border border-error-800 text-error-800",
|
|
13
|
-
orangeWarning: "border border-orange-warning-800 text-orange-warning-800",
|
|
14
|
-
yellowWarning: "border border-yellow-warning-800 text-yellow-warning-800",
|
|
15
|
-
info: "border border-primary-800 text-primary-800"
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
sm: "rounded px-3 py-2",
|
|
19
|
-
md: "rounded-lg px-4 py-3",
|
|
20
|
-
lg: "rounded-lg px-6 py-4"
|
|
21
|
-
},
|
|
22
|
-
isDisabled: {
|
|
23
|
-
true: "pointer-events-none cursor-not-allowed border-none bg-neutral-400 text-neutral-600"
|
|
24
|
-
},
|
|
25
|
-
isHovered: {
|
|
26
|
-
true: ""
|
|
27
|
-
},
|
|
28
|
-
isActive: {
|
|
29
|
-
true: ""
|
|
30
|
-
},
|
|
31
|
-
fullWidth: {
|
|
32
|
-
true: "w-full",
|
|
33
|
-
false: "w-fit"
|
|
34
|
-
},
|
|
35
|
-
isLoading: {
|
|
36
|
-
true: "pointer-events-none cursor-not-allowed opacity-70"
|
|
37
|
-
},
|
|
38
|
-
isFocused: {
|
|
39
|
-
true: "focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-[0.4px] border-none",
|
|
40
|
-
false: ""
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
defaultVariants: {
|
|
44
|
-
intent: "primary",
|
|
45
|
-
size: "md"
|
|
46
|
-
},
|
|
47
|
-
compoundVariants: [
|
|
48
|
-
/* Hover State */
|
|
49
|
-
{
|
|
50
|
-
intent: "primary",
|
|
51
|
-
isHovered: !0,
|
|
52
|
-
class: "bg-primary-700"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
intent: "secondary",
|
|
56
|
-
isHovered: !0,
|
|
57
|
-
class: "bg-primary-200"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
intent: "tertiary",
|
|
61
|
-
isHovered: !0,
|
|
62
|
-
class: "bg-primary-300 text-primary-800"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
intent: "outline",
|
|
66
|
-
isHovered: !0,
|
|
67
|
-
class: "bg-primary-500 text-primary-50"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
intent: "success",
|
|
71
|
-
isHovered: !0,
|
|
72
|
-
class: "bg-success-600 text-neutral-50"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
intent: "error",
|
|
76
|
-
isHovered: !0,
|
|
77
|
-
class: "bg-error-600 text-neutral-50"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
intent: "orangeWarning",
|
|
81
|
-
isHovered: !0,
|
|
82
|
-
class: "bg-orange-warning-600 text-neutral-50"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
intent: "yellowWarning",
|
|
86
|
-
isHovered: !0,
|
|
87
|
-
class: "bg-yellow-warning-600 text-neutral-50"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
intent: "info",
|
|
91
|
-
isHovered: !0,
|
|
92
|
-
class: "bg-primary-600 text-neutral-50"
|
|
93
|
-
},
|
|
94
|
-
/* /Focus State */
|
|
95
|
-
{
|
|
96
|
-
intent: "success",
|
|
97
|
-
isFocused: !0,
|
|
98
|
-
class: "border-[1.5px] focus:ring-success-800"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
intent: "error",
|
|
102
|
-
isFocused: !0,
|
|
103
|
-
class: "border-[1.5px] focus:ring-error-800"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
intent: "orangeWarning",
|
|
107
|
-
isFocused: !0,
|
|
108
|
-
class: "border-[1.5px] focus:ring-orange-800"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
intent: "yellowWarning",
|
|
112
|
-
isFocused: !0,
|
|
113
|
-
class: "border-[1.5px] focus:ring-yellow-800"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
intent: "info",
|
|
117
|
-
isFocused: !0,
|
|
118
|
-
class: "border-[1.5px] focus:ring-primary-800"
|
|
119
|
-
},
|
|
120
|
-
/* Active State */
|
|
121
|
-
{
|
|
122
|
-
intent: "primary",
|
|
123
|
-
isActive: !0,
|
|
124
|
-
class: "bg-primary-900"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
intent: "secondary",
|
|
128
|
-
isActive: !0,
|
|
129
|
-
class: "bg-primary-300"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
intent: "tertiary",
|
|
133
|
-
isActive: !0,
|
|
134
|
-
class: "bg-primary-500 text-white"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
intent: "outline",
|
|
138
|
-
isActive: !0,
|
|
139
|
-
class: "border border-primary-500 bg-primary-300 text-primary-500"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
intent: "success",
|
|
143
|
-
isActive: !0,
|
|
144
|
-
class: "border border-transparent bg-success-300 text-success-600"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
intent: "error",
|
|
148
|
-
isActive: !0,
|
|
149
|
-
class: "border border-transparent bg-error-300 text-error-600"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
intent: "orangeWarning",
|
|
153
|
-
isActive: !0,
|
|
154
|
-
class: "border border-transparent bg-orange-warning-300 text-orange-warning-600"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
intent: "yellowWarning",
|
|
158
|
-
isActive: !0,
|
|
159
|
-
class: "border border-transparent bg-yellow-warning-300 text-yellow-warning-600"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
intent: "info",
|
|
163
|
-
isActive: !0,
|
|
164
|
-
class: "border border-transparent bg-primary-300 text-primary-600"
|
|
165
|
-
}
|
|
166
|
-
/* /Active State */
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
);
|
|
1
|
+
import { clsx as o } from "clsx";
|
|
2
|
+
import { twMerge as t } from "tailwind-merge";
|
|
3
|
+
function n(...r) {
|
|
4
|
+
return t(o(r));
|
|
5
|
+
}
|
|
170
6
|
export {
|
|
171
|
-
|
|
7
|
+
n as cn
|
|
172
8
|
};
|
package/dist/index.es6.js
CHANGED
|
@@ -1,52 +1,173 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
)
|
|
43
|
-
]
|
|
1
|
+
import { cva as r } from "class-variance-authority";
|
|
2
|
+
const t = r(
|
|
3
|
+
"inline-flex select-none items-center justify-center text-center text-base font-semibold leading-6 transition duration-150 ease-in-out focus:outline-none",
|
|
4
|
+
{
|
|
5
|
+
variants: {
|
|
6
|
+
intent: {
|
|
7
|
+
primary: "bg-primary-500 text-primary-50",
|
|
8
|
+
secondary: "border border-primary-500 bg-primary-50 text-primary-500",
|
|
9
|
+
tertiary: "text-primary-500",
|
|
10
|
+
outline: "border border-primary-500 text-primary-500",
|
|
11
|
+
success: "border border-success-800 text-success-800",
|
|
12
|
+
error: "border border-error-800 text-error-800",
|
|
13
|
+
orangeWarning: "border border-orange-warning-800 text-orange-warning-800",
|
|
14
|
+
yellowWarning: "border border-yellow-warning-800 text-yellow-warning-800",
|
|
15
|
+
info: "border border-primary-800 text-primary-800"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
xs: "rounded px-3 py-1",
|
|
19
|
+
sm: "rounded px-3 py-2",
|
|
20
|
+
md: "rounded-lg px-4 py-3",
|
|
21
|
+
lg: "rounded-lg px-6 py-4"
|
|
22
|
+
},
|
|
23
|
+
isDisabled: {
|
|
24
|
+
true: "pointer-events-none cursor-not-allowed border-none bg-neutral-400 text-neutral-600"
|
|
25
|
+
},
|
|
26
|
+
isHovered: {
|
|
27
|
+
true: ""
|
|
28
|
+
},
|
|
29
|
+
isActive: {
|
|
30
|
+
true: ""
|
|
31
|
+
},
|
|
32
|
+
fullWidth: {
|
|
33
|
+
true: "w-full",
|
|
34
|
+
false: "w-fit"
|
|
35
|
+
},
|
|
36
|
+
isLoading: {
|
|
37
|
+
true: "pointer-events-none cursor-not-allowed opacity-70"
|
|
38
|
+
},
|
|
39
|
+
isFocused: {
|
|
40
|
+
true: "focus:outline-none focus:ring-2 focus:ring-sky-400 focus:ring-offset-[0.4px] border-none",
|
|
41
|
+
false: ""
|
|
44
42
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
intent: "primary",
|
|
46
|
+
size: "md"
|
|
47
|
+
},
|
|
48
|
+
compoundVariants: [
|
|
49
|
+
/* Hover State */
|
|
50
|
+
{
|
|
51
|
+
intent: "primary",
|
|
52
|
+
isHovered: !0,
|
|
53
|
+
class: "bg-primary-700"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
intent: "secondary",
|
|
57
|
+
isHovered: !0,
|
|
58
|
+
class: "bg-primary-200"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
intent: "tertiary",
|
|
62
|
+
isHovered: !0,
|
|
63
|
+
class: "bg-primary-300 text-primary-800"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
intent: "outline",
|
|
67
|
+
isHovered: !0,
|
|
68
|
+
class: "bg-primary-500 text-primary-50"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
intent: "success",
|
|
72
|
+
isHovered: !0,
|
|
73
|
+
class: "bg-success-600 text-neutral-50"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
intent: "error",
|
|
77
|
+
isHovered: !0,
|
|
78
|
+
class: "bg-error-600 text-neutral-50"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
intent: "orangeWarning",
|
|
82
|
+
isHovered: !0,
|
|
83
|
+
class: "bg-orange-warning-600 text-neutral-50"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
intent: "yellowWarning",
|
|
87
|
+
isHovered: !0,
|
|
88
|
+
class: "bg-yellow-warning-600 text-neutral-50"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
intent: "info",
|
|
92
|
+
isHovered: !0,
|
|
93
|
+
class: "bg-primary-600 text-neutral-50"
|
|
94
|
+
},
|
|
95
|
+
/* /Focus State */
|
|
96
|
+
{
|
|
97
|
+
intent: "success",
|
|
98
|
+
isFocused: !0,
|
|
99
|
+
class: "border-[1.5px] focus:ring-success-800"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
intent: "error",
|
|
103
|
+
isFocused: !0,
|
|
104
|
+
class: "border-[1.5px] focus:ring-error-800"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
intent: "orangeWarning",
|
|
108
|
+
isFocused: !0,
|
|
109
|
+
class: "border-[1.5px] focus:ring-orange-800"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
intent: "yellowWarning",
|
|
113
|
+
isFocused: !0,
|
|
114
|
+
class: "border-[1.5px] focus:ring-yellow-800"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
intent: "info",
|
|
118
|
+
isFocused: !0,
|
|
119
|
+
class: "border-[1.5px] focus:ring-primary-800"
|
|
120
|
+
},
|
|
121
|
+
/* Active State */
|
|
122
|
+
{
|
|
123
|
+
intent: "primary",
|
|
124
|
+
isActive: !0,
|
|
125
|
+
class: "bg-primary-900"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
intent: "secondary",
|
|
129
|
+
isActive: !0,
|
|
130
|
+
class: "bg-primary-300"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
intent: "tertiary",
|
|
134
|
+
isActive: !0,
|
|
135
|
+
class: "bg-primary-500 text-white"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
intent: "outline",
|
|
139
|
+
isActive: !0,
|
|
140
|
+
class: "border border-primary-500 bg-primary-300 text-primary-500"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
intent: "success",
|
|
144
|
+
isActive: !0,
|
|
145
|
+
class: "border border-transparent bg-success-300 text-success-600"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
intent: "error",
|
|
149
|
+
isActive: !0,
|
|
150
|
+
class: "border border-transparent bg-error-300 text-error-600"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
intent: "orangeWarning",
|
|
154
|
+
isActive: !0,
|
|
155
|
+
class: "border border-transparent bg-orange-warning-300 text-orange-warning-600"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
intent: "yellowWarning",
|
|
159
|
+
isActive: !0,
|
|
160
|
+
class: "border border-transparent bg-yellow-warning-300 text-yellow-warning-600"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
intent: "info",
|
|
164
|
+
isActive: !0,
|
|
165
|
+
class: "border border-transparent bg-primary-300 text-primary-600"
|
|
166
|
+
}
|
|
167
|
+
/* /Active State */
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
);
|
|
50
171
|
export {
|
|
51
|
-
|
|
172
|
+
t as buttonVariants
|
|
52
173
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ className, label, size }: import('../components').LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Large: Story;
|
|
14
|
+
export declare const Medium: Story;
|
|
15
|
+
export declare const Small: Story;
|
|
16
|
+
export declare const ExtraSmall: Story;
|
package/dist/style.css
CHANGED
|
@@ -753,6 +753,10 @@ select {
|
|
|
753
753
|
.inline-flex {
|
|
754
754
|
display: inline-flex;
|
|
755
755
|
}
|
|
756
|
+
.size-6 {
|
|
757
|
+
width: 1.5rem;
|
|
758
|
+
height: 1.5rem;
|
|
759
|
+
}
|
|
756
760
|
.h-12 {
|
|
757
761
|
height: 3rem;
|
|
758
762
|
}
|
|
@@ -762,9 +766,6 @@ select {
|
|
|
762
766
|
.h-4 {
|
|
763
767
|
height: 1rem;
|
|
764
768
|
}
|
|
765
|
-
.h-6 {
|
|
766
|
-
height: 1.5rem;
|
|
767
|
-
}
|
|
768
769
|
.h-8 {
|
|
769
770
|
height: 2rem;
|
|
770
771
|
}
|
|
@@ -780,9 +781,6 @@ select {
|
|
|
780
781
|
.w-4 {
|
|
781
782
|
width: 1rem;
|
|
782
783
|
}
|
|
783
|
-
.w-6 {
|
|
784
|
-
width: 1.5rem;
|
|
785
|
-
}
|
|
786
784
|
.w-8 {
|
|
787
785
|
width: 2rem;
|
|
788
786
|
}
|
|
@@ -959,6 +957,10 @@ select {
|
|
|
959
957
|
padding-left: 1.5rem;
|
|
960
958
|
padding-right: 1.5rem;
|
|
961
959
|
}
|
|
960
|
+
.py-1 {
|
|
961
|
+
padding-top: 0.25rem;
|
|
962
|
+
padding-bottom: 0.25rem;
|
|
963
|
+
}
|
|
962
964
|
.py-2 {
|
|
963
965
|
padding-top: 0.5rem;
|
|
964
966
|
padding-bottom: 0.5rem;
|