@motiadev/ui 0.13.0 → 0.13.1-beta.163-660633
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 +93 -21
- package/dist/components/ui/background-effect.d.ts +7 -4
- package/dist/components/ui/background-effect.d.ts.map +1 -1
- package/dist/components/ui/background-effect.js +31 -0
- package/dist/components/ui/background-effect.js.map +1 -0
- package/dist/components/ui/badge.d.ts +11 -8
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +57 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +24 -20
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +168 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button.d.ts +14 -9
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +88 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +7 -3
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +53 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible-panel.d.ts +17 -13
- package/dist/components/ui/collapsible-panel.d.ts.map +1 -1
- package/dist/components/ui/collapsible-panel.js +252 -0
- package/dist/components/ui/collapsible-panel.js.map +1 -0
- package/dist/components/ui/container.d.ts +17 -13
- package/dist/components/ui/container.d.ts.map +1 -1
- package/dist/components/ui/container.js +143 -0
- package/dist/components/ui/container.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +23 -21
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +430 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +36 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +219 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/input.d.ts +12 -8
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +66 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.d.ts +7 -3
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +43 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/level-dot.d.ts +7 -3
- package/dist/components/ui/level-dot.d.ts.map +1 -1
- package/dist/components/ui/level-dot.js +35 -0
- package/dist/components/ui/level-dot.js.map +1 -0
- package/dist/components/ui/panel.d.ts +32 -28
- package/dist/components/ui/panel.d.ts.map +1 -1
- package/dist/components/ui/panel.js +284 -0
- package/dist/components/ui/panel.js.map +1 -0
- package/dist/components/ui/select.d.ts +11 -13
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +341 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/side-panel-detail.d.ts +8 -5
- package/dist/components/ui/side-panel-detail.d.ts.map +1 -1
- package/dist/components/ui/side-panel-detail.js +54 -0
- package/dist/components/ui/side-panel-detail.js.map +1 -0
- package/dist/components/ui/side-panel.d.ts +18 -18
- package/dist/components/ui/side-panel.d.ts.map +1 -1
- package/dist/components/ui/side-panel.js +138 -0
- package/dist/components/ui/side-panel.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +12 -8
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +153 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/table.d.ts +5 -4
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +285 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +10 -6
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +142 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -2
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +42 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +10 -5
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +54 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/index.d.ts +24 -23
- package/dist/index.js +25 -10946
- package/dist/lib/utils.d.ts +6 -2
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/stores/use-theme-store.d.ts +22 -17
- package/dist/stores/use-theme-store.d.ts.map +1 -1
- package/dist/stores/use-theme-store.js +30 -0
- package/dist/stores/use-theme-store.js.map +1 -0
- package/dist/styles.css +2647 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.js +0 -0
- package/package.json +13 -15
- package/dist/components/ui/background-effect.stories.d.ts +0 -12
- package/dist/components/ui/background-effect.stories.d.ts.map +0 -1
- package/dist/components/ui/badge.stories.d.ts +0 -19
- package/dist/components/ui/badge.stories.d.ts.map +0 -1
- package/dist/components/ui/breadcrumb.stories.d.ts +0 -21
- package/dist/components/ui/breadcrumb.stories.d.ts.map +0 -1
- package/dist/components/ui/button.stories.d.ts +0 -25
- package/dist/components/ui/button.stories.d.ts.map +0 -1
- package/dist/components/ui/checkbox.stories.d.ts +0 -25
- package/dist/components/ui/checkbox.stories.d.ts.map +0 -1
- package/dist/components/ui/collapsible-panel.stories.d.ts +0 -12
- package/dist/components/ui/collapsible-panel.stories.d.ts.map +0 -1
- package/dist/components/ui/container.stories.d.ts +0 -10
- package/dist/components/ui/container.stories.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.stories.d.ts +0 -18
- package/dist/components/ui/dropdown-menu.stories.d.ts.map +0 -1
- package/dist/components/ui/input.stories.d.ts +0 -23
- package/dist/components/ui/input.stories.d.ts.map +0 -1
- package/dist/components/ui/label.stories.d.ts +0 -17
- package/dist/components/ui/label.stories.d.ts.map +0 -1
- package/dist/components/ui/level-dot.stories.d.ts +0 -19
- package/dist/components/ui/level-dot.stories.d.ts.map +0 -1
- package/dist/components/ui/panel.stories.d.ts +0 -24
- package/dist/components/ui/panel.stories.d.ts.map +0 -1
- package/dist/components/ui/select.stories.d.ts +0 -18
- package/dist/components/ui/select.stories.d.ts.map +0 -1
- package/dist/components/ui/side-panel-detail.stories.d.ts +0 -12
- package/dist/components/ui/side-panel-detail.stories.d.ts.map +0 -1
- package/dist/components/ui/side-panel.stories.d.ts +0 -13
- package/dist/components/ui/side-panel.stories.d.ts.map +0 -1
- package/dist/components/ui/sidebar.stories.d.ts +0 -14
- package/dist/components/ui/sidebar.stories.d.ts.map +0 -1
- package/dist/components/ui/table.stories.d.ts +0 -18
- package/dist/components/ui/table.stories.d.ts.map +0 -1
- package/dist/components/ui/tabs.stories.d.ts +0 -16
- package/dist/components/ui/tabs.stories.d.ts.map +0 -1
- package/dist/components/ui/textarea.stories.d.ts +0 -21
- package/dist/components/ui/textarea.stories.d.ts.map +0 -1
- package/dist/components/ui/tooltip.stories.d.ts +0 -21
- package/dist/components/ui/tooltip.stories.d.ts.map +0 -1
- package/dist/index.cjs +0 -122
- package/dist/index.d.ts.map +0 -1
- package/dist/ui.css +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Elastic License 2.0
|
|
2
|
+
|
|
3
|
+
URL: https://www.elastic.co/licensing/elastic-license
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
12
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
13
|
+
available, and prepare derivative works of the software, in each case subject
|
|
14
|
+
to the limitations and conditions below.
|
|
15
|
+
|
|
16
|
+
## Limitations
|
|
17
|
+
|
|
18
|
+
You may not provide the software to third parties as a hosted or managed
|
|
19
|
+
service, where the service provides users with access to any substantial set of
|
|
20
|
+
the features or functionality of the software.
|
|
21
|
+
|
|
22
|
+
You may not move, change, disable, or circumvent the license key functionality
|
|
23
|
+
in the software, and you may not remove or obscure any functionality in the
|
|
24
|
+
software that is protected by the license key.
|
|
25
|
+
|
|
26
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
27
|
+
of the licensor in the software. Any use of the licensor's trademarks is subject
|
|
28
|
+
to applicable law.
|
|
29
|
+
|
|
30
|
+
## Patents
|
|
31
|
+
|
|
32
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
33
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
34
|
+
sale, import and have imported the software, in each case subject to the
|
|
35
|
+
limitations and conditions in this license. This license does not cover any
|
|
36
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
37
|
+
the software. If you or your company make any written claim that the software
|
|
38
|
+
infringes or contributes to infringement of any patent, your patent license for
|
|
39
|
+
the software granted under these terms ends immediately. If your company makes
|
|
40
|
+
such a claim, your patent license ends immediately for work on behalf of your
|
|
41
|
+
company.
|
|
42
|
+
|
|
43
|
+
## Notices
|
|
44
|
+
|
|
45
|
+
You must ensure that anyone who gets a copy of any part of the software from you
|
|
46
|
+
also gets a copy of these terms.
|
|
47
|
+
|
|
48
|
+
If you modify the software, you must include in any modified copies of the
|
|
49
|
+
software prominent notices stating that you have modified the software.
|
|
50
|
+
|
|
51
|
+
## No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
54
|
+
these terms.
|
|
55
|
+
|
|
56
|
+
## Termination
|
|
57
|
+
|
|
58
|
+
If you use the software in violation of these terms, such use is not licensed,
|
|
59
|
+
and your licenses will automatically terminate. If the licensor provides you
|
|
60
|
+
with a notice of your violation, and you cease all violation of this license no
|
|
61
|
+
later than 30 days after you receive that notice, your licenses will be
|
|
62
|
+
reinstated retroactively. However, if you violate these terms after such
|
|
63
|
+
reinstatement, any additional violation of these terms will cause your licenses
|
|
64
|
+
to terminate automatically and permanently.
|
|
65
|
+
|
|
66
|
+
## No Liability
|
|
67
|
+
|
|
68
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
69
|
+
condition, and the licensor will not be liable to you for any damages arising
|
|
70
|
+
out of these terms or the use or nature of the software, under any kind of
|
|
71
|
+
legal claim.*
|
|
72
|
+
|
|
73
|
+
## Definitions
|
|
74
|
+
|
|
75
|
+
The **licensor** is the entity offering these terms, and the **software** is the
|
|
76
|
+
software the licensor makes available under these terms, including any portion
|
|
77
|
+
of it.
|
|
78
|
+
|
|
79
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
80
|
+
|
|
81
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
82
|
+
organization that you work for, plus all organizations that have control over,
|
|
83
|
+
are under the control of, or are under common control with that organization.
|
|
84
|
+
**control** means ownership of substantially all the assets of an entity, or the
|
|
85
|
+
power to direct its management and policies by vote, contract, or otherwise.
|
|
86
|
+
Control can be direct or indirect.
|
|
87
|
+
|
|
88
|
+
**your licenses** are all the licenses granted to you for the software under
|
|
89
|
+
these terms.
|
|
90
|
+
|
|
91
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
92
|
+
|
|
93
|
+
**trademark** means trademarks, service marks, and similar rights.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/ui/background-effect.d.ts
|
|
2
4
|
type PatternType = 'subtle';
|
|
3
5
|
type BackgroundEffectProps = {
|
|
4
|
-
|
|
6
|
+
patternType?: PatternType;
|
|
5
7
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
declare const BackgroundEffect: React.FC<BackgroundEffectProps>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BackgroundEffect };
|
|
8
11
|
//# sourceMappingURL=background-effect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-effect.d.ts","
|
|
1
|
+
{"version":3,"file":"background-effect.d.ts","names":[],"sources":["../../../src/components/ui/background-effect.tsx"],"sourcesContent":[],"mappings":";;;KAGK,WAAA;KAEA,qBAAA;EAFA,WAAA,CAAA,EAGW,WAHA;AAAA,CAAA;AAaH,cAAA,gBAA2B,EAAT,KAAA,CAAM,EAAG,CAAA,qBAAD,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ui/background-effect.tsx
|
|
5
|
+
const types = { subtle: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: "100%"
|
|
8
|
+
} };
|
|
9
|
+
const BackgroundEffect = (t0) => {
|
|
10
|
+
const $ = c(2);
|
|
11
|
+
const { patternType: t1 } = t0;
|
|
12
|
+
const style = types[t1 === void 0 ? "subtle" : t1];
|
|
13
|
+
let t2;
|
|
14
|
+
if ($[0] !== style) {
|
|
15
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
className: "absolute top-0 h-full w-full inset-x-0 -z-10 transform-gpu overflow-hidden pointer-events-none",
|
|
18
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
19
|
+
style,
|
|
20
|
+
className: "relative -z-10 aspect-1155/678 bg-linear-to-br from-white/60 to-[#050505] opacity-10 pointer-events-none"
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
$[0] = style;
|
|
24
|
+
$[1] = t2;
|
|
25
|
+
} else t2 = $[1];
|
|
26
|
+
return t2;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { BackgroundEffect };
|
|
31
|
+
//# sourceMappingURL=background-effect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-effect.js","names":["React","CSSProperties","PatternType","BackgroundEffectProps","patternType","types","Record","subtle","width","height","BackgroundEffect","FC","t0","$","_c","t1","undefined","style","t2"],"sources":["../../../src/components/ui/background-effect.tsx"],"sourcesContent":["import type React from 'react'\nimport type { CSSProperties } from 'react'\n\ntype PatternType = 'subtle'\n\ntype BackgroundEffectProps = {\n patternType?: PatternType\n}\n\nconst types: Record<PatternType, CSSProperties> = {\n subtle: {\n width: '100%',\n height: '100%',\n },\n}\n\nexport const BackgroundEffect: React.FC<BackgroundEffectProps> = ({ patternType = 'subtle' }) => {\n const style = types[patternType]\n\n return (\n <div\n aria-hidden=\"true\"\n className=\"absolute top-0 h-full w-full inset-x-0 -z-10 transform-gpu overflow-hidden pointer-events-none\"\n >\n <div\n style={style}\n className=\"relative -z-10 aspect-1155/678 bg-linear-to-br from-white/60 to-[#050505] opacity-10 pointer-events-none\"\n ></div>\n </div>\n )\n}\n"],"mappings":";;;;AASA,MAAMK,QAA4C,EAChDE,QAAQ;CACNC,OAAO;CACPC,QAAQ;CACV,EACD;AAED,MAAaC,oBAAoDE,OAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAC,MAAA,EAAAV,aAAAW,OAAAH;CAChE,MAAAK,QAAcZ,MADoDU,OAAAC,SAAA,WAAAD;CAClC,IAAAG;AAAA,KAAAL,EAAA,OAAAI,OAAA;AAG9BC,OAAA,oBAAA;GACc,eAAA;GACF,WAAA;aAEV,oBAAA;IACSD;IACG,WAAA;KAEd;IAAM;AAAAJ,IAAA,KAAAI;AAAAJ,IAAA,KAAAK;OAAAA,MAAAL,EAAA;AAAA,QARNK"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { VariantProps } from
|
|
2
|
-
import { FC, HTMLAttributes } from
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { FC, HTMLAttributes } from "react";
|
|
3
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
|
+
|
|
5
|
+
//#region src/components/ui/badge.d.ts
|
|
3
6
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
|
|
5
|
-
} &
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {};
|
|
7
|
+
variant?: "info" | "success" | "error" | "default" | "outline" | "warning" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
9
|
+
interface BadgeProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
10
|
+
declare const Badge: FC<BadgeProps>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Badge, BadgeProps };
|
|
10
13
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","
|
|
1
|
+
{"version":3,"file":"badge.d.ts","names":[],"sources":["../../../src/components/ui/badge.tsx"],"sourcesContent":[],"mappings":";;;;;cAIM;;IAcJ,+BAAA,CAAA;AAdI,UAgBW,UAAA,SAAmB,cAFlC,CAEiD,cAFjD,CAAA,EAEkE,YAFlE,CAAA,OAEsF,aAFtF,CAAA,CAAA,CAEF;AAAmD,cAEtC,KAFsC,EAE/B,EAF+B,CAE5B,UAF4B,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
//#region src/components/ui/badge.tsx
|
|
7
|
+
const badgeVariants = cva("inline-flex items-center rounded-full px-4 py-1 text-xs font-bold transition-colors", {
|
|
8
|
+
variants: { variant: {
|
|
9
|
+
info: "dark:bg-accent-100 dark:text-accent-1000 bg-accent-200 text-accent-900 capitalize",
|
|
10
|
+
success: "bg-accent-1000 text-white",
|
|
11
|
+
error: "bg-destructive/10 text-destructive capitalize",
|
|
12
|
+
default: "dark:bg-gray-800/30 dark:text-gray-500 bg-gray-100 text-gray-800",
|
|
13
|
+
outline: "border border-gray-200 dark:border-gray-700",
|
|
14
|
+
warning: "border-transparent bg-amber-300 text-amber-950 hover:bg-amber/80"
|
|
15
|
+
} },
|
|
16
|
+
defaultVariants: { variant: "default" }
|
|
17
|
+
});
|
|
18
|
+
const Badge = (t0) => {
|
|
19
|
+
const $ = c(10);
|
|
20
|
+
let className;
|
|
21
|
+
let props;
|
|
22
|
+
let variant;
|
|
23
|
+
if ($[0] !== t0) {
|
|
24
|
+
({className, variant, ...props} = t0);
|
|
25
|
+
$[0] = t0;
|
|
26
|
+
$[1] = className;
|
|
27
|
+
$[2] = props;
|
|
28
|
+
$[3] = variant;
|
|
29
|
+
} else {
|
|
30
|
+
className = $[1];
|
|
31
|
+
props = $[2];
|
|
32
|
+
variant = $[3];
|
|
33
|
+
}
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[4] !== className || $[5] !== variant) {
|
|
36
|
+
t1 = cn(badgeVariants({ variant }), className);
|
|
37
|
+
$[4] = className;
|
|
38
|
+
$[5] = variant;
|
|
39
|
+
$[6] = t1;
|
|
40
|
+
} else t1 = $[6];
|
|
41
|
+
let t2;
|
|
42
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
43
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: t1,
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
$[7] = props;
|
|
48
|
+
$[8] = t1;
|
|
49
|
+
$[9] = t2;
|
|
50
|
+
} else t2 = $[9];
|
|
51
|
+
return t2;
|
|
52
|
+
};
|
|
53
|
+
Badge.displayName = "Badge";
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Badge };
|
|
57
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","names":["cva","VariantProps","FC","HTMLAttributes","cn","badgeVariants","variants","variant","info","success","error","default","outline","warning","defaultVariants","BadgeProps","HTMLDivElement","Badge","t0","$","_c","className","props","t1","t2","displayName"],"sources":["../../../src/components/ui/badge.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\nimport type { FC, HTMLAttributes } from 'react'\nimport { cn } from '../../lib/utils'\n\nconst badgeVariants = cva('inline-flex items-center rounded-full px-4 py-1 text-xs font-bold transition-colors', {\n variants: {\n variant: {\n info: 'dark:bg-accent-100 dark:text-accent-1000 bg-accent-200 text-accent-900 capitalize',\n success: 'bg-accent-1000 text-white',\n error: 'bg-destructive/10 text-destructive capitalize',\n default: 'dark:bg-gray-800/30 dark:text-gray-500 bg-gray-100 text-gray-800',\n outline: 'border border-gray-200 dark:border-gray-700',\n warning: 'border-transparent bg-amber-300 text-amber-950 hover:bg-amber/80',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n})\n\nexport interface BadgeProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}\n\nexport const Badge: FC<BadgeProps> = ({ className, variant, ...props }) => {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />\n}\n\nBadge.displayName = 'Badge'\n"],"mappings":";;;;;;AAIA,MAAMK,gBAAgBL,IAAI,uFAAuF;CAC/GM,UAAU,EACRC,SAAS;EACPC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,SAAS;EACX,EACD;CACDC,iBAAiB,EACfP,SAAS,WACX;CACD,CAAC;AAIF,MAAaU,SAAwBC,OAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAf;AAAA,KAAAY,EAAA,OAAAD,IAAA;AAAC,GAAA,CAAAG,WAAAd,YAAAe,SAAAJ;AAAgCC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAZ;QAAA;AAAAc,cAAAF,EAAA;AAAAG,UAAAH,EAAA;AAAAZ,YAAAY,EAAA;;CAAA,IAAAI;AAAA,KAAAJ,EAAA,OAAAE,aAAAF,EAAA,OAAAZ,SAAA;AAC7CgB,OAAAnB,GAAGC,cAAc,EAAAE,SAAW,CAAC,EAAEc,UAAU;AAAAF,IAAA,KAAAE;AAAAF,IAAA,KAAAZ;AAAAY,IAAA,KAAAI;OAAAA,MAAAJ,EAAA;CAAA,IAAAK;AAAA,KAAAL,EAAA,OAAAG,SAAAH,EAAA,OAAAI,IAAA;AAAzDC,OAAA,oBAAA;GAAgB,WAAAD;GAAyC,GAAMD;IAAS;AAAAH,IAAA,KAAAG;AAAAH,IAAA,KAAAI;AAAAJ,IAAA,KAAAK;OAAAA,MAAAL,EAAA;AAAA,QAAxEK;;AAGTP,MAAMQ,cAAc"}
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import { ComponentProps, FC, ReactNode } from
|
|
2
|
-
|
|
1
|
+
import { ComponentProps, FC, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/ui/breadcrumb.d.ts
|
|
4
|
+
interface BreadcrumbItemProps {
|
|
5
|
+
label: string | ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
isLast: boolean;
|
|
9
|
+
dropdownItems?: {
|
|
3
10
|
label: string | ReactNode;
|
|
4
11
|
icon?: ReactNode;
|
|
5
12
|
onClick?: () => void;
|
|
6
|
-
|
|
7
|
-
dropdownItems?: {
|
|
8
|
-
label: string | ReactNode;
|
|
9
|
-
icon?: ReactNode;
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
}[];
|
|
13
|
+
}[];
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}[];
|
|
15
|
+
declare const BreadcrumbItem: FC<BreadcrumbItemProps>;
|
|
16
|
+
interface BreadcrumbProps extends ComponentProps<'div'> {
|
|
17
|
+
items: {
|
|
18
|
+
label: string | ReactNode;
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
onClick?: () => void;
|
|
21
|
+
dropdownItems?: {
|
|
22
|
+
label: string | ReactNode;
|
|
23
|
+
icon?: ReactNode;
|
|
24
|
+
onClick?: () => void;
|
|
24
25
|
}[];
|
|
26
|
+
}[];
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Breadcrumb, BreadcrumbItem, BreadcrumbItemProps, BreadcrumbProps };
|
|
27
31
|
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.d.ts","
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","names":[],"sources":["../../../src/components/ui/breadcrumb.tsx"],"sourcesContent":[],"mappings":";;;UAOiB,mBAAA;kBACC;EADD,IAAA,CAAA,EAER,SAFQ;EACC,OAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EACT,MAAA,EAAA,OAAA;EAIW,aAAA,CAAA,EAAA;IACT,KAAA,EAAA,MAAA,GADS,SACT;IAAS,IAAA,CAAA,EAAT,SAAS;IAKP,OAAA,CAAA,EAAA,GA4CZ,GAAA,IAAA;EAIgB,CAAA,EAAA;;AAGN,cAnDE,cAmDF,EAnDkB,EAmDlB,CAnDqB,mBAmDrB,CAAA;AAGW,UANL,eAAA,SAAwB,cAMnB,CAAA,KAAA,CAAA,CAAA;EACT,KAAA,EAAA;IAP4B,KAAA,EAAA,MAAA,GAErB,SAFqB;IAAc,IAAA,CAAA,EAG5C,SAH4C;IAa1C,OAAA,CAAA,EAsBZ,GAAA,GAAA,IAtB2B;;sBAPN;aACT;;;;;cAMA,YAAY,GAAG"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
|
|
9
|
+
//#region src/components/ui/breadcrumb.tsx
|
|
10
|
+
const BreadcrumbItem = (t0) => {
|
|
11
|
+
const $ = c(18);
|
|
12
|
+
const { label, onClick, isLast, dropdownItems, icon } = t0;
|
|
13
|
+
if (dropdownItems?.length) {
|
|
14
|
+
let t1$1;
|
|
15
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
16
|
+
t1$1 = /* @__PURE__ */ jsx(ChevronsUpDown, { className: "size-4" });
|
|
17
|
+
$[0] = t1$1;
|
|
18
|
+
} else t1$1 = $[0];
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[1] !== icon || $[2] !== label) {
|
|
21
|
+
t2 = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
22
|
+
asChild: true,
|
|
23
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
24
|
+
variant: "ghost",
|
|
25
|
+
size: "sm",
|
|
26
|
+
className: "p-1 gap-2",
|
|
27
|
+
children: [
|
|
28
|
+
icon,
|
|
29
|
+
label,
|
|
30
|
+
" ",
|
|
31
|
+
t1$1
|
|
32
|
+
]
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
$[1] = icon;
|
|
36
|
+
$[2] = label;
|
|
37
|
+
$[3] = t2;
|
|
38
|
+
} else t2 = $[3];
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[4] !== dropdownItems) {
|
|
41
|
+
t3 = dropdownItems.map(_temp);
|
|
42
|
+
$[4] = dropdownItems;
|
|
43
|
+
$[5] = t3;
|
|
44
|
+
} else t3 = $[5];
|
|
45
|
+
let t4;
|
|
46
|
+
if ($[6] !== t3) {
|
|
47
|
+
t4 = /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
48
|
+
className: "bg-background text-foreground",
|
|
49
|
+
children: t3
|
|
50
|
+
});
|
|
51
|
+
$[6] = t3;
|
|
52
|
+
$[7] = t4;
|
|
53
|
+
} else t4 = $[7];
|
|
54
|
+
let t5;
|
|
55
|
+
if ($[8] !== t2 || $[9] !== t4) {
|
|
56
|
+
t5 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t2, t4] });
|
|
57
|
+
$[8] = t2;
|
|
58
|
+
$[9] = t4;
|
|
59
|
+
$[10] = t5;
|
|
60
|
+
} else t5 = $[10];
|
|
61
|
+
return t5;
|
|
62
|
+
}
|
|
63
|
+
if (isLast) {
|
|
64
|
+
let t1$1;
|
|
65
|
+
if ($[11] !== icon || $[12] !== label) {
|
|
66
|
+
t1$1 = /* @__PURE__ */ jsx(Button, {
|
|
67
|
+
variant: "ghost",
|
|
68
|
+
size: "sm",
|
|
69
|
+
className: "cursor-default hover:bg-transparent hover:text-muted-transparent p-1",
|
|
70
|
+
asChild: true,
|
|
71
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
72
|
+
className: "flex items-center gap-2",
|
|
73
|
+
children: [icon, label]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
$[11] = icon;
|
|
77
|
+
$[12] = label;
|
|
78
|
+
$[13] = t1$1;
|
|
79
|
+
} else t1$1 = $[13];
|
|
80
|
+
return t1$1;
|
|
81
|
+
}
|
|
82
|
+
let t1;
|
|
83
|
+
if ($[14] !== icon || $[15] !== label || $[16] !== onClick) {
|
|
84
|
+
t1 = /* @__PURE__ */ jsxs(Button, {
|
|
85
|
+
onClick,
|
|
86
|
+
variant: "ghost",
|
|
87
|
+
size: "sm",
|
|
88
|
+
className: "p-1 gap-2",
|
|
89
|
+
children: [icon, label]
|
|
90
|
+
});
|
|
91
|
+
$[14] = icon;
|
|
92
|
+
$[15] = label;
|
|
93
|
+
$[16] = onClick;
|
|
94
|
+
$[17] = t1;
|
|
95
|
+
} else t1 = $[17];
|
|
96
|
+
return t1;
|
|
97
|
+
};
|
|
98
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
99
|
+
const Breadcrumb = (t0) => {
|
|
100
|
+
const $ = c(15);
|
|
101
|
+
let className;
|
|
102
|
+
let items;
|
|
103
|
+
let props;
|
|
104
|
+
if ($[0] !== t0) {
|
|
105
|
+
({className, items, ...props} = t0);
|
|
106
|
+
$[0] = t0;
|
|
107
|
+
$[1] = className;
|
|
108
|
+
$[2] = items;
|
|
109
|
+
$[3] = props;
|
|
110
|
+
} else {
|
|
111
|
+
className = $[1];
|
|
112
|
+
items = $[2];
|
|
113
|
+
props = $[3];
|
|
114
|
+
}
|
|
115
|
+
const lastIndex = items.length - 1;
|
|
116
|
+
let t1;
|
|
117
|
+
if ($[4] !== className) {
|
|
118
|
+
t1 = cn("flex items-center", className);
|
|
119
|
+
$[4] = className;
|
|
120
|
+
$[5] = t1;
|
|
121
|
+
} else t1 = $[5];
|
|
122
|
+
let t2;
|
|
123
|
+
if ($[6] !== items || $[7] !== lastIndex) {
|
|
124
|
+
let t3$1;
|
|
125
|
+
if ($[9] !== lastIndex) {
|
|
126
|
+
t3$1 = (item, index) => /* @__PURE__ */ jsxs(React$1.Fragment, { children: [index !== 0 && /* @__PURE__ */ jsx("span", {
|
|
127
|
+
className: "mx-1.5 text-muted-foreground",
|
|
128
|
+
children: "/"
|
|
129
|
+
}, `${item.label}-separator`), /* @__PURE__ */ jsx(BreadcrumbItem, {
|
|
130
|
+
label: item.label,
|
|
131
|
+
icon: item.icon,
|
|
132
|
+
isLast: index === lastIndex,
|
|
133
|
+
dropdownItems: item.dropdownItems
|
|
134
|
+
}, `${item.label}-item`)] }, `${item.label}-fragment`);
|
|
135
|
+
$[9] = lastIndex;
|
|
136
|
+
$[10] = t3$1;
|
|
137
|
+
} else t3$1 = $[10];
|
|
138
|
+
t2 = items.map(t3$1);
|
|
139
|
+
$[6] = items;
|
|
140
|
+
$[7] = lastIndex;
|
|
141
|
+
$[8] = t2;
|
|
142
|
+
} else t2 = $[8];
|
|
143
|
+
let t3;
|
|
144
|
+
if ($[11] !== props || $[12] !== t1 || $[13] !== t2) {
|
|
145
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
146
|
+
className: t1,
|
|
147
|
+
...props,
|
|
148
|
+
children: t2
|
|
149
|
+
});
|
|
150
|
+
$[11] = props;
|
|
151
|
+
$[12] = t1;
|
|
152
|
+
$[13] = t2;
|
|
153
|
+
$[14] = t3;
|
|
154
|
+
} else t3 = $[14];
|
|
155
|
+
return t3;
|
|
156
|
+
};
|
|
157
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
158
|
+
function _temp(item) {
|
|
159
|
+
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
160
|
+
className: "cursor-pointer gap-2",
|
|
161
|
+
onClick: item.onClick,
|
|
162
|
+
children: [item.icon, item.label]
|
|
163
|
+
}, `dropdown-${item.label}`);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
export { Breadcrumb, BreadcrumbItem };
|
|
168
|
+
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":["ChevronsUpDown","ComponentProps","FC","ReactNode","React","cn","Button","DropdownMenu","DropdownMenuContent","DropdownMenuItem","DropdownMenuTrigger","BreadcrumbItemProps","label","icon","onClick","isLast","dropdownItems","BreadcrumbItem","t0","$","_c","length","t1","Symbol","for","t2","t3","map","_temp","t4","t5","displayName","BreadcrumbProps","items","Breadcrumb","className","props","lastIndex","item","index"],"sources":["../../../src/components/ui/breadcrumb.tsx"],"sourcesContent":["import { ChevronsUpDown } from 'lucide-react'\nimport type { ComponentProps, FC, ReactNode } from 'react'\nimport * as React from 'react'\nimport { cn } from '../../lib/utils'\nimport { Button } from './button'\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from './dropdown-menu'\n\nexport interface BreadcrumbItemProps {\n label: string | ReactNode\n icon?: ReactNode\n onClick?: () => void\n isLast: boolean\n dropdownItems?: {\n label: string | ReactNode\n icon?: ReactNode\n onClick?: () => void\n }[]\n}\n\nexport const BreadcrumbItem: FC<BreadcrumbItemProps> = ({ label, onClick, isLast, dropdownItems, icon }) => {\n if (dropdownItems?.length) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"sm\" className=\"p-1 gap-2\">\n {icon}\n {label} <ChevronsUpDown className=\"size-4\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent className={'bg-background text-foreground'}>\n {dropdownItems.map((item) => (\n <DropdownMenuItem key={`dropdown-${item.label}`} className=\"cursor-pointer gap-2\" onClick={item.onClick}>\n {item.icon}\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n }\n\n if (isLast) {\n return (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className=\"cursor-default hover:bg-transparent hover:text-muted-transparent p-1\"\n asChild\n >\n <div className=\"flex items-center gap-2\">\n {icon}\n {label}\n </div>\n </Button>\n )\n }\n\n return (\n <Button onClick={onClick} variant=\"ghost\" size=\"sm\" className=\"p-1 gap-2\">\n {icon}\n {label}\n </Button>\n )\n}\n\nBreadcrumbItem.displayName = 'BreadcrumbItem'\n\nexport interface BreadcrumbProps extends ComponentProps<'div'> {\n items: {\n label: string | ReactNode\n icon?: ReactNode\n onClick?: () => void\n dropdownItems?: {\n label: string | ReactNode\n icon?: ReactNode\n onClick?: () => void\n }[]\n }[]\n}\n\nexport const Breadcrumb: FC<BreadcrumbProps> = ({ className, items, ...props }) => {\n const lastIndex = items.length - 1\n return (\n <div className={cn('flex items-center', className)} {...props}>\n {items.map((item, index) => (\n <React.Fragment key={`${item.label}-fragment`}>\n {index !== 0 && (\n <span key={`${item.label}-separator`} className=\"mx-1.5 text-muted-foreground\">\n /\n </span>\n )}\n <BreadcrumbItem\n key={`${item.label}-item`}\n label={item.label}\n icon={item.icon}\n isLast={index === lastIndex}\n dropdownItems={item.dropdownItems}\n />\n </React.Fragment>\n ))}\n </div>\n )\n}\nBreadcrumb.displayName = 'Breadcrumb'\n"],"mappings":"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"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { VariantProps } from
|
|
2
|
-
import
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as react0 from "react";
|
|
3
|
+
import { ButtonHTMLAttributes } from "react";
|
|
4
|
+
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
|
+
|
|
6
|
+
//#region src/components/ui/button.d.ts
|
|
3
7
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} &
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
variant?: "link" | "default" | "outline" | "accent" | "light" | "secondary" | "destructive" | "ghost" | "icon" | null | undefined;
|
|
9
|
+
size?: "default" | "icon" | "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
12
|
+
asChild?: boolean;
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
declare const Button: react0.ForwardRefExoticComponent<ButtonProps & react0.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Button, ButtonProps };
|
|
12
17
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","
|
|
1
|
+
{"version":3,"file":"button.d.ts","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":[],"mappings":";;;;;;cAMM;;;IA4BL,+BAAA,CAAA;AA5BK,UA8BW,WAAA,SAAoB,oBAFpC,CAEyD,iBAFzD,CAAA,EAE6E,YAF7E,CAAA,OAEiG,cAFjG,CAAA,CAAA;EAEgB,OAAA,CAAA,EAAA,OAAY;;AAAqE,cAIrF,MAJqF,EAI/E,MAAA,CAAA,yBAJ+E,CAI/E,WAJ+E,GAI/E,MAAA,CAAA,aAJ+E,CAI/E,iBAJ+E,CAAA,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
7
|
+
|
|
8
|
+
//#region src/components/ui/button.tsx
|
|
9
|
+
const buttonVariants = cva("inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md font-semibold transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-input text-foreground hover:bg-border active:bg-card",
|
|
13
|
+
accent: "bg-accent text-accent-foreground hover:bg-accent/90 active:bg-accent/80",
|
|
14
|
+
light: "bg-background text-foreground border border-border hover:bg-muted active:bg-muted/80",
|
|
15
|
+
secondary: "bg-secondary text-foreground shadow-sm hover:opacity-90 active:opacity-80",
|
|
16
|
+
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:opacity-90 active:opacity-80",
|
|
17
|
+
outline: "border border-border bg-transparent hover:bg-muted hover:text-muted-foreground text-foreground",
|
|
18
|
+
ghost: "hover:bg-muted-foreground/20 text-foreground",
|
|
19
|
+
link: "text-primary underline-offset-4 hover:underline text-primary-foreground",
|
|
20
|
+
icon: "hover:bg-muted-foreground/20 text-foreground rounded-full bg-muted-foreground/10"
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
sm: "h-6 px-3 text-xs [&_svg]:size-3",
|
|
24
|
+
default: "h-9 px-4 text-sm [&_svg]:size-4",
|
|
25
|
+
md: "h-9 px-4 text-sm [&_svg]:size-4",
|
|
26
|
+
lg: "h-11 px-6 text-base [&_svg]:size-5",
|
|
27
|
+
icon: "h-4 w-4 [&_svg]:size-4"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "default",
|
|
32
|
+
size: "default"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const Button = forwardRef((t0, ref) => {
|
|
36
|
+
const $ = c(15);
|
|
37
|
+
let className;
|
|
38
|
+
let props;
|
|
39
|
+
let size;
|
|
40
|
+
let t1;
|
|
41
|
+
let variant;
|
|
42
|
+
if ($[0] !== t0) {
|
|
43
|
+
({className, variant, size, asChild: t1, ...props} = t0);
|
|
44
|
+
$[0] = t0;
|
|
45
|
+
$[1] = className;
|
|
46
|
+
$[2] = props;
|
|
47
|
+
$[3] = size;
|
|
48
|
+
$[4] = t1;
|
|
49
|
+
$[5] = variant;
|
|
50
|
+
} else {
|
|
51
|
+
className = $[1];
|
|
52
|
+
props = $[2];
|
|
53
|
+
size = $[3];
|
|
54
|
+
t1 = $[4];
|
|
55
|
+
variant = $[5];
|
|
56
|
+
}
|
|
57
|
+
const Comp = (t1 === void 0 ? false : t1) ? Slot : "button";
|
|
58
|
+
let t2;
|
|
59
|
+
if ($[6] !== className || $[7] !== size || $[8] !== variant) {
|
|
60
|
+
t2 = cn(buttonVariants({
|
|
61
|
+
variant,
|
|
62
|
+
size
|
|
63
|
+
}), className);
|
|
64
|
+
$[6] = className;
|
|
65
|
+
$[7] = size;
|
|
66
|
+
$[8] = variant;
|
|
67
|
+
$[9] = t2;
|
|
68
|
+
} else t2 = $[9];
|
|
69
|
+
let t3;
|
|
70
|
+
if ($[10] !== Comp || $[11] !== props || $[12] !== ref || $[13] !== t2) {
|
|
71
|
+
t3 = /* @__PURE__ */ jsx(Comp, {
|
|
72
|
+
className: t2,
|
|
73
|
+
ref,
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
$[10] = Comp;
|
|
77
|
+
$[11] = props;
|
|
78
|
+
$[12] = ref;
|
|
79
|
+
$[13] = t2;
|
|
80
|
+
$[14] = t3;
|
|
81
|
+
} else t3 = $[14];
|
|
82
|
+
return t3;
|
|
83
|
+
});
|
|
84
|
+
Button.displayName = "Button";
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Button };
|
|
88
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","names":["Slot","cva","VariantProps","ButtonHTMLAttributes","forwardRef","cn","buttonVariants","variants","variant","default","accent","light","secondary","destructive","outline","ghost","link","icon","size","sm","md","lg","defaultVariants","ButtonProps","HTMLButtonElement","asChild","Button","t0","ref","$","_c","className","props","t1","undefined","Comp","t2","t3","displayName"],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { type ButtonHTMLAttributes, forwardRef } from 'react'\n\nimport { cn } from '../../lib/utils'\n\nconst buttonVariants = cva(\n 'inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md font-semibold transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n default: 'bg-input text-foreground hover:bg-border active:bg-card',\n accent: 'bg-accent text-accent-foreground hover:bg-accent/90 active:bg-accent/80',\n light: 'bg-background text-foreground border border-border hover:bg-muted active:bg-muted/80',\n secondary: 'bg-secondary text-foreground shadow-sm hover:opacity-90 active:opacity-80',\n destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:opacity-90 active:opacity-80',\n outline: 'border border-border bg-transparent hover:bg-muted hover:text-muted-foreground text-foreground',\n ghost: 'hover:bg-muted-foreground/20 text-foreground',\n link: 'text-primary underline-offset-4 hover:underline text-primary-foreground',\n icon: 'hover:bg-muted-foreground/20 text-foreground rounded-full bg-muted-foreground/10',\n },\n size: {\n sm: 'h-6 px-3 text-xs [&_svg]:size-3',\n default: 'h-9 px-4 text-sm [&_svg]:size-4',\n md: 'h-9 px-4 text-sm [&_svg]:size-4',\n lg: 'h-11 px-6 text-base [&_svg]:size-5',\n icon: 'h-4 w-4 [&_svg]:size-4',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n)\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n return <Comp className={cn(buttonVariants({ variant, size }), className)} ref={ref} {...props} />\n },\n)\nButton.displayName = 'Button'\n"],"mappings":";;;;;;;;AAMA,MAAMM,iBAAiBL,IACrB,6SACA;CACEM,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,QAAQ;GACRC,OAAO;GACPC,WAAW;GACXC,aAAa;GACbC,SAAS;GACTC,OAAO;GACPC,MAAM;GACNC,MAAM;GACP;EACDC,MAAM;GACJC,IAAI;GACJV,SAAS;GACTW,IAAI;GACJC,IAAI;GACJJ,MAAM;GACR;EACD;CACDK,iBAAiB;EACfd,SAAS;EACTU,MAAM;EACR;CAEJ,CAAC;AAMD,MAAaQ,SAAStB,YACpBuB,IAAAC,QAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAd;CAAA,IAAAe;CAAA,IAAAzB;AAAA,KAAAqB,EAAA,OAAAF,IAAA;AAAC,GAAA,CAAAI,WAAAvB,SAAAU,MAAAO,SAAAQ,OAAAD,SAAAL;AAAuDE,IAAA,KAAAF;AAAAE,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAX;AAAAW,IAAA,KAAAI;AAAAJ,IAAA,KAAArB;QAAA;AAAAuB,cAAAF,EAAA;AAAAG,UAAAH,EAAA;AAAAX,SAAAW,EAAA;AAAAI,OAAAJ,EAAA;AAAArB,YAAAqB,EAAA;;CACtD,MAAAM,QAD2BF,OAAAC,SAAA,QAAAD,MACdjC,OAAA;CAAyB,IAAAoC;AAAA,KAAAP,EAAA,OAAAE,aAAAF,EAAA,OAAAX,QAAAW,EAAA,OAAArB,SAAA;AACd4B,OAAA/B,GAAGC,eAAe;GAAAE;GAAAU;GAAiB,CAAC,EAAEa,UAAU;AAAAF,IAAA,KAAAE;AAAAF,IAAA,KAAAX;AAAAW,IAAA,KAAArB;AAAAqB,IAAA,KAAAO;OAAAA,MAAAP,EAAA;CAAA,IAAAQ;AAAA,KAAAR,EAAA,QAAAM,QAAAN,EAAA,QAAAG,SAAAH,EAAA,QAAAD,OAAAC,EAAA,QAAAO,IAAA;AAAjEC,OAAA,oBAAC;GAAgB,WAAAD;GAAuDR;GAAG,GAAMI;IAAS;AAAAH,IAAA,MAAAM;AAAAN,IAAA,MAAAG;AAAAH,IAAA,MAAAD;AAAAC,IAAA,MAAAO;AAAAP,IAAA,MAAAQ;OAAAA,MAAAR,EAAA;AAAA,QAA1FQ;EAEV;AACDX,OAAOY,cAAc"}
|