@astral/ui 4.22.2 → 4.23.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.
@@ -1,6 +1,10 @@
1
1
  import { type PropsWithChildren } from 'react';
2
2
  export type BulletListProps = PropsWithChildren<{
3
3
  className?: string;
4
+ /**
5
+ * Флаг для скрытия точек у первых элементов списка каждой строки.
6
+ */
7
+ hideFirstBullet?: boolean;
4
8
  }>;
5
9
  /**
6
10
  * Список элементов с маркерами
@@ -1,9 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Wrapper } from './styles';
2
+ import { useMemo } from 'react';
3
+ import { classNames } from '../utils/classNames';
4
+ import { bulletListClassnames } from './constants';
5
+ import { List, Wrapper } from './styles';
3
6
  /**
4
7
  * Список элементов с маркерами
5
8
  */
6
9
  export const BulletList = (props) => {
7
- const { children, ...restProps } = props;
8
- return _jsx(Wrapper, { ...restProps, children: children });
10
+ const { children, hideFirstBullet, className } = props;
11
+ const classnames = useMemo(() => classNames(className, bulletListClassnames.root, {
12
+ [bulletListClassnames.hideFirstBullet]: hideFirstBullet,
13
+ }), [hideFirstBullet]);
14
+ return (_jsx(Wrapper, { children: _jsx(List, { className: classnames, children: children }) }));
9
15
  };
@@ -0,0 +1,4 @@
1
+ export declare const bulletListClassnames: {
2
+ root: string;
3
+ hideFirstBullet: string;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { createUIKitClassname } from '../utils/createUIKitClassname';
2
+ export const bulletListClassnames = {
3
+ root: createUIKitClassname('bullet-list'),
4
+ hideFirstBullet: createUIKitClassname('bullet-list_hide-first-bullets'),
5
+ };
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
- export declare const Wrapper: import("../styled").StyledComponent<{
2
+ export declare const List: import("../styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
6
+ export declare const Wrapper: import("../styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,5 +1,13 @@
1
1
  import { styled } from '../styled';
2
2
  import { listContainer } from '../styled/mixins';
3
- export const Wrapper = styled('ul') `
3
+ import { bulletListClassnames } from './constants';
4
+ export const List = styled.ul `
4
5
  ${listContainer};
6
+
7
+ &.${bulletListClassnames.hideFirstBullet} {
8
+ margin-left: -${({ theme }) => theme.spacing(5)};
9
+ }
10
+ `;
11
+ export const Wrapper = styled.div `
12
+ overflow: hidden;
5
13
  `;
@@ -1,6 +1,10 @@
1
1
  import { type PropsWithChildren } from 'react';
2
2
  export type BulletListProps = PropsWithChildren<{
3
3
  className?: string;
4
+ /**
5
+ * Флаг для скрытия точек у первых элементов списка каждой строки.
6
+ */
7
+ hideFirstBullet?: boolean;
4
8
  }>;
5
9
  /**
6
10
  * Список элементов с маркерами
@@ -2,12 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BulletList = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const classNames_1 = require("../utils/classNames");
7
+ const constants_1 = require("./constants");
5
8
  const styles_1 = require("./styles");
6
9
  /**
7
10
  * Список элементов с маркерами
8
11
  */
9
12
  const BulletList = (props) => {
10
- const { children, ...restProps } = props;
11
- return (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { ...restProps, children: children });
13
+ const { children, hideFirstBullet, className } = props;
14
+ const classnames = (0, react_1.useMemo)(() => (0, classNames_1.classNames)(className, constants_1.bulletListClassnames.root, {
15
+ [constants_1.bulletListClassnames.hideFirstBullet]: hideFirstBullet,
16
+ }), [hideFirstBullet]);
17
+ return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { children: (0, jsx_runtime_1.jsx)(styles_1.List, { className: classnames, children: children }) }));
12
18
  };
13
19
  exports.BulletList = BulletList;
@@ -0,0 +1,4 @@
1
+ export declare const bulletListClassnames: {
2
+ root: string;
3
+ hideFirstBullet: string;
4
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bulletListClassnames = void 0;
4
+ const createUIKitClassname_1 = require("../utils/createUIKitClassname");
5
+ exports.bulletListClassnames = {
6
+ root: (0, createUIKitClassname_1.createUIKitClassname)('bullet-list'),
7
+ hideFirstBullet: (0, createUIKitClassname_1.createUIKitClassname)('bullet-list_hide-first-bullets'),
8
+ };
@@ -1,5 +1,9 @@
1
1
  /// <reference types="react" />
2
- export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
2
+ export declare const List: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
6
+ export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Wrapper = void 0;
3
+ exports.Wrapper = exports.List = void 0;
4
4
  const styled_1 = require("../styled");
5
5
  const mixins_1 = require("../styled/mixins");
6
- exports.Wrapper = (0, styled_1.styled)('ul') `
6
+ const constants_1 = require("./constants");
7
+ exports.List = styled_1.styled.ul `
7
8
  ${mixins_1.listContainer};
9
+
10
+ &.${constants_1.bulletListClassnames.hideFirstBullet} {
11
+ margin-left: -${({ theme }) => theme.spacing(5)};
12
+ }
13
+ `;
14
+ exports.Wrapper = styled_1.styled.div `
15
+ overflow: hidden;
8
16
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.22.2",
3
+ "version": "4.23.0",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {