armtek-uikit-react 1.0.60 → 1.0.62
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/assets/ButtonIcon.scss +1 -0
- package/assets/ListItem.scss +4 -0
- package/assets/Skeleton.scss +21 -0
- package/package.json +1 -1
- package/ui/List/ListItem.d.ts +5 -3
- package/ui/List/ListItem.js +5 -3
- package/ui/Skeleton/Skeleton.d.ts +8 -0
- package/ui/Skeleton/Skeleton.js +23 -0
- package/ui/Skeleton/Skeleton.module.scss +1 -0
- package/ui/Skeleton/index.d.ts +2 -0
- package/ui/Skeleton/index.js +2 -0
- package/ui/Table/Table.d.ts +2 -2
- package/ui/Table/Table.js +2 -0
- package/ui/Table/index.d.ts +1 -1
package/assets/ButtonIcon.scss
CHANGED
package/assets/ListItem.scss
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@import "variables";
|
|
2
|
+
|
|
3
|
+
.skeleton{
|
|
4
|
+
background-color: $color-gray-100;
|
|
5
|
+
animation: shine-lines 1.6s infinite linear;
|
|
6
|
+
opacity: 0;
|
|
7
|
+
}
|
|
8
|
+
.skeleton_circle{
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
}
|
|
11
|
+
@keyframes shine-lines {
|
|
12
|
+
0% {
|
|
13
|
+
opacity: 0.5;
|
|
14
|
+
}
|
|
15
|
+
50% {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
100% {
|
|
19
|
+
opacity: 0.5;
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.62","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
package/ui/List/ListItem.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export type
|
|
1
|
+
import { ButtonHTMLAttributes, ComponentPropsWithoutRef, ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type OwnProps<T extends ElementType = ElementType> = {
|
|
3
3
|
active?: boolean;
|
|
4
4
|
checked?: boolean;
|
|
5
5
|
divider?: boolean;
|
|
6
6
|
endAdornment?: string | ReactNode;
|
|
7
7
|
startAdornment?: string | ReactNode;
|
|
8
|
+
as?: T;
|
|
8
9
|
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
9
|
-
|
|
10
|
+
type ListItemProps<T extends ElementType = ElementType<HTMLAttributes<HTMLButtonElement>>> = OwnProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof OwnProps>;
|
|
11
|
+
declare function ListItem<T extends ElementType>(props: ListItemProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export default ListItem;
|
package/ui/List/ListItem.js
CHANGED
|
@@ -9,7 +9,7 @@ const CssClasses = ['listitem', 'listitem_active', 'listitem_divider', 'listitem
|
|
|
9
9
|
|
|
10
10
|
// const css = getCssPrefix(CssClasses)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function ListItem(props) {
|
|
13
13
|
let {
|
|
14
14
|
children,
|
|
15
15
|
className,
|
|
@@ -19,11 +19,13 @@ const ListItem = props => {
|
|
|
19
19
|
checked,
|
|
20
20
|
startAdornment,
|
|
21
21
|
endAdornment,
|
|
22
|
+
as,
|
|
22
23
|
...restProps
|
|
23
24
|
} = props;
|
|
24
25
|
let withStartAdornment = checked !== undefined || !!startAdornment;
|
|
26
|
+
let Component = as || 'button';
|
|
25
27
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
26
|
-
children: /*#__PURE__*/_jsxs(
|
|
28
|
+
children: /*#__PURE__*/_jsxs(Component, {
|
|
27
29
|
...restProps,
|
|
28
30
|
className: clsx(css.listitem, className, {
|
|
29
31
|
[css.listitem_active]: !!active || !!checked,
|
|
@@ -65,5 +67,5 @@ const ListItem = props => {
|
|
|
65
67
|
})]
|
|
66
68
|
})
|
|
67
69
|
});
|
|
68
|
-
}
|
|
70
|
+
}
|
|
69
71
|
export default ListItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type SkeletonProps = {
|
|
3
|
+
width: number | string;
|
|
4
|
+
height: number | string;
|
|
5
|
+
circle?: boolean;
|
|
6
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
7
|
+
declare const Skeleton: (props: SkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Skeleton;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import css from "./Skeleton.module.scss";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const Skeleton = props => {
|
|
5
|
+
const {
|
|
6
|
+
width,
|
|
7
|
+
height,
|
|
8
|
+
className,
|
|
9
|
+
circle,
|
|
10
|
+
...divProps
|
|
11
|
+
} = props;
|
|
12
|
+
return /*#__PURE__*/_jsx("div", {
|
|
13
|
+
...divProps,
|
|
14
|
+
className: clsx(className, css.skeleton, {
|
|
15
|
+
[css.skeleton_circle]: !!circle
|
|
16
|
+
}),
|
|
17
|
+
style: {
|
|
18
|
+
width: typeof width === 'number' ? width + 'px' : width,
|
|
19
|
+
height: typeof height === 'number' ? height + 'px' : height
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export default Skeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "../../assets/Skeleton";
|
package/ui/Table/Table.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ type ItemType = Record<string, any>;
|
|
|
3
3
|
type ClassesType<T extends ItemType> = {
|
|
4
4
|
tableRowHead?: string;
|
|
5
5
|
tableRow?: string | ((item: T) => string);
|
|
6
|
+
tableCell?: string | ((item: T, code: keyof T) => string);
|
|
6
7
|
tableCellHead?: string;
|
|
7
|
-
tableCell?: string;
|
|
8
8
|
};
|
|
9
9
|
export type TableColType<T extends ItemType> = {
|
|
10
10
|
text: string;
|
|
@@ -12,7 +12,7 @@ export type TableColType<T extends ItemType> = {
|
|
|
12
12
|
getTitle?: () => string | ReactNode | number;
|
|
13
13
|
code: keyof T;
|
|
14
14
|
};
|
|
15
|
-
type TableProps<T extends ItemType> = Omit<ComponentPropsWithoutRef<'table'>, 'onClick'> & {
|
|
15
|
+
export type TableProps<T extends ItemType> = Omit<ComponentPropsWithoutRef<'table'>, 'onClick'> & {
|
|
16
16
|
classes?: ClassesType<T>;
|
|
17
17
|
structure: TableColType<T>[];
|
|
18
18
|
items: T[];
|
package/ui/Table/Table.js
CHANGED
|
@@ -35,7 +35,9 @@ export function Table(props) {
|
|
|
35
35
|
}),
|
|
36
36
|
onClick: e => onClick ? onClick(row, e) : null,
|
|
37
37
|
children: structure.map((item, itemIndex) => {
|
|
38
|
+
let cellClass = !!(classes != null && classes.tableCell) ? typeof classes.tableCell === 'string' ? classes.tableCell : classes.tableCell(row, item.code) : '';
|
|
38
39
|
return /*#__PURE__*/_jsx(TableCell, {
|
|
40
|
+
className: cellClass,
|
|
39
41
|
children: item.getValue ? item.getValue(row) : row[item.code]
|
|
40
42
|
}, itemIndex);
|
|
41
43
|
})
|
package/ui/Table/index.d.ts
CHANGED