armtek-uikit-react 1.0.73 → 1.0.75
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/Dropdown.scss +38 -0
- package/assets/Link.scss +3 -0
- package/package.json +1 -1
- package/ui/Adornment/Adornment.d.ts +2 -0
- package/ui/Adornment/Adornment.js +2 -1
- package/ui/Dropdown/Dropdown.d.ts +7 -0
- package/ui/Dropdown/Dropdown.js +50 -0
- package/ui/Dropdown/Dropdown.module.scss +1 -0
- package/ui/Dropdown/index.d.ts +2 -0
- package/ui/Dropdown/index.js +2 -0
- package/ui/Form/Checkbox/Checkbox.d.ts +2 -1
- package/ui/Link/Link.d.ts +2 -0
- package/ui/Link/Link.js +4 -2
- package/ui/List/ListItem.js +3 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@import "variables";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.Dropdown {
|
|
5
|
+
|
|
6
|
+
&__ContentWrapper {
|
|
7
|
+
&Enter {
|
|
8
|
+
//opacity: 0;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
max-height: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&EnterActive {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
max-height: var(--content-height);
|
|
16
|
+
transition: opacity 0.3s, max-height 1s cubic-bezier(0, 1, 0, 1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&Exit {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
max-height: var(--content-height);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&ExitActive {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
opacity: 0;
|
|
27
|
+
max-height: 0;
|
|
28
|
+
transition: opacity 0.3s, max-height 1s cubic-bezier(0, 1, 0, 1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__Content {
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
transition: all 0.3s;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
}
|
package/assets/Link.scss
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.75","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,8 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { ThemeType } from '../../types/theme';
|
|
2
3
|
type PropsType = {
|
|
3
4
|
position?: 'start' | 'end';
|
|
5
|
+
theme?: ThemeType;
|
|
4
6
|
} & HTMLAttributes<HTMLDivElement>;
|
|
5
7
|
declare const Adornment: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
6
8
|
export declare const AdornmentContainer: (props: PropsType) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import css from "./Adornment.module.scss";
|
|
3
|
-
// import { getCssPrefix } from 'lib/helpers/helpers'
|
|
4
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
4
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
// import { getCssPrefix } from 'lib/helpers/helpers'
|
|
6
|
+
|
|
6
7
|
const AdornmentClasses = ['adornmentContainer', 'adornmentContainer_end', 'adornment_start', 'adornment_end'];
|
|
7
8
|
|
|
8
9
|
// const css = getCssPrefix(AdornmentClasses)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type ChipProps = {
|
|
3
|
+
expanded?: boolean;
|
|
4
|
+
unmountOnExit?: boolean;
|
|
5
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
6
|
+
declare function Dropdown(props: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Dropdown;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { CSSTransition } from 'react-transition-group';
|
|
6
|
+
import css from "./Dropdown.module.scss";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
function Dropdown(props) {
|
|
10
|
+
var _nodeRef$current;
|
|
11
|
+
const {
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
expanded,
|
|
15
|
+
unmountOnExit,
|
|
16
|
+
...divProps
|
|
17
|
+
} = props;
|
|
18
|
+
const nodeRef = useRef(null);
|
|
19
|
+
const contentHeight = (_nodeRef$current = nodeRef.current) == null ? void 0 : _nodeRef$current.scrollHeight;
|
|
20
|
+
const duration = 1000;
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (nodeRef.current && contentHeight) nodeRef.current.style.setProperty("--content-height", String(contentHeight) + 'px');
|
|
23
|
+
}, [contentHeight]);
|
|
24
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
25
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
26
|
+
...divProps,
|
|
27
|
+
className: clsx('Arm-dropdown', css.Dropdown, className),
|
|
28
|
+
children: /*#__PURE__*/_jsx(CSSTransition, {
|
|
29
|
+
classNames: {
|
|
30
|
+
'enter': css.Dropdown__ContentWrapperEnter,
|
|
31
|
+
'enterActive': css.Dropdown__ContentWrapperEnterActive,
|
|
32
|
+
'exit': css.Dropdown__ContentWrapperExit,
|
|
33
|
+
'exitActive': css.Dropdown__ContentWrapperExitActive
|
|
34
|
+
},
|
|
35
|
+
in: expanded,
|
|
36
|
+
nodeRef: nodeRef,
|
|
37
|
+
timeout: duration,
|
|
38
|
+
unmountOnExit: unmountOnExit || false,
|
|
39
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
40
|
+
ref: nodeRef,
|
|
41
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
42
|
+
className: css.Dropdown__Content,
|
|
43
|
+
children: children
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export default Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./../../assets/Dropdown.scss";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { ColorType, SizeType, VariantType } from '../../../types/theme';
|
|
2
|
+
import { ColorType, SizeType, ThemeType, VariantType } from '../../../types/theme';
|
|
3
3
|
type BaseCheckboxPropsType = {
|
|
4
4
|
label?: string | ReactNode;
|
|
5
5
|
size?: Exclude<SizeType, 'extraLarge'>;
|
|
6
6
|
color?: ColorType;
|
|
7
|
+
theme?: ThemeType;
|
|
7
8
|
variant?: Exclude<VariantType, 'transparent'>;
|
|
8
9
|
intermediate?: boolean;
|
|
9
10
|
};
|
package/ui/Link/Link.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
2
|
+
import { ThemeType } from '../../types/theme';
|
|
2
3
|
type LinkType = 'a';
|
|
3
4
|
type OwnProps<T extends ElementType = LinkType> = {
|
|
4
5
|
border?: 'solid' | 'dotted' | 'dashed';
|
|
5
6
|
as?: T;
|
|
6
7
|
disabled?: boolean;
|
|
8
|
+
theme?: ThemeType;
|
|
7
9
|
};
|
|
8
10
|
export type LinkProps<T extends ElementType = LinkType> = OwnProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof OwnProps<T>>;
|
|
9
11
|
declare const Link: <T extends ElementType = "a">(props: LinkProps<T>) => import("react/jsx-runtime").JSX.Element;
|
package/ui/Link/Link.js
CHANGED
|
@@ -4,10 +4,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
5
|
const Link = props => {
|
|
6
6
|
let {
|
|
7
|
-
border
|
|
7
|
+
border,
|
|
8
8
|
children,
|
|
9
9
|
disabled,
|
|
10
10
|
className,
|
|
11
|
+
theme,
|
|
11
12
|
as,
|
|
12
13
|
...restProps
|
|
13
14
|
} = props;
|
|
@@ -17,7 +18,8 @@ const Link = props => {
|
|
|
17
18
|
...restProps,
|
|
18
19
|
className: clsx('Arm-link', css.link, {
|
|
19
20
|
[css.link_border]: !!border,
|
|
20
|
-
[css.link_disabled]: !!disabled
|
|
21
|
+
[css.link_disabled]: !!disabled,
|
|
22
|
+
[css.link_dark]: theme === 'dark'
|
|
21
23
|
}, css['link_border_' + border], className),
|
|
22
24
|
children: children
|
|
23
25
|
})
|
package/ui/List/ListItem.js
CHANGED
|
@@ -40,12 +40,14 @@ function ListItem(props) {
|
|
|
40
40
|
children: [checked !== undefined && /*#__PURE__*/_jsx(Adornment, {
|
|
41
41
|
position: 'start',
|
|
42
42
|
children: /*#__PURE__*/_jsx(Checkbox, {
|
|
43
|
+
theme: theme,
|
|
43
44
|
disabled: restProps.disabled,
|
|
44
45
|
checked: checked,
|
|
45
46
|
readOnly: true,
|
|
46
47
|
size: 'small'
|
|
47
48
|
})
|
|
48
49
|
}), !!startAdornment && /*#__PURE__*/_jsx(Adornment, {
|
|
50
|
+
theme: theme,
|
|
49
51
|
position: 'start',
|
|
50
52
|
children: startAdornment
|
|
51
53
|
})]
|
|
@@ -63,6 +65,7 @@ function ListItem(props) {
|
|
|
63
65
|
}), !!endAdornment && /*#__PURE__*/_jsx(AdornmentContainer, {
|
|
64
66
|
position: 'end',
|
|
65
67
|
children: /*#__PURE__*/_jsx(Adornment, {
|
|
68
|
+
theme: theme,
|
|
66
69
|
position: 'end',
|
|
67
70
|
children: endAdornment
|
|
68
71
|
})
|