@mailstep/design-system 0.10.0 → 0.10.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 +7 -7
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.js +1 -1
- package/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.js +1 -1
- package/ui/Blocks/CommonGrid/components/DropdownButton/DropdownButton.js +1 -1
- package/ui/Blocks/CommonGrid/components/GridAggregation/GridAggregation.js +6 -4
- package/ui/Blocks/CommonGrid/components/GridAggregation/hooks/useGridAggregation.d.ts +1 -0
- package/ui/Blocks/CommonGrid/components/GridAggregation/hooks/useGridAggregation.js +4 -2
- package/ui/Blocks/CommonGrid/components/IconList/IconList.js +1 -1
- package/ui/Blocks/SideMenu/components/Footer.js +1 -1
- package/ui/Blocks/SideMenu/components/HamburgerMenu.js +1 -1
- package/ui/Elements/Button/styles.js +1 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +1 -1
- package/ui/Elements/HighlightBox/HighlightBox.js +1 -1
- package/ui/Elements/Icon/Icon.js +1 -1
- package/ui/Elements/Pagination/styled.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@nivo/legends": "^0.73.0",
|
|
46
46
|
"@nivo/pie": "^0.73.0",
|
|
47
47
|
"@popperjs/core": "^2.11.8",
|
|
48
|
-
"@storybook/addon-designs": "^11.1.
|
|
49
|
-
"@storybook/addon-docs": "10.
|
|
50
|
-
"@storybook/addon-links": "10.
|
|
51
|
-
"@storybook/react-webpack5": "10.
|
|
48
|
+
"@storybook/addon-designs": "^11.1.4",
|
|
49
|
+
"@storybook/addon-docs": "10.5.3",
|
|
50
|
+
"@storybook/addon-links": "10.5.3",
|
|
51
|
+
"@storybook/react-webpack5": "10.5.3",
|
|
52
52
|
"@svgr/rollup": "^8.0.1",
|
|
53
53
|
"@swc/core": "^1.15.30",
|
|
54
54
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"eslint-plugin-react": "^7.35.0",
|
|
81
81
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
82
82
|
"eslint-plugin-react-perf": "^3.3.2",
|
|
83
|
-
"eslint-plugin-storybook": "10.
|
|
83
|
+
"eslint-plugin-storybook": "10.5.3",
|
|
84
84
|
"faker": "^5.1.0",
|
|
85
85
|
"husky": "^9.1.7",
|
|
86
86
|
"immer": "^9.0.19",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"react-use-draggable-scroll": "^0.4.7",
|
|
106
106
|
"redux": ">=4.0.5",
|
|
107
107
|
"reselect": "5.0.0-alpha.2",
|
|
108
|
-
"storybook": "10.
|
|
108
|
+
"storybook": "10.5.3",
|
|
109
109
|
"string-width": "6.1.0",
|
|
110
110
|
"styled-components": "^5.3.10",
|
|
111
111
|
"swiper": "^11.0.3",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import styled$1 from "@xstyled/styled-components";
|
|
3
|
-
import { th as th$1 } from "@xstyled/system";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { th as th$1 } from "@xstyled/system";
|
|
5
5
|
//#region packages/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownMenu.tsx
|
|
6
6
|
const StyledDropdownWrap = styled$1.div`
|
|
7
7
|
position: relative;
|
|
@@ -3,8 +3,8 @@ import Popover from "../../../../Popover/index.js";
|
|
|
3
3
|
import ActionDropdownMenu from "./ActionDropdownMenu.js";
|
|
4
4
|
import React, { memo, useRef } from "react";
|
|
5
5
|
import styled$1 from "@xstyled/styled-components";
|
|
6
|
-
import { th as th$1 } from "@xstyled/system";
|
|
7
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { th as th$1 } from "@xstyled/system";
|
|
8
8
|
import { Trans } from "@lingui/react";
|
|
9
9
|
//#region packages/ui/Blocks/CommonGrid/components/ActionHead/components/ActionDropdownSelect.tsx
|
|
10
10
|
const Content = styled$1.div`
|
|
@@ -7,8 +7,8 @@ import "../../../../Elements/DropdownMenu/index.js";
|
|
|
7
7
|
import { useClickOutside } from "../../../Modal/hooks/useClickOutside.js";
|
|
8
8
|
import React, { useCallback, useState } from "react";
|
|
9
9
|
import styled$1 from "@xstyled/styled-components";
|
|
10
|
-
import { th as th$1 } from "@xstyled/system";
|
|
11
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { th as th$1 } from "@xstyled/system";
|
|
12
12
|
//#region packages/ui/Blocks/CommonGrid/components/DropdownButton/DropdownButton.tsx
|
|
13
13
|
const ButtonWrapper = styled$1.div`
|
|
14
14
|
position: relative;
|
|
@@ -6,12 +6,16 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
//#region packages/ui/Blocks/CommonGrid/components/GridAggregation/GridAggregation.tsx
|
|
7
7
|
const GridAggregation = ({ rowsData, columns, activeColumnName }) => {
|
|
8
8
|
const [operation, setOperation] = useState("sum");
|
|
9
|
-
const { column, numericValues, operationOptions, selectedOption } = useGridAggregation({
|
|
9
|
+
const { column, isNumberFilter, numericValues, operationOptions, selectedOption } = useGridAggregation({
|
|
10
10
|
rowsData,
|
|
11
11
|
columns,
|
|
12
12
|
activeColumnName,
|
|
13
13
|
operation
|
|
14
14
|
});
|
|
15
|
+
const handleChange = useCallback((option) => {
|
|
16
|
+
if (option && "value" in option) setOperation(option.value);
|
|
17
|
+
}, []);
|
|
18
|
+
if (!isNumberFilter) return null;
|
|
15
19
|
return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsxs(StyledSelect, { children: [/* @__PURE__ */ jsx(Select, {
|
|
16
20
|
name: "aggregationOperation",
|
|
17
21
|
menuPlacement: "top",
|
|
@@ -19,9 +23,7 @@ const GridAggregation = ({ rowsData, columns, activeColumnName }) => {
|
|
|
19
23
|
options: operationOptions,
|
|
20
24
|
value: operation,
|
|
21
25
|
isDarkPlaceholderText: true,
|
|
22
|
-
onChange:
|
|
23
|
-
if (option && "value" in option) setOperation(option.value);
|
|
24
|
-
}, []),
|
|
26
|
+
onChange: handleChange,
|
|
25
27
|
title: selectedOption?.label,
|
|
26
28
|
disabled: !numericValues?.length,
|
|
27
29
|
isSearchable: false
|
|
@@ -13,11 +13,12 @@ const useGridAggregation = ({ rowsData, columns, activeColumnName, operation })
|
|
|
13
13
|
activeColumnName,
|
|
14
14
|
rowsData
|
|
15
15
|
]);
|
|
16
|
+
const isNumberFilter = column?.filteringType === "number";
|
|
16
17
|
const numericValues = useMemo(() => {
|
|
17
18
|
return rowsData?.map((row) => {
|
|
18
19
|
const value = get(activeColumnName || "", row);
|
|
19
|
-
const
|
|
20
|
-
return Number(
|
|
20
|
+
const formatRowValue = column?.formatRowValue?.(row);
|
|
21
|
+
return Number(typeof formatRowValue === "string" || typeof formatRowValue === "number" ? formatRowValue : value);
|
|
21
22
|
}).filter((n) => Number.isFinite(n));
|
|
22
23
|
}, [
|
|
23
24
|
rowsData,
|
|
@@ -43,6 +44,7 @@ const useGridAggregation = ({ rowsData, columns, activeColumnName, operation })
|
|
|
43
44
|
}, [numericValues]);
|
|
44
45
|
return {
|
|
45
46
|
column,
|
|
47
|
+
isNumberFilter,
|
|
46
48
|
numericValues,
|
|
47
49
|
operationOptions,
|
|
48
50
|
selectedOption: useMemo(() => operationOptions.find((o) => o.value === operation), [operationOptions, operation])
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Icon from "../../../../Elements/Icon/Icon.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import styled$1 from "@xstyled/styled-components";
|
|
4
|
-
import { th as th$1 } from "@xstyled/system";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { th as th$1 } from "@xstyled/system";
|
|
6
6
|
//#region packages/ui/Blocks/CommonGrid/components/IconList/IconList.tsx
|
|
7
7
|
const List = styled$1.ul`
|
|
8
8
|
background-color: white;
|
|
@@ -3,8 +3,8 @@ import { Paragraph4 } from "../../../Elements/Typography/Typography.js";
|
|
|
3
3
|
import "../../../Elements/Typography/index.js";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
import styled$1, { css } from "@xstyled/styled-components";
|
|
6
|
-
import { th as th$1 } from "@xstyled/system";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { th as th$1 } from "@xstyled/system";
|
|
8
8
|
import { Trans } from "@lingui/react";
|
|
9
9
|
//#region packages/ui/Blocks/SideMenu/components/Footer.tsx
|
|
10
10
|
const FooterWrap = styled$1.div`
|
|
@@ -2,8 +2,8 @@ import { HamburgerMenu } from "../../../Elements/Icon/icons/HamburgerMenu.js";
|
|
|
2
2
|
import { MobileCancel } from "../../../Elements/Icon/icons/MobileCancel.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { css, useTheme, x } from "@xstyled/styled-components";
|
|
5
|
-
import { th as th$1 } from "@xstyled/system";
|
|
6
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { th as th$1 } from "@xstyled/system";
|
|
7
7
|
import styled$2 from "styled-components";
|
|
8
8
|
//#region packages/ui/Blocks/SideMenu/components/HamburgerMenu.tsx
|
|
9
9
|
const HamburgerMenuWrapper = styled$2(x.div)`
|
|
@@ -3,8 +3,8 @@ import { FooterRow } from "./FooterRow.js";
|
|
|
3
3
|
import { FooterRowLabel } from "./FooterRowLabel.js";
|
|
4
4
|
import { useCallback, useEffect, useState } from "react";
|
|
5
5
|
import styled$1, { x } from "@xstyled/styled-components";
|
|
6
|
-
import { th as th$1 } from "@xstyled/system";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { th as th$1 } from "@xstyled/system";
|
|
8
8
|
import { i18n } from "@lingui/core";
|
|
9
9
|
//#region packages/ui/Elements/DatePicker/Datetime/components/Timepicker.tsx
|
|
10
10
|
const Btn = styled$1.button`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import styled$1, { useTheme } from "@xstyled/styled-components";
|
|
3
|
-
import { th as th$1 } from "@xstyled/system";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { th as th$1 } from "@xstyled/system";
|
|
5
5
|
//#region packages/ui/Elements/HighlightBox/HighlightBox.tsx
|
|
6
6
|
const StyledHighlightBox = styled$1.div`
|
|
7
7
|
display: inline-flex;
|
package/ui/Elements/Icon/Icon.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { icons_exports } from "./icons/index.js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import styled$1, { th, useTheme } from "@xstyled/styled-components";
|
|
4
3
|
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
5
4
|
import { faFacebookF } from "@fortawesome/free-brands-svg-icons/faFacebookF";
|
|
6
5
|
import { faInstagram } from "@fortawesome/free-brands-svg-icons/faInstagram";
|
|
@@ -115,6 +114,7 @@ import { faWebhook } from "@fortawesome/pro-solid-svg-icons/faWebhook";
|
|
|
115
114
|
import { faWineGlassCrack } from "@fortawesome/pro-solid-svg-icons/faWineGlassCrack";
|
|
116
115
|
import { faXmark } from "@fortawesome/pro-solid-svg-icons/faXmark";
|
|
117
116
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
117
|
+
import styled$1, { th, useTheme } from "@xstyled/styled-components";
|
|
118
118
|
import { jsx } from "react/jsx-runtime";
|
|
119
119
|
//#region packages/ui/Elements/Icon/Icon.tsx
|
|
120
120
|
const iconDictionary = {
|