linkedunion-design-kit 1.11.6-beta.3 → 1.11.8
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 +0 -1
- package/dist/index.js +0 -1
- package/dist/src/components/Button/index.js +1 -1
- package/dist/src/components/DatePicker/DatePicker.jsx +1 -1
- package/dist/src/components/DateRangePicker/DateRangePicker.jsx +1 -1
- package/dist/src/components/Dropdown/Combobox/Combobox.jsx +1 -1
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.jsx +3 -3
- package/dist/src/components/TimePicker/TimePicker.jsx +1 -1
- package/dist/styles/global.css +4 -40
- package/package.json +3 -3
- package/dist/src/components/Popover/Popover.stories.d.ts +0 -74
- package/dist/src/components/Popover/Popover.stories.jsx +0 -544
- package/dist/src/components/Popover/index.d.ts +0 -1
- package/dist/src/components/Popover/index.js +0 -1
- /package/dist/src/components/{Popover → ui}/popover.d.ts +0 -0
- /package/dist/src/components/{Popover → ui}/popover.jsx +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -40,4 +40,3 @@ export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
|
|
40
40
|
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
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, } from "./src/components/Popover/popover";
|
package/dist/index.js
CHANGED
|
@@ -39,4 +39,3 @@ export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
|
|
39
39
|
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
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, } from "./src/components/Popover/popover";
|
|
@@ -18,7 +18,7 @@ export var buttonStyles = {
|
|
|
18
18
|
},
|
|
19
19
|
size: {
|
|
20
20
|
xl: "h-13 !py-3.5 !px-6 !text-base !font-normal !leading-normal",
|
|
21
|
-
lg: "h-12 !py-3 !px-5 !text-base font-normal !leading-normal",
|
|
21
|
+
lg: "h-12 !py-3 !px-5 !text-base !font-normal !leading-normal",
|
|
22
22
|
md: "h-10 !py-2.5 !px-5 !text-sm !font-normal !leading-5",
|
|
23
23
|
sm: "h-9 !py-2 !px-3 !text-sm !font-normal !leading-5",
|
|
24
24
|
},
|
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { format } from "date-fns";
|
|
14
14
|
import { cn } from "../../lib/utils";
|
|
15
15
|
import { Calendar } from "../ui/calendar";
|
|
16
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../
|
|
16
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
17
17
|
import LUIcon from "../Icons/LUIcon";
|
|
18
18
|
import { getIconSize, getPadding, getIconPosition } from "../Input";
|
|
19
19
|
import { inputVariantConfig, inputVariants } from "../Input/input";
|
|
@@ -22,7 +22,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
22
22
|
import { format, startOfDay } from "date-fns";
|
|
23
23
|
import { cn } from "../../lib/utils";
|
|
24
24
|
import { Calendar } from "../ui/calendar";
|
|
25
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../
|
|
25
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
26
26
|
import LUIcon from "../Icons/LUIcon";
|
|
27
27
|
import { getIconSize, getPadding, getIconPosition } from "../Input";
|
|
28
28
|
import { inputVariantConfig, inputVariants } from "../Input/input";
|
|
@@ -13,7 +13,7 @@ import { cn } from "../../../lib/utils";
|
|
|
13
13
|
import { Badge } from "../../../components/Badge/Badge";
|
|
14
14
|
import { renderBadge } from "./utils/renderBadge";
|
|
15
15
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "../../../components/ui/command";
|
|
16
|
-
import { Popover, PopoverContent, PopoverTrigger, } from "../../../components/
|
|
16
|
+
import { Popover, PopoverContent, PopoverTrigger, } from "../../../components/ui/popover";
|
|
17
17
|
import { Button } from "../../../components/Button/Button/Button";
|
|
18
18
|
import LUIcon from "../../../components/Icons/LUIcon";
|
|
19
19
|
import { Checkbox } from "../../../components/Checkbox/checkbox";
|
|
@@ -47,7 +47,7 @@ var DropdownMenuContent = React.forwardRef(function (_a, ref) {
|
|
|
47
47
|
return (<DropdownMenuPrimitive.Portal>
|
|
48
48
|
<DropdownMenuSizeContext.Provider value={size}>
|
|
49
49
|
<DropdownMenuPrimitive.Content data-reset={Reset_BS} ref={ref} sideOffset={sideOffset} align={align} // Pass align prop to DropdownMenuPrimitive.Content
|
|
50
|
-
className={cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-sm bg-white !p-2 text-gray-900 shadow-backdrop-shadow-lg", "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]", dropdownMenuSize[size]
|
|
50
|
+
className={cn(className, "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-sm bg-white !p-2 text-gray-900 shadow-backdrop-shadow-lg", "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]", dropdownMenuSize[size])} {...props}/>
|
|
51
51
|
</DropdownMenuSizeContext.Provider>
|
|
52
52
|
</DropdownMenuPrimitive.Portal>);
|
|
53
53
|
});
|
|
@@ -57,7 +57,7 @@ var DropdownMenuItem = React.forwardRef(function (_a, ref) {
|
|
|
57
57
|
var className = _a.className, inset = _a.inset, selected = _a.selected, size = _a.size, props = __rest(_a, ["className", "inset", "selected", "size"]);
|
|
58
58
|
var inheritedSize = React.useContext(DropdownMenuSizeContext);
|
|
59
59
|
var effectiveSize = (_b = size !== null && size !== void 0 ? size : inheritedSize) !== null && _b !== void 0 ? _b : "md";
|
|
60
|
-
return (<DropdownMenuPrimitive.Item ref={ref} data-reset={Reset_BS} className={cn("relative flex cursor-pointer select-none items-center gap-2 rounded-sm outline-none transition-colors text-gray-900 hover:bg-blue-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:bg-gray-100 data-[disabled]:text-gray-300 [&>svg]:shrink-0", dropdownMenuIconSize[effectiveSize], dropdownMenuSize[effectiveSize], dropDownMenuItemSize[effectiveSize], inset && "pl-8", selected && "bg-blue-50 text-blue-600", // Apply styles for selected item
|
|
60
|
+
return (<DropdownMenuPrimitive.Item ref={ref} data-reset={Reset_BS} className={cn("relative font-normal! flex cursor-pointer select-none items-center gap-2 rounded-sm outline-none transition-colors text-gray-900 hover:bg-blue-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:bg-gray-100 data-[disabled]:text-gray-300 [&>svg]:shrink-0", dropdownMenuIconSize[effectiveSize], dropdownMenuSize[effectiveSize], dropDownMenuItemSize[effectiveSize], inset && "pl-8", selected && "bg-blue-50 text-blue-600", // Apply styles for selected item
|
|
61
61
|
className)} {...props}/>);
|
|
62
62
|
});
|
|
63
63
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
@@ -87,7 +87,7 @@ var DropdownMenuRadioItem = React.forwardRef(function (_a, ref) {
|
|
|
87
87
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
88
88
|
var DropdownMenuLabel = React.forwardRef(function (_a, ref) {
|
|
89
89
|
var className = _a.className, inset = _a.inset, props = __rest(_a, ["className", "inset"]);
|
|
90
|
-
return (<DropdownMenuPrimitive.Label ref={ref} className={cn("!px-2 !py-1.5 text-sm font-semibold", inset && "pl-8"
|
|
90
|
+
return (<DropdownMenuPrimitive.Label ref={ref} className={cn(className, "!px-2 !py-1.5 text-sm font-semibold", inset && "pl-8")} {...props}/>);
|
|
91
91
|
});
|
|
92
92
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
93
93
|
var DropdownMenuSeparator = React.forwardRef(function (_a, ref) {
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
import { cn } from "../../lib/utils";
|
|
14
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../
|
|
14
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
15
15
|
import LUIcon from "../Icons/LUIcon";
|
|
16
16
|
import { getIconSize, getPadding, getIconPosition } from "../Input";
|
|
17
17
|
import { Button } from "../Button/Button/Button";
|
package/dist/styles/global.css
CHANGED
|
@@ -349,9 +349,6 @@
|
|
|
349
349
|
.order-last {
|
|
350
350
|
order: 9999;
|
|
351
351
|
}
|
|
352
|
-
.col-span-2 {
|
|
353
|
-
grid-column: span 2 / span 2;
|
|
354
|
-
}
|
|
355
352
|
.container {
|
|
356
353
|
width: 100%;
|
|
357
354
|
@media (width >= 480px) {
|
|
@@ -784,9 +781,6 @@
|
|
|
784
781
|
.min-h-\[42px\] {
|
|
785
782
|
min-height: 42px;
|
|
786
783
|
}
|
|
787
|
-
.min-h-\[300px\] {
|
|
788
|
-
min-height: 300px;
|
|
789
|
-
}
|
|
790
784
|
.min-h-screen {
|
|
791
785
|
min-height: 100vh;
|
|
792
786
|
}
|
|
@@ -889,9 +883,6 @@
|
|
|
889
883
|
.w-64 {
|
|
890
884
|
width: calc(var(--spacing) * 64);
|
|
891
885
|
}
|
|
892
|
-
.w-72 {
|
|
893
|
-
width: calc(var(--spacing) * 72);
|
|
894
|
-
}
|
|
895
886
|
.w-80 {
|
|
896
887
|
width: calc(var(--spacing) * 80);
|
|
897
888
|
}
|
|
@@ -1118,9 +1109,6 @@
|
|
|
1118
1109
|
.items-center {
|
|
1119
1110
|
align-items: center;
|
|
1120
1111
|
}
|
|
1121
|
-
.items-end {
|
|
1122
|
-
align-items: flex-end;
|
|
1123
|
-
}
|
|
1124
1112
|
.items-start {
|
|
1125
1113
|
align-items: flex-start;
|
|
1126
1114
|
}
|
|
@@ -1195,13 +1183,6 @@
|
|
|
1195
1183
|
margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
|
|
1196
1184
|
}
|
|
1197
1185
|
}
|
|
1198
|
-
.space-y-3 {
|
|
1199
|
-
:where(& > :not(:last-child)) {
|
|
1200
|
-
--tw-space-y-reverse: 0;
|
|
1201
|
-
margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));
|
|
1202
|
-
margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
1186
|
.space-y-4 {
|
|
1206
1187
|
:where(& > :not(:last-child)) {
|
|
1207
1188
|
--tw-space-y-reverse: 0;
|
|
@@ -1251,15 +1232,6 @@
|
|
|
1251
1232
|
margin-inline-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)));
|
|
1252
1233
|
}
|
|
1253
1234
|
}
|
|
1254
|
-
.divide-y {
|
|
1255
|
-
:where(& > :not(:last-child)) {
|
|
1256
|
-
--tw-divide-y-reverse: 0;
|
|
1257
|
-
border-bottom-style: var(--tw-border-style);
|
|
1258
|
-
border-top-style: var(--tw-border-style);
|
|
1259
|
-
border-top-width: calc(1px * var(--tw-divide-y-reverse));
|
|
1260
|
-
border-bottom-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
1235
|
.truncate {
|
|
1264
1236
|
overflow: hidden;
|
|
1265
1237
|
text-overflow: ellipsis;
|
|
@@ -1935,9 +1907,6 @@
|
|
|
1935
1907
|
.\!pt-4 {
|
|
1936
1908
|
padding-top: calc(var(--spacing) * 4) !important;
|
|
1937
1909
|
}
|
|
1938
|
-
.pt-3 {
|
|
1939
|
-
padding-top: calc(var(--spacing) * 3);
|
|
1940
|
-
}
|
|
1941
1910
|
.\!pr-2 {
|
|
1942
1911
|
padding-right: calc(var(--spacing) * 2) !important;
|
|
1943
1912
|
}
|
|
@@ -1989,9 +1958,6 @@
|
|
|
1989
1958
|
.text-left {
|
|
1990
1959
|
text-align: left;
|
|
1991
1960
|
}
|
|
1992
|
-
.text-right {
|
|
1993
|
-
text-align: right;
|
|
1994
|
-
}
|
|
1995
1961
|
.text-start {
|
|
1996
1962
|
text-align: start;
|
|
1997
1963
|
}
|
|
@@ -2123,6 +2089,10 @@
|
|
|
2123
2089
|
--tw-font-weight: var(--font-weight-normal);
|
|
2124
2090
|
font-weight: var(--font-weight-normal);
|
|
2125
2091
|
}
|
|
2092
|
+
.font-normal\! {
|
|
2093
|
+
--tw-font-weight: var(--font-weight-normal) !important;
|
|
2094
|
+
font-weight: var(--font-weight-normal) !important;
|
|
2095
|
+
}
|
|
2126
2096
|
.font-semibold {
|
|
2127
2097
|
--tw-font-weight: var(--font-weight-semibold);
|
|
2128
2098
|
font-weight: var(--font-weight-semibold);
|
|
@@ -5549,11 +5519,6 @@
|
|
|
5549
5519
|
inherits: false;
|
|
5550
5520
|
initial-value: 0;
|
|
5551
5521
|
}
|
|
5552
|
-
@property --tw-divide-y-reverse {
|
|
5553
|
-
syntax: "*";
|
|
5554
|
-
inherits: false;
|
|
5555
|
-
initial-value: 0;
|
|
5556
|
-
}
|
|
5557
5522
|
@property --tw-border-style {
|
|
5558
5523
|
syntax: "*";
|
|
5559
5524
|
inherits: false;
|
|
@@ -5795,7 +5760,6 @@
|
|
|
5795
5760
|
--tw-skew-y: initial;
|
|
5796
5761
|
--tw-space-y-reverse: 0;
|
|
5797
5762
|
--tw-space-x-reverse: 0;
|
|
5798
|
-
--tw-divide-y-reverse: 0;
|
|
5799
5763
|
--tw-border-style: solid;
|
|
5800
5764
|
--tw-gradient-position: initial;
|
|
5801
5765
|
--tw-gradient-from: #0000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linkedunion-design-kit",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"init": "^0.1.2",
|
|
71
71
|
"linkedunion-design-kit": "^1.6.0",
|
|
72
72
|
"lucide-react": "^0.488.0",
|
|
73
|
-
"next": "^15.
|
|
73
|
+
"next": "^15.5.10",
|
|
74
74
|
"radio-group": "^0.0.2",
|
|
75
75
|
"react": "^19.0.0",
|
|
76
76
|
"react-day-picker": "^9.11.1",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"postcss": "^8.4.49",
|
|
120
120
|
"postcss-cli": "^11.0.0",
|
|
121
121
|
"prettier": "^3.5.2",
|
|
122
|
-
"storybook": "^8.
|
|
122
|
+
"storybook": "^8.6.15",
|
|
123
123
|
"tailwindcss": "^4.1.3",
|
|
124
124
|
"ts-node": "^10.9.2",
|
|
125
125
|
"typescript": "^5"
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Popover } from "./popover";
|
|
3
|
-
declare const meta: Meta<typeof Popover>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
interface InteractiveArgs {
|
|
7
|
-
align: "start" | "center" | "end";
|
|
8
|
-
side: "top" | "right" | "bottom" | "left";
|
|
9
|
-
sideOffset: number;
|
|
10
|
-
triggerLabel: string;
|
|
11
|
-
title: string;
|
|
12
|
-
description: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Interactive playground to test different popover configurations.
|
|
16
|
-
* Use the Controls panel to customize alignment, side, offset, and content.
|
|
17
|
-
*/
|
|
18
|
-
export declare const Interactive: StoryObj<InteractiveArgs>;
|
|
19
|
-
/**
|
|
20
|
-
* Default demo popover with a dimension settings form.
|
|
21
|
-
* Matches the standard shadcn/ui popover demo pattern with labeled input fields.
|
|
22
|
-
*/
|
|
23
|
-
export declare const Default: Story;
|
|
24
|
-
/**
|
|
25
|
-
* Basic popover with a title and description.
|
|
26
|
-
* Demonstrates the simplest content structure.
|
|
27
|
-
*/
|
|
28
|
-
export declare const Basic: Story;
|
|
29
|
-
/**
|
|
30
|
-
* Demonstrates the three horizontal alignment options for popover content:
|
|
31
|
-
* start, center, and end. Each aligns the popover differently relative
|
|
32
|
-
* to the trigger element.
|
|
33
|
-
*/
|
|
34
|
-
export declare const Alignment: Story;
|
|
35
|
-
/**
|
|
36
|
-
* Popover containing a form with grouped input fields.
|
|
37
|
-
* Demonstrates the common pattern of inline editing within a popover.
|
|
38
|
-
*/
|
|
39
|
-
export declare const Form: Story;
|
|
40
|
-
/**
|
|
41
|
-
* Demonstrates RTL (right-to-left) support for languages like Arabic and Hebrew.
|
|
42
|
-
* Uses the dir prop and side positioning for correct RTL layout.
|
|
43
|
-
*/
|
|
44
|
-
export declare const RTLSupport: Story;
|
|
45
|
-
/**
|
|
46
|
-
* Demonstrates all four side positions for the popover:
|
|
47
|
-
* top, right, bottom, and left.
|
|
48
|
-
*/
|
|
49
|
-
export declare const SidePositions: Story;
|
|
50
|
-
/**
|
|
51
|
-
* Demonstrates using PopoverAnchor to position the popover relative
|
|
52
|
-
* to a different element than the trigger.
|
|
53
|
-
*/
|
|
54
|
-
export declare const WithAnchor: Story;
|
|
55
|
-
/**
|
|
56
|
-
* Notification popover showing a list of recent notifications.
|
|
57
|
-
*/
|
|
58
|
-
export declare const NotificationList: Story;
|
|
59
|
-
/**
|
|
60
|
-
* User profile popover showing account details and actions.
|
|
61
|
-
*/
|
|
62
|
-
export declare const UserProfileCard: Story;
|
|
63
|
-
/**
|
|
64
|
-
* Popover with a large amount of text content to test overflow and scrolling behavior.
|
|
65
|
-
*/
|
|
66
|
-
export declare const LongContent: Story;
|
|
67
|
-
/**
|
|
68
|
-
* Popover with minimal content to verify it renders correctly with little data.
|
|
69
|
-
*/
|
|
70
|
-
export declare const MinimalContent: Story;
|
|
71
|
-
/**
|
|
72
|
-
* Popover in a default open state, useful for testing and documentation screenshots.
|
|
73
|
-
*/
|
|
74
|
-
export declare const DefaultOpen: Story;
|
|
@@ -1,544 +0,0 @@
|
|
|
1
|
-
import { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, } from "./popover";
|
|
2
|
-
import { Button } from "../Button/Button/Button";
|
|
3
|
-
import { Input } from "../Input/input";
|
|
4
|
-
import { Label } from "../Label/Label";
|
|
5
|
-
import { Heading } from "../Typography/Heading/heading";
|
|
6
|
-
import { Body } from "../Typography/Body/body";
|
|
7
|
-
// Reusable className constants for PopoverContent styling
|
|
8
|
-
var POPOVER_BASE_CLASSES = "rounded-md border bg-white shadow-md";
|
|
9
|
-
var POPOVER_WIDE = "w-80 ".concat(POPOVER_BASE_CLASSES, " p-4"); // 320px width
|
|
10
|
-
var POPOVER_MEDIUM = "w-64 ".concat(POPOVER_BASE_CLASSES, " p-4"); // 256px width
|
|
11
|
-
var POPOVER_NARROW = "w-48 ".concat(POPOVER_BASE_CLASSES, " p-3"); // 192px width
|
|
12
|
-
var POPOVER_LARGE = "w-72 ".concat(POPOVER_BASE_CLASSES, " p-4"); // 288px width
|
|
13
|
-
var POPOVER_WIDE_NO_PADDING = "w-80 ".concat(POPOVER_BASE_CLASSES, " p-0");
|
|
14
|
-
var POPOVER_WIDE_SCROLLABLE = "w-80 max-h-64 overflow-y-auto ".concat(POPOVER_BASE_CLASSES, " p-4");
|
|
15
|
-
var POPOVER_MINIMAL = "".concat(POPOVER_BASE_CLASSES, " px-3 py-2");
|
|
16
|
-
var meta = {
|
|
17
|
-
title: "Components/Popover",
|
|
18
|
-
component: Popover,
|
|
19
|
-
tags: ["autodocs"],
|
|
20
|
-
parameters: {
|
|
21
|
-
layout: "centered",
|
|
22
|
-
docs: {
|
|
23
|
-
description: {
|
|
24
|
-
component: "A floating panel that appears when a trigger element is clicked. Built on Radix UI Popover primitives with animated enter/exit transitions.",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
decorators: [
|
|
29
|
-
function (Story) { return (<div className="flex items-center justify-center min-h-[300px]">
|
|
30
|
-
<Story />
|
|
31
|
-
</div>); },
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
export default meta;
|
|
35
|
-
/**
|
|
36
|
-
* Interactive playground to test different popover configurations.
|
|
37
|
-
* Use the Controls panel to customize alignment, side, offset, and content.
|
|
38
|
-
*/
|
|
39
|
-
export var Interactive = {
|
|
40
|
-
args: {
|
|
41
|
-
align: "center",
|
|
42
|
-
side: "bottom",
|
|
43
|
-
sideOffset: 4,
|
|
44
|
-
triggerLabel: "Open Popover",
|
|
45
|
-
title: "Popover Title",
|
|
46
|
-
description: "This is a popover with customizable placement and content.",
|
|
47
|
-
},
|
|
48
|
-
argTypes: {
|
|
49
|
-
align: {
|
|
50
|
-
control: "select",
|
|
51
|
-
options: ["start", "center", "end"],
|
|
52
|
-
description: "Horizontal alignment relative to the trigger",
|
|
53
|
-
},
|
|
54
|
-
side: {
|
|
55
|
-
control: "select",
|
|
56
|
-
options: ["top", "right", "bottom", "left"],
|
|
57
|
-
description: "Which side of the trigger the popover appears on",
|
|
58
|
-
},
|
|
59
|
-
sideOffset: {
|
|
60
|
-
control: { type: "number", min: 0, max: 24 },
|
|
61
|
-
description: "Distance in pixels between the trigger and the popover",
|
|
62
|
-
},
|
|
63
|
-
triggerLabel: {
|
|
64
|
-
control: "text",
|
|
65
|
-
description: "Text for the trigger button",
|
|
66
|
-
},
|
|
67
|
-
title: {
|
|
68
|
-
control: "text",
|
|
69
|
-
description: "The popover title text",
|
|
70
|
-
},
|
|
71
|
-
description: {
|
|
72
|
-
control: "text",
|
|
73
|
-
description: "The popover description text",
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
render: function (args) { return (<Popover>
|
|
77
|
-
<PopoverTrigger asChild>
|
|
78
|
-
<Button variant="outline">{args.triggerLabel}</Button>
|
|
79
|
-
</PopoverTrigger>
|
|
80
|
-
<PopoverContent align={args.align} side={args.side} sideOffset={args.sideOffset} className={POPOVER_WIDE}>
|
|
81
|
-
<div className="space-y-2">
|
|
82
|
-
<Heading variant="h4-500">{args.title}</Heading>
|
|
83
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
84
|
-
{args.description}
|
|
85
|
-
</Body>
|
|
86
|
-
</div>
|
|
87
|
-
</PopoverContent>
|
|
88
|
-
</Popover>); },
|
|
89
|
-
};
|
|
90
|
-
// ============================================================================
|
|
91
|
-
// DEMO (DEFAULT) - Dimension form matching shadcn reference
|
|
92
|
-
// ============================================================================
|
|
93
|
-
/**
|
|
94
|
-
* Default demo popover with a dimension settings form.
|
|
95
|
-
* Matches the standard shadcn/ui popover demo pattern with labeled input fields.
|
|
96
|
-
*/
|
|
97
|
-
export var Default = {
|
|
98
|
-
render: function () { return (<Popover>
|
|
99
|
-
<PopoverTrigger asChild>
|
|
100
|
-
<Button variant="outline">Open Popover</Button>
|
|
101
|
-
</PopoverTrigger>
|
|
102
|
-
<PopoverContent className={POPOVER_WIDE}>
|
|
103
|
-
<div className="grid gap-4">
|
|
104
|
-
<div className="space-y-2">
|
|
105
|
-
<Heading variant="h4-500">Dimensions</Heading>
|
|
106
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
107
|
-
Set the dimensions for the layer.
|
|
108
|
-
</Body>
|
|
109
|
-
</div>
|
|
110
|
-
<div className="grid gap-2">
|
|
111
|
-
<div className="grid grid-cols-3 items-center gap-4">
|
|
112
|
-
<Label>Width</Label>
|
|
113
|
-
<Input defaultValue="100%" className="col-span-2 h-8"/>
|
|
114
|
-
</div>
|
|
115
|
-
<div className="grid grid-cols-3 items-center gap-4">
|
|
116
|
-
<Label>Max Width</Label>
|
|
117
|
-
<Input defaultValue="300px" className="col-span-2 h-8"/>
|
|
118
|
-
</div>
|
|
119
|
-
<div className="grid grid-cols-3 items-center gap-4">
|
|
120
|
-
<Label>Height</Label>
|
|
121
|
-
<Input defaultValue="25px" className="col-span-2 h-8"/>
|
|
122
|
-
</div>
|
|
123
|
-
<div className="grid grid-cols-3 items-center gap-4">
|
|
124
|
-
<Label>Max Height</Label>
|
|
125
|
-
<Input defaultValue="none" className="col-span-2 h-8"/>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
</PopoverContent>
|
|
130
|
-
</Popover>); },
|
|
131
|
-
};
|
|
132
|
-
// ============================================================================
|
|
133
|
-
// BASIC - Simple popover with title and description
|
|
134
|
-
// ============================================================================
|
|
135
|
-
/**
|
|
136
|
-
* Basic popover with a title and description.
|
|
137
|
-
* Demonstrates the simplest content structure.
|
|
138
|
-
*/
|
|
139
|
-
export var Basic = {
|
|
140
|
-
render: function () { return (<Popover>
|
|
141
|
-
<PopoverTrigger asChild>
|
|
142
|
-
<Button variant="outline">Open Popover</Button>
|
|
143
|
-
</PopoverTrigger>
|
|
144
|
-
<PopoverContent className={POPOVER_WIDE}>
|
|
145
|
-
<div className="space-y-2">
|
|
146
|
-
<Heading variant="h4-500">Popover Title</Heading>
|
|
147
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
148
|
-
This is a basic popover with a title and description. Use it to
|
|
149
|
-
display additional context or information.
|
|
150
|
-
</Body>
|
|
151
|
-
</div>
|
|
152
|
-
</PopoverContent>
|
|
153
|
-
</Popover>); },
|
|
154
|
-
};
|
|
155
|
-
// ============================================================================
|
|
156
|
-
// ALIGNMENT - All three alignment variants shown together
|
|
157
|
-
// ============================================================================
|
|
158
|
-
/**
|
|
159
|
-
* Demonstrates the three horizontal alignment options for popover content:
|
|
160
|
-
* start, center, and end. Each aligns the popover differently relative
|
|
161
|
-
* to the trigger element.
|
|
162
|
-
*/
|
|
163
|
-
export var Alignment = {
|
|
164
|
-
render: function () { return (<div className="flex items-end gap-8">
|
|
165
|
-
<div className="flex flex-col items-center gap-2">
|
|
166
|
-
<Popover>
|
|
167
|
-
<PopoverTrigger asChild>
|
|
168
|
-
<Button variant="outline">Align Start</Button>
|
|
169
|
-
</PopoverTrigger>
|
|
170
|
-
<PopoverContent align="start" className={POPOVER_MEDIUM}>
|
|
171
|
-
<div className="space-y-2">
|
|
172
|
-
<Heading variant="h4-500">Start Aligned</Heading>
|
|
173
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
174
|
-
The popover content is aligned to the start edge of the trigger.
|
|
175
|
-
</Body>
|
|
176
|
-
</div>
|
|
177
|
-
</PopoverContent>
|
|
178
|
-
</Popover>
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<div className="flex flex-col items-center gap-2">
|
|
182
|
-
<Popover>
|
|
183
|
-
<PopoverTrigger asChild>
|
|
184
|
-
<Button variant="outline">Align Center</Button>
|
|
185
|
-
</PopoverTrigger>
|
|
186
|
-
<PopoverContent align="center" className={POPOVER_MEDIUM}>
|
|
187
|
-
<div className="space-y-2">
|
|
188
|
-
<Heading variant="h4-500">Center Aligned</Heading>
|
|
189
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
190
|
-
The popover content is centered relative to the trigger.
|
|
191
|
-
</Body>
|
|
192
|
-
</div>
|
|
193
|
-
</PopoverContent>
|
|
194
|
-
</Popover>
|
|
195
|
-
</div>
|
|
196
|
-
|
|
197
|
-
<div className="flex flex-col items-center gap-2">
|
|
198
|
-
<Popover>
|
|
199
|
-
<PopoverTrigger asChild>
|
|
200
|
-
<Button variant="outline">Align End</Button>
|
|
201
|
-
</PopoverTrigger>
|
|
202
|
-
<PopoverContent align="end" className={POPOVER_MEDIUM}>
|
|
203
|
-
<div className="space-y-2">
|
|
204
|
-
<Heading variant="h4-500">End Aligned</Heading>
|
|
205
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
206
|
-
The popover content is aligned to the end edge of the trigger.
|
|
207
|
-
</Body>
|
|
208
|
-
</div>
|
|
209
|
-
</PopoverContent>
|
|
210
|
-
</Popover>
|
|
211
|
-
</div>
|
|
212
|
-
</div>); },
|
|
213
|
-
};
|
|
214
|
-
// ============================================================================
|
|
215
|
-
// FORM - Popover with form fields
|
|
216
|
-
// ============================================================================
|
|
217
|
-
/**
|
|
218
|
-
* Popover containing a form with grouped input fields.
|
|
219
|
-
* Demonstrates the common pattern of inline editing within a popover.
|
|
220
|
-
*/
|
|
221
|
-
export var Form = {
|
|
222
|
-
render: function () { return (<Popover>
|
|
223
|
-
<PopoverTrigger asChild>
|
|
224
|
-
<Button variant="outline">Edit Profile</Button>
|
|
225
|
-
</PopoverTrigger>
|
|
226
|
-
<PopoverContent className={POPOVER_WIDE}>
|
|
227
|
-
<div className="grid gap-4">
|
|
228
|
-
<div className="space-y-2">
|
|
229
|
-
<Heading variant="h4-500">Edit Profile</Heading>
|
|
230
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
231
|
-
Update your display name and email address.
|
|
232
|
-
</Body>
|
|
233
|
-
</div>
|
|
234
|
-
<div className="grid gap-3">
|
|
235
|
-
<div className="grid grid-cols-3 items-center gap-4">
|
|
236
|
-
<Label>Name</Label>
|
|
237
|
-
<Input defaultValue="John Doe" className="col-span-2 h-8"/>
|
|
238
|
-
</div>
|
|
239
|
-
<div className="grid grid-cols-3 items-center gap-4">
|
|
240
|
-
<Label>Email</Label>
|
|
241
|
-
<Input defaultValue="john@example.com" className="col-span-2 h-8"/>
|
|
242
|
-
</div>
|
|
243
|
-
<div className="grid grid-cols-3 items-center gap-4">
|
|
244
|
-
<Label>Phone</Label>
|
|
245
|
-
<Input defaultValue="555-0123" className="col-span-2 h-8"/>
|
|
246
|
-
</div>
|
|
247
|
-
</div>
|
|
248
|
-
<div className="flex justify-end gap-2">
|
|
249
|
-
<Button variant="outline" size="sm">
|
|
250
|
-
Cancel
|
|
251
|
-
</Button>
|
|
252
|
-
<Button size="sm">Save</Button>
|
|
253
|
-
</div>
|
|
254
|
-
</div>
|
|
255
|
-
</PopoverContent>
|
|
256
|
-
</Popover>); },
|
|
257
|
-
};
|
|
258
|
-
// ============================================================================
|
|
259
|
-
// RTL SUPPORT - Right-to-left layout
|
|
260
|
-
// ============================================================================
|
|
261
|
-
/**
|
|
262
|
-
* Demonstrates RTL (right-to-left) support for languages like Arabic and Hebrew.
|
|
263
|
-
* Uses the dir prop and side positioning for correct RTL layout.
|
|
264
|
-
*/
|
|
265
|
-
export var RTLSupport = {
|
|
266
|
-
render: function () { return (<div className="flex gap-8">
|
|
267
|
-
<Popover>
|
|
268
|
-
<PopoverTrigger asChild>
|
|
269
|
-
<Button variant="outline">English (LTR)</Button>
|
|
270
|
-
</PopoverTrigger>
|
|
271
|
-
<PopoverContent side="bottom" align="start" className="w-64 rounded-md border bg-white p-4 shadow-md">
|
|
272
|
-
<div className="space-y-2">
|
|
273
|
-
<Heading variant="h4-500">Settings</Heading>
|
|
274
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
275
|
-
Manage your account settings and preferences.
|
|
276
|
-
</Body>
|
|
277
|
-
</div>
|
|
278
|
-
</PopoverContent>
|
|
279
|
-
</Popover>
|
|
280
|
-
|
|
281
|
-
<div dir="rtl">
|
|
282
|
-
<Popover>
|
|
283
|
-
<PopoverTrigger asChild>
|
|
284
|
-
<Button variant="outline">RTL Layout</Button>
|
|
285
|
-
</PopoverTrigger>
|
|
286
|
-
<PopoverContent side="bottom" align="start" className={POPOVER_MEDIUM}>
|
|
287
|
-
<div className="space-y-2 text-right">
|
|
288
|
-
<Heading variant="h4-500">Settings</Heading>
|
|
289
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
290
|
-
This popover renders with right-to-left text direction and
|
|
291
|
-
alignment.
|
|
292
|
-
</Body>
|
|
293
|
-
</div>
|
|
294
|
-
</PopoverContent>
|
|
295
|
-
</Popover>
|
|
296
|
-
</div>
|
|
297
|
-
</div>); },
|
|
298
|
-
};
|
|
299
|
-
// ============================================================================
|
|
300
|
-
// SIDE VARIANTS
|
|
301
|
-
// ============================================================================
|
|
302
|
-
/**
|
|
303
|
-
* Demonstrates all four side positions for the popover:
|
|
304
|
-
* top, right, bottom, and left.
|
|
305
|
-
*/
|
|
306
|
-
export var SidePositions = {
|
|
307
|
-
render: function () { return (<div className="flex items-center gap-4">
|
|
308
|
-
<Popover>
|
|
309
|
-
<PopoverTrigger asChild>
|
|
310
|
-
<Button variant="outline">Top</Button>
|
|
311
|
-
</PopoverTrigger>
|
|
312
|
-
<PopoverContent side="top" className={POPOVER_NARROW}>
|
|
313
|
-
<Body variant="body-sm" className="text-gray-600">
|
|
314
|
-
Appears above the trigger.
|
|
315
|
-
</Body>
|
|
316
|
-
</PopoverContent>
|
|
317
|
-
</Popover>
|
|
318
|
-
|
|
319
|
-
<Popover>
|
|
320
|
-
<PopoverTrigger asChild>
|
|
321
|
-
<Button variant="outline">Right</Button>
|
|
322
|
-
</PopoverTrigger>
|
|
323
|
-
<PopoverContent side="right" className={POPOVER_NARROW}>
|
|
324
|
-
<Body variant="body-sm" className="text-gray-600">
|
|
325
|
-
Appears to the right.
|
|
326
|
-
</Body>
|
|
327
|
-
</PopoverContent>
|
|
328
|
-
</Popover>
|
|
329
|
-
|
|
330
|
-
<Popover>
|
|
331
|
-
<PopoverTrigger asChild>
|
|
332
|
-
<Button variant="outline">Bottom</Button>
|
|
333
|
-
</PopoverTrigger>
|
|
334
|
-
<PopoverContent side="bottom" className={POPOVER_NARROW}>
|
|
335
|
-
<Body variant="body-sm" className="text-gray-600">
|
|
336
|
-
Appears below the trigger.
|
|
337
|
-
</Body>
|
|
338
|
-
</PopoverContent>
|
|
339
|
-
</Popover>
|
|
340
|
-
|
|
341
|
-
<Popover>
|
|
342
|
-
<PopoverTrigger asChild>
|
|
343
|
-
<Button variant="outline">Left</Button>
|
|
344
|
-
</PopoverTrigger>
|
|
345
|
-
<PopoverContent side="left" className={POPOVER_NARROW}>
|
|
346
|
-
<Body variant="body-sm" className="text-gray-600">
|
|
347
|
-
Appears to the left.
|
|
348
|
-
</Body>
|
|
349
|
-
</PopoverContent>
|
|
350
|
-
</Popover>
|
|
351
|
-
</div>); },
|
|
352
|
-
};
|
|
353
|
-
// ============================================================================
|
|
354
|
-
// POPOVER ANCHOR
|
|
355
|
-
// ============================================================================
|
|
356
|
-
/**
|
|
357
|
-
* Demonstrates using PopoverAnchor to position the popover relative
|
|
358
|
-
* to a different element than the trigger.
|
|
359
|
-
*/
|
|
360
|
-
export var WithAnchor = {
|
|
361
|
-
render: function () { return (<Popover>
|
|
362
|
-
<div className="flex items-center gap-4">
|
|
363
|
-
<PopoverAnchor asChild>
|
|
364
|
-
<Input placeholder="Anchored here..." className="w-48"/>
|
|
365
|
-
</PopoverAnchor>
|
|
366
|
-
<PopoverTrigger asChild>
|
|
367
|
-
<Button variant="outline" size="sm">
|
|
368
|
-
Open
|
|
369
|
-
</Button>
|
|
370
|
-
</PopoverTrigger>
|
|
371
|
-
</div>
|
|
372
|
-
<PopoverContent className="w-64 rounded-md border bg-white p-4 shadow-md">
|
|
373
|
-
<Body variant="body-sm" className="text-gray-600">
|
|
374
|
-
This popover is anchored to the input field rather than the trigger
|
|
375
|
-
button. The content appears relative to the anchor element.
|
|
376
|
-
</Body>
|
|
377
|
-
</PopoverContent>
|
|
378
|
-
</Popover>); },
|
|
379
|
-
};
|
|
380
|
-
// ============================================================================
|
|
381
|
-
// REAL-WORLD USE CASES
|
|
382
|
-
// ============================================================================
|
|
383
|
-
/**
|
|
384
|
-
* Notification popover showing a list of recent notifications.
|
|
385
|
-
*/
|
|
386
|
-
export var NotificationList = {
|
|
387
|
-
render: function () { return (<Popover>
|
|
388
|
-
<PopoverTrigger asChild>
|
|
389
|
-
<Button variant="outline">Notifications (3)</Button>
|
|
390
|
-
</PopoverTrigger>
|
|
391
|
-
<PopoverContent className={POPOVER_WIDE_NO_PADDING}>
|
|
392
|
-
<div className="p-4 border-b">
|
|
393
|
-
<Heading variant="h4-500">Notifications</Heading>
|
|
394
|
-
</div>
|
|
395
|
-
<div className="divide-y">
|
|
396
|
-
<div className="p-3 hover:bg-gray-50">
|
|
397
|
-
<Body variant="body-sm-500">Meeting Reminder</Body>
|
|
398
|
-
<Body variant="body-xs" className="text-gray-500">
|
|
399
|
-
Monthly union meeting starts in 30 minutes.
|
|
400
|
-
</Body>
|
|
401
|
-
<Body variant="body-xs" className="text-gray-400 mt-1">
|
|
402
|
-
5 min ago
|
|
403
|
-
</Body>
|
|
404
|
-
</div>
|
|
405
|
-
<div className="p-3 hover:bg-gray-50">
|
|
406
|
-
<Body variant="body-sm-500">Dues Payment Received</Body>
|
|
407
|
-
<Body variant="body-xs" className="text-gray-500">
|
|
408
|
-
Your quarterly dues payment has been processed successfully.
|
|
409
|
-
</Body>
|
|
410
|
-
<Body variant="body-xs" className="text-gray-400 mt-1">
|
|
411
|
-
1 hour ago
|
|
412
|
-
</Body>
|
|
413
|
-
</div>
|
|
414
|
-
<div className="p-3 hover:bg-gray-50">
|
|
415
|
-
<Body variant="body-sm-500">New Announcement</Body>
|
|
416
|
-
<Body variant="body-xs" className="text-gray-500">
|
|
417
|
-
Contract negotiations update from leadership.
|
|
418
|
-
</Body>
|
|
419
|
-
<Body variant="body-xs" className="text-gray-400 mt-1">
|
|
420
|
-
3 hours ago
|
|
421
|
-
</Body>
|
|
422
|
-
</div>
|
|
423
|
-
</div>
|
|
424
|
-
<div className="p-3 border-t text-center">
|
|
425
|
-
<Button variant="link" size="sm">
|
|
426
|
-
View All Notifications
|
|
427
|
-
</Button>
|
|
428
|
-
</div>
|
|
429
|
-
</PopoverContent>
|
|
430
|
-
</Popover>); },
|
|
431
|
-
};
|
|
432
|
-
/**
|
|
433
|
-
* User profile popover showing account details and actions.
|
|
434
|
-
*/
|
|
435
|
-
export var UserProfileCard = {
|
|
436
|
-
render: function () { return (<Popover>
|
|
437
|
-
<PopoverTrigger asChild>
|
|
438
|
-
<Button variant="ghost" size="sm">
|
|
439
|
-
John Doe
|
|
440
|
-
</Button>
|
|
441
|
-
</PopoverTrigger>
|
|
442
|
-
<PopoverContent className={POPOVER_LARGE}>
|
|
443
|
-
<div className="space-y-3">
|
|
444
|
-
<div className="space-y-1">
|
|
445
|
-
<Heading variant="h6-600">John Doe</Heading>
|
|
446
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
447
|
-
john.doe@union-local-123.org
|
|
448
|
-
</Body>
|
|
449
|
-
</div>
|
|
450
|
-
<div className="border-t pt-3 space-y-1">
|
|
451
|
-
<Body variant="body-xs" className="text-gray-400">
|
|
452
|
-
Role: Union Member
|
|
453
|
-
</Body>
|
|
454
|
-
<Body variant="body-xs" className="text-gray-400">
|
|
455
|
-
Local: 123 - Iron Workers
|
|
456
|
-
</Body>
|
|
457
|
-
<Body variant="body-xs" className="text-gray-400">
|
|
458
|
-
Member since: January 2022
|
|
459
|
-
</Body>
|
|
460
|
-
</div>
|
|
461
|
-
<div className="flex gap-2 border-t pt-3">
|
|
462
|
-
<Button variant="outline" size="sm" className="flex-1">
|
|
463
|
-
Profile
|
|
464
|
-
</Button>
|
|
465
|
-
<Button variant="outline" size="sm" className="flex-1">
|
|
466
|
-
Sign Out
|
|
467
|
-
</Button>
|
|
468
|
-
</div>
|
|
469
|
-
</div>
|
|
470
|
-
</PopoverContent>
|
|
471
|
-
</Popover>); },
|
|
472
|
-
};
|
|
473
|
-
// ============================================================================
|
|
474
|
-
// EDGE CASES
|
|
475
|
-
// ============================================================================
|
|
476
|
-
/**
|
|
477
|
-
* Popover with a large amount of text content to test overflow and scrolling behavior.
|
|
478
|
-
*/
|
|
479
|
-
export var LongContent = {
|
|
480
|
-
render: function () { return (<Popover>
|
|
481
|
-
<PopoverTrigger asChild>
|
|
482
|
-
<Button variant="outline">Long Content</Button>
|
|
483
|
-
</PopoverTrigger>
|
|
484
|
-
<PopoverContent className={POPOVER_WIDE_SCROLLABLE}>
|
|
485
|
-
<div className="space-y-3">
|
|
486
|
-
<Heading variant="h4-500">Detailed Information</Heading>
|
|
487
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
488
|
-
This popover contains a significant amount of text to demonstrate
|
|
489
|
-
how the component handles overflow. When the content exceeds the
|
|
490
|
-
maximum height, vertical scrolling is enabled so users can access
|
|
491
|
-
all the information without the popover growing too large.
|
|
492
|
-
</Body>
|
|
493
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
494
|
-
Union members can access their full benefits package details through
|
|
495
|
-
this interface. The benefits include healthcare coverage, retirement
|
|
496
|
-
planning resources, training program access, and legal
|
|
497
|
-
representation services.
|
|
498
|
-
</Body>
|
|
499
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
500
|
-
For questions about specific benefits or coverage details, members
|
|
501
|
-
should contact their union representative directly. Representatives
|
|
502
|
-
are available during business hours and can provide personalized
|
|
503
|
-
guidance on all benefit-related topics.
|
|
504
|
-
</Body>
|
|
505
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
506
|
-
Additional resources and documentation are available in the member
|
|
507
|
-
portal. You can find frequently asked questions, downloadable forms,
|
|
508
|
-
and contact information for each department.
|
|
509
|
-
</Body>
|
|
510
|
-
</div>
|
|
511
|
-
</PopoverContent>
|
|
512
|
-
</Popover>); },
|
|
513
|
-
};
|
|
514
|
-
/**
|
|
515
|
-
* Popover with minimal content to verify it renders correctly with little data.
|
|
516
|
-
*/
|
|
517
|
-
export var MinimalContent = {
|
|
518
|
-
render: function () { return (<Popover>
|
|
519
|
-
<PopoverTrigger asChild>
|
|
520
|
-
<Button variant="outline">Info</Button>
|
|
521
|
-
</PopoverTrigger>
|
|
522
|
-
<PopoverContent className={POPOVER_MINIMAL}>
|
|
523
|
-
<Body variant="body-sm">Done.</Body>
|
|
524
|
-
</PopoverContent>
|
|
525
|
-
</Popover>); },
|
|
526
|
-
};
|
|
527
|
-
/**
|
|
528
|
-
* Popover in a default open state, useful for testing and documentation screenshots.
|
|
529
|
-
*/
|
|
530
|
-
export var DefaultOpen = {
|
|
531
|
-
render: function () { return (<Popover defaultOpen>
|
|
532
|
-
<PopoverTrigger asChild>
|
|
533
|
-
<Button variant="outline">Already Open</Button>
|
|
534
|
-
</PopoverTrigger>
|
|
535
|
-
<PopoverContent className={POPOVER_WIDE}>
|
|
536
|
-
<div className="space-y-2">
|
|
537
|
-
<Heading variant="h4-500">Open by Default</Heading>
|
|
538
|
-
<Body variant="body-sm" className="text-gray-500">
|
|
539
|
-
This popover starts in the open state by default.
|
|
540
|
-
</Body>
|
|
541
|
-
</div>
|
|
542
|
-
</PopoverContent>
|
|
543
|
-
</Popover>); },
|
|
544
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./popover";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./popover";
|
|
File without changes
|
|
File without changes
|