@astral/ui 4.31.1 → 4.32.0

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 (80) hide show
  1. package/components/ActionGroup/index.d.ts +1 -1
  2. package/components/Button/Button.js +1 -1
  3. package/components/Button/constants.d.ts +1 -0
  4. package/components/Button/constants.js +1 -0
  5. package/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  6. package/components/DashboardLayout/Header/styles.js +1 -1
  7. package/components/DashboardSidebar/styles.js +1 -1
  8. package/components/DataGridPaginationContainer/styles.js +1 -1
  9. package/components/PageAside/styles.js +4 -1
  10. package/components/PageContent/styles.js +1 -1
  11. package/components/PageHeader/HeaderContent/HeaderContent.js +1 -1
  12. package/components/PageHeader/HeaderContent/styles.js +7 -2
  13. package/components/PageHeader/PageActions/PageActions.d.ts +1 -0
  14. package/components/PageHeader/PageActions/PageActions.js +3 -7
  15. package/components/PageHeader/PageActions/constants.d.ts +3 -0
  16. package/components/PageHeader/PageActions/constants.js +3 -0
  17. package/components/PageHeader/PageActions/styles.d.ts +11 -1
  18. package/components/PageHeader/PageActions/styles.js +39 -4
  19. package/components/PageHeader/PageActions/types.d.ts +4 -0
  20. package/components/PageHeader/PageActions/useLogic/useLogic.d.ts +4 -3
  21. package/components/PageHeader/PageActions/useLogic/useLogic.js +38 -3
  22. package/components/PageHeader/styles.js +1 -1
  23. package/components/PageLayoutContainer/styles.js +0 -4
  24. package/components/PageLayoutFooter/styles.js +5 -1
  25. package/components/PagePinnableAside/styles.js +2 -2
  26. package/components/declaration/mui-material.d.ts +4 -0
  27. package/components/theme/breakpoints.d.ts +10 -1
  28. package/components/theme/breakpoints.js +1 -0
  29. package/hook-form/FormFilters/AllFiltersButton/AllFiltersButton.js +2 -2
  30. package/hook-form/FormFilters/AllFiltersButton/styles.d.ts +3 -0
  31. package/hook-form/FormFilters/AllFiltersButton/styles.js +33 -3
  32. package/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +1 -0
  33. package/hook-form/FormFilters/FormFiltersSkeleton/styles.js +7 -0
  34. package/hook-form/FormFilters/constants.d.ts +1 -0
  35. package/hook-form/FormFilters/constants.js +1 -0
  36. package/hook-form/FormFilters/styles.js +8 -4
  37. package/hook-form/FormFiltersSearchField/FormFiltersSearchField.js +4 -3
  38. package/hook-form/FormFiltersSearchField/constants.d.ts +4 -0
  39. package/hook-form/FormFiltersSearchField/constants.js +5 -0
  40. package/hook-form/FormFiltersSearchField/styles.js +60 -1
  41. package/node/components/ActionGroup/index.d.ts +1 -1
  42. package/node/components/Button/Button.js +1 -1
  43. package/node/components/Button/constants.d.ts +1 -0
  44. package/node/components/Button/constants.js +1 -0
  45. package/node/components/DashboardLayout/DashboardWrapper/styles.js +1 -1
  46. package/node/components/DashboardLayout/Header/styles.js +1 -1
  47. package/node/components/DashboardSidebar/styles.js +1 -1
  48. package/node/components/DataGridPaginationContainer/styles.js +1 -1
  49. package/node/components/PageAside/styles.js +4 -1
  50. package/node/components/PageContent/styles.js +1 -1
  51. package/node/components/PageHeader/HeaderContent/HeaderContent.js +1 -1
  52. package/node/components/PageHeader/HeaderContent/styles.js +7 -2
  53. package/node/components/PageHeader/PageActions/PageActions.d.ts +1 -0
  54. package/node/components/PageHeader/PageActions/PageActions.js +2 -6
  55. package/node/components/PageHeader/PageActions/constants.d.ts +3 -0
  56. package/node/components/PageHeader/PageActions/constants.js +4 -1
  57. package/node/components/PageHeader/PageActions/styles.d.ts +11 -1
  58. package/node/components/PageHeader/PageActions/styles.js +39 -4
  59. package/node/components/PageHeader/PageActions/types.d.ts +4 -0
  60. package/node/components/PageHeader/PageActions/useLogic/useLogic.d.ts +4 -3
  61. package/node/components/PageHeader/PageActions/useLogic/useLogic.js +36 -1
  62. package/node/components/PageHeader/styles.js +1 -1
  63. package/node/components/PageLayoutContainer/styles.js +0 -4
  64. package/node/components/PageLayoutFooter/styles.js +4 -0
  65. package/node/components/PagePinnableAside/styles.js +2 -2
  66. package/node/components/theme/breakpoints.d.ts +10 -1
  67. package/node/components/theme/breakpoints.js +1 -0
  68. package/node/hook-form/FormFilters/AllFiltersButton/AllFiltersButton.js +1 -1
  69. package/node/hook-form/FormFilters/AllFiltersButton/styles.d.ts +3 -0
  70. package/node/hook-form/FormFilters/AllFiltersButton/styles.js +41 -11
  71. package/node/hook-form/FormFilters/AllFiltersButton/useLogic/useLogic.js +1 -0
  72. package/node/hook-form/FormFilters/FormFiltersSkeleton/styles.js +7 -0
  73. package/node/hook-form/FormFilters/constants.d.ts +1 -0
  74. package/node/hook-form/FormFilters/constants.js +1 -0
  75. package/node/hook-form/FormFilters/styles.js +8 -4
  76. package/node/hook-form/FormFiltersSearchField/FormFiltersSearchField.js +3 -2
  77. package/node/hook-form/FormFiltersSearchField/constants.d.ts +4 -0
  78. package/node/hook-form/FormFiltersSearchField/constants.js +6 -1
  79. package/node/hook-form/FormFiltersSearchField/styles.js +60 -1
  80. package/package.json +1 -1
@@ -1,36 +1,55 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StyledCounter = exports.StyledBadge = exports.AllFiltersButtonWrapper = void 0;
3
+ exports.StyledCounter = exports.StyledBadge = exports.StyledTooltip = exports.AllFiltersButtonWrapper = void 0;
4
4
  const Badge_1 = require("@mui/material/Badge");
5
+ const Tooltip_1 = require("@mui/material/Tooltip");
5
6
  const Badge_2 = require("../../../components/Badge");
7
+ const constants_1 = require("../../../components/Button/constants");
6
8
  const Counter_1 = require("../../../components/Counter");
7
9
  const styled_1 = require("../../../components/styled");
8
- const constants_1 = require("../constants");
10
+ const Tooltip_2 = require("../../../components/Tooltip");
11
+ const constants_2 = require("../constants");
9
12
  exports.AllFiltersButtonWrapper = styled_1.styled.div `
10
13
  display: none;
11
14
 
12
15
  white-space: nowrap;
13
16
 
14
- &.${constants_1.formFiltersClassnames.showAllFiltersButtonOnDesktop} {
17
+ &.${constants_2.formFiltersClassnames.showAllFiltersButtonOnDesktop} {
15
18
  display: flex;
16
19
  }
17
20
 
21
+ ${({ theme }) => theme.breakpoints.between('sm', 'laptop')} {
22
+ &.${constants_2.formFiltersClassnames.showAllFiltersButtonOnLaptop} {
23
+ display: flex;
24
+ }
25
+
26
+ .${constants_2.formFiltersClassnames.allFiltersButton} {
27
+ padding: ${({ theme }) => theme.microSpacing(0, 3)};
28
+
29
+ font-size: 0;
30
+
31
+ &.${constants_1.buttonClassnames.root} {
32
+ gap: 0;
33
+ }
34
+ }
35
+ }
36
+
18
37
  ${({ theme }) => theme.breakpoints.down('sm')} {
19
38
  margin-right: 0;
20
- &.${constants_1.formFiltersClassnames.showAllFiltersButtonOnMobile} {
39
+ &.${constants_2.formFiltersClassnames.showAllFiltersButtonOnMobile} {
21
40
  display: flex;
22
41
  }
23
42
 
24
- &.${constants_1.formFiltersClassnames.withoutSearch} {
43
+ &.${constants_2.formFiltersClassnames.withoutSearch} {
25
44
  width: 100%;
26
45
 
27
- .${constants_1.formFiltersClassnames.allFiltersButton} {
46
+ .${constants_2.formFiltersClassnames.allFiltersButton} {
28
47
  width: 100%;
29
48
  }
30
49
  }
31
50
 
32
- &.${constants_1.formFiltersClassnames.withSearch} {
33
- .${constants_1.formFiltersClassnames.allFiltersButton} {
51
+ &.${constants_2.formFiltersClassnames.withSearch} {
52
+ .${constants_2.formFiltersClassnames.allFiltersButton} {
34
53
  display: unset;
35
54
  gap: 0;
36
55
 
@@ -41,16 +60,27 @@ exports.AllFiltersButtonWrapper = styled_1.styled.div `
41
60
  }
