armtek-uikit-react 1.0.105 → 1.0.107
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/Checkbox.scss +1 -0
- package/assets/Icon.scss +11 -1
- package/assets/styles.scss +1 -0
- package/package.json +1 -1
- package/ui/Form/Checkbox/Checkbox.d.ts +3 -3
- package/ui/Form/Checkbox/Checkbox.js +16 -19
- package/ui/Form/Radio/Radio.d.ts +2 -2
- package/ui/Icon/Icon.d.ts +2 -1
- package/ui/Icon/Icon.js +4 -1
package/assets/Checkbox.scss
CHANGED
package/assets/Icon.scss
CHANGED
|
@@ -18,4 +18,14 @@
|
|
|
18
18
|
.Icon_color_success{color:var(--color-success)}
|
|
19
19
|
.Icon_color_info{color:var(--color-info)}
|
|
20
20
|
.Icon_color_warning{color:var(--color-warning)}
|
|
21
|
-
.Icon_color_error{color:var(--color-error)}
|
|
21
|
+
.Icon_color_error{color:var(--color-error)}
|
|
22
|
+
|
|
23
|
+
.Icon_theme_dark {
|
|
24
|
+
//&.Icon_color_primary{color: var(--color-primary-contrast)}
|
|
25
|
+
//&.Icon_color_secondary{color: var(--color-secondary-contrast)}
|
|
26
|
+
&.Icon_color_neutral{color: var(--color-neutral-contrast)}
|
|
27
|
+
//&.Icon_color_success{color:var(--color-success-contrast)}
|
|
28
|
+
//&.Icon_color_info{color:var(--color-info-contrast)}
|
|
29
|
+
//&.Icon_color_warning{color:var(--color-warning-contrast)}
|
|
30
|
+
//&.Icon_color_error{color:var(--color-error-contrast)}
|
|
31
|
+
}
|
package/assets/styles.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
|
|
2
2
|
//@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
|
|
3
3
|
|
|
4
|
+
@import "global.css";
|
|
4
5
|
@import "variables";
|
|
5
6
|
@import "Button";
|
|
6
7
|
@import "Adornment";
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.107","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":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { ColorType, SizeType, ThemeType, VariantType } from '../../../types/theme';
|
|
3
|
-
type
|
|
3
|
+
type BaseCheckboxProps = {
|
|
4
4
|
label?: string | ReactNode;
|
|
5
5
|
size?: Exclude<SizeType, 'extraLarge'>;
|
|
6
6
|
color?: ColorType;
|
|
@@ -8,6 +8,6 @@ type BaseCheckboxPropsType = {
|
|
|
8
8
|
variant?: Exclude<VariantType, 'transparent'>;
|
|
9
9
|
intermediate?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
12
|
-
declare const Checkbox: (props:
|
|
11
|
+
export type CheckboxProps = BaseCheckboxProps & Omit<InputHTMLAttributes<any>, 'size'>;
|
|
12
|
+
declare const Checkbox: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default Checkbox;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import clsx from 'clsx';
|
|
4
3
|
import { useState } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
import css from "./Checkbox.module.scss";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -22,34 +22,31 @@ const Checkbox = props => {
|
|
|
22
22
|
...inputProps
|
|
23
23
|
} = props;
|
|
24
24
|
let [checked, setChecked] = useState(!!props.defaultChecked);
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
if (onChange) onChange(e);
|
|
29
|
-
}
|
|
25
|
+
const handleChange = e => {
|
|
26
|
+
if (inputProps.checked === undefined) setChecked(prev => !prev);
|
|
27
|
+
if (onChange) onChange(e);
|
|
30
28
|
};
|
|
31
29
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
32
|
-
children: /*#__PURE__*/
|
|
30
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
33
31
|
className: clsx(css.checkbox, className),
|
|
34
|
-
children:
|
|
35
|
-
...inputProps,
|
|
36
|
-
className: clsx(css.checkbox__input, {
|
|
37
|
-
'_checked': !!inputProps.checked
|
|
38
|
-
}),
|
|
39
|
-
onChange: onChange,
|
|
40
|
-
type: props.type || 'checkbox'
|
|
41
|
-
}), /*#__PURE__*/_jsx("label", {
|
|
42
|
-
onClick: handleClick,
|
|
32
|
+
children: /*#__PURE__*/_jsxs("label", {
|
|
43
33
|
className: clsx(css.checkbox__label, css['checkbox_' + size], css['checkbox_' + variant], css['checkbox_' + color], {
|
|
44
34
|
[css.checkbox__label_checked]: inputProps.checked !== undefined ? inputProps.checked : checked,
|
|
45
35
|
[css.checkbox__label_intermediate]: !!intermediate,
|
|
46
36
|
[css.checkbox__label_disabled]: !!inputProps.disabled
|
|
47
37
|
}),
|
|
48
|
-
children:
|
|
38
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
39
|
+
...inputProps,
|
|
40
|
+
className: clsx(css.checkbox__input, {
|
|
41
|
+
'_checked': !!inputProps.checked
|
|
42
|
+
}),
|
|
43
|
+
onChange: handleChange,
|
|
44
|
+
type: props.type || 'checkbox'
|
|
45
|
+
}), label && /*#__PURE__*/_jsx("span", {
|
|
49
46
|
className: css.checkbox__text,
|
|
50
47
|
children: label
|
|
51
|
-
})
|
|
52
|
-
})
|
|
48
|
+
})]
|
|
49
|
+
})
|
|
53
50
|
})
|
|
54
51
|
});
|
|
55
52
|
};
|
package/ui/Form/Radio/Radio.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const Radio: (props:
|
|
1
|
+
import { CheckboxProps } from '../Checkbox/Checkbox';
|
|
2
|
+
declare const Radio: (props: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Radio;
|
package/ui/Icon/Icon.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import { ColorStatusType, ColorType, SizeType, VariantType } from '../../types/theme';
|
|
2
|
+
import { ColorStatusType, ColorType, SizeType, ThemeType, VariantType } from '../../types/theme';
|
|
3
3
|
type OwnProps = {
|
|
4
4
|
icon: string;
|
|
5
5
|
variant?: VariantType;
|
|
6
6
|
color?: ColorType | ColorStatusType;
|
|
7
7
|
size?: SizeType;
|
|
8
|
+
theme?: ThemeType;
|
|
8
9
|
fs?: number;
|
|
9
10
|
};
|
|
10
11
|
export type IconProps = OwnProps & Omit<ComponentPropsWithoutRef<'span'>, keyof OwnProps>;
|
package/ui/Icon/Icon.js
CHANGED
|
@@ -9,6 +9,7 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
9
9
|
className,
|
|
10
10
|
size,
|
|
11
11
|
icon,
|
|
12
|
+
theme,
|
|
12
13
|
variant = 'outlined',
|
|
13
14
|
color,
|
|
14
15
|
fs,
|
|
@@ -20,13 +21,15 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
20
21
|
...spanProps,
|
|
21
22
|
className: clsx(className, 'Arm-Icon', {
|
|
22
23
|
[css['Icon_size_' + size]]: size,
|
|
24
|
+
[css['Icon_theme_' + theme]]: theme,
|
|
23
25
|
'mi': variant === 'outlined',
|
|
24
26
|
'mis': variant === 'contained',
|
|
25
27
|
[css['Icon_color_' + color]]: color
|
|
26
28
|
}),
|
|
27
29
|
style: fs ? {
|
|
30
|
+
...spanProps.style,
|
|
28
31
|
fontSize: fs + 'px'
|
|
29
|
-
} :
|
|
32
|
+
} : spanProps.style,
|
|
30
33
|
children: icon || children
|
|
31
34
|
})
|
|
32
35
|
});
|