@astral/ui 4.117.0 → 4.118.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 (41) hide show
  1. package/components/Alert/styles.d.ts +2 -2
  2. package/components/Banner/BannerTemplate/styles.d.ts +4 -4
  3. package/components/CollapsableAlert/styles.d.ts +2 -2
  4. package/components/DialogActions/styles.d.ts +4 -3
  5. package/components/FlowButton/styles.d.ts +2 -2
  6. package/components/Grid/Grid.d.ts +2 -6
  7. package/components/Grid/Grid.js +7 -1
  8. package/components/Grid/index.d.ts +1 -0
  9. package/components/Grid/styles.d.ts +1 -39
  10. package/components/Grid/styles.js +6 -1
  11. package/components/Grid/types.d.ts +50 -0
  12. package/components/Grid/types.js +1 -0
  13. package/components/Grid/useLogic/index.d.ts +1 -0
  14. package/components/Grid/useLogic/index.js +1 -0
  15. package/components/Grid/useLogic/useLogic.d.ts +7 -0
  16. package/components/Grid/useLogic/useLogic.js +8 -0
  17. package/components/MenuOrganization/styles.d.ts +2 -2
  18. package/components/ProductSwitcher/Content/styles.d.ts +2 -2
  19. package/components/Tag/styles.d.ts +2 -2
  20. package/hook-form/FormFiltersModalGroup/styles.d.ts +2 -2
  21. package/node/components/Alert/styles.d.ts +2 -2
  22. package/node/components/Banner/BannerTemplate/styles.d.ts +4 -4
  23. package/node/components/CollapsableAlert/styles.d.ts +2 -2
  24. package/node/components/DialogActions/styles.d.ts +4 -3
  25. package/node/components/FlowButton/styles.d.ts +2 -2
  26. package/node/components/Grid/Grid.d.ts +2 -6
  27. package/node/components/Grid/Grid.js +7 -1
  28. package/node/components/Grid/index.d.ts +1 -0
  29. package/node/components/Grid/styles.d.ts +1 -39
  30. package/node/components/Grid/styles.js +6 -1
  31. package/node/components/Grid/types.d.ts +50 -0
  32. package/node/components/Grid/types.js +2 -0
  33. package/node/components/Grid/useLogic/index.d.ts +1 -0
  34. package/node/components/Grid/useLogic/index.js +17 -0
  35. package/node/components/Grid/useLogic/useLogic.d.ts +7 -0
  36. package/node/components/Grid/useLogic/useLogic.js +12 -0
  37. package/node/components/MenuOrganization/styles.d.ts +2 -2
  38. package/node/components/ProductSwitcher/Content/styles.d.ts +2 -2
  39. package/node/components/Tag/styles.d.ts +2 -2
  40. package/node/hook-form/FormFiltersModalGroup/styles.d.ts +2 -2
  41. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledGrid: import("../styled").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
2
+ export declare const StyledGrid: import("../styled").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
4
+ }, {}, {}>;
5
5
  export declare const StyledIconButton: import("../styled").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
6
6
  variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
7
7
  loading?: boolean | undefined;
@@ -7,12 +7,12 @@ export declare const Image: import("../../styled").StyledComponent<{
7
7
  theme?: import("@emotion/react").Theme | undefined;
8
8
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
9
  }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
10
- export declare const Wrapper: import("../../styled").StyledComponent<Omit<import("../../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
10
+ export declare const Wrapper: import("../../styled").StyledComponent<Omit<import("../../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
11
11
  theme?: import("@emotion/react").Theme | undefined;
12
- } & import("../../Grid/styles").StyledGridProps, {}, {}>;
13
- export declare const WrapperTextContent: import("../../styled").StyledComponent<Omit<import("../../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
12
+ }, {}, {}>;
13
+ export declare const WrapperTextContent: import("../../styled").StyledComponent<Omit<import("../../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
14
14
  theme?: import("@emotion/react").Theme | undefined;
15
- } & import("../../Grid/styles").StyledGridProps, {}, {}>;
15
+ }, {}, {}>;
16
16
  export declare const Footer: import("../../styled").StyledComponent<{
17
17
  theme?: import("@emotion/react").Theme | undefined;
18
18
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const Actions: import("../styled").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
2
+ export declare const Actions: import("../styled").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
4
+ }, {}, {}>;
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
+ import { type GridProps } from '../Grid';
2
3
  export declare const StyledDialogActions: import("../styled").StyledComponent<import("@mui/material/DialogActions").DialogActionsProps & {
3
4
  theme?: import("@emotion/react").Theme | undefined;
4
5
  }, {}, {}>;
5
- export declare const StyledGrid: import("../styled").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
6
+ export declare const StyledGrid: import("../styled").StyledComponent<Omit<GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
6
7
  theme?: import("@emotion/react").Theme | undefined;
7
- } & import("../Grid/styles").StyledGridProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
+ } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
9
  component?: import("react").ElementType | undefined;
9
10
  children?: import("react").ReactNode;
10
- }, {}, {}>;
11
+ } & import("../Grid/types").StyledGridProps, {}, {}>;
@@ -20,6 +20,6 @@ export declare const TargetTextWrapper: import("../styled").StyledComponent<impo
20
20
  } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
21
21
  theme?: import("@emotion/react").Theme | undefined;
22
22
  }, {}, {}>;
23
- export declare const StyledGrid: import("../styled").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
23
+ export declare const StyledGrid: import("../styled").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
24
24
  theme?: import("@emotion/react").Theme | undefined;
25
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
25
+ }, {}, {}>;
@@ -1,7 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { type GridComponentProps } from './GridComponent';
3
- import { type StyledGridProps } from './styles';
4
- export type GridProps = GridComponentProps & StyledGridProps;
5
- export declare const Grid: import("@emotion/styled").StyledComponent<Omit<GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
6
- theme?: import("@emotion/react").Theme | undefined;
7
- } & StyledGridProps, {}, {}>;
2
+ import { type GridProps } from './types';
3
+ export declare const Grid: import("react").ForwardRefExoticComponent<Omit<GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
1
3
  import { StyledGrid } from './styles';
2
- export const Grid = StyledGrid;
4
+ import { useLogic } from './useLogic';
5
+ export const Grid = forwardRef(({ style, ...props }, ref) => {
6
+ const { gridCssVars } = useLogic(props);
7
+ return (_jsx(StyledGrid, { ref: ref, ...props, style: { ...gridCssVars, ...style } }));
8
+ });
@@ -1 +1,2 @@
1
1
  export * from './Grid';
2
+ export type { GridProps } from './types';
@@ -1,43 +1,5 @@
1
1
  /// <reference types="react" />
2
- export type StyledGridProps = {
3
- /**
4
- * Задаёт display: grid; Если задан columns, spacing и тп, то включается автоматически
5
- * @default false
6
- */
7
- container?: boolean;
8
- /**
9
- * Количество равных колонок,
10
- * либо текстовое значение соответствующее grid-template-columns
11
- * @default undefined
12
- */
13
- columns?: number | string;
14
- /**
15
- * Количество равных рядов,
16
- * либо текстовое значение соответствующее grid-template-rows
17
- * @default undefined
18
- */
19
- rows?: number | string;
20
- /**
21
- * Отступы между колонками
22
- * @default undefined
23
- */
24
- columnSpacing?: number;
25
- /**
26
- * Отступы между рядами
27
- * @default undefined
28
- */
29
- rowSpacing?: number;
30
- /**
31
- * Отступы между колонками и рядами. Если передан массив: Первый элемент - отступ между рядами, второй - между колонками
32
- * @default undefined
33
- */
34
- spacing?: number | [number, number];
35
- /**
36
- * Соответствует grid-autoflow
37
- * @default 'row'
38
- */
39
- direction?: 'row' | 'column' | 'dense';
40
- };
2
+ import { type StyledGridProps } from './types';
41
3
  export declare const StyledGrid: import("../styled").StyledComponent<Omit<import("./GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
42
4
  theme?: import("@emotion/react").Theme | undefined;
43
5
  } & StyledGridProps, {}, {}>;
