armtek-uikit-react 1.0.109 → 1.0.111

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.
@@ -2,7 +2,9 @@
2
2
 
3
3
  .Accordion_variant_section {
4
4
  & + .Accordion_variant_section{
5
- border-top: 1px solid var(--color-gray-300)
5
+ border-top: 1px solid var(--color-gray-300);
6
+ //padding-top: calc(var(--size-step) * 3);
7
+ //padding-bottom: calc(var(--size-step) * 3);
6
8
  }
7
9
  }
8
10
 
@@ -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
  }
@@ -1,6 +1,6 @@
1
1
  @import "variables";
2
2
 
3
- .textfield{
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
- &.textfield_focused{
14
+ &.textfield_root_focused{
15
15
  border-color: $color-gray-800;
16
16
  }
17
- &.textfield_disabled{
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
- .textfield_outlined{
37
- &.textfield_disabled{
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
- .textfield__container{
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
- .textfield__container_outlined{
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.109","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
+ {"name":"armtek-uikit-react","version":"1.0.111","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"}}
@@ -12,6 +12,7 @@ export const BackDropBase = props => {
12
12
  const handleClick = e => {
13
13
  if (e.target instanceof Element) {
14
14
  if (e.target.classList.contains('Arm-BackDropBase')) {
15
+ e.stopPropagation();
15
16
  if (onClick) onClick(e);
16
17
  }
17
18
  }
@@ -2,13 +2,14 @@ import { TextFieldProps } from '../TextField/TextField';
2
2
  import { ChangeEvent, MouseEvent } from 'react';
3
3
  import { DatePickerProps } from '../DatePicker/DatePicker';
4
4
  type BaseInputProps = Pick<TextFieldProps, 'label' | 'className' | 'placeholder'>;
5
+ export type DateFieldChangeEvent = ChangeEvent<HTMLInputElement> & {
6
+ value: Date | null;
7
+ };
5
8
  type OwnProps = {
6
9
  onClick?: (e: MouseEvent) => void;
7
10
  format?: string;
8
11
  onInput?: (e: ChangeEvent<HTMLInputElement>) => void;
9
- onChange?: (e: ChangeEvent<HTMLInputElement> & {
10
- value: Date | null;
11
- }) => void;
12
+ onChange?: (e: DateFieldChangeEvent) => void;
12
13
  value?: Date | string | null;
13
14
  showTime?: boolean;
14
15
  showTimeOnly?: boolean;
@@ -4,10 +4,14 @@ export declare const Password: import("react").ForwardRefExoticComponent<{
4
4
  variant?: import("../../../types/theme").VariantType | undefined;
5
5
  error?: boolean | undefined;
6
6
  success?: boolean | undefined;
7
- helperText?: string | undefined;
7
+ helperText?: import("react").ReactNode;
8
8
  endAdornment?: import("react").ReactNode;
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;
@@ -36,6 +36,9 @@ const TextArea = props => {
36
36
  className: clsx(css.textarea, css['size_' + restProps.size], className),
37
37
  onChange: handleChange,
38
38
  multiline: true,
39
+ classes: {
40
+ root: css.textarea__root
41
+ },
39
42
  style: {
40
43
  height: textHeight + 'px'
41
44
  }
@@ -1,16 +1,18 @@
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'>;
6
7
  variant?: VariantType;
7
8
  error?: boolean;
8
9
  success?: boolean;
9
- helperText?: string;
10
+ helperText?: string | ReactNode;
10
11
  endAdornment?: string | ReactNode;
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;
@@ -18,12 +20,13 @@ export declare const TextField: import("react").ForwardRefExoticComponent<{
18
20
  variant?: VariantType | undefined;
19
21
  error?: boolean | undefined;
20
22
  success?: boolean | undefined;
21
- helperText?: string | undefined;
23
+ helperText?: string | ReactNode;
22
24
  endAdornment?: string | ReactNode;
23
25
  multiline?: boolean | undefined;
24
26
  focused?: boolean | undefined;
25
27
  editable?: boolean | undefined;
26
- } & Omit<InputHTMLAttributes<any>, "size"> & import("react").RefAttributes<unknown>>;
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(ref);
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$current;
62
- return editable ? (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.focus() : null;
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.textfield, css['textfield_' + variant], css['size_' + size], {
101
- [css.textfield_focused]: focused,
102
- [css.textfield_disabled]: disabled,
103
- [css.textfield_error]: error
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.textfield__container, css['size_' + size], {
140
+ className: clsx(css.textfield__wrapper, css['size_' + size], wrapperClass, {
127
141
  [css._label]: !!label,
128
- [css.textfield__container_outlined]: variant === 'outlined'
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
  }),