@mailstep/design-system 0.6.55 → 0.6.56

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 (44) hide show
  1. package/package.json +1 -1
  2. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.d.ts +2 -2
  3. package/ui/Blocks/CommonGrid/components/ManageColumnForm/components/ActionRow.js +6 -5
  4. package/ui/Blocks/CommonGrid/hooks/useManageColumn.d.ts +3 -3
  5. package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +5 -2
  6. package/ui/Blocks/CommonGrid/translations.js +6 -0
  7. package/ui/Elements/Text/Text.d.ts +1 -1
  8. package/ui/Elements/Text/Text.js +1 -15
  9. package/ui/Elements/Text/stories/Text.stories.d.ts +1 -1
  10. package/ui/Elements/Text/types.d.ts +2 -4
  11. package/ui/Elements/Typography/Typography.d.ts +116 -13
  12. package/ui/Elements/Typography/Typography.js +26 -31
  13. package/ui/index.d.ts +2 -4
  14. package/ui/index.es.js +16058 -16598
  15. package/ui/index.js +2 -4
  16. package/ui/index.umd.js +570 -909
  17. package/ui/Blocks/SideMenu/MenuItem.d.ts +0 -12
  18. package/ui/Blocks/SideMenu/MenuItem.js +0 -54
  19. package/ui/Blocks/SideMenu/SideMenu.d.ts +0 -3
  20. package/ui/Blocks/SideMenu/SideMenu.js +0 -24
  21. package/ui/Blocks/SideMenu/components/Footer.d.ts +0 -14
  22. package/ui/Blocks/SideMenu/components/Footer.js +0 -28
  23. package/ui/Blocks/SideMenu/components/HamburgerMenu.d.ts +0 -6
  24. package/ui/Blocks/SideMenu/components/HamburgerMenu.js +0 -24
  25. package/ui/Blocks/SideMenu/components/SubitemTooltip.d.ts +0 -13
  26. package/ui/Blocks/SideMenu/components/SubitemTooltip.js +0 -42
  27. package/ui/Blocks/SideMenu/context/LeftMenuContext.d.ts +0 -12
  28. package/ui/Blocks/SideMenu/context/LeftMenuContext.js +0 -15
  29. package/ui/Blocks/SideMenu/context/useLeftMenuContext.d.ts +0 -4
  30. package/ui/Blocks/SideMenu/context/useLeftMenuContext.js +0 -8
  31. package/ui/Blocks/SideMenu/hooks/useOutsideHover.d.ts +0 -11
  32. package/ui/Blocks/SideMenu/hooks/useOutsideHover.js +0 -23
  33. package/ui/Blocks/SideMenu/index.d.ts +0 -7
  34. package/ui/Blocks/SideMenu/index.js +0 -5
  35. package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +0 -12
  36. package/ui/Blocks/SideMenu/stories/SideMenu.stories.js +0 -23
  37. package/ui/Blocks/SideMenu/stories/menuItems.d.ts +0 -17
  38. package/ui/Blocks/SideMenu/stories/menuItems.js +0 -102
  39. package/ui/Blocks/SideMenu/styles.d.ts +0 -43
  40. package/ui/Blocks/SideMenu/styles.js +0 -162
  41. package/ui/Blocks/SideMenu/types.d.ts +0 -21
  42. package/ui/Blocks/SideMenu/utils/constants.d.ts +0 -2
  43. package/ui/Blocks/SideMenu/utils/constants.js +0 -2
  44. /package/ui/Blocks/{SideMenu/types.js → CommonGrid/translations.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.6.55",
3
+ "version": "0.6.56",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { ColumnConfig, ColumnDefinition } from '../../../types';
3
2
  import { DraggableProps, DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';
3
+ import { ColumnConfig, ColumnDefinition } from '../../../types';
4
4
  type ActionRowProps = {
5
5
  column: ColumnDefinition;
6
6
  columnsConfigValues: string[] | undefined;
@@ -12,5 +12,5 @@ type ActionRowProps = {
12
12
  draggableProps?: DraggableProps | any;
13
13
  dragHandleProps?: DraggableProvidedDragHandleProps | null;
14
14
  };
15
- export declare const ActionRow: ({ column, columnsConfigValues, setColumnsConfigOptions, searchedValue, innerRef, draggableProps, dragHandleProps, }: ActionRowProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const ActionRow: ({ column, columnsConfigValues, setColumnsConfigOptions, searchedValue, innerRef, draggableProps, dragHandleProps }: ActionRowProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export {};
@@ -15,13 +15,13 @@ var __assign = (this && this.__assign) || function () {
15
15
  };
16
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
17
  import { useCallback, useMemo, useState } from 'react';
18
- import { x, th } from '@xstyled/styled-components';
18
+ import { isObject } from 'lodash';
19
19
  import styled from 'styled-components';
20
- import Toggle from '../../../../../Elements/Toggle/Toggle';
21
20
  import { Group } from '../../../../../Elements/Icon/icons/Group';
22
- import { isObject } from 'lodash';
21
+ import Toggle from '../../../../../Elements/Toggle/Toggle';
23
22
  import { H6 } from '../../../../../Elements/Typography/Typography';
24
23
  import { i18n } from '@lingui/core';
24
+ import { x, th } from '@xstyled/styled-components';
25
25
  var RowLayout = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n align-items: center;\n justify-content: space-between;\n padding: 16px;\n height: 52px;\n background-color: white;\n border: 1px solid ", ";\n border-radius: 8px;\n margin-bottom: 15px;\n"], ["\n display: ", ";\n align-items: center;\n justify-content: space-between;\n padding: 16px;\n height: 52px;\n background-color: white;\n border: 1px solid ", ";\n border-radius: 8px;\n margin-bottom: 15px;\n"])), function (_a) {
26
26
  var $isVisible = _a.$isVisible;
27
27
  return ($isVisible ? 'flex' : 'none');
@@ -31,10 +31,11 @@ export var ActionRow = function (_a) {
31
31
  var column = _a.column, columnsConfigValues = _a.columnsConfigValues, setColumnsConfigOptions = _a.setColumnsConfigOptions, searchedValue = _a.searchedValue, innerRef = _a.innerRef, draggableProps = _a.draggableProps, dragHandleProps = _a.dragHandleProps;
32
32
  var _g = useState((_b = columnsConfigValues === null || columnsConfigValues === void 0 ? void 0 : columnsConfigValues.includes(column.name)) !== null && _b !== void 0 ? _b : false), isSelected = _g[0], setIsSelected = _g[1];
33
33
  var style = useMemo(function () { return (__assign({}, draggableProps === null || draggableProps === void 0 ? void 0 : draggableProps.style)); }, [draggableProps]);
34
- var translatedValue = isObject(column === null || column === void 0 ? void 0 : column.title) &&
34
+ var translatedValue = (isObject(column === null || column === void 0 ? void 0 : column.title) &&
35
35
  'props' in column.title &&
36
36
  ((_c = column.title) === null || _c === void 0 ? void 0 : _c.props) &&
37
- i18n._({ id: (_e = (_d = column.title) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.id, message: (_f = column.title) === null || _f === void 0 ? void 0 : _f.props.message });
37
+ i18n._({ id: (_e = (_d = column.title) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.id, message: (_f = column.title) === null || _f === void 0 ? void 0 : _f.props.message })) ||
38
+ (column === null || column === void 0 ? void 0 : column.title);
38
39
  var isVisible = translatedValue && translatedValue.toLocaleLowerCase().includes(searchedValue.toLocaleLowerCase()) && !column.alwaysOn;
39
40
  var handleToggleChange = useCallback(function () {
40
41
  setColumnsConfigOptions(function (prevOptions) {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DropResult } from 'react-beautiful-dnd';
3
- import { CommonGridProps, GridActionsType, GridSelectorsType } from '../types';
3
+ import { CommonGridProps, GridActionsType, GridSelectorsType, ColumnDefinition } from '../types';
4
4
  type Props = {
5
5
  columns: CommonGridProps['columnsDefinitions'];
6
6
  gridActions: GridActionsType;
@@ -18,7 +18,7 @@ declare const useManageColumn: ({ columns, gridSelectors, gridActions, onClose }
18
18
  resetColumnConfig: () => void;
19
19
  handleDragEnd: (isManageModal?: boolean) => (item: DropResult) => void;
20
20
  onCloseForm: () => void;
21
- displayColumnsDefinitions: import("../types").ColumnDefinition<string>[];
22
- manageColumnsFormDefinitions: import("../types").ColumnDefinition<string>[];
21
+ displayColumnsDefinitions: ColumnDefinition<string>[];
22
+ manageColumnsFormDefinitions: ColumnDefinition<string>[];
23
23
  };
24
24
  export default useManageColumn;
@@ -60,11 +60,14 @@ var useManageColumn = function (_a) {
60
60
  setColumnsConfigOptions(columnConfig || {});
61
61
  }, [columnsOrderValue, onClose]);
62
62
  var getSortedColumns = useCallback(function (orderValues, isManageModal) {
63
- return (!isManageModal ? columns.filter(function (column) { return isColumnOn(column, columnsConfigOptions); }) : columns).toSorted(function (col1, col2) {
63
+ var list = !isManageModal ? columns.filter(function (column) { return isColumnOn(column, columnsConfigOptions); }) : columns;
64
+ var sortFunction = function (col1, col2) {
64
65
  var i = (orderValues || []).indexOf(col1.name);
65
66
  var j = (orderValues || []).indexOf(col2.name);
66
67
  return i > j ? 1 : i < j ? -1 : 0;
67
- });
68
+ };
69
+ var sortedList = __spreadArray([], list, true).sort(sortFunction);
70
+ return sortedList;
68
71
  }, [columnConfig, columnsConfigOptions, columns]);
69
72
  var displayColumnsDefinitions = useMemo(function () { return getSortedColumns(columnsOrderValue, false); }, [columnsOrderValue, columns, columnsConfigOptions, getSortedColumns]);
70
73
  var manageColumnsFormDefinitions = useMemo(function () { return getSortedColumns(updatedColumnsOrder, true); }, [updatedColumnsOrder]);
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Trans } from '@lingui/react';
3
+ /** catalog for lungui to track commonGrid translations - DO NOT REMOVE */
4
+ var Translations = function () {
5
+ return (_jsxs(_Fragment, { children: [_jsx(Trans, { id: "dataGrid.status.loadingData", message: "... loading data ..." }), _jsx(Trans, { id: "dataGrid.status.noDataFound", message: "No data found." }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "dataGrid.buttonClearConfig", message: "Reset config" }), _jsx(Trans, { id: "dataGrid.buttonGridConfig", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.title", message: "Configure columns" }), _jsx(Trans, { id: "dataGrid.config.buttonReset", message: "Reset all" }), _jsx(Trans, { id: "dataGrid.resultsPerPage", message: "Results per page" }), _jsx(Trans, { id: "manageColumn.title", message: "Manage column" }), _jsx(Trans, { id: "dataGrid.buttonClearSettings", message: "Reset filters" }), _jsx(Trans, { id: "form.buttonCancel", message: "Cancel" }), _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "form.buttonImport", message: "Import" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.export", message: "Export" }), ",", _jsx(Trans, { id: "form.buttonConfirm", message: "Confirm" }), ",", _jsx(Trans, { id: "dataGrid.actionOptions.createNew", message: "Create new" }), ",", _jsx(Trans, { id: "dataGrid.checkAll", message: "Check all" }), ",", _jsx(Trans, { id: "datagrid.filterCell.selectAllLabel", message: "select all" }), _jsx(Trans, { id: "datagrid.filterCell.optionsSelectedLabel", message: '{count} options' }), ",", _jsx(Trans, { id: "dataGrid.deleteItem", message: "Delete" }), ",", _jsx(Trans, { id: "dataGrid.columnLot.NA", message: "N/A" }), ",", _jsx(Trans, { id: "dataGrid.buttonActions", message: "Actions" }), ",", _jsx(Trans, { id: "dataGrid.errors.ipValidationError", message: "Value is not valid ip" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.all", message: "All" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.yes", message: "Yes" }), ",", _jsx(Trans, { id: "dataGrid.columnActive.filterOptions.no", message: "No" }), _jsx(Trans, { id: "products.eshopFilterPlaceholder", message: "Select eshop..." }), ",", _jsx(Trans, { id: "dataGrid.checkedRowsCount", message: "Selected {checkedRowsCount} items" }), ",", _jsx(Trans, { id: "dataGrid.filterCell", message: "Type to filter" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.from", message: "From" }), ",", _jsx(Trans, { id: "dataGrid.filterCell.to", message: "To" }), ",", _jsx(Trans, { id: "manageColumn.searchPlaceholder", message: "Find column..." }), ",", _jsx(Trans, { id: "dataGrid.comparator.equals", message: "Equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notEquals", message: "Not equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThan", message: "Less than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.lessThanOrEquals", message: "Less than or equals" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThan", message: "Greater than" }), ",", _jsx(Trans, { id: "dataGrid.comparator.greaterThanOrEquals", message: "Greater than or equal" }), ",", _jsx(Trans, { id: "dataGrid.comparator.contains", message: "Contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.notContains", message: "Not contains" }), ",", _jsx(Trans, { id: "dataGrid.comparator.startsWith", message: "Starts with'" }), ",", _jsx(Trans, { id: "dataGrid.comparator.endsWith", message: "Ends with" }), ",", _jsx(Trans, { id: "select.noOptions", message: "no options" }), ",", _jsx(Trans, { id: "components.dropdown.loading", message: "Loading..." }), ",", _jsx(Trans, { id: "components.dropdown.placeholder", message: "Select..." }), ",", _jsx(Trans, { id: "components.dropdown.notReact", message: "Select related values first..." }), ",", _jsx(Trans, { id: "components.dropdown.writeMoreChars", message: "Write at least ${asyncLoadMinChars} characters." }), ",", _jsx(Trans, { id: "components.dropdown.noOptions", message: "No options" }), ",", _jsx(Trans, { id: "components.dropdown.newOption", message: "new value" }), ",", _jsx(Trans, { id: "form.general.min2Chars", message: "Minimal length is 2 characters." }), ",", _jsx(Trans, { id: "controlButtons.searchPlaceholder", message: "Search ${translatedValue} ..." }), ","] }));
6
+ };
@@ -1,3 +1,3 @@
1
1
  import type { TextProps } from './types';
2
- declare const Text: ({ as, ...props }: TextProps) => JSX.Element;
2
+ declare const Text: (props: TextProps) => JSX.Element;
3
3
  export default Text;
@@ -9,21 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { jsx as _jsx } from "react/jsx-runtime";
24
13
  import { x } from '@xstyled/styled-components';
25
- var Text = function (_a) {
26
- var _b = _a.as, as = _b === void 0 ? 'span' : _b, props = __rest(_a, ["as"]);
27
- return _jsx(x.div, __assign({ as: as }, props));
28
- };
14
+ var Text = function (props) { return _jsx(x.div, __assign({ as: "span" }, props)); };
29
15
  export default Text;
@@ -2,7 +2,7 @@
2
2
  import type { StoryObj } from '@storybook/react';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: ({ as, ...props }: import("..").TextProps) => JSX.Element;
5
+ component: (props: import("..").TextProps) => JSX.Element;
6
6
  tags: string[];
7
7
  argTypes: {};
8
8
  };
@@ -1,15 +1,13 @@
1
- import { ComponentType, ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export type TextVariant = 'normal' | 'medium' | 'semiBold' | 'bold';
3
3
  export type TextProps = {
4
4
  children?: ReactNode | ReactNode[];
5
- fontSize?: string | number;
5
+ fontSize?: number;
6
6
  fontWeight?: string;
7
- fontFamily?: string;
8
7
  variant?: TextVariant;
9
8
  mt?: string | number;
10
9
  mr?: string | number;
11
10
  mb?: string | number;
12
11
  ml?: string | number;
13
12
  color?: string;
14
- as?: string | ComponentType<any>;
15
13
  };
@@ -1,14 +1,117 @@
1
1
  import { TextProps as BaseTextProps } from '../Text';
2
- export declare const Text: ({ as, fontFamily, fontSize, variant, ...props }: BaseTextProps) => JSX.Element;
3
- export declare const Paragraph1: (props: BaseTextProps) => JSX.Element;
4
- export declare const Paragraph2: (props: BaseTextProps) => JSX.Element;
5
- export declare const Paragraph3: (props: BaseTextProps) => JSX.Element;
6
- export declare const Paragraph4: (props: BaseTextProps) => JSX.Element;
7
- export declare const Paragraph5: (props: BaseTextProps) => JSX.Element;
8
- export declare const H1: (props: BaseTextProps) => JSX.Element;
9
- export declare const H2: (props: BaseTextProps) => JSX.Element;
10
- export declare const H3: (props: BaseTextProps) => JSX.Element;
11
- export declare const H4: (props: BaseTextProps) => JSX.Element;
12
- export declare const H5: (props: BaseTextProps) => JSX.Element;
13
- export declare const H6: (props: BaseTextProps) => JSX.Element;
14
- export declare const H7: (props: BaseTextProps) => JSX.Element;
2
+ export declare const Text: {
3
+ (props: BaseTextProps): JSX.Element;
4
+ defaultProps: {
5
+ fontFamily: string;
6
+ };
7
+ };
8
+ export declare const Paragraph1: {
9
+ (props: BaseTextProps): JSX.Element;
10
+ defaultProps: {
11
+ as: string;
12
+ fontFamily: string;
13
+ fontSize: string;
14
+ };
15
+ };
16
+ export declare const Paragraph2: {
17
+ (props: BaseTextProps): JSX.Element;
18
+ defaultProps: {
19
+ as: string;
20
+ fontFamily: string;
21
+ fontSize: string;
22
+ };
23
+ };
24
+ export declare const Paragraph3: {
25
+ (props: BaseTextProps): JSX.Element;
26
+ defaultProps: {
27
+ as: string;
28
+ fontFamily: string;
29
+ fontSize: string;
30
+ };
31
+ };
32
+ export declare const Paragraph4: {
33
+ (props: BaseTextProps): JSX.Element;
34
+ defaultProps: {
35
+ as: string;
36
+ fontFamily: string;
37
+ fontSize: string;
38
+ };
39
+ };
40
+ export declare const Paragraph5: {
41
+ (props: BaseTextProps): JSX.Element;
42
+ defaultProps: {
43
+ as: string;
44
+ fontFamily: string;
45
+ fontSize: string;
46
+ };
47
+ };
48
+ export declare const H1: {
49
+ (props: BaseTextProps): JSX.Element;
50
+ defaultProps: {
51
+ as: string;
52
+ fontFamily: string;
53
+ fontSize: string;
54
+ mt: number;
55
+ mb: number;
56
+ };
57
+ };
58
+ export declare const H2: {
59
+ (props: BaseTextProps): JSX.Element;
60
+ defaultProps: {
61
+ as: string;
62
+ fontFamily: string;
63
+ fontSize: string;
64
+ mt: number;
65
+ mb: number;
66
+ };
67
+ };
68
+ export declare const H3: {
69
+ (props: BaseTextProps): JSX.Element;
70
+ defaultProps: {
71
+ as: string;
72
+ fontFamily: string;
73
+ fontSize: string;
74
+ mt: number;
75
+ mb: number;
76
+ };
77
+ };
78
+ export declare const H4: {
79
+ (props: BaseTextProps): JSX.Element;
80
+ defaultProps: {
81
+ as: string;
82
+ fontFamily: string;
83
+ fontSize: string;
84
+ mt: number;
85
+ mb: number;
86
+ };
87
+ };
88
+ export declare const H5: {
89
+ (props: BaseTextProps): JSX.Element;
90
+ defaultProps: {
91
+ as: string;
92
+ fontFamily: string;
93
+ fontSize: string;
94
+ mt: number;
95
+ mb: number;
96
+ };
97
+ };
98
+ export declare const H6: {
99
+ (props: BaseTextProps): JSX.Element;
100
+ defaultProps: {
101
+ as: string;
102
+ fontFamily: string;
103
+ fontSize: string;
104
+ mt: number;
105
+ mb: number;
106
+ };
107
+ };
108
+ export declare const H7: {
109
+ (props: BaseTextProps): JSX.Element;
110
+ defaultProps: {
111
+ as: string;
112
+ fontFamily: string;
113
+ fontSize: string;
114
+ mt: number;
115
+ mb: number;
116
+ };
117
+ };
@@ -9,38 +9,33 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { jsx as _jsx } from "react/jsx-runtime";
24
13
  import { Text as BaseText } from '../Text';
25
- export var Text = function (_a) {
26
- var _b = _a.as, as = _b === void 0 ? 'p' : _b, _c = _a.fontFamily, fontFamily = _c === void 0 ? 'primary' : _c, _d = _a.fontSize, fontSize = _d === void 0 ? '10px' : _d, variant = _a.variant, props = __rest(_a, ["as", "fontFamily", "fontSize", "variant"]);
27
- return (_jsx(BaseText, __assign({ as: as, fontFamily: fontFamily, fontSize: fontSize, fontWeight: variant }, props)));
28
- };
29
- var BaseHeading = function (_a) {
30
- var _b = _a.fontFamily, fontFamily = _b === void 0 ? 'heading' : _b, _c = _a.mb, mb = _c === void 0 ? 2 : _c, _d = _a.mt, mt = _d === void 0 ? 2 : _d, props = __rest(_a, ["fontFamily", "mb", "mt"]);
31
- return (_jsx(Text, __assign({ fontFamily: fontFamily, mt: mt, mb: mt }, props)));
32
- };
14
+ export var Text = function (props) { return _jsx(BaseText, __assign({}, props, { fontWeight: props.variant })); };
15
+ Text.defaultProps = { fontFamily: 'primary' };
33
16
  // Paragraphs
34
- export var Paragraph1 = function (props) { return _jsx(Text, __assign({ fontSize: "18px" }, props)); };
35
- export var Paragraph2 = function (props) { return _jsx(Text, __assign({ fontSize: "16px" }, props)); };
36
- export var Paragraph3 = function (props) { return _jsx(Text, __assign({ fontSize: "14px" }, props)); };
37
- export var Paragraph4 = function (props) { return _jsx(Text, __assign({ fontSize: "12px" }, props)); };
38
- export var Paragraph5 = function (props) { return _jsx(Text, __assign({ fontSize: "10px" }, props)); };
17
+ export var Paragraph1 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
18
+ Paragraph1.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '18px' };
19
+ export var Paragraph2 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
20
+ Paragraph2.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '16px' };
21
+ export var Paragraph3 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
22
+ Paragraph3.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '14px' };
23
+ export var Paragraph4 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
24
+ Paragraph4.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '12px' };
25
+ export var Paragraph5 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
26
+ Paragraph5.defaultProps = { as: 'p', fontFamily: 'primary', fontSize: '10px' };
39
27
  // Headings
40
- export var H1 = function (props) { return _jsx(BaseHeading, __assign({ fontSize: "32px", as: "h1" }, props)); };
41
- export var H2 = function (props) { return _jsx(BaseHeading, __assign({ fontSize: "24px", as: "h2" }, props)); };
42
- export var H3 = function (props) { return _jsx(BaseHeading, __assign({ fontSize: "21px", as: "h3" }, props)); };
43
- export var H4 = function (props) { return _jsx(BaseHeading, __assign({ fontSize: "18px", as: "h4" }, props)); };
44
- export var H5 = function (props) { return _jsx(BaseHeading, __assign({ fontSize: "16px", as: "h5" }, props)); };
45
- export var H6 = function (props) { return _jsx(BaseHeading, __assign({ fontSize: "14px", as: "h6" }, props)); };
46
- export var H7 = function (props) { return _jsx(BaseHeading, __assign({ fontSize: "12x", as: "h7" }, props)); };
28
+ export var H1 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
29
+ H1.defaultProps = { as: 'h1', fontFamily: 'heading', fontSize: '32px', mt: 2, mb: 2 };
30
+ export var H2 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
31
+ H2.defaultProps = { as: 'h2', fontFamily: 'heading', fontSize: '24px', mt: 2, mb: 2 };
32
+ export var H3 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
33
+ H3.defaultProps = { as: 'h3', fontFamily: 'heading', fontSize: '21px', mt: 2, mb: 2 };
34
+ export var H4 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
35
+ H4.defaultProps = { as: 'h4', fontFamily: 'heading', fontSize: '18px', mt: 2, mb: 2 };
36
+ export var H5 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
37
+ H5.defaultProps = { as: 'h5', fontFamily: 'heading', fontSize: '16px', mt: 2, mb: 2 };
38
+ export var H6 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
39
+ H6.defaultProps = { as: 'h6', fontFamily: 'heading', fontSize: '14px', mt: 2, mb: 2 };
40
+ export var H7 = function (props) { return _jsx(Text, __assign({}, props, { fontWeight: props.variant })); };
41
+ H7.defaultProps = { as: 'h6', fontFamily: 'heading', fontSize: '12px', mt: 2, mb: 2 };
package/ui/index.d.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  import CommonGrid from './Blocks/CommonGrid';
2
2
  import CornerDialog from './Blocks/CornerDialog';
3
3
  import ImageList from './Blocks/ImageList';
4
- import LanguageSwitch from './Blocks/LanguageSwitch';
5
4
  import LightBox from './Blocks/LightBox';
6
5
  import LoginPage from './Blocks/LoginPage';
7
6
  import Modal from './Blocks/Modal';
8
7
  import Popover from './Blocks/Popover';
9
- import SideMenu from './Blocks/SideMenu';
10
8
  import Tabs from './Blocks/Tabs';
11
9
  import Alert from './Elements/Alert';
12
10
  import Avatar from './Elements/Avatar';
@@ -21,6 +19,7 @@ import ErrorMessage from './Elements/ErrorMessage';
21
19
  import Icon from './Elements/Icon';
22
20
  import Image from './Elements/Image';
23
21
  import Label from './Elements/Label';
22
+ import LanguageSwitch from './Blocks/LanguageSwitch';
24
23
  import Line from './Elements/Line';
25
24
  import Link from './Elements/Link';
26
25
  import Logo from './Elements/Logo';
@@ -43,7 +42,7 @@ import RadioButton from './Forms/RadioButton';
43
42
  import TextArea from './Forms/TextArea';
44
43
  import ThemeProvider from './ThemeProvider';
45
44
  import utils from './utils';
46
- export { DropdownSelect, DatePicker, CommonGrid, Popover, SingleSelect, MultiSelect, Select, Card, CornerDialog, ImageList, LightBox, Modal, Tabs, Alert, Avatar, Badge, BorderedBox, Button, Dropdown, ErrorMessage, Icon, Image, Label, Line, Link, Logo, Pagination, Portal, ProgressBar, SimpleLink, SpaceAround, Spinner, Tag, Toast, Toggle, Typography, Checkbox, Input, RadioButton, ThemeProvider, utils, TextArea, LoginPage, LanguageSwitch, SideMenu };
45
+ export { DropdownSelect, DatePicker, CommonGrid, Popover, SingleSelect, MultiSelect, Select, Card, CornerDialog, ImageList, LightBox, Modal, Tabs, Alert, Avatar, Badge, BorderedBox, Button, Dropdown, ErrorMessage, Icon, Image, Label, Line, Link, Logo, Pagination, Portal, ProgressBar, SimpleLink, SpaceAround, Spinner, Tag, Toast, Toggle, Typography, Checkbox, Input, RadioButton, ThemeProvider, utils, TextArea, LoginPage, LanguageSwitch };
47
46
  export * from './Blocks/CornerDialog';
48
47
  export * from './Blocks/ImageList';
49
48
  export * from './Blocks/LightBox';
@@ -88,4 +87,3 @@ export * from './Elements/DropdownSelect';
88
87
  export * from './Forms/TextArea';
89
88
  export * from './Blocks/LoginPage';
90
89
  export * from './Blocks/LanguageSwitch';
91
- export * from './Blocks/SideMenu';