@@ -27,11 +27,16 @@ export const StyledGrid = styled(GridComponent, {
27
27
  'spacing',
28
28
  ].includes(prop),
29
29
  }) `
30
+ --grid-justify-content: normal;
31
+ --grid-align-items: normal;
32
+
30
33
  ${({ theme, columnSpacing }) => columnSpacing && `column-gap: ${theme.spacing(columnSpacing)};`};
31
34
  ${({ theme, rowSpacing }) => rowSpacing && `row-gap: ${theme.spacing(rowSpacing)};`};
32
35
  ${({ theme, spacing }) => spacing && `gap: ${setCss(spacing, theme)};`};
33
36
  ${({ container, spacing, rowSpacing, columnSpacing }) => (spacing || rowSpacing || container || columnSpacing) && 'display: grid'};
34
37
  grid-template-columns: ${({ columns }) => getTemplateStyle(columns)};
35
38
  grid-template-rows: ${({ rows }) => getTemplateStyle(rows)};
36
- ${({ direction }) => direction && `grid-auto-flow: ${direction}`};
39
+ ${({ direction }) => direction && `grid-auto-flow: ${direction};`};
40
+ align-items: var(--grid-align-items);
41
+ justify-content: var(--grid-justify-content);
37
42
  `;
@@ -0,0 +1,50 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { GridComponentProps } from './GridComponent';
3
+ export type StyledGridProps = {
4
+ /**
5
+ * Задаёт display: grid; Если задан columns, spacing и тп, то включается автоматически
6
+ * @default false
7
+ */
8
+ container?: boolean;
9
+ /**
10
+ * Количество равных колонок,
11
+ * либо текстовое значение соответствующее grid-template-columns
12
+ * @default undefined
13
+ */
14
+ columns?: number | string;
15
+ /**
16
+ * Количество равных рядов,
17
+ * либо текстовое значение соответствующее grid-template-rows
18
+ * @default undefined
19
+ */
20
+ rows?: number | string;
21
+ /**
22
+ * Отступы между колонками
23
+ * @default undefined
24
+ */
25
+ columnSpacing?: number;
26
+ /**
27
+ * Отступы между рядами
28
+ * @default undefined
29
+ */
30
+ rowSpacing?: number;
31
+ /**
32
+ * Отступы между колонками и рядами. Если передан массив: Первый элемент - отступ между рядами, второй - между колонками
33
+ * @default undefined
34
+ */
35
+ spacing?: number | [number, number];
36
+ /**
37
+ * Соответствует grid-autoflow
38
+ * @default 'row'
39
+ */
40
+ direction?: 'row' | 'column' | 'dense';
41
+ /**
42
+ * Горизонтальное выравнивание сетки в контейнере.
43
+ */
44
+ justifyContent?: CSSProperties['justifyContent'];
45
+ /**
46
+ * Вертикальное выравнивание элементов внутри ячеек.
47
+ */
48
+ alignItems?: CSSProperties['alignItems'];
49
+ };
50
+ export type GridProps = GridComponentProps & StyledGridProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,7 @@
1
+ import { type CSSProperties } from 'react';
2
+ import type { StyledGridProps } from '../types';
3
+ type UseLogicParams = Pick<StyledGridProps, 'justifyContent' | 'alignItems'>;
4
+ export declare const useLogic: (params: UseLogicParams) => {
5
+ gridCssVars: CSSProperties;
6
+ };
7
+ export {};
@@ -0,0 +1,8 @@
1
+ export const useLogic = (params) => {
2
+ const { justifyContent, alignItems } = params;
3
+ const gridCssVars = {
4
+ '--grid-justify-content': justifyContent,
5
+ '--grid-align-items': alignItems,
6
+ };
7
+ return { gridCssVars };
8
+ };
@@ -13,9 +13,9 @@ export declare const OrganizationsWrapper: import("../styled").StyledComponent<{
13
13
  } & {
14
14
  $isLoading?: boolean | undefined;
15
15
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
16
- export declare const OrganizationData: import("../styled").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
16
+ export declare const OrganizationData: import("../styled").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
17
17
  theme?: import("@emotion/react").Theme | undefined;
18
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
18
+ }, {}, {}>;
19
19
  export declare const StyledTypography: import("../styled").StyledComponent<import("../Typography/types").TypographyPropsBase & {
20
20
  color?: import("../Typography").TypographyColor | undefined;
21
21
  variant?: import("../Typography").TypographyVariant | undefined;
@@ -10,9 +10,9 @@ export declare const Logo: import("../../styled").StyledComponent<{
10
10
  theme?: import("@emotion/react").Theme | undefined;
11
11
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
12
  }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
13
- export declare const TitleErrorContainer: import("../../styled").StyledComponent<Omit<import("../../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
13
+ export declare const TitleErrorContainer: import("../../styled").StyledComponent<Omit<import("../../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
14
14
  theme?: import("@emotion/react").Theme | undefined;
15
- } & import("../../Grid/styles").StyledGridProps, {}, {}>;
15
+ }, {}, {}>;
16
16
  export declare const ProductName: import("../../styled").StyledComponent<import("../../Typography/types").TypographyPropsBase & {
17
17
  color?: import("../../Typography").TypographyColor | undefined;
18
18
  variant?: import("../../Typography").TypographyVariant | undefined;
@@ -15,9 +15,9 @@ export declare const getBadgeColor: ({ tagColor }: {
15
15
  tagColor?: TagColor | undefined;
16
16
  }) => BadgeColor;
17
17
  export declare const getDeleteIconColor: ({ variant, color, theme, }: Omit<StyledTagThemeProps, 'disabled' | 'size'>) => string;
18
- export declare const LabelContainer: import("../styled").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
18
+ export declare const LabelContainer: import("../styled").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
19
19
  theme?: import("@emotion/react").Theme | undefined;
20
- } & import("../Grid/styles").StyledGridProps & {
20
+ } & {
21
21
  $variant: TagVariant;
22
22
  }, {}, {}>;
23
23
  export declare const Label: import("../styled").StyledComponent<{
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const Container: import("../../components/styled").StyledComponent<Omit<import("../../components/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
2
+ export declare const Container: import("../../components/styled").StyledComponent<Omit<import("../../components/Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- } & import("../../components/Grid/styles").StyledGridProps, {}, {}>;
4
+ }, {}, {}>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
2
+ export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
4
+ }, {}, {}>;
5
5
  export declare const StyledIconButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
6
6
  variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
7
7
  loading?: boolean | undefined;
@@ -7,12 +7,12 @@ export declare const Image: import("@emotion/styled/dist/declarations/src/types"
7
7
  theme?: import("@emotion/react").Theme | undefined;
8
8
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
9
  }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
10
- export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
10
+ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
11
11
  theme?: import("@emotion/react").Theme | undefined;
12
- } & import("../../Grid/styles").StyledGridProps, {}, {}>;
13
- export declare const WrapperTextContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
12
+ }, {}, {}>;
13
+ export declare const WrapperTextContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
14
14
  theme?: import("@emotion/react").Theme | undefined;
15
- } & import("../../Grid/styles").StyledGridProps, {}, {}>;
15
+ }, {}, {}>;
16
16
  export declare const Footer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
17
17
  theme?: import("@emotion/react").Theme | undefined;
18
18
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const Actions: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
2
+ export declare const Actions: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
4
+ }, {}, {}>;
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
+ import { type GridProps } from '../Grid';
2
3
  export declare const StyledDialogActions: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("@mui/material/DialogActions").DialogActionsProps & {
3
4
  theme?: import("@emotion/react").Theme | undefined;
4
5
  }, {}, {}>;
5
- export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
6
+ export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
6
7
  theme?: import("@emotion/react").Theme | undefined;
7
- } & import("../Grid/styles").StyledGridProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
+ } & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
8
9
  component?: import("react").ElementType | undefined;
9
10
  children?: import("react").ReactNode;
10
- }, {}, {}>;
11
+ } & import("../Grid/types").StyledGridProps, {}, {}>;
@@ -20,6 +20,6 @@ export declare const TargetTextWrapper: import("@emotion/styled/dist/declaration
20
20
  } & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
21
21
  theme?: import("@emotion/react").Theme | undefined;
22
22
  }, {}, {}>;
23
- export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
23
+ export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
24
24
  theme?: import("@emotion/react").Theme | undefined;
25
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
25
+ }, {}, {}>;
@@ -1,7 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { type GridComponentProps } from './GridComponent';
3
- import { type StyledGridProps } from './styles';
4
- export type GridProps = GridComponentProps & StyledGridProps;
5
- export declare const Grid: import("@emotion/styled").StyledComponent<Omit<GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
6
- theme?: import("@emotion/react").Theme | undefined;
7
- } & StyledGridProps, {}, {}>;
2
+ import { type GridProps } from './types';
3
+ export declare const Grid: import("react").ForwardRefExoticComponent<Omit<GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Grid = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
4
6
  const styles_1 = require("./styles");
