linkedunion-design-kit 1.11.12 → 1.11.15
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/src/components/Button/Button/Button.js +1 -1
- package/dist/src/components/Button/index.js +7 -7
- 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/styles/global.css +15 -3
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ import { buttonStyles } from "..";
|
|
|
38
38
|
export var variant = {
|
|
39
39
|
fill: "",
|
|
40
40
|
link: "lu-bg-transparent hover:lu-bg-transparent focus:lu-bg-transparent active:lu-bg-transparent !p-0 underline-offset-4 hover:underline border-none font-normal leading-normal",
|
|
41
|
-
outline: "lu-border
|
|
41
|
+
outline: "lu-border",
|
|
42
42
|
ghost: "lu-bg-transparent border-none",
|
|
43
43
|
};
|
|
44
44
|
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer", {
|
|
@@ -48,19 +48,19 @@ export var buttonStyles = {
|
|
|
48
48
|
sm: "!text-sm",
|
|
49
49
|
},
|
|
50
50
|
outlineColor: {
|
|
51
|
-
blue: "text-blue-600 hover:bg-blue-700 hover:text-blue-50 active:bg-blue-800 active:text-blue-50",
|
|
51
|
+
blue: "bg-transparent text-blue-600 hover:bg-blue-700 hover:text-blue-50 active:bg-blue-800 active:text-blue-50",
|
|
52
52
|
"light-blue": "bg-blue-100 text-blue-600 hover:bg-blue-700 hover:text-blue-50 active:bg-blue-800 active:text-blue-50",
|
|
53
|
-
green: "text-green-600 hover:bg-green-700 hover:text-green-50 active:bg-green-800 active:text-green-50",
|
|
53
|
+
green: "bg-transparent text-green-600 hover:bg-green-700 hover:text-green-50 active:bg-green-800 active:text-green-50",
|
|
54
54
|
"light-green": "bg-green-100 text-green-600 hover:bg-green-700 hover:text-green-50 active:bg-green-800 active:text-green-50",
|
|
55
|
-
yellow: "text-yellow-500 hover:bg-yellow-600 hover:text-yellow-950 active:bg-yellow-700 active:text-yellow-950",
|
|
56
|
-
"light-yellow": "bg-yellow-100 text-yellow-950 hover:bg-yellow-600 active:bg-yellow-700",
|
|
57
|
-
red: "text-red-600 hover:bg-red-700 hover:text-red-50 active:bg-red-800 active:text-red-50",
|
|
55
|
+
yellow: "bg-yellow-50 text-yellow-950 border-yellow-500 hover:bg-yellow-600 hover:text-yellow-950 focus-visible:bg-yellow-600 focus-visible:text-yellow-950 focus-visible:ring-2 focus-visible:ring-yellow-500 focus-visible:ring-offset-2 active:bg-yellow-700 active:text-yellow-950",
|
|
56
|
+
"light-yellow": "bg-yellow-100 text-yellow-950 border-yellow-500 hover:bg-yellow-600 focus-visible:bg-yellow-600 focus-visible:text-yellow-950 focus-visible:ring-2 focus-visible:ring-yellow-500 focus-visible:ring-offset-2 active:bg-yellow-700",
|
|
57
|
+
red: "bg-transparent text-red-600 hover:bg-red-700 hover:text-red-50 active:bg-red-800 active:text-red-50",
|
|
58
58
|
"light-red": "bg-red-100 text-red-600 hover:bg-red-700 hover:text-red-50 active:bg-red-800 active:text-red-50",
|
|
59
|
-
indigo: "text-indigo-600 hover:bg-indigo-700 hover:text-indigo-50 active:bg-indigo-800 active:text-indigo-50",
|
|
59
|
+
indigo: "bg-transparent text-indigo-600 hover:bg-indigo-700 hover:text-indigo-50 active:bg-indigo-800 active:text-indigo-50",
|
|
60
60
|
"light-indigo": "bg-indigo-100 text-indigo-600 hover:bg-indigo-700 hover:text-indigo-50 active:bg-indigo-800 active:text-indigo-50",
|
|
61
61
|
gray: "bg-gray-50 border-gray-200 text-gray-950 hover:bg-gray-100 hover:text-gray-950 active:bg-gray-300 active:text-gray-950",
|
|
62
62
|
"light-gray": "text-gray-900 border-gray-900 bg-gray-100 hover:text-gray-950 active:bg-gray-300 active:text-gray-950",
|
|
63
|
-
disabled: "text-gray-300",
|
|
63
|
+
disabled: "bg-transparent text-gray-300",
|
|
64
64
|
},
|
|
65
65
|
ghostColor: {
|
|
66
66
|
blue: "text-blue-600 hover:bg-blue-100 active:bg-blue-600 active:text-blue-50",
|
|
@@ -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",
|
package/dist/styles/global.css
CHANGED
|
@@ -1360,6 +1360,11 @@
|
|
|
1360
1360
|
border-bottom-right-radius: var(--radius-2xl);
|
|
1361
1361
|
border-bottom-left-radius: var(--radius-2xl);
|
|
1362
1362
|
}
|
|
1363
|
+
.lu-border {
|
|
1364
|
+
border-width: 1px;
|
|
1365
|
+
border-style: solid;
|
|
1366
|
+
border-color: currentColor;
|
|
1367
|
+
}
|
|
1363
1368
|
.\!border {
|
|
1364
1369
|
border-style: var(--tw-border-style) !important;
|
|
1365
1370
|
border-width: 1px !important;
|
|
@@ -2595,9 +2600,6 @@
|
|
|
2595
2600
|
.\[--cell-size\:--spacing\(6\)\] {
|
|
2596
2601
|
--cell-size: calc(var(--spacing) * 6);
|
|
2597
2602
|
}
|
|
2598
|
-
.lu-border {
|
|
2599
|
-
border: 1px solid currentColor;
|
|
2600
|
-
}
|
|
2601
2603
|
.running {
|
|
2602
2604
|
animation-play-state: running;
|
|
2603
2605
|
}
|
|
@@ -3962,6 +3964,16 @@
|
|
|
3962
3964
|
background-color: #fffdf5;
|
|
3963
3965
|
}
|
|
3964
3966
|
}
|
|
3967
|
+
.focus-visible\:bg-yellow-600 {
|
|
3968
|
+
&:focus-visible {
|
|
3969
|
+
background-color: #ffc700;
|
|
3970
|
+
}
|
|
3971
|
+
}
|
|
3972
|
+
.focus-visible\:text-yellow-950 {
|
|
3973
|
+
&:focus-visible {
|
|
3974
|
+
color: #473800;
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3965
3977
|
.focus-visible\:ring-2 {
|
|
3966
3978
|
&:focus-visible {
|
|
3967
3979
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|