@koslibs/components 1.9.0 → 1.11.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/CHANGELOG.md +12 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/index.js +1 -0
- package/dist/components/Skeleton/index.module.js +7 -0
- package/dist/components/Skeleton/index_module.css +26 -0
- package/dist/components/Skeleton/skeleton.d.ts +5 -0
- package/dist/components/Skeleton/skeleton.js +14 -0
- package/dist/components/Skeleton/types.d.ts +16 -0
- package/dist/components/Skeleton/types.js +0 -0
- package/dist/components/Skeleton/vars.css +6 -0
- package/dist/components/Space/index.d.ts +2 -0
- package/dist/components/Space/index.js +1 -0
- package/dist/components/Space/index.module.js +14 -0
- package/dist/components/Space/index_module.css +46 -0
- package/dist/components/Space/space.d.ts +9 -0
- package/dist/components/Space/space.js +23 -0
- package/dist/components/Space/types.d.ts +40 -0
- package/dist/components/Space/types.js +0 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @koslibs/components
|
|
2
2
|
|
|
3
|
+
## 1.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#12](https://github.com/koslibs/components/pull/12) [`563c38f`](https://github.com/koslibs/components/commit/563c38f0dcaf306c4993e50d5e7f5e4ddd44368d) Thanks [@holypower777](https://github.com/holypower777)! - Добавлен Skeleton: CSS-пульсация с управлением через animated, настраиваемые размеры и скругление через стили, CSS-переменные фона, радиуса и длительности. Доступны ref, нативные атрибуты div, dataTestId, Storybook Docs и Playground.
|
|
8
|
+
|
|
9
|
+
## 1.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#11](https://github.com/koslibs/components/pull/11) [`85e4c4b`](https://github.com/koslibs/components/commit/85e4c4b523847d339a773b63fcf7916098f28327) Thanks [@holypower777](https://github.com/holypower777)! - Добавлен Space для горизонтальной и вертикальной раскладки: обязательные size и children, единый положительный отступ из --size-\*, align, wrap и fullWidth. Компонент использует CSS gap, сохраняет прямые дочерние элементы и доступен через @koslibs/components/Space. Добавлены Storybook Docs и Playground.
|
|
14
|
+
|
|
3
15
|
## 1.9.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Skeleton } from "./skeleton.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import "./vars.css";
|
|
2
|
+
|
|
3
|
+
.component-dYdUkS {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
border-radius: var(--skeleton-border-radius);
|
|
6
|
+
background-color: var(--skeleton-background-color);
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.animated-RXyKCh {
|
|
14
|
+
animation: pulse-Qjbi05 var(--skeleton-animation-duration) ease-in-out infinite;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes pulse-Qjbi05 {
|
|
18
|
+
0%, 100% {
|
|
19
|
+
opacity: 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
50% {
|
|
23
|
+
opacity: .45;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Skeleton: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML"> & {
|
|
2
|
+
animated?: boolean;
|
|
3
|
+
children?: never;
|
|
4
|
+
dataTestId?: string;
|
|
5
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import index_module from "./index.module.js";
|
|
5
|
+
const Skeleton = /*#__PURE__*/ forwardRef(({ animated = true, className, dataTestId, ...restProps }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
6
|
+
...restProps,
|
|
7
|
+
ref: ref,
|
|
8
|
+
className: classnames(index_module.component, {
|
|
9
|
+
[index_module.animated]: animated
|
|
10
|
+
}, className),
|
|
11
|
+
"data-test-id": dataTestId
|
|
12
|
+
}));
|
|
13
|
+
Skeleton.displayName = 'Skeleton';
|
|
14
|
+
export { Skeleton };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type SkeletonProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Включает пульсацию.
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
animated?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Skeleton не содержит дочерних элементов.
|
|
10
|
+
*/
|
|
11
|
+
children?: never;
|
|
12
|
+
/**
|
|
13
|
+
* Идентификатор корневого элемента для тестов.
|
|
14
|
+
*/
|
|
15
|
+
dataTestId?: string;
|
|
16
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Space } from "./space.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./index_module.css";
|
|
2
|
+
const index_module = {
|
|
3
|
+
component: "component-DK13jr",
|
|
4
|
+
vertical: "vertical-MuaZ3s",
|
|
5
|
+
horizontal: "horizontal-GVxqs5",
|
|
6
|
+
start: "start-bYNz01",
|
|
7
|
+
center: "center-PS6vZJ",
|
|
8
|
+
end: "end-KbDlui",
|
|
9
|
+
stretch: "stretch-WhVrSc",
|
|
10
|
+
baseline: "baseline-mcTNmk",
|
|
11
|
+
wrap: "wrap-Ad0xGu",
|
|
12
|
+
fullWidth: "fullWidth-c7M8Hd"
|
|
13
|
+
};
|
|
14
|
+
export default index_module;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@import "../../styles/variables.css";
|
|
2
|
+
|
|
3
|
+
.component-DK13jr {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
gap: var(--space-gap);
|
|
6
|
+
min-width: 0;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.vertical-MuaZ3s {
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.horizontal-GVxqs5 {
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.start-bYNz01 {
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.center-PS6vZJ {
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.end-KbDlui {
|
|
27
|
+
align-items: flex-end;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.stretch-WhVrSc {
|
|
31
|
+
align-items: stretch;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.baseline-mcTNmk {
|
|
35
|
+
align-items: baseline;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.wrap-Ad0xGu {
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.fullWidth-c7M8Hd {
|
|
43
|
+
width: 100%;
|
|
44
|
+
display: flex;
|
|
45
|
+
}
|
|
46
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const Space: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
2
|
+
children: import("react").ReactNode;
|
|
3
|
+
direction?: "horizontal" | "vertical";
|
|
4
|
+
size: import("./types.js").SpaceSize;
|
|
5
|
+
align?: "start" | "center" | "end" | "stretch" | "baseline";
|
|
6
|
+
wrap?: boolean;
|
|
7
|
+
fullWidth?: boolean;
|
|
8
|
+
dataTestId?: string;
|
|
9
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import { Children, forwardRef } from "react";
|
|
4
|
+
import index_module from "./index.module.js";
|
|
5
|
+
const Space = /*#__PURE__*/ forwardRef(({ children, direction = 'vertical', size, align = 'start', wrap = false, fullWidth = false, className, style, dataTestId, ...restProps }, ref)=>{
|
|
6
|
+
if (0 === Children.toArray(children).length) return null;
|
|
7
|
+
return /*#__PURE__*/ jsx("div", {
|
|
8
|
+
...restProps,
|
|
9
|
+
ref: ref,
|
|
10
|
+
className: classnames(index_module.component, index_module[direction], index_module[align], {
|
|
11
|
+
[index_module.wrap]: wrap,
|
|
12
|
+
[index_module.fullWidth]: fullWidth
|
|
13
|
+
}, className),
|
|
14
|
+
style: {
|
|
15
|
+
'--space-gap': `var(--size-${size})`,
|
|
16
|
+
...style
|
|
17
|
+
},
|
|
18
|
+
"data-test-id": dataTestId,
|
|
19
|
+
children: children
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
Space.displayName = 'Space';
|
|
23
|
+
export { Space };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Положительный отступ из общей шкалы --size-*.
|
|
4
|
+
*/
|
|
5
|
+
export type SpaceSize = 2 | 4 | 6 | 8 | 12 | 16 | 20 | 22 | 24 | 28 | 30 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 72 | 80 | 96 | 128;
|
|
6
|
+
export type SpaceProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
7
|
+
/**
|
|
8
|
+
* Элементы раскладки. Отображаются без дополнительных обёрток.
|
|
9
|
+
*/
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Направление раскладки.
|
|
13
|
+
* @default 'vertical'
|
|
14
|
+
*/
|
|
15
|
+
direction?: 'horizontal' | 'vertical';
|
|
16
|
+
/**
|
|
17
|
+
* Единый отступ между элементами и строками.
|
|
18
|
+
* Обязательное положительное значение из глобальной шкалы --size-*.
|
|
19
|
+
*/
|
|
20
|
+
size: SpaceSize;
|
|
21
|
+
/**
|
|
22
|
+
* Выравнивание по поперечной оси относительно direction.
|
|
23
|
+
* @default 'start'
|
|
24
|
+
*/
|
|
25
|
+
align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
26
|
+
/**
|
|
27
|
+
* Разрешает перенос элементов на следующую строку или колонку.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
wrap?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Растягивает контейнер на всю ширину родителя.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
fullWidth?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Идентификатор корневого элемента для тестов.
|
|
38
|
+
*/
|
|
39
|
+
dataTestId?: string;
|
|
40
|
+
};
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -10,8 +10,12 @@ export { Tab, Tabs } from './components/Tabs/index.js';
|
|
|
10
10
|
export type { TabProps, TabsProps } from './components/Tabs/index.js';
|
|
11
11
|
export { Spinner } from './components/Spinner/index.js';
|
|
12
12
|
export type { SpinnerProps } from './components/Spinner/index.js';
|
|
13
|
+
export { Skeleton } from './components/Skeleton/index.js';
|
|
14
|
+
export type { SkeletonProps } from './components/Skeleton/index.js';
|
|
13
15
|
export { Status } from './components/Status/index.js';
|
|
14
16
|
export type { StatusProps } from './components/Status/index.js';
|
|
17
|
+
export { Space } from './components/Space/index.js';
|
|
18
|
+
export type { SpaceProps, SpaceSize } from './components/Space/index.js';
|
|
15
19
|
export { Typography, TypographyText, TypographyTitle, Text, Title } from './components/Typography/index.js';
|
|
16
20
|
export type { TextProps, TitleProps, TypographyColor, TypographyWeight, } from './components/Typography/index.js';
|
|
17
21
|
export { Popover } from './components/Popover/index.js';
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,9 @@ export { Select } from "./components/Select/index.js";
|
|
|
4
4
|
export { Textarea } from "./components/Textarea/index.js";
|
|
5
5
|
export { Tab, Tabs } from "./components/Tabs/index.js";
|
|
6
6
|
export { Spinner } from "./components/Spinner/index.js";
|
|
7
|
+
export { Skeleton } from "./components/Skeleton/index.js";
|
|
7
8
|
export { Status } from "./components/Status/index.js";
|
|
9
|
+
export { Space } from "./components/Space/index.js";
|
|
8
10
|
export { Text, Title, Typography, TypographyText, TypographyTitle } from "./components/Typography/index.js";
|
|
9
11
|
export { Popover } from "./components/Popover/index.js";
|
|
10
12
|
export { Collapse } from "./components/Collapse/index.js";
|