react-science 0.19.2 → 0.20.1

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.
Files changed (130) hide show
  1. package/lib/app/about/AboutDialogToolbarButton.js +10 -10
  2. package/lib/app/explorer/MeasurementExplorer.js +36 -43
  3. package/lib/app/helpers/react-plot.js +16 -13
  4. package/lib/app/kinds/iv/plot-view/IvPlotView.js +14 -13
  5. package/lib/app/panels/measurements/MeasurementCheckbox.js +10 -8
  6. package/lib/app/panels/measurements/MeasurementColorPreview.js +9 -7
  7. package/lib/app/panels/measurements/MeasurementsTable.js +81 -94
  8. package/lib/components/button/ButtonGroup.js +31 -43
  9. package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +18 -21
  10. package/lib/components/drop-zone/DropZone.js +48 -48
  11. package/lib/components/dropdown-menu/DropdownMenu.js +4 -4
  12. package/lib/components/dropdown-menu/MenuItems.js +2 -1
  13. package/lib/components/forms/Input.js +150 -0
  14. package/lib/components/forms/context/FieldsContext.js +54 -0
  15. package/lib/components/forms/context/index.js +17 -0
  16. package/lib/components/forms/index.js +18 -0
  17. package/lib/components/index.js +1 -0
  18. package/lib/components/modal/ConfirmModal.js +40 -29
  19. package/lib/components/modal/Modal.js +45 -34
  20. package/lib/components/root-layout/RootLayout.js +1 -1
  21. package/lib/components/root-layout/css-reset/customPreflight.js +10 -3
  22. package/lib/components/spinner/FullSpinner.js +10 -7
  23. package/lib-esm/app/about/AboutDialogToolbarButton.d.ts +1 -1
  24. package/lib-esm/app/about/AboutDialogToolbarButton.d.ts.map +1 -1
  25. package/lib-esm/app/about/AboutDialogToolbarButton.js +7 -10
  26. package/lib-esm/app/about/AboutDialogToolbarButton.js.map +1 -1
  27. package/lib-esm/app/explorer/MeasurementExplorer.d.ts +2 -1
  28. package/lib-esm/app/explorer/MeasurementExplorer.d.ts.map +1 -1
  29. package/lib-esm/app/explorer/MeasurementExplorer.js +31 -41
  30. package/lib-esm/app/explorer/MeasurementExplorer.js.map +1 -1
  31. package/lib-esm/app/helpers/MeasurementPlot.js.map +1 -1
  32. package/lib-esm/app/helpers/react-plot.d.ts +4 -2
  33. package/lib-esm/app/helpers/react-plot.d.ts.map +1 -1
  34. package/lib-esm/app/helpers/react-plot.js +11 -11
  35. package/lib-esm/app/helpers/react-plot.js.map +1 -1
  36. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.d.ts +2 -1
  37. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.d.ts.map +1 -1
  38. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js +14 -13
  39. package/lib-esm/app/kinds/iv/plot-view/IvPlotView.js.map +1 -1
  40. package/lib-esm/app/panels/measurements/MeasurementCheckbox.d.ts +2 -1
  41. package/lib-esm/app/panels/measurements/MeasurementCheckbox.d.ts.map +1 -1
  42. package/lib-esm/app/panels/measurements/MeasurementCheckbox.js +4 -5
  43. package/lib-esm/app/panels/measurements/MeasurementCheckbox.js.map +1 -1
  44. package/lib-esm/app/panels/measurements/MeasurementColorPreview.d.ts +2 -1
  45. package/lib-esm/app/panels/measurements/MeasurementColorPreview.d.ts.map +1 -1
  46. package/lib-esm/app/panels/measurements/MeasurementColorPreview.js +4 -5
  47. package/lib-esm/app/panels/measurements/MeasurementColorPreview.js.map +1 -1
  48. package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts +2 -1
  49. package/lib-esm/app/panels/measurements/MeasurementsTable.d.ts.map +1 -1
  50. package/lib-esm/app/panels/measurements/MeasurementsTable.js +81 -94
  51. package/lib-esm/app/panels/measurements/MeasurementsTable.js.map +1 -1
  52. package/lib-esm/components/button/ButtonGroup.d.ts +2 -2
  53. package/lib-esm/components/button/ButtonGroup.d.ts.map +1 -1
  54. package/lib-esm/components/button/ButtonGroup.js +28 -43
  55. package/lib-esm/components/button/ButtonGroup.js.map +1 -1
  56. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts +2 -1
  57. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts.map +1 -1
  58. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +16 -19
  59. package/lib-esm/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js.map +1 -1
  60. package/lib-esm/components/drop-zone/DropZone.d.ts +2 -2
  61. package/lib-esm/components/drop-zone/DropZone.d.ts.map +1 -1
  62. package/lib-esm/components/drop-zone/DropZone.js +42 -45
  63. package/lib-esm/components/drop-zone/DropZone.js.map +1 -1
  64. package/lib-esm/components/dropdown-menu/DropdownMenu.js +4 -4
  65. package/lib-esm/components/dropdown-menu/DropdownMenu.js.map +1 -1
  66. package/lib-esm/components/dropdown-menu/MenuItems.js +2 -1
  67. package/lib-esm/components/dropdown-menu/MenuItems.js.map +1 -1
  68. package/lib-esm/components/forms/Input.d.ts +17 -0
  69. package/lib-esm/components/forms/Input.d.ts.map +1 -0
  70. package/lib-esm/components/forms/Input.js +144 -0
  71. package/lib-esm/components/forms/Input.js.map +1 -0
  72. package/lib-esm/components/forms/context/FieldsContext.d.ts +16 -0
  73. package/lib-esm/components/forms/context/FieldsContext.d.ts.map +1 -0
  74. package/lib-esm/components/forms/context/FieldsContext.js +47 -0
  75. package/lib-esm/components/forms/context/FieldsContext.js.map +1 -0
  76. package/lib-esm/components/forms/context/index.d.ts +2 -0
  77. package/lib-esm/components/forms/context/index.d.ts.map +1 -0
  78. package/lib-esm/components/forms/context/index.js +2 -0
  79. package/lib-esm/components/forms/context/index.js.map +1 -0
  80. package/lib-esm/components/forms/index.d.ts +3 -0
  81. package/lib-esm/components/forms/index.d.ts.map +1 -0
  82. package/lib-esm/components/forms/index.js +3 -0
  83. package/lib-esm/components/forms/index.js.map +1 -0
  84. package/lib-esm/components/index.d.ts +1 -0
  85. package/lib-esm/components/index.d.ts.map +1 -1
  86. package/lib-esm/components/index.js +1 -0
  87. package/lib-esm/components/index.js.map +1 -1
  88. package/lib-esm/components/modal/ConfirmModal.d.ts +1 -1
  89. package/lib-esm/components/modal/ConfirmModal.d.ts.map +1 -1
  90. package/lib-esm/components/modal/ConfirmModal.js +37 -29
  91. package/lib-esm/components/modal/ConfirmModal.js.map +1 -1
  92. package/lib-esm/components/modal/Modal.d.ts +4 -4
  93. package/lib-esm/components/modal/Modal.d.ts.map +1 -1
  94. package/lib-esm/components/modal/Modal.js +45 -34
  95. package/lib-esm/components/modal/Modal.js.map +1 -1
  96. package/lib-esm/components/root-layout/RootLayout.d.ts.map +1 -1
  97. package/lib-esm/components/root-layout/RootLayout.js +2 -2
  98. package/lib-esm/components/root-layout/RootLayout.js.map +1 -1
  99. package/lib-esm/components/root-layout/css-reset/customPreflight.d.ts +5 -1
  100. package/lib-esm/components/root-layout/css-reset/customPreflight.d.ts.map +1 -1
  101. package/lib-esm/components/root-layout/css-reset/customPreflight.js +6 -2
  102. package/lib-esm/components/root-layout/css-reset/customPreflight.js.map +1 -1
  103. package/lib-esm/components/spinner/FullSpinner.d.ts +7 -1
  104. package/lib-esm/components/spinner/FullSpinner.d.ts.map +1 -1
  105. package/lib-esm/components/spinner/FullSpinner.js +8 -8
  106. package/lib-esm/components/spinner/FullSpinner.js.map +1 -1
  107. package/package.json +1 -1
  108. package/src/app/about/AboutDialogToolbarButton.tsx +6 -9
  109. package/src/app/explorer/MeasurementExplorer.tsx +47 -59
  110. package/src/app/helpers/MeasurementPlot.tsx +1 -0
  111. package/src/app/helpers/react-plot.tsx +24 -19
  112. package/src/app/kinds/iv/plot-view/IvPlotView.tsx +18 -19
  113. package/src/app/panels/measurements/MeasurementCheckbox.tsx +3 -5
  114. package/src/app/panels/measurements/MeasurementColorPreview.tsx +4 -6
  115. package/src/app/panels/measurements/MeasurementsTable.tsx +112 -115
  116. package/src/components/button/ButtonGroup.tsx +30 -44
  117. package/src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx +19 -26
  118. package/src/components/drop-zone/DropZone.tsx +54 -56
  119. package/src/components/dropdown-menu/DropdownMenu.tsx +19 -17
  120. package/src/components/dropdown-menu/MenuItems.tsx +2 -1
  121. package/src/components/forms/Input.tsx +255 -0
  122. package/src/components/forms/context/FieldsContext.tsx +82 -0
  123. package/src/components/forms/context/index.ts +1 -0
  124. package/src/components/forms/index.ts +2 -0
  125. package/src/components/index.ts +1 -0
  126. package/src/components/modal/ConfirmModal.tsx +49 -44
  127. package/src/components/modal/Modal.tsx +54 -58
  128. package/src/components/root-layout/RootLayout.tsx +3 -7
  129. package/src/components/root-layout/css-reset/customPreflight.ts +6 -2
  130. package/src/components/spinner/FullSpinner.tsx +14 -9
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.AboutDialogToolbarButton = void 0;
4
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
- /** @jsxImportSource @emotion/react */
6
- const react_1 = require("@emotion/react");
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_1 = __importDefault(require("@emotion/styled"));
7
9
  const index_1 = require("../../components/index");
