@trackunit/react-components 0.1.200 → 0.1.202
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 +115 -2
- package/index.esm.js +113 -3
- package/package.json +6 -6
- package/src/components/EmptyState/EmptyState.d.ts +0 -1
- package/src/components/Icon/Icon.variants.d.ts +1 -1
- package/src/components/Menu/MenuItem/MenuItem.d.ts +3 -3
- package/src/components/Popover/Popover.d.ts +1 -2
- package/src/components/Popover/usePopover.d.ts +1 -1
- package/src/components/Tabs/Tab.d.ts +15 -0
- package/src/components/Tabs/TabPanel.d.ts +15 -0
- package/src/components/Tabs/Tabs.d.ts +37 -0
- package/src/components/Tabs/Tabs.variants.d.ts +12 -0
- package/src/components/Tag/Tag.variants.d.ts +1 -1
- package/src/components/index.d.ts +3 -0
package/index.cjs.js
CHANGED
|
@@ -1221,7 +1221,6 @@ const usePopoverContext = () => {
|
|
|
1221
1221
|
*
|
|
1222
1222
|
* To render the content of the popover, use the `<PopoverContent />` component.
|
|
1223
1223
|
*
|
|
1224
|
-
|
|
1225
1224
|
* @param {PopoverProps} props The props for the popover
|
|
1226
1225
|
* @returns {JSX.Element} A Popover Context Provider containing the children
|
|
1227
1226
|
*/
|
|
@@ -1414,7 +1413,6 @@ var WorkerWithSign = "8df3d27593b5fba4.svg";
|
|
|
1414
1413
|
* Component representing an empty state.
|
|
1415
1414
|
* Use this component when there is no data to display or when an error occurs.
|
|
1416
1415
|
*
|
|
1417
|
-
|
|
1418
1416
|
* @param {EmptyStateProps} props props
|
|
1419
1417
|
* @returns {JSX.Element} component
|
|
1420
1418
|
* @example
|
|
@@ -2159,6 +2157,118 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
|
|
|
2159
2157
|
}) }))) }))) : null] }));
|
|
2160
2158
|
};
|
|
2161
2159
|
|
|
2160
|
+
const cvaTab = cssClassVarianceUtilities.cvaMerge([
|
|
2161
|
+
"mb-px",
|
|
2162
|
+
"box-content",
|
|
2163
|
+
"flex",
|
|
2164
|
+
"h-12",
|
|
2165
|
+
"min-w-0",
|
|
2166
|
+
"cursor-pointer items-center",
|
|
2167
|
+
"justify-center ",
|
|
2168
|
+
"gap-2",
|
|
2169
|
+
"border-b-4",
|
|
2170
|
+
"px-1",
|
|
2171
|
+
"font-medium",
|
|
2172
|
+
"transition",
|
|
2173
|
+
"duration-200",
|
|
2174
|
+
"ease-in-out",
|
|
2175
|
+
], {
|
|
2176
|
+
variants: {
|
|
2177
|
+
isSelected: {
|
|
2178
|
+
true: "border-b-blue-600 hover:text-neutral-500",
|
|
2179
|
+
false: "border-neutral-200 text-neutral-500 hover:border-b-neutral-500",
|
|
2180
|
+
},
|
|
2181
|
+
isFullWidth: {
|
|
2182
|
+
true: "w-full",
|
|
2183
|
+
false: "",
|
|
2184
|
+
},
|
|
2185
|
+
},
|
|
2186
|
+
defaultVariants: {
|
|
2187
|
+
isSelected: false,
|
|
2188
|
+
isFullWidth: false,
|
|
2189
|
+
},
|
|
2190
|
+
});
|
|
2191
|
+
cssClassVarianceUtilities.cvaMerge(["whitespace-no-wrap", "mr-4", "overflow-hidden"]);
|
|
2192
|
+
const cvaTabs = cssClassVarianceUtilities.cvaMerge(["flex", "flex-col"]);
|
|
2193
|
+
const cvaTabsPanels = cssClassVarianceUtilities.cvaMerge(["mt-4", "flex", "h-full"]);
|
|
2194
|
+
const cvaTabsPanel = cssClassVarianceUtilities.cvaMerge([], {
|
|
2195
|
+
variants: {
|
|
2196
|
+
isSelected: {
|
|
2197
|
+
true: "flex-1",
|
|
2198
|
+
false: "grow-0",
|
|
2199
|
+
},
|
|
2200
|
+
},
|
|
2201
|
+
defaultVariants: {
|
|
2202
|
+
isSelected: false,
|
|
2203
|
+
},
|
|
2204
|
+
});
|
|
2205
|
+
const cvaTabPanel = cssClassVarianceUtilities.cvaMerge(["flex-1"]);
|
|
2206
|
+
const cvaTabsContainer = cssClassVarianceUtilities.cvaMerge([
|
|
2207
|
+
"m-0",
|
|
2208
|
+
"flex",
|
|
2209
|
+
"list-none",
|
|
2210
|
+
"items-center",
|
|
2211
|
+
"gap-x-4",
|
|
2212
|
+
"border-b",
|
|
2213
|
+
"border-solid",
|
|
2214
|
+
"border-neutral-100",
|
|
2215
|
+
"p-0",
|
|
2216
|
+
]);
|
|
2217
|
+
|
|
2218
|
+
/**
|
|
2219
|
+
*
|
|
2220
|
+
*/
|
|
2221
|
+
const Tab = ({ onTabClick, isFullWidth = false, iconName, isSelected = false, label, dataTestId, suffix, }) => {
|
|
2222
|
+
return (jsxRuntime.jsxs("li", { onClick: onTabClick, "data-testid": dataTestId, role: "tab", className: cvaTab({ isSelected, isFullWidth }), children: [iconName && jsxRuntime.jsx(Icon, { name: iconName, size: "small" }), label, suffix] }));
|
|
2223
|
+
};
|
|
2224
|
+
|
|
2225
|
+
/**
|
|
2226
|
+
*
|
|
2227
|
+
*/
|
|
2228
|
+
const TabPanel = ({ id, label, iconName, suffix, className, dataTestId, children }) => {
|
|
2229
|
+
return (jsxRuntime.jsx("div", { "data-testid": dataTestId && `${dataTestId}-panel`, className: cvaTabPanel({ className }), children: children }));
|
|
2230
|
+
};
|
|
2231
|
+
|
|
2232
|
+
/**
|
|
2233
|
+
* Represents a set of tabs used for navigating content.
|
|
2234
|
+
*/
|
|
2235
|
+
const Tabs = ({ defaultSelectedTabId, children, forceRender, className, dataTestId, fullWidth, onSelectedTabChanged, }) => {
|
|
2236
|
+
const getDefaultedSelectedTabId = () => {
|
|
2237
|
+
if (defaultSelectedTabId) {
|
|
2238
|
+
return defaultSelectedTabId;
|
|
2239
|
+
}
|
|
2240
|
+
const firstChild = React.Children.toArray(children)[0];
|
|
2241
|
+
return firstChild.props.id;
|
|
2242
|
+
};
|
|
2243
|
+
const [selectedTabId, setSelectedTabId] = React.useState(getDefaultedSelectedTabId());
|
|
2244
|
+
React.useEffect(() => {
|
|
2245
|
+
if (defaultSelectedTabId) {
|
|
2246
|
+
setSelectedTabId(defaultSelectedTabId);
|
|
2247
|
+
}
|
|
2248
|
+
}, [defaultSelectedTabId]);
|
|
2249
|
+
const isTabSelected = (panel) => {
|
|
2250
|
+
return panel.id === selectedTabId;
|
|
2251
|
+
};
|
|
2252
|
+
const handleTabClick = (panel) => {
|
|
2253
|
+
if (selectedTabId !== panel.id) {
|
|
2254
|
+
if (onSelectedTabChanged) {
|
|
2255
|
+
onSelectedTabChanged(panel.id);
|
|
2256
|
+
}
|
|
2257
|
+
setSelectedTabId(panel.id);
|
|
2258
|
+
}
|
|
2259
|
+
};
|
|
2260
|
+
return (jsxRuntime.jsxs("div", { className: cvaTabs({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("ol", { role: "tablist", className: cvaTabsContainer(), children: React.Children.map(children, child => {
|
|
2261
|
+
const panel = child.props;
|
|
2262
|
+
return panel ? (jsxRuntime.jsx(Tab, { onTabClick: () => handleTabClick(panel), isSelected: panel.id === selectedTabId, isFullWidth: fullWidth, label: panel.label, iconName: panel.iconName, suffix: panel.suffix, dataTestId: panel.dataTestId })) : null;
|
|
2263
|
+
}) }), jsxRuntime.jsx("div", { className: cvaTabsPanels(), children: React.Children.map(children, child => {
|
|
2264
|
+
const panel = child === null || child === void 0 ? void 0 : child.props;
|
|
2265
|
+
if (!panel || (panel.id !== selectedTabId && !forceRender)) {
|
|
2266
|
+
return null;
|
|
2267
|
+
}
|
|
2268
|
+
return (jsxRuntime.jsx("div", { className: cvaTabsPanel({ isSelected: isTabSelected(panel) }), children: jsxRuntime.jsx(TabPanel, Object.assign({}, panel)) }));
|
|
2269
|
+
}) })] }));
|
|
2270
|
+
};
|
|
2271
|
+
|
|
2162
2272
|
const cvaTimeline = cssClassVarianceUtilities.cvaMerge("ml-4");
|
|
2163
2273
|
const cvaTimelineElement = cssClassVarianceUtilities.cvaMerge([
|
|
2164
2274
|
"grid",
|
|
@@ -2934,6 +3044,9 @@ exports.SkeletonLines = SkeletonLines;
|
|
|
2934
3044
|
exports.Spacer = Spacer;
|
|
2935
3045
|
exports.Spinner = Spinner;
|
|
2936
3046
|
exports.StarButton = StarButton;
|
|
3047
|
+
exports.Tab = Tab;
|
|
3048
|
+
exports.TabPanel = TabPanel;
|
|
3049
|
+
exports.Tabs = Tabs;
|
|
2937
3050
|
exports.Tag = Tag;
|
|
2938
3051
|
exports.Text = Text;
|
|
2939
3052
|
exports.Timeline = Timeline;
|
package/index.esm.js
CHANGED
|
@@ -1192,7 +1192,6 @@ const usePopoverContext = () => {
|
|
|
1192
1192
|
*
|
|
1193
1193
|
* To render the content of the popover, use the `<PopoverContent />` component.
|
|
1194
1194
|
*
|
|
1195
|
-
|
|
1196
1195
|
* @param {PopoverProps} props The props for the popover
|
|
1197
1196
|
* @returns {JSX.Element} A Popover Context Provider containing the children
|
|
1198
1197
|
*/
|
|
@@ -1385,7 +1384,6 @@ var WorkerWithSign = "8df3d27593b5fba4.svg";
|
|
|
1385
1384
|
* Component representing an empty state.
|
|
1386
1385
|
* Use this component when there is no data to display or when an error occurs.
|
|
1387
1386
|
*
|
|
1388
|
-
|
|
1389
1387
|
* @param {EmptyStateProps} props props
|
|
1390
1388
|
* @returns {JSX.Element} component
|
|
1391
1389
|
* @example
|
|
@@ -2130,6 +2128,118 @@ const Sidebar = ({ childContainerClassName, children, breakpoint = "lg", classNa
|
|
|
2130
2128
|
}) }))) }))) : null] }));
|
|
2131
2129
|
};
|
|
2132
2130
|
|
|
2131
|
+
const cvaTab = cvaMerge([
|
|
2132
|
+
"mb-px",
|
|
2133
|
+
"box-content",
|
|
2134
|
+
"flex",
|
|
2135
|
+
"h-12",
|
|
2136
|
+
"min-w-0",
|
|
2137
|
+
"cursor-pointer items-center",
|
|
2138
|
+
"justify-center ",
|
|
2139
|
+
"gap-2",
|
|
2140
|
+
"border-b-4",
|
|
2141
|
+
"px-1",
|
|
2142
|
+
"font-medium",
|
|
2143
|
+
"transition",
|
|
2144
|
+
"duration-200",
|
|
2145
|
+
"ease-in-out",
|
|
2146
|
+
], {
|
|
2147
|
+
variants: {
|
|
2148
|
+
isSelected: {
|
|
2149
|
+
true: "border-b-blue-600 hover:text-neutral-500",
|
|
2150
|
+
false: "border-neutral-200 text-neutral-500 hover:border-b-neutral-500",
|
|
2151
|
+
},
|
|
2152
|
+
isFullWidth: {
|
|
2153
|
+
true: "w-full",
|
|
2154
|
+
false: "",
|
|
2155
|
+
},
|
|
2156
|
+
},
|
|
2157
|
+
defaultVariants: {
|
|
2158
|
+
isSelected: false,
|
|
2159
|
+
isFullWidth: false,
|
|
2160
|
+
},
|
|
2161
|
+
});
|
|
2162
|
+
cvaMerge(["whitespace-no-wrap", "mr-4", "overflow-hidden"]);
|
|
2163
|
+
const cvaTabs = cvaMerge(["flex", "flex-col"]);
|
|
2164
|
+
const cvaTabsPanels = cvaMerge(["mt-4", "flex", "h-full"]);
|
|
2165
|
+
const cvaTabsPanel = cvaMerge([], {
|
|
2166
|
+
variants: {
|
|
2167
|
+
isSelected: {
|
|
2168
|
+
true: "flex-1",
|
|
2169
|
+
false: "grow-0",
|
|
2170
|
+
},
|
|
2171
|
+
},
|
|
2172
|
+
defaultVariants: {
|
|
2173
|
+
isSelected: false,
|
|
2174
|
+
},
|
|
2175
|
+
});
|
|
2176
|
+
const cvaTabPanel = cvaMerge(["flex-1"]);
|
|
2177
|
+
const cvaTabsContainer = cvaMerge([
|
|
2178
|
+
"m-0",
|
|
2179
|
+
"flex",
|
|
2180
|
+
"list-none",
|
|
2181
|
+
"items-center",
|
|
2182
|
+
"gap-x-4",
|
|
2183
|
+
"border-b",
|
|
2184
|
+
"border-solid",
|
|
2185
|
+
"border-neutral-100",
|
|
2186
|
+
"p-0",
|
|
2187
|
+
]);
|
|
2188
|
+
|
|
2189
|
+
/**
|
|
2190
|
+
*
|
|
2191
|
+
*/
|
|
2192
|
+
const Tab = ({ onTabClick, isFullWidth = false, iconName, isSelected = false, label, dataTestId, suffix, }) => {
|
|
2193
|
+
return (jsxs("li", { onClick: onTabClick, "data-testid": dataTestId, role: "tab", className: cvaTab({ isSelected, isFullWidth }), children: [iconName && jsx(Icon, { name: iconName, size: "small" }), label, suffix] }));
|
|
2194
|
+
};
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
*
|
|
2198
|
+
*/
|
|
2199
|
+
const TabPanel = ({ id, label, iconName, suffix, className, dataTestId, children }) => {
|
|
2200
|
+
return (jsx("div", { "data-testid": dataTestId && `${dataTestId}-panel`, className: cvaTabPanel({ className }), children: children }));
|
|
2201
|
+
};
|
|
2202
|
+
|
|
2203
|
+
/**
|
|
2204
|
+
* Represents a set of tabs used for navigating content.
|
|
2205
|
+
*/
|
|
2206
|
+
const Tabs = ({ defaultSelectedTabId, children, forceRender, className, dataTestId, fullWidth, onSelectedTabChanged, }) => {
|
|
2207
|
+
const getDefaultedSelectedTabId = () => {
|
|
2208
|
+
if (defaultSelectedTabId) {
|
|
2209
|
+
return defaultSelectedTabId;
|
|
2210
|
+
}
|
|
2211
|
+
const firstChild = Children.toArray(children)[0];
|
|
2212
|
+
return firstChild.props.id;
|
|
2213
|
+
};
|
|
2214
|
+
const [selectedTabId, setSelectedTabId] = useState(getDefaultedSelectedTabId());
|
|
2215
|
+
useEffect(() => {
|
|
2216
|
+
if (defaultSelectedTabId) {
|
|
2217
|
+
setSelectedTabId(defaultSelectedTabId);
|
|
2218
|
+
}
|
|
2219
|
+
}, [defaultSelectedTabId]);
|
|
2220
|
+
const isTabSelected = (panel) => {
|
|
2221
|
+
return panel.id === selectedTabId;
|
|
2222
|
+
};
|
|
2223
|
+
const handleTabClick = (panel) => {
|
|
2224
|
+
if (selectedTabId !== panel.id) {
|
|
2225
|
+
if (onSelectedTabChanged) {
|
|
2226
|
+
onSelectedTabChanged(panel.id);
|
|
2227
|
+
}
|
|
2228
|
+
setSelectedTabId(panel.id);
|
|
2229
|
+
}
|
|
2230
|
+
};
|
|
2231
|
+
return (jsxs("div", { className: cvaTabs({ className }), "data-testid": dataTestId, children: [jsx("ol", { role: "tablist", className: cvaTabsContainer(), children: Children.map(children, child => {
|
|
2232
|
+
const panel = child.props;
|
|
2233
|
+
return panel ? (jsx(Tab, { onTabClick: () => handleTabClick(panel), isSelected: panel.id === selectedTabId, isFullWidth: fullWidth, label: panel.label, iconName: panel.iconName, suffix: panel.suffix, dataTestId: panel.dataTestId })) : null;
|
|
2234
|
+
}) }), jsx("div", { className: cvaTabsPanels(), children: Children.map(children, child => {
|
|
2235
|
+
const panel = child === null || child === void 0 ? void 0 : child.props;
|
|
2236
|
+
if (!panel || (panel.id !== selectedTabId && !forceRender)) {
|
|
2237
|
+
return null;
|
|
2238
|
+
}
|
|
2239
|
+
return (jsx("div", { className: cvaTabsPanel({ isSelected: isTabSelected(panel) }), children: jsx(TabPanel, Object.assign({}, panel)) }));
|
|
2240
|
+
}) })] }));
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2133
2243
|
const cvaTimeline = cvaMerge("ml-4");
|
|
2134
2244
|
const cvaTimelineElement = cvaMerge([
|
|
2135
2245
|
"grid",
|
|
@@ -2866,4 +2976,4 @@ const useVisibilityChange = ({ onChange, targetState = "hidden" }) => {
|
|
|
2866
2976
|
}, [onChange, targetState]);
|
|
2867
2977
|
};
|
|
2868
2978
|
|
|
2869
|
-
export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, PackageNameStoryComponent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text, Timeline, TimelineElement, Tip, Tooltip, ValueBar, WidgetBody, cvaButton, cvaButtonSpinner, cvaClickable, cvaIconButtonContainer, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, useOptionallyElevatedState, useOverflowItems, usePopoverContext, usePrompt, useResize, useSelfUpdatingRef, useTimeout, useVisibilityChange };
|
|
2979
|
+
export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayPickerPopover, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, PackageNameStoryComponent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabPanel, Tabs, Tag, Text, Timeline, TimelineElement, Tip, Tooltip, ValueBar, WidgetBody, cvaButton, cvaButtonSpinner, cvaClickable, cvaIconButtonContainer, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, useOptionallyElevatedState, useOverflowItems, usePopoverContext, usePrompt, useResize, useSelfUpdatingRef, useTimeout, useVisibilityChange };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.202",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"react": "^18.2.0",
|
|
12
12
|
"@trackunit/css-class-variance-utilities": "*",
|
|
13
13
|
"react-use": "^17.4.0",
|
|
14
|
-
"react-day-picker": "^8.
|
|
15
|
-
"date-fns": "^2.
|
|
16
|
-
"@floating-ui/react": "^0.
|
|
14
|
+
"react-day-picker": "^8.9.1",
|
|
15
|
+
"date-fns": "^2.30.0",
|
|
16
|
+
"@floating-ui/react": "^0.26.2",
|
|
17
17
|
"@trackunit/ui-icons": "*",
|
|
18
18
|
"@trackunit/shared-utils": "*",
|
|
19
19
|
"react-useportal": "1.0.18",
|
|
20
|
-
"react-router-dom": "6.
|
|
20
|
+
"react-router-dom": "6.18.0",
|
|
21
21
|
"react-helmet-async": "^1.3.0",
|
|
22
|
-
"zod": "3.22.
|
|
22
|
+
"zod": "3.22.4",
|
|
23
23
|
"lodash": "4.17.21",
|
|
24
24
|
"jest-fetch-mock": "^3.0.3",
|
|
25
25
|
"@testing-library/react": "14.0.0"
|
|
@@ -14,7 +14,6 @@ export interface EmptyStateProps extends CommonProps {
|
|
|
14
14
|
* Component representing an empty state.
|
|
15
15
|
* Use this component when there is no data to display or when an error occurs.
|
|
16
16
|
*
|
|
17
|
-
|
|
18
17
|
* @param {EmptyStateProps} props props
|
|
19
18
|
* @returns {JSX.Element} component
|
|
20
19
|
* @example
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const cvaIcon: (props?: ({
|
|
2
|
-
color?: "primary" | "secondary" | "accent" | "neutral" | "info" | "success" | "warning" | "danger" | "good" | "low" | "critical" | "working" | "idle" | "moving" | "active" | "stopped" | "unknown" | "
|
|
2
|
+
color?: "default" | "primary" | "secondary" | "accent" | "neutral" | "info" | "success" | "warning" | "danger" | "good" | "low" | "critical" | "working" | "idle" | "moving" | "active" | "stopped" | "unknown" | "black" | "white" | "unused" | "utilized" | "heavily_utilized" | "unknown_utilization" | "site" | "on_rent" | "returned" | "available" | "pickup_ready" | "transfer" | "in_repair" | "other_rental_status" | null | undefined;
|
|
3
3
|
size?: "small" | "medium" | "large" | "font" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
5
|
export declare const cvaIconComponent: (props?: ({
|
|
@@ -33,20 +33,20 @@ export interface MenuItemProps extends CommonProps {
|
|
|
33
33
|
* An boolean flag to turn on/off selected state
|
|
34
34
|
* This is typically used highlight that item is selected
|
|
35
35
|
*
|
|
36
|
-
* @memberof
|
|
36
|
+
* @memberof MenuItemProps
|
|
37
37
|
*/
|
|
38
38
|
selected?: boolean;
|
|
39
39
|
/**
|
|
40
40
|
* OnClick event handler it is thrown on root element of the component tree
|
|
41
41
|
*
|
|
42
|
-
* @memberof
|
|
42
|
+
* @memberof MenuItemProps
|
|
43
43
|
*/
|
|
44
44
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
45
45
|
/**
|
|
46
46
|
* An boolean flag to turn on/off focused state
|
|
47
47
|
* This is typically used for keyboard navigation
|
|
48
48
|
*
|
|
49
|
-
* @memberof
|
|
49
|
+
* @memberof MenuItemProps
|
|
50
50
|
*/
|
|
51
51
|
focused?: boolean;
|
|
52
52
|
/**
|
|
@@ -47,7 +47,7 @@ export declare const usePopoverContext: () => {
|
|
|
47
47
|
update: () => void;
|
|
48
48
|
floatingStyles: import("react").CSSProperties;
|
|
49
49
|
open: boolean;
|
|
50
|
-
onOpenChange: (open: boolean, event?: Event | undefined) => void;
|
|
50
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
51
51
|
events: import("@floating-ui/react").FloatingEvents;
|
|
52
52
|
dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
53
53
|
nodeId: string | undefined;
|
|
@@ -68,7 +68,6 @@ export declare const usePopoverContext: () => {
|
|
|
68
68
|
*
|
|
69
69
|
* To render the content of the popover, use the `<PopoverContent />` component.
|
|
70
70
|
*
|
|
71
|
-
|
|
72
71
|
* @param {PopoverProps} props The props for the popover
|
|
73
72
|
* @returns {JSX.Element} A Popover Context Provider containing the children
|
|
74
73
|
*/
|
|
@@ -48,7 +48,7 @@ export declare const usePopover: ({ initialOpen, placement, isModal, isOpen: con
|
|
|
48
48
|
update: () => void;
|
|
49
49
|
floatingStyles: import("react").CSSProperties;
|
|
50
50
|
open: boolean;
|
|
51
|
-
onOpenChange: (open: boolean, event?: Event | undefined) => void;
|
|
51
|
+
onOpenChange: (open: boolean, event?: Event | undefined, reason?: import("@floating-ui/react").OpenChangeReason | undefined) => void;
|
|
52
52
|
events: import("@floating-ui/react").FloatingEvents;
|
|
53
53
|
dataRef: import("react").MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
54
54
|
nodeId: string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IconName } from "@trackunit/ui-icons";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface TabProps {
|
|
4
|
+
onTabClick?: () => void;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
isFullWidth?: boolean;
|
|
7
|
+
dataTestId?: string;
|
|
8
|
+
suffix?: JSX.Element;
|
|
9
|
+
iconName?: IconName;
|
|
10
|
+
label: string | React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare const Tab: ({ onTabClick, isFullWidth, iconName, isSelected, label, dataTestId, suffix, }: TabProps) => JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IconName } from "@trackunit/ui-icons";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export interface TabPanelProps {
|
|
4
|
+
id: string | number;
|
|
5
|
+
label: string | ReactNode;
|
|
6
|
+
iconName?: IconName;
|
|
7
|
+
suffix?: JSX.Element;
|
|
8
|
+
className?: string;
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare const TabPanel: ({ id, label, iconName, suffix, className, dataTestId, children }: TabPanelProps) => JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface TabsProps {
|
|
3
|
+
/**
|
|
4
|
+
* The ID of the tab that should be selected by default.
|
|
5
|
+
*/
|
|
6
|
+
defaultSelectedTabId?: string | number;
|
|
7
|
+
/**
|
|
8
|
+
* If set to true, forces the content of all tabs to render even if not selected.
|
|
9
|
+
*/
|
|
10
|
+
forceRender?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* If set to true, the tabs will expand to fill the width of their container.
|
|
13
|
+
*/
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The child elements to be displayed within the Tabs component.
|
|
17
|
+
*/
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* A custom class name to be attached to root element
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* An ID that can be used in tests to locate the component.
|
|
25
|
+
*/
|
|
26
|
+
dataTestId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A callback function invoked when the selected tab changes.
|
|
29
|
+
*
|
|
30
|
+
* @param id - ID of the selected tab.
|
|
31
|
+
*/
|
|
32
|
+
onSelectedTabChanged?: (id: string | number) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Represents a set of tabs used for navigating content.
|
|
36
|
+
*/
|
|
37
|
+
export declare const Tabs: ({ defaultSelectedTabId, children, forceRender, className, dataTestId, fullWidth, onSelectedTabChanged, }: TabsProps) => JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const cvaTab: (props?: ({
|
|
2
|
+
isSelected?: boolean | null | undefined;
|
|
3
|
+
isFullWidth?: boolean | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const cvaTabNoWrapContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const cvaTabs: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
7
|
+
export declare const cvaTabsPanels: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
8
|
+
export declare const cvaTabsPanel: (props?: ({
|
|
9
|
+
isSelected?: boolean | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
11
|
+
export declare const cvaTabPanel: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
12
|
+
export declare const cvaTabsContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const cvaTag: (props?: ({
|
|
2
2
|
size?: "small" | "medium" | null | undefined;
|
|
3
|
-
layout?: "
|
|
3
|
+
layout?: "default" | "withIcon" | null | undefined;
|
|
4
4
|
color?: "primary" | "secondary" | "accent" | "neutral" | "black" | "white" | "info" | "success" | "warning" | "danger" | "good" | "low" | "critical" | "working" | "stopped" | "idle" | "unknown" | "moving" | "active" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const cvaTagIconContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -23,6 +23,9 @@ export * from "./Sidebar/useOverflowItems";
|
|
|
23
23
|
export * from "./SkeletonLines";
|
|
24
24
|
export * from "./Spacer";
|
|
25
25
|
export * from "./Spinner";
|
|
26
|
+
export * from "./Tabs/Tab";
|
|
27
|
+
export * from "./Tabs/TabPanel";
|
|
28
|
+
export * from "./Tabs/Tabs";
|
|
26
29
|
export * from "./Tag";
|
|
27
30
|
export * from "./Text";
|
|
28
31
|
export * from "./Timeline/Timeline";
|