linkedunion-design-kit 1.11.11 → 1.11.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/src/components/Spinner/Spinner.d.ts +2 -0
- package/dist/src/components/Spinner/Spinner.js +30 -0
- package/dist/src/components/Spinner/Spinner.stories.d.ts +10 -0
- package/dist/src/components/Spinner/Spinner.stories.js +64 -0
- package/dist/styles/global.css +18 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -41,3 +41,4 @@ export * from "./src/components/Sheet";
|
|
|
41
41
|
export * from "./src/components/Separator";
|
|
42
42
|
export { SweetAlert, SweetAlertTrigger, SweetAlertContent, SweetAlertFooter, SweetAlertTitle, SweetAlertDescription, SweetAlertAction, SweetAlertCancel, SweetAlertIcon, } from "./src/components/SweetAlert/SweetAlert";
|
|
43
43
|
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, } from "./src/components/Popover/popover";
|
|
44
|
+
export { Spinner } from "./src/components/Spinner/Spinner";
|
package/dist/index.js
CHANGED
|
@@ -40,3 +40,4 @@ export * from "./src/components/Sheet";
|
|
|
40
40
|
export * from "./src/components/Separator";
|
|
41
41
|
export { SweetAlert, SweetAlertTrigger, SweetAlertContent, SweetAlertFooter, SweetAlertTitle, SweetAlertDescription, SweetAlertAction, SweetAlertCancel, SweetAlertIcon, } from "./src/components/SweetAlert/SweetAlert";
|
|
42
42
|
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, } from "./src/components/Popover/popover";
|
|
43
|
+
export { Spinner } from "./src/components/Spinner/Spinner";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { Loader2Icon } from "lucide-react";
|
|
25
|
+
import { cn } from "../../lib/utils";
|
|
26
|
+
function Spinner(_a) {
|
|
27
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
28
|
+
return (_jsx(Loader2Icon, __assign({ role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className) }, props)));
|
|
29
|
+
}
|
|
30
|
+
export { Spinner };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("@storybook/react").Args>;
|
|
5
|
+
export declare const Sizes: StoryFn;
|
|
6
|
+
export declare const InButtons: StoryFn;
|
|
7
|
+
export declare const InBadges: StoryFn;
|
|
8
|
+
export declare const InInputGroup: StoryFn;
|
|
9
|
+
export declare const EmptyState: StoryFn;
|
|
10
|
+
export declare const Colors: StoryFn;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Spinner } from "./Spinner";
|
|
14
|
+
import { Button } from "../Button/Button/Button";
|
|
15
|
+
import { Badge } from "../Badge/Badge";
|
|
16
|
+
import { Input } from "../Input/input";
|
|
17
|
+
import { Label } from "../Label/Label";
|
|
18
|
+
export default {
|
|
19
|
+
title: "Components/Spinner",
|
|
20
|
+
component: Spinner,
|
|
21
|
+
tags: ["autodocs"],
|
|
22
|
+
};
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// DEFAULT
|
|
25
|
+
// ============================================================================
|
|
26
|
+
var Template = function (args) { return _jsx(Spinner, __assign({}, args)); };
|
|
27
|
+
export var Default = Template.bind({});
|
|
28
|
+
Default.args = {
|
|
29
|
+
className: "size-4",
|
|
30
|
+
};
|
|
31
|
+
Default.argTypes = {
|
|
32
|
+
className: {
|
|
33
|
+
control: "text",
|
|
34
|
+
description: "Additional CSS classes for custom sizing or color",
|
|
35
|
+
table: {
|
|
36
|
+
defaultValue: { summary: "size-4" },
|
|
37
|
+
type: { summary: "string" },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// SIZES
|
|
43
|
+
// ============================================================================
|
|
44
|
+
export var Sizes = function () { return (_jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsx(Spinner, { className: "size-3" }), _jsx("span", { className: "text-xs text-gray-500", children: "Small" })] }), _jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsx(Spinner, { className: "size-4" }), _jsx("span", { className: "text-xs text-gray-500", children: "Default" })] }), _jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsx(Spinner, { className: "size-6" }), _jsx("span", { className: "text-xs text-gray-500", children: "Medium" })] }), _jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsx(Spinner, { className: "size-8" }), _jsx("span", { className: "text-xs text-gray-500", children: "Large" })] })] })); };
|
|
45
|
+
// ============================================================================
|
|
46
|
+
// IN BUTTONS
|
|
47
|
+
// ============================================================================
|
|
48
|
+
export var InButtons = function () { return (_jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [_jsxs(Button, { disabled: true, children: [_jsx(Spinner, {}), "Submit"] }), _jsxs(Button, { variant: "outline", disabled: true, children: [_jsx(Spinner, {}), "Outline"] }), _jsxs(Button, { variant: "ghost", disabled: true, children: [_jsx(Spinner, {}), "Ghost"] }), _jsx(Button, { disabled: true, size: "sm", children: _jsx(Spinner, { className: "size-3" }) })] })); };
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// IN BADGES
|
|
51
|
+
// ============================================================================
|
|
52
|
+
export var InBadges = function () { return (_jsxs("div", { className: "flex flex-wrap items-center gap-4", children: [_jsxs(Badge, { color: "blue", children: [_jsx(Spinner, { className: "size-3" }), "Default"] }), _jsxs(Badge, { color: "gray", type: "outline", children: [_jsx(Spinner, { className: "size-3" }), "Outline"] }), _jsxs(Badge, { color: "red", children: [_jsx(Spinner, { className: "size-3" }), "Destructive"] }), _jsxs(Badge, { color: "green", children: [_jsx(Spinner, { className: "size-3" }), "Success"] })] })); };
|
|
53
|
+
// ============================================================================
|
|
54
|
+
// IN INPUT GROUP
|
|
55
|
+
// ============================================================================
|
|
56
|
+
export var InInputGroup = function () { return (_jsxs("div", { className: "grid w-72 gap-2", children: [_jsx(Label, { children: "Input Group" }), _jsxs("div", { className: "relative", children: [_jsx(Input, { placeholder: "Loading...", className: "pr-10", disabled: true }), _jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2", children: _jsx(Spinner, { className: "size-4 text-gray-400" }) })] })] })); };
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// EMPTY STATE
|
|
59
|
+
// ============================================================================
|
|
60
|
+
export var EmptyState = function () { return (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 rounded-lg border border-dashed border-gray-300 p-10", children: [_jsx(Spinner, { className: "size-8 text-gray-400" }), _jsxs("div", { className: "text-center", children: [_jsx("p", { className: "text-sm font-medium text-gray-900", children: "Loading projects" }), _jsx("p", { className: "text-sm text-gray-500", children: "Please wait while we fetch your data." })] })] })); };
|
|
61
|
+
// ============================================================================
|
|
62
|
+
// COLORS
|
|
63
|
+
// ============================================================================
|
|
64
|
+
export var Colors = function () { return (_jsxs("div", { className: "flex items-center gap-4", children: [_jsx(Spinner, { className: "size-6 text-blue-600" }), _jsx(Spinner, { className: "size-6 text-red-600" }), _jsx(Spinner, { className: "size-6 text-green-600" }), _jsx(Spinner, { className: "size-6 text-yellow-500" }), _jsx(Spinner, { className: "size-6 text-gray-400" })] })); };
|
package/dist/styles/global.css
CHANGED
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
--radius-3xl: 1.5rem;
|
|
56
56
|
--ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
57
57
|
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
58
|
+
--animate-spin: spin 1s linear infinite;
|
|
58
59
|
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
59
60
|
--aspect-video: 16 / 9;
|
|
60
61
|
--default-transition-duration: 150ms;
|
|
@@ -298,6 +299,9 @@
|
|
|
298
299
|
.right-2 {
|
|
299
300
|
right: calc(var(--spacing) * 2);
|
|
300
301
|
}
|
|
302
|
+
.right-3 {
|
|
303
|
+
right: calc(var(--spacing) * 3);
|
|
304
|
+
}
|
|
301
305
|
.right-4 {
|
|
302
306
|
right: calc(var(--spacing) * 4);
|
|
303
307
|
}
|
|
@@ -1055,6 +1059,9 @@
|
|
|
1055
1059
|
.animate-pulse {
|
|
1056
1060
|
animation: var(--animate-pulse);
|
|
1057
1061
|
}
|
|
1062
|
+
.animate-spin {
|
|
1063
|
+
animation: var(--animate-spin);
|
|
1064
|
+
}
|
|
1058
1065
|
.cursor-default {
|
|
1059
1066
|
cursor: default;
|
|
1060
1067
|
}
|
|
@@ -1833,6 +1840,9 @@
|
|
|
1833
1840
|
.p-9 {
|
|
1834
1841
|
padding: calc(var(--spacing) * 9);
|
|
1835
1842
|
}
|
|
1843
|
+
.p-10 {
|
|
1844
|
+
padding: calc(var(--spacing) * 10);
|
|
1845
|
+
}
|
|
1836
1846
|
.p-24 {
|
|
1837
1847
|
padding: calc(var(--spacing) * 24);
|
|
1838
1848
|
}
|
|
@@ -1959,6 +1969,9 @@
|
|
|
1959
1969
|
.pr-9\.5 {
|
|
1960
1970
|
padding-right: calc(var(--spacing) * 9.5);
|
|
1961
1971
|
}
|
|
1972
|
+
.pr-10 {
|
|
1973
|
+
padding-right: calc(var(--spacing) * 10);
|
|
1974
|
+
}
|
|
1962
1975
|
.pr-11 {
|
|
1963
1976
|
padding-right: calc(var(--spacing) * 11);
|
|
1964
1977
|
}
|
|
@@ -5773,6 +5786,11 @@
|
|
|
5773
5786
|
syntax: "*";
|
|
5774
5787
|
inherits: false;
|
|
5775
5788
|
}
|
|
5789
|
+
@keyframes spin {
|
|
5790
|
+
to {
|
|
5791
|
+
transform: rotate(360deg);
|
|
5792
|
+
}
|
|
5793
|
+
}
|
|
5776
5794
|
@keyframes pulse {
|
|
5777
5795
|
50% {
|
|
5778
5796
|
opacity: 0.5;
|