pixelize-design-library 2.4.2-beta.33 → 2.4.2-beta.34
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/Components/Button/Button.styles.js +3 -3
- package/dist/Components/Table/Table.js +2 -0
- package/dist/Theme/tokens/builders/scrollShadow.d.ts +2 -0
- package/dist/Theme/tokens/builders/scrollShadow.js +16 -0
- package/dist/esm/Components/Button/Button.styles.js +3 -3
- package/dist/esm/Components/Table/Table.js +2 -0
- package/dist/esm/Theme/tokens/builders/scrollShadow.js +13 -0
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ const onCanvasHoverBg = (theme, colorScheme, step) => {
|
|
|
23
23
|
return "opacity" in scale ? scale.opacity[step] : scale[50];
|
|
24
24
|
};
|
|
25
25
|
const swatch = (theme, colorScheme) => theme.colors[colorScheme];
|
|
26
|
-
const
|
|
26
|
+
const buttonSolidRung = (theme, colorScheme) => (0, filledSurface_1.solidFillRung)(swatch(theme, colorScheme), theme.colors.white);
|
|
27
27
|
const darkerFill = (theme, colorScheme, step) => {
|
|
28
28
|
const scale = swatch(theme, colorScheme);
|
|
29
29
|
const rung = (0, filledSurface_1.darkerFillRung)(scale, theme.colors.backgroundColor.main, theme.colors.white, step);
|
|
@@ -56,7 +56,7 @@ exports.Button = {
|
|
|
56
56
|
}),
|
|
57
57
|
variants: {
|
|
58
58
|
solid: ({ theme, colorScheme = "primary" }) => {
|
|
59
|
-
const fill = theme.colors[colorScheme][
|
|
59
|
+
const fill = theme.colors[colorScheme][buttonSolidRung(theme, colorScheme)];
|
|
60
60
|
const hoverFill = darkerFill(theme, colorScheme, 0);
|
|
61
61
|
const activeFill = darkerFill(theme, colorScheme, 1);
|
|
62
62
|
const hoverLabel = labelFor(theme, hoverFill);
|
|
@@ -90,7 +90,7 @@ exports.Button = {
|
|
|
90
90
|
},
|
|
91
91
|
outline: ({ theme, colorScheme = "primary" }) => {
|
|
92
92
|
// Same rung as `solid`'s fill, not raw [500] — keeps hover bg AA-safe for white text.
|
|
93
|
-
const hoverFill = theme.colors[colorScheme][
|
|
93
|
+
const hoverFill = theme.colors[colorScheme][buttonSolidRung(theme, colorScheme)];
|
|
94
94
|
const activeFill = darkerFill(theme, colorScheme, 0);
|
|
95
95
|
const ink = onCanvasText(theme, colorScheme);
|
|
96
96
|
return {
|
|
@@ -19,6 +19,7 @@ const TableHeader_1 = __importDefault(require("./components/TableHeader"));
|
|
|
19
19
|
const TableBody_1 = __importDefault(require("./components/TableBody"));
|
|
20
20
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
21
21
|
const scrollbar_1 = require("../../Theme/tokens/builders/scrollbar");
|
|
22
|
+
const scrollShadow_1 = require("../../Theme/tokens/builders/scrollShadow");
|
|
22
23
|
const useTable_1 = __importDefault(require("./hooks/useTable"));
|
|
23
24
|
const table_1 = require("../../Utils/table");
|
|
24
25
|
const usePreferences_1 = require("../../Hooks/usePreferences");
|
|
@@ -400,6 +401,7 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, head
|
|
|
400
401
|
}, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { size: 16 }) }) })] })), headerActions && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Divider_1.default, {}), (0, jsx_runtime_1.jsx)(HeaderActions_1.default, { actions: headerActions, selections: selection })] })), (0, jsx_runtime_1.jsx)(ActiveFilters_1.default, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }), (0, jsx_runtime_1.jsxs)(react_2.Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2, children: [groupLoadMoreActive && loadMorePosition === "top" && (groupLoadMoreCaption || canGroupLoadMore) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", alignItems: "center", gap: 2, flex: "0 0 auto", children: [groupLoadMoreCaption && ((0, jsx_runtime_1.jsx)(react_2.Box, { fontSize: "0.75rem", color: theme.colors.text[500], whiteSpace: "nowrap", children: groupLoadMoreCaption })), canGroupLoadMore && ((0, jsx_runtime_1.jsx)(Button_1.default, { size: "xs", variant: "outline", colorScheme: "gray", isLoading: isLoadingMore, loadingText: loadMoreText, onClick: handleGroupLoadMore, label: loadMoreText }))] })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }) })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && tableData.length > 0 && ((0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isPaginationPopoverOpen, onClose: () => setIsPaginationPopoverOpen(false), placement: "bottom-end", children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": "Pagination", size: "sm", variant: "ghost", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.EllipsisVertical, { size: 18 }), color: theme.colors.text[500], _hover: {
|
|
401
402
|
color: theme.colors.accentText,
|
|
402
403
|
}, onClick: () => setIsPaginationPopoverOpen((open) => !open) }) }), (0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { maxW: "22rem", p: 2, zIndex: 1600, bg: theme.colors.background[50], boxShadow: "lg", children: (0, jsx_runtime_1.jsx)(react_2.PopoverBody, { p: 0, children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }) }) }) })] }))] })] }), (0, jsx_runtime_1.jsxs)(react_2.TableContainer, { ref: tableContainerRef, position: "relative", h: isTableLoading ? tableMaxH : undefined, maxH: !isTableLoading ? tableMaxH : undefined, pb: isTableLoading ? 0 : compactScrollbarPadding, overflowY: isCompactRows ? "hidden" : "auto", overflowX: "auto", sx: {
|
|
404
|
+
...(0, scrollShadow_1.scrollShadowStyles)(theme.colors.background[50]),
|
|
403
405
|
...(0, scrollbar_1.scrollbarStyles)(theme.colors),
|
|
404
406
|
// Compact rows hide the horizontal bar until hover to keep the row height.
|
|
405
407
|
'&::-webkit-scrollbar': {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scrollShadowStyles = scrollShadowStyles;
|
|
4
|
+
const EDGE = "24px";
|
|
5
|
+
const TINT = "rgba(0, 0, 0, 0.08)";
|
|
6
|
+
// CSS-only overflow hint via background-attachment local vs scroll — no listener, no extra node.
|
|
7
|
+
function scrollShadowStyles(surface) {
|
|
8
|
+
return {
|
|
9
|
+
backgroundColor: surface,
|
|
10
|
+
backgroundImage: `linear-gradient(to right, ${surface}, ${surface}), linear-gradient(to left, ${surface}, ${surface}), linear-gradient(to right, ${TINT}, transparent), linear-gradient(to left, ${TINT}, transparent)`,
|
|
11
|
+
backgroundRepeat: "no-repeat",
|
|
12
|
+
backgroundSize: `${EDGE} 100%, ${EDGE} 100%, 8px 100%, 8px 100%`,
|
|
13
|
+
backgroundPosition: "0 0, 100% 0, 0 0, 100% 0",
|
|
14
|
+
backgroundAttachment: "local, local, scroll, scroll",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -20,7 +20,7 @@ const onCanvasHoverBg = (theme, colorScheme, step) => {
|
|
|
20
20
|
return "opacity" in scale ? scale.opacity[step] : scale[50];
|
|
21
21
|
};
|
|
22
22
|
const swatch = (theme, colorScheme) => theme.colors[colorScheme];
|
|
23
|
-
const
|
|
23
|
+
const buttonSolidRung = (theme, colorScheme) => solidFillRung(swatch(theme, colorScheme), theme.colors.white);
|
|
24
24
|
const darkerFill = (theme, colorScheme, step) => {
|
|
25
25
|
const scale = swatch(theme, colorScheme);
|
|
26
26
|
const rung = darkerFillRung(scale, theme.colors.backgroundColor.main, theme.colors.white, step);
|
|
@@ -53,7 +53,7 @@ export const Button = {
|
|
|
53
53
|
}),
|
|
54
54
|
variants: {
|
|
55
55
|
solid: ({ theme, colorScheme = "primary" }) => {
|
|
56
|
-
const fill = theme.colors[colorScheme][
|
|
56
|
+
const fill = theme.colors[colorScheme][buttonSolidRung(theme, colorScheme)];
|
|
57
57
|
const hoverFill = darkerFill(theme, colorScheme, 0);
|
|
58
58
|
const activeFill = darkerFill(theme, colorScheme, 1);
|
|
59
59
|
const hoverLabel = labelFor(theme, hoverFill);
|
|
@@ -87,7 +87,7 @@ export const Button = {
|
|
|
87
87
|
},
|
|
88
88
|
outline: ({ theme, colorScheme = "primary" }) => {
|
|
89
89
|
// Same rung as `solid`'s fill, not raw [500] — keeps hover bg AA-safe for white text.
|
|
90
|
-
const hoverFill = theme.colors[colorScheme][
|
|
90
|
+
const hoverFill = theme.colors[colorScheme][buttonSolidRung(theme, colorScheme)];
|
|
91
91
|
const activeFill = darkerFill(theme, colorScheme, 0);
|
|
92
92
|
const ink = onCanvasText(theme, colorScheme);
|
|
93
93
|
return {
|
|
@@ -13,6 +13,7 @@ import TableHeader from "./components/TableHeader.js";
|
|
|
13
13
|
import TableBody from "./components/TableBody.js";
|
|
14
14
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
15
15
|
import { scrollbarStyles, SCROLLBAR_WIDTH } from "../../Theme/tokens/builders/scrollbar.js";
|
|
16
|
+
import { scrollShadowStyles } from "../../Theme/tokens/builders/scrollShadow.js";
|
|
16
17
|
import useTable from "./hooks/useTable.js";
|
|
17
18
|
import { searchAndSortData, SortMultiColumnData, groupRows, buildTablePalette, pickTableColor } from "../../Utils/table.js";
|
|
18
19
|
import { useGetPreferences, useSavePreferences, } from "../../Hooks/usePreferences.js";
|
|
@@ -394,6 +395,7 @@ export default function Table({ data, columns, onSelection, isLoading, isCheckbo
|
|
|
394
395
|
}, children: _jsx(RefreshCw, { size: 16 }) }) })] })), headerActions && (_jsxs(_Fragment, { children: [_jsx(VeritcalDivider, {}), _jsx(HeaderActions, { actions: headerActions, selections: selection })] })), _jsx(ActiveFilters, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }), _jsxs(Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2, children: [groupLoadMoreActive && loadMorePosition === "top" && (groupLoadMoreCaption || canGroupLoadMore) && (_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, flex: "0 0 auto", children: [groupLoadMoreCaption && (_jsx(Box, { fontSize: "0.75rem", color: theme.colors.text[500], whiteSpace: "nowrap", children: groupLoadMoreCaption })), canGroupLoadMore && (_jsx(Button, { size: "xs", variant: "outline", colorScheme: "gray", isLoading: isLoadingMore, loadingText: loadMoreText, onClick: handleGroupLoadMore, label: loadMoreText }))] })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && (_jsx("div", { children: _jsx(Pagination, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }) })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && tableData.length > 0 && (_jsxs(Popover, { isOpen: isPaginationPopoverOpen, onClose: () => setIsPaginationPopoverOpen(false), placement: "bottom-end", children: [_jsx(PopoverTrigger, { children: _jsx(IconButton, { "aria-label": "Pagination", size: "sm", variant: "ghost", icon: _jsx(EllipsisVertical, { size: 18 }), color: theme.colors.text[500], _hover: {
|
|
395
396
|
color: theme.colors.accentText,
|
|
396
397
|
}, onClick: () => setIsPaginationPopoverOpen((open) => !open) }) }), _jsx(Portal, { children: _jsx(PopoverContent, { maxW: "22rem", p: 2, zIndex: 1600, bg: theme.colors.background[50], boxShadow: "lg", children: _jsx(PopoverBody, { p: 0, children: _jsx(Pagination, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }) }) }) })] }))] })] }), _jsxs(TableContainer, { ref: tableContainerRef, position: "relative", h: isTableLoading ? tableMaxH : undefined, maxH: !isTableLoading ? tableMaxH : undefined, pb: isTableLoading ? 0 : compactScrollbarPadding, overflowY: isCompactRows ? "hidden" : "auto", overflowX: "auto", sx: {
|
|
398
|
+
...scrollShadowStyles(theme.colors.background[50]),
|
|
397
399
|
...scrollbarStyles(theme.colors),
|
|
398
400
|
// Compact rows hide the horizontal bar until hover to keep the row height.
|
|
399
401
|
'&::-webkit-scrollbar': {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const EDGE = "24px";
|
|
2
|
+
const TINT = "rgba(0, 0, 0, 0.08)";
|
|
3
|
+
// CSS-only overflow hint via background-attachment local vs scroll — no listener, no extra node.
|
|
4
|
+
export function scrollShadowStyles(surface) {
|
|
5
|
+
return {
|
|
6
|
+
backgroundColor: surface,
|
|
7
|
+
backgroundImage: `linear-gradient(to right, ${surface}, ${surface}), linear-gradient(to left, ${surface}, ${surface}), linear-gradient(to right, ${TINT}, transparent), linear-gradient(to left, ${TINT}, transparent)`,
|
|
8
|
+
backgroundRepeat: "no-repeat",
|
|
9
|
+
backgroundSize: `${EDGE} 100%, ${EDGE} 100%, 8px 100%, 8px 100%`,
|
|
10
|
+
backgroundPosition: "0 0, 100% 0, 0 0, 100% 0",
|
|
11
|
+
backgroundAttachment: "local, local, scroll, scroll",
|
|
12
|
+
};
|
|
13
|
+
}
|
package/package.json
CHANGED