8
- const aboutDialogToolbarButtonCss = {
9
- root: (0, react_1.css) `
10
- max-width: 600px;
11
- padding: 10px;
12
- `,
13
- };
10
+ const ModalBody = styled_1.default.div `
11
+ max-width: 600px;
12
+ padding: 10px;
13
+ `;
14
14
  function AboutDialogToolbarButton(props) {
15
15
  const { name, icon, body } = props;
16
16
  const [isOpenDialog, openDialog, closeDialog] = (0, index_1.useOnOff)(false);
17
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(index_1.Toolbar.Item, { titleOrientation: "horizontal", title: `About ${name}`, onClick: openDialog, children: icon }), (0, jsx_runtime_1.jsxs)(index_1.Modal, { isOpen: isOpenDialog, onRequestClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(index_1.Modal.Header, { children: name }), (0, jsx_runtime_1.jsx)(index_1.Modal.Body, { children: (0, jsx_runtime_1.jsx)("div", { css: aboutDialogToolbarButtonCss.root, children: body }) })] })] }));
17
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(index_1.Toolbar.Item, { titleOrientation: "horizontal", title: `About ${name}`, onClick: openDialog, children: icon }), (0, jsx_runtime_1.jsxs)(index_1.Modal, { isOpen: isOpenDialog, onRequestClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(index_1.Modal.Header, { children: name }), (0, jsx_runtime_1.jsx)(index_1.Modal.Body, { children: (0, jsx_runtime_1.jsx)(ModalBody, { children: body }) })] })] }));
18
18
  }
