@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.
- package/SectionHeader.d.ts +2 -0
- package/SectionHeader.js +15 -0
- package/SectionHeader.js.map +1 -0
- package/index.css +7 -0
- package/index.d.ts +2 -0
- package/index.js +7 -0
- package/index.js.map +1 -0
- package/index.mock.d.ts +3 -0
- package/index.mock.js +9 -0
- package/index.mock.js.map +1 -0
- package/package.json +34 -0
- package/types.d.ts +7 -0
- package/types.js +3 -0
- package/types.js.map +1 -0
package/SectionHeader.js
ADDED
|
@@ -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
package/index.d.ts
ADDED
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/index.mock.d.ts
ADDED
package/index.mock.js
ADDED
|
@@ -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
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|