42
61
  }
43
62
  `;
63
+ exports.StyledTooltip = (0, styled_1.styled)(Tooltip_2.Tooltip) `
64
+ & .${Tooltip_1.tooltipClasses.tooltip} {
65
+ ${({ theme }) => theme.breakpoints.up('laptop')} {
66
+ display: none;
67
+ }
68
+ }
69
+ `;
44
70
  exports.StyledBadge = (0, styled_1.styled)(Badge_2.Badge) `
45
- width: 100%;
71
+ width: 100%;
72
+
46
73
  .${Badge_1.badgeClasses.dot} {
47
- ${({ theme }) => theme.breakpoints.up('sm')} {
74
+ top: ${({ theme }) => theme.spacing(1)};
75
+ right: ${({ theme }) => theme.spacing(1)};
76
+
77
+ ${({ theme }) => theme.breakpoints.up('laptop')} {
48
78
  display: none;
49
79
  }
50
80
  }
51
81
  `;
52
82
  exports.StyledCounter = (0, styled_1.styled)(Counter_1.Counter) `
53
- ${({ theme }) => theme.breakpoints.down('sm')} {
83
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
54
84
  display: none;
55
85
  }
56
86
  `;
@@ -23,6 +23,7 @@ const useLogic = ({ form, onOpenModal, hasMainFilters, hasSecondaryFilters, hasS
23
23
  const allFiltersButtonClassName = (0, react_1.useMemo)(() => {
24
24
  return (0, classNames_1.classNames)({
25
25
  [constants_2.formFiltersClassnames.showAllFiltersButtonOnDesktop]: hasSecondaryFilters,
26
+ [constants_2.formFiltersClassnames.showAllFiltersButtonOnLaptop]: hasMainFilters || hasSecondaryFilters,
26
27
  [constants_2.formFiltersClassnames.showAllFiltersButtonOnMobile]: hasMainFilters || hasSecondaryFilters,
27
28
  [constants_2.formFiltersClassnames.withSearch]: hasSearch,
28
29
  [constants_2.formFiltersClassnames.withoutSearch]: !hasSearch,
@@ -10,6 +10,13 @@ exports.SkeletonWrapper = styled_1.styled.div `
10
10
 
11
11
  margin-top: ${({ theme }) => theme.spacing(4)};
12
12
 
13
+ ${({ theme }) => theme.breakpoints.between('sm', 'laptop')} {
14
+ grid-template-columns: 72px 0 0 0;
15
+ gap: 0;
16
+
17
+ margin: ${({ theme }) => theme.spacing(0, 2, 0)};
18
+ }
19
+
13
20
  .${Skeleton_1.skeletonClasses.root} {
14
21
  height: 32px;
15
22
  }
@@ -3,6 +3,7 @@ export declare const formFiltersClassnames: {
3
3
  submitButton: string;
4
4
  allFiltersButton: string;
5
5
  showAllFiltersButtonOnDesktop: string;
6
+ showAllFiltersButtonOnLaptop: string;
6
7
  showAllFiltersButtonOnMobile: string;
7
8
  withSearch: string;
8
9
  withoutSearch: string;
@@ -7,6 +7,7 @@ exports.formFiltersClassnames = {
7
7
  submitButton: (0, createUIKitClassname_1.createUIKitClassname)('form-filters__submit-button'),
8
8
  allFiltersButton: (0, createUIKitClassname_1.createUIKitClassname)('form-filters__all-filters-button'),
9
9
  showAllFiltersButtonOnDesktop: (0, createUIKitClassname_1.createUIKitClassname)('form-filters_show-all-filters-button_desktop'),
10
+ showAllFiltersButtonOnLaptop: (0, createUIKitClassname_1.createUIKitClassname)('form-filters_show-all-filters-button_laptop'),
10
11
  showAllFiltersButtonOnMobile: (0, createUIKitClassname_1.createUIKitClassname)('form-filters_show-all-filters-button_mobile'),
11
12
  withSearch: (0, createUIKitClassname_1.createUIKitClassname)('form-filters_with-search'),
12
13
  withoutSearch: (0, createUIKitClassname_1.createUIKitClassname)('form-filters_without-search'),
@@ -16,9 +16,13 @@ exports.Wrapper = styled_1.styled.div `
16
16
  .${FormLabel_1.formLabelClasses.root} {
17
17
  display: none;
18
18
  }
19
+
20
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
21
+ margin-top: 0;
22
+ padding-right: ${({ theme }) => theme.spacing(2)};
23
+ }
19
24
 
20
25
  ${({ theme }) => theme.breakpoints.down('sm')} {
21
- margin-top: 0;
22
26
  padding: ${({ theme }) => theme.spacing(1, 4, 5, 4)};
23
27
 
24
28
  font-size: 0;
@@ -40,14 +44,14 @@ exports.MainFiltersWrapper = styled_1.styled.div `
40
44
 
41
45
  width: 100%;
42
46
 
43
- ${({ theme }) => theme.breakpoints.down('sm')} {
47
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
44
48
  display: none;
45
49
  }
46
50
  `;
47
51
  exports.SubmitButtonWrapper = styled_1.styled.div `
48
52
  white-space: nowrap;
49
53
 
50
- ${({ theme }) => theme.breakpoints.down('sm')} {
51
- display: contents;
54
+ ${({ theme }) => theme.breakpoints.down('laptop')} {
55
+ display: none;
52
56
  }
53
57
  `;
@@ -8,13 +8,14 @@ const useFormFieldProps_1 = require("../useFormFieldProps");
8
8
  const constants_1 = require("./constants");
9
9
  const styles_1 = require("./styles");
10
10
  /**
11
- * Адаптер для SearchField
11
+ * Адаптер для SearchField для использования в FormFilters
12
12
  */
13
13
  function FormFiltersSearchFieldInner({ width, ...props }, ref) {
14
14
  const fieldProps = (0, useFormFieldProps_1.useFormFieldProps)({
15
15
  ...props,
16
16
  defaultValue: props.defaultValue || '',
17
17
  });
18
- return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { "$width": width, children: (0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { ...fieldProps, ref: ref, inputProps: { id: constants_1.FORM_FILTERS_SEARCH_FIELD_ID }, fullWidth: true }) }));
18
+ const hasValue = Boolean(fieldProps.value);
19
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { "$width": width, className: hasValue ? constants_1.formFiltersSearchFieldClassnames.hasValue : '', children: (0, jsx_runtime_1.jsx)(SearchField_1.SearchField, { ...fieldProps, ref: ref, inputProps: { id: constants_1.FORM_FILTERS_SEARCH_FIELD_ID }, fullWidth: true }) }));
19
20
  }
20
21
  exports.FormFiltersSearchField = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(FormFiltersSearchFieldInner);
@@ -1 +1,5 @@
1
1
  export declare const FORM_FILTERS_SEARCH_FIELD_ID = "form-filters-search-field";
2
+ export declare const formFiltersSearchFieldClassnames: {
3
+ hasValue: string;
4
+ };
5
+ export declare const DEFAULT_SEARCH_FIELD_WIDTH = "240px";
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FORM_FILTERS_SEARCH_FIELD_ID = void 0;
3
+ exports.DEFAULT_SEARCH_FIELD_WIDTH = exports.formFiltersSearchFieldClassnames = exports.FORM_FILTERS_SEARCH_FIELD_ID = void 0;
4
+ const createUIKitClassname_1 = require("../../components/utils/createUIKitClassname");
4
5
  exports.FORM_FILTERS_SEARCH_FIELD_ID = 'form-filters-search-field';
6
+ exports.formFiltersSearchFieldClassnames = {
7
+ hasValue: (0, createUIKitClassname_1.createUIKitClassname)('form-filters-search-field__has-value'),
8
+ };
9
+ exports.DEFAULT_SEARCH_FIELD_WIDTH = '240px';
@@ -1,9 +1,68 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Wrapper = void 0;
4
+ const FormControl_1 = require("@mui/material/FormControl");
5
+ const InputBase_1 = require("@mui/material/InputBase");
6
+ const OutlinedInput_1 = require("@mui/material/OutlinedInput");
7
+ const SvgIcon_1 = require("../../components/SvgIcon");
4
8
  const styled_1 = require("../../components/styled");
9
+ const constants_1 = require("./constants");
5
10
  exports.Wrapper = styled_1.styled.div `
6
- min-width: ${({ $width }) => $width || '240px'};
11
+ min-width: ${({ $width }) => $width || constants_1.DEFAULT_SEARCH_FIELD_WIDTH};
12
+
13
+ ${({ theme }) => theme.breakpoints.between('sm', 'laptop')} {
14
+ overflow: hidden;
15
+
16
+ width: ${({ $width }) => $width || constants_1.DEFAULT_SEARCH_FIELD_WIDTH};
17
+ min-width: unset;
18
+
19
+ transition: ${({ theme }) => theme.transitions.create(['width', 'padding'], {
20
+ duration: theme.transitions.duration.shorter,
21
+ easing: theme.transitions.easing.easeInOut,
22
+ delay: theme.transitions.duration.shorter,
23
+ })};
24
+
25
+ .${FormControl_1.formControlClasses.root} {
26
+ display: flex;
27
+ flex-direction: row-reverse;
28
+
29
+ width: 100%;
30
+ min-width: 32px;
31
+ }
32
+
33
+ .${OutlinedInput_1.outlinedInputClasses.root} {
34
+ transition: ${({ theme }) => theme.transitions.create(['width', 'padding'], {
35
+ duration: theme.transitions.duration.shorter,
36
+ easing: theme.transitions.easing.easeInOut,
37
+ delay: theme.transitions.duration.shorter,
38
+ })};
39
+ }
40
+
41
+ .${SvgIcon_1.svgIconClassnames.root} {
42
+ transition: ${({ theme }) => theme.transitions.create(['fill'], {
43
+ duration: theme.transitions.duration.shorter,
44
+ easing: theme.transitions.easing.easeInOut,
45
+ delay: theme.transitions.duration.shorter,
46
+ })};
47
+ }
48
+
49
+ &:not(:hover, :focus-within):not(.${constants_1.formFiltersSearchFieldClassnames.hasValue}) {
50
+ width: 32px;
51
+
52
+ .${SvgIcon_1.svgIconClassnames.root} {
53
+ fill: ${({ theme }) => theme.palette.grey[800]};
54
+ }
55
+
56
+ .${OutlinedInput_1.outlinedInputClasses.root} {
57
+ padding: ${({ theme }) => theme.microSpacing(1, 3)};
58
+ }
59
+
60
+ .${InputBase_1.inputBaseClasses.input} {
61
+ width: 0;
62
+ min-width: 0;
63
+ }
64
+ }
65
+ }
7
66
 
8
67
  ${({ theme }) => theme.breakpoints.down('sm')} {
9
68
  width: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.31.1",
3
+ "version": "4.32.0",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {