@hh.ru/magritte-ui-section-header 1.1.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.
@@ -0,0 +1,2 @@
1
+ import { SectionHeaderProps } from '@hh.ru/magritte-ui-section-header/types';
2
+ export declare const SectionHeader: import("react").ForwardRefExoticComponent<SectionHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,15 @@
1
+ import './index.css';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import classnames from 'classnames';
5
+ import { Text } from '@hh.ru/magritte-ui-typography';
6
+
7
+ var styles = {"section-header":"magritte-section-header___4Qnhz_1-1-0","sectionHeader":"magritte-section-header___4Qnhz_1-1-0"};
8
+
9
+ const SectionHeader = forwardRef(({ children, className, link, padding, style, ...props }, ref) => {
10
+ return (jsxs("div", { ...props, className: classnames(className, styles.sectionHeader), ref: ref, style: { ...style, '--padding': `${padding}px` }, children: [jsx(Text, { ellipsis: true, style: "secondary", typography: "label-2-regular", children: children }), link] }));
11
+ });
12
+ SectionHeader.displayName = 'SectionHeader';
13
+
14
+ export { SectionHeader };
15
+ //# sourceMappingURL=SectionHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionHeader.js","sources":["src/SectionHeader.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classnames from 'classnames';\n\nimport { SectionHeaderProps } from '@hh.ru/magritte-ui-section-header/types';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './section-header.less';\n\nexport const SectionHeader = forwardRef<HTMLDivElement, SectionHeaderProps>(\n ({ children, className, link, padding, style, ...props }, ref) => {\n return (\n <div\n {...props}\n className={classnames(className, styles.sectionHeader)}\n ref={ref}\n style={{ ...style, '--padding': `${padding}px` } as React.CSSProperties}\n >\n <Text ellipsis style=\"secondary\" typography=\"label-2-regular\">\n {children}\n </Text>\n {link}\n </div>\n );\n }\n);\n\nSectionHeader.displayName = 'SectionHeader';\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAQa,MAAA,aAAa,GAAG,UAAU,CACnC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;IAC7D,QACIA,iBACQ,KAAK,EACT,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,EACtD,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,WAAW,EAAE,CAAA,EAAG,OAAO,CAAA,EAAA,CAAI,EAAyB,EAAA,QAAA,EAAA,CAEvEC,IAAC,IAAI,EAAA,EAAC,QAAQ,EAAA,IAAA,EAAC,KAAK,EAAC,WAAW,EAAC,UAAU,EAAC,iBAAiB,EACxD,QAAA,EAAA,QAAQ,GACN,EACN,IAAI,CACH,EAAA,CAAA,EACR;AACN,CAAC,EACH;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
package/index.css ADDED
@@ -0,0 +1,7 @@
1
+ .magritte-section-header___4Qnhz_1-1-0{
2
+ display:flex;
3
+ gap:8px;
4
+ justify-content:space-between;
5
+ align-items:center;
6
+ padding:12px var(--padding) 4px var(--padding);
7
+ }
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from '@hh.ru/magritte-ui-section-header/SectionHeader';
2
+ export * from '@hh.ru/magritte-ui-section-header/types';
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import './index.css';
2
+ export { SectionHeader } from './SectionHeader.js';
3
+ import 'react/jsx-runtime';
4
+ import 'react';
5
+ import 'classnames';
6
+ import '@hh.ru/magritte-ui-typography';
7
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,3 @@
1
+ import { ForwardRefExoticComponent } from 'react';
2
+ export * from '@hh.ru/magritte-ui-section-header/types';
3
+ export declare const SectionHeader: ForwardRefExoticComponent<Record<string, unknown>>;
package/index.mock.js ADDED
@@ -0,0 +1,9 @@
1
+ import './index.css';
2
+ import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
3
+
4
+ const SectionHeader = mockComponent('SectionHeader', undefined, {
5
+ withChildren: true,
6
+ });
7
+
8
+ export { SectionHeader };
9
+ //# sourceMappingURL=index.mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-section-header/types';\n\nexport const SectionHeader: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'SectionHeader',\n undefined,\n {\n withChildren: true,\n }\n);\n"],"names":[],"mappings":";;MAMa,aAAa,GAAuD,aAAa,CAC1F,eAAe,EACf,SAAS,EACT;AACI,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@hh.ru/magritte-ui-section-header",
3
+ "version": "1.1.0",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "sideEffects": [
7
+ "index.css"
8
+ ],
9
+ "scripts": {
10
+ "build": "yarn root:build $(pwd)",
11
+ "build-test-branch": "yarn root:build-test-branch $(pwd)",
12
+ "prepack": "yarn root:prepack $(pwd)",
13
+ "postpublish": "yarn root:postpublish $(pwd)",
14
+ "stylelint-check": "yarn root:stylelint-check $(pwd)",
15
+ "eslint-check": "yarn root:eslint-check $(pwd)",
16
+ "ts-config": "yarn root:ts-config $(pwd)",
17
+ "ts-check": "yarn root:ts-check $(pwd)",
18
+ "test": "exit 0",
19
+ "watch": "yarn root:watch $(pwd)"
20
+ },
21
+ "dependencies": {
22
+ "@hh.ru/magritte-design-tokens": "24.7.2",
23
+ "@hh.ru/magritte-ui-mock-component": "1.1.7",
24
+ "@hh.ru/magritte-ui-typography": "5.3.6"
25
+ },
26
+ "peerDependencies": {
27
+ "classnames": ">=2.3.2",
28
+ "react": ">=18.2.0"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "gitHead": "7c77ddb0fd8887722dc07c2ddf82ad1dc9618659"
34
+ }
package/types.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { TokenBaseStaticSpace } from '@hh.ru/magritte-design-tokens/types';
2
+ export interface SectionHeaderProps extends React.HTMLAttributes<HTMLDivElement>, React.PropsWithChildren {
3
+ /** Компонент <Link /> */
4
+ link?: React.ReactNode;
5
+ /** Горизонтальные отступы */
6
+ padding: Extract<TokenBaseStaticSpace, 0 | 12 | 16>;
7
+ }
package/types.js ADDED
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+
3
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}