5
- exports.Grid = styles_1.StyledGrid;
7
+ const useLogic_1 = require("./useLogic");
8
+ exports.Grid = (0, react_1.forwardRef)(({ style, ...props }, ref) => {
9
+ const { gridCssVars } = (0, useLogic_1.useLogic)(props);
10
+ return ((0, jsx_runtime_1.jsx)(styles_1.StyledGrid, { ref: ref, ...props, style: { ...gridCssVars, ...style } }));
11
+ });
@@ -1 +1,2 @@
1
1
  export * from './Grid';
2
+ export type { GridProps } from './types';
@@ -1,43 +1,5 @@
1
1
  /// <reference types="react" />
2
- export type StyledGridProps = {
3
- /**
4
- * Задаёт display: grid; Если задан columns, spacing и тп, то включается автоматически
5
- * @default false
6
- */
7
- container?: boolean;
8
- /**
9
- * Количество равных колонок,
10
- * либо текстовое значение соответствующее grid-template-columns
11
- * @default undefined
12
- */
13
- columns?: number | string;
14
- /**
15
- * Количество равных рядов,
16
- * либо текстовое значение соответствующее grid-template-rows
17
- * @default undefined
18
- */
19
- rows?: number | string;
20
- /**
21
- * Отступы между колонками
22
- * @default undefined
23
- */
24
- columnSpacing?: number;
25
- /**
26
- * Отступы между рядами
27
- * @default undefined
28
- */
29
- rowSpacing?: number;
30
- /**
31
- * Отступы между колонками и рядами. Если передан массив: Первый элемент - отступ между рядами, второй - между колонками
32
- * @default undefined
33
- */
34
- spacing?: number | [number, number];
35
- /**
36
- * Соответствует grid-autoflow
37
- * @default 'row'
38
- */
39
- direction?: 'row' | 'column' | 'dense';
40
- };
2
+ import { type StyledGridProps } from './types';
41
3
  export declare const StyledGrid: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("./GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
42
4
  theme?: import("@emotion/react").Theme | undefined;
43
5
  } & StyledGridProps, {}, {}>;
@@ -30,11 +30,16 @@ exports.StyledGrid = (0, styled_1.styled)(GridComponent_1.GridComponent, {
30
30
  'spacing',
31
31
  ].includes(prop),
32
32
  }) `
33
+ --grid-justify-content: normal;
34
+ --grid-align-items: normal;
35
+
33
36
  ${({ theme, columnSpacing }) => columnSpacing && `column-gap: ${theme.spacing(columnSpacing)};`};
34
37
  ${({ theme, rowSpacing }) => rowSpacing && `row-gap: ${theme.spacing(rowSpacing)};`};
35
38
  ${({ theme, spacing }) => spacing && `gap: ${setCss(spacing, theme)};`};
36
39
  ${({ container, spacing, rowSpacing, columnSpacing }) => (spacing || rowSpacing || container || columnSpacing) && 'display: grid'};
37
40
  grid-template-columns: ${({ columns }) => getTemplateStyle(columns)};
38
41
  grid-template-rows: ${({ rows }) => getTemplateStyle(rows)};
39
- ${({ direction }) => direction && `grid-auto-flow: ${direction}`};
42
+ ${({ direction }) => direction && `grid-auto-flow: ${direction};`};
43
+ align-items: var(--grid-align-items);
44
+ justify-content: var(--grid-justify-content);
40
45
  `;