19
19
  exports.AboutDialogToolbarButton = AboutDialogToolbarButton;
@@ -1,12 +1,33 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.MeasurementExplorer = void 0;
4
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
- /** @jsxImportSource @emotion/react */
6
- const react_1 = require("@emotion/react");
7
- const react_2 = require("react");
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_1 = __importDefault(require("@emotion/styled"));
9
+ const react_1 = require("react");
8
10
  const fa_1 = require("react-icons/fa");
9
11
  const index_1 = require("../helpers/index");
12
+ const MeasurementExplorerRoot = styled_1.default.div `
13
+ display: flex;
14
+ flex-direction: column;
15
+ `;
16
+ const MeasurementExplorerContent = styled_1.default.div `
17
+ display: flex;
18
+ justify-content: space-around;
19
+ margin-bottom: 20px;
20
+ `;
21
+ const MeasurementExplorerSelect = styled_1.default.select `
22
+ cursor: pointer;
23
+ border: 1px solid black;
24
+ padding: 1px;
25
+ margin-left: 2px;
26
+ `;
27
+ const MeasurementExplorerAction = styled_1.default.div `
28
+ padding: 1px;
29
+ display: flex;
30
+ `;
10
31
  function MeasurementExplorer(props) {
11
32
  const { measurement: { data }, width = '100%', height = '100%', } = props;
12
33
  function defaultInfo(dataIndex) {
@@ -17,7 +38,7 @@ function MeasurementExplorer(props) {
17
38
  yVariableName: varNames.includes('y') ? 'y' : varNames[1],
18
39
  };
19
40
  }
20
- const [info, setInfo] = (0, react_2.useState)({
41
+ const [info, setInfo] = (0, react_1.useState)({
21
42
  flipHorizontalAxis: false,
22
43
  ...defaultInfo(0),
23
44
  });
@@ -40,19 +61,7 @@ function MeasurementExplorer(props) {
40
61
  return null;
41
62
  });
42
63
  }
43
- return ((0, jsx_runtime_1.jsxs)("div", { style: { width, height }, css: (0, react_1.css) `
44
- display: flex;
45
- flex-direction: column;
46
- `, children: [(0, jsx_runtime_1.jsxs)("div", { css: (0, react_1.css) `
47
- display: flex;
48
- justify-content: space-around;
49
- margin-bottom: 20px;
50
- `, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "dataIndex: " }), (0, jsx_runtime_1.jsx)("select", { css: (0, react_1.css) `
51
- cursor: pointer;
52
- border: 1px solid black;
53
- padding: 1px;
54
- margin-left: 2px;
55
- `, onChange: ({ target }) => {
64
+ return ((0, jsx_runtime_1.jsxs)(MeasurementExplorerRoot, { style: { width, height }, children: [(0, jsx_runtime_1.jsxs)(MeasurementExplorerContent, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "dataIndex: " }), (0, jsx_runtime_1.jsx)(MeasurementExplorerSelect, { onChange: ({ target }) => {
56
65
  const value = Number(target.value);
57
66
  if (value !== undefined && !Number.isNaN(value)) {
58
67
  setInfo(({ flipHorizontalAxis }) => ({
@@ -62,42 +71,26 @@ function MeasurementExplorer(props) {
62
71
  }
63
72
  }, children: data.map((d, i) => (
64
73
  // eslint-disable-next-line react/no-array-index-key
65
- (0, jsx_runtime_1.jsx)("option", { value: i, children: i }, i))) })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "xVariable: " }), (0, jsx_runtime_1.jsx)("select", { css: (0, react_1.css) `
66
- cursor: pointer;
67
- border: 1px solid black;
68
- padding: 1px;
69
- margin-left: 2px;
70
- `, onChange: ({ target }) => {
74
+ (0, jsx_runtime_1.jsx)("option", { value: i, children: i }, i))) })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "xVariable: " }), (0, jsx_runtime_1.jsx)(MeasurementExplorerSelect, { onChange: ({ target }) => {
71
75
  const value = target.value;
72
76
  if (value) {
73
77
  setInfo((info) => ({ ...info, xVariableName: value }));
74
78
  }
75
- }, value: info.xVariableName, children: dropdownVariables('x') })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(fa_1.FaExchangeAlt, { css: (0, react_1.css) `
76
- margin-top: 2px;
77
- cursor: pointer;
78
- `, size: "20", onClick: () => setInfo(({ xVariableName, yVariableName, ...info }) => ({
79
+ }, value: info.xVariableName, children: dropdownVariables('x') })] }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(fa_1.FaExchangeAlt, { style: { marginTop: 2, cursor: 'pointer' }, size: "20", onClick: () => setInfo(({ xVariableName, yVariableName, ...info }) => ({
79
80
  ...info,
80
81
  xVariableName: yVariableName,
81
82
  yVariableName: xVariableName,
82
- })) }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "yVariable :" }), (0, jsx_runtime_1.jsx)("select", { css: (0, react_1.css) `
83
- cursor: pointer;
84
- border: 1px solid black;
85
- padding: 1px;
86
- margin-left: 2px;
87
- `, onChange: ({ target }) => {
83
+ })) }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { children: "yVariable :" }), (0, jsx_runtime_1.jsx)(MeasurementExplorerSelect, { onChange: ({ target }) => {
88
84
  const value = target.value;
89
85
  if (value) {
90
86
  setInfo((info) => ({ ...info, yVariableName: value }));
91
87
  }
92
- }, value: info.yVariableName, children: dropdownVariables('y') })] }), (0, jsx_runtime_1.jsxs)("div", { css: (0, react_1.css) `
93
- padding: 1px;
94
- display: flex;
95
- `, children: ["Flip horizontal axis:", (0, jsx_runtime_1.jsx)(fa_1.FaArrowsAltH, { css: (0, react_1.css) `
96
- cursor: pointer;
97
- border: 1px solid black;
98
- padding: 1px;
99
- margin-left: 2px;
100
- `, size: "28", onClick: () => setInfo(({ flipHorizontalAxis, ...other }) => ({
88
+ }, value: info.yVariableName, children: dropdownVariables('y') })] }), (0, jsx_runtime_1.jsxs)(MeasurementExplorerAction, { children: ["Flip horizontal axis:", (0, jsx_runtime_1.jsx)(fa_1.FaArrowsAltH, { style: {
89
+ cursor: 'pointer',
90
+ border: '1px solid black',
91
+ padding: 1,
92
+ marginLeft: 2,
93
+ }, size: "28", onClick: () => setInfo(({ flipHorizontalAxis, ...other }) => ({
101
94
  flipHorizontalAxis: !flipHorizontalAxis,
102
95
  ...other,
103
96
  })) })] })] }), (0, jsx_runtime_1.jsx)(index_1.MeasurementPlot, { ...props, ...info })] }));
@@ -1,16 +1,26 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.BasicComponent = void 0;
4
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
- /** @jsxImportSource @emotion/react */
6
- const react_1 = require("@emotion/react");
7
- const react_2 = require("react");
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_1 = __importDefault(require("@emotion/styled"));
9
+ const react_1 = require("react");
8
10
  const react_d3_utils_1 = require("react-d3-utils");
9
11
  const react_plot_1 = require("react-plot");
12
+ const BasicComponentRoot = styled_1.default.div `
13
+ user-drag: none;
14
+ -webkit-user-drag: none;
15
+ user-select: none;
16
+ -moz-user-select: none;
17
+ -webkit-user-select: none;
18
+ -ms-user-select: none;
19
+ `;
10
20
  function BasicComponent(props) {
11
21
  const { children, measurement, dataIndex = 0, xVariableName = 'x', yVariableName = 'y', width = '100%', height = '100%', zoom = 'horizontal', wheelZoom = 'vertical', crossHair = true, showHorizontalAxis = true, showVerticalAxis = true, showHorizontalGrid = true, showVerticalGrid = true, flipHorizontalAxis = false, } = props;
12
22
  const { info: { title }, data, } = measurement;
13
- const { x, y } = (0, react_2.useMemo)(() => {
23
+ const { x, y } = (0, react_1.useMemo)(() => {
14
24
  const { variables } = data[dataIndex];
15
25
  const { [xVariableName]: x, [yVariableName]: y } = variables;
16
26
  if (x === undefined || y === undefined) {
@@ -35,13 +45,6 @@ function BasicComponent(props) {
35
45
  disabled: !crossHair,
36
46
  });
37
47
  (0, react_plot_1.usePan)();
38
- return ((0, jsx_runtime_1.jsx)("div", { style: { width, height }, css: (0, react_1.css) `
39
- user-drag: none;
40
- -webkit-user-drag: none;
41
- user-select: none;
42
- -moz-user-select: none;
43
- -webkit-user-select: none;
44
- -ms-user-select: none;
45
- `, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { width: width, height: height, children: ({ width, height }) => ((0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: width, height: height, children: [(0, jsx_runtime_1.jsx)(react_plot_1.Heading, { title: title }), children, (0, jsx_runtime_1.jsxs)(react_plot_1.Annotations, { children: [rectZoom.annotations, axisZoom.annotations, crossHairAnnot.annotations] }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showHorizontalAxis, displayPrimaryGridLines: showVerticalGrid, flip: flipHorizontalAxis, position: "bottom", label: `${x.label}${x.units ? `(${x.units})` : ''}` }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showVerticalAxis, displayPrimaryGridLines: showHorizontalGrid, position: "left", label: `${y.label}${y.units ? `(${y.units})` : ''}`, paddingStart: "10", paddingEnd: "10" })] })) }) }));
48
+ return ((0, jsx_runtime_1.jsx)(BasicComponentRoot, { style: { width, height }, children: (0, jsx_runtime_1.jsx)(react_d3_utils_1.ResponsiveChart, { width: width, height: height, children: ({ width, height }) => ((0, jsx_runtime_1.jsxs)(react_plot_1.Plot, { width: width, height: height, children: [(0, jsx_runtime_1.jsx)(react_plot_1.Heading, { title: title }), children, (0, jsx_runtime_1.jsxs)(react_plot_1.Annotations, { children: [rectZoom.annotations, axisZoom.annotations, crossHairAnnot.annotations] }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showHorizontalAxis, displayPrimaryGridLines: showVerticalGrid, flip: flipHorizontalAxis, position: "bottom", label: `${x.label}${x.units ? `(${x.units})` : ''}` }), (0, jsx_runtime_1.jsx)(react_plot_1.Axis, { hidden: !showVerticalAxis, displayPrimaryGridLines: showHorizontalGrid, position: "left", label: `${y.label}${y.units ? `(${y.units})` : ''}`, paddingStart: "10", paddingEnd: "10" })] })) }) }));
46
49
  }
47
50
  exports.BasicComponent = BasicComponent;
@@ -4,26 +4,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.IvPlotView = void 0;
7
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
8
- /** @jsxImportSource @emotion/react */
9
- const react_1 = require("@emotion/react");
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_1 = __importDefault(require("@emotion/styled"));
10
9
  const fa_1 = require("react-icons/fa");
