armtek-uikit-react 1.0.74 → 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.
@@ -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/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.74","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"}}
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"}}
@@ -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";
@@ -0,0 +1,2 @@
1
+ export { default } from './Dropdown';
2
+ export * from './Dropdown';
@@ -0,0 +1,2 @@
1
+ export { default } from "./Dropdown";
2
+ export * from "./Dropdown";