@@ -0,0 +1,50 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { GridComponentProps } from './GridComponent';
3
+ export type StyledGridProps = {
4
+ /**
5
+ * Задаёт display: grid; Если задан columns, spacing и тп, то включается автоматически
6
+ * @default false
7
+ */
8
+ container?: boolean;
9
+ /**
10
+ * Количество равных колонок,
11
+ * либо текстовое значение соответствующее grid-template-columns
12
+ * @default undefined
13
+ */
14
+ columns?: number | string;
15
+ /**
16
+ * Количество равных рядов,
17
+ * либо текстовое значение соответствующее grid-template-rows
18
+ * @default undefined
19
+ */
20
+ rows?: number | string;
21
+ /**
22
+ * Отступы между колонками
23
+ * @default undefined
24
+ */
25
+ columnSpacing?: number;
26
+ /**
27
+ * Отступы между рядами
28
+ * @default undefined
29
+ */
30
+ rowSpacing?: number;
31
+ /**
32
+ * Отступы между колонками и рядами. Если передан массив: Первый элемент - отступ между рядами, второй - между колонками
33
+ * @default undefined
34
+ */
35
+ spacing?: number | [number, number];
36
+ /**
37
+ * Соответствует grid-autoflow
38
+ * @default 'row'
39
+ */
40
+ direction?: 'row' | 'column' | 'dense';
41
+ /**
42
+ * Горизонтальное выравнивание сетки в контейнере.
43
+ */
44
+ justifyContent?: CSSProperties['justifyContent'];
45
+ /**
46
+ * Вертикальное выравнивание элементов внутри ячеек.
47
+ */
48
+ alignItems?: CSSProperties['alignItems'];
49
+ };
50
+ export type GridProps = GridComponentProps & StyledGridProps;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useLogic"), exports);
@@ -0,0 +1,7 @@
1
+ import { type CSSProperties } from 'react';
2
+ import type { StyledGridProps } from '../types';
3
+ type UseLogicParams = Pick<StyledGridProps, 'justifyContent' | 'alignItems'>;
4
+ export declare const useLogic: (params: UseLogicParams) => {
5
+ gridCssVars: CSSProperties;
6
+ };
7
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLogic = void 0;
4
+ const useLogic = (params) => {
5
+ const { justifyContent, alignItems } = params;
6
+ const gridCssVars = {
7
+ '--grid-justify-content': justifyContent,
8
+ '--grid-align-items': alignItems,
9
+ };
10
+ return { gridCssVars };
11
+ };
12
+ exports.useLogic = useLogic;
@@ -13,9 +13,9 @@ export declare const OrganizationsWrapper: import("@emotion/styled/dist/declarat
13
13
  } & {
14
14
  $isLoading?: boolean | undefined;
15
15
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
16
- export declare const OrganizationData: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
16
+ export declare const OrganizationData: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
17
17
  theme?: import("@emotion/react").Theme | undefined;
18
- } & import("../Grid/styles").StyledGridProps, {}, {}>;
18
+ }, {}, {}>;
19
19
  export declare const StyledTypography: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../Typography/types").TypographyPropsBase & {
20
20
  color?: import("../Typography").TypographyColor | undefined;
21
21
  variant?: import("../Typography").TypographyVariant | undefined;
@@ -10,9 +10,9 @@ export declare const Logo: import("@emotion/styled/dist/declarations/src/types")
10
10
  theme?: import("@emotion/react").Theme | undefined;
11
11
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
12
12
  }, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
13
- export declare const TitleErrorContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
13
+ export declare const TitleErrorContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
14
14
  theme?: import("@emotion/react").Theme | undefined;
15
- } & import("../../Grid/styles").StyledGridProps, {}, {}>;
15
+ }, {}, {}>;
16
16
  export declare const ProductName: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../../Typography/types").TypographyPropsBase & {
17
17
  color?: import("../../Typography").TypographyColor | undefined;
18
18
  variant?: import("../../Typography").TypographyVariant | undefined;
@@ -15,9 +15,9 @@ export declare const getBadgeColor: ({ tagColor }: {
15
15
  tagColor?: TagColor | undefined;
16
16
  }) => BadgeColor;
17
17
  export declare const getDeleteIconColor: ({ variant, color, theme, }: Omit<StyledTagThemeProps, 'disabled' | 'size'>) => string;
18
- export declare const LabelContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
18
+ export declare const LabelContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
19
19
  theme?: import("@emotion/react").Theme | undefined;
20
- } & import("../Grid/styles").StyledGridProps & {
20
+ } & {
21
21
  $variant: TagVariant;
22
22
  }, {}, {}>;
23
23
  export declare const Label: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const Container: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../components/Grid/GridComponent").GridComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
2
+ export declare const Container: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("../../components/Grid").GridProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & {
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- } & import("../../components/Grid/styles").StyledGridProps, {}, {}>;
4
+ }, {}, {}>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.117.0",
3
+ "version": "4.118.0",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {