@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.12.0-beta.1",
3
+ "version": "0.12.0-beta.2",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -42,7 +42,7 @@ const RowActionsCell = ({ actionColumnDefinition, rowData, addRowNumbers, rowInd
42
42
  }, [onClick]);
43
43
  return /* @__PURE__ */ jsxs(x.div, {
44
44
  display: "flex",
45
- gap: "12px",
45
+ gap: addRowNumbers ? "12px" : "18px",
46
46
  pl: "4px",
47
47
  pr: "4px",
48
48
  children: [
@@ -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 ACTIONS_CELL_GAP = 12;
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 gaps = (parts.length - 1) * ACTIONS_CELL_GAP;
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: 2,
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: 2,
69
+ size: "14px",
70
70
  readOnly: true
71
71
  }), showToggle && /* @__PURE__ */ jsx(Toggle, {
72
72
  name: "",
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { type CheckboxProps } from './types';
3
- declare const _default: React.NamedExoticComponent<CheckboxProps>;
2
+ declare const _default: import("react").NamedExoticComponent<CheckboxProps>;
4
3
  export default _default;
@@ -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 = 4, className, disabled, inputRef, readOnly, minusIcon = false }) => {
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: themeSize,
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: themeSize,
26
+ size,
30
27
  children: /* @__PURE__ */ jsx(CheckIcon, {
31
28
  icon: minusIcon ? "minus" : "check",
32
- size: themeSize
29
+ size
33
30
  })
34
31
  }),
35
32
  label && /* @__PURE__ */ jsx(Label, {
@@ -8,7 +8,7 @@ export type CheckboxProps = {
8
8
  disabled?: boolean;
9
9
  color?: string;
10
10
  unsetColor?: string;
11
- size?: number;
11
+ size?: string;
12
12
  className?: string;
13
13
  inputRef?: RefObject<HTMLInputElement>;
14
14
  readOnly?: boolean;