@trackunit/react-components 1.10.3-alpha-fb1493a185d.0 → 1.10.4
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/index.cjs.js +57 -33
- package/index.esm.js +53 -34
- package/package.json +6 -6
- package/src/components/Menu/MenuList/MenuList.d.ts +1 -7
- package/src/components/Menu/MenuList/MenuList.variants.d.ts +3 -2
- package/src/components/Menu/index.d.ts +1 -0
- package/src/components/Popover/PopoverContent.d.ts +30 -0
package/index.cjs.js
CHANGED
|
@@ -3082,7 +3082,13 @@ const cvaPopoverTitleContainer = cssClassVarianceUtilities.cvaMerge(["flex", "it
|
|
|
3082
3082
|
const cvaPopoverTitleText = cssClassVarianceUtilities.cvaMerge(["flex-1", "text-neutral-500"]);
|
|
3083
3083
|
|
|
3084
3084
|
/**
|
|
3085
|
+
* The PopoverContent component displays the content inside a popover overlay.
|
|
3085
3086
|
*
|
|
3087
|
+
* This component must be used within a `<Popover>` component. It renders the content
|
|
3088
|
+
* in a portal and manages focus, positioning, and accessibility features.
|
|
3089
|
+
*
|
|
3090
|
+
* @param {PopoverContentProps} props - The props for the PopoverContent component
|
|
3091
|
+
* @returns {ReactElement} The popover content element
|
|
3086
3092
|
*/
|
|
3087
3093
|
const PopoverContent = function PopoverContent({ className, dataTestId, children, portalId, ref: propRef, ...props }) {
|
|
3088
3094
|
const { context: floatingContext, customProps, ...context } = usePopoverContext();
|
|
@@ -4028,7 +4034,7 @@ const cvaInteractableItem = cssClassVarianceUtilities.cvaMerge("", {
|
|
|
4028
4034
|
"not-allowed": "cursor-not-allowed",
|
|
4029
4035
|
},
|
|
4030
4036
|
selection: {
|
|
4031
|
-
selected: ["bg-primary-50", "hover:bg-primary-
|
|
4037
|
+
selected: ["bg-primary-50", "hover:bg-primary-100", "focus-within:bg-primary-50"],
|
|
4032
4038
|
unselected: "",
|
|
4033
4039
|
auto: [
|
|
4034
4040
|
"hover:bg-neutral-100",
|
|
@@ -4083,25 +4089,37 @@ const ListItem = ({ className, dataTestId, onClick, details, title, description,
|
|
|
4083
4089
|
})) })) : null, meta ? (jsxRuntime.jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center pt-0.5", children: jsxRuntime.jsx(Text, { className: "truncate text-xs text-neutral-400", dataTestId: dataTestId ? `${dataTestId}-meta` : undefined, weight: "bold", children: meta }) })) : null] })] }), jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 text-nowrap pl-2", children: [details, onClick ? jsxRuntime.jsx(Icon, { color: "neutral", name: "ChevronRight", size: "medium" }) : null] })] }));
|
|
4084
4090
|
};
|
|
4085
4091
|
|
|
4086
|
-
|
|
4092
|
+
// These must be two separate divs (menu and menulist) so that the overflow-clip can be applied to the parent and the overflow-y-auto can be applied to the child.
|
|
4093
|
+
// * Note that the cvaMenu is also used for Select component
|
|
4094
|
+
const cvaMenu = cssClassVarianceUtilities.cvaMerge([
|
|
4087
4095
|
"shadow",
|
|
4088
4096
|
"rounded-lg",
|
|
4089
|
-
"z-popover",
|
|
4090
4097
|
"bg-white",
|
|
4091
4098
|
"border",
|
|
4092
4099
|
"border-neutral-300",
|
|
4100
|
+
"z-popover",
|
|
4093
4101
|
"grid",
|
|
4094
4102
|
"min-w-[200px]",
|
|
4095
|
-
"
|
|
4096
|
-
"p-1",
|
|
4103
|
+
"overflow-clip",
|
|
4097
4104
|
], {
|
|
4098
4105
|
variants: {
|
|
4099
|
-
|
|
4100
|
-
true: "
|
|
4106
|
+
limitWidth: {
|
|
4107
|
+
true: "max-w-[300px]",
|
|
4101
4108
|
false: "",
|
|
4102
4109
|
},
|
|
4103
4110
|
},
|
|
4111
|
+
defaultVariants: {
|
|
4112
|
+
limitWidth: true,
|
|
4113
|
+
},
|
|
4104
4114
|
});
|
|
4115
|
+
// * Note that the cvaMenuList is also used for Select component
|
|
4116
|
+
const cvaMenuList = cssClassVarianceUtilities.cvaMerge([
|
|
4117
|
+
"p-1",
|
|
4118
|
+
"gap-y-0.5",
|
|
4119
|
+
"grid",
|
|
4120
|
+
"max-h-[max(40dvh,var(--spacing-64))]",
|
|
4121
|
+
"overflow-y-auto",
|
|
4122
|
+
]);
|
|
4105
4123
|
const cvaMenuListDivider = cssClassVarianceUtilities.cvaMerge(["mx-[-4px]", "my-1", "min-h-px", "bg-neutral-300"]);
|
|
4106
4124
|
const cvaMenuListMultiSelect = cssClassVarianceUtilities.cvaMerge("hover:!bg-blue-200");
|
|
4107
4125
|
const cvaMenuListItem = cssClassVarianceUtilities.cvaMerge("max-w-full");
|
|
@@ -4126,12 +4144,12 @@ const cvaMenuItem = (props) => {
|
|
|
4126
4144
|
focus: focused === true ? "focused" : "unfocused",
|
|
4127
4145
|
}), className);
|
|
4128
4146
|
};
|
|
4129
|
-
const cvaMenuItemStyle = cssClassVarianceUtilities.cvaMerge(["
|
|
4147
|
+
const cvaMenuItemStyle = cssClassVarianceUtilities.cvaMerge(["px-2", "h-auto", "flex", "flex-row", "items-center", "gap-x-2", "select-none", "rounded"], {
|
|
4130
4148
|
variants: {
|
|
4131
4149
|
fieldSize: {
|
|
4132
4150
|
small: ["text-xs", "py-1.5"],
|
|
4133
|
-
medium: "",
|
|
4134
|
-
large: "",
|
|
4151
|
+
medium: ["text-sm", "py-2"],
|
|
4152
|
+
large: ["text-sm", "py-2"],
|
|
4135
4153
|
},
|
|
4136
4154
|
variant: {
|
|
4137
4155
|
primary: [],
|
|
@@ -4161,6 +4179,7 @@ const cvaMenuItemStyle = cssClassVarianceUtilities.cvaMerge(["py-2", "px-2", "h-
|
|
|
4161
4179
|
},
|
|
4162
4180
|
],
|
|
4163
4181
|
defaultVariants: {
|
|
4182
|
+
fieldSize: "medium",
|
|
4164
4183
|
variant: "primary",
|
|
4165
4184
|
selected: false,
|
|
4166
4185
|
disabled: false,
|
|
@@ -4274,7 +4293,7 @@ const MenuItem = ({ className, dataTestId, label, children, selected = false, fo
|
|
|
4274
4293
|
* @param {MenuListProps} props - The props for the MenuList component
|
|
4275
4294
|
* @returns {ReactElement} MenuList component
|
|
4276
4295
|
*/
|
|
4277
|
-
const MenuList = ({ dataTestId, className, children,
|
|
4296
|
+
const MenuList = ({ dataTestId, className, children, isMulti = false, selectedItems: controlledSelectedItems, onSelectionChange, ...args }) => {
|
|
4278
4297
|
const childrenArr = react.Children.toArray(children);
|
|
4279
4298
|
const [internalSelectedItems, setInternalSelectedItems] = react.useState(controlledSelectedItems ?? []);
|
|
4280
4299
|
const selectedItems = controlledSelectedItems ?? internalSelectedItems;
|
|
@@ -4291,28 +4310,28 @@ const MenuList = ({ dataTestId, className, children, withStickyHeader = false, i
|
|
|
4291
4310
|
setInternalSelectedItems(newSelectedItems);
|
|
4292
4311
|
}
|
|
4293
4312
|
}, [isMulti, selectedItems, onSelectionChange]);
|
|
4294
|
-
return (jsxRuntime.jsx("div", { className:
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4313
|
+
return (jsxRuntime.jsx("div", { className: cvaMenu({ className, limitWidth: true }), "data-testid": dataTestId ? `${dataTestId}-menu-list` : "menu-list", onClick: args.onClick, role: "list", tabIndex: 0, children: jsxRuntime.jsx("div", { className: cvaMenuList(), children: childrenArr.map((menuItem, index) => {
|
|
4314
|
+
if (react.isValidElement(menuItem)) {
|
|
4315
|
+
const isSelected = (selectedItems.includes(menuItem.props.id ?? `${index}`) || menuItem.props.selected) ?? false;
|
|
4316
|
+
return react.cloneElement(menuItem, {
|
|
4317
|
+
...menuItem.props,
|
|
4318
|
+
key: index,
|
|
4319
|
+
onClick: (event) => {
|
|
4320
|
+
menuItem.props.onClick?.(event);
|
|
4321
|
+
if (menuItem.props.disabled !== true) {
|
|
4322
|
+
handleItemClick(menuItem.props.id ?? `${index}`);
|
|
4323
|
+
}
|
|
4324
|
+
},
|
|
4325
|
+
className: isMulti && isSelected
|
|
4326
|
+
? cvaMenuListMultiSelect({ className: menuItem.props.className })
|
|
4327
|
+
: cvaMenuListItem({ className: menuItem.props.className }),
|
|
4328
|
+
selected: isSelected,
|
|
4329
|
+
suffix: menuItem.props.suffix ??
|
|
4330
|
+
(isMulti && isSelected ? jsxRuntime.jsx(Icon, { className: "block text-blue-600", name: "Check", size: "medium" }) : null),
|
|
4331
|
+
});
|
|
4332
|
+
}
|
|
4333
|
+
return null;
|
|
4334
|
+
}) }) }));
|
|
4316
4335
|
};
|
|
4317
4336
|
|
|
4318
4337
|
const cvaMoreMenu = cssClassVarianceUtilities.cvaMerge(["p-0"]);
|
|
@@ -5345,11 +5364,16 @@ exports.cvaInteractableItem = cvaInteractableItem;
|
|
|
5345
5364
|
exports.cvaList = cvaList;
|
|
5346
5365
|
exports.cvaListContainer = cvaListContainer;
|
|
5347
5366
|
exports.cvaListItem = cvaListItem$1;
|
|
5367
|
+
exports.cvaMenu = cvaMenu;
|
|
5348
5368
|
exports.cvaMenuItem = cvaMenuItem;
|
|
5349
5369
|
exports.cvaMenuItemLabel = cvaMenuItemLabel;
|
|
5350
5370
|
exports.cvaMenuItemPrefix = cvaMenuItemPrefix;
|
|
5351
5371
|
exports.cvaMenuItemStyle = cvaMenuItemStyle;
|
|
5352
5372
|
exports.cvaMenuItemSuffix = cvaMenuItemSuffix;
|
|
5373
|
+
exports.cvaMenuList = cvaMenuList;
|
|
5374
|
+
exports.cvaMenuListDivider = cvaMenuListDivider;
|
|
5375
|
+
exports.cvaMenuListItem = cvaMenuListItem;
|
|
5376
|
+
exports.cvaMenuListMultiSelect = cvaMenuListMultiSelect;
|
|
5353
5377
|
exports.cvaPageHeader = cvaPageHeader;
|
|
5354
5378
|
exports.cvaPageHeaderContainer = cvaPageHeaderContainer;
|
|
5355
5379
|
exports.cvaPageHeaderHeading = cvaPageHeaderHeading;
|
package/index.esm.js
CHANGED
|
@@ -3080,7 +3080,13 @@ const cvaPopoverTitleContainer = cvaMerge(["flex", "items-center", "px-2", "py-1
|
|
|
3080
3080
|
const cvaPopoverTitleText = cvaMerge(["flex-1", "text-neutral-500"]);
|
|
3081
3081
|
|
|
3082
3082
|
/**
|
|
3083
|
+
* The PopoverContent component displays the content inside a popover overlay.
|
|
3083
3084
|
*
|
|
3085
|
+
* This component must be used within a `<Popover>` component. It renders the content
|
|
3086
|
+
* in a portal and manages focus, positioning, and accessibility features.
|
|
3087
|
+
*
|
|
3088
|
+
* @param {PopoverContentProps} props - The props for the PopoverContent component
|
|
3089
|
+
* @returns {ReactElement} The popover content element
|
|
3084
3090
|
*/
|
|
3085
3091
|
const PopoverContent = function PopoverContent({ className, dataTestId, children, portalId, ref: propRef, ...props }) {
|
|
3086
3092
|
const { context: floatingContext, customProps, ...context } = usePopoverContext();
|
|
@@ -4026,7 +4032,7 @@ const cvaInteractableItem = cvaMerge("", {
|
|
|
4026
4032
|
"not-allowed": "cursor-not-allowed",
|
|
4027
4033
|
},
|
|
4028
4034
|
selection: {
|
|
4029
|
-
selected: ["bg-primary-50", "hover:bg-primary-
|
|
4035
|
+
selected: ["bg-primary-50", "hover:bg-primary-100", "focus-within:bg-primary-50"],
|
|
4030
4036
|
unselected: "",
|
|
4031
4037
|
auto: [
|
|
4032
4038
|
"hover:bg-neutral-100",
|
|
@@ -4081,25 +4087,37 @@ const ListItem = ({ className, dataTestId, onClick, details, title, description,
|
|
|
4081
4087
|
})) })) : null, meta ? (jsx("div", { className: "gap-responsive-space-sm flex w-full min-w-0 items-center pt-0.5", children: jsx(Text, { className: "truncate text-xs text-neutral-400", dataTestId: dataTestId ? `${dataTestId}-meta` : undefined, weight: "bold", children: meta }) })) : null] })] }), jsxs("div", { className: "flex items-center gap-0.5 text-nowrap pl-2", children: [details, onClick ? jsx(Icon, { color: "neutral", name: "ChevronRight", size: "medium" }) : null] })] }));
|
|
4082
4088
|
};
|
|
4083
4089
|
|
|
4084
|
-
|
|
4090
|
+
// These must be two separate divs (menu and menulist) so that the overflow-clip can be applied to the parent and the overflow-y-auto can be applied to the child.
|
|
4091
|
+
// * Note that the cvaMenu is also used for Select component
|
|
4092
|
+
const cvaMenu = cvaMerge([
|
|
4085
4093
|
"shadow",
|
|
4086
4094
|
"rounded-lg",
|
|
4087
|
-
"z-popover",
|
|
4088
4095
|
"bg-white",
|
|
4089
4096
|
"border",
|
|
4090
4097
|
"border-neutral-300",
|
|
4098
|
+
"z-popover",
|
|
4091
4099
|
"grid",
|
|
4092
4100
|
"min-w-[200px]",
|
|
4093
|
-
"
|
|
4094
|
-
"p-1",
|
|
4101
|
+
"overflow-clip",
|
|
4095
4102
|
], {
|
|
4096
4103
|
variants: {
|
|
4097
|
-
|
|
4098
|
-
true: "
|
|
4104
|
+
limitWidth: {
|
|
4105
|
+
true: "max-w-[300px]",
|
|
4099
4106
|
false: "",
|
|
4100
4107
|
},
|
|
4101
4108
|
},
|
|
4109
|
+
defaultVariants: {
|
|
4110
|
+
limitWidth: true,
|
|
4111
|
+
},
|
|
4102
4112
|
});
|
|
4113
|
+
// * Note that the cvaMenuList is also used for Select component
|
|
4114
|
+
const cvaMenuList = cvaMerge([
|
|
4115
|
+
"p-1",
|
|
4116
|
+
"gap-y-0.5",
|
|
4117
|
+
"grid",
|
|
4118
|
+
"max-h-[max(40dvh,var(--spacing-64))]",
|
|
4119
|
+
"overflow-y-auto",
|
|
4120
|
+
]);
|
|
4103
4121
|
const cvaMenuListDivider = cvaMerge(["mx-[-4px]", "my-1", "min-h-px", "bg-neutral-300"]);
|
|
4104
4122
|
const cvaMenuListMultiSelect = cvaMerge("hover:!bg-blue-200");
|
|
4105
4123
|
const cvaMenuListItem = cvaMerge("max-w-full");
|
|
@@ -4124,12 +4142,12 @@ const cvaMenuItem = (props) => {
|
|
|
4124
4142
|
focus: focused === true ? "focused" : "unfocused",
|
|
4125
4143
|
}), className);
|
|
4126
4144
|
};
|
|
4127
|
-
const cvaMenuItemStyle = cvaMerge(["
|
|
4145
|
+
const cvaMenuItemStyle = cvaMerge(["px-2", "h-auto", "flex", "flex-row", "items-center", "gap-x-2", "select-none", "rounded"], {
|
|
4128
4146
|
variants: {
|
|
4129
4147
|
fieldSize: {
|
|
4130
4148
|
small: ["text-xs", "py-1.5"],
|
|
4131
|
-
medium: "",
|
|
4132
|
-
large: "",
|
|
4149
|
+
medium: ["text-sm", "py-2"],
|
|
4150
|
+
large: ["text-sm", "py-2"],
|
|
4133
4151
|
},
|
|
4134
4152
|
variant: {
|
|
4135
4153
|
primary: [],
|
|
@@ -4159,6 +4177,7 @@ const cvaMenuItemStyle = cvaMerge(["py-2", "px-2", "h-auto", "flex", "flex-row",
|
|
|
4159
4177
|
},
|
|
4160
4178
|
],
|
|
4161
4179
|
defaultVariants: {
|
|
4180
|
+
fieldSize: "medium",
|
|
4162
4181
|
variant: "primary",
|
|
4163
4182
|
selected: false,
|
|
4164
4183
|
disabled: false,
|
|
@@ -4272,7 +4291,7 @@ const MenuItem = ({ className, dataTestId, label, children, selected = false, fo
|
|
|
4272
4291
|
* @param {MenuListProps} props - The props for the MenuList component
|
|
4273
4292
|
* @returns {ReactElement} MenuList component
|
|
4274
4293
|
*/
|
|
4275
|
-
const MenuList = ({ dataTestId, className, children,
|
|
4294
|
+
const MenuList = ({ dataTestId, className, children, isMulti = false, selectedItems: controlledSelectedItems, onSelectionChange, ...args }) => {
|
|
4276
4295
|
const childrenArr = Children.toArray(children);
|
|
4277
4296
|
const [internalSelectedItems, setInternalSelectedItems] = useState(controlledSelectedItems ?? []);
|
|
4278
4297
|
const selectedItems = controlledSelectedItems ?? internalSelectedItems;
|
|
@@ -4289,28 +4308,28 @@ const MenuList = ({ dataTestId, className, children, withStickyHeader = false, i
|
|
|
4289
4308
|
setInternalSelectedItems(newSelectedItems);
|
|
4290
4309
|
}
|
|
4291
4310
|
}, [isMulti, selectedItems, onSelectionChange]);
|
|
4292
|
-
return (jsx("div", { className:
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4311
|
+
return (jsx("div", { className: cvaMenu({ className, limitWidth: true }), "data-testid": dataTestId ? `${dataTestId}-menu-list` : "menu-list", onClick: args.onClick, role: "list", tabIndex: 0, children: jsx("div", { className: cvaMenuList(), children: childrenArr.map((menuItem, index) => {
|
|
4312
|
+
if (isValidElement(menuItem)) {
|
|
4313
|
+
const isSelected = (selectedItems.includes(menuItem.props.id ?? `${index}`) || menuItem.props.selected) ?? false;
|
|
4314
|
+
return cloneElement(menuItem, {
|
|
4315
|
+
...menuItem.props,
|
|
4316
|
+
key: index,
|
|
4317
|
+
onClick: (event) => {
|
|
4318
|
+
menuItem.props.onClick?.(event);
|
|
4319
|
+
if (menuItem.props.disabled !== true) {
|
|
4320
|
+
handleItemClick(menuItem.props.id ?? `${index}`);
|
|
4321
|
+
}
|
|
4322
|
+
},
|
|
4323
|
+
className: isMulti && isSelected
|
|
4324
|
+
? cvaMenuListMultiSelect({ className: menuItem.props.className })
|
|
4325
|
+
: cvaMenuListItem({ className: menuItem.props.className }),
|
|
4326
|
+
selected: isSelected,
|
|
4327
|
+
suffix: menuItem.props.suffix ??
|
|
4328
|
+
(isMulti && isSelected ? jsx(Icon, { className: "block text-blue-600", name: "Check", size: "medium" }) : null),
|
|
4329
|
+
});
|
|
4330
|
+
}
|
|
4331
|
+
return null;
|
|
4332
|
+
}) }) }));
|
|
4314
4333
|
};
|
|
4315
4334
|
|
|
4316
4335
|
const cvaMoreMenu = cvaMerge(["p-0"]);
|
|
@@ -5262,4 +5281,4 @@ const cvaClickable = cvaMerge([
|
|
|
5262
5281
|
},
|
|
5263
5282
|
});
|
|
5264
5283
|
|
|
5265
|
-
export { ActionRenderer, Alert, Badge, Breadcrumb, BreadcrumbContainer, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CompletionStatusIndicator, CopyableText, DetailsList, EmptyState, EmptyValue, ExternalLink, Heading, Highlight, HorizontalOverflowScroller, Icon, IconButton, Indicator, KPI, KPICard, List, ListItem, MenuDivider, MenuItem, MenuList, MoreMenu, Notice, PackageNameStoryComponent, Page, PageContent, PageHeader, PageHeaderKpiMetrics, PageHeaderSecondaryActions, PageHeaderTitle, Pagination, Polygon, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Portal, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, ToggleGroup, Tooltip, ValueBar, ZStack, cvaButton, cvaButtonPrefixSuffix, cvaButtonSpinner, cvaButtonSpinnerContainer, cvaClickable, cvaContainerStyles, cvaIconButton, cvaImgStyles, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaInteractableItem, cvaList, cvaListContainer, cvaListItem$1 as cvaListItem, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemStyle, cvaMenuItemSuffix, cvaPageHeader, cvaPageHeaderContainer, cvaPageHeaderHeading, cvaToggleGroup, cvaToggleGroupWithSlidingBackground, cvaToggleItem, cvaToggleItemContent, cvaToggleItemText, cvaZStackContainer, cvaZStackItem, defaultPageSize, docs, getDevicePixelRatio, getResponsiveRandomWidthPercentage, getValueBarColorByValue, iconColorNames, iconPalette, noPagination, useClickOutside, useContainerBreakpoints, useContinuousTimeout, useDebounce, useDevicePixelRatio, useElevatedReducer, useElevatedState, useGeometry, useHover, useInfiniteScroll, useIsFirstRender, useIsFullscreen, useIsTextTruncated, useList, useListItemHeight, useModifierKey, useOverflowItems, usePopoverContext, usePrompt, useRelayPagination, useResize, useScrollDetection, useSelfUpdatingRef, useTimeout, useViewportBreakpoints, useWindowActivity };
|
|
5284
|
+
export { ActionRenderer, Alert, Badge, Breadcrumb, BreadcrumbContainer, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CompletionStatusIndicator, CopyableText, DetailsList, EmptyState, EmptyValue, ExternalLink, Heading, Highlight, HorizontalOverflowScroller, Icon, IconButton, Indicator, KPI, KPICard, List, ListItem, MenuDivider, MenuItem, MenuList, MoreMenu, Notice, PackageNameStoryComponent, Page, PageContent, PageHeader, PageHeaderKpiMetrics, PageHeaderSecondaryActions, PageHeaderTitle, Pagination, Polygon, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Portal, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, ToggleGroup, Tooltip, ValueBar, ZStack, cvaButton, cvaButtonPrefixSuffix, cvaButtonSpinner, cvaButtonSpinnerContainer, cvaClickable, cvaContainerStyles, cvaIconButton, cvaImgStyles, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaInteractableItem, cvaList, cvaListContainer, cvaListItem$1 as cvaListItem, cvaMenu, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemStyle, cvaMenuItemSuffix, cvaMenuList, cvaMenuListDivider, cvaMenuListItem, cvaMenuListMultiSelect, cvaPageHeader, cvaPageHeaderContainer, cvaPageHeaderHeading, cvaToggleGroup, cvaToggleGroupWithSlidingBackground, cvaToggleItem, cvaToggleItemContent, cvaToggleItemText, cvaZStackContainer, cvaZStackItem, defaultPageSize, docs, getDevicePixelRatio, getResponsiveRandomWidthPercentage, getValueBarColorByValue, iconColorNames, iconPalette, noPagination, useClickOutside, useContainerBreakpoints, useContinuousTimeout, useDebounce, useDevicePixelRatio, useElevatedReducer, useElevatedState, useGeometry, useHover, useInfiniteScroll, useIsFirstRender, useIsFullscreen, useIsTextTruncated, useList, useListItemHeight, useModifierKey, useOverflowItems, usePopoverContext, usePrompt, useRelayPagination, useResize, useScrollDetection, useSelfUpdatingRef, useTimeout, useViewportBreakpoints, useWindowActivity };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"@floating-ui/react": "^0.26.25",
|
|
17
17
|
"string-ts": "^2.0.0",
|
|
18
18
|
"tailwind-merge": "^2.0.0",
|
|
19
|
-
"@trackunit/ui-design-tokens": "1.7.43
|
|
20
|
-
"@trackunit/css-class-variance-utilities": "1.7.43
|
|
21
|
-
"@trackunit/shared-utils": "1.9.43
|
|
22
|
-
"@trackunit/ui-icons": "1.7.44
|
|
23
|
-
"@trackunit/react-test-setup": "1.4.43
|
|
19
|
+
"@trackunit/ui-design-tokens": "1.7.43",
|
|
20
|
+
"@trackunit/css-class-variance-utilities": "1.7.43",
|
|
21
|
+
"@trackunit/shared-utils": "1.9.43",
|
|
22
|
+
"@trackunit/ui-icons": "1.7.44",
|
|
23
|
+
"@trackunit/react-test-setup": "1.4.43",
|
|
24
24
|
"@tanstack/react-router": "1.114.29",
|
|
25
25
|
"es-toolkit": "^1.39.10",
|
|
26
26
|
"@tanstack/react-virtual": "3.13.12"
|
|
@@ -5,12 +5,6 @@ export interface MenuListProps extends CommonProps {
|
|
|
5
5
|
* List of menu items to be rendered.
|
|
6
6
|
*/
|
|
7
7
|
children: ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* When enabled the menu list padding will be removed, and a grid will be applied to keep the first column "sticky".
|
|
10
|
-
*
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
withStickyHeader?: boolean;
|
|
14
8
|
/** Click handler - typically used to trigger close action. when propagation is NOT prevented on menuItem */
|
|
15
9
|
onClick?: () => void;
|
|
16
10
|
/**
|
|
@@ -39,4 +33,4 @@ export interface MenuListProps extends CommonProps {
|
|
|
39
33
|
* @param {MenuListProps} props - The props for the MenuList component
|
|
40
34
|
* @returns {ReactElement} MenuList component
|
|
41
35
|
*/
|
|
42
|
-
export declare const MenuList: ({ dataTestId, className, children,
|
|
36
|
+
export declare const MenuList: ({ dataTestId, className, children, isMulti, selectedItems: controlledSelectedItems, onSelectionChange, ...args }: MenuListProps) => ReactElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
1
|
+
export declare const cvaMenu: (props?: ({
|
|
2
|
+
limitWidth?: boolean | null | undefined;
|
|
3
3
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const cvaMenuList: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
4
5
|
export declare const cvaMenuListDivider: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
5
6
|
export declare const cvaMenuListMultiSelect: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
7
|
export declare const cvaMenuListItem: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -2,6 +2,30 @@ import { HTMLProps, ReactElement, ReactNode, Ref } from "react";
|
|
|
2
2
|
import { CommonProps } from "../../common";
|
|
3
3
|
export type PopoverContentChildren = ((close: () => void) => ReactNode) | ReactNode;
|
|
4
4
|
export interface PopoverContentProps extends Omit<HTMLProps<HTMLDivElement>, "children">, CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The content to display inside the popover.
|
|
7
|
+
*
|
|
8
|
+
* Can be either:
|
|
9
|
+
* - **ReactNode**: Any valid React content (elements, text, components, etc.)
|
|
10
|
+
* - **Function**: A render function that receives a `close` callback to programmatically close the popover
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // Static content
|
|
14
|
+
* <PopoverContent>
|
|
15
|
+
* <Card><CardBody>Hello</CardBody></Card>
|
|
16
|
+
* </PopoverContent>
|
|
17
|
+
* @example
|
|
18
|
+
* // Dynamic content with close button
|
|
19
|
+
* <PopoverContent>
|
|
20
|
+
* {close => (
|
|
21
|
+
* <Card>
|
|
22
|
+
* <CardBody>
|
|
23
|
+
* <Button onClick={close}>Close</Button>
|
|
24
|
+
* </CardBody>
|
|
25
|
+
* </Card>
|
|
26
|
+
* )}
|
|
27
|
+
* </PopoverContent>
|
|
28
|
+
*/
|
|
5
29
|
children: PopoverContentChildren;
|
|
6
30
|
/**
|
|
7
31
|
* Custom dom id to use for portalling the popover content
|
|
@@ -13,6 +37,12 @@ export interface PopoverContentProps extends Omit<HTMLProps<HTMLDivElement>, "ch
|
|
|
13
37
|
ref?: Ref<HTMLDivElement>;
|
|
14
38
|
}
|
|
15
39
|
/**
|
|
40
|
+
* The PopoverContent component displays the content inside a popover overlay.
|
|
41
|
+
*
|
|
42
|
+
* This component must be used within a `<Popover>` component. It renders the content
|
|
43
|
+
* in a portal and manages focus, positioning, and accessibility features.
|
|
16
44
|
*
|
|
45
|
+
* @param {PopoverContentProps} props - The props for the PopoverContent component
|
|
46
|
+
* @returns {ReactElement} The popover content element
|
|
17
47
|
*/
|
|
18
48
|
export declare const PopoverContent: ({ className, dataTestId, children, portalId, ref: propRef, ...props }: PopoverContentProps) => ReactElement;
|