@hazelcast/ui 1.3.2-next.15 → 1.3.2-next.18
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/lib/Calendar/Calendar.d.ts +1 -0
- package/lib/Calendar/Calendar.js +6 -4
- package/lib/Calendar/Calendar.js.map +1 -1
- package/lib/Calendar/Calendar.module.scss +2 -1
- package/lib/Calendar/CalendarRange.d.ts +4 -3
- package/lib/Calendar/CalendarRange.js +5 -5
- package/lib/Calendar/CalendarRange.js.map +1 -1
- package/lib/Calendar/CalendarRange.module.scss +5 -0
- package/lib/Card.js +2 -2
- package/lib/Card.js.map +1 -1
- package/lib/Overlay.d.ts +4 -0
- package/lib/Overlay.js +5 -5
- package/lib/Overlay.js.map +1 -1
- package/package.json +2 -2
|
@@ -10,5 +10,6 @@ export declare type CalendarProps = {
|
|
|
10
10
|
onDateChange: ReactDatePickerProps['onChange'];
|
|
11
11
|
size?: CalendarSize;
|
|
12
12
|
container?: PortalContainer;
|
|
13
|
+
insidePopover?: boolean;
|
|
13
14
|
} & Omit<ReactDatePickerProps, 'value' | 'onChange'>;
|
|
14
15
|
export declare const Calendar: FC<CalendarProps>;
|
package/lib/Calendar/Calendar.js
CHANGED
|
@@ -9,11 +9,13 @@ import styles from './Calendar.module.scss';
|
|
|
9
9
|
import { getPortalContainer } from '../utils/portal';
|
|
10
10
|
const DATE_FORMAT = 'yyyy-MM-dd';
|
|
11
11
|
const DATE_FORMAT_WITH_TIME = 'yyyy-MM-dd hh:mm a';
|
|
12
|
-
const CalendarPopperContainer = (container) => ({ children }) => container && children
|
|
13
|
-
? createPortal(
|
|
12
|
+
const CalendarPopperContainer = (container, insidePopover) => ({ children }) => container && children
|
|
13
|
+
? createPortal(
|
|
14
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
15
|
+
React.createElement("div", { className: styles.popper, onMouseDown: insidePopover ? (e) => e.nativeEvent.stopImmediatePropagation() : undefined },
|
|
14
16
|
React.createElement("div", { "data-test": "date-picker-popper-container", className: "hz-date-picker-popper-container" }, children)), container)
|
|
15
17
|
: null;
|
|
16
|
-
export const Calendar = ({ calendarClassName, className, containerClassName, date, inputLabel, inputClassName, onDateChange, showTimeInput, size = 'medium', container = `body`, ...props }) => (React.createElement("div", { className: cn(styles.container, {
|
|
18
|
+
export const Calendar = ({ calendarClassName, className, containerClassName, date, inputLabel, inputClassName, onDateChange, showTimeInput, size = 'medium', container = `body`, insidePopover = false, ...props }) => (React.createElement("div", { className: cn(styles.container, {
|
|
17
19
|
[styles.time]: showTimeInput,
|
|
18
20
|
}, containerClassName) },
|
|
19
21
|
React.createElement(DatePicker, { ...props, calendarClassName: cn(styles.calendar, calendarClassName), className: className,
|
|
@@ -21,7 +23,7 @@ export const Calendar = ({ calendarClassName, className, containerClassName, dat
|
|
|
21
23
|
* Note: The library instantiates the component using React.cloneElement
|
|
22
24
|
* Source: https://github.com/Hacker0x01/react-datepicker/blob/master/src/index.jsx#L926
|
|
23
25
|
*/
|
|
24
|
-
customInput: React.createElement(CalendarInput, { label: inputLabel, textFieldSize: size, className: inputClassName }), customTimeInput: React.createElement(CalendarTime, null), dateFormat: showTimeInput ? DATE_FORMAT_WITH_TIME : DATE_FORMAT, onChange: onDateChange, popperContainer: CalendarPopperContainer(getPortalContainer(container)),
|
|
26
|
+
customInput: React.createElement(CalendarInput, { label: inputLabel, textFieldSize: size, className: inputClassName }), customTimeInput: React.createElement(CalendarTime, null), dateFormat: showTimeInput ? DATE_FORMAT_WITH_TIME : DATE_FORMAT, onChange: onDateChange, popperContainer: CalendarPopperContainer(getPortalContainer(container), insidePopover),
|
|
25
27
|
/*
|
|
26
28
|
* Note:
|
|
27
29
|
* 'renderCustomHeader' is the only child component override prop that is not instantiated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CA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ACd,eAAe,EAAE,KAAK,EACtB,aAAa,EAAE,aAAa,GAC5B,CACE,CACP,CAAA"}
|
|
@@ -33,6 +33,8 @@ $inputPadding: c.$grid * 3;
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:global .react-datepicker {
|
|
36
|
+
padding: $inputPadding;
|
|
37
|
+
|
|
36
38
|
:global .react-datepicker__header {
|
|
37
39
|
margin: 0;
|
|
38
40
|
padding: 0;
|
|
@@ -161,7 +163,6 @@ $inputPadding: c.$grid * 3;
|
|
|
161
163
|
flex-direction: row;
|
|
162
164
|
border: c.$borderWidth solid c.$colorNeutralLight;
|
|
163
165
|
background-color: c.$colorNeutralLighter;
|
|
164
|
-
padding: $inputPadding;
|
|
165
166
|
box-sizing: border-box;
|
|
166
167
|
|
|
167
168
|
.headerContainer {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { ReactDatePickerProps } from 'react-datepicker';
|
|
3
2
|
import { CalendarProps } from './Calendar';
|
|
3
|
+
export declare type CalendarRangeVariant = 'horizontal' | 'vertical';
|
|
4
4
|
export declare type CalendarRangeProps = {
|
|
5
5
|
startDate: CalendarProps['date'];
|
|
6
6
|
startInputLabel?: string;
|
|
@@ -9,7 +9,8 @@ export declare type CalendarRangeProps = {
|
|
|
9
9
|
endDate: CalendarProps['date'];
|
|
10
10
|
endInputLabel?: string;
|
|
11
11
|
endOpen?: boolean;
|
|
12
|
+
variant?: CalendarRangeVariant;
|
|
12
13
|
onEndDateChange: CalendarProps['onDateChange'];
|
|
13
|
-
|
|
14
|
-
} &
|
|
14
|
+
insidePopover?: boolean;
|
|
15
|
+
} & Omit<CalendarProps, 'onDateChange' | 'date' | 'inputLabel'>;
|
|
15
16
|
export declare const CalendarRange: FC<CalendarRangeProps>;
|
|
@@ -4,10 +4,10 @@ import cn from 'classnames';
|
|
|
4
4
|
import { Icon } from '../Icon';
|
|
5
5
|
import { Calendar } from './Calendar';
|
|
6
6
|
import styles from './CalendarRange.module.scss';
|
|
7
|
-
export const CalendarRange = ({ startDate, startInputLabel = 'From', startOpen, onStartDateChange, endDate, endInputLabel = 'To', endOpen, onEndDateChange,
|
|
8
|
-
return (React.createElement("div", { className: styles.container },
|
|
9
|
-
React.createElement(Calendar, { "data-test": "calendar-range-start", date: startDate, onDateChange: onStartDateChange, selectsStart: true, startDate: startDate, endDate: endDate, inputLabel: startInputLabel,
|
|
10
|
-
React.createElement(Icon, { "data-test": "calendar-range-icon", className: cn(styles.arrowRight, { [styles.small]: size === 'small' }), icon: ArrowRight, ariaLabel: "Arrow Right" }),
|
|
11
|
-
React.createElement(Calendar, { "data-test": "calendar-range-end", date: endDate, onDateChange: onEndDateChange, selectsEnd: true, startDate: startDate, endDate: endDate, minDate: startDate, inputLabel: endInputLabel,
|
|
7
|
+
export const CalendarRange = ({ startDate, startInputLabel = 'From', startOpen, onStartDateChange, endDate, endInputLabel = 'To', endOpen, onEndDateChange, size, insidePopover = false, variant = 'horizontal', ...rest }) => {
|
|
8
|
+
return (React.createElement("div", { className: cn(styles.container, { [styles.vertical]: variant === 'vertical' }) },
|
|
9
|
+
React.createElement(Calendar, { "data-test": "calendar-range-start", date: startDate, onDateChange: onStartDateChange, selectsStart: true, startDate: startDate, endDate: endDate, inputLabel: startInputLabel, open: startOpen, size: size, insidePopover: insidePopover, ...rest }),
|
|
10
|
+
variant === 'horizontal' && (React.createElement(Icon, { "data-test": "calendar-range-icon", className: cn(styles.arrowRight, { [styles.small]: size === 'small' }), icon: ArrowRight, ariaLabel: "Arrow Right" })),
|
|
11
|
+
React.createElement(Calendar, { "data-test": "calendar-range-end", date: endDate, onDateChange: onEndDateChange, selectsEnd: true, startDate: startDate, endDate: endDate, minDate: startDate, inputLabel: endInputLabel, open: endOpen, size: size, insidePopover: insidePopover, ...rest })));
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=CalendarRange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarRange.js","sourceRoot":"","sources":["../../src/Calendar/CalendarRange.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"CalendarRange.js","sourceRoot":"","sources":["../../src/Calendar/CalendarRange.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAA;AAEpD,OAAO,MAAM,MAAM,6BAA6B,CAAA;AAgBhD,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EACpD,SAAS,EACT,eAAe,GAAG,MAAM,EACxB,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,aAAa,GAAG,IAAI,EACpB,OAAO,EACP,eAAe,EACf,IAAI,EACJ,aAAa,GAAG,KAAK,EACrB,OAAO,GAAG,YAAY,EACtB,GAAG,IAAI,EACR,EAAE,EAAE;IACH,OAAO,CACL,6BAAK,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,UAAU,EAAE,CAAC;QACjF,oBAAC,QAAQ,iBACG,sBAAsB,EAChC,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,iBAAiB,EAC/B,YAAY,QACZ,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,KACxB,IAAI,GACR;QACD,OAAO,KAAK,YAAY,IAAI,CAC3B,oBAAC,IAAI,iBACO,qBAAqB,EAC/B,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,OAAO,EAAE,CAAC,EACtE,IAAI,EAAE,UAAU,EAChB,SAAS,EAAC,aAAa,GACvB,CACH;QACD,oBAAC,QAAQ,iBACG,oBAAoB,EAC9B,IAAI,EAAE,OAAO,EACb,YAAY,EAAE,eAAe,EAC7B,UAAU,QACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,aAAa,EACzB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,KACxB,IAAI,GACR,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
package/lib/Card.js
CHANGED
|
@@ -11,9 +11,9 @@ import styles from './Card.module.scss';
|
|
|
11
11
|
*/
|
|
12
12
|
export const Card = ({ headingIcon, title, headingContent, separator = false, 'data-test': dataTest, children, className, iconClassName, titleClassName, contentClassName, headerClassName, caption, }) => (React.createElement("div", { "data-test": dataTest !== null && dataTest !== void 0 ? dataTest : 'card-wrapper', className: cn(styles.wrapper, { [styles.noTitle]: !title }, className) },
|
|
13
13
|
caption && React.createElement("div", { className: styles.caption }, caption),
|
|
14
|
-
title && (React.createElement("div", { "data-test": "card-heading", className: cn(styles.heading, headerClassName) },
|
|
14
|
+
(title || headingContent || headingIcon) && (React.createElement("div", { "data-test": "card-heading", className: cn(styles.heading, headerClassName) },
|
|
15
15
|
headingIcon && React.createElement(Icon, { "data-test": "card-heading-icon", icon: headingIcon, className: cn(styles.icon, iconClassName), ariaHidden: true }),
|
|
16
|
-
React.createElement("h3", { "data-test": "card-heading-title", className: cn(styles.title, { [styles.space]: !!headingContent }, titleClassName) }, title),
|
|
16
|
+
title && (React.createElement("h3", { "data-test": "card-heading-title", className: cn(styles.title, { [styles.space]: !!headingContent }, titleClassName) }, title)),
|
|
17
17
|
headingContent)),
|
|
18
18
|
separator && React.createElement("div", { "data-test": "card-separator", className: styles.separator }),
|
|
19
19
|
children && (React.createElement("div", { "data-test": "card-content", className: cn(styles.content, contentClassName) }, children))));
|
package/lib/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AAExC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAgBvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,CAAC,EAClC,WAAW,EACX,KAAK,EACL,cAAc,EACd,SAAS,GAAG,KAAK,EACjB,WAAW,EAAE,QAAQ,EACrB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,OAAO,GACR,EAAE,EAAE,CAAC,CACJ,0CAAgB,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC;IAC/G,OAAO,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,IAAG,OAAO,CAAO;IAC1D,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAA;AAExC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAgBvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,CAAC,EAClC,WAAW,EACX,KAAK,EACL,cAAc,EACd,SAAS,GAAG,KAA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
|
|
|
7
7
|
export declare type OverlayProps = {
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
closable?: boolean;
|
|
10
|
+
closeText?: string | null;
|
|
10
11
|
headerClassName?: string;
|
|
12
|
+
footerClassName?: string;
|
|
11
13
|
contentClassName?: string;
|
|
14
|
+
wrapperClassName?: string;
|
|
12
15
|
icon?: IconProps['icon'];
|
|
13
16
|
onClose?: ReactModalProps['onRequestClose'];
|
|
14
17
|
contentWidth?: 'fullscreen' | 'normal';
|
|
15
18
|
title?: string;
|
|
16
19
|
headingContent?: ReactNode;
|
|
20
|
+
footerContent?: ReactNode;
|
|
17
21
|
} & DataTestProp & Exclude<ReactModalProps, 'onRequestClose' | 'shouldFocusAfterRender' | 'shouldReturnFocusAfterClose'>;
|
|
18
22
|
export declare const Overlay: FC<OverlayProps>;
|
package/lib/Overlay.js
CHANGED
|
@@ -15,7 +15,7 @@ import styles from './Overlay.module.scss';
|
|
|
15
15
|
* - Overlay always contains a title, cancel button in the top right corner, and content.
|
|
16
16
|
* - To close the Overlay, use cancel button in the top right corner or press "Esc" key.
|
|
17
17
|
*/
|
|
18
|
-
export const Overlay = ({ 'data-test': dataTest, children, className, headerClassName, contentClassName, icon, onClose, title, headingContent, contentWidth = 'normal', isOpen, closable = true, ...rest }) => {
|
|
18
|
+
export const Overlay = ({ 'data-test': dataTest, children, className, headerClassName, footerClassName, contentClassName, wrapperClassName, icon, onClose, title, headingContent, footerContent, contentWidth = 'normal', isOpen, closable = true, closeText = 'Cancel', ...rest }) => {
|
|
19
19
|
useIsomorphicLayoutEffect(() => {
|
|
20
20
|
if (isOpen) {
|
|
21
21
|
document.body.classList.add(styles.overlayed);
|
|
@@ -25,13 +25,13 @@ export const Overlay = ({ 'data-test': dataTest, children, className, headerClas
|
|
|
25
25
|
}
|
|
26
26
|
}, [isOpen]);
|
|
27
27
|
return (React.createElement(ReactModal, { "data-test": dataTest, portalClassName: styles.portal, className: cn(styles.modal, className), contentLabel: title, onRequestClose: onClose, shouldCloseOnOverlayClick: false, shouldCloseOnEsc: closable, shouldFocusAfterRender: true, shouldReturnFocusAfterClose: true, isOpen: isOpen, ...rest },
|
|
28
|
-
React.createElement("div", { "data-test": "overlay-wrapper", className: cn(styles.wrapper, { [styles.normal]: contentWidth === 'normal', [styles.fullscreen]: contentWidth === 'fullscreen' }) },
|
|
28
|
+
React.createElement("div", { "data-test": "overlay-wrapper", className: cn(styles.wrapper, { [styles.normal]: contentWidth === 'normal', [styles.fullscreen]: contentWidth === 'fullscreen' }, wrapperClassName) },
|
|
29
29
|
React.createElement("div", { "data-test": "overlay-header", className: cn(styles.header, headerClassName) },
|
|
30
30
|
icon && React.createElement(Icon, { "data-test": "overlay-header-icon", className: styles.icon, size: "medium", icon: icon, ariaHidden: true }),
|
|
31
31
|
title && (React.createElement("h1", { "data-test": "overlay-header-title", className: styles.title }, title)),
|
|
32
32
|
headingContent,
|
|
33
|
-
closable && (React.createElement(Link, { "data-test": "overlay-header-cancel-button", className: styles.close, component: "button", onClick: onClose, size: "small", iconClassName: styles.closeIcon, icon: X, ariaLabel:
|
|
34
|
-
|
|
35
|
-
React.createElement("div", { "data-test": "overlay-
|
|
33
|
+
closable && (React.createElement(Link, { "data-test": "overlay-header-cancel-button", className: styles.close, component: "button", onClick: onClose, size: "small", iconClassName: styles.closeIcon, icon: X, ariaLabel: closeText || 'Cancel' }, !!closeText && React.createElement("span", { className: styles.closeText }, closeText)))),
|
|
34
|
+
React.createElement("div", { "data-test": "overlay-content", className: cn(styles.content, contentClassName) }, children),
|
|
35
|
+
footerContent && (React.createElement("div", { "data-test": "overlay-footer", className: footerClassName }, footerContent)))));
|
|
36
36
|
};
|
|
37
37
|
//# sourceMappingURL=Overlay.js.map
|
package/lib/Overlay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.js","sourceRoot":"","sources":["../src/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,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AAS,EAAE,SAAS,IAAI,QAAQ,IAE/B,CAAC,CAAC,SAAS,IAAI,8BAAM,SAAS,EAAE,MAAM,CAAC,SAAS,IAAG,SAAS,CAAQ,CAChE,CACR,CACG;YACN,0CAAe,iBAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,IAC7E,QAAQ,CACL;YACL,aAAa,IAAI,CAChB,0CAAe,gBAAgB,EAAC,SAAS,EAAE,eAAe,IACvD,aAAa,CACV,CACP,CACG,CACK,CACd,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hazelcast/ui",
|
|
3
|
-
"version": "1.3.2-next.
|
|
3
|
+
"version": "1.3.2-next.18+254b6f0",
|
|
4
4
|
"description": "Hazelcast design system components",
|
|
5
5
|
"author": "",
|
|
6
6
|
"homepage": "https://github.com/hazelcast/frontend-shared#readme",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"webpack": "^5.65.0",
|
|
114
114
|
"yup": "^0.32.11"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "254b6f09b71b097c9fa1163af85699cccaedfc3d"
|
|
117
117
|
}
|