@hh.ru/magritte-ui-loader 1.2.35
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/Loader.d.ts +3 -0
- package/Loader.js +29 -0
- package/Loader.js.map +1 -0
- package/index.css +29 -0
- package/index.d.ts +3 -0
- package/index.js +7 -0
- package/index.js.map +1 -0
- package/index.mock.d.ts +2 -0
- package/index.mock.js +7 -0
- package/index.mock.js.map +1 -0
- package/package.json +34 -0
- package/types.d.ts +9 -0
- package/types.js +3 -0
- package/types.js.map +1 -0
package/Loader.d.ts
ADDED
package/Loader.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { LoaderOutlinedSize16, LoaderOutlinedSize24, LoaderOutlinedSize64, LoaderOutlinedSize96 } from '@hh.ru/magritte-ui-icon/icon';
|
|
5
|
+
|
|
6
|
+
var styles = {"loader":"magritte-loader___GSe1a_1-2-35","spin":"magritte-spin___DyLX-_1-2-35","internal_overriden":"magritte-internal_overriden___GcH9X_1-2-35","internalOverriden":"magritte-internal_overriden___GcH9X_1-2-35"};
|
|
7
|
+
|
|
8
|
+
const iconsBySize = new Map([
|
|
9
|
+
[16, LoaderOutlinedSize16],
|
|
10
|
+
[24, LoaderOutlinedSize24],
|
|
11
|
+
[64, LoaderOutlinedSize64],
|
|
12
|
+
[96, LoaderOutlinedSize96],
|
|
13
|
+
]);
|
|
14
|
+
const Loader = ({ size = 16, 'aria-label': ariaLabel = 'loading', ...props }) => {
|
|
15
|
+
const Element = iconsBySize.get(size);
|
|
16
|
+
if (!Element) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const baseProps = {
|
|
20
|
+
'aria-label': ariaLabel,
|
|
21
|
+
...props,
|
|
22
|
+
};
|
|
23
|
+
return (jsx("span", { className: classNames(styles.loader, {
|
|
24
|
+
[styles.internal_overriden]: !props.initial,
|
|
25
|
+
}), role: "status", children: jsx(Element, { ...baseProps }) }));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { Loader };
|
|
29
|
+
//# sourceMappingURL=Loader.js.map
|
package/Loader.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader.js","sources":["../src/Loader.tsx"],"sourcesContent":["import { FC } from 'react';\nimport classNames from 'classnames';\n\nimport {\n LoaderOutlinedSize16,\n LoaderOutlinedSize24,\n LoaderOutlinedSize64,\n LoaderOutlinedSize96,\n} from '@hh.ru/magritte-ui-icon/icon';\nimport { IconWrapperComponent } from '@hh.ru/magritte-ui-icon/src';\nimport { type LoaderSize, type LoaderProps } from '@hh.ru/magritte-ui-loader/types';\n\nimport styles from './loader.less';\n\nconst iconsBySize = new Map<LoaderSize, IconWrapperComponent>([\n [16, LoaderOutlinedSize16],\n [24, LoaderOutlinedSize24],\n [64, LoaderOutlinedSize64],\n [96, LoaderOutlinedSize96],\n]);\n\nexport const Loader: FC<LoaderProps> = ({ size = 16, 'aria-label': ariaLabel = 'loading', ...props }) => {\n const Element = iconsBySize.get(size);\n\n if (!Element) {\n return null;\n }\n\n const baseProps = {\n 'aria-label': ariaLabel,\n ...props,\n };\n\n return (\n <span\n className={classNames(styles.loader, {\n [styles.internal_overriden]: !props.initial,\n })}\n role=\"status\"\n >\n <Element {...baseProps} />\n </span>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAcA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAmC;IAC1D,CAAC,EAAE,EAAE,oBAAoB,CAAC;IAC1B,CAAC,EAAE,EAAE,oBAAoB,CAAC;IAC1B,CAAC,EAAE,EAAE,oBAAoB,CAAC;IAC1B,CAAC,EAAE,EAAE,oBAAoB,CAAC;AAC7B,CAAA,CAAC,CAAC;MAEU,MAAM,GAAoB,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,YAAY,EAAE,SAAS,GAAG,SAAS,EAAE,GAAG,KAAK,EAAE,KAAI;IACpG,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEtC,IAAI,CAAC,OAAO,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AAED,IAAA,MAAM,SAAS,GAAG;AACd,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,GAAG,KAAK;KACX,CAAC;IAEF,QACIA,cACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE;YACjC,CAAC,MAAM,CAAC,kBAAkB,GAAG,CAAC,KAAK,CAAC,OAAO;AAC9C,SAAA,CAAC,EACF,IAAI,EAAC,QAAQ,EAEb,QAAA,EAAAA,GAAA,CAAC,OAAO,EAAA,EAAA,GAAK,SAAS,EAAA,CAAI,EACvB,CAAA,EACT;AACN;;;;"}
|
package/index.css
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
:root{
|
|
2
|
+
--magritte-color-component-loader-icon-content-v18-1-1:#0070ff;
|
|
3
|
+
}
|
|
4
|
+
.magritte-night-theme{
|
|
5
|
+
--magritte-color-component-loader-icon-content-v18-1-1:#0d63e3;
|
|
6
|
+
}
|
|
7
|
+
@keyframes magritte-spin___DyLX-_1-2-35{
|
|
8
|
+
from{
|
|
9
|
+
transform:rotate(0deg);
|
|
10
|
+
}
|
|
11
|
+
to{
|
|
12
|
+
transform:rotate(360deg);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
.magritte-loader___GSe1a_1-2-35{
|
|
16
|
+
display:inline-flex;
|
|
17
|
+
height:max-content;
|
|
18
|
+
width:max-content;
|
|
19
|
+
}
|
|
20
|
+
.magritte-loader___GSe1a_1-2-35 svg{
|
|
21
|
+
animation-name:magritte-spin___DyLX-_1-2-35;
|
|
22
|
+
animation-duration:1s;
|
|
23
|
+
animation-iteration-count:infinite;
|
|
24
|
+
animation-timing-function:linear;
|
|
25
|
+
animation-fill-mode:none;
|
|
26
|
+
}
|
|
27
|
+
.magritte-internal_overriden___GcH9X_1-2-35{
|
|
28
|
+
--magritte-ui-icon-color-override:var(--magritte-color-component-loader-icon-content-v18-1-1);
|
|
29
|
+
}
|
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 const Loader: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('Loader');\n"],"names":[],"mappings":";;MAIa,MAAM,GAAuD,aAAa,CAAC,QAAQ;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hh.ru/magritte-ui-loader",
|
|
3
|
+
"version": "1.2.35",
|
|
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
|
+
"changelog": "yarn root:changelog $(pwd)",
|
|
13
|
+
"prepack": "yarn root:prepack $(pwd)",
|
|
14
|
+
"postpublish": "yarn root:postpublish $(pwd)",
|
|
15
|
+
"stylelint-test": "yarn root:stylelint-test $(pwd)",
|
|
16
|
+
"eslint-test": "yarn root:eslint-test $(pwd)",
|
|
17
|
+
"ts-config": "yarn root:ts-config $(pwd)",
|
|
18
|
+
"ts-check": "yarn root:ts-check $(pwd)",
|
|
19
|
+
"test": "yarn root:test $(pwd)"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@hh.ru/magritte-design-tokens": "18.1.1",
|
|
23
|
+
"@hh.ru/magritte-ui-icon": "7.1.3",
|
|
24
|
+
"@hh.ru/magritte-ui-mock-component": "1.0.10"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"classnames": ">=2.3.2",
|
|
28
|
+
"react": ">=18.2.0"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"gitHead": "b660dd64fca3eaad5ec44ea9a73f92bb0d9694aa"
|
|
34
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IconColor } from '@hh.ru/magritte-ui-icon/icon';
|
|
2
|
+
export type LoaderSize = 16 | 24 | 64 | 96;
|
|
3
|
+
export interface LoaderProps {
|
|
4
|
+
/** Свойство для изменения размеров SVG-иконки */
|
|
5
|
+
size?: LoaderSize;
|
|
6
|
+
/** Цвет иконки */
|
|
7
|
+
initial?: IconColor;
|
|
8
|
+
'aria-label'?: string;
|
|
9
|
+
}
|
package/types.js
ADDED
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|