@hazelcast/ui 1.3.3-next.3 → 1.3.3-next.31
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/Alert.js +1 -1
- package/lib/Alert.js.map +1 -1
- package/lib/Alert.module.scss +1 -0
- package/lib/AppHeader/AppHeader.d.ts +16 -0
- package/lib/AppHeader/AppHeader.js +17 -0
- package/lib/AppHeader/AppHeader.js.map +1 -0
- package/lib/AppHeader/AppHeader.module.scss +29 -0
- package/lib/AppHeader/AppHeaderLogo/AppHeaderLogo.d.ts +12 -0
- package/lib/AppHeader/AppHeaderLogo/AppHeaderLogo.js +7 -0
- package/lib/AppHeader/AppHeaderLogo/AppHeaderLogo.js.map +1 -0
- package/lib/AppHeader/AppHeaderLogo/AppHeaderLogo.module.scss +29 -0
- package/lib/AppHeader/AppHeaderLogo/index.d.ts +1 -0
- package/lib/AppHeader/AppHeaderLogo/index.js +2 -0
- package/lib/AppHeader/AppHeaderLogo/index.js.map +1 -0
- package/lib/AppHeader/AppHeaderMenu/AppHeaderMenu.d.ts +8 -0
- package/lib/AppHeader/AppHeaderMenu/AppHeaderMenu.js +15 -0
- package/lib/AppHeader/AppHeaderMenu/AppHeaderMenu.js.map +1 -0
- package/lib/AppHeader/AppHeaderMenu/AppHeaderMenu.module.scss +20 -0
- package/lib/AppHeader/AppHeaderMenu/index.d.ts +1 -0
- package/lib/AppHeader/AppHeaderMenu/index.js +2 -0
- package/lib/AppHeader/AppHeaderMenu/index.js.map +1 -0
- package/lib/AppHeader/EnvironmentBadge/EnvironmentBadge.d.ts +5 -0
- package/lib/AppHeader/EnvironmentBadge/EnvironmentBadge.js +10 -0
- package/lib/AppHeader/EnvironmentBadge/EnvironmentBadge.js.map +1 -0
- package/lib/AppHeader/EnvironmentBadge/EnvironmentBadge.module.scss +13 -0
- package/lib/AppHeader/EnvironmentBadge/index.d.ts +1 -0
- package/lib/AppHeader/EnvironmentBadge/index.js +2 -0
- package/lib/AppHeader/EnvironmentBadge/index.js.map +1 -0
- package/lib/AppHeader/SelectCluster/SelectCluster.d.ts +9 -0
- package/lib/AppHeader/SelectCluster/SelectCluster.js +37 -0
- package/lib/AppHeader/SelectCluster/SelectCluster.js.map +1 -0
- package/lib/AppHeader/SelectCluster/SelectCluster.module.scss +101 -0
- package/lib/AppHeader/SelectCluster/index.d.ts +1 -0
- package/lib/AppHeader/SelectCluster/index.js +2 -0
- package/lib/AppHeader/SelectCluster/index.js.map +1 -0
- package/lib/AppHeader/index.d.ts +1 -0
- package/lib/AppHeader/index.js +2 -0
- package/lib/AppHeader/index.js.map +1 -0
- package/lib/AppSidebar/AppSidebar.d.ts +12 -0
- package/lib/AppSidebar/AppSidebar.js +31 -0
- package/lib/AppSidebar/AppSidebar.js.map +1 -0
- package/lib/AppSidebar/AppSidebar.module.scss +66 -0
- package/lib/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.d.ts +6 -0
- package/lib/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js +22 -0
- package/lib/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js.map +1 -0
- package/lib/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.module.scss +16 -0
- package/lib/AppSidebar/AppSidebarFavoriteButton/index.d.ts +1 -0
- package/lib/AppSidebar/AppSidebarFavoriteButton/index.js +2 -0
- package/lib/AppSidebar/AppSidebarFavoriteButton/index.js.map +1 -0
- package/lib/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.d.ts +7 -0
- package/lib/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js +11 -0
- package/lib/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.js.map +1 -0
- package/lib/AppSidebar/AppSidebarFavorites/AppSidebarFavorites.module.scss +13 -0
- package/lib/AppSidebar/AppSidebarFavorites/index.d.ts +1 -0
- package/lib/AppSidebar/AppSidebarFavorites/index.js +2 -0
- package/lib/AppSidebar/AppSidebarFavorites/index.js.map +1 -0
- package/lib/AppSidebar/AppSidebarItem/AppSidebarItem.d.ts +28 -0
- package/lib/AppSidebar/AppSidebarItem/AppSidebarItem.js +23 -0
- package/lib/AppSidebar/AppSidebarItem/AppSidebarItem.js.map +1 -0
- package/lib/AppSidebar/AppSidebarItem/AppSidebarItem.module.scss +92 -0
- package/lib/AppSidebar/AppSidebarItem/index.d.ts +1 -0
- package/lib/AppSidebar/AppSidebarItem/index.js +2 -0
- package/lib/AppSidebar/AppSidebarItem/index.js.map +1 -0
- package/lib/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.d.ts +6 -0
- package/lib/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js +6 -0
- package/lib/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.js.map +1 -0
- package/lib/AppSidebar/AppSidebarMenuItemCounter/AppSidebarMenuItemCounter.module.scss +24 -0
- package/lib/AppSidebar/AppSidebarMenuItemCounter/index.d.ts +1 -0
- package/lib/AppSidebar/AppSidebarMenuItemCounter/index.js +2 -0
- package/lib/AppSidebar/AppSidebarMenuItemCounter/index.js.map +1 -0
- package/lib/AppSidebar/AppSidebarSection/AppSidebarSection.d.ts +13 -0
- package/lib/AppSidebar/AppSidebarSection/AppSidebarSection.js +15 -0
- package/lib/AppSidebar/AppSidebarSection/AppSidebarSection.js.map +1 -0
- package/lib/AppSidebar/AppSidebarSection/AppSidebarSection.module.scss +58 -0
- package/lib/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.d.ts +12 -0
- package/lib/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js +55 -0
- package/lib/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js.map +1 -0
- package/lib/AppSidebar/AppSidebarSection/appSidebarSectionContext.d.ts +2 -0
- package/lib/AppSidebar/AppSidebarSection/appSidebarSectionContext.js +3 -0
- package/lib/AppSidebar/AppSidebarSection/appSidebarSectionContext.js.map +1 -0
- package/lib/AppSidebar/AppSidebarSection/index.d.ts +1 -0
- package/lib/AppSidebar/AppSidebarSection/index.js +2 -0
- package/lib/AppSidebar/AppSidebarSection/index.js.map +1 -0
- package/lib/AppSidebar/appSidebarContext.d.ts +10 -0
- package/lib/AppSidebar/appSidebarContext.js +11 -0
- package/lib/AppSidebar/appSidebarContext.js.map +1 -0
- package/lib/AppSidebar/index.d.ts +5 -0
- package/lib/AppSidebar/index.js +6 -0
- package/lib/AppSidebar/index.js.map +1 -0
- package/lib/AutocompleteField.js +3 -3
- package/lib/AutocompleteField.js.map +1 -1
- package/lib/Button.d.ts +8 -8
- package/lib/Button.js +14 -42
- package/lib/Button.js.map +1 -1
- package/lib/Button.module.scss +40 -10
- package/lib/Calendar/Calendar.d.ts +2 -1
- package/lib/Calendar/Calendar.js +4 -4
- package/lib/Calendar/Calendar.js.map +1 -1
- package/lib/Calendar/components/CalendarInput.d.ts +3 -2
- package/lib/Calendar/components/CalendarInput.js +1 -1
- package/lib/Calendar/components/CalendarInput.js.map +1 -1
- package/lib/Calendar/components/CalendarTime.d.ts +3 -2
- package/lib/Calendar/components/CalendarTime.js +5 -5
- package/lib/Calendar/components/CalendarTime.js.map +1 -1
- package/lib/Card.d.ts +2 -0
- package/lib/Card.js +3 -2
- package/lib/Card.js.map +1 -1
- package/lib/Card.module.scss +51 -18
- package/lib/CenteredLoader.d.ts +5 -0
- package/lib/CenteredLoader.js +6 -0
- package/lib/CenteredLoader.js.map +1 -0
- package/lib/CenteredLoader.module.scss +11 -0
- package/lib/Checkbox.js +2 -2
- package/lib/Checkbox.js.map +1 -1
- package/lib/Checkbox.module.scss +2 -2
- package/lib/Dialog.js +22 -18
- package/lib/Dialog.js.map +1 -1
- package/lib/Error.d.ts +2 -1
- package/lib/Error.js +1 -1
- package/lib/Error.js.map +1 -1
- package/lib/Help.d.ts +2 -1
- package/lib/Help.js +2 -2
- package/lib/Help.js.map +1 -1
- package/lib/Icon.d.ts +2 -1
- package/lib/Icon.js +2 -2
- package/lib/Icon.js.map +1 -1
- package/lib/IconButton.js +3 -3
- package/lib/IconButton.js.map +1 -1
- package/lib/InteractiveList.d.ts +6 -5
- package/lib/InteractiveList.js +10 -10
- package/lib/InteractiveList.js.map +1 -1
- package/lib/Label.d.ts +2 -1
- package/lib/Label.js +1 -1
- package/lib/Label.js.map +1 -1
- package/lib/Link.d.ts +1 -1
- package/lib/Link.js +1 -0
- package/lib/Link.js.map +1 -1
- package/lib/Link.module.scss +5 -0
- package/lib/Loader.d.ts +2 -1
- package/lib/Loader.js +2 -2
- package/lib/Loader.js.map +1 -1
- package/lib/Modal.js +4 -4
- package/lib/Modal.js.map +1 -1
- package/lib/Modal.module.scss +2 -1
- package/lib/NumberField.d.ts +1 -0
- package/lib/NumberField.js +27 -10
- package/lib/NumberField.js.map +1 -1
- package/lib/Overlay.js +3 -1
- package/lib/Overlay.js.map +1 -1
- package/lib/Overlay.module.scss +5 -2
- package/lib/Pagination.js +10 -10
- package/lib/Pagination.js.map +1 -1
- package/lib/Pagination.module.scss +4 -4
- package/lib/PasswordField.js +4 -4
- package/lib/PasswordField.js.map +1 -1
- package/lib/Radio.js +3 -3
- package/lib/Radio.js.map +1 -1
- package/lib/RadioGroup.js +3 -3
- package/lib/RadioGroup.js.map +1 -1
- package/lib/Select/Common.js +8 -12
- package/lib/Select/Common.js.map +1 -1
- package/lib/Select/Common.module.scss +1 -1
- package/lib/Select/MultiSelectField.js +4 -5
- package/lib/Select/MultiSelectField.js.map +1 -1
- package/lib/Select/MultiSelectFieldFormik.d.ts +2 -1
- package/lib/Select/MultiSelectFieldFormik.js.map +1 -1
- package/lib/Select/SelectField.d.ts +1 -0
- package/lib/Select/SelectField.js +4 -4
- package/lib/Select/SelectField.js.map +1 -1
- package/lib/Slider.module.scss +6 -6
- package/lib/Table/Cell.d.ts +5 -3
- package/lib/Table/Cell.js +4 -3
- package/lib/Table/Cell.js.map +1 -1
- package/lib/Table/Cell.module.scss +14 -5
- package/lib/Table/CellWrapper.d.ts +6 -6
- package/lib/Table/CellWrapper.js +6 -6
- package/lib/Table/CellWrapper.js.map +1 -1
- package/lib/Table/EnhancedRenderers.d.ts +8 -10
- package/lib/Table/EnhancedRenderers.js +7 -10
- package/lib/Table/EnhancedRenderers.js.map +1 -1
- package/lib/Table/Header.d.ts +9 -5
- package/lib/Table/Header.js +12 -7
- package/lib/Table/Header.js.map +1 -1
- package/lib/Table/Header.module.scss +12 -7
- package/lib/Table/Row.d.ts +5 -3
- package/lib/Table/Row.js +4 -4
- package/lib/Table/Row.js.map +1 -1
- package/lib/Table/Row.module.scss +15 -12
- package/lib/Table/Table.d.ts +21 -36
- package/lib/Table/Table.js +102 -87
- package/lib/Table/Table.js.map +1 -1
- package/lib/Table/Table.module.scss +6 -0
- package/lib/Table/TableContent.d.ts +7 -7
- package/lib/Table/TableContent.js +20 -14
- package/lib/Table/TableContent.js.map +1 -1
- package/lib/Table/helpers.d.ts +2 -0
- package/lib/Table/helpers.js +10 -0
- package/lib/Table/helpers.js.map +1 -0
- package/lib/Table/tableTypes.d.ts +80 -0
- package/lib/Table/tableTypes.js +2 -0
- package/lib/Table/tableTypes.js.map +1 -0
- package/lib/Table/useTrackTableState.d.ts +3 -0
- package/lib/Table/useTrackTableState.js +30 -0
- package/lib/Table/useTrackTableState.js.map +1 -0
- package/lib/Table/utils.d.ts +16 -0
- package/lib/Table/utils.js +121 -0
- package/lib/Table/utils.js.map +1 -0
- package/lib/Tabs/Tab.d.ts +1 -19
- package/lib/Tabs/Tab.js +2 -16
- package/lib/Tabs/Tab.js.map +1 -1
- package/lib/Tabs/Tab.module.scss +0 -4
- package/lib/Tabs/TabPanel.d.ts +2 -1
- package/lib/Tabs/TabPanel.js +2 -2
- package/lib/Tabs/TabPanel.js.map +1 -1
- package/lib/TextArea.js +3 -3
- package/lib/TextArea.js.map +1 -1
- package/lib/TextField.js +5 -5
- package/lib/TextField.js.map +1 -1
- package/lib/TimeField.js +3 -3
- package/lib/TimeField.js.map +1 -1
- package/lib/Toast.d.ts +2 -1
- package/lib/Toast.js +5 -5
- package/lib/Toast.js.map +1 -1
- package/lib/Toggle.js +5 -5
- package/lib/Toggle.js.map +1 -1
- package/lib/Tooltip.d.ts +3 -0
- package/lib/Tooltip.js +21 -15
- package/lib/Tooltip.js.map +1 -1
- package/lib/Tooltip.module.scss +102 -70
- package/lib/TruncatedText.d.ts +4 -1
- package/lib/TruncatedText.js +4 -4
- package/lib/TruncatedText.js.map +1 -1
- package/lib/TruncatedText.module.scss +4 -0
- package/lib/hooks/useOnClickOutside.d.ts +1 -1
- package/lib/hooks/useOnClickOutside.js +7 -1
- package/lib/hooks/useOnClickOutside.js.map +1 -1
- package/package.json +26 -20
- package/styles/constants/_colors.scss +36 -12
- package/styles/constants/_typography.scss +0 -7
- package/styles/helpers/_a11y.scss +8 -0
- package/styles/helpers/_gradients.scss +39 -6
- package/styles/helpers/_text.scss +9 -0
- package/styles/typography/fonts/UbuntuMono-Bold.woff2 +0 -0
- package/styles/typography/fonts/UbuntuMono-BoldItalic.woff2 +0 -0
- package/styles/typography/fonts/UbuntuMono-Italic.woff2 +0 -0
- package/styles/typography/fonts/UbuntuMono-Regular.woff2 +0 -0
- package/styles/typography/ubuntu-mono.css +31 -0
- package/lib/utils/test.d.ts +0 -3
- package/lib/utils/test.js +0 -8
- package/lib/utils/test.js.map +0 -1
package/lib/Button.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes, HTMLAttributes, ReactElement } from 'react';
|
|
2
|
-
import { IconProps } from './Icon';
|
|
2
|
+
import { IconProps, IconSize } from './Icon';
|
|
3
3
|
import { TooltipProps } from './Tooltip';
|
|
4
4
|
import { LinkRel, LinkTarget } from './Link';
|
|
5
|
-
|
|
5
|
+
import { DataTestProp } from '@hazelcast/helpers';
|
|
6
6
|
export type ButtonVariant = 'contained' | 'outlined' | 'text';
|
|
7
|
-
export type ButtonColor = 'primary' | 'secondary' | 'warning' | 'brand' | 'authPrimary' | 'authSecondary';
|
|
7
|
+
export type ButtonColor = 'primary' | 'secondary' | 'warning' | 'brand' | 'authPrimary' | 'authSecondary' | 'light';
|
|
8
8
|
export type ButtonSize = 'medium' | 'small';
|
|
9
9
|
export type ButtonAccessibleIconLeftProps = {
|
|
10
10
|
iconLeft: IconProps['icon'];
|
|
@@ -42,12 +42,9 @@ export type ButtonDisabledProps = {
|
|
|
42
42
|
};
|
|
43
43
|
export type ButtonOutlineType = 'outline' | 'inset';
|
|
44
44
|
export type ButtonCommonProps = {
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated Use variant + color instead
|
|
47
|
-
*/
|
|
48
|
-
kind?: ButtonKind;
|
|
49
45
|
children: string | ReactElement;
|
|
50
46
|
size?: ButtonSize;
|
|
47
|
+
iconSize?: IconSize;
|
|
51
48
|
color?: ButtonColor;
|
|
52
49
|
capitalize?: boolean;
|
|
53
50
|
bodyClassName?: string;
|
|
@@ -55,6 +52,9 @@ export type ButtonCommonProps = {
|
|
|
55
52
|
outlineClassName?: string;
|
|
56
53
|
outline?: ButtonOutlineType;
|
|
57
54
|
tooltip?: string;
|
|
55
|
+
tooltipColor?: TooltipProps['color'];
|
|
56
|
+
active?: boolean;
|
|
57
|
+
truncate?: boolean;
|
|
58
58
|
} & (ButtonDisabledProps | ButtonNotDisabledProps) & Pick<HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, 'className' | 'onClick' | 'tabIndex' | 'style'>;
|
|
59
59
|
export type ButtonTypeAnchorProps = {
|
|
60
60
|
component: 'a';
|
|
@@ -72,7 +72,7 @@ export type ButtonTypeButtonProps = {
|
|
|
72
72
|
loading?: boolean;
|
|
73
73
|
} & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'autoFocus' | 'type'>;
|
|
74
74
|
export type ButtonTypeProps = ButtonTypeAnchorProps | ButtonTypeButtonProps;
|
|
75
|
-
export type ButtonProps<T = ButtonTypeProps> = ButtonCommonProps & T & ButtonAccessibleIconLeftProps & ButtonAccessibleIconRightProps;
|
|
75
|
+
export type ButtonProps<T = ButtonTypeProps> = ButtonCommonProps & T & ButtonAccessibleIconLeftProps & ButtonAccessibleIconRightProps & DataTestProp;
|
|
76
76
|
/**
|
|
77
77
|
* ### Purpose
|
|
78
78
|
* Make it clear what users should do to continue with their main flow by using buttons to highlight the main actions they can take.
|
package/lib/Button.js
CHANGED
|
@@ -8,31 +8,6 @@ import { Tooltip } from './Tooltip';
|
|
|
8
8
|
import { Loader } from './Loader';
|
|
9
9
|
import styles from './Button.module.scss';
|
|
10
10
|
const capitalizeFirstCharacter = (str) => `${str[0].toUpperCase()}${str.slice(1)}`;
|
|
11
|
-
const resolveButtonKindStyles = (kind) => {
|
|
12
|
-
switch (kind) {
|
|
13
|
-
case 'secondary':
|
|
14
|
-
return {
|
|
15
|
-
[styles.colorPrimary]: true,
|
|
16
|
-
[styles.variantOutlined]: true,
|
|
17
|
-
};
|
|
18
|
-
case 'transparent':
|
|
19
|
-
return {
|
|
20
|
-
[styles.colorPrimary]: true,
|
|
21
|
-
[styles.variantText]: true,
|
|
22
|
-
};
|
|
23
|
-
case 'danger': {
|
|
24
|
-
return {
|
|
25
|
-
[styles.colorSecondary]: true,
|
|
26
|
-
[styles.variantContained]: true,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
default:
|
|
30
|
-
return {
|
|
31
|
-
[styles.colorPrimary]: true,
|
|
32
|
-
[styles.variantContained]: true,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
11
|
/**
|
|
37
12
|
* ### Purpose
|
|
38
13
|
* Make it clear what users should do to continue with their main flow by using buttons to highlight the main actions they can take.
|
|
@@ -53,38 +28,35 @@ const resolveButtonKindStyles = (kind) => {
|
|
|
53
28
|
* - **Danger**: Use danger button for potentially destructive actions.
|
|
54
29
|
* - **Transparent**: Use for IconButton and similar use-cases.
|
|
55
30
|
*/
|
|
56
|
-
export const Button = forwardRef(({
|
|
31
|
+
export const Button = forwardRef(({ component: Component = 'button', className, bodyClassName, outlineClassName, outline = 'outline', children, capitalize = true,
|
|
57
32
|
// Disabled tooltip
|
|
58
33
|
disabled, disabledTooltip, disabledTooltipVisible, disabledTooltipPlacement,
|
|
59
34
|
// Left icon
|
|
60
35
|
iconLeft, iconLeftAriaLabel, iconLeftColor, iconLeftClassName,
|
|
61
36
|
// Right icon
|
|
62
|
-
iconRight, iconRightAriaLabel, iconRightColor, iconRightClassName, rel = 'noopener', target, type = 'button', loading, variant = 'contained', color = 'primary', tooltip, size = 'small', ...rest }, ref) => {
|
|
37
|
+
iconRight, iconRightAriaLabel, iconRightColor, iconRightClassName, rel = 'noopener', target, type = 'button', loading, variant = 'contained', color = 'primary', tooltip, size = 'small', active, truncate = true, iconSize: propIconSize, tooltipColor, ...rest }, ref) => {
|
|
63
38
|
const tooltipId = useUID();
|
|
64
|
-
const iconSize = size === 'medium' ? 'smallMedium' : 'small';
|
|
39
|
+
const iconSize = propIconSize || (size === 'medium' ? 'smallMedium' : 'small');
|
|
65
40
|
const relFinal = Array.isArray(rel) ? rel.join(' ') : rel;
|
|
66
41
|
const loadingAnimationOnRight = loading && iconRight && iconRightAriaLabel && !(iconLeft && iconLeftAriaLabel);
|
|
67
|
-
return (React.createElement(Tooltip, { id: tooltipId, content: disabled ? disabledTooltip : tooltip, visible: disabled && disabledTooltipVisible, placement: disabledTooltipPlacement }, (tooltipRef, onMouseEnter, onMouseLeave) => (React.createElement(Component, { "data-test": "button", className: cn(styles.button, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
[styles[`color${capitalizeFirstCharacter(color)}`]]: true,
|
|
72
|
-
[styles[`variant${capitalizeFirstCharacter(variant)}`]]: true,
|
|
73
|
-
}),
|
|
42
|
+
return (React.createElement(Tooltip, { id: tooltipId, color: tooltipColor, content: disabled ? disabledTooltip : tooltip, visible: disabled && disabledTooltipVisible, placement: disabledTooltipPlacement }, (tooltipRef, onMouseEnter, onMouseLeave) => (React.createElement(Component, { "data-test": "button", className: cn(styles.button, {
|
|
43
|
+
[styles[`color${capitalizeFirstCharacter(color)}`]]: true,
|
|
44
|
+
[styles[`variant${capitalizeFirstCharacter(variant)}`]]: true,
|
|
45
|
+
[styles.active]: active,
|
|
74
46
|
[styles[size]]: size !== 'small',
|
|
75
47
|
}, className), "aria-describedby": disabled ? tooltipId : undefined, disabled: disabled !== null && disabled !== void 0 ? disabled : loading, rel: Component === 'a' ? relFinal : undefined, target: Component === 'a' ? target : undefined, type: Component === 'button' ? type : undefined, ref: mergeRefs([ref, tooltipRef]), ...rest },
|
|
76
48
|
React.createElement("span", { "data-test": "button-outline", className: cn(styles.outline, { [styles.inset]: outline === 'inset' }, outlineClassName) }),
|
|
77
49
|
React.createElement("span", { className: cn(styles.body, bodyClassName), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave },
|
|
78
50
|
loading && !loadingAnimationOnRight && React.createElement(Loader, { className: styles.iconLeft, size: iconSize }),
|
|
79
51
|
iconLeft && iconLeftAriaLabel && !loading && (React.createElement(Icon, { icon: iconLeft, ariaLabel: iconLeftAriaLabel, "data-test": "button-icon-left", className: cn(styles.iconLeft, iconLeftClassName), size: iconSize, color: iconLeftColor })),
|
|
80
|
-
React.createElement(TruncatedText, { text: capitalize && typeof children === 'string' ? children.toUpperCase() : children,
|
|
52
|
+
truncate ? (React.createElement(TruncatedText, { text: capitalize && typeof children === 'string' ? children.toUpperCase() : children,
|
|
81
53
|
/*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
tooltipVisible: disabled && disabledTooltipVisible !== false ? false : undefined }),
|
|
54
|
+
If a button is disabled and text is long we don't want to show 2 popups.
|
|
55
|
+
1. In case a button is disabled and no `disabledTooltipVisible` is enforced, we just hide truncated popup.
|
|
56
|
+
2. In case a button is disabled and disabledTooltip is hidden with a false flag, there is a space to show
|
|
57
|
+
the truncated popup -> setting it to undefined will leave the default behaviour.
|
|
58
|
+
*/
|
|
59
|
+
tooltipVisible: disabled && disabledTooltipVisible !== false ? false : undefined })) : (children),
|
|
88
60
|
loadingAnimationOnRight && React.createElement(Loader, { className: styles.iconRight, size: iconSize }),
|
|
89
61
|
!loadingAnimationOnRight && iconRight && iconRightAriaLabel && (React.createElement(Icon, { icon: iconRight, ariaLabel: iconRightAriaLabel, "data-test": "button-icon-right", className: cn(styles.iconRight, iconRightClassName), size: iconSize, color: iconRightColor })))))));
|
|
90
62
|
});
|
package/lib/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwB,UAAU,EAAgC,MAAM,OAAO,CAAA;AAC7F,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,SAAS,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,EAAE,IAAI,EAAuB,MAAM,QAAQ,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAA;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,MAAM,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwB,UAAU,EAAgC,MAAM,OAAO,CAAA;AAC7F,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,SAAS,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,EAAE,IAAI,EAAuB,MAAM,QAAQ,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAA;AAEjD,OAAO,EAA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SAAS,EAAE,kBAAkB,eACnB,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,EACnD,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,cAAc,GACrB,CACH,CACI,CACG,CACb,CACO,CACX,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA"}
|
package/lib/Button.module.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
1
2
|
@use '../styles/constants' as c;
|
|
2
3
|
@use '../styles/helpers' as h;
|
|
3
4
|
|
|
@@ -174,12 +175,12 @@
|
|
|
174
175
|
&.hover,
|
|
175
176
|
&:focus-visible,
|
|
176
177
|
&.focus {
|
|
177
|
-
@include buttonColor(
|
|
178
|
+
@include buttonColor(color.adjust(c.$colorBrand, $lightness: 20%));
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
&:active,
|
|
181
182
|
&.active {
|
|
182
|
-
@include buttonColor(
|
|
183
|
+
@include buttonColor(color.adjust(c.$colorBrand, $lightness: -10%));
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
&.variantContained {
|
|
@@ -192,18 +193,18 @@
|
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
&AuthPrimary {
|
|
195
|
-
@include buttonColor(c.$
|
|
196
|
+
@include buttonColor(c.$colorBrandPrimary);
|
|
196
197
|
|
|
197
198
|
&:hover,
|
|
198
199
|
&.hover,
|
|
199
200
|
&:focus-visible,
|
|
200
201
|
&.focus {
|
|
201
|
-
@include buttonColor(
|
|
202
|
+
@include buttonColor(color.adjust(c.$colorBrandPrimary, $lightness: 10%));
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
&:active,
|
|
205
206
|
&.active {
|
|
206
|
-
@include buttonColor(
|
|
207
|
+
@include buttonColor(color.adjust(c.$colorBrandPrimary, $lightness: -10%));
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
&.variantContained {
|
|
@@ -216,7 +217,7 @@
|
|
|
216
217
|
}
|
|
217
218
|
|
|
218
219
|
&AuthSecondary {
|
|
219
|
-
@include buttonColor(c.$
|
|
220
|
+
@include buttonColor(c.$colorAuthSecondary);
|
|
220
221
|
|
|
221
222
|
border-color: c.$colorNeutralWhite;
|
|
222
223
|
|
|
@@ -224,12 +225,12 @@
|
|
|
224
225
|
&.hover,
|
|
225
226
|
&:focus-visible,
|
|
226
227
|
&.focus {
|
|
227
|
-
@include buttonColor(
|
|
228
|
+
@include buttonColor(color.adjust(c.$colorAuthSecondary, $lightness: 10%));
|
|
228
229
|
}
|
|
229
230
|
|
|
230
231
|
&:active,
|
|
231
232
|
&.active {
|
|
232
|
-
@include buttonColor(
|
|
233
|
+
@include buttonColor(color.adjust(c.$colorAuthSecondary, $lightness: -10%));
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
&.variantContained {
|
|
@@ -237,7 +238,7 @@
|
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
&.variantOutlined {
|
|
240
|
-
border-color: c.$
|
|
241
|
+
border-color: c.$colorAuthSecondary;
|
|
241
242
|
}
|
|
242
243
|
|
|
243
244
|
&:disabled {
|
|
@@ -245,6 +246,36 @@
|
|
|
245
246
|
background-color: c.$colorNeutralWhite;
|
|
246
247
|
}
|
|
247
248
|
}
|
|
249
|
+
|
|
250
|
+
&Light {
|
|
251
|
+
@include buttonColor(c.$colorNeutralLighter);
|
|
252
|
+
|
|
253
|
+
border-color: c.$colorNeutralLighter;
|
|
254
|
+
|
|
255
|
+
&:hover,
|
|
256
|
+
&.hover,
|
|
257
|
+
&:focus-visible,
|
|
258
|
+
&.focus {
|
|
259
|
+
@include buttonColor(color.adjust(c.$colorBrandText, $lightness: 10%));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&:active,
|
|
263
|
+
&.active {
|
|
264
|
+
@include buttonColor(c.$colorBrandText);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&.variantContained {
|
|
268
|
+
color: c.$colorText;
|
|
269
|
+
|
|
270
|
+
&:disabled {
|
|
271
|
+
@include disabledButtonColor;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&:disabled {
|
|
276
|
+
@include buttonColor(c.$colorNeutralLight);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
248
279
|
}
|
|
249
280
|
|
|
250
281
|
&.variant {
|
|
@@ -281,7 +312,6 @@
|
|
|
281
312
|
}
|
|
282
313
|
|
|
283
314
|
&Text {
|
|
284
|
-
color: inherit;
|
|
285
315
|
background: none;
|
|
286
316
|
|
|
287
317
|
&:hover,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ReactDatePickerProps } from 'react-datepicker';
|
|
3
|
+
import { DataTestProp } from '@hazelcast/helpers';
|
|
3
4
|
import { PortalContainer } from '../utils/portal';
|
|
4
5
|
export type CalendarSize = 'medium' | 'small';
|
|
5
6
|
export type CalendarProps = {
|
|
@@ -12,5 +13,5 @@ export type CalendarProps = {
|
|
|
12
13
|
container?: PortalContainer;
|
|
13
14
|
inPortal?: boolean;
|
|
14
15
|
dateFormat?: string;
|
|
15
|
-
} & Omit<ReactDatePickerProps, 'value' | 'onChange' | 'dateFormat'
|
|
16
|
+
} & Omit<ReactDatePickerProps, 'value' | 'onChange' | 'dateFormat'> & DataTestProp;
|
|
16
17
|
export declare const Calendar: FC<CalendarProps>;
|
package/lib/Calendar/Calendar.js
CHANGED
|
@@ -5,8 +5,8 @@ import DatePicker from 'react-datepicker';
|
|
|
5
5
|
import { CalendarInput } from './components/CalendarInput';
|
|
6
6
|
import { CalendarHeader } from './components/CalendarHeader';
|
|
7
7
|
import { CalendarTime } from './components/CalendarTime';
|
|
8
|
-
import styles from './Calendar.module.scss';
|
|
9
8
|
import { getPortalContainer } from '../utils/portal';
|
|
9
|
+
import styles from './Calendar.module.scss';
|
|
10
10
|
const DATE_FORMAT = 'yyyy-MM-dd';
|
|
11
11
|
const TIME_FORMAT = 'HH:mm';
|
|
12
12
|
const CalendarPopperContainer = (container, inPortal) =>
|
|
@@ -20,17 +20,17 @@ const CalendarPopperContainer = (container, inPortal) =>
|
|
|
20
20
|
}
|
|
21
21
|
return container && children ? createPortal(content, container) : null;
|
|
22
22
|
};
|
|
23
|
-
export const Calendar = ({ calendarClassName, className, containerClassName, date, inputLabel, inputClassName, onDateChange, showTimeInput, size = 'medium', container = `body`, inPortal = false, dateFormat = DATE_FORMAT, timeFormat = TIME_FORMAT, ...props }) => {
|
|
23
|
+
export const Calendar = ({ calendarClassName, className, containerClassName, date, inputLabel, inputClassName, onDateChange, showTimeInput, size = 'medium', container = `body`, inPortal = false, dateFormat = DATE_FORMAT, timeFormat = TIME_FORMAT, 'data-test': dataTest = 'calendar', ...props }) => {
|
|
24
24
|
const PopperContainer = useMemo(() => CalendarPopperContainer(getPortalContainer(container), inPortal), [container, inPortal]);
|
|
25
25
|
return (React.createElement("div", { className: cn(styles.container, {
|
|
26
26
|
[styles.time]: showTimeInput,
|
|
27
27
|
}, containerClassName) },
|
|
28
|
-
React.createElement(DatePicker, { ...props, calendarClassName: cn(styles.calendar, calendarClassName), className: className,
|
|
28
|
+
React.createElement(DatePicker, { ...props, "data-test": dataTest, calendarClassName: cn(styles.calendar, calendarClassName), className: className,
|
|
29
29
|
/*
|
|
30
30
|
* Note: The library instantiates the component using React.cloneElement
|
|
31
31
|
* Source: https://github.com/Hacker0x01/react-datepicker/blob/master/src/index.jsx#L926
|
|
32
32
|
*/
|
|
33
|
-
customInput: React.createElement(CalendarInput, { label: inputLabel, textFieldSize: size, className: inputClassName }), customTimeInput: React.createElement(CalendarTime,
|
|
33
|
+
customInput: React.createElement(CalendarInput, { "data-test": `${dataTest}-input`, label: inputLabel, textFieldSize: size, className: inputClassName }), customTimeInput: React.createElement(CalendarTime, { "data-test": `${dataTest}-time` }), dateFormat: showTimeInput ? `${dateFormat} ${timeFormat}` : dateFormat, onChange: onDateChange, popperContainer: PopperContainer,
|
|
34
34
|
/*
|
|
35
35
|
* Note:
|
|
36
36
|
* '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,KAAK,EAAE,EAAM,OAAO,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,UAAoC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,OAAO,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,UAAoC,MAAM,kBAAkB,CAAA;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAmB,MAAM,iBAAiB,CAAA;AAErE,OAAO,MAAM,MAAM,wBAAwB,CAAA;AAE3C,MAAM,WAAW,GAAG,YAAY,CAAA;AAChC,MAAM,WAAW,GAAG,OAAO,CAAA;AAE3B,MAAM,uBAAuB,GAC3B,CAAC,SAA6B,EAAE,QAAiB,EAAM,EAAE;AACzD,8CAA8C;AAC9C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACf,MAAM,OAAO,GAAG,mEAAmE;KACjF,CACE,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM;QAC3B,0CAAe,8BAA8B,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AO,GAAI,EAChE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,EACtE,QAAQ,EAAE,YAAY,EACtB,eAAe,EAAE,eAAe;YAChC;;;;eAIG;YACH,kBAAkB,EAAE,cAAc,EAClC,QAAQ,EAAE,IAAI,EACd,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,KAAK,EACtB,aAAa,EAAE,aAAa,GAC5B,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { FC, ChangeEvent, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { DataTestProp } from '@hazelcast/helpers';
|
|
2
3
|
import { CalendarSize } from '../Calendar';
|
|
3
4
|
export type CalendarInputInternalProps = {
|
|
4
5
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
-
} & CalendarInputExtraProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>;
|
|
6
|
+
} & CalendarInputExtraProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & Required<DataTestProp>;
|
|
6
7
|
export declare const CalendarInputInternal: React.ForwardRefExoticComponent<{
|
|
7
8
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
-
} & CalendarInputExtraProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
} & CalendarInputExtraProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> & Required<DataTestProp> & React.RefAttributes<HTMLInputElement>>;
|
|
9
10
|
export type CalendarInputExtraProps = {
|
|
10
11
|
label?: string;
|
|
11
12
|
textFieldSize?: CalendarSize;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Calendar } from 'react-feather';
|
|
3
3
|
import { TextField } from '../../TextField';
|
|
4
|
-
export const CalendarInputInternal = forwardRef(({ className, value, onChange, label, textFieldSize, ...props }, ref) => (React.createElement(TextField, { ...props, mRef: ref, size: textFieldSize, "data-test":
|
|
4
|
+
export const CalendarInputInternal = forwardRef(({ className, value, onChange, label, textFieldSize, 'data-test': dataTest, ...props }, ref) => (React.createElement(TextField, { ...props, mRef: ref, size: textFieldSize, "data-test": dataTest, value: value === null || value === void 0 ? void 0 : value.toString(), onChange: onChange, inputContainerClassName: className, type: "text", name: "calendar-input", label: label, inputTrailingIcon: Calendar, inputTrailingIconLabel: "Calendar Icon" })));
|
|
5
5
|
CalendarInputInternal.displayName = 'CalendarInputInternal';
|
|
6
6
|
export const CalendarInput = forwardRef((props, ref) => {
|
|
7
7
|
// Note: Cast the "unknown" props to the actual type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarInput.js","sourceRoot":"","sources":["../../../src/Calendar/components/CalendarInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwC,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"CalendarInput.js","sourceRoot":"","sources":["../../../src/Calendar/components/CalendarInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwC,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAS3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAC7C,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC9F,oBAAC,SAAS,OACJ,KAAK,EACT,IAAI,EAAE,GAAG,EACT,IAAI,EAAE,aAAa,eACR,QAAQ,EACnB,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,EACxB,QAAQ,EAAE,QAAQ,EAClB,uBAAuB,EAAE,SAAS,EAClC,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAE,KAAK,EACZ,iBAAiB,EAAE,QAAQ,EAC3B,sBAAsB,EAAC,eAAe,GACtC,CACH,CACF,CAAA;AACD,qBAAqB,CAAC,WAAW,GAAG,uBAAuB,CAAA;AAgB3D,MAAM,CAAC,MAAM,aAAa,GAA2B,UAAU,CAAuC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACnH,oDAAoD;IACpD,MAAM,UAAU,GAAG,KAAmC,CAAA;IAEtD,OAAO,oBAAC,qBAAqB,IAAC,GAAG,EAAE,GAAG,KAAM,UAAU,GAAI,CAAA;AAC5D,CAAC,CAAC,CAAA;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { DataTestProp } from '@hazelcast/helpers';
|
|
2
3
|
export type CalendarTimeInternalProps = {
|
|
3
4
|
date: Date;
|
|
4
5
|
onChange: (timeString: string) => void;
|
|
5
6
|
value: string;
|
|
6
|
-
};
|
|
7
|
+
} & DataTestProp;
|
|
7
8
|
export declare const CalendarTimeInternal: FC<CalendarTimeInternalProps>;
|
|
8
|
-
export type CalendarTimeProps = unknown
|
|
9
|
+
export type CalendarTimeProps = unknown & Required<DataTestProp>;
|
|
9
10
|
export declare const CalendarTime: FC<CalendarTimeProps>;
|
|
@@ -6,7 +6,7 @@ import { TimeField } from '../../TimeField';
|
|
|
6
6
|
import { useRefValue } from '../../hooks';
|
|
7
7
|
import styles from './CalendarTime.module.scss';
|
|
8
8
|
const DATE_FORMAT = 'HH:mm';
|
|
9
|
-
export const CalendarTimeInternal = ({ date, value, onChange }) => {
|
|
9
|
+
export const CalendarTimeInternal = ({ date, value, onChange, 'data-test': dataTest = 'calendar-time' }) => {
|
|
10
10
|
const [time, setTime] = useState(value);
|
|
11
11
|
const [timeInputError, setTimeInputError] = useState();
|
|
12
12
|
const getValue = useRefValue(value);
|
|
@@ -56,10 +56,10 @@ export const CalendarTimeInternal = ({ date, value, onChange }) => {
|
|
|
56
56
|
setTime(timeStringWithoutAm);
|
|
57
57
|
}
|
|
58
58
|
}, [onChange, getValue, date]);
|
|
59
|
-
return (React.createElement("div", { "data-test":
|
|
60
|
-
React.createElement("div", { "data-test":
|
|
61
|
-
React.createElement(TimeField, { showAriaLabel: true, size: "small", label: "Time Input", error: timeInputError, name: "time", value: time.toString(), inputClassName: styles.timeInput, onChange: handleTimeInputChange })),
|
|
62
|
-
React.createElement("div", { "data-test":
|
|
59
|
+
return (React.createElement("div", { "data-test": dataTest, className: styles.container },
|
|
60
|
+
React.createElement("div", { "data-test": `${dataTest}-header`, className: styles.header },
|
|
61
|
+
React.createElement(TimeField, { showAriaLabel: true, size: "small", label: "Time Input", error: timeInputError, name: "time", value: time.toString(), "data-test": `${dataTest}-input`, inputClassName: styles.timeInput, onChange: handleTimeInputChange })),
|
|
62
|
+
React.createElement("div", { "data-test": `${dataTest}-timePoints`, className: styles.timePoints }, timePoints.map((tP) => (React.createElement(Button, { className: styles.timePoint, bodyClassName: styles.timePointBody, key: tP, variant: "text", onClick: handleDateClick(tP) }, tP))))));
|
|
63
63
|
};
|
|
64
64
|
export const CalendarTime = (props) => {
|
|
65
65
|
// Note: Cast the "unknown" props to the actual type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarTime.js","sourceRoot":"","sources":["../../../src/Calendar/components/CalendarTime.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmB,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;
|
|
1
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MAAM,CAAC,UAAU,IACnE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CACtB,oBAAC,MAAM,IAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE,CAAC,IAC3H,EAAE,CACI,CACV,CAAC,CACE,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAUD,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,KAAK,EAAE,EAAE;IAC3D,oDAAoD;IACpD,MAAM,UAAU,GAAG,KAAkC,CAAA;IAErD,OAAO,oBAAC,oBAAoB,OAAK,UAAU,GAAI,CAAA;AACjD,CAAC,CAAA"}
|
package/lib/Card.d.ts
CHANGED
|
@@ -5,8 +5,10 @@ export type CardProps = {
|
|
|
5
5
|
headingIcon?: IconProps['icon'];
|
|
6
6
|
caption?: ReactNode;
|
|
7
7
|
title?: string;
|
|
8
|
+
titleTagName?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
8
9
|
headingContent?: ReactNode;
|
|
9
10
|
separator?: boolean;
|
|
11
|
+
variant?: 'bordered' | 'default';
|
|
10
12
|
children: ReactNode;
|
|
11
13
|
className?: string;
|
|
12
14
|
iconClassName?: string;
|
package/lib/Card.js
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Icon } from './Icon';
|
|
4
4
|
import styles from './Card.module.scss';
|
|
5
|
+
const Title = ({ as: Tag, ...props }) => React.createElement(Tag, { "data-test": "card-heading-title", ...props });
|
|
5
6
|
/**
|
|
6
7
|
* ### Purpose
|
|
7
8
|
* Card components define content hierarchy (visual and logical), separating content into "groups".
|
|
@@ -9,11 +10,11 @@ import styles from './Card.module.scss';
|
|
|
9
10
|
* ### General Info
|
|
10
11
|
* - Card can be rendered with an optional separator and/or icon.
|
|
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
|
+
export const Card = ({ headingIcon, title, headingContent, separator = false, variant = 'default', 'data-test': dataTest, children, titleTagName = 'h2', 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, [styles.bordered]: variant === 'bordered' }, className) },
|
|
13
14
|
caption && React.createElement("div", { className: styles.caption }, caption),
|
|
14
15
|
(title || headingContent || headingIcon) && (React.createElement("div", { "data-test": "card-heading", className: cn(styles.heading, headerClassName) },
|
|
15
16
|
headingIcon && React.createElement(Icon, { "data-test": "card-heading-icon", icon: headingIcon, className: cn(styles.icon, iconClassName), ariaHidden: true }),
|
|
16
|
-
title && (React.createElement(
|
|
17
|
+
title && (React.createElement(Title, { as: titleTagName, className: cn(styles.title, { [styles.space]: !!headingContent }, titleClassName) }, title)),
|
|
17
18
|
headingContent)),
|
|
18
19
|
separator && React.createElement("div", { "data-test": "card-separator", className: styles.separator }),
|
|
19
20
|
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,
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,IAAI,EAA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AC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,cAAc,EAAE,EAAE,cAAc,CAAC,IACvG,KAAK,CACA,CACT;QACA,cAAc,CACX,CACP;IAEA,SAAS,IAAI,0CAAe,gBAAgB,EAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAI;IAE5E,QAAQ,IAAI,CACX,0CAAe,cAAc,EAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,IAC1E,QAAQ,CACL,CACP,CACG,CACP,CAAA"}
|
package/lib/Card.module.scss
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
@use '../styles/constants' as c;
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
$padding: c.$grid * 5;
|
|
3
|
+
$padding: c.$grid * 5;
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
border-radius: c.$borderRadius;
|
|
5
|
+
.wrapper {
|
|
8
6
|
background: c.$colorNeutralWhite;
|
|
9
|
-
border: c.$borderWidth solid c.$colorNeutral;
|
|
10
7
|
|
|
11
8
|
.heading {
|
|
12
|
-
@include c.typographyH3;
|
|
13
|
-
|
|
14
9
|
display: flex;
|
|
15
10
|
align-items: center;
|
|
11
|
+
margin-bottom: c.$grid * 5;
|
|
16
12
|
|
|
17
13
|
.icon {
|
|
18
14
|
margin-right: c.$grid * 2.5;
|
|
@@ -20,8 +16,6 @@
|
|
|
20
16
|
|
|
21
17
|
.title {
|
|
22
18
|
margin: 0;
|
|
23
|
-
font-size: c.$fontSizeBodyNormal !important;
|
|
24
|
-
line-height: c.$lineHeightBodyNormal !important;
|
|
25
19
|
|
|
26
20
|
&.space {
|
|
27
21
|
margin-right: c.$grid * 2.5;
|
|
@@ -37,23 +31,62 @@
|
|
|
37
31
|
}
|
|
38
32
|
|
|
39
33
|
.content {
|
|
34
|
+
padding-top: c.$grid * 6;
|
|
40
35
|
@include c.typographyBodyNormal;
|
|
41
|
-
|
|
42
|
-
margin-top: c.$grid * 4;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&.noTitle {
|
|
46
|
-
.content {
|
|
47
|
-
margin-top: 0;
|
|
48
|
-
}
|
|
49
36
|
}
|
|
50
37
|
|
|
51
38
|
.caption {
|
|
52
39
|
display: flex;
|
|
53
|
-
margin:
|
|
40
|
+
margin-bottom: $padding;
|
|
54
41
|
|
|
55
42
|
& > * {
|
|
56
43
|
flex: 1;
|
|
57
44
|
}
|
|
58
45
|
}
|
|
59
46
|
}
|
|
47
|
+
|
|
48
|
+
.bordered {
|
|
49
|
+
padding: $padding;
|
|
50
|
+
border-radius: c.$borderRadius;
|
|
51
|
+
border: c.$borderWidth solid c.$colorNeutral;
|
|
52
|
+
|
|
53
|
+
.heading {
|
|
54
|
+
@include c.typographyH3;
|
|
55
|
+
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
margin: 0;
|
|
59
|
+
|
|
60
|
+
.icon {
|
|
61
|
+
margin-right: c.$grid * 2.5;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.title {
|
|
65
|
+
margin: 0;
|
|
66
|
+
font-size: c.$fontSizeBodyNormal !important;
|
|
67
|
+
line-height: c.$lineHeightBodyNormal !important;
|
|
68
|
+
|
|
69
|
+
&.space {
|
|
70
|
+
margin-right: c.$grid * 2.5;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.content {
|
|
76
|
+
@include c.typographyBodyNormal;
|
|
77
|
+
|
|
78
|
+
margin-top: c.$grid * 4;
|
|
79
|
+
padding: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.caption {
|
|
83
|
+
margin: (-$padding) (-$padding) $padding;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.noTitle {
|
|
88
|
+
.content {
|
|
89
|
+
margin-top: 0;
|
|
90
|
+
padding-top: 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Loader } from './Loader';
|
|
3
|
+
import styles from './CenteredLoader.module.scss';
|
|
4
|
+
export const CenteredLoader = ({ 'data-test': dataTest = 'centered-loader', ...props }) => (React.createElement("div", { className: styles.container, "data-test": dataTest },
|
|
5
|
+
React.createElement(Loader, { ...props })));
|
|
6
|
+
//# sourceMappingURL=CenteredLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CenteredLoader.js","sourceRoot":"","sources":["../src/CenteredLoader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AAGjC,OAAO,EAAe,MAAM,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,MAAM,MAAM,8BAA8B,CAAA;AAGjD,MAAM,CAAC,MAAM,cAAc,GAA4B,CAAC,EAAE,WAAW,EAAE,QAAQ,GAAG,iBAAiB,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CAClH,6BAAK,SAAS,EAAE,MAAM,CAAC,SAAS,eAAa,QAAQ;IACnD,oBAAC,MAAM,OAAK,KAAK,GAAI,CACjB,CACP,CAAA"}
|
package/lib/Checkbox.js
CHANGED
|
@@ -17,7 +17,7 @@ import { TruncatedText } from './TruncatedText';
|
|
|
17
17
|
* - They can have a special indeterminate state, that represents a '3rd' value, usually used in tree structures, etc.
|
|
18
18
|
*/
|
|
19
19
|
export const Checkbox = forwardRef((props, ref) => {
|
|
20
|
-
const { checked, name, onChange, onBlur, className, classNameLabel, classNameCheckmark, value, indeterminate = false, label, helperText, error, disabled = false, required, 'data-test': dataTest, 'aria-label': ariaLabel, onClick, } = props;
|
|
20
|
+
const { checked, name, onChange, onBlur, className, classNameLabel, classNameCheckmark, value, indeterminate = false, label, helperText, error, disabled = false, required, 'data-test': dataTest = 'checkbox', 'aria-label': ariaLabel, onClick, } = props;
|
|
21
21
|
const inputRef = useRef(null);
|
|
22
22
|
const id = useUID();
|
|
23
23
|
return (React.createElement("div", { ref: ref, className: classNames(className, { [styles.withError]: 'error' in props }), "data-test": dataTest },
|
|
@@ -30,7 +30,7 @@ export const Checkbox = forwardRef((props, ref) => {
|
|
|
30
30
|
label !== undefined && (React.createElement("div", { className: styles.name, "data-test": "input-checkbox-label" },
|
|
31
31
|
React.createElement(TruncatedText, { text: label }))),
|
|
32
32
|
React.createElement("input", { type: "checkbox", ref: inputRef, id: id, name: name, "aria-label": ariaLabel, checked: !!checked, onChange: onChange, onBlur: onBlur, onClick: onClick, value: value, disabled: disabled, "aria-invalid": !!error, "aria-required": required, "aria-describedby": helperText && helpTooltipId(id), "aria-errormessage": error && errorId(id) }),
|
|
33
|
-
indeterminate ? (React.createElement(Minus, { className: classNames(styles.checkmark, classNameCheckmark) })) : (React.createElement(Check, { className: classNames(styles.checkmark, classNameCheckmark) })),
|
|
33
|
+
indeterminate ? (React.createElement(Minus, { "data-test": `${dataTest}-minus`, className: classNames(styles.checkmark, classNameCheckmark) })) : (React.createElement(Check, { "data-test": `${dataTest}-check`, className: classNames(styles.checkmark, classNameCheckmark) })),
|
|
34
34
|
helperText && React.createElement(Help, { parentId: id, helperText: helperText, className: styles.helperText })),
|
|
35
35
|
React.createElement(Error, { truncated: true, error: error, className: styles.errorContainer, inputId: id })));
|
|
36
36
|
});
|