@cloud-ru/ds-loader 1.0.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 (70) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +201 -0
  3. package/README.md +88 -0
  4. package/dist/cjs/components/Spinner/Spinner.d.ts +10 -0
  5. package/dist/cjs/components/Spinner/Spinner.js +20 -0
  6. package/dist/cjs/components/Spinner/constants.d.ts +17 -0
  7. package/dist/cjs/components/Spinner/constants.js +17 -0
  8. package/dist/cjs/components/Spinner/index.d.ts +1 -0
  9. package/dist/cjs/components/Spinner/index.js +17 -0
  10. package/dist/cjs/components/Spinner/styles.module.css +36 -0
  11. package/dist/cjs/components/Spinner/utils.d.ts +5 -0
  12. package/dist/cjs/components/Spinner/utils.js +20 -0
  13. package/dist/cjs/components/Sun/Sun.d.ts +10 -0
  14. package/dist/cjs/components/Sun/Sun.js +17 -0
  15. package/dist/cjs/components/Sun/constants.d.ts +18 -0
  16. package/dist/cjs/components/Sun/constants.js +26 -0
  17. package/dist/cjs/components/Sun/index.d.ts +1 -0
  18. package/dist/cjs/components/Sun/index.js +17 -0
  19. package/dist/cjs/components/Sun/styles.module.css +88 -0
  20. package/dist/cjs/components/constants.d.ts +13 -0
  21. package/dist/cjs/components/constants.js +16 -0
  22. package/dist/cjs/components/index.d.ts +4 -0
  23. package/dist/cjs/components/index.js +20 -0
  24. package/dist/cjs/components/types.d.ts +4 -0
  25. package/dist/cjs/components/types.js +2 -0
  26. package/dist/cjs/index.d.ts +1 -0
  27. package/dist/cjs/index.js +17 -0
  28. package/dist/cjs/package.json +3 -0
  29. package/dist/cjs/style.css +124 -0
  30. package/dist/esm/components/Spinner/Spinner.d.ts +10 -0
  31. package/dist/esm/components/Spinner/Spinner.js +14 -0
  32. package/dist/esm/components/Spinner/constants.d.ts +17 -0
  33. package/dist/esm/components/Spinner/constants.js +14 -0
  34. package/dist/esm/components/Spinner/index.d.ts +1 -0
  35. package/dist/esm/components/Spinner/index.js +1 -0
  36. package/dist/esm/components/Spinner/styles.module.css +36 -0
  37. package/dist/esm/components/Spinner/utils.d.ts +5 -0
  38. package/dist/esm/components/Spinner/utils.js +17 -0
  39. package/dist/esm/components/Sun/Sun.d.ts +10 -0
  40. package/dist/esm/components/Sun/Sun.js +11 -0
  41. package/dist/esm/components/Sun/constants.d.ts +18 -0
  42. package/dist/esm/components/Sun/constants.js +23 -0
  43. package/dist/esm/components/Sun/index.d.ts +1 -0
  44. package/dist/esm/components/Sun/index.js +1 -0
  45. package/dist/esm/components/Sun/styles.module.css +88 -0
  46. package/dist/esm/components/constants.d.ts +13 -0
  47. package/dist/esm/components/constants.js +13 -0
  48. package/dist/esm/components/index.d.ts +4 -0
  49. package/dist/esm/components/index.js +4 -0
  50. package/dist/esm/components/types.d.ts +4 -0
  51. package/dist/esm/components/types.js +1 -0
  52. package/dist/esm/index.d.ts +1 -0
  53. package/dist/esm/index.js +1 -0
  54. package/dist/esm/style.css +124 -0
  55. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  56. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  57. package/package.json +42 -0
  58. package/src/components/Spinner/Spinner.tsx +41 -0
  59. package/src/components/Spinner/constants.ts +26 -0
  60. package/src/components/Spinner/index.ts +1 -0
  61. package/src/components/Spinner/styles.module.scss +30 -0
  62. package/src/components/Spinner/utils.ts +21 -0
  63. package/src/components/Sun/Sun.tsx +60 -0
  64. package/src/components/Sun/constants.ts +25 -0
  65. package/src/components/Sun/index.ts +1 -0
  66. package/src/components/Sun/styles.module.scss +72 -0
  67. package/src/components/constants.ts +14 -0
  68. package/src/components/index.ts +4 -0
  69. package/src/components/types.ts +6 -0
  70. package/src/index.ts +1 -0
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUN_SIZE = exports.LOADER_SIZE = void 0;
4
+ exports.LOADER_SIZE = {
5
+ '2XS': '2xs',
6
+ XS: 'xs',
7
+ S: 's',
8
+ M: 'm',
9
+ L: 'l',
10
+ };
11
+ exports.SUN_SIZE = {
12
+ XS: 'xs',
13
+ S: 's',
14
+ M: 'm',
15
+ L: 'l',
16
+ };
@@ -0,0 +1,4 @@
1
+ export * from './constants';
2
+ export * from './Spinner';
3
+ export * from './Sun';
4
+ export * from './types';
@@ -0,0 +1,20 @@
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("./constants"), exports);
18
+ __exportStar(require("./Spinner"), exports);
19
+ __exportStar(require("./Sun"), exports);
20
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,4 @@
1
+ import { ValueOf } from '@cloud-ru/ds-utils';
2
+ import { LOADER_SIZE, SUN_SIZE } from './constants';
3
+ export type LoaderSize = ValueOf<typeof LOADER_SIZE>;
4
+ export type SunSize = ValueOf<typeof SUN_SIZE>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -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("./components"), exports);
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,124 @@
1
+ .spinner{
2
+ pointer-events:none;
3
+ stroke:currentcolor;
4
+ animation:spin 1s ease-in-out infinite;
5
+ }
6
+ .spinner > g > path{
7
+ fill:currentcolor;
8
+ }
9
+ .spinner > mask{
10
+ mask-type:alpha;
11
+ }
12
+ .spinner[data-size="2xs"]{
13
+ width:var(--sn-density-size-icon-2xs, var(--sn-primitive-dimension-16, 16px));
14
+ height:var(--sn-density-size-icon-2xs, var(--sn-primitive-dimension-16, 16px));
15
+ }
16
+ .spinner[data-size=xs]{
17
+ width:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
18
+ height:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
19
+ }
20
+ .spinner[data-size=s]{
21
+ width:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
22
+ height:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
23
+ }
24
+ .spinner[data-size=m]{
25
+ width:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
26
+ height:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
27
+ }
28
+ .spinner[data-size=l]{
29
+ width:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
30
+ height:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
31
+ }
32
+ @keyframes spin{
33
+ to{
34
+ transform:rotate(360deg);
35
+ }
36
+ }
37
+ .sun{
38
+ pointer-events:none;
39
+ fill:currentcolor;
40
+ }
41
+ .sun[data-size=xs]{
42
+ width:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
43
+ height:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
44
+ }
45
+ .sun[data-size=s]{
46
+ width:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
47
+ height:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
48
+ }
49
+ .sun[data-size=m]{
50
+ width:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
51
+ height:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
52
+ }
53
+ .sun[data-size=l]{
54
+ width:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
55
+ height:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
56
+ }
57
+ .sun > path{
58
+ stroke:currentcolor;
59
+ animation-name:loading-wheel;
60
+ animation-timing-function:linear;
61
+ animation-iteration-count:infinite;
62
+ }
63
+ .sun > path:nth-child(1){
64
+ animation-duration:1000ms;
65
+ animation-delay:0ms;
66
+ }
67
+ .sun > path:nth-child(2){
68
+ animation-duration:1000ms;
69
+ animation-delay:-125ms;
70
+ }
71
+ .sun > path:nth-child(3){
72
+ animation-duration:1000ms;
73
+ animation-delay:-250ms;
74
+ }
75
+ .sun > path:nth-child(4){
76
+ animation-duration:1000ms;
77
+ animation-delay:-375ms;
78
+ }
79
+ .sun > path:nth-child(5){
80
+ animation-duration:1000ms;
81
+ animation-delay:-500ms;
82
+ }
83
+ .sun > path:nth-child(6){
84
+ animation-duration:1000ms;
85
+ animation-delay:-625ms;
86
+ }
87
+ .sun > path:nth-child(7){
88
+ animation-duration:1000ms;
89
+ animation-delay:-750ms;
90
+ }
91
+ .sun > path:nth-child(8){
92
+ animation-duration:1000ms;
93
+ animation-delay:-875ms;
94
+ }
95
+
96
+ @keyframes loading-wheel{
97
+ 0%{
98
+ opacity:1;
99
+ }
100
+ 12.5%{
101
+ opacity:0.48;
102
+ }
103
+ 25%{
104
+ opacity:0.4;
105
+ }
106
+ 37.5%{
107
+ opacity:0.32;
108
+ }
109
+ 50%{
110
+ opacity:0.24;
111
+ }
112
+ 62.5%{
113
+ opacity:0.16;
114
+ }
115
+ 75%{
116
+ opacity:0.08;
117
+ }
118
+ 87.5%{
119
+ opacity:0.04;
120
+ }
121
+ 100%{
122
+ opacity:1;
123
+ }
124
+ }
@@ -0,0 +1,10 @@
1
+ import { WithSupportProps } from '@cloud-ru/ds-utils';
2
+ import { LoaderSize } from '../types.js';
3
+ export type SpinnerProps = WithSupportProps<{
4
+ /** Размер */
5
+ size?: LoaderSize;
6
+ /** CSS-класс */
7
+ className?: string;
8
+ }>;
9
+ /** Компонент спиннер */
10
+ export declare function Spinner({ size, className, ...rest }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { extractSupportProps } from '@cloud-ru/ds-utils';
3
+ import cn from 'classnames';
4
+ import { LOADER_SIZE } from '../constants.js';
5
+ import { SPINNER_GEOMETRY, SPINNER_TRACK_OPACITY } from './constants.js';
6
+ import styles from './styles.module.css';
7
+ import { buildQuarterArcPath } from './utils.js';
8
+ /** Компонент спиннер */
9
+ export function Spinner({ size = LOADER_SIZE.S, className, ...rest }) {
10
+ const { frame, ring, strokeWidth } = SPINNER_GEOMETRY[size];
11
+ const center = frame / 2;
12
+ const radius = ring / 2;
13
+ return (_jsxs("svg", { viewBox: `0 0 ${frame} ${frame}`, fill: 'none', xmlns: 'http://www.w3.org/2000/svg', className: cn(styles.spinner, className), ...extractSupportProps(rest), "data-size": size, children: [_jsx("circle", { opacity: SPINNER_TRACK_OPACITY, cx: center, cy: center, r: radius, strokeWidth: strokeWidth }), _jsx("path", { d: buildQuarterArcPath(center, radius), strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' })] }));
14
+ }
@@ -0,0 +1,17 @@
1
+ import { LoaderSize } from '../types.js';
2
+ type SpinnerGeometry = {
3
+ /** Сторона квадратного кадра — `viewBox` иконки */
4
+ frame: number;
5
+ /** Диаметр кольца по центру обводки */
6
+ ring: number;
7
+ /** Толщина обводки кольца и дуги */
8
+ strokeWidth: number;
9
+ };
10
+ /**
11
+ * Геометрия кольца по размерам — снята с мастера Figma `loader/loaderSpinner`
12
+ * (страница `loader`, узел `2918:21302`).
13
+ */
14
+ export declare const SPINNER_GEOMETRY: Record<LoaderSize, SpinnerGeometry>;
15
+ /** Прозрачность трека — кольца под вращающейся дугой */
16
+ export declare const SPINNER_TRACK_OPACITY = 0.24;
17
+ export {};
@@ -0,0 +1,14 @@
1
+ import { LOADER_SIZE } from '../constants.js';
2
+ /**
3
+ * Геометрия кольца по размерам — снята с мастера Figma `loader/loaderSpinner`
4
+ * (страница `loader`, узел `2918:21302`).
5
+ */
6
+ export const SPINNER_GEOMETRY = {
7
+ [LOADER_SIZE['2XS']]: { frame: 8, ring: 6, strokeWidth: 0.5 },
8
+ [LOADER_SIZE.XS]: { frame: 16, ring: 9, strokeWidth: 1.25 },
9
+ [LOADER_SIZE.S]: { frame: 24, ring: 13, strokeWidth: 1.5 },
10
+ [LOADER_SIZE.M]: { frame: 32, ring: 20, strokeWidth: 2 },
11
+ [LOADER_SIZE.L]: { frame: 40, ring: 30, strokeWidth: 2.5 },
12
+ };
13
+ /** Прозрачность трека — кольца под вращающейся дугой */
14
+ export const SPINNER_TRACK_OPACITY = 0.24;
@@ -0,0 +1 @@
1
+ export * from './Spinner.js';
@@ -0,0 +1 @@
1
+ export * from './Spinner.js';
@@ -0,0 +1,36 @@
1
+ .spinner{
2
+ pointer-events:none;
3
+ stroke:currentcolor;
4
+ animation:spin 1s ease-in-out infinite;
5
+ }
6
+ .spinner > g > path{
7
+ fill:currentcolor;
8
+ }
9
+ .spinner > mask{
10
+ mask-type:alpha;
11
+ }
12
+ .spinner[data-size="2xs"]{
13
+ width:var(--sn-density-size-icon-2xs, var(--sn-primitive-dimension-16, 16px));
14
+ height:var(--sn-density-size-icon-2xs, var(--sn-primitive-dimension-16, 16px));
15
+ }
16
+ .spinner[data-size=xs]{
17
+ width:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
18
+ height:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
19
+ }
20
+ .spinner[data-size=s]{
21
+ width:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
22
+ height:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
23
+ }
24
+ .spinner[data-size=m]{
25
+ width:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
26
+ height:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
27
+ }
28
+ .spinner[data-size=l]{
29
+ width:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
30
+ height:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
31
+ }
32
+ @keyframes spin{
33
+ to{
34
+ transform:rotate(360deg);
35
+ }
36
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Путь четверти окружности — от левой точки кольца к верхней, против часовой стрелки.
3
+ * Так дуга спиннера повторяет `ToneAlpha1` из мастера Figma.
4
+ */
5
+ export declare function buildQuarterArcPath(center: number, radius: number): string;
@@ -0,0 +1,17 @@
1
+ /** Отношение длины контрольного плеча к радиусу для четверти окружности, заданной кубической кривой Безье */
2
+ const QUARTER_ARC_HANDLE_RATIO = 0.5522847498;
3
+ function format(value) {
4
+ return String(Number(value.toFixed(5)));
5
+ }
6
+ /**
7
+ * Путь четверти окружности — от левой точки кольца к верхней, против часовой стрелки.
8
+ * Так дуга спиннера повторяет `ToneAlpha1` из мастера Figma.
9
+ */
10
+ export function buildQuarterArcPath(center, radius) {
11
+ const handle = radius * QUARTER_ARC_HANDLE_RATIO;
12
+ const start = `${format(center - radius)} ${format(center)}`;
13
+ const firstControl = `${format(center - radius)} ${format(center - handle)}`;
14
+ const secondControl = `${format(center - handle)} ${format(center - radius)}`;
15
+ const end = `${format(center)} ${format(center - radius)}`;
16
+ return `M${start}C${firstControl} ${secondControl} ${end}`;
17
+ }
@@ -0,0 +1,10 @@
1
+ import { WithSupportProps } from '@cloud-ru/ds-utils';
2
+ import { SunSize } from '../types.js';
3
+ export type SunProps = WithSupportProps<{
4
+ /** Размер */
5
+ size?: SunSize;
6
+ /** CSS-класс */
7
+ className?: string;
8
+ }>;
9
+ /** Компонент спиннер */
10
+ export declare function Sun({ size, className, ...rest }: SunProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { extractSupportProps } from '@cloud-ru/ds-utils';
3
+ import cn from 'classnames';
4
+ import { LOADER_SIZE } from '../constants.js';
5
+ import { SUN_STROKE_WIDTH } from './constants.js';
6
+ import styles from './styles.module.css';
7
+ /** Компонент спиннер */
8
+ export function Sun({ size = LOADER_SIZE.S, className, ...rest }) {
9
+ const strokeWidth = SUN_STROKE_WIDTH[size];
10
+ return (_jsxs("svg", { viewBox: '0 0 24 24', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', id: 'SunSVG', className: cn(styles.sun, className), ...extractSupportProps(rest), "data-size": size, children: [_jsx("path", { d: 'M12 4V7', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M6.34302 6.34314L8.46434 8.46446', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M4 12L7 12', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M6.34302 17.6569L8.46434 15.5355', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M12 17V20', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M15.5354 15.5355L17.6567 17.6568', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M17 12L20 12', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' }), _jsx("path", { d: 'M15.5354 8.46448L17.6567 6.34316', strokeWidth: strokeWidth, strokeLinecap: 'round', strokeLinejoin: 'round' })] }));
11
+ }
@@ -0,0 +1,18 @@
1
+ import { SunSize } from '../types.js';
2
+ /**
3
+ * Толщина луча по размерам, в единицах `viewBox` (кадр 24 у всех размеров).
4
+ *
5
+ * Пути солнца нарисованы в кадре 24, а сам `<svg>` масштабируется CSS'ом до размера
6
+ * иконки — значит видимая толщина равна `strokeWidth × размер / 24`. Поэтому число
7
+ * здесь пересчитано от эталона Figma, а не взято из макета напрямую:
8
+ *
9
+ * | размер | иконка | эталон Figma | `strokeWidth` |
10
+ * |--------|--------|--------------|---------------|
11
+ * | `xs` | 16 | 1.25 | 1.875 |
12
+ * | `s` | 24 | 1.5 | 1.5 |
13
+ * | `m` | 32 | 2 | 1.5 |
14
+ * | `l` | 40 | 2.5 | 1.5 |
15
+ *
16
+ * Без этой карты толщина выводилась из масштаба и при `xs` давала 1.0 вместо 1.25.
17
+ */
18
+ export declare const SUN_STROKE_WIDTH: Record<SunSize, number>;
@@ -0,0 +1,23 @@
1
+ import { SUN_SIZE } from '../constants.js';
2
+ /**
3
+ * Толщина луча по размерам, в единицах `viewBox` (кадр 24 у всех размеров).
4
+ *
5
+ * Пути солнца нарисованы в кадре 24, а сам `<svg>` масштабируется CSS'ом до размера
6
+ * иконки — значит видимая толщина равна `strokeWidth × размер / 24`. Поэтому число
7
+ * здесь пересчитано от эталона Figma, а не взято из макета напрямую:
8
+ *
9
+ * | размер | иконка | эталон Figma | `strokeWidth` |
10
+ * |--------|--------|--------------|---------------|
11
+ * | `xs` | 16 | 1.25 | 1.875 |
12
+ * | `s` | 24 | 1.5 | 1.5 |
13
+ * | `m` | 32 | 2 | 1.5 |
14
+ * | `l` | 40 | 2.5 | 1.5 |
15
+ *
16
+ * Без этой карты толщина выводилась из масштаба и при `xs` давала 1.0 вместо 1.25.
17
+ */
18
+ export const SUN_STROKE_WIDTH = {
19
+ [SUN_SIZE.XS]: 1.875,
20
+ [SUN_SIZE.S]: 1.5,
21
+ [SUN_SIZE.M]: 1.5,
22
+ [SUN_SIZE.L]: 1.5,
23
+ };
@@ -0,0 +1 @@
1
+ export * from './Sun.js';
@@ -0,0 +1 @@
1
+ export * from './Sun.js';
@@ -0,0 +1,88 @@
1
+ .sun{
2
+ pointer-events:none;
3
+ fill:currentcolor;
4
+ }
5
+ .sun[data-size=xs]{
6
+ width:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
7
+ height:var(--sn-density-size-icon-xs, var(--sn-primitive-dimension-24, 24px));
8
+ }
9
+ .sun[data-size=s]{
10
+ width:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
11
+ height:var(--sn-density-size-icon-s, var(--sn-primitive-dimension-24, 24px));
12
+ }
13
+ .sun[data-size=m]{
14
+ width:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
15
+ height:var(--sn-density-size-icon-m, var(--sn-primitive-dimension-32, 32px));
16
+ }
17
+ .sun[data-size=l]{
18
+ width:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
19
+ height:var(--sn-density-size-icon-l, var(--sn-primitive-dimension-40, 40px));
20
+ }
21
+ .sun > path{
22
+ stroke:currentcolor;
23
+ animation-name:loading-wheel;
24
+ animation-timing-function:linear;
25
+ animation-iteration-count:infinite;
26
+ }
27
+ .sun > path:nth-child(1){
28
+ animation-duration:1000ms;
29
+ animation-delay:0ms;
30
+ }
31
+ .sun > path:nth-child(2){
32
+ animation-duration:1000ms;
33
+ animation-delay:-125ms;
34
+ }
35
+ .sun > path:nth-child(3){
36
+ animation-duration:1000ms;
37
+ animation-delay:-250ms;
38
+ }
39
+ .sun > path:nth-child(4){
40
+ animation-duration:1000ms;
41
+ animation-delay:-375ms;
42
+ }
43
+ .sun > path:nth-child(5){
44
+ animation-duration:1000ms;
45
+ animation-delay:-500ms;
46
+ }
47
+ .sun > path:nth-child(6){
48
+ animation-duration:1000ms;
49
+ animation-delay:-625ms;
50
+ }
51
+ .sun > path:nth-child(7){
52
+ animation-duration:1000ms;
53
+ animation-delay:-750ms;
54
+ }
55
+ .sun > path:nth-child(8){
56
+ animation-duration:1000ms;
57
+ animation-delay:-875ms;
58
+ }
59
+
60
+ @keyframes loading-wheel{
61
+ 0%{
62
+ opacity:1;
63
+ }
64
+ 12.5%{
65
+ opacity:0.48;
66
+ }
67
+ 25%{
68
+ opacity:0.4;
69
+ }
70
+ 37.5%{
71
+ opacity:0.32;
72
+ }
73
+ 50%{
74
+ opacity:0.24;
75
+ }
76
+ 62.5%{
77
+ opacity:0.16;
78
+ }
79
+ 75%{
80
+ opacity:0.08;
81
+ }
82
+ 87.5%{
83
+ opacity:0.04;
84
+ }
85
+ 100%{
86
+ opacity:1;
87
+ }
88
+ }
@@ -0,0 +1,13 @@
1
+ export declare const LOADER_SIZE: {
2
+ readonly '2XS': "2xs";
3
+ readonly XS: "xs";
4
+ readonly S: "s";
5
+ readonly M: "m";
6
+ readonly L: "l";
7
+ };
8
+ export declare const SUN_SIZE: {
9
+ readonly XS: "xs";
10
+ readonly S: "s";
11
+ readonly M: "m";
12
+ readonly L: "l";
13
+ };
@@ -0,0 +1,13 @@
1
+ export const LOADER_SIZE = {
2
+ '2XS': '2xs',
3
+ XS: 'xs',
4
+ S: 's',
5
+ M: 'm',
6
+ L: 'l',
7
+ };
8
+ export const SUN_SIZE = {
9
+ XS: 'xs',
10
+ S: 's',
11
+ M: 'm',
12
+ L: 'l',
13
+ };
@@ -0,0 +1,4 @@
1
+ export * from './constants.js';
2
+ export * from './Spinner/index.js';
3
+ export * from './Sun/index.js';
4
+ export * from './types.js';
@@ -0,0 +1,4 @@
1
+ export * from './constants.js';
2
+ export * from './Spinner/index.js';
3
+ export * from './Sun/index.js';
4
+ export * from './types.js';
@@ -0,0 +1,4 @@
1
+ import { ValueOf } from '@cloud-ru/ds-utils';
2
+ import { LOADER_SIZE, SUN_SIZE } from './constants.js';
3
+ export type LoaderSize = ValueOf<typeof LOADER_SIZE>;
4
+ export type SunSize = ValueOf<typeof SUN_SIZE>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './components/index.js';
@@ -0,0 +1 @@
1
+ export * from './components/index.js';