11
10
  const react_plot_1 = require("react-plot");
12
11
  const index_1 = require("../../../../app-data/index");
13
12
  const index_2 = require("../../../../components/index");
14
13
  const IvMeasurementsPlot_1 = __importDefault(require("./IvMeasurementsPlot"));
15
14
  const IvPlotVariablesSelector_1 = __importDefault(require("./IvPlotVariablesSelector"));
15
+ const IvPlotRoot = styled_1.default.div `
16
+ display: flex;
17
+ flex-direction: row;
18
+ height: 100%;
19
+ `;
20
+ const PlotRoot = styled_1.default.div `
21
+ padding: 5px;
22
+ flex: 1;
23
+ display: flex;
24
+ flex-direction: column;
25
+ `;
16
26
  function IvPlotView() {
17
- return ((0, jsx_runtime_1.jsxs)("div", { css: (0, react_1.css) `
18
- display: flex;
19
- flex-direction: row;
20
- height: 100%;
21
- `, children: [(0, jsx_runtime_1.jsx)(VerticalToolbar, {}), (0, jsx_runtime_1.jsxs)("div", { css: (0, react_1.css) `
22
- padding: 5px;
23
- flex: 1;
24
- display: flex;
25
- flex-direction: column;
26
- `, children: [(0, jsx_runtime_1.jsx)(react_plot_1.PlotController, { children: (0, jsx_runtime_1.jsx)(IvMeasurementsPlot_1.default, {}) }), (0, jsx_runtime_1.jsx)(IvPlotVariablesSelector_1.default, {})] })] }));
27
+ return ((0, jsx_runtime_1.jsxs)(IvPlotRoot, { children: [(0, jsx_runtime_1.jsx)(VerticalToolbar, {}), (0, jsx_runtime_1.jsxs)(PlotRoot, { children: [(0, jsx_runtime_1.jsx)(react_plot_1.PlotController, { children: (0, jsx_runtime_1.jsx)(IvMeasurementsPlot_1.default, {}) }), (0, jsx_runtime_1.jsx)(IvPlotVariablesSelector_1.default, {})] })] }));
27
28
  }
28
29
  exports.IvPlotView = IvPlotView;
29
30
  function VerticalToolbar() {
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.MeasurementCheckbox = void 0;
4
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
- /** @jsxImportSource @emotion/react */
6
- const react_1 = require("@emotion/react");
7
- const react_2 = require("react");
8
- const checkboxCss = (0, react_1.css) `
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_1 = __importDefault(require("@emotion/styled"));
9
+ const react_1 = require("react");
10
+ const InputMeasurementCheckBox = styled_1.default.input `
9
11
  color: #6366f1;
10
12
  border-color: #d1d5db;
11
13
  border-radius: 0.25rem;
@@ -15,12 +17,12 @@ const checkboxCss = (0, react_1.css) `
15
17
  `;
16
18
  function MeasurementCheckbox(props) {
17
19
  const { checked, onSelectCheckbox, indeterminate } = props;
18
- const ref = (0, react_2.useRef)(null);
19
- (0, react_2.useLayoutEffect)(() => {
20
+ const ref = (0, react_1.useRef)(null);
21
+ (0, react_1.useLayoutEffect)(() => {
20
22
  if (ref.current && indeterminate !== undefined) {
21
23
  ref.current.indeterminate = indeterminate;
22
24
  }
23
25
  }, [indeterminate]);
24
- return ((0, jsx_runtime_1.jsx)("input", { css: checkboxCss, type: "checkbox", checked: checked, onChange: onSelectCheckbox, ref: ref }));
26
+ return ((0, jsx_runtime_1.jsx)(InputMeasurementCheckBox, { type: "checkbox", checked: checked, onChange: onSelectCheckbox, ref: ref }));
25
27
  }
26
28
  exports.MeasurementCheckbox = MeasurementCheckbox;
@@ -1,27 +1,29 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
4
- /** @jsxImportSource @emotion/react */
5
- const react_1 = require("@emotion/react");
6
- const react_2 = require("react");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const styled_1 = __importDefault(require("@emotion/styled"));
8
+ const react_1 = require("react");
7
9
  const index_1 = require("../../../app-data/index");
8
10
  const index_2 = require("../../../components/index");
9
11
  const Portal_1 = require("../../../components/root-layout/Portal");
10
- const colorPreviewCss = (0, react_1.css) `
12
+ const ColorPreviewButton = styled_1.default.button `
11
13
  width: 1em;
12
14
  height: 1em;
13
15
  `;
14
16
  function MeasurementColorPreview(props) {
15
17
  const { measurementId, kind, color } = props;
16
18
  const dispatch = (0, index_1.useAppDispatch)();
17
- const ref = (0, react_2.useRef)(null);
19
+ const ref = (0, react_1.useRef)(null);
18
20
  const [isOpened, , close, toggle] = (0, index_2.useOnOff)(false);
19
21
  const { setReferenceElement, setPopperElement, popperProps } = (0, index_2.useModifiedPopper)({
20
22
  placement: 'bottom-start',
21
23
  offset: 6,
22
24
  });
23
25
  (0, index_2.useOnClickOutside)(ref, close);
24
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { type: "button", ref: setReferenceElement, css: colorPreviewCss, onClick: toggle, children: (0, jsx_runtime_1.jsx)(index_2.ColorPreview, { color: color }) }), isOpened && ((0, jsx_runtime_1.jsx)(Portal_1.Portal, { children: (0, jsx_runtime_1.jsx)("div", { ref: (div) => {
26
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ColorPreviewButton, { type: "button", ref: setReferenceElement, onClick: toggle, children: (0, jsx_runtime_1.jsx)(index_2.ColorPreview, { color: color }) }), isOpened && ((0, jsx_runtime_1.jsx)(Portal_1.Portal, { children: (0, jsx_runtime_1.jsx)("div", { ref: (div) => {
25
27
  setPopperElement(div);
26
28
  ref.current = div;
27
29
  }, ...popperProps, children: color.kind === 'fixed' ? ((0, jsx_runtime_1.jsx)(FixedColorPicker, { color: color.color, onChange: (newColor) => dispatch({
@@ -27,87 +27,76 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.MeasurementsTable = void 0;
30
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
31
- /** @jsxImportSource @emotion/react */
32
- const react_1 = require("@emotion/react");
30
+ const jsx_runtime_1 = require("react/jsx-runtime");
31
+ const styled_1 = __importDefault(require("@emotion/styled"));
33
32
  const fa_1 = require("react-icons/fa");
34
33
  const index_1 = require("../../../app-data/index");
35
34
  const index_2 = require("../../../components/index");
36
35
  const MeasurementCheckbox_1 = require("./MeasurementCheckbox");
37
36
  const MeasurementColorPreview_1 = __importDefault(require("./MeasurementColorPreview"));
38
37
  const MeasurementVisibilityToggle_1 = __importStar(require("./MeasurementVisibilityToggle"));
39
- const styles = {
40
- root: (0, react_1.css) `
41
- font-size: 0.875rem;
42
- line-height: 1.25rem;
43
- border-collapse: collapse;
44
- table-layout: fixed;
45
- `,
46
- th: (0, react_1.css) `
47
- border-bottom-width: 1px;
48
- font-weight: 500;
49
- text-align: left;
50
- padding-bottom: 10px;
51
- padding-top: 10px;
52
- padding-left: 2rem;
53
- `,
54
- tbody: (0, react_1.css) `
55
- background-color: white;
56
- `,
57
- tr: (0, react_1.css) `
58
- height: 50px;
59
- max-height: 50px;
60
- overflow: hidden;
61
- cursor: pointer;
62
- padding-left: 2rem;
63
- padding-bottom: 10px;
64
- padding-top: 10px;
65
- border-bottom-width: 1px;
38
+ const MeasurementsTableContainer = styled_1.default.div `
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 5px;
42
+ `;
43
+ const MeasurementsTableRoot = styled_1.default.table `
44
+ font-size: 0.875rem;
45
+ line-height: 1.25rem;
46
+ border-collapse: collapse;
47
+ table-layout: fixed;
48
+ `;
49
+ const MeasurementsTableHeaderStyled = styled_1.default.tr `
50
+ border-bottom-width: 1px;
51
+ font-weight: 500;
52
+ text-align: left;
53
+ padding-bottom: 10px;
54
+ padding-top: 10px;
55
+ padding-left: 2rem;
56
+ `;
57
+ const MeasurementsTableBody = styled_1.default.tbody `
58
+ background-color: white;
59
+ `;
60
+ const MeasurementsLinkButton = styled_1.default.span `
61
+ cursor: pointer;
62
+ :hover {
63
+ text-decoration: underline;
64
+ }
65
+ `;
66
+ const MeasurementsHeaderColumn = styled_1.default.div `
67
+ display: flex;
68
+ flex-direction: row;
69
+ gap: 10px;
70
+ align-items: center;
71
+ padding-left: 5px;
66
72
 
67
- font-weight: 500;
68
- font-size: 0.875rem;
69
- line-height: 1.25rem;
70
- `,
71
- header: (0, react_1.css) `
72
- border-bottom-width: 1px;
73
- font-weight: 500;
74
- text-align: left;
75
- padding-bottom: 10px;
76
- padding-top: 10px;
77
- padding-left: 2rem;
78
- `,
79
- iconsContainer: (0, react_1.css) `
80
- display: flex;
81
- justify-content: center;
82
- align-items: center;
83
- justify-items: center;
84
- height: 50px;
85
- flex-direction: row;
86
- gap: 0.5rem;
87
- cursor: default;
88
- width: 70px;
89
- `,
90
- linkButton: (0, react_1.css) `
91
- cursor: pointer;
92
- :hover {
93
- text-decoration: underline;
94
- }
95
- `,
96
- container: (0, react_1.css) `
97
- display: flex;
98
- flex-direction: column;
99
- gap: 5px;
100
- `,
101
- headerColumn: (0, react_1.css) `
102
- display: flex;
103
- flex-direction: row;
104
- gap: 10px;
105
- align-items: center;
106
- padding-left: 5px;
73
+ border-bottom: 1px solid black;
74
+ `;
75
+ const MeasurementsTableRowData = styled_1.default.tr `
76
+ height: 50px;
77
+ max-height: 50px;
78
+ overflow: hidden;
79
+ cursor: pointer;
80
+ padding-left: 2rem;
81
+ padding-bottom: 10px;
82
+ padding-top: 10px;
83
+ border-bottom-width: 1px;
107
84
 
108
- border-bottom: 1px solid black;
109
- `,
110
- };
85
+ font-weight: 500;
86
+ font-size: 0.875rem;
87
+ line-height: 1.25rem;
88
+ `;
89
+ const MeasurementsIconsContainer = styled_1.default.td `
90
+ display: flex;
91
+ justify-content: center;
92
+ align-items: center;
93
+ justify-items: center;
94
+ height: 50px;
95
+ flex-direction: row;
96
+ gap: 0.5rem;
97
+ cursor: default;
98
+ width: 70px;
99
+ `;
111
100
  function MeasurementsTable(props) {
112
101
  const { kind } = props;
113
102
  const { data: { measurements }, view: { selectedMeasurements }, } = (0, index_1.useAppState)();
@@ -127,29 +116,27 @@ function MeasurementsTable(props) {
127
116
  dispatch({ type: 'REMOVE_SELECTED_MEASUREMENTS', payload: { kind } });
128
117
  closeRemoveModal();
129
118
  }
130
- return ((0, jsx_runtime_1.jsxs)("div", { css: styles.container, children: [(0, jsx_runtime_1.jsxs)("div", { css: styles.headerColumn, children: [(0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.MeasurementSelectedVisibilityChange, { kind: kind, openedEyes: true }), (0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.MeasurementSelectedVisibilityChange, { kind: kind, openedEyes: false }), (0, jsx_runtime_1.jsx)("span", { css: styles.linkButton, onClick: () => onSelectLink(true), children: "Select all" }), (0, jsx_runtime_1.jsx)("span", { css: styles.linkButton, onClick: () => onSelectLink(false), children: "Unselect all" }), (0, jsx_runtime_1.jsx)(fa_1.FaTrash, { style: hasSelectedMeasurements ? { cursor: 'pointer' } : { opacity: 0.6 }, onClick: hasSelectedMeasurements ? openRemoveModal : undefined }), (0, jsx_runtime_1.jsx)(index_2.ConfirmModal, { headerColor: "red", isOpen: isRemoveModalOpen, onConfirm: onRemove, onRequestClose: closeRemoveModal, saveText: "Remove", children: (0, jsx_runtime_1.jsx)("div", { style: { fontWeight: 'bold', padding: 10 }, children: "Remove selected measurements?" }) })] }), (0, jsx_runtime_1.jsxs)("table", { css: styles.root, children: [(0, jsx_runtime_1.jsx)(MeasurementsTableHeader, {}), (0, jsx_runtime_1.jsx)("tbody", { css: styles.tbody, children: measurements[kind].entries.map((element) => ((0, jsx_runtime_1.jsx)(MeasurementsTableRow, { item: element, kind: kind }, element.id))) })] })] }));
119
+ return ((0, jsx_runtime_1.jsxs)(MeasurementsTableContainer, { children: [(0, jsx_runtime_1.jsxs)(MeasurementsHeaderColumn, { children: [(0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.MeasurementSelectedVisibilityChange, { kind: kind, openedEyes: true }), (0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.MeasurementSelectedVisibilityChange, { kind: kind, openedEyes: false }), (0, jsx_runtime_1.jsx)(MeasurementsLinkButton, { onClick: () => onSelectLink(true), children: "Select all" }), (0, jsx_runtime_1.jsx)(MeasurementsLinkButton, { onClick: () => onSelectLink(false), children: "Unselect all" }), (0, jsx_runtime_1.jsx)(fa_1.FaTrash, { style: hasSelectedMeasurements ? { cursor: 'pointer' } : { opacity: 0.6 }, onClick: hasSelectedMeasurements ? openRemoveModal : undefined }), (0, jsx_runtime_1.jsx)(index_2.ConfirmModal, { headerColor: "red", isOpen: isRemoveModalOpen, onConfirm: onRemove, onRequestClose: closeRemoveModal, saveText: "Remove", children: (0, jsx_runtime_1.jsx)("div", { style: { fontWeight: 'bold', padding: 10 }, children: "Remove selected measurements?" }) })] }), (0, jsx_runtime_1.jsxs)(MeasurementsTableRoot, { children: [(0, jsx_runtime_1.jsx)(MeasurementsTableHeader, {}), (0, jsx_runtime_1.jsx)(MeasurementsTableBody, { children: measurements[kind].entries.map((element) => ((0, jsx_runtime_1.jsx)(MeasurementsTableRow, { item: element, kind: kind }, element.id))) })] })] }));
131
120
  }
132
121
  exports.MeasurementsTable = MeasurementsTable;
133
- const tableHeaderStyles = {
134
- thStyleEmpty: (0, react_1.css) `
135
- display: flex;
136
- gap: 5px;
137
- align-items: center;
138
- width: 70px;
139
- `,
140
- thStyleFilename: (0, react_1.css) `
141
- width: 60%;
142
- `,
143
- thStyleTechnique: (0, react_1.css) `
144
- width: 150px;
145
- `,
146
- tdName: (0, react_1.css) `
147
- width: 60%;
148
- overflow: hidden;
149
- `,
150
- };
122
+ const TableHeaderEmpty = styled_1.default.th `
123
+ display: flex;
124
+ gap: 5px;
125
+ align-items: center;
126
+ width: 70px;
127
+ `;
128
+ const TableHeaderFilename = styled_1.default.th `
129
+ width: 60%;
130
+ `;
131
+ const TableHeaderTechnique = styled_1.default.th `
132
+ width: 150px;
133
+ `;
134
+ const TableDataHeaderName = styled_1.default.td `
135
+ width: 60%;
136
+ overflow: hidden;
137
+ `;
151
138
  function MeasurementsTableHeader() {
152
- return ((0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { css: styles.header, children: [(0, jsx_runtime_1.jsx)("th", { css: tableHeaderStyles.thStyleEmpty }), (0, jsx_runtime_1.jsx)("th", { css: tableHeaderStyles.thStyleFilename, children: "Filename" }), (0, jsx_runtime_1.jsx)("th", { css: tableHeaderStyles.thStyleTechnique, children: "Technique" })] }) }));
139
+ return ((0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)(MeasurementsTableHeaderStyled, { children: [(0, jsx_runtime_1.jsx)(TableHeaderEmpty, {}), (0, jsx_runtime_1.jsx)(TableHeaderFilename, { children: "Filename" }), (0, jsx_runtime_1.jsx)(TableHeaderTechnique, { children: "Technique" })] }) }));
153
140
  }
154
141
  function MeasurementsTableRow(props) {
155
142
  const { item, kind } = props;
@@ -168,5 +155,5 @@ function MeasurementsTableRow(props) {
168
155
  payload: { id: item.id, kind, acc: isAlreadyChecked ? 'remove' : 'add' },
169
156
  });
170
157
  }
171
- return ((0, jsx_runtime_1.jsxs)("tr", { css: styles.tr, children: [(0, jsx_runtime_1.jsxs)("td", { css: styles.iconsContainer, children: [(0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.default, { id: item.id, isVisible: measurements[item.id].visible }), (0, jsx_runtime_1.jsx)(MeasurementColorPreview_1.default, { measurementId: item.id, kind: kind, color: measurements[item.id].color }), (0, jsx_runtime_1.jsx)(MeasurementCheckbox_1.MeasurementCheckbox, { checked: selectedMeasurements[kind]?.includes(item.id) || false, onSelectCheckbox: onSelectCheckbox })] }), (0, jsx_runtime_1.jsx)("td", { css: tableHeaderStyles.tdName, onClick: onSelectRow, title: item.id, children: item.info.file?.name ?? item.info.title }), (0, jsx_runtime_1.jsx)("td", { onClick: onSelectRow, children: item.meta.technique })] }));
158
+ return ((0, jsx_runtime_1.jsxs)(MeasurementsTableRowData, { children: [(0, jsx_runtime_1.jsxs)(MeasurementsIconsContainer, { children: [(0, jsx_runtime_1.jsx)(MeasurementVisibilityToggle_1.default, { id: item.id, isVisible: measurements[item.id].visible }), (0, jsx_runtime_1.jsx)(MeasurementColorPreview_1.default, { measurementId: item.id, kind: kind, color: measurements[item.id].color }), (0, jsx_runtime_1.jsx)(MeasurementCheckbox_1.MeasurementCheckbox, { checked: selectedMeasurements[kind]?.includes(item.id) || false, onSelectCheckbox: onSelectCheckbox })] }), (0, jsx_runtime_1.jsx)(TableDataHeaderName, { onClick: onSelectRow, title: item.id, children: item.info.file?.name ?? item.info.title }), (0, jsx_runtime_1.jsx)("td", { onClick: onSelectRow, children: item.meta.technique })] }));
172
159
  }
@@ -1,53 +1,41 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.ButtonGroup = void 0;
4
- const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
- /** @jsxImportSource @emotion/react */
6
- const react_1 = require("@emotion/react");
7
- const styles = {
8
- root: (0, react_1.css) `
9
- display: inline-flex;
10
- border-radius: 0.375rem;
11
- isolation: isolate;
12
- `,
13
- firstButton: (0, react_1.css) `
14
- position: relative;
15
- display: inline-flex;
16
- align-items: center;
17
- font-weight: 500;
18
- font-size: 0.875rem;
19
- line-height: 1.25rem;
20
- padding-left: 1rem;
21
- padding-right: 1rem;
22
- padding-top: 5px;
23
- padding-bottom: 5px;
24
- border-width: 1px;
25
- border-top-left-radius: 0.375rem;
26
- border-bottom-left-radius: 0.375rem;
27
- `,
28
- secondButton: (0, react_1.css) `
29
- position: relative;
30
- display: inline-flex;
31
- align-items: center;
32
- font-weight: 500;
33
- font-size: 0.875rem;
34
- line-height: 1.25rem;
35
- padding-left: 1rem;
36
- padding-right: 1rem;
37
- padding-top: 5px;
38
- padding-bottom: 5px;
39
- border-width: 1px;
40
- border-top-right-radius: 0.375rem;
41
- border-bottom-right-radius: 0.375rem;
42
- margin-left: -1px;
43
- `,
44
- };
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_1 = __importDefault(require("@emotion/styled"));
9
+ const ButtonGroupRoot = styled_1.default.div `
10
+ display: inline-flex;
11
+ border-radius: 0.375rem;
12
+ isolation: isolate;
13
+ `;
14
+ const ButtonGroupCustomButton = styled_1.default.button `
15
+ position: relative;
16
+ display: inline-flex;
17
+ align-items: center;
18
+ font-weight: 500;
19
+ font-size: 0.875rem;
20
+ line-height: 1.25rem;
21
+ padding-left: 1rem;
22
+ padding-right: 1rem;
23
+ padding-top: 5px;
24
+ padding-bottom: 5px;
25
+ border-width: 1px;
26
+ border-top-left-radius: ${({ isLast }) => !isLast && '0.375rem'};
27
+ border-bottom-left-radius: ${({ isLast }) => !isLast && '0.375rem'};
28
+
29
+ border-top-right-radius: ${({ isLast }) => isLast && '0.375rem'};
30
+ border-bottom-right-radius: ${({ isLast }) => isLast && '0.375rem'};
31
+ margin-left: ${({ isLast }) => isLast && '-1px'};
32
+ `;
45
33
  function ButtonGroup(props) {
46
34
  const { children } = props;
47
- return (0, jsx_runtime_1.jsx)("div", { css: styles.root, children: children });
35
+ return (0, jsx_runtime_1.jsx)(ButtonGroupRoot, { children: children });
48
36
  }
49
37
  exports.ButtonGroup = ButtonGroup;
50
38
  ButtonGroup.Button = function ButtonGroupButton(props) {
51
39
  const { position, label, onClick } = props;
52
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClick, css: position === 'first' ? styles.firstButton : styles.secondButton, children: label }));
40
+ return ((0, jsx_runtime_1.jsx)(ButtonGroupCustomButton, { type: "button", onClick: onClick, isLast: position === 'last', children: label }));
53
41
  };