@appdirect/design-system 0.0.20 → 0.0.21
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/ComplexComponents/DataTable/CustomBottomToolbar/CustomBottomToolbar.module.css +24 -1
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.js +2 -1
- package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.tsx +3 -0
- package/dist/ComplexComponents/DataTable/CustomToolbarAlertBannerContent/CustomToolbarAlertBannerContent.module.css +9 -1
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/CustomTopToolbar.module.css +7 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/DateRangeSelectorFilter.module.css +7 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.js +1 -1
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/DateRangeSelectorFilter/index.tsx +1 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.js +4 -2
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.module.css +16 -0
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.tsx +6 -3
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.js +2 -2
- package/dist/ComplexComponents/DataTable/CustomTopToolbar/index.tsx +11 -8
- package/dist/ComplexComponents/DataTable/DataTableGrid/DataTableGrid.module.css +17 -3
- package/dist/ComplexComponents/DataTable/DataTableGrid/index.js +1 -1
- package/dist/ComplexComponents/DataTable/DataTableGrid/index.tsx +2 -2
- package/dist/ComplexComponents/DataTable/ToolbarAlertBanner/ToolbarAlertBanner.module.css +4 -1
- package/dist/contracts/index.json +1 -1
- package/dist/css/mantine.css +4 -4
- package/dist/stories/index.json +1 -1
- package/package.json +2 -2
|
@@ -4,4 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
.pageSize {
|
|
6
6
|
flex-shrink: 0;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* The page-size select reads as plain text with a chevron: no fill or border, even on hover and
|
|
10
|
+
focus. The selectors are deliberately as specific as the global Input state rules
|
|
11
|
+
(:hover / :focus) so they win without !important. */
|
|
12
|
+
.pageSize .pageSizeInput[data-variant="unstyled"]:not([data-error]):not([data-disabled]) {
|
|
13
|
+
background: transparent;
|
|
14
|
+
border-color: transparent;
|
|
15
|
+
padding-inline-start: 0;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.pageSizeChevron {
|
|
20
|
+
width: var(--ad-icon-size-lg);
|
|
21
|
+
height: var(--ad-icon-size-lg);
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
color: var(--ad-color-text-default);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* The global Input section rule pads both sides, which squeezes the chevron to a few px. */
|
|
27
|
+
.pageSize .pageSizeSection[data-position] {
|
|
28
|
+
padding-inline: 0;
|
|
29
|
+
justify-content: flex-end;
|
|
30
|
+
}
|
|
@@ -5,6 +5,7 @@ import React, { useMemo } from "react";
|
|
|
5
5
|
import { Box, Flex, Select, ActionIcon, Text } from "@mantine/core";
|
|
6
6
|
import { RiArrowLeftSLine as PreviousPageIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
7
7
|
import { RiArrowRightSLine as NextPageIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
8
|
+
import { RiArrowDropDownFill as DropdownIcon } from "@remixicon/react"; // DS-ADAPT: down triangle for the page-size select
|
|
8
9
|
import { translate } from "../translations/index.js"; // DS-ADAPT: translate lives in DataTable/translations
|
|
9
10
|
import { getFormattedPageCount, getFormattedPageSize, getNumOfRowsPerPageOptions } from "./utils.js";
|
|
10
11
|
import styles from "./CustomBottomToolbar.module.css";
|
|
@@ -17,7 +18,7 @@ const CustomBottomToolbar = ({ paginationState, onPageSizeChange, onNextPage, on
|
|
|
17
18
|
};
|
|
18
19
|
const formattedPageLegend = getFormattedPageCount(paginationState.pageIndex, paginationState.pageSize, rowCount);
|
|
19
20
|
const numOfRowsPerPageOptions = useMemo(() => getNumOfRowsPerPageOptions(rowCount, undefined, paginationState.pageSize), [rowCount, paginationState.pageSize]);
|
|
20
|
-
return (_jsxs(Flex, { className: styles.toolbar, bg: "var(--ad-color-bg-subtle)", px: "md", py: "xshalf", justify: "space-between", align: "center", children: [_jsxs(Flex, { align: "center", gap: "sm", w: "fit-content", flex: "none", children: [_jsx(Text, { size: "xs", children: translate("table.rows.per.page") }), _jsx(Box, { w: PAGE_SIZE_SELECT_WIDTH, className: styles.pageSize, children: _jsx(Select, { disabled: !rowCount || isDisabled, "aria-label": translate("table.rows.per.page"), data: numOfRowsPerPageOptions, value: paginationState.pageSize.toString(), onChange: onPageSizeChangeHandler, size: "xs", w: "100%", rightSectionWidth: 22, variant: "unstyled", comboboxProps: { withinPortal: false, width: "max-content" } }) })] }), numberOfSelectedRowsText && _jsx(Text, { size: "xs", children: numberOfSelectedRowsText }), _jsxs(Flex, { align: "center", gap: "xs", children: [_jsx(Text, { size: "xs", children: formattedPageLegend }), _jsx(ActionIcon, { "data-testid": "previous-page-btn", disabled: !hasPreviousPage || isDisabled, onClick: () => {
|
|
21
|
+
return (_jsxs(Flex, { className: styles.toolbar, bg: "var(--ad-color-bg-subtle)", px: "md", py: "xshalf", justify: "space-between", align: "center", children: [_jsxs(Flex, { align: "center", gap: "sm", w: "fit-content", flex: "none", children: [_jsx(Text, { size: "xs", children: translate("table.rows.per.page") }), _jsx(Box, { w: PAGE_SIZE_SELECT_WIDTH, className: styles.pageSize, children: _jsx(Select, { disabled: !rowCount || isDisabled, "aria-label": translate("table.rows.per.page"), data: numOfRowsPerPageOptions, value: paginationState.pageSize.toString(), onChange: onPageSizeChangeHandler, size: "xs", w: "100%", rightSectionWidth: 22, variant: "unstyled", rightSection: _jsx(DropdownIcon, { className: styles.pageSizeChevron }), classNames: { input: styles.pageSizeInput, section: styles.pageSizeSection }, comboboxProps: { withinPortal: false, width: "max-content" } }) })] }), numberOfSelectedRowsText && _jsx(Text, { size: "xs", children: numberOfSelectedRowsText }), _jsxs(Flex, { align: "center", gap: "xs", children: [_jsx(Text, { size: "xs", children: formattedPageLegend }), _jsx(ActionIcon, { "data-testid": "previous-page-btn", disabled: !hasPreviousPage || isDisabled, onClick: () => {
|
|
21
22
|
if (!isFetching && onPreviousPage) {
|
|
22
23
|
onPreviousPage();
|
|
23
24
|
}
|
|
@@ -4,6 +4,7 @@ import React, { useMemo, ReactElement } from "react";
|
|
|
4
4
|
import { Box, Flex, Select, ActionIcon, Text } from "@mantine/core";
|
|
5
5
|
import { RiArrowLeftSLine as PreviousPageIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
6
6
|
import { RiArrowRightSLine as NextPageIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
7
|
+
import { RiArrowDropDownFill as DropdownIcon } from "@remixicon/react"; // DS-ADAPT: down triangle for the page-size select
|
|
7
8
|
import { PaginationState } from "../types";
|
|
8
9
|
import { translate } from "../translations"; // DS-ADAPT: translate lives in DataTable/translations
|
|
9
10
|
import { getFormattedPageCount, getFormattedPageSize, getNumOfRowsPerPageOptions } from "./utils";
|
|
@@ -76,6 +77,8 @@ const CustomBottomToolbar = ({
|
|
|
76
77
|
w="100%"
|
|
77
78
|
rightSectionWidth={22}
|
|
78
79
|
variant="unstyled"
|
|
80
|
+
rightSection={<DropdownIcon className={styles.pageSizeChevron} />} // DS-ADAPT: down triangle marks the select as interactive
|
|
81
|
+
classNames={{ input: styles.pageSizeInput, section: styles.pageSizeSection }} // DS-ADAPT: chevron, no fill or border
|
|
79
82
|
comboboxProps={{ withinPortal: false, width: "max-content" }}
|
|
80
83
|
/>
|
|
81
84
|
</Box>
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/* The global outline Button rule paints brand blue on the brand-blue banner, which made the action
|
|
2
|
+
invisible. These selectors match its :hover / :active specificity so the banner colours win
|
|
3
|
+
without !important. */
|
|
4
|
+
.action[data-variant="outline"]:not(:disabled):not([data-disabled]) {
|
|
2
5
|
color: var(--ad-table-toolbar-selection-banner-fg);
|
|
3
6
|
border-color: var(--ad-table-toolbar-selection-banner-fg);
|
|
4
7
|
}
|
|
8
|
+
|
|
9
|
+
.action.action[data-variant="outline"]:not(:disabled):not([data-disabled]):hover,
|
|
10
|
+
.action.action[data-variant="outline"]:not(:disabled):not([data-disabled]):active {
|
|
11
|
+
background: color-mix(in srgb, var(--ad-table-toolbar-selection-banner-fg) 16%, transparent);
|
|
12
|
+
}
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
border-bottom: var(--ad-table-toolbar-border-width) solid var(--ad-table-toolbar-border-color);
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
/* Closed: same white-surface outline as the fullscreen and density buttons (outline variant).
|
|
6
|
+
Open: brand outline and icon, matching the outline Button. */
|
|
7
|
+
.filterToggle[data-open="true"][data-variant] {
|
|
8
|
+
color: var(--ad-color-brand-primary);
|
|
9
|
+
border-color: var(--ad-color-brand-primary);
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
.clearFilters {
|
|
6
13
|
cursor: pointer;
|
|
7
14
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
.field label {
|
|
2
2
|
font-weight: 600;
|
|
3
3
|
}
|
|
4
|
+
|
|
5
|
+
/* The trigger is a <button>, so unlike a text input it does not centre its text vertically:
|
|
6
|
+
the global input padding plus the full-height line-height pushed the value below the City
|
|
7
|
+
select's text. Zero block padding lines the two up. */
|
|
8
|
+
.fieldInput[data-variant] {
|
|
9
|
+
padding-block: 0;
|
|
10
|
+
}
|
|
@@ -121,6 +121,6 @@ const DateRangeSelector = ({ label, locale, onChange }) => {
|
|
|
121
121
|
}));
|
|
122
122
|
onChange(value);
|
|
123
123
|
};
|
|
124
|
-
return (_jsxs(Popover, { opened: isDatePickerOpened, position: "bottom-start", children: [_jsx(Popover.Target, { children: _jsx("div", { ref: presetSelectRef, role: "menuitem", children: _jsxs(Combobox, { size: "xs", store: combobox, withinPortal: false, onOptionSubmit: handlePresetChange, children: [_jsx(Combobox.Target, { children: _jsx(InputBase, { className: styles.field, component: "button", type: "button", size: "xs", pointer: true, rightSection: preset ? (_jsx(CloseButton, { size: "xs", variant: "transparent", onMouseDown: (event) => event.preventDefault(), onClick: handleClearClick, "aria-label": "Clear date range" })) : (_jsx(Combobox.Chevron, { size: "xs" })), onClick: handleInputBaseClick, rightSectionPointerEvents: preset === null ? "none" : "all", label: label, children: getValueDisplayed }) }), _jsx(Combobox.Dropdown, { children: _jsx(Combobox.Options, { children: options }) })] }) }) }), _jsx(Popover.Dropdown, { children: _jsx(DatePicker, { id: "date-picker", "data-testid": "date-picker", type: "range", value: customDateRange, onChange: handleDatePickerChange, defaultDate: customDateRange[0] || customDateRange[1] || toDateString(new Date()) || undefined, allowSingleDateInRange: true }) })] }));
|
|
124
|
+
return (_jsxs(Popover, { opened: isDatePickerOpened, position: "bottom-start", children: [_jsx(Popover.Target, { children: _jsx("div", { ref: presetSelectRef, role: "menuitem", children: _jsxs(Combobox, { size: "xs", store: combobox, withinPortal: false, onOptionSubmit: handlePresetChange, children: [_jsx(Combobox.Target, { children: _jsx(InputBase, { className: styles.field, classNames: { input: styles.fieldInput }, component: "button", type: "button", size: "xs", pointer: true, rightSection: preset ? (_jsx(CloseButton, { size: "xs", variant: "transparent", onMouseDown: (event) => event.preventDefault(), onClick: handleClearClick, "aria-label": "Clear date range" })) : (_jsx(Combobox.Chevron, { size: "xs" })), onClick: handleInputBaseClick, rightSectionPointerEvents: preset === null ? "none" : "all", label: label, children: getValueDisplayed }) }), _jsx(Combobox.Dropdown, { children: _jsx(Combobox.Options, { children: options }) })] }) }) }), _jsx(Popover.Dropdown, { children: _jsx(DatePicker, { id: "date-picker", "data-testid": "date-picker", type: "range", value: customDateRange, onChange: handleDatePickerChange, defaultDate: customDateRange[0] || customDateRange[1] || toDateString(new Date()) || undefined, allowSingleDateInRange: true }) })] }));
|
|
125
125
|
};
|
|
126
126
|
export default DateRangeSelector;
|
|
@@ -163,6 +163,7 @@ const DateRangeSelector = ({ label, locale, onChange }: DateRangeSelectorProps):
|
|
|
163
163
|
<Combobox.Target>
|
|
164
164
|
<InputBase
|
|
165
165
|
className={styles.field}
|
|
166
|
+
classNames={{ input: styles.fieldInput }} // DS-ADAPT: align the button text with the City select
|
|
166
167
|
component="button"
|
|
167
168
|
type="button"
|
|
168
169
|
size="xs"
|
|
@@ -4,8 +4,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import React, { useEffect, useRef, useState } from "react";
|
|
5
5
|
import { RiSearchLine as SearchIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
6
6
|
import { RiCloseLine as CloseIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
7
|
-
import
|
|
7
|
+
import clsx from "clsx";
|
|
8
|
+
import { TextInput } from "@mantine/core";
|
|
8
9
|
import { translate } from "../translations/index.js"; // DS-ADAPT: translate lives in DataTable/translations
|
|
10
|
+
import styles from "./SearchFilter.module.css";
|
|
9
11
|
const debounce = (fn, timeout = 1000) => {
|
|
10
12
|
let timer;
|
|
11
13
|
return (value) => {
|
|
@@ -35,6 +37,6 @@ const SearchFilter = ({ searchTerm, onChange }) => {
|
|
|
35
37
|
useEffect(() => {
|
|
36
38
|
setLocalSearchTerm(searchTerm);
|
|
37
39
|
}, [searchTerm]);
|
|
38
|
-
return (_jsx(TextInput, { size: "xs", placeholder: translate("table.search.placeholder"), flex: "1 1 auto", onChange: (event) => handleSearchChange(event.target.value), rightSection: localSearchTerm === "" ? (_jsx(SearchIcon, {
|
|
40
|
+
return (_jsx(TextInput, { size: "xs", placeholder: translate("table.search.placeholder"), flex: "1 1 auto", onChange: (event) => handleSearchChange(event.target.value), classNames: { section: styles.section }, rightSection: localSearchTerm === "" ? (_jsx(SearchIcon, { className: styles.icon })) : (_jsx(CloseIcon, { "data-testid": "search-clear", onClick: clearSearch, className: clsx(styles.icon, styles.clearIcon) })), value: localSearchTerm }));
|
|
39
41
|
};
|
|
40
42
|
export default SearchFilter;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* The global Input section rule pads the section on both sides, which squeezes a bare icon down to
|
|
2
|
+
a few px. The icon fills the section instead. */
|
|
3
|
+
.section[data-position] {
|
|
4
|
+
padding-inline: 0;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.icon {
|
|
9
|
+
width: var(--ad-icon-size-md);
|
|
10
|
+
height: var(--ad-icon-size-md);
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.clearIcon {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import React, { ReactElement, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { RiSearchLine as SearchIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
5
5
|
import { RiCloseLine as CloseIcon } from "@remixicon/react"; // DS-ADAPT: @remixicon/react instead of remixicon svg import
|
|
6
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { TextInput } from "@mantine/core";
|
|
7
8
|
import { translate } from "../translations"; // DS-ADAPT: translate lives in DataTable/translations
|
|
9
|
+
import styles from "./SearchFilter.module.css";
|
|
8
10
|
|
|
9
11
|
const debounce = (fn: (value: string) => void, timeout = 1000): ((value: string) => void) => {
|
|
10
12
|
let timer: NodeJS.Timeout | undefined;
|
|
@@ -54,14 +56,15 @@ const SearchFilter = ({ searchTerm, onChange }: SearchFilterProps): ReactElement
|
|
|
54
56
|
placeholder={translate("table.search.placeholder")}
|
|
55
57
|
flex="1 1 auto"
|
|
56
58
|
onChange={(event): void => handleSearchChange(event.target.value)}
|
|
59
|
+
classNames={{ section: styles.section }} // DS-ADAPT: icon sizing via tokens in a module
|
|
57
60
|
rightSection={
|
|
58
61
|
localSearchTerm === "" ? (
|
|
59
|
-
<SearchIcon
|
|
62
|
+
<SearchIcon className={styles.icon} />
|
|
60
63
|
) : (
|
|
61
64
|
<CloseIcon
|
|
62
65
|
data-testid="search-clear"
|
|
63
66
|
onClick={clearSearch}
|
|
64
|
-
|
|
67
|
+
className={clsx(styles.icon, styles.clearIcon)}
|
|
65
68
|
/>
|
|
66
69
|
)
|
|
67
70
|
}
|
|
@@ -23,7 +23,7 @@ const dateOptions = {
|
|
|
23
23
|
day: "numeric",
|
|
24
24
|
timeZone: "UTC", // DS-ADAPT: range dates are stored as UTC calendar days, so format them in UTC to avoid a day shift
|
|
25
25
|
};
|
|
26
|
-
const FilterIconButton = ({ onClick, areFiltersShown, }) => (_jsx(ActionIcon, { "data-testid": "additional-filter-toggle", variant:
|
|
26
|
+
const FilterIconButton = ({ onClick, areFiltersShown, }) => (_jsx(ActionIcon, { "data-testid": "additional-filter-toggle", variant: "outline", className: styles.filterToggle, size: "var(--ad-table-toolbar-action-icon-size)", "data-open": areFiltersShown, onClick: onClick, "aria-label": translate("table.filters.toggle.aria"), children: _jsx(FilterIcon, { color: areFiltersShown ? "currentColor" : "var(--ad-color-text-default)", style: { width: "71%", height: "71%" } }) }));
|
|
27
27
|
const CustomTopToolbar = ({ filtersState, locale, resultCount, onChange, isLoading, showFilters, onFilterToggleChange, fullscreenControl, densityControl, alertBanner, }) => {
|
|
28
28
|
const { searchTerm, city, dateRange } = filtersState;
|
|
29
29
|
const [dateRangeSelectorRefreshKey, setDateRangeSelectorRefreshKey] = useState(0);
|
|
@@ -68,7 +68,7 @@ const CustomTopToolbar = ({ filtersState, locale, resultCount, onChange, isLoadi
|
|
|
68
68
|
});
|
|
69
69
|
setDateRangeSelectorRefreshKey(prev => prev + 1);
|
|
70
70
|
};
|
|
71
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Stack, { p: "md", gap: "xshalf", className: styles.toolbar, children: [_jsxs(SimpleGrid, { cols: 2, children: [_jsxs(Group, { gap: "xs", align: "center", children: [
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Stack, { p: "md", gap: "xshalf", className: styles.toolbar, children: [_jsxs(SimpleGrid, { cols: 2, children: [_jsxs(Group, { gap: "xs", align: "center", children: [_jsx(Indicator, { size: "8", disabled: !(areFiltersActive() || Boolean(searchTerm)), children: _jsx(FilterIconButton, { areFiltersShown: showFilters, onClick: onToggleFilterClick }) }), _jsx(SearchFilter, { searchTerm: searchTerm, onChange: (value) => onChange({
|
|
72
72
|
searchTerm: value,
|
|
73
73
|
}) })] }), _jsxs(Group, { justify: "end", gap: "xs", children: [fullscreenControl, densityControl] })] }), _jsx(Group, { justify: "space-between", children: _jsxs(Group, { gap: "xs", children: [areFiltersActive() && (_jsxs(_Fragment, { children: [_jsx(Text, { className: styles.clearFilters, size: "xs", span: true, role: "button", fw: 600, onClick: clearFilters, c: "var(--ad-color-text-link)", "data-testid": "clear-filters", children: translate("table.filters.clear.filters") }), filtersState.city && (_jsx(FilterChip, { label: filtersState.city, onClick: () => onChange({
|
|
74
74
|
city: null,
|
|
@@ -57,11 +57,17 @@ const FilterIconButton = ({
|
|
|
57
57
|
}): ReactElement => (
|
|
58
58
|
<ActionIcon
|
|
59
59
|
data-testid="additional-filter-toggle"
|
|
60
|
-
variant=
|
|
60
|
+
variant="outline"
|
|
61
|
+
className={styles.filterToggle}
|
|
62
|
+
size="var(--ad-table-toolbar-action-icon-size)"
|
|
63
|
+
data-open={areFiltersShown}
|
|
61
64
|
onClick={onClick}
|
|
62
65
|
aria-label={translate("table.filters.toggle.aria")}
|
|
63
66
|
>
|
|
64
|
-
<FilterIcon
|
|
67
|
+
<FilterIcon
|
|
68
|
+
color={areFiltersShown ? "currentColor" : "var(--ad-color-text-default)"} // DS-ADAPT: open state takes the outline variant's brand colour
|
|
69
|
+
style={{ width: "71%", height: "71%" }}
|
|
70
|
+
/>
|
|
65
71
|
</ActionIcon>
|
|
66
72
|
);
|
|
67
73
|
|
|
@@ -134,13 +140,10 @@ const CustomTopToolbar = ({
|
|
|
134
140
|
<Stack p="md" gap="xshalf" className={styles.toolbar}>
|
|
135
141
|
<SimpleGrid cols={2}>
|
|
136
142
|
<Group gap="xs" align="center">
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
<FilterIconButton areFiltersShown={showFilters} onClick={onToggleFilterClick} />
|
|
140
|
-
</Indicator>
|
|
141
|
-
) : (
|
|
143
|
+
{/* DS-ADAPT: indicator shows for a search term as well as filters */}
|
|
144
|
+
<Indicator size="8" disabled={!(areFiltersActive() || Boolean(searchTerm))}>
|
|
142
145
|
<FilterIconButton areFiltersShown={showFilters} onClick={onToggleFilterClick} />
|
|
143
|
-
|
|
146
|
+
</Indicator>
|
|
144
147
|
<SearchFilter
|
|
145
148
|
searchTerm={searchTerm as string}
|
|
146
149
|
onChange={(value): void =>
|
|
@@ -18,12 +18,17 @@
|
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/* The grid layout makes <thead> a block-level grid item, so the sticky element has to be the
|
|
22
|
+
thead itself: a sticky <tr> can only move within its own (header-high) containing block. */
|
|
23
|
+
.head {
|
|
24
24
|
position: sticky;
|
|
25
25
|
top: 0;
|
|
26
26
|
z-index: var(--ad-table-header-z-index);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.headRow {
|
|
30
|
+
background-color: var(--ad-table-header-bg);
|
|
31
|
+
display: flex;
|
|
27
32
|
box-shadow: var(--ad-table-header-shadow);
|
|
28
33
|
}
|
|
29
34
|
|
|
@@ -33,6 +38,15 @@
|
|
|
33
38
|
box-sizing: border-box;
|
|
34
39
|
}
|
|
35
40
|
|
|
41
|
+
/* The bottom toolbar owns the line under the table (its border-top) in every layout, including
|
|
42
|
+
fullscreen, where a short grid leaves blank space above the footer and a tall one sits flush
|
|
43
|
+
against it. The last row therefore never draws its own border: that is the only way to get
|
|
44
|
+
exactly one line when flush, and a blank gap above the footer line is the normal table look. */
|
|
45
|
+
.body > .bodyRow:last-of-type .bodyCell,
|
|
46
|
+
.body > .bodyRow:last-of-type .emptyCell {
|
|
47
|
+
border-bottom: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
.bodyRow[data-selected="true"],
|
|
37
51
|
.bodyRow[data-selected="true"] .bodyCell {
|
|
38
52
|
background-color: var(--ad-table-row-selected-bg);
|
|
@@ -41,6 +41,6 @@ const DataTableGrid = ({ table, density, rowSelection, isLoading, pageSize, empt
|
|
|
41
41
|
}
|
|
42
42
|
return (_jsx(_Fragment, { children: rows.map(row => (_jsx(TableTr, { className: clsx(styles.bodyRow, rowStyles["table-row"]), "data-selected": rowSelection[row.id] ? "true" : undefined, children: row.getAllCells().map(cell => (_jsx(TableTd, { className: styles.bodyCell, ...getCellSizeProps(cell.column.id, cell.column.columnDef.minSize ?? 40), children: _jsx(table.FlexRender, { cell: cell }) }, cell.id))) }, row.id))) }));
|
|
43
43
|
};
|
|
44
|
-
return (_jsxs(Table, { className: styles.rootGrid, highlightOnHover: false, "data-density": density, withRowBorders:
|
|
44
|
+
return (_jsxs(Table, { className: styles.rootGrid, highlightOnHover: false, "data-density": density, withRowBorders: false, withTableBorder: false, __vars: columnSizeVars, children: [_jsx(TableThead, { className: styles.head, children: table.getHeaderGroups().map(headerGroup => (_jsx(TableTr, { className: styles.headRow, children: headerGroup.headers.map(header => (_jsx(TableTh, { className: styles.headCell, ...getCellSizeProps(header.column.id, header.column.columnDef.minSize ?? 40), children: header.isPlaceholder ? null : _jsx(table.FlexRender, { header: header }) }, header.id))) }, headerGroup.id))) }), _jsx(TableTbody, { className: styles.body, children: renderBody() })] }));
|
|
45
45
|
};
|
|
46
46
|
export default DataTableGrid;
|
|
@@ -116,11 +116,11 @@ const DataTableGrid = <TData extends RowData>({
|
|
|
116
116
|
className={styles.rootGrid}
|
|
117
117
|
highlightOnHover={false}
|
|
118
118
|
data-density={density}
|
|
119
|
-
withRowBorders
|
|
119
|
+
withRowBorders={false}
|
|
120
120
|
withTableBorder={false}
|
|
121
121
|
__vars={columnSizeVars as unknown as ComponentProps<typeof Table>["__vars"]} // DS-ADAPT: Mantine 9 CssVarsProp typing
|
|
122
122
|
>
|
|
123
|
-
<TableThead>
|
|
123
|
+
<TableThead className={styles.head}>
|
|
124
124
|
{table.getHeaderGroups().map(headerGroup => (
|
|
125
125
|
<TableTr key={headerGroup.id} className={styles.headRow}>
|
|
126
126
|
{headerGroup.headers.map(header => (
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
.
|
|
1
|
+
/* [data-variant] lifts these above the global .mantine-Alert-root rule, which would otherwise
|
|
2
|
+
put its radius back (the radius={0} prop is only a Mantine variable). */
|
|
3
|
+
.alert[data-variant] {
|
|
2
4
|
background-color: var(--ad-table-toolbar-selection-banner-bg);
|
|
3
5
|
color: var(--ad-table-toolbar-selection-banner-fg);
|
|
4
6
|
border: 0;
|
|
7
|
+
border-radius: 0;
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
.alert :global(.mantine-Alert-icon) {
|
package/dist/css/mantine.css
CHANGED
|
@@ -1076,7 +1076,7 @@
|
|
|
1076
1076
|
}
|
|
1077
1077
|
/* === Indicator === */
|
|
1078
1078
|
.mantine-Indicator-indicator {
|
|
1079
|
-
color: var(--ad-
|
|
1079
|
+
color: var(--ad-white);
|
|
1080
1080
|
border-radius: 1000px;
|
|
1081
1081
|
font-size: var(--ad-font-sizes-xs);
|
|
1082
1082
|
}
|
|
@@ -1701,7 +1701,7 @@
|
|
|
1701
1701
|
--progress-size-xl: 16px;
|
|
1702
1702
|
}
|
|
1703
1703
|
.mantine-Progress-label {
|
|
1704
|
-
color: var(--ad-
|
|
1704
|
+
color: var(--ad-white);
|
|
1705
1705
|
font-weight: var(--ad-font-weights-bold);
|
|
1706
1706
|
}
|
|
1707
1707
|
/* === Radio === */
|
|
@@ -1857,7 +1857,7 @@ fieldset:disabled .mantine-Slider-bar {
|
|
|
1857
1857
|
background: var(--ad-color-state-disabled-text);
|
|
1858
1858
|
}
|
|
1859
1859
|
.mantine-Slider-mark {
|
|
1860
|
-
background: var(--ad-
|
|
1860
|
+
background: var(--ad-white);
|
|
1861
1861
|
border-color: var(--ad-color-border-subtle);
|
|
1862
1862
|
}
|
|
1863
1863
|
.mantine-Slider-mark[data-filled] {
|
|
@@ -1889,7 +1889,7 @@ fieldset:disabled .mantine-Slider-mark[data-filled] {
|
|
|
1889
1889
|
.mantine-Stepper-stepIcon[data-completed] {
|
|
1890
1890
|
background: var(--ad-color-brand-primary);
|
|
1891
1891
|
border-color: var(--ad-color-brand-primary);
|
|
1892
|
-
color: var(--ad-
|
|
1892
|
+
color: var(--ad-white);
|
|
1893
1893
|
}
|
|
1894
1894
|
.mantine-Stepper-root[data-size="xs"] .mantine-Stepper-stepIcon {
|
|
1895
1895
|
--stepper-icon-size: 34px;
|
package/dist/stories/index.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appdirect/design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "AppDirect Design System components. Wraps Mantine v9 with standardized props, variants, and tokens.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"prepublishOnly": "npm run build"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@appdirect/ad-design-tokens": "0.0.
|
|
52
|
+
"@appdirect/ad-design-tokens": "0.0.21",
|
|
53
53
|
"@mantine/dropzone": "^9.6.0",
|
|
54
54
|
"@remixicon/react": "^4.6.0",
|
|
55
55
|
"@tabler/icons-react": "^3.33.0",
|