@mailstep/design-system 0.12.0-beta.1 → 0.12.0-beta.2
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/package.json +1 -1
- package/ui/Blocks/CommonGrid/components/gridCells/RowActionsCell.js +1 -1
- package/ui/Blocks/CommonGrid/utils/index.js +4 -2
- package/ui/Elements/Select/components/ChevronOption.js +1 -1
- package/ui/Elements/Select/components/SelectAll.js +1 -1
- package/ui/Forms/Checkbox/Checkbox.d.ts +1 -2
- package/ui/Forms/Checkbox/Checkbox.js +4 -7
- package/ui/Forms/Checkbox/types.d.ts +1 -1
package/package.json
CHANGED
|
@@ -38,7 +38,8 @@ const calculatePaginator = (page, rowsPerPage) => ({
|
|
|
38
38
|
const ROW_NUMBER_DIGIT_WIDTH = 8;
|
|
39
39
|
const CHECKBOX_WIDTH = 18;
|
|
40
40
|
const ICON_BUTTON_WIDTH = 20;
|
|
41
|
-
const
|
|
41
|
+
const ACTIONS_CELL_GAP_WITH_ROW_NUMBERS = 12;
|
|
42
|
+
const ACTIONS_CELL_GAP = 18;
|
|
42
43
|
const ACTIONS_CELL_PADDING = 16;
|
|
43
44
|
const getRowNumbersExtraWidth = (maxRowNumber = 0) => {
|
|
44
45
|
return String(maxRowNumber).length * ROW_NUMBER_DIGIT_WIDTH;
|
|
@@ -50,7 +51,8 @@ const getActionsColumnExtraWidth = ({ addRowNumbers, withCheckboxes, canRowEdit,
|
|
|
50
51
|
if (addRowNumbers) parts.push(getRowNumbersExtraWidth(maxRowNumber));
|
|
51
52
|
if (hasActionIcon) parts.push(ICON_BUTTON_WIDTH);
|
|
52
53
|
if (!parts.length) return 0;
|
|
53
|
-
const
|
|
54
|
+
const gap = addRowNumbers ? ACTIONS_CELL_GAP_WITH_ROW_NUMBERS : ACTIONS_CELL_GAP;
|
|
55
|
+
const gaps = (parts.length - 1) * gap;
|
|
54
56
|
parts.push(ACTIONS_CELL_PADDING);
|
|
55
57
|
return sum(parts) + gaps;
|
|
56
58
|
};
|
|
@@ -12,7 +12,7 @@ const ChevronOption = (props) => {
|
|
|
12
12
|
...props,
|
|
13
13
|
children: [(showCheckbox || showToggle) && /* @__PURE__ */ jsxs(SelectedIndicator, { children: [showCheckbox && /* @__PURE__ */ jsx(Checkbox_default, {
|
|
14
14
|
checked: isSelected,
|
|
15
|
-
size:
|
|
15
|
+
size: "14px",
|
|
16
16
|
readOnly: true
|
|
17
17
|
}), showToggle && /* @__PURE__ */ jsx(Toggle, {
|
|
18
18
|
name: "",
|
|
@@ -66,7 +66,7 @@ const SelectAll = ({ onCustomSelectAll, onCustomDeselectAll, value, options, max
|
|
|
66
66
|
children: [
|
|
67
67
|
(showCheckbox || showToggle) && /* @__PURE__ */ jsxs(SelectedIndicator, { children: [showCheckbox && /* @__PURE__ */ jsx(Checkbox_default, {
|
|
68
68
|
checked: isSelected,
|
|
69
|
-
size:
|
|
69
|
+
size: "14px",
|
|
70
70
|
readOnly: true
|
|
71
71
|
}), showToggle && /* @__PURE__ */ jsx(Toggle, {
|
|
72
72
|
name: "",
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { CheckIcon, CheckboxWrap, FakeInput, Label } from "./styles.js";
|
|
2
2
|
import { memo, useId } from "react";
|
|
3
|
-
import { th, useTheme } from "@xstyled/styled-components";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
//#region packages/ui/Forms/Checkbox/Checkbox.tsx
|
|
6
|
-
const Checkbox = ({ name, label, onChange, checked, defaultChecked, size =
|
|
7
|
-
const theme = useTheme();
|
|
8
|
-
const themeSize = th.fontSize(size)({ theme });
|
|
5
|
+
const Checkbox = ({ name, label, onChange, checked, defaultChecked, size = "18px", className, disabled, inputRef, readOnly, minusIcon = false }) => {
|
|
9
6
|
const id = useId();
|
|
10
7
|
return /* @__PURE__ */ jsxs(CheckboxWrap, {
|
|
11
|
-
size
|
|
8
|
+
size,
|
|
12
9
|
className,
|
|
13
10
|
children: [
|
|
14
11
|
/* @__PURE__ */ jsx("input", {
|
|
@@ -26,10 +23,10 @@ const Checkbox = ({ name, label, onChange, checked, defaultChecked, size = 4, cl
|
|
|
26
23
|
id
|
|
27
24
|
}),
|
|
28
25
|
/* @__PURE__ */ jsx(FakeInput, {
|
|
29
|
-
size
|
|
26
|
+
size,
|
|
30
27
|
children: /* @__PURE__ */ jsx(CheckIcon, {
|
|
31
28
|
icon: minusIcon ? "minus" : "check",
|
|
32
|
-
size
|
|
29
|
+
size
|
|
33
30
|
})
|
|
34
31
|
}),
|
|
35
32
|
label && /* @__PURE__ */ jsx(Label, {
|