armtek-uikit-react 1.0.110 → 1.0.112
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/Accordion.scss +3 -1
- package/assets/Link.scss +10 -1
- package/assets/TextArea.scss +4 -0
- package/assets/TextField.scss +7 -7
- package/package.json +1 -1
- package/ui/BackDrop/BackDropBase.js +1 -0
- package/ui/Form/Password/Password.d.ts +4 -0
- package/ui/Form/TextArea/TextArea.js +3 -0
- package/ui/Form/TextField/TextField.d.ts +5 -1
- package/ui/Form/TextField/TextField.js +25 -11
- package/ui/Link/Link.d.ts +2 -1
- package/ui/Link/Link.js +2 -0
package/assets/Accordion.scss
CHANGED
package/assets/Link.scss
CHANGED
|
@@ -8,13 +8,22 @@
|
|
|
8
8
|
outline: none;
|
|
9
9
|
background-color: transparent;
|
|
10
10
|
padding: 0;
|
|
11
|
-
font-size:
|
|
11
|
+
font-size: inherit;
|
|
12
12
|
font-family: inherit;
|
|
13
13
|
text-decoration: none;
|
|
14
14
|
&:hover{
|
|
15
15
|
color: var(--color-primary-light)
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
.link_size_small{
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
}
|
|
21
|
+
.link_size_medium{
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
}
|
|
24
|
+
.link_size_large{
|
|
25
|
+
font-size: 20px;
|
|
26
|
+
}
|
|
18
27
|
.link_color_secondary{
|
|
19
28
|
color: var(--color-secondary);
|
|
20
29
|
&:hover{
|
package/assets/TextArea.scss
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
font-family: $font-family;
|
|
5
5
|
height: auto;
|
|
6
6
|
min-height: $size-elarge;
|
|
7
|
+
line-height: 20px;
|
|
7
8
|
&.size_small{
|
|
8
9
|
height: auto;
|
|
9
10
|
min-height: $size-large;
|
|
@@ -12,4 +13,7 @@
|
|
|
12
13
|
resize: none;
|
|
13
14
|
appearance: none;
|
|
14
15
|
}
|
|
16
|
+
}
|
|
17
|
+
.textarea__root{
|
|
18
|
+
height: auto;
|
|
15
19
|
}
|
package/assets/TextField.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@import "variables";
|
|
2
2
|
|
|
3
|
-
.
|
|
3
|
+
.textfield_root{
|
|
4
4
|
position: relative;
|
|
5
5
|
overflow: hidden;
|
|
6
6
|
border-radius: $radius;
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
&:hover{
|
|
12
12
|
border-color: $color-gray-600;
|
|
13
13
|
}
|
|
14
|
-
&.
|
|
14
|
+
&.textfield_root_focused{
|
|
15
15
|
border-color: $color-gray-800;
|
|
16
16
|
}
|
|
17
|
-
&.
|
|
17
|
+
&.textfield_root_disabled{
|
|
18
18
|
pointer-events: none;
|
|
19
19
|
background: $color-gray-100;
|
|
20
20
|
border-color: transparent;
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
border-radius: 0;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
.
|
|
37
|
-
&.
|
|
36
|
+
.textfield_root_outlined{
|
|
37
|
+
&.textfield_root_disabled{
|
|
38
38
|
background: transparent;
|
|
39
39
|
border-bottom-style: dotted;
|
|
40
40
|
border-bottom-width: 1px;
|
|
41
41
|
border-bottom-color: $color-gray-100;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
.
|
|
44
|
+
.textfield__wrapper{
|
|
45
45
|
cursor: text;
|
|
46
46
|
position: relative;
|
|
47
47
|
padding: 10px 12px 8px;
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
.
|
|
58
|
+
.textfield__wrapper_outlined{
|
|
59
59
|
padding-left: 0 !important;
|
|
60
60
|
& .textfield__label{
|
|
61
61
|
padding-left: 0;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.112","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"}}
|
|
@@ -9,5 +9,9 @@ export declare const Password: import("react").ForwardRefExoticComponent<{
|
|
|
9
9
|
multiline?: boolean | undefined;
|
|
10
10
|
focused?: boolean | undefined;
|
|
11
11
|
editable?: boolean | undefined;
|
|
12
|
+
classes?: Partial<{
|
|
13
|
+
root: string;
|
|
14
|
+
wrapper: string;
|
|
15
|
+
}> | undefined;
|
|
12
16
|
} & Omit<import("react").InputHTMLAttributes<any>, "size"> & import("react").RefAttributes<unknown>>;
|
|
13
17
|
export default Password;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { SizeType, VariantType } from '../../../types/theme';
|
|
3
|
+
type Classes = Record<'root' | 'wrapper', string>;
|
|
3
4
|
export type TextFieldProps = {
|
|
4
5
|
label?: string;
|
|
5
6
|
size?: Exclude<SizeType, 'extraLarge' | 'medium'>;
|
|
@@ -11,6 +12,7 @@ export type TextFieldProps = {
|
|
|
11
12
|
multiline?: boolean;
|
|
12
13
|
focused?: boolean;
|
|
13
14
|
editable?: boolean;
|
|
15
|
+
classes?: Partial<Classes>;
|
|
14
16
|
} & Omit<InputHTMLAttributes<any>, 'size'>;
|
|
15
17
|
export declare const TextField: import("react").ForwardRefExoticComponent<{
|
|
16
18
|
label?: string | undefined;
|
|
@@ -23,7 +25,8 @@ export declare const TextField: import("react").ForwardRefExoticComponent<{
|
|
|
23
25
|
multiline?: boolean | undefined;
|
|
24
26
|
focused?: boolean | undefined;
|
|
25
27
|
editable?: boolean | undefined;
|
|
26
|
-
|
|
28
|
+
classes?: Partial<Classes> | undefined;
|
|
29
|
+
} & Omit<InputHTMLAttributes<any>, "size"> & import("react").RefAttributes<any>>;
|
|
27
30
|
type ContainerPropsType = {
|
|
28
31
|
focused?: boolean;
|
|
29
32
|
disabled?: boolean;
|
|
@@ -40,5 +43,6 @@ export declare const TextFieldInput: import("react").ForwardRefExoticComponent<{
|
|
|
40
43
|
multiline?: boolean | undefined;
|
|
41
44
|
error?: boolean | undefined;
|
|
42
45
|
label?: string | undefined;
|
|
46
|
+
wrapperClass?: string | undefined;
|
|
43
47
|
} & Omit<InputHTMLAttributes<any>, "size"> & import("react").RefAttributes<unknown>>;
|
|
44
48
|
export default TextField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { forwardRef, useRef, useState } from 'react';
|
|
3
|
+
import { forwardRef, useRef, useState, useImperativeHandle } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import HelperText from "../../HelperText/HelperText";
|
|
6
6
|
import css from "./TextField.module.scss";
|
|
@@ -13,6 +13,7 @@ const CssClasses = ['textfield__container_outlined', 'textfield__container', 'te
|
|
|
13
13
|
// const css = getCssPrefix(CssClasses)
|
|
14
14
|
|
|
15
15
|
export const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
16
|
+
var _inputRef$current;
|
|
16
17
|
let {
|
|
17
18
|
error,
|
|
18
19
|
success,
|
|
@@ -22,12 +23,21 @@ export const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22
23
|
variant = 'solid',
|
|
23
24
|
endAdornment,
|
|
24
25
|
className,
|
|
26
|
+
classes,
|
|
25
27
|
multiline = false,
|
|
26
28
|
editable = true,
|
|
27
29
|
...inputProps
|
|
28
30
|
} = props;
|
|
29
31
|
let [focused, setFocused] = useState(false);
|
|
30
|
-
const inputRef = useRef(
|
|
32
|
+
const inputRef = useRef(null);
|
|
33
|
+
const currentScrollHeight = (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.scrollHeight;
|
|
34
|
+
useImperativeHandle(ref, () => {
|
|
35
|
+
var _inputRef$current2;
|
|
36
|
+
return {
|
|
37
|
+
scrollHeight: currentScrollHeight,
|
|
38
|
+
style: (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.style
|
|
39
|
+
};
|
|
40
|
+
}, [currentScrollHeight]);
|
|
31
41
|
const handleFocus = e => {
|
|
32
42
|
setFocused(true);
|
|
33
43
|
if (inputProps.onFocus) inputProps.onFocus(e);
|
|
@@ -58,11 +68,13 @@ export const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
58
68
|
disabled: inputProps.disabled,
|
|
59
69
|
focused: realFocused,
|
|
60
70
|
onClick: () => {
|
|
61
|
-
var _inputRef$
|
|
62
|
-
return editable ? (_inputRef$
|
|
71
|
+
var _inputRef$current3;
|
|
72
|
+
return editable ? (_inputRef$current3 = inputRef.current) == null ? void 0 : _inputRef$current3.focus() : null;
|
|
63
73
|
},
|
|
64
74
|
error: error,
|
|
75
|
+
className: classes == null ? void 0 : classes.root,
|
|
65
76
|
children: [/*#__PURE__*/_jsx(TextFieldInput, {
|
|
77
|
+
wrapperClass: classes == null ? void 0 : classes.wrapper,
|
|
66
78
|
Component: Component,
|
|
67
79
|
ref: inputRef,
|
|
68
80
|
size: size,
|
|
@@ -97,16 +109,17 @@ export const TextFieldContainer = props => {
|
|
|
97
109
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
98
110
|
children: /*#__PURE__*/_jsx("div", {
|
|
99
111
|
...restProps,
|
|
100
|
-
className: clsx('TextFieldContrainer', css.
|
|
101
|
-
[css.
|
|
102
|
-
[css.
|
|
103
|
-
[css.
|
|
112
|
+
className: clsx('TextFieldContrainer', css.textfield_root, css['textfield_root_' + variant], css['size_' + size], {
|
|
113
|
+
[css.textfield_root_focused]: focused,
|
|
114
|
+
[css.textfield_root_disabled]: disabled,
|
|
115
|
+
[css.textfield_root_error]: error
|
|
104
116
|
}, className),
|
|
105
117
|
children: children
|
|
106
118
|
})
|
|
107
119
|
});
|
|
108
120
|
};
|
|
109
121
|
export const TextFieldInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
122
|
+
var _ref$current;
|
|
110
123
|
let {
|
|
111
124
|
Component = 'input',
|
|
112
125
|
size,
|
|
@@ -115,6 +128,7 @@ export const TextFieldInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
115
128
|
error,
|
|
116
129
|
focused,
|
|
117
130
|
label,
|
|
131
|
+
wrapperClass,
|
|
118
132
|
className,
|
|
119
133
|
...inputProps
|
|
120
134
|
} = props;
|
|
@@ -123,9 +137,9 @@ export const TextFieldInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
123
137
|
};
|
|
124
138
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
125
139
|
children: /*#__PURE__*/_jsxs("div", {
|
|
126
|
-
className: clsx(css.
|
|
140
|
+
className: clsx(css.textfield__wrapper, css['size_' + size], wrapperClass, {
|
|
127
141
|
[css._label]: !!label,
|
|
128
|
-
[css.
|
|
142
|
+
[css.textfield__wrapper_outlined]: variant === 'outlined'
|
|
129
143
|
}),
|
|
130
144
|
children: [/*#__PURE__*/_jsx(Component, {
|
|
131
145
|
ref: ref,
|
|
@@ -139,7 +153,7 @@ export const TextFieldInput = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
139
153
|
}, className)
|
|
140
154
|
}), label && /*#__PURE__*/_jsx("span", {
|
|
141
155
|
className: clsx(css.textfield__label, {
|
|
142
|
-
[css.textfield__label_focused]: focused || !!props.value,
|
|
156
|
+
[css.textfield__label_focused]: focused || !!props.value || !!((_ref$current = ref.current) != null && _ref$current.value),
|
|
143
157
|
[css.textfield__label_small]: size === 'small',
|
|
144
158
|
[css.textfield__label_error]: error
|
|
145
159
|
}),
|
package/ui/Link/Link.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
2
|
-
import { ColorStatusType, ColorType, ThemeType } from '../../types/theme';
|
|
2
|
+
import { ColorStatusType, ColorType, SizeType, ThemeType } from '../../types/theme';
|
|
3
3
|
type LinkType = 'a';
|
|
4
4
|
type OwnProps<T extends ElementType = LinkType> = {
|
|
5
5
|
border?: 'solid' | 'dotted' | 'dashed';
|
|
@@ -7,6 +7,7 @@ type OwnProps<T extends ElementType = LinkType> = {
|
|
|
7
7
|
as?: T;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
theme?: ThemeType;
|
|
10
|
+
size?: SizeType;
|
|
10
11
|
};
|
|
11
12
|
export type LinkProps<T extends ElementType = LinkType> = OwnProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof OwnProps<T>>;
|
|
12
13
|
declare const Link: <T extends ElementType = "a">(props: LinkProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/ui/Link/Link.js
CHANGED
|
@@ -9,6 +9,7 @@ const Link = props => {
|
|
|
9
9
|
disabled,
|
|
10
10
|
className,
|
|
11
11
|
theme,
|
|
12
|
+
size,
|
|
12
13
|
color,
|
|
13
14
|
as,
|
|
14
15
|
...restProps
|
|
@@ -21,6 +22,7 @@ const Link = props => {
|
|
|
21
22
|
[css.link_border]: !!border,
|
|
22
23
|
[css.link_disabled]: !!disabled,
|
|
23
24
|
[css.link_dark]: theme === 'dark',
|
|
25
|
+
[css['link_size_' + size]]: !!size,
|
|
24
26
|
[css['link_color_' + color]]: !!color
|
|
25
27
|
}, css['link_border_' + border], className),
|
|
26
28
|
children: children
|