@coveord/plasma-mantine 56.8.0 → 56.9.0
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/.turbo/turbo-build.log +4 -4
- package/.turbo/turbo-test.log +108 -103
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/components/CodeEditor/languages/xml.d.ts.map +1 -1
- package/dist/cjs/components/CodeEditor/languages/xml.js.map +1 -1
- package/dist/cjs/components/Collection/enhanceWithCollectionProps.d.ts.map +1 -1
- package/dist/cjs/components/Collection/enhanceWithCollectionProps.js.map +1 -1
- package/dist/cjs/components/DateRangePicker/DateRange.module.css +4 -0
- package/dist/cjs/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/cjs/components/DateRangePicker/DateRangePicker.js +2 -1
- package/dist/cjs/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/cjs/components/RadioCard/RadioCard.d.ts +26 -0
- package/dist/cjs/components/RadioCard/RadioCard.d.ts.map +1 -0
- package/dist/cjs/components/RadioCard/RadioCard.js +82 -0
- package/dist/cjs/components/RadioCard/RadioCard.js.map +1 -0
- package/dist/cjs/components/Table/Table.d.ts +2 -12
- package/dist/cjs/components/Table/Table.d.ts.map +1 -1
- package/dist/cjs/components/Table/Table.js +0 -3
- package/dist/cjs/components/Table/Table.js.map +1 -1
- package/dist/cjs/components/Table/table-column/TableActionsColumn.d.ts +15 -0
- package/dist/cjs/components/Table/table-column/TableActionsColumn.d.ts.map +1 -1
- package/dist/cjs/components/Table/table-column/TableActionsColumn.js +14 -1
- package/dist/cjs/components/Table/table-column/TableActionsColumn.js.map +1 -1
- package/dist/cjs/components/Table/table-columns-selector/TableColumnsSelector.d.ts +11 -32
- package/dist/cjs/components/Table/table-columns-selector/TableColumnsSelector.d.ts.map +1 -1
- package/dist/cjs/components/Table/table-columns-selector/TableColumnsSelector.js +101 -97
- package/dist/cjs/components/Table/table-columns-selector/TableColumnsSelector.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles/RadioCard.module.css +44 -0
- package/dist/esm/components/CodeEditor/languages/xml.d.ts.map +1 -1
- package/dist/esm/components/CodeEditor/languages/xml.js.map +1 -1
- package/dist/esm/components/Collection/enhanceWithCollectionProps.d.ts.map +1 -1
- package/dist/esm/components/Collection/enhanceWithCollectionProps.js.map +1 -1
- package/dist/esm/components/DateRangePicker/DateRange.module.css +4 -0
- package/dist/esm/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/esm/components/DateRangePicker/DateRangePicker.js +2 -1
- package/dist/esm/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/esm/components/RadioCard/RadioCard.d.ts +26 -0
- package/dist/esm/components/RadioCard/RadioCard.d.ts.map +1 -0
- package/dist/esm/components/RadioCard/RadioCard.js +63 -0
- package/dist/esm/components/RadioCard/RadioCard.js.map +1 -0
- package/dist/esm/components/Table/Table.d.ts +2 -12
- package/dist/esm/components/Table/Table.d.ts.map +1 -1
- package/dist/esm/components/Table/Table.js +0 -3
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/table-column/TableActionsColumn.d.ts +15 -0
- package/dist/esm/components/Table/table-column/TableActionsColumn.d.ts.map +1 -1
- package/dist/esm/components/Table/table-column/TableActionsColumn.js +12 -1
- package/dist/esm/components/Table/table-column/TableActionsColumn.js.map +1 -1
- package/dist/esm/components/Table/table-columns-selector/TableColumnsSelector.d.ts +11 -32
- package/dist/esm/components/Table/table-columns-selector/TableColumnsSelector.d.ts.map +1 -1
- package/dist/esm/components/Table/table-columns-selector/TableColumnsSelector.js +94 -84
- package/dist/esm/components/Table/table-columns-selector/TableColumnsSelector.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/styles/RadioCard.module.css +44 -0
- package/package.json +19 -19
- package/src/components/CodeEditor/languages/xml.ts +2 -1
- package/src/components/Collection/enhanceWithCollectionProps.ts +2 -2
- package/src/components/DateRangePicker/DateRange.module.css +4 -0
- package/src/components/DateRangePicker/DateRangePicker.tsx +2 -1
- package/src/components/RadioCard/RadioCard.tsx +73 -0
- package/src/components/RadioCard/__tests__/RadioCard.component.spec.tsx +25 -0
- package/src/components/Table/Table.tsx +4 -9
- package/src/components/Table/__tests__/TableColumnsSelectorHeader.spec.tsx +325 -0
- package/src/components/Table/table-column/TableActionsColumn.tsx +28 -1
- package/src/components/Table/table-columns-selector/TableColumnsSelector.tsx +96 -125
- package/src/index.ts +4 -0
- package/src/styles/RadioCard.module.css +44 -0
- package/src/components/Table/__tests__/TableColumnsSelector.spec.tsx +0 -352
|
@@ -1,99 +1,109 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconSettings } from '@coveord/plasma-react-icons';
|
|
3
|
+
import { Checkbox, Combobox, Text, Tooltip, useCombobox } from '@mantine/core';
|
|
3
4
|
import { flexRender } from '@tanstack/react-table';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
label: 'Edit columns',
|
|
8
|
-
buttonVariant: 'outline',
|
|
5
|
+
import { ActionIcon } from '../../ActionIcon/ActionIcon';
|
|
6
|
+
const DEFAULT_OPTIONS = {
|
|
7
|
+
footer: (max)=>`You can display up to ${max} columns.`,
|
|
9
8
|
limitReachedTooltip: 'You have reached the maximum display limit.',
|
|
10
|
-
alwaysVisibleTooltip: 'This column is always visible.'
|
|
11
|
-
showVisibleCountLabel: false
|
|
9
|
+
alwaysVisibleTooltip: 'This column is always visible.'
|
|
12
10
|
};
|
|
13
|
-
export const
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
export const TableColumnsSelectorHeader = ({ table, options })=>{
|
|
12
|
+
const { maxSelectableColumns, footer, limitReachedTooltip, alwaysVisibleTooltip } = {
|
|
13
|
+
...DEFAULT_OPTIONS,
|
|
14
|
+
...options
|
|
15
|
+
};
|
|
16
|
+
const combobox = useCombobox({
|
|
17
|
+
onDropdownClose: ()=>{
|
|
18
|
+
combobox.resetSelectedOption();
|
|
19
|
+
},
|
|
20
|
+
onDropdownOpen: ()=>combobox.updateSelectedOptionIndex('active')
|
|
21
|
+
});
|
|
17
22
|
const allColumns = table.getAllLeafColumns();
|
|
18
23
|
const filteredColumns = allColumns.filter((column)=>!column.columnDef.meta?.controlColumn);
|
|
19
24
|
const selectedColumnsCount = filteredColumns.filter((column)=>column.getIsVisible()).length;
|
|
25
|
+
// Validate maxSelectableColumns - must be a positive integer to be effective
|
|
26
|
+
const effectiveMaxColumns = maxSelectableColumns !== undefined && maxSelectableColumns > 0 ? maxSelectableColumns : undefined;
|
|
20
27
|
if (filteredColumns.length <= 0) {
|
|
21
28
|
return null;
|
|
22
29
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
const getColumnState = (column)=>{
|
|
31
|
+
const alwaysVisible = !column.getCanHide();
|
|
32
|
+
const isDisabled = effectiveMaxColumns !== undefined && selectedColumnsCount >= effectiveMaxColumns && !column.getIsVisible() || alwaysVisible;
|
|
33
|
+
const isVisible = column.getIsVisible() || alwaysVisible;
|
|
34
|
+
return {
|
|
35
|
+
alwaysVisible,
|
|
36
|
+
isDisabled,
|
|
37
|
+
isVisible
|
|
38
|
+
};
|
|
26
39
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
children: /*#__PURE__*/ _jsx(Stack, {
|
|
56
|
-
...getStyles('columnSelectorWrapper', stylesApiProps),
|
|
57
|
-
children: filteredColumns.map((column)=>{
|
|
58
|
-
const alwaysVisible = !column.getCanHide();
|
|
59
|
-
const isDisabled = selectedColumnsCount >= maxSelectableColumns && !column.getIsVisible() || alwaysVisible;
|
|
60
|
-
return /*#__PURE__*/ _jsx(Tooltip, {
|
|
61
|
-
label: alwaysVisible ? alwaysVisibleTooltip : limitReachedTooltip,
|
|
62
|
-
disabled: !isDisabled,
|
|
63
|
-
position: "left",
|
|
64
|
-
children: /*#__PURE__*/ _jsx("div", {
|
|
65
|
-
children: /*#__PURE__*/ _jsx(Checkbox, {
|
|
66
|
-
label: flexRender(column.columnDef.header, {
|
|
67
|
-
table,
|
|
68
|
-
column,
|
|
69
|
-
header: {
|
|
70
|
-
column
|
|
71
|
-
}
|
|
72
|
-
}),
|
|
73
|
-
name: column.id,
|
|
74
|
-
checked: column.getIsVisible() || alwaysVisible,
|
|
75
|
-
disabled: isDisabled,
|
|
76
|
-
onChange: column.getToggleVisibilityHandler()
|
|
77
|
-
}, column.id)
|
|
78
|
-
})
|
|
79
|
-
}, column.id);
|
|
80
|
-
})
|
|
81
|
-
})
|
|
40
|
+
const handleOptionClick = (columnId)=>{
|
|
41
|
+
const column = filteredColumns.find((col)=>col.id === columnId);
|
|
42
|
+
if (column) {
|
|
43
|
+
const { isDisabled } = getColumnState(column);
|
|
44
|
+
if (!isDisabled) {
|
|
45
|
+
column.toggleVisibility();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const columnOptions = filteredColumns.map((column)=>{
|
|
50
|
+
const { alwaysVisible, isDisabled, isVisible } = getColumnState(column);
|
|
51
|
+
return /*#__PURE__*/ _jsx(Combobox.Option, {
|
|
52
|
+
value: column.id,
|
|
53
|
+
disabled: isDisabled,
|
|
54
|
+
active: isVisible,
|
|
55
|
+
children: /*#__PURE__*/ _jsx(Tooltip, {
|
|
56
|
+
label: alwaysVisible ? alwaysVisibleTooltip : limitReachedTooltip,
|
|
57
|
+
disabled: !isDisabled,
|
|
58
|
+
position: "left",
|
|
59
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
60
|
+
children: /*#__PURE__*/ _jsx(Checkbox, {
|
|
61
|
+
checked: isVisible,
|
|
62
|
+
label: flexRender(column.columnDef.header, {
|
|
63
|
+
table,
|
|
64
|
+
column,
|
|
65
|
+
header: {
|
|
66
|
+
column
|
|
67
|
+
}
|
|
82
68
|
}),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/*#__PURE__*/ _jsx(Divider, {
|
|
86
|
-
mb: "xs",
|
|
87
|
-
mt: "sm"
|
|
88
|
-
}),
|
|
89
|
-
footer
|
|
90
|
-
]
|
|
91
|
-
})
|
|
92
|
-
]
|
|
69
|
+
disabled: isDisabled
|
|
70
|
+
})
|
|
93
71
|
})
|
|
94
|
-
|
|
95
|
-
})
|
|
72
|
+
})
|
|
73
|
+
}, column.id);
|
|
96
74
|
});
|
|
97
|
-
|
|
75
|
+
return /*#__PURE__*/ _jsxs(Combobox, {
|
|
76
|
+
store: combobox,
|
|
77
|
+
position: "bottom-end",
|
|
78
|
+
shadow: "md",
|
|
79
|
+
onOptionSubmit: handleOptionClick,
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx(Combobox.Target, {
|
|
82
|
+
children: /*#__PURE__*/ _jsx(ActionIcon.Tertiary, {
|
|
83
|
+
onClick: ()=>combobox.toggleDropdown(),
|
|
84
|
+
"aria-label": "settings",
|
|
85
|
+
children: /*#__PURE__*/ _jsx(IconSettings, {
|
|
86
|
+
height: 16
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ _jsxs(Combobox.Dropdown, {
|
|
91
|
+
miw: 270,
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ _jsx(Combobox.Options, {
|
|
94
|
+
children: columnOptions
|
|
95
|
+
}),
|
|
96
|
+
effectiveMaxColumns && /*#__PURE__*/ _jsx(Combobox.Footer, {
|
|
97
|
+
children: /*#__PURE__*/ _jsx(Text, {
|
|
98
|
+
size: "sm",
|
|
99
|
+
c: "dimmed",
|
|
100
|
+
children: typeof footer === 'function' ? footer(effectiveMaxColumns) : footer
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
};
|
|
98
108
|
|
|
99
109
|
//# sourceMappingURL=TableColumnsSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Table/table-columns-selector/TableColumnsSelector.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Table/table-columns-selector/TableColumnsSelector.tsx"],"sourcesContent":["import {IconSettings} from '@coveord/plasma-react-icons';\nimport {Checkbox, Combobox, Text, Tooltip, useCombobox} from '@mantine/core';\nimport {flexRender, Header, Table} from '@tanstack/react-table';\nimport {ActionIcon} from '../../ActionIcon/ActionIcon';\n\nexport interface TableColumnsSelectorOptions {\n /**\n * The maximum number of columns that can be selected at the same time.\n * If defined a footer will render with the remaining number of columns that can be selected.\n * Must be a positive integer (greater than 0).\n */\n maxSelectableColumns?: number;\n /**\n * The content to display in the footer when maxSelectableColumns is defined.\n * Can be a string or a function that receives the maxSelectableColumns value.\n * @default (max) => `You can display up to ${max} columns.`\n */\n footer?: string | ((maxSelectableColumns: number) => string);\n /**\n * The tooltip to display when the user hovers over a disabled checkbox because of the limit.\n * @default 'You have reached the maximum display limit.'\n */\n limitReachedTooltip?: string;\n /**\n * The tooltip to display when the user hovers over a disabled checkbox because a column cannot be hidden.\n * @default 'This column is always visible.'\n */\n alwaysVisibleTooltip?: string;\n}\n\nexport interface TableColumnsSelectorHeaderProps {\n table: Table<unknown>;\n options?: TableColumnsSelectorOptions;\n}\n\nconst DEFAULT_OPTIONS: Omit<TableColumnsSelectorOptions, 'footer'> & {\n footer: (maxSelectableColumns: number) => string;\n} = {\n footer: (max) => `You can display up to ${max} columns.`,\n limitReachedTooltip: 'You have reached the maximum display limit.',\n alwaysVisibleTooltip: 'This column is always visible.',\n};\n\nexport const TableColumnsSelectorHeader = ({table, options}: TableColumnsSelectorHeaderProps) => {\n const {maxSelectableColumns, footer, limitReachedTooltip, alwaysVisibleTooltip} = {\n ...DEFAULT_OPTIONS,\n ...options,\n };\n\n const combobox = useCombobox({\n onDropdownClose: () => {\n combobox.resetSelectedOption();\n },\n onDropdownOpen: () => combobox.updateSelectedOptionIndex('active'),\n });\n\n const allColumns = table.getAllLeafColumns();\n const filteredColumns = allColumns.filter((column) => !column.columnDef.meta?.controlColumn);\n const selectedColumnsCount = filteredColumns.filter((column) => column.getIsVisible()).length;\n\n // Validate maxSelectableColumns - must be a positive integer to be effective\n const effectiveMaxColumns =\n maxSelectableColumns !== undefined && maxSelectableColumns > 0 ? maxSelectableColumns : undefined;\n\n if (filteredColumns.length <= 0) {\n return null;\n }\n\n const getColumnState = (column: (typeof filteredColumns)[number]) => {\n const alwaysVisible = !column.getCanHide();\n const isDisabled =\n (effectiveMaxColumns !== undefined &&\n selectedColumnsCount >= effectiveMaxColumns &&\n !column.getIsVisible()) ||\n alwaysVisible;\n const isVisible = column.getIsVisible() || alwaysVisible;\n return {alwaysVisible, isDisabled, isVisible};\n };\n\n const handleOptionClick = (columnId: string) => {\n const column = filteredColumns.find((col) => col.id === columnId);\n if (column) {\n const {isDisabled} = getColumnState(column);\n if (!isDisabled) {\n column.toggleVisibility();\n }\n }\n };\n\n const columnOptions = filteredColumns.map((column) => {\n const {alwaysVisible, isDisabled, isVisible} = getColumnState(column);\n\n return (\n <Combobox.Option value={column.id} key={column.id} disabled={isDisabled} active={isVisible}>\n <Tooltip\n label={alwaysVisible ? alwaysVisibleTooltip : limitReachedTooltip}\n disabled={!isDisabled}\n position=\"left\"\n >\n <div>\n <Checkbox\n checked={isVisible}\n label={flexRender(column.columnDef.header, {\n table,\n column,\n header: {column} as Header<unknown, unknown>,\n })}\n disabled={isDisabled}\n />\n </div>\n </Tooltip>\n </Combobox.Option>\n );\n });\n\n return (\n <Combobox store={combobox} position=\"bottom-end\" shadow=\"md\" onOptionSubmit={handleOptionClick}>\n <Combobox.Target>\n <ActionIcon.Tertiary onClick={() => combobox.toggleDropdown()} aria-label=\"settings\">\n <IconSettings height={16} />\n </ActionIcon.Tertiary>\n </Combobox.Target>\n <Combobox.Dropdown miw={270}>\n <Combobox.Options>{columnOptions}</Combobox.Options>\n {effectiveMaxColumns && (\n <Combobox.Footer>\n <Text size=\"sm\" c=\"dimmed\">\n {typeof footer === 'function' ? footer(effectiveMaxColumns) : footer}\n </Text>\n </Combobox.Footer>\n )}\n </Combobox.Dropdown>\n </Combobox>\n );\n};\n"],"names":["IconSettings","Checkbox","Combobox","Text","Tooltip","useCombobox","flexRender","ActionIcon","DEFAULT_OPTIONS","footer","max","limitReachedTooltip","alwaysVisibleTooltip","TableColumnsSelectorHeader","table","options","maxSelectableColumns","combobox","onDropdownClose","resetSelectedOption","onDropdownOpen","updateSelectedOptionIndex","allColumns","getAllLeafColumns","filteredColumns","filter","column","columnDef","meta","controlColumn","selectedColumnsCount","getIsVisible","length","effectiveMaxColumns","undefined","getColumnState","alwaysVisible","getCanHide","isDisabled","isVisible","handleOptionClick","columnId","find","col","id","toggleVisibility","columnOptions","map","Option","value","disabled","active","label","position","div","checked","header","store","shadow","onOptionSubmit","Target","Tertiary","onClick","toggleDropdown","aria-label","height","Dropdown","miw","Options","Footer","size","c"],"mappings":";AAAA,SAAQA,YAAY,QAAO,8BAA8B;AACzD,SAAQC,QAAQ,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,WAAW,QAAO,gBAAgB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
export { Modal, type ModalFactory, type ModalProps } from './components/Modal/Modal.js';
|
|
42
42
|
export * from './components/Modal/ModalFooter.js';
|
|
43
43
|
export * from './components/Prompt/Prompt.js';
|
|
44
|
+
export { RadioCard, type RadioCardProps } from './components/RadioCard/RadioCard.js';
|
|
44
45
|
export { PasswordInput } from './components/PasswordInput/PasswordInput.js';
|
|
45
46
|
export { Select } from './components/Select/Select.js';
|
|
46
47
|
export * from './components/StickyFooter/StickyFooter.js';
|
|
47
48
|
export { flexRender as renderTableCell } from '@tanstack/react-table';
|
|
49
|
+
export { TableActionsColumn } from './components/Table/table-column/TableActionsColumn.js';
|
|
48
50
|
export { type TablePredicateProps } from './components/Table/table-predicate/TablePredicate.js';
|
|
49
51
|
export { Table, TableComponentsOrder, type PlasmaTableFactory } from './components/Table/Table.js';
|
|
50
52
|
export { type TableAction, type TableLayout, type TableLayoutProps, type TableProps, } from './components/Table/Table.types.js';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AACvD,OAAO,EAAC,KAAK,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,KAAK,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAE1D,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,gBAAgB,CAAC;AACpD,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,KAAK,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC/D,cAAc,sBAAsB,CAAC;AAIrC,OAAO,EAAC,SAAS,EAAC,MAAM,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AA6B,CAAC;AACjG,OAAO,EACH,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAC,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,iCAAiC,CAAC;AACjH,OAAO,EAAC,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,wBAAwB,EAAC,MAAM,iCAAiC,CAAC;AAExH,OAAO,EAAC,IAAI,EAAC,CAAC;AAGd,cAAc,uCAAuC,CAAC;AACtD,cAAc,wBAAwB,CAAC;AAEvC,OAAO,QAAQ,eAAe,CAAC;IAC3B,UAAiB,0BAA0B;QACvC,MAAM,EAAE,MAAM,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,kBAAkB,CAAC,CAAC;KACjF;CACJ;AAED,OAAO,QAAQ,uBAAuB,CAAC;IACnC,UAAU,UAAU,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM;QAC9C;;;;WAIG;QACH,aAAa,EAAE,OAAO,CAAC;KAC1B;CACJ"}
|
package/dist/esm/index.js
CHANGED
|
@@ -61,6 +61,8 @@ export { Modal } from './components/Modal/Modal.js';
|
|
|
61
61
|
export * from './components/Modal/ModalFooter.js';
|
|
62
62
|
// Prompt
|
|
63
63
|
export * from './components/Prompt/Prompt.js';
|
|
64
|
+
// RadioCard - override Mantine RadioCard
|
|
65
|
+
export { RadioCard } from './components/RadioCard/RadioCard.js';
|
|
64
66
|
// Read Only - override Mantine PasswordInput and Select
|
|
65
67
|
export { PasswordInput } from './components/PasswordInput/PasswordInput.js';
|
|
66
68
|
export { Select } from './components/Select/Select.js';
|
|
@@ -68,6 +70,7 @@ export { Select } from './components/Select/Select.js';
|
|
|
68
70
|
export * from './components/StickyFooter/StickyFooter.js';
|
|
69
71
|
// Table - override Mantine Table
|
|
70
72
|
export { flexRender as renderTableCell } from '@tanstack/react-table';
|
|
73
|
+
export { TableActionsColumn } from './components/Table/table-column/TableActionsColumn.js';
|
|
71
74
|
export { Table, TableComponentsOrder } from './components/Table/Table.js';
|
|
72
75
|
export { useTableContext } from './components/Table/TableContext.js';
|
|
73
76
|
export { useTable } from './components/Table/use-table.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import {MantineColorsTuple, noop} from '@mantine/core';\nimport {type RowData} from '@tanstack/table-core';\nimport {type PlasmaColors} from './theme/PlasmaColors.js';\n\nexport * from '@mantine/carousel';\nexport * from '@mantine/core';\nexport {Pagination} from '@mantine/core';\nexport {type DatesRangeValue} from '@mantine/dates';\nexport * from '@mantine/form';\nexport * from '@mantine/hooks';\nexport * from '@mantine/notifications';\nexport {type NotificationsProps} from '@mantine/notifications';\nexport * from '@tanstack/table-core';\n\n// Export all components\n// Accordion\nexport {Accordion} from './components/Accordion/Accordion.js';\n\n// Action Icon - override Mantine ActionIcon\nexport {ActionIcon, type ActionIconProps} from './components/ActionIcon/ActionIcon.js';\n\n// Alert - override Mantine Alert\nexport {Alert} from './components/Alert/Alert.js';\n\n// Badge - override Mantine Badge\nexport {\n Badge,\n type BadgeOverloadFactory,\n type SemanticBadge,\n type SemanticBadgeProps,\n} from './components/Badge/Badge.js';\n\n// Blank Slate\nexport * from './components/BlankSlate/BlankSlate.js';\n\n// Browser Preview\nexport * from './components/BrowserPreview/BrowserPreview.js';\n\n// Button - override Mantine Button\nexport {Button, type ButtonProps} from './components/Button/Button.js';\nexport {type ButtonWithDisabledTooltipProps} from './components/Button/ButtonWithDisabledTooltip.js';\n\n// Checkbox\nexport * from './components/CheckboxIcon/CheckboxIcon.js';\n\n// Child Form\nexport * from './components/ChildForm/ChildForm.js';\n\n// Chip - override Mantine Chip\nexport {Chip} from './components/Chip/Chip.js';\n\n// Code Editor\nexport * from './components/CodeEditor/CodeEditor.js';\n\n// Collection\nexport * from './components/Collection/Collection.js';\nexport {enhanceWithCollectionProps} from './components/Collection/enhanceWithCollectionProps.js';\n\n// Copy to Clipboard\nexport * from './components/CopyToClipboard/CopyToClipboard.js';\n\n// Date Range Picker\nexport * from './components/DateRangePicker/DateRangePicker.js';\nexport * from './components/DateRangePicker/DateRangePickerInlineCalendar.js';\nexport * from './components/DateRangePicker/DateRangePickerPopoverCalendar.js';\nexport * from './components/DateRangePicker/DateRangePickerPresetSelect.js';\n\n// Date Time Range Picker\nexport * from './components/DateTimeRangePicker/DateTimeRangePicker.js';\n\n// Ellipsis Text\nexport * from './components/EllipsisText/EllipsisText.js';\n\n// Header - override @tanstack/table-core Header\nexport {\n Header,\n type HeaderBreadcrumbsProps,\n type HeaderDocAnchorProps,\n type HeaderFactory,\n type HeaderProps,\n type HeaderRightProps,\n type HeaderStyleNames,\n type HeaderVariant,\n} from './components/Header/Header.js';\n\n// Info Token\nexport * from './components/InfoToken/InfoToken.js';\n\n// Inline Confirm\nexport * from './components/InlineConfirm/InlineConfirm.js';\nexport * from './components/InlineConfirm/InlineConfirmContext.js';\n\n// Last Updated\nexport * from './components/LastUpdated/LastUpdated.js';\n\n// Loader\nexport * from './components/CircleLoader/CircleLoader.js';\n\n// Menu - override Mantine Menu\nexport {Menu, type MenuItemProps} from './components/Menu/Menu.js';\n\n// Modal - override Mantine Modal\nexport {Modal, type ModalFactory, type ModalProps} from './components/Modal/Modal.js';\nexport * from './components/Modal/ModalFooter.js';\n\n// Prompt\nexport * from './components/Prompt/Prompt.js';\n\n// Read Only - override Mantine PasswordInput and Select\nexport {PasswordInput} from './components/PasswordInput/PasswordInput.js';\nexport {Select} from './components/Select/Select.js';\n\n// Sticky Footer\nexport * from './components/StickyFooter/StickyFooter.js';\n\n// Table - override Mantine Table\nexport {flexRender as renderTableCell} from '@tanstack/react-table';\nexport {type TablePredicateProps} from './components/Table/table-predicate/TablePredicate.js';\nexport {Table, TableComponentsOrder, type PlasmaTableFactory} from './components/Table/Table.js';\nexport {\n type TableAction,\n type TableLayout,\n type TableLayoutProps,\n type TableProps,\n} from './components/Table/Table.types.js';\nexport {useTableContext} from './components/Table/TableContext.js';\nexport {useTable, type TableState, type TableStore, type UseTableOptions} from './components/Table/use-table.js';\nexport {useUrlSyncedState, type SearchParamEntry, type UseUrlSyncedStateOptions} from './hooks/use-url-synced-state.js';\n\nexport {noop};\n\n// Theme\nexport * from './theme/plasmaCSSVariablesResolver.js';\nexport * from './theme/Plasmantine.js';\n\ndeclare module '@mantine/core' {\n export interface MantineThemeColorsOverride {\n colors: Record<keyof typeof PlasmaColors | (string & {}), MantineColorsTuple>;\n }\n}\n\ndeclare module '@tanstack/react-table' {\n interface ColumnMeta<TData extends RowData, TValue> {\n /**\n * Whether the column is a control column.\n * Control columns are columns that are not part of the data but are used to control the table.\n * For example, a column that contains checkboxes to select rows.\n */\n controlColumn: boolean;\n }\n}\n"],"names":["noop","Pagination","Accordion","ActionIcon","Alert","Badge","Button","Chip","enhanceWithCollectionProps","Header","Menu","Modal","PasswordInput","Select","flexRender","renderTableCell","Table","TableComponentsOrder","useTableContext","useTable","useUrlSyncedState"],"mappings":"AAAA,SAA4BA,IAAI,QAAO,gBAAgB;AAIvD,cAAc,oBAAoB;AAClC,cAAc,gBAAgB;AAC9B,SAAQC,UAAU,QAAO,gBAAgB;AAEzC,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,yBAAyB;AAEvC,cAAc,uBAAuB;AAErC,wBAAwB;AACxB,YAAY;AACZ,SAAQC,SAAS,QAAO,sCAAsC;AAE9D,4CAA4C;AAC5C,SAAQC,UAAU,QAA6B,wCAAwC;AAEvF,iCAAiC;AACjC,SAAQC,KAAK,QAAO,8BAA8B;AAElD,iCAAiC;AACjC,SACIC,KAAK,QAIF,8BAA8B;AAErC,cAAc;AACd,cAAc,wCAAwC;AAEtD,kBAAkB;AAClB,cAAc,gDAAgD;AAE9D,mCAAmC;AACnC,SAAQC,MAAM,QAAyB,gCAAgC;AAGvE,WAAW;AACX,cAAc,4CAA4C;AAE1D,aAAa;AACb,cAAc,sCAAsC;AAEpD,+BAA+B;AAC/B,SAAQC,IAAI,QAAO,4BAA4B;AAE/C,cAAc;AACd,cAAc,wCAAwC;AAEtD,aAAa;AACb,cAAc,wCAAwC;AACtD,SAAQC,0BAA0B,QAAO,wDAAwD;AAEjG,oBAAoB;AACpB,cAAc,kDAAkD;AAEhE,oBAAoB;AACpB,cAAc,kDAAkD;AAChE,cAAc,gEAAgE;AAC9E,cAAc,iEAAiE;AAC/E,cAAc,8DAA8D;AAE5E,yBAAyB;AACzB,cAAc,0DAA0D;AAExE,gBAAgB;AAChB,cAAc,4CAA4C;AAE1D,gDAAgD;AAChD,SACIC,MAAM,QAQH,gCAAgC;AAEvC,aAAa;AACb,cAAc,sCAAsC;AAEpD,iBAAiB;AACjB,cAAc,8CAA8C;AAC5D,cAAc,qDAAqD;AAEnE,eAAe;AACf,cAAc,0CAA0C;AAExD,SAAS;AACT,cAAc,4CAA4C;AAE1D,+BAA+B;AAC/B,SAAQC,IAAI,QAA2B,4BAA4B;AAEnE,iCAAiC;AACjC,SAAQC,KAAK,QAA2C,8BAA8B;AACtF,cAAc,oCAAoC;AAElD,SAAS;AACT,cAAc,gCAAgC;AAE9C,wDAAwD;AACxD,SAAQC,aAAa,QAAO,8CAA8C;AAC1E,SAAQC,MAAM,QAAO,gCAAgC;AAErD,gBAAgB;AAChB,cAAc,4CAA4C;AAE1D,iCAAiC;AACjC,SAAQC,cAAcC,eAAe,QAAO,wBAAwB;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import {MantineColorsTuple, noop} from '@mantine/core';\nimport {type RowData} from '@tanstack/table-core';\nimport {type PlasmaColors} from './theme/PlasmaColors.js';\n\nexport * from '@mantine/carousel';\nexport * from '@mantine/core';\nexport {Pagination} from '@mantine/core';\nexport {type DatesRangeValue} from '@mantine/dates';\nexport * from '@mantine/form';\nexport * from '@mantine/hooks';\nexport * from '@mantine/notifications';\nexport {type NotificationsProps} from '@mantine/notifications';\nexport * from '@tanstack/table-core';\n\n// Export all components\n// Accordion\nexport {Accordion} from './components/Accordion/Accordion.js';\n\n// Action Icon - override Mantine ActionIcon\nexport {ActionIcon, type ActionIconProps} from './components/ActionIcon/ActionIcon.js';\n\n// Alert - override Mantine Alert\nexport {Alert} from './components/Alert/Alert.js';\n\n// Badge - override Mantine Badge\nexport {\n Badge,\n type BadgeOverloadFactory,\n type SemanticBadge,\n type SemanticBadgeProps,\n} from './components/Badge/Badge.js';\n\n// Blank Slate\nexport * from './components/BlankSlate/BlankSlate.js';\n\n// Browser Preview\nexport * from './components/BrowserPreview/BrowserPreview.js';\n\n// Button - override Mantine Button\nexport {Button, type ButtonProps} from './components/Button/Button.js';\nexport {type ButtonWithDisabledTooltipProps} from './components/Button/ButtonWithDisabledTooltip.js';\n\n// Checkbox\nexport * from './components/CheckboxIcon/CheckboxIcon.js';\n\n// Child Form\nexport * from './components/ChildForm/ChildForm.js';\n\n// Chip - override Mantine Chip\nexport {Chip} from './components/Chip/Chip.js';\n\n// Code Editor\nexport * from './components/CodeEditor/CodeEditor.js';\n\n// Collection\nexport * from './components/Collection/Collection.js';\nexport {enhanceWithCollectionProps} from './components/Collection/enhanceWithCollectionProps.js';\n\n// Copy to Clipboard\nexport * from './components/CopyToClipboard/CopyToClipboard.js';\n\n// Date Range Picker\nexport * from './components/DateRangePicker/DateRangePicker.js';\nexport * from './components/DateRangePicker/DateRangePickerInlineCalendar.js';\nexport * from './components/DateRangePicker/DateRangePickerPopoverCalendar.js';\nexport * from './components/DateRangePicker/DateRangePickerPresetSelect.js';\n\n// Date Time Range Picker\nexport * from './components/DateTimeRangePicker/DateTimeRangePicker.js';\n\n// Ellipsis Text\nexport * from './components/EllipsisText/EllipsisText.js';\n\n// Header - override @tanstack/table-core Header\nexport {\n Header,\n type HeaderBreadcrumbsProps,\n type HeaderDocAnchorProps,\n type HeaderFactory,\n type HeaderProps,\n type HeaderRightProps,\n type HeaderStyleNames,\n type HeaderVariant,\n} from './components/Header/Header.js';\n\n// Info Token\nexport * from './components/InfoToken/InfoToken.js';\n\n// Inline Confirm\nexport * from './components/InlineConfirm/InlineConfirm.js';\nexport * from './components/InlineConfirm/InlineConfirmContext.js';\n\n// Last Updated\nexport * from './components/LastUpdated/LastUpdated.js';\n\n// Loader\nexport * from './components/CircleLoader/CircleLoader.js';\n\n// Menu - override Mantine Menu\nexport {Menu, type MenuItemProps} from './components/Menu/Menu.js';\n\n// Modal - override Mantine Modal\nexport {Modal, type ModalFactory, type ModalProps} from './components/Modal/Modal.js';\nexport * from './components/Modal/ModalFooter.js';\n\n// Prompt\nexport * from './components/Prompt/Prompt.js';\n\n// RadioCard - override Mantine RadioCard\nexport {RadioCard, type RadioCardProps} from './components/RadioCard/RadioCard.js';\n\n// Read Only - override Mantine PasswordInput and Select\nexport {PasswordInput} from './components/PasswordInput/PasswordInput.js';\nexport {Select} from './components/Select/Select.js';\n\n// Sticky Footer\nexport * from './components/StickyFooter/StickyFooter.js';\n\n// Table - override Mantine Table\nexport {flexRender as renderTableCell} from '@tanstack/react-table';\nexport {TableActionsColumn} from './components/Table/table-column/TableActionsColumn.js';\nexport {type TablePredicateProps} from './components/Table/table-predicate/TablePredicate.js';\nexport {Table, TableComponentsOrder, type PlasmaTableFactory} from './components/Table/Table.js';\nexport {\n type TableAction,\n type TableLayout,\n type TableLayoutProps,\n type TableProps,\n} from './components/Table/Table.types.js';\nexport {useTableContext} from './components/Table/TableContext.js';\nexport {useTable, type TableState, type TableStore, type UseTableOptions} from './components/Table/use-table.js';\nexport {useUrlSyncedState, type SearchParamEntry, type UseUrlSyncedStateOptions} from './hooks/use-url-synced-state.js';\n\nexport {noop};\n\n// Theme\nexport * from './theme/plasmaCSSVariablesResolver.js';\nexport * from './theme/Plasmantine.js';\n\ndeclare module '@mantine/core' {\n export interface MantineThemeColorsOverride {\n colors: Record<keyof typeof PlasmaColors | (string & {}), MantineColorsTuple>;\n }\n}\n\ndeclare module '@tanstack/react-table' {\n interface ColumnMeta<TData extends RowData, TValue> {\n /**\n * Whether the column is a control column.\n * Control columns are columns that are not part of the data but are used to control the table.\n * For example, a column that contains checkboxes to select rows.\n */\n controlColumn: boolean;\n }\n}\n"],"names":["noop","Pagination","Accordion","ActionIcon","Alert","Badge","Button","Chip","enhanceWithCollectionProps","Header","Menu","Modal","RadioCard","PasswordInput","Select","flexRender","renderTableCell","TableActionsColumn","Table","TableComponentsOrder","useTableContext","useTable","useUrlSyncedState"],"mappings":"AAAA,SAA4BA,IAAI,QAAO,gBAAgB;AAIvD,cAAc,oBAAoB;AAClC,cAAc,gBAAgB;AAC9B,SAAQC,UAAU,QAAO,gBAAgB;AAEzC,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,yBAAyB;AAEvC,cAAc,uBAAuB;AAErC,wBAAwB;AACxB,YAAY;AACZ,SAAQC,SAAS,QAAO,sCAAsC;AAE9D,4CAA4C;AAC5C,SAAQC,UAAU,QAA6B,wCAAwC;AAEvF,iCAAiC;AACjC,SAAQC,KAAK,QAAO,8BAA8B;AAElD,iCAAiC;AACjC,SACIC,KAAK,QAIF,8BAA8B;AAErC,cAAc;AACd,cAAc,wCAAwC;AAEtD,kBAAkB;AAClB,cAAc,gDAAgD;AAE9D,mCAAmC;AACnC,SAAQC,MAAM,QAAyB,gCAAgC;AAGvE,WAAW;AACX,cAAc,4CAA4C;AAE1D,aAAa;AACb,cAAc,sCAAsC;AAEpD,+BAA+B;AAC/B,SAAQC,IAAI,QAAO,4BAA4B;AAE/C,cAAc;AACd,cAAc,wCAAwC;AAEtD,aAAa;AACb,cAAc,wCAAwC;AACtD,SAAQC,0BAA0B,QAAO,wDAAwD;AAEjG,oBAAoB;AACpB,cAAc,kDAAkD;AAEhE,oBAAoB;AACpB,cAAc,kDAAkD;AAChE,cAAc,gEAAgE;AAC9E,cAAc,iEAAiE;AAC/E,cAAc,8DAA8D;AAE5E,yBAAyB;AACzB,cAAc,0DAA0D;AAExE,gBAAgB;AAChB,cAAc,4CAA4C;AAE1D,gDAAgD;AAChD,SACIC,MAAM,QAQH,gCAAgC;AAEvC,aAAa;AACb,cAAc,sCAAsC;AAEpD,iBAAiB;AACjB,cAAc,8CAA8C;AAC5D,cAAc,qDAAqD;AAEnE,eAAe;AACf,cAAc,0CAA0C;AAExD,SAAS;AACT,cAAc,4CAA4C;AAE1D,+BAA+B;AAC/B,SAAQC,IAAI,QAA2B,4BAA4B;AAEnE,iCAAiC;AACjC,SAAQC,KAAK,QAA2C,8BAA8B;AACtF,cAAc,oCAAoC;AAElD,SAAS;AACT,cAAc,gCAAgC;AAE9C,yCAAyC;AACzC,SAAQC,SAAS,QAA4B,sCAAsC;AAEnF,wDAAwD;AACxD,SAAQC,aAAa,QAAO,8CAA8C;AAC1E,SAAQC,MAAM,QAAO,gCAAgC;AAErD,gBAAgB;AAChB,cAAc,4CAA4C;AAE1D,iCAAiC;AACjC,SAAQC,cAAcC,eAAe,QAAO,wBAAwB;AACpE,SAAQC,kBAAkB,QAAO,wDAAwD;AAEzF,SAAQC,KAAK,EAAEC,oBAAoB,QAAgC,8BAA8B;AAOjG,SAAQC,eAAe,QAAO,qCAAqC;AACnE,SAAQC,QAAQ,QAA+D,kCAAkC;AACjH,SAAQC,iBAAiB,QAA6D,kCAAkC;AAExH,SAAQtB,IAAI,GAAE;AAEd,QAAQ;AACR,cAAc,wCAAwC;AACtD,cAAc,yBAAyB"}
|
|
@@ -5,7 +5,51 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.card {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: flex-start;
|
|
11
|
+
padding: var(--mantine-spacing-sm);
|
|
12
|
+
border-radius: var(--mantine-radius-lg);
|
|
13
|
+
|
|
14
|
+
&[data-checked] {
|
|
15
|
+
border-color: var(--mantine-primary-color-filled);
|
|
16
|
+
}
|
|
17
|
+
|
|
8
18
|
&[disabled] {
|
|
9
19
|
pointer-events: none;
|
|
20
|
+
|
|
21
|
+
.title {
|
|
22
|
+
color: var(--mantine-color-disabled-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.description {
|
|
26
|
+
color: var(--mantine-color-disabled-color);
|
|
27
|
+
}
|
|
10
28
|
}
|
|
11
29
|
}
|
|
30
|
+
|
|
31
|
+
.container {
|
|
32
|
+
flex-wrap: nowrap;
|
|
33
|
+
gap: var(--mantine-spacing-sm);
|
|
34
|
+
align-items: baseline;
|
|
35
|
+
justify-content: flex-start;
|
|
36
|
+
width: 100%;
|
|
37
|
+
margin-bottom: var(--mantine-spacing-xs);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.title {
|
|
41
|
+
flex: 1;
|
|
42
|
+
color: var(--coveo-color-title);
|
|
43
|
+
word-break: break-word;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.description {
|
|
47
|
+
padding-left: var(--mantine-spacing-lg);
|
|
48
|
+
color: var(--mantine-color-dimmed);
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
font-size: var(--mantine-font-size-xs);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.indicator {
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveord/plasma-mantine",
|
|
3
|
-
"version": "56.
|
|
3
|
+
"version": "56.9.0",
|
|
4
4
|
"description": "A Plasma flavoured Mantine theme",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plasma",
|
|
@@ -80,45 +80,45 @@
|
|
|
80
80
|
"dayjs": "1.11.19",
|
|
81
81
|
"fast-deep-equal": "3.1.3",
|
|
82
82
|
"lodash.defaultsdeep": "4.6.1",
|
|
83
|
-
"monaco-editor": "0.
|
|
84
|
-
"@coveord/plasma-react-icons": "56.
|
|
85
|
-
"@coveord/plasma-tokens": "56.
|
|
83
|
+
"monaco-editor": "0.55.1",
|
|
84
|
+
"@coveord/plasma-react-icons": "56.8.1",
|
|
85
|
+
"@coveord/plasma-tokens": "56.8.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@mantine/carousel": "8.3.
|
|
89
|
-
"@mantine/code-highlight": "8.3.
|
|
90
|
-
"@mantine/core": "8.3.
|
|
91
|
-
"@mantine/dates": "8.3.
|
|
92
|
-
"@mantine/form": "8.3.
|
|
93
|
-
"@mantine/hooks": "8.3.
|
|
94
|
-
"@mantine/modals": "8.3.
|
|
95
|
-
"@mantine/notifications": "8.3.
|
|
88
|
+
"@mantine/carousel": "8.3.10",
|
|
89
|
+
"@mantine/code-highlight": "8.3.10",
|
|
90
|
+
"@mantine/core": "8.3.10",
|
|
91
|
+
"@mantine/dates": "8.3.10",
|
|
92
|
+
"@mantine/form": "8.3.10",
|
|
93
|
+
"@mantine/hooks": "8.3.10",
|
|
94
|
+
"@mantine/modals": "8.3.10",
|
|
95
|
+
"@mantine/notifications": "8.3.10",
|
|
96
96
|
"@swc/cli": "0.7.9",
|
|
97
|
-
"@swc/core": "1.15.
|
|
97
|
+
"@swc/core": "1.15.3",
|
|
98
98
|
"@testing-library/dom": "10.4.1",
|
|
99
99
|
"@testing-library/jest-dom": "6.9.1",
|
|
100
100
|
"@testing-library/react": "16.3.0",
|
|
101
101
|
"@testing-library/user-event": "14.6.1",
|
|
102
102
|
"@types/lodash.defaultsdeep": "4.6.9",
|
|
103
|
-
"@types/react": "18.3.
|
|
103
|
+
"@types/react": "18.3.27",
|
|
104
104
|
"@types/react-dom": "18.3.7",
|
|
105
|
-
"@vitest/eslint-plugin": "1.
|
|
105
|
+
"@vitest/eslint-plugin": "1.5.2",
|
|
106
106
|
"cross-env": "10.1.0",
|
|
107
107
|
"embla-carousel": "8.6.0",
|
|
108
108
|
"embla-carousel-react": "8.6.0",
|
|
109
|
-
"eslint-plugin-testing-library": "
|
|
109
|
+
"eslint-plugin-testing-library": "7.13.5",
|
|
110
110
|
"eslint-plugin-vitest-globals": "1.5.0",
|
|
111
|
-
"jsdom": "27.
|
|
111
|
+
"jsdom": "27.3.0",
|
|
112
112
|
"postcss": "8.5.6",
|
|
113
113
|
"postcss-preset-mantine": "^1.11.0",
|
|
114
114
|
"postcss-simple-vars": "^7.0.1",
|
|
115
115
|
"publint": "0.3.15",
|
|
116
116
|
"react": "18.3.1",
|
|
117
117
|
"react-dom": "18.3.1",
|
|
118
|
-
"rimraf": "6.1.
|
|
118
|
+
"rimraf": "6.1.2",
|
|
119
119
|
"tslib": "2.8.1",
|
|
120
120
|
"typescript": "5.9.3",
|
|
121
|
-
"vitest": "4.0.
|
|
121
|
+
"vitest": "4.0.15"
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"@mantine/carousel": "^8.0.2",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {Monaco} from '@monaco-editor/react';
|
|
2
|
+
import type {editor} from 'monaco-editor';
|
|
2
3
|
|
|
3
4
|
const format = (xml: string): string => {
|
|
4
5
|
// https://stackoverflow.com/questions/57039218/doesnt-monaco-editor-support-xml-language-by-default
|
|
@@ -31,7 +32,7 @@ const format = (xml: string): string => {
|
|
|
31
32
|
|
|
32
33
|
const register = (monaco: Monaco): void => {
|
|
33
34
|
monaco.languages.registerDocumentFormattingEditProvider('xml', {
|
|
34
|
-
provideDocumentFormattingEdits: async (model) => [
|
|
35
|
+
provideDocumentFormattingEdits: async (model: editor.ITextModel) => [
|
|
35
36
|
{
|
|
36
37
|
range: model.getFullModelRange(),
|
|
37
38
|
text: format(model.getValue()),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {UseFormInput} from '@mantine/form';
|
|
1
|
+
import {UseFormInput, type FormArrayElement} from '@mantine/form';
|
|
2
2
|
import {CollectionProps} from './Collection.js';
|
|
3
3
|
|
|
4
4
|
export const enhanceWithCollectionProps = <
|
|
@@ -20,7 +20,7 @@ export const enhanceWithCollectionProps = <
|
|
|
20
20
|
payload.form.removeListItem(field, index);
|
|
21
21
|
validateInputOnChange && payload.form.validate();
|
|
22
22
|
},
|
|
23
|
-
onInsertItem: (valueToInsert:
|
|
23
|
+
onInsertItem: (valueToInsert: FormArrayElement<FormValues, (typeof payload)['field']>, index: number) => {
|
|
24
24
|
payload.form.insertListItem(field, valueToInsert, index);
|
|
25
25
|
validateInputOnChange && payload.form.validate();
|
|
26
26
|
},
|
|
@@ -14,6 +14,7 @@ import {DatesRangeValue, DateStringValue} from '@mantine/dates';
|
|
|
14
14
|
import {useUncontrolled} from '@mantine/hooks';
|
|
15
15
|
import dayjs from 'dayjs';
|
|
16
16
|
import {useUrlSyncedState, UseUrlSyncedStateOptions} from '../../hooks/use-url-synced-state';
|
|
17
|
+
import classes from './DateRange.module.css';
|
|
17
18
|
import {DateRangePickerInlineCalendar, DateRangePickerInlineCalendarProps} from './DateRangePickerInlineCalendar';
|
|
18
19
|
|
|
19
20
|
const serialization = (input: Pick<UseUrlSyncedStateOptions<DatesRangeValue<string>>, 'serializer' | 'deserializer'>) =>
|
|
@@ -123,7 +124,7 @@ export const DateRangePicker = factory<DateRangePickerFactory>((props: DateRange
|
|
|
123
124
|
|
|
124
125
|
const getStyles = useStyles<DateRangePickerFactory>({
|
|
125
126
|
name: 'DateRangePicker',
|
|
126
|
-
classes
|
|
127
|
+
classes,
|
|
127
128
|
props,
|
|
128
129
|
className,
|
|
129
130
|
classNames,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
Factory,
|
|
4
|
+
Group,
|
|
5
|
+
RadioCardProps as MantineRadioCardProps,
|
|
6
|
+
RadioCardStylesNames as MantineRadioCardStylesNames,
|
|
7
|
+
Radio,
|
|
8
|
+
RadioCardCssVariables,
|
|
9
|
+
StylesApiProps,
|
|
10
|
+
Title,
|
|
11
|
+
factory,
|
|
12
|
+
useProps,
|
|
13
|
+
useStyles,
|
|
14
|
+
} from '@mantine/core';
|
|
15
|
+
import {ReactNode} from 'react';
|
|
16
|
+
import classes from '../../styles/RadioCard.module.css';
|
|
17
|
+
|
|
18
|
+
export type RadioCardStylesNames = MantineRadioCardStylesNames | 'container' | 'indicator' | 'title' | 'description';
|
|
19
|
+
export type RadioCardFactory = Factory<{
|
|
20
|
+
props: RadioCardProps;
|
|
21
|
+
ref: HTMLButtonElement;
|
|
22
|
+
stylesNames: RadioCardStylesNames;
|
|
23
|
+
vars: RadioCardCssVariables;
|
|
24
|
+
}>;
|
|
25
|
+
|
|
26
|
+
export type RadioCardProps = MantineRadioCardProps &
|
|
27
|
+
StylesApiProps<RadioCardFactory> & {
|
|
28
|
+
/**
|
|
29
|
+
* The label of the card. Appears next to the radio indicator.
|
|
30
|
+
*/
|
|
31
|
+
label: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* The description of the card. Appears under the title.
|
|
34
|
+
*/
|
|
35
|
+
description?: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const defaultProps: Partial<RadioCardProps> = {};
|
|
39
|
+
|
|
40
|
+
export const RadioCard = factory<RadioCardFactory>((_props, ref) => {
|
|
41
|
+
const {classNames, styles, style, className, vars, disabled, label, description, ...others} = useProps(
|
|
42
|
+
'RadioCard',
|
|
43
|
+
defaultProps,
|
|
44
|
+
_props,
|
|
45
|
+
);
|
|
46
|
+
const getStyles = useStyles<RadioCardFactory>({
|
|
47
|
+
name: 'RadioCard',
|
|
48
|
+
classes,
|
|
49
|
+
vars,
|
|
50
|
+
classNames,
|
|
51
|
+
className,
|
|
52
|
+
style,
|
|
53
|
+
props: _props,
|
|
54
|
+
styles,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Radio.Card
|
|
59
|
+
ref={ref}
|
|
60
|
+
disabled={disabled}
|
|
61
|
+
{...getStyles('card', {className, style, classNames, styles})}
|
|
62
|
+
{...others}
|
|
63
|
+
>
|
|
64
|
+
<Group {...getStyles('container', {classNames, styles})}>
|
|
65
|
+
<Radio.Indicator size="xs" disabled={disabled} {...getStyles('indicator', {classNames, styles})} />
|
|
66
|
+
<Title order={4} {...getStyles('title', {classNames, styles})}>
|
|
67
|
+
{label}
|
|
68
|
+
</Title>
|
|
69
|
+
</Group>
|
|
70
|
+
{description && <Box {...getStyles('description', {classNames, styles})}>{description}</Box>}
|
|
71
|
+
</Radio.Card>
|
|
72
|
+
);
|
|
73
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {render, screen} from '@test-utils';
|
|
2
|
+
import {RadioCard} from '../RadioCard.js';
|
|
3
|
+
|
|
4
|
+
describe('RadioCard', () => {
|
|
5
|
+
it('renders the title and description correctly', () => {
|
|
6
|
+
const title = 'Test Title';
|
|
7
|
+
const description = 'Test Description';
|
|
8
|
+
|
|
9
|
+
render(<RadioCard label={title} description={description} />);
|
|
10
|
+
|
|
11
|
+
expect(screen.getByText(title)).toBeInTheDocument();
|
|
12
|
+
expect(screen.getByText(description)).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
it('renders the radio indicator correctly', () => {
|
|
15
|
+
render(<RadioCard label="Test Title" />);
|
|
16
|
+
|
|
17
|
+
expect(screen.getByRole('radio')).not.toBeDisabled();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('renders disabled state correctly', () => {
|
|
21
|
+
render(<RadioCard label="Test Title" disabled />);
|
|
22
|
+
|
|
23
|
+
expect(screen.getByRole('radio')).toBeDisabled();
|
|
24
|
+
});
|
|
25
|
+
});
|