linkedunion-design-kit 1.11.11 → 1.11.13
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/Dropdown/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +25 -4
- package/dist/src/components/Dropdown/DropdownMenu/index.d.ts +5 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.js +5 -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";
|
|
@@ -25,7 +25,7 @@ import * as React from "react";
|
|
|
25
25
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
26
26
|
import { ChevronRight, Circle } from "lucide-react";
|
|
27
27
|
import { cn } from "../../../lib/utils";
|
|
28
|
-
import { checkBoxSize, dropdownMenuIconSize, dropDownMenuItemSize, dropdownMenuSize, } from ".";
|
|
28
|
+
import { checkBoxSize, dropdownMenuIconSize, dropDownMenuItemSize, dropdownMenuSize, dropDownSubMenuItemSize, } from ".";
|
|
29
29
|
import { Checkbox } from "../../../components/Checkbox/checkbox";
|
|
30
30
|
import { Reset_BS } from "../../../utils/constants";
|
|
31
31
|
// Provide size from Content to all items
|
|
@@ -38,7 +38,7 @@ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
|
38
38
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
39
39
|
var DropdownMenuSubTrigger = React.forwardRef(function (_a, ref) {
|
|
40
40
|
var className = _a.className, inset = _a.inset, children = _a.children, props = __rest(_a, ["className", "inset", "children"]);
|
|
41
|
-
return (_jsxs(DropdownMenuPrimitive.SubTrigger, __assign({ ref: ref, className: cn("flex cursor-default select-none items-center gap-2 rounded-sm !p-2 outline-none
|
|
41
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, __assign({ ref: ref, className: cn("flex cursor-default select-none items-center gap-2 rounded-sm !p-2 outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className) }, props, { children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
|
|
42
42
|
});
|
|
43
43
|
DropdownMenuSubTrigger.displayName =
|
|
44
44
|
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
@@ -47,7 +47,7 @@ var DropdownMenuSubContent = React.forwardRef(function (_a, ref) {
|
|
|
47
47
|
var className = _a.className, size = _a.size, props = __rest(_a, ["className", "size"]);
|
|
48
48
|
var inheritedSize = React.useContext(DropdownMenuSizeContext);
|
|
49
49
|
var effectiveSize = (_b = size !== null && size !== void 0 ? size : inheritedSize) !== null && _b !== void 0 ? _b : "md";
|
|
50
|
-
return (_jsx(DropdownMenuPrimitive.SubContent, __assign({ ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-sm bg-white text-gray-900 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className,
|
|
50
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, __assign({ ref: ref, className: cn("z-50 h-auto min-w-[8rem] overflow-hidden shadow-backdrop-shadow-lg rounded-sm bg-white text-gray-900 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className, dropDownSubMenuItemSize[effectiveSize]) }, props)));
|
|
51
51
|
});
|
|
52
52
|
DropdownMenuSubContent.displayName =
|
|
53
53
|
DropdownMenuPrimitive.SubContent.displayName;
|
|
@@ -268,15 +268,32 @@ export var MasterDropdownMenu = function () {
|
|
|
268
268
|
var menuItems = [
|
|
269
269
|
{ type: "item", label: "Text Label 1" },
|
|
270
270
|
{ type: "item", label: "Text Label 2" },
|
|
271
|
-
{
|
|
272
|
-
|
|
271
|
+
{
|
|
272
|
+
type: "submenu",
|
|
273
|
+
label: "Text Label 3",
|
|
274
|
+
subItems: [
|
|
275
|
+
"Submenu Item 1",
|
|
276
|
+
"Submenu Item 2",
|
|
277
|
+
"Submenu Item 3",
|
|
278
|
+
"Submenu Item 4",
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
type: "submenu",
|
|
283
|
+
label: "Text Label 4",
|
|
284
|
+
subItems: ["Submenu Item 1", "Submenu Item 2", "Submenu Item 3"],
|
|
285
|
+
},
|
|
273
286
|
{ type: "item", label: "Text Label 5" },
|
|
274
287
|
{ type: "badge", label: "Text Label 6", badge: "09" },
|
|
275
288
|
{ type: "avatar", label: "Text Label 7" },
|
|
276
289
|
{ type: "item", label: "Text Label 8" },
|
|
277
290
|
// Second column starts after 8 items
|
|
278
291
|
{ type: "item", label: "Text Label 9" },
|
|
279
|
-
{
|
|
292
|
+
{
|
|
293
|
+
type: "submenu",
|
|
294
|
+
label: "Text Label 10",
|
|
295
|
+
subItems: ["Submenu Item 1", "Submenu Item 2", "Submenu Item 3"],
|
|
296
|
+
},
|
|
280
297
|
{ type: "item", label: "Text Label 11" },
|
|
281
298
|
{ type: "badge", label: "Text Label 12", badge: "09" },
|
|
282
299
|
{ type: "avatar", label: "Text Label 13" },
|
|
@@ -294,5 +311,9 @@ export var MasterDropdownMenu = function () {
|
|
|
294
311
|
return (_jsx(DropdownMenuItem, { onSelect: function () { return alert("".concat(item.label, " selected")); }, children: item.label }, index));
|
|
295
312
|
}
|
|
296
313
|
};
|
|
297
|
-
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { shape: "rounded-full", children: "Text Label" }) }), _jsx(DropdownMenuContent, { className: "w-auto", size: "lg", children: _jsxs("div", { className: "grid gap-0 ".concat(menuItems.length > 8 ?
|
|
314
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { shape: "rounded-full", children: "Text Label" }) }), _jsx(DropdownMenuContent, { className: "w-auto", size: "lg", children: _jsxs("div", { className: "grid gap-0 ".concat(menuItems.length > 8 ? "grid-cols-1 md:grid-cols-2" : "grid-cols-1"), children: [_jsxs("div", { className: "flex flex-col", children: [_jsx(DropdownMenuLabel, { className: "mb-1", children: "Group Heading" }), menuItems
|
|
315
|
+
.slice(0, 8)
|
|
316
|
+
.map(function (item, index) { return renderMenuItem(item, index); })] }), menuItems.length > 8 && (_jsxs("div", { className: "flex flex-col md:pl-2", children: [_jsx(DropdownMenuLabel, { className: "mb-1", children: "Group Heading" }), menuItems
|
|
317
|
+
.slice(8)
|
|
318
|
+
.map(function (item, index) { return renderMenuItem(item, index + 8); })] }))] }) })] }));
|
|
298
319
|
};
|
|
@@ -8,6 +8,11 @@ export declare const dropDownMenuItemSize: {
|
|
|
8
8
|
md: string;
|
|
9
9
|
lg: string;
|
|
10
10
|
};
|
|
11
|
+
export declare const dropDownSubMenuItemSize: {
|
|
12
|
+
sm: string;
|
|
13
|
+
md: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
};
|
|
11
16
|
export declare const dropdownMenuIconSize: {
|
|
12
17
|
sm: string;
|
|
13
18
|
md: string;
|
|
@@ -8,6 +8,11 @@ export var dropDownMenuItemSize = {
|
|
|
8
8
|
md: "h-10 !py-3 !px-4",
|
|
9
9
|
lg: "h-12 !py-3 !px-4",
|
|
10
10
|
};
|
|
11
|
+
export var dropDownSubMenuItemSize = {
|
|
12
|
+
sm: "!p-3",
|
|
13
|
+
md: "!py-3 !px-4",
|
|
14
|
+
lg: "!py-3 !px-4",
|
|
15
|
+
};
|
|
11
16
|
// Map dropdown menu size to icon size
|
|
12
17
|
export var dropdownMenuIconSize = {
|
|
13
18
|
sm: "sm",
|
|
@@ -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;
|