@hazelcast/ui 1.0.3 → 1.2.1-next.0
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.d.ts +3 -2
- package/lib/Alert.js +23 -23
- package/lib/Alert.js.map +1 -1
- package/lib/Alert.module.scss +14 -6
- package/lib/AutocompleteField.d.ts +2 -1
- package/lib/AutocompleteField.js +45 -22
- package/lib/AutocompleteField.js.map +1 -1
- package/lib/AutocompleteField.module.scss +3 -5
- package/lib/AutocompleteFieldFormik.d.ts +2 -1
- package/lib/AutocompleteFieldFormik.js +11 -5
- package/lib/AutocompleteFieldFormik.js.map +1 -1
- package/lib/Button.d.ts +9 -322
- package/lib/Button.js +44 -15
- package/lib/Button.js.map +1 -1
- package/lib/Button.module.scss +120 -87
- package/lib/Calendar/Calendar.d.ts +1 -1
- package/lib/Calendar/Calendar.js +8 -3
- package/lib/Calendar/Calendar.js.map +1 -1
- package/lib/Calendar/Calendar.module.scss +134 -123
- package/lib/Calendar/components/CalendarInput.js +2 -2
- package/lib/Calendar/components/CalendarInput.js.map +1 -1
- package/lib/Calendar/components/CalendarTime.js +2 -2
- package/lib/Calendar/components/CalendarTime.js.map +1 -1
- package/lib/Calendar/components/CalendarTime.module.scss +2 -0
- package/lib/Card.d.ts +1 -0
- package/lib/Card.js +4 -3
- package/lib/Card.js.map +1 -1
- package/lib/Card.module.scss +16 -4
- package/lib/Checkbox.d.ts +2 -2
- package/lib/Checkbox.js +7 -4
- package/lib/Checkbox.js.map +1 -1
- package/lib/Checkbox.module.scss +17 -6
- package/lib/CheckboxFormik.d.ts +2 -1
- package/lib/CheckboxFormik.js +9 -4
- package/lib/CheckboxFormik.js.map +1 -1
- package/lib/CodeEditor.d.ts +3 -2
- package/lib/CodeEditor.js +4 -3
- package/lib/CodeEditor.js.map +1 -1
- package/lib/CodeEditor.module.scss +5 -2
- package/lib/CodeEditorFormik.js +2 -2
- package/lib/CodeEditorFormik.js.map +1 -1
- package/lib/Dialog.js +5 -2
- package/lib/Dialog.js.map +1 -1
- package/lib/Dialog.module.scss +3 -0
- package/lib/EmptyState.d.ts +6 -4
- package/lib/EmptyState.js +4 -6
- package/lib/EmptyState.js.map +1 -1
- package/lib/EmptyState.module.scss +1 -1
- package/lib/Error.d.ts +3 -0
- package/lib/Error.js +2 -1
- package/lib/Error.js.map +1 -1
- package/lib/FieldHeader.d.ts +20 -0
- package/lib/FieldHeader.js +15 -0
- package/lib/FieldHeader.js.map +1 -0
- package/lib/FieldHeader.module.scss +20 -0
- package/lib/Icon.d.ts +2 -35
- package/lib/Icon.js +1 -1
- package/lib/Icon.js.map +1 -1
- package/lib/Icon.module.scss +5 -0
- package/lib/IconButton.d.ts +4 -158
- package/lib/IconButton.js +3 -3
- package/lib/IconButton.js.map +1 -1
- package/lib/InteractiveList.d.ts +3 -3
- package/lib/InteractiveList.js +2 -3
- package/lib/InteractiveList.js.map +1 -1
- package/lib/InteractiveList.module.scss +1 -0
- package/lib/InteractiveListFormik.js +5 -4
- package/lib/InteractiveListFormik.js.map +1 -1
- package/lib/Link.d.ts +1 -65
- package/lib/Link.js +3 -4
- package/lib/Link.js.map +1 -1
- package/lib/Link.module.scss +7 -0
- package/lib/Loader.js +2 -2
- package/lib/Loader.js.map +1 -1
- package/lib/Loader.module.scss +10 -1
- package/lib/Modal.js +3 -3
- package/lib/Modal.js.map +1 -1
- package/lib/Modal.module.scss +1 -0
- package/lib/Notification.module.scss +1 -0
- package/lib/NumberField.d.ts +1 -0
- package/lib/NumberField.js +27 -11
- package/lib/NumberField.js.map +1 -1
- package/lib/NumberField.module.scss +40 -3
- package/lib/NumberFieldFormik.d.ts +2 -1
- package/lib/NumberFieldFormik.js +7 -4
- package/lib/NumberFieldFormik.js.map +1 -1
- package/lib/Overlay.d.ts +3 -2
- package/lib/Overlay.js +7 -5
- package/lib/Overlay.js.map +1 -1
- package/lib/Overlay.module.scss +18 -3
- package/lib/Pagination.d.ts +0 -4
- package/lib/Pagination.js +19 -17
- package/lib/Pagination.js.map +1 -1
- package/lib/Pagination.module.scss +7 -4
- package/lib/PasswordField.js +2 -2
- package/lib/PasswordField.js.map +1 -1
- package/lib/PasswordFieldFormik.d.ts +2 -1
- package/lib/PasswordFieldFormik.js +9 -4
- package/lib/PasswordFieldFormik.js.map +1 -1
- package/lib/Popover.d.ts +21 -0
- package/lib/Popover.js +77 -0
- package/lib/Popover.js.map +1 -0
- package/lib/Popover.module.scss +12 -0
- package/lib/Radio.d.ts +2 -2
- package/lib/Radio.js +4 -2
- package/lib/Radio.js.map +1 -1
- package/lib/Radio.module.scss +3 -0
- package/lib/RadioFormik.js +1 -1
- package/lib/RadioFormik.js.map +1 -1
- package/lib/RadioGroup.js +4 -3
- package/lib/RadioGroup.js.map +1 -1
- package/lib/RadioGroup.module.scss +1 -4
- package/lib/RadioGroupFormik.d.ts +2 -1
- package/lib/RadioGroupFormik.js +9 -4
- package/lib/RadioGroupFormik.js.map +1 -1
- package/lib/SegmentedControl.d.ts +8 -8
- package/lib/SegmentedControl.js.map +1 -1
- package/lib/SegmentedControl.module.scss +4 -2
- package/lib/SegmentedControlFormik.d.ts +4 -4
- package/lib/SegmentedControlFormik.js +1 -1
- package/lib/SegmentedControlFormik.js.map +1 -1
- package/lib/Select/CheckableSelectField.d.ts +34 -0
- package/lib/Select/CheckableSelectField.js +65 -0
- package/lib/Select/CheckableSelectField.js.map +1 -0
- package/lib/Select/CheckableSelectField.module.scss +87 -0
- package/lib/Select/CheckableSelectFieldFormik.d.ts +10 -0
- package/lib/Select/CheckableSelectFieldFormik.js +19 -0
- package/lib/Select/CheckableSelectFieldFormik.js.map +1 -0
- package/lib/Select/Common.d.ts +11 -0
- package/lib/Select/Common.js +44 -0
- package/lib/Select/Common.js.map +1 -0
- package/lib/Select/Common.module.scss +56 -0
- package/lib/Select/MultiSelectField.d.ts +28 -0
- package/lib/Select/MultiSelectField.js +108 -0
- package/lib/Select/MultiSelectField.js.map +1 -0
- package/lib/Select/MultiSelectField.module.scss +72 -0
- package/lib/Select/MultiSelectFieldFormik.d.ts +10 -0
- package/lib/Select/MultiSelectFieldFormik.js +19 -0
- package/lib/Select/MultiSelectFieldFormik.js.map +1 -0
- package/lib/Select/SelectField.d.ts +42 -0
- package/lib/Select/SelectField.js +87 -0
- package/lib/Select/SelectField.js.map +1 -0
- package/lib/Select/SelectField.module.scss +191 -0
- package/lib/Select/SelectFieldFormik.d.ts +10 -0
- package/lib/Select/SelectFieldFormik.js +19 -0
- package/lib/Select/SelectFieldFormik.js.map +1 -0
- package/lib/Select/helpers.d.ts +10 -0
- package/lib/Select/helpers.js +29 -0
- package/lib/Select/helpers.js.map +1 -0
- package/lib/Select/index.d.ts +7 -0
- package/lib/Select/index.js +8 -0
- package/lib/Select/index.js.map +1 -0
- package/lib/SimpleTable.d.ts +11 -0
- package/lib/SimpleTable.js +26 -0
- package/lib/SimpleTable.js.map +1 -0
- package/lib/SimpleTable.module.scss +28 -0
- package/lib/Slider.d.ts +6 -5
- package/lib/Slider.js +35 -17
- package/lib/Slider.js.map +1 -1
- package/lib/Slider.module.scss +13 -9
- package/lib/SliderFormik.d.ts +1 -1
- package/lib/SliderFormik.js +1 -1
- package/lib/SliderFormik.js.map +1 -1
- package/lib/Table/Cell.module.scss +11 -4
- package/lib/Table/EnhancedRenderers.d.ts +0 -7
- package/lib/Table/EnhancedRenderers.js +3 -14
- package/lib/Table/EnhancedRenderers.js.map +1 -1
- package/lib/Table/Header.js +9 -3
- package/lib/Table/Header.js.map +1 -1
- package/lib/Table/Header.module.scss +29 -35
- package/lib/Table/Row.js +2 -7
- package/lib/Table/Row.js.map +1 -1
- package/lib/Table/Row.module.scss +4 -10
- package/lib/Table/Table.d.ts +11 -4
- package/lib/Table/Table.js +75 -34
- package/lib/Table/Table.js.map +1 -1
- package/lib/Table/Table.module.scss +5 -5
- package/lib/Tabs/Tab.d.ts +9 -1
- package/lib/Tabs/Tab.js +5 -2
- package/lib/Tabs/Tab.js.map +1 -1
- package/lib/Tabs/Tab.module.scss +5 -1
- package/lib/Tabs/TabList.js +2 -1
- package/lib/Tabs/TabList.js.map +1 -1
- package/lib/Tabs/index.d.ts +4 -4
- package/lib/Tabs/index.js +4 -4
- package/lib/Tabs/index.js.map +1 -1
- package/lib/Terminal.js +3 -3
- package/lib/Terminal.js.map +1 -1
- package/lib/Terminal.module.scss +1 -0
- package/lib/TextArea.d.ts +4 -5
- package/lib/TextArea.js +9 -9
- package/lib/TextArea.js.map +1 -1
- package/lib/TextArea.module.scss +19 -10
- package/lib/TextAreaFormik.js +1 -1
- package/lib/TextAreaFormik.js.map +1 -1
- package/lib/TextField.d.ts +13 -23
- package/lib/TextField.js +27 -12
- package/lib/TextField.js.map +1 -1
- package/lib/TextField.module.scss +36 -34
- package/lib/TextFieldFormik.d.ts +4 -2
- package/lib/TextFieldFormik.js +15 -4
- package/lib/TextFieldFormik.js.map +1 -1
- package/lib/TimeField.d.ts +2 -11
- package/lib/TimeField.js +8 -7
- package/lib/TimeField.js.map +1 -1
- package/lib/TimeField.module.scss +6 -6
- package/lib/TimeFieldFormik.js +1 -1
- package/lib/TimeFieldFormik.js.map +1 -1
- package/lib/Toast.js.map +1 -1
- package/lib/Toggle.js +4 -3
- package/lib/Toggle.js.map +1 -1
- package/lib/Toggle.module.scss +23 -19
- package/lib/ToggleFormik.js +1 -1
- package/lib/ToggleFormik.js.map +1 -1
- package/lib/Tooltip.d.ts +9 -2
- package/lib/Tooltip.js +87 -27
- package/lib/Tooltip.js.map +1 -1
- package/lib/Tooltip.module.scss +10 -5
- package/lib/TruncatedText.d.ts +6 -3
- package/lib/TruncatedText.js +2 -2
- package/lib/TruncatedText.js.map +1 -1
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.js +7 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useIsMounted.d.ts +1 -0
- package/lib/hooks/useIsMounted.js +12 -0
- package/lib/hooks/useIsMounted.js.map +1 -0
- package/lib/hooks/useOnClickOutside.d.ts +8 -0
- package/lib/hooks/useOnClickOutside.js +24 -0
- package/lib/hooks/useOnClickOutside.js.map +1 -0
- package/lib/hooks/useOpenCloseState.d.ts +6 -0
- package/lib/hooks/useOpenCloseState.js +14 -0
- package/lib/hooks/useOpenCloseState.js.map +1 -0
- package/lib/hooks/usePrevious.d.ts +1 -0
- package/lib/hooks/usePrevious.js +9 -0
- package/lib/hooks/usePrevious.js.map +1 -0
- package/lib/hooks/useRefValue.d.ts +1 -0
- package/lib/hooks/useRefValue.js +9 -0
- package/lib/hooks/useRefValue.js.map +1 -0
- package/lib/hooks/useTableCustomizableColumns.d.ts +9 -0
- package/lib/hooks/useTableCustomizableColumns.js +23 -0
- package/lib/hooks/useTableCustomizableColumns.js.map +1 -0
- package/lib/index.d.ts +55 -53
- package/lib/index.js +55 -53
- package/lib/index.js.map +1 -1
- package/lib/utils/test.d.ts +1 -0
- package/lib/utils/test.js +8 -0
- package/lib/utils/test.js.map +1 -0
- package/package.json +57 -50
- package/styles/constants/_animations.scss +0 -1
- package/styles/constants/_colors.scss +1 -10
- package/styles/constants/_sizes.scss +8 -26
- package/styles/constants/_typography.scss +21 -10
- package/styles/constants/export.module.scss +1 -1
- package/styles/fonts.css +14 -65
- package/styles/helpers/_a11y.scss +8 -1
- package/styles/helpers/_error.scss +17 -0
- package/styles/helpers/_index.scss +1 -0
- package/styles/helpers/_input.scss +1 -1
- package/lib/Calendar/components/CalendarHeader.tsx +0 -45
- package/lib/Calendar/components/CalendarInput.tsx +0 -50
- package/lib/Calendar/components/CalendarTime.tsx +0 -116
- package/lib/Calendar/helpers/consts.ts +0 -99
- package/lib/SelectField.d.ts +0 -81
- package/lib/SelectField.js +0 -196
- package/lib/SelectField.js.map +0 -1
- package/lib/SelectField.module.scss +0 -251
- package/lib/SelectFieldFormik.d.ts +0 -20
- package/lib/SelectFieldFormik.js +0 -19
- package/lib/SelectFieldFormik.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@use '../styles/constants' as c;
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
display: flex;
|
|
5
|
+
margin-bottom: c.$grid;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.label {
|
|
9
|
+
flex-shrink: 0;
|
|
10
|
+
white-space: pre-wrap;
|
|
11
|
+
|
|
12
|
+
&.small {
|
|
13
|
+
@include c.typographyBodySmall;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.helperText {
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
margin-top: c.$grid * 0.5;
|
|
20
|
+
}
|
package/lib/Icon.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare type IconAriaProps = {
|
|
|
11
11
|
} | {
|
|
12
12
|
ariaLabel?: never;
|
|
13
13
|
ariaLabelledBy?: never;
|
|
14
|
-
ariaHidden
|
|
14
|
+
ariaHidden?: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare type IconType = FC<SVGAttributes<SVGElement> & {
|
|
17
17
|
color?: string;
|
|
@@ -25,37 +25,4 @@ export declare type IconProps = {
|
|
|
25
25
|
containerClassName?: string;
|
|
26
26
|
bold?: boolean;
|
|
27
27
|
} & IconAriaProps;
|
|
28
|
-
export declare const Icon: React.ForwardRefExoticComponent<
|
|
29
|
-
color?: string | undefined;
|
|
30
|
-
icon: IconType;
|
|
31
|
-
size?: "medium" | "large" | "small" | "smallMedium" | "xlarge" | undefined;
|
|
32
|
-
className?: string | undefined;
|
|
33
|
-
containerClassName?: string | undefined;
|
|
34
|
-
bold?: boolean | undefined;
|
|
35
|
-
} & {
|
|
36
|
-
ariaLabel: string;
|
|
37
|
-
ariaLabelledBy?: undefined;
|
|
38
|
-
ariaHidden?: undefined;
|
|
39
|
-
} & React.RefAttributes<HTMLDivElement>) | ({
|
|
40
|
-
color?: string | undefined;
|
|
41
|
-
icon: IconType;
|
|
42
|
-
size?: "medium" | "large" | "small" | "smallMedium" | "xlarge" | undefined;
|
|
43
|
-
className?: string | undefined;
|
|
44
|
-
containerClassName?: string | undefined;
|
|
45
|
-
bold?: boolean | undefined;
|
|
46
|
-
} & {
|
|
47
|
-
ariaLabel?: undefined;
|
|
48
|
-
ariaLabelledBy: string;
|
|
49
|
-
ariaHidden?: undefined;
|
|
50
|
-
} & React.RefAttributes<HTMLDivElement>) | ({
|
|
51
|
-
color?: string | undefined;
|
|
52
|
-
icon: IconType;
|
|
53
|
-
size?: "medium" | "large" | "small" | "smallMedium" | "xlarge" | undefined;
|
|
54
|
-
className?: string | undefined;
|
|
55
|
-
containerClassName?: string | undefined;
|
|
56
|
-
bold?: boolean | undefined;
|
|
57
|
-
} & {
|
|
58
|
-
ariaLabel?: undefined;
|
|
59
|
-
ariaLabelledBy?: undefined;
|
|
60
|
-
ariaHidden: boolean;
|
|
61
|
-
} & React.RefAttributes<HTMLDivElement>)>;
|
|
28
|
+
export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLDivElement>>;
|
package/lib/Icon.js
CHANGED
|
@@ -21,7 +21,7 @@ export const Icon = forwardRef(({ color, icon: IconElement, ariaLabel, ariaLabel
|
|
|
21
21
|
strokeWidth: iconStroke,
|
|
22
22
|
};
|
|
23
23
|
return (React.createElement("div", { className: cn(styles.iconContainer, containerClassName), ref: ref },
|
|
24
|
-
React.createElement(IconElement,
|
|
24
|
+
React.createElement(IconElement, { role: "img", ...props })));
|
|
25
25
|
});
|
|
26
26
|
Icon.displayName = 'Icon';
|
|
27
27
|
//# sourceMappingURL=Icon.js.map
|
package/lib/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../src/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,UAAU,EAA2B,MAAM,OAAO,CAAA;AACtE,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,WAAW,MAAM,wCAAwC,CAAA;AAChE,OAAO,MAAM,MAAM,oBAAoB,CAAA;AA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|
2
2
|
|
|
3
3
|
.iconContainer {
|
|
4
4
|
display: inline-block;
|
|
5
|
+
|
|
5
6
|
// Note: Font-size reset in order break inheritance.
|
|
6
7
|
font-size: 0;
|
|
7
8
|
|
|
@@ -9,18 +10,22 @@
|
|
|
9
10
|
width: c.$iconSizeSmall;
|
|
10
11
|
height: c.$iconSizeSmall;
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
.smallMedium {
|
|
13
15
|
width: c.$iconSizeSmallMedium;
|
|
14
16
|
height: c.$iconSizeSmallMedium;
|
|
15
17
|
}
|
|
18
|
+
|
|
16
19
|
.medium {
|
|
17
20
|
width: c.$iconSizeMedium;
|
|
18
21
|
height: c.$iconSizeMedium;
|
|
19
22
|
}
|
|
23
|
+
|
|
20
24
|
.large {
|
|
21
25
|
width: c.$iconSizeLarge;
|
|
22
26
|
height: c.$iconSizeLarge;
|
|
23
27
|
}
|
|
28
|
+
|
|
24
29
|
.xlarge {
|
|
25
30
|
width: c.$iconSizeXLarge;
|
|
26
31
|
height: c.$iconSizeXLarge;
|
package/lib/IconButton.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Icon as FeatherIcon } from 'react-feather';
|
|
|
3
3
|
import { IconProps, IconAriaProps } from './Icon';
|
|
4
4
|
import { TooltipProps } from './Tooltip';
|
|
5
5
|
import { LinkRel, LinkTarget } from './Link';
|
|
6
|
+
import { DataTestProp } from '../../helpers';
|
|
6
7
|
export declare type IconButtonKind = 'primary' | 'transparent';
|
|
7
8
|
declare type IconButtonCommonProps = {
|
|
8
9
|
icon: FeatherIcon;
|
|
@@ -11,7 +12,8 @@ declare type IconButtonCommonProps = {
|
|
|
11
12
|
kind?: IconButtonKind;
|
|
12
13
|
size?: IconProps['size'];
|
|
13
14
|
padding?: 'normal';
|
|
14
|
-
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
} & DataTestProp & IconAriaProps & Pick<ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, 'onClick' | 'onMouseDown' | 'className' | 'tabIndex' | 'style'>;
|
|
15
17
|
export declare type IconButtonNotDisabledProps = {
|
|
16
18
|
disabledTooltip?: never;
|
|
17
19
|
disabled?: never;
|
|
@@ -39,161 +41,5 @@ declare type IconButtonComponentProps = ({
|
|
|
39
41
|
loading?: boolean;
|
|
40
42
|
} & (IconButtonDisabledProps | IconButtonNotDisabledProps) & Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'autoFocus' | 'type'>);
|
|
41
43
|
export declare type IconButtonProps = IconButtonCommonProps & IconButtonComponentProps;
|
|
42
|
-
export declare const IconButton: React.ForwardRefExoticComponent<
|
|
43
|
-
icon: FeatherIcon;
|
|
44
|
-
iconClassName?: string | undefined;
|
|
45
|
-
iconColor?: string | undefined;
|
|
46
|
-
kind?: "transparent" | "primary" | undefined;
|
|
47
|
-
size?: IconProps['size'];
|
|
48
|
-
padding?: "normal" | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
ariaLabel: string;
|
|
51
|
-
ariaLabelledBy?: undefined;
|
|
52
|
-
ariaHidden?: undefined;
|
|
53
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
54
|
-
component: 'a';
|
|
55
|
-
href: string;
|
|
56
|
-
target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
|
|
57
|
-
rel?: "alternate" | "help" | "search" | "author" | "bookmark" | "dns-prefetch" | "external" | "license" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "prev" | "tag" | LinkRel[] | undefined;
|
|
58
|
-
type?: undefined;
|
|
59
|
-
loading?: undefined;
|
|
60
|
-
} & IconButtonNotDisabledProps & React.RefAttributes<HTMLElement>) | ({
|
|
61
|
-
icon: FeatherIcon;
|
|
62
|
-
iconClassName?: string | undefined;
|
|
63
|
-
iconColor?: string | undefined;
|
|
64
|
-
kind?: "transparent" | "primary" | undefined;
|
|
65
|
-
size?: IconProps['size'];
|
|
66
|
-
padding?: "normal" | undefined;
|
|
67
|
-
} & {
|
|
68
|
-
ariaLabel: string;
|
|
69
|
-
ariaLabelledBy?: undefined;
|
|
70
|
-
ariaHidden?: undefined;
|
|
71
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
72
|
-
component?: "button" | undefined;
|
|
73
|
-
href?: undefined;
|
|
74
|
-
target?: undefined;
|
|
75
|
-
rel?: undefined;
|
|
76
|
-
loading?: boolean | undefined;
|
|
77
|
-
} & IconButtonNotDisabledProps & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "autoFocus"> & React.RefAttributes<HTMLElement>) | ({
|
|
78
|
-
icon: FeatherIcon;
|
|
79
|
-
iconClassName?: string | undefined;
|
|
80
|
-
iconColor?: string | undefined;
|
|
81
|
-
kind?: "transparent" | "primary" | undefined;
|
|
82
|
-
size?: IconProps['size'];
|
|
83
|
-
padding?: "normal" | undefined;
|
|
84
|
-
} & {
|
|
85
|
-
ariaLabel: string;
|
|
86
|
-
ariaLabelledBy?: undefined;
|
|
87
|
-
ariaHidden?: undefined;
|
|
88
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
89
|
-
component?: "button" | undefined;
|
|
90
|
-
href?: undefined;
|
|
91
|
-
target?: undefined;
|
|
92
|
-
rel?: undefined;
|
|
93
|
-
loading?: boolean | undefined;
|
|
94
|
-
} & IconButtonDisabledProps & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "autoFocus"> & React.RefAttributes<HTMLElement>) | ({
|
|
95
|
-
icon: FeatherIcon;
|
|
96
|
-
iconClassName?: string | undefined;
|
|
97
|
-
iconColor?: string | undefined;
|
|
98
|
-
kind?: "transparent" | "primary" | undefined;
|
|
99
|
-
size?: IconProps['size'];
|
|
100
|
-
padding?: "normal" | undefined;
|
|
101
|
-
} & {
|
|
102
|
-
ariaLabel?: undefined;
|
|
103
|
-
ariaLabelledBy: string;
|
|
104
|
-
ariaHidden?: undefined;
|
|
105
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
106
|
-
component: 'a';
|
|
107
|
-
href: string;
|
|
108
|
-
target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
|
|
109
|
-
rel?: "alternate" | "help" | "search" | "author" | "bookmark" | "dns-prefetch" | "external" | "license" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "prev" | "tag" | LinkRel[] | undefined;
|
|
110
|
-
type?: undefined;
|
|
111
|
-
loading?: undefined;
|
|
112
|
-
} & IconButtonNotDisabledProps & React.RefAttributes<HTMLElement>) | ({
|
|
113
|
-
icon: FeatherIcon;
|
|
114
|
-
iconClassName?: string | undefined;
|
|
115
|
-
iconColor?: string | undefined;
|
|
116
|
-
kind?: "transparent" | "primary" | undefined;
|
|
117
|
-
size?: IconProps['size'];
|
|
118
|
-
padding?: "normal" | undefined;
|
|
119
|
-
} & {
|
|
120
|
-
ariaLabel?: undefined;
|
|
121
|
-
ariaLabelledBy: string;
|
|
122
|
-
ariaHidden?: undefined;
|
|
123
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
124
|
-
component?: "button" | undefined;
|
|
125
|
-
href?: undefined;
|
|
126
|
-
target?: undefined;
|
|
127
|
-
rel?: undefined;
|
|
128
|
-
loading?: boolean | undefined;
|
|
129
|
-
} & IconButtonNotDisabledProps & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "autoFocus"> & React.RefAttributes<HTMLElement>) | ({
|
|
130
|
-
icon: FeatherIcon;
|
|
131
|
-
iconClassName?: string | undefined;
|
|
132
|
-
iconColor?: string | undefined;
|
|
133
|
-
kind?: "transparent" | "primary" | undefined;
|
|
134
|
-
size?: IconProps['size'];
|
|
135
|
-
padding?: "normal" | undefined;
|
|
136
|
-
} & {
|
|
137
|
-
ariaLabel?: undefined;
|
|
138
|
-
ariaLabelledBy: string;
|
|
139
|
-
ariaHidden?: undefined;
|
|
140
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
141
|
-
component?: "button" | undefined;
|
|
142
|
-
href?: undefined;
|
|
143
|
-
target?: undefined;
|
|
144
|
-
rel?: undefined;
|
|
145
|
-
loading?: boolean | undefined;
|
|
146
|
-
} & IconButtonDisabledProps & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "autoFocus"> & React.RefAttributes<HTMLElement>) | ({
|
|
147
|
-
icon: FeatherIcon;
|
|
148
|
-
iconClassName?: string | undefined;
|
|
149
|
-
iconColor?: string | undefined;
|
|
150
|
-
kind?: "transparent" | "primary" | undefined;
|
|
151
|
-
size?: IconProps['size'];
|
|
152
|
-
padding?: "normal" | undefined;
|
|
153
|
-
} & {
|
|
154
|
-
ariaLabel?: undefined;
|
|
155
|
-
ariaLabelledBy?: undefined;
|
|
156
|
-
ariaHidden: boolean;
|
|
157
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
158
|
-
component: 'a';
|
|
159
|
-
href: string;
|
|
160
|
-
target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
|
|
161
|
-
rel?: "alternate" | "help" | "search" | "author" | "bookmark" | "dns-prefetch" | "external" | "license" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "prev" | "tag" | LinkRel[] | undefined;
|
|
162
|
-
type?: undefined;
|
|
163
|
-
loading?: undefined;
|
|
164
|
-
} & IconButtonNotDisabledProps & React.RefAttributes<HTMLElement>) | ({
|
|
165
|
-
icon: FeatherIcon;
|
|
166
|
-
iconClassName?: string | undefined;
|
|
167
|
-
iconColor?: string | undefined;
|
|
168
|
-
kind?: "transparent" | "primary" | undefined;
|
|
169
|
-
size?: IconProps['size'];
|
|
170
|
-
padding?: "normal" | undefined;
|
|
171
|
-
} & {
|
|
172
|
-
ariaLabel?: undefined;
|
|
173
|
-
ariaLabelledBy?: undefined;
|
|
174
|
-
ariaHidden: boolean;
|
|
175
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
176
|
-
component?: "button" | undefined;
|
|
177
|
-
href?: undefined;
|
|
178
|
-
target?: undefined;
|
|
179
|
-
rel?: undefined;
|
|
180
|
-
loading?: boolean | undefined;
|
|
181
|
-
} & IconButtonNotDisabledProps & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "autoFocus"> & React.RefAttributes<HTMLElement>) | ({
|
|
182
|
-
icon: FeatherIcon;
|
|
183
|
-
iconClassName?: string | undefined;
|
|
184
|
-
iconColor?: string | undefined;
|
|
185
|
-
kind?: "transparent" | "primary" | undefined;
|
|
186
|
-
size?: IconProps['size'];
|
|
187
|
-
padding?: "normal" | undefined;
|
|
188
|
-
} & {
|
|
189
|
-
ariaLabel?: undefined;
|
|
190
|
-
ariaLabelledBy?: undefined;
|
|
191
|
-
ariaHidden: boolean;
|
|
192
|
-
} & Pick<React.ButtonHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "style" | "className" | "tabIndex" | "onClick" | "onMouseDown"> & {
|
|
193
|
-
component?: "button" | undefined;
|
|
194
|
-
href?: undefined;
|
|
195
|
-
target?: undefined;
|
|
196
|
-
rel?: undefined;
|
|
197
|
-
loading?: boolean | undefined;
|
|
198
|
-
} & IconButtonDisabledProps & Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "autoFocus"> & React.RefAttributes<HTMLElement>)>;
|
|
44
|
+
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLElement>>;
|
|
199
45
|
export {};
|
package/lib/IconButton.js
CHANGED
|
@@ -8,15 +8,15 @@ import { Loader } from './Loader';
|
|
|
8
8
|
import styles from './IconButton.module.scss';
|
|
9
9
|
export const IconButton = forwardRef(({ component: Component = 'button', icon, iconClassName, iconColor, className, size, kind = 'transparent', ariaHidden, ariaLabelledBy, ariaLabel,
|
|
10
10
|
// Disabled tooltip
|
|
11
|
-
disabled, disabledTooltip, disabledTooltipVisible, disabledTooltipPlacement, rel = 'noopener', target, type = 'button', loading, padding, ...rest }, ref) => {
|
|
11
|
+
disabled, disabledTooltip, disabledTooltipVisible, disabledTooltipPlacement, rel = 'noopener', target, type = 'button', loading, padding, tooltip, ...rest }, ref) => {
|
|
12
12
|
const tooltipId = useUID();
|
|
13
13
|
const relFinal = Array.isArray(rel) ? rel.join(' ') : rel;
|
|
14
14
|
const labelledByFinal = [ariaLabelledBy, disabled ? tooltipId : undefined].filter(Boolean).join(' ');
|
|
15
|
-
return (React.createElement(Tooltip, { id: tooltipId, content: disabled ? disabledTooltip :
|
|
15
|
+
return (React.createElement(Tooltip, { id: tooltipId, content: disabled ? disabledTooltip : tooltip, placement: disabledTooltipPlacement, visible: disabled && disabledTooltipVisible }, (tooltipRef) => (React.createElement(Component, { className: cn(styles.iconButton, {
|
|
16
16
|
[styles.primary]: kind === 'primary',
|
|
17
17
|
[styles.transparent]: kind === 'transparent',
|
|
18
18
|
[styles.paddingNormal]: padding === 'normal',
|
|
19
|
-
}, className), "aria-hidden": ariaHidden, "aria-label": ariaLabel, "aria-labelledby": labelledByFinal, disabled: disabled !== null && disabled !== void 0 ? disabled : loading, rel: Component === 'a' ? relFinal : undefined, target: Component === 'a' ? target : undefined, type: Component === 'button' ? type : undefined
|
|
19
|
+
}, className), "aria-hidden": ariaHidden, "aria-label": ariaLabel, "aria-labelledby": labelledByFinal, disabled: disabled !== null && disabled !== void 0 ? disabled : loading, rel: Component === 'a' ? relFinal : undefined, target: Component === 'a' ? target : undefined, type: Component === 'button' ? type : undefined, ...rest },
|
|
20
20
|
React.createElement("span", { className: styles.body, ref: mergeRefs([ref, tooltipRef]) },
|
|
21
21
|
loading && React.createElement(Loader, { size: size }),
|
|
22
22
|
!loading && React.createElement(Icon, { className: iconClassName, color: iconColor, icon: icon, size: size, ariaHidden: true }))))));
|
package/lib/IconButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../src/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwB,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,EAAE,IAAI,EAA4B,MAAM,QAAQ,CAAA;AACvD,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAA;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../src/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwB,UAAU,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,EAAE,IAAI,EAA4B,MAAM,QAAQ,CAAA;AACvD,OAAO,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAA;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,OAAO,MAAM,MAAM,0BAA0B,CAAA;AA+C7C,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EAAE,SAAS,GAAG,QAAQ,EAC/B,IA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,aAAR,QAAQ,cAAR,QAAQ,GAAI,OAAO,EAC7B,GAAG,EAAE,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAC7C,MAAM,EAAE,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC9C,IAAI,EAAE,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,KAC3C,IAAI;QAER,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;YAC5D,OAAO,IAAI,oBAAC,MAAM,IAAC,IAAI,EAAE,IAAI,GAAI;YACjC,CAAC,OAAO,IAAI,oBAAC,IAAI,IAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,SAAG,CAC/F,CACG,CACb,CACO,CACX,CAAA;AACH,CAAC,CACF,CAAA;AACD,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA"}
|
package/lib/InteractiveList.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { FocusEvent } from 'react';
|
|
2
2
|
import { TextFieldExtraProps } from './TextField';
|
|
3
3
|
import { ExtractKeysOfValueType } from './utils/types';
|
|
4
|
+
import { FieldHeaderProps } from './FieldHeader';
|
|
4
5
|
export declare type InteractiveListExtraProps = {
|
|
5
6
|
children?: React.ReactNode | React.ReactNode[];
|
|
6
|
-
} & Pick<TextFieldExtraProps<'text'>, '
|
|
7
|
+
} & Pick<TextFieldExtraProps<'text'>, 'inputIcon' | 'type' | 'placeholder'> & Omit<FieldHeaderProps, 'id'>;
|
|
7
8
|
export declare type InteractiveListCoreProps<V> = {
|
|
8
9
|
name: ExtractKeysOfValueType<V, string[]>;
|
|
9
10
|
value: string[];
|
|
@@ -29,5 +30,4 @@ export declare const InteractiveListItem: ({ onRemoveItem, content, error, idx }
|
|
|
29
30
|
* This component is meant to be used only from InteractiveListFormik
|
|
30
31
|
* @private
|
|
31
32
|
*/
|
|
32
|
-
declare const InteractiveList: <V>({ label, children, error, name, value, helperText, inputIcon, type, inputValue, setInputValue, onAddItem, onRemoveItem, }: InteractiveListProps<V>) => JSX.Element;
|
|
33
|
-
export default InteractiveList;
|
|
33
|
+
export declare const InteractiveList: <V>({ label, children, error, name, value, helperText, inputIcon, type, inputValue, setInputValue, onAddItem, onRemoveItem, }: InteractiveListProps<V>) => JSX.Element;
|
package/lib/InteractiveList.js
CHANGED
|
@@ -15,7 +15,7 @@ export const InteractiveListItem = ({ onRemoveItem, content, error, idx }) => {
|
|
|
15
15
|
: {};
|
|
16
16
|
return (React.createElement(React.Fragment, null,
|
|
17
17
|
React.createElement("div", { className: styles.content },
|
|
18
|
-
React.createElement("span",
|
|
18
|
+
React.createElement("span", { id: id, ...errorProps }, content),
|
|
19
19
|
' ',
|
|
20
20
|
React.createElement(IconButton, { kind: "transparent", ariaLabel: "Remove Item", icon: X, size: "small", onClick: () => {
|
|
21
21
|
onRemoveItem(idx);
|
|
@@ -26,7 +26,7 @@ export const InteractiveListItem = ({ onRemoveItem, content, error, idx }) => {
|
|
|
26
26
|
* This component is meant to be used only from InteractiveListFormik
|
|
27
27
|
* @private
|
|
28
28
|
*/
|
|
29
|
-
const InteractiveList = ({ label, children, error, name, value, helperText, inputIcon, type, inputValue, setInputValue, onAddItem, onRemoveItem, }) => {
|
|
29
|
+
export const InteractiveList = ({ label, children, error, name, value, helperText, inputIcon, type, inputValue, setInputValue, onAddItem, onRemoveItem, }) => {
|
|
30
30
|
const id = useUID();
|
|
31
31
|
return (React.createElement(React.Fragment, null,
|
|
32
32
|
React.createElement("div", { className: styles.inputRow },
|
|
@@ -43,5 +43,4 @@ const InteractiveList = ({ label, children, error, name, value, helperText, inpu
|
|
|
43
43
|
React.createElement("ul", { className: styles.list }, value.map((str, idx) => (React.createElement("li", { key: str },
|
|
44
44
|
React.createElement(InteractiveListItem, { onRemoveItem: onRemoveItem, idx: idx, content: str, error: typeof error === 'object' && error[idx] ? error[idx] : undefined })))))));
|
|
45
45
|
};
|
|
46
|
-
export default InteractiveList;
|
|
47
46
|
//# sourceMappingURL=InteractiveList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveList.js","sourceRoot":"","sources":["../src/InteractiveList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,SAAS,EAAuB,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"InteractiveList.js","sourceRoot":"","sources":["../src/InteractiveList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,SAAS,EAAuB,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AA+BxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAA4B,EAAE,EAAE;IACrG,MAAM,EAAE,GAAG,M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,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;oBAClC,aAAa,CAAC,KAAK,CAAC,CAAA;gBACtB,CAAC,EACD,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;oBACtB,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;wBACrB,CAAC,CAAC,cAAc,EAAE,CAAA;wBAClB,MAAM,SAAS,EAAE,CAAA;qBAClB;gBACH,CAAC,GACD;YACF,oBAAC,UAAU,iBACC,6BAA6B,EACvC,IAAI,EAAC,aAAa,EAClB,SAAS,EAAC,UAAU,EACpB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,CAAC,OAAO,EACzB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,SAAS,GAClB,CACE;QACL,QAAQ;QACT,4BAAI,SAAS,EAAE,MAAM,CAAC,IAAI,IACvB,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CACvB,4BAAI,GAAG,EAAE,GAAG;YACV,oBAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,GAAG,EACZ,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GACvE,CACC,CACN,CAAC,CACC,CACJ,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
2
2
|
import { FieldArray, useField, useFormikContext } from 'formik';
|
|
3
|
-
import InteractiveList from './InteractiveList';
|
|
3
|
+
import { InteractiveList } from './InteractiveList';
|
|
4
4
|
import { getFieldError } from './utils/formik';
|
|
5
5
|
/**
|
|
6
6
|
* InteractiveListFormik
|
|
@@ -15,7 +15,7 @@ import { getFieldError } from './utils/formik';
|
|
|
15
15
|
* Passing an InteractiveListInputRef as inputControlRef property allows you to modify the value of text input.
|
|
16
16
|
*/
|
|
17
17
|
export const InteractiveListFormik = ({ name, validate, children, inputControlRef, ...props }) => {
|
|
18
|
-
const { validateForm } = useFormikContext();
|
|
18
|
+
const { validateForm, values: valuesFormik } = useFormikContext();
|
|
19
19
|
const [field, meta, { setTouched, setError }] = useField({
|
|
20
20
|
name,
|
|
21
21
|
validate,
|
|
@@ -39,6 +39,7 @@ export const InteractiveListFormik = ({ name, validate, children, inputControlRe
|
|
|
39
39
|
// If we passed with previous checks, let's check against Formik's validation error
|
|
40
40
|
// We do that by checking future state with validateForm
|
|
41
41
|
const formikErrors = await validateForm({
|
|
42
|
+
...valuesFormik,
|
|
42
43
|
[name]: [...field.value, normalizedValue],
|
|
43
44
|
});
|
|
44
45
|
const fieldErrors = formikErrors[name];
|
|
@@ -72,7 +73,7 @@ export const InteractiveListFormik = ({ name, validate, children, inputControlRe
|
|
|
72
73
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
74
|
}, [inputTouched, inputValue]);
|
|
74
75
|
return (React.createElement(FieldArray, { name: name, render: (arrayHelpers) => {
|
|
75
|
-
return (React.createElement(InteractiveList,
|
|
76
|
+
return (React.createElement(InteractiveList, { ...props, name: name, value: field.value, inputValue: inputValue, setInputValue: setInputValue, error: getFieldError(meta), onAddItem: async () => {
|
|
76
77
|
const validationError = await getValidationError();
|
|
77
78
|
if (validationError) {
|
|
78
79
|
onError(validationError);
|
|
@@ -85,7 +86,7 @@ export const InteractiveListFormik = ({ name, validate, children, inputControlRe
|
|
|
85
86
|
setInputValue('');
|
|
86
87
|
return undefined;
|
|
87
88
|
}
|
|
88
|
-
}, onRemoveItem: (idx) => !!arrayHelpers.remove(idx) }
|
|
89
|
+
}, onRemoveItem: (idx) => !!arrayHelpers.remove(idx) }, children));
|
|
89
90
|
} }));
|
|
90
91
|
};
|
|
91
92
|
//# sourceMappingURL=InteractiveListFormik.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveListFormik.js","sourceRoot":"","sources":["../src/InteractiveListFormik.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChH,OAAO,EAAE,UAAU,EAAkB,QAAQ,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAE/E,OAAO,
|
|
1
|
+
{"version":3,"file":"InteractiveListFormik.js","sourceRoot":"","sources":["../src/InteractiveListFormik.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChH,OAAO,EAAE,UAAU,EAAkB,QAAQ,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAE/E,OAAO,EAAE,eAAe,EAAsD,MAAM,mBAAmB,CAAA;AACvG,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAQ9C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAmB,EACtD,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,GAAG,KAAK,EACsB,EAAgB,EAAE;IAChD,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,gBAAgB,EAAK,CAAA;IACpE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAW;QACjE,IAAI;QACJ,QAAQ;KACT,CAAC,CAAA;IAEF,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,eAAe,GAAuB,SAAS,CAAA;QAEnD,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC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A;wBACtB,aAAa,CAAC,EAAE,CAAC,CAAA;wBACjB,OAAO,SAAS,CAAA;qBACjB;gBACH,CAAC,EACD,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,IAEhD,QAAQ,CACO,CACnB,CAAA;QACH,CAAC,GACD,CACH,CAAA;AACH,CAAC,CAAA"}
|
package/lib/Link.d.ts
CHANGED
|
@@ -48,69 +48,5 @@ export declare type LinkProps = IconProps & {
|
|
|
48
48
|
* - Link can be used as a stand-alone component with right chevron icon.
|
|
49
49
|
* - You can change underlying semantics with a component property. Typescript will guard you on providing other properties related to the component type.
|
|
50
50
|
*/
|
|
51
|
-
export declare const Link: React.ForwardRefExoticComponent<
|
|
52
|
-
icon: FeatherIcon;
|
|
53
|
-
ariaLabel: string;
|
|
54
|
-
iconClassName?: string | undefined;
|
|
55
|
-
} & {
|
|
56
|
-
size?: "normal" | "small" | undefined;
|
|
57
|
-
kind?: "primary" | "secondary" | undefined;
|
|
58
|
-
children: ReactNode;
|
|
59
|
-
bold?: boolean | undefined;
|
|
60
|
-
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
61
|
-
} & Pick<AnchorAttributes, "className"> & {
|
|
62
|
-
component: 'button';
|
|
63
|
-
href?: undefined;
|
|
64
|
-
target?: undefined;
|
|
65
|
-
rel?: undefined;
|
|
66
|
-
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
67
|
-
} & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>) | ({
|
|
68
|
-
icon: FeatherIcon;
|
|
69
|
-
ariaLabel: string;
|
|
70
|
-
iconClassName?: string | undefined;
|
|
71
|
-
} & {
|
|
72
|
-
size?: "normal" | "small" | undefined;
|
|
73
|
-
kind?: "primary" | "secondary" | undefined;
|
|
74
|
-
children: ReactNode;
|
|
75
|
-
bold?: boolean | undefined;
|
|
76
|
-
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
77
|
-
} & Pick<AnchorAttributes, "className"> & {
|
|
78
|
-
component?: "a" | undefined;
|
|
79
|
-
href: string;
|
|
80
|
-
target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
|
|
81
|
-
rel?: "alternate" | "help" | "search" | "author" | "bookmark" | "dns-prefetch" | "external" | "license" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "prev" | "tag" | LinkRel[] | undefined;
|
|
82
|
-
type?: undefined;
|
|
83
|
-
} & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>) | ({
|
|
84
|
-
icon?: undefined;
|
|
85
|
-
ariaLabel?: undefined;
|
|
86
|
-
iconClassName?: undefined;
|
|
87
|
-
} & {
|
|
88
|
-
size?: "normal" | "small" | undefined;
|
|
89
|
-
kind?: "primary" | "secondary" | undefined;
|
|
90
|
-
children: ReactNode;
|
|
91
|
-
bold?: boolean | undefined;
|
|
92
|
-
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
93
|
-
} & Pick<AnchorAttributes, "className"> & {
|
|
94
|
-
component: 'button';
|
|
95
|
-
href?: undefined;
|
|
96
|
-
target?: undefined;
|
|
97
|
-
rel?: undefined;
|
|
98
|
-
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
99
|
-
} & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>) | ({
|
|
100
|
-
icon?: undefined;
|
|
101
|
-
ariaLabel?: undefined;
|
|
102
|
-
iconClassName?: undefined;
|
|
103
|
-
} & {
|
|
104
|
-
size?: "normal" | "small" | undefined;
|
|
105
|
-
kind?: "primary" | "secondary" | undefined;
|
|
106
|
-
children: ReactNode;
|
|
107
|
-
bold?: boolean | undefined;
|
|
108
|
-
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void) | undefined;
|
|
109
|
-
} & Pick<AnchorAttributes, "className"> & {
|
|
110
|
-
component?: "a" | undefined;
|
|
111
|
-
href: string;
|
|
112
|
-
target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
|
|
113
|
-
rel?: "alternate" | "help" | "search" | "author" | "bookmark" | "dns-prefetch" | "external" | "license" | "next" | "nofollow" | "noopener" | "noreferrer" | "opener" | "prev" | "tag" | LinkRel[] | undefined;
|
|
114
|
-
type?: undefined;
|
|
115
|
-
} & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>)>;
|
|
51
|
+
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
116
52
|
export {};
|
package/lib/Link.js
CHANGED
|
@@ -18,7 +18,7 @@ const sizes = {
|
|
|
18
18
|
* - Link can be used as a stand-alone component with right chevron icon.
|
|
19
19
|
* - You can change underlying semantics with a component property. Typescript will guard you on providing other properties related to the component type.
|
|
20
20
|
*/
|
|
21
|
-
export const Link = forwardRef(({ component = 'a', kind = 'primary', size = 'normal', bold = false, icon, ariaLabel, iconClassName, href, rel = 'noopener', target = '_self', type, onClick, className, children, }, ref) => {
|
|
21
|
+
export const Link = forwardRef(({ component = 'a', kind = 'primary', size = 'normal', bold = false, icon, ariaLabel, iconClassName, href, rel = 'noopener', target = '_self', type = 'button', onClick, className, children, }, ref) => {
|
|
22
22
|
const relFinal = Array.isArray(rel) ? rel.join(' ') : rel;
|
|
23
23
|
const commonProps = {
|
|
24
24
|
className: cn(styles[size], {
|
|
@@ -30,12 +30,11 @@ export const Link = forwardRef(({ component = 'a', kind = 'primary', size = 'nor
|
|
|
30
30
|
}, className),
|
|
31
31
|
href: href,
|
|
32
32
|
onClick: onClick,
|
|
33
|
-
type: type,
|
|
34
33
|
};
|
|
35
34
|
const iconComponent = icon && ariaLabel ? (React.createElement(Icon, { bold: bold, icon: icon, ariaLabel: ariaLabel, size: size === 'normal' ? 'medium' : 'small', className: iconClassName })) : undefined;
|
|
36
|
-
return component === 'a' ? (React.createElement("a",
|
|
35
|
+
return component === 'a' ? (React.createElement("a", { ...commonProps, rel: relFinal, target: target, ref: ref },
|
|
37
36
|
children,
|
|
38
|
-
iconComponent)) : (React.createElement("button",
|
|
37
|
+
iconComponent)) : (React.createElement("button", { ...commonProps, type: type, ref: ref },
|
|
39
38
|
children,
|
|
40
39
|
iconComponent));
|
|
41
40
|
});
|
package/lib/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA8C,UAAU,EAAkD,MAAM,OAAO,CAAA;AAErI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAIvC,MAAM,KAAK,GAAG;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC,KAAK;CACpB,CAAA;AA6DD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAC5B,CACE,EACE,SAAS,GAAG,GAAG,EACf,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,KAAK,EACZ,IAAI,EACJ,SAAS,EACT,aAAa,EACb,IAAI,EACJ,GAAG,GAAG,UAAU,EAChB,MAAM,GAAG,OAAO,EAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA8C,UAAU,EAAkD,MAAM,OAAO,CAAA;AAErI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAIvC,MAAM,KAAK,GAAG;I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AA;IAEf,OAAO,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CACzB,8BAAO,WAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAA0C;QAC/F,QAAQ;QACR,aAAa,CACZ,CACL,CAAC,CAAC,CAAC,CACF,mCAAY,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAA0C;QACjF,QAAQ;QACR,aAAa,CACP,CACV,CAAA;AACH,CAAC,CACF,CAAA;AACD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA"}
|
package/lib/Link.module.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use '../styles/constants' as c;
|
|
2
|
+
@use '../styles/helpers' as h;
|
|
2
3
|
|
|
3
4
|
@mixin link {
|
|
4
5
|
display: inline-flex;
|
|
@@ -19,9 +20,15 @@
|
|
|
19
20
|
outline: transparent solid c.$outlineWidth;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
&:focus,
|
|
24
|
+
&.focus {
|
|
25
|
+
@include h.outlineSimple;
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
&.primary {
|
|
23
29
|
color: c.$colorPrimary;
|
|
24
30
|
}
|
|
31
|
+
|
|
25
32
|
&.secondary {
|
|
26
33
|
color: c.$colorTextSecondary;
|
|
27
34
|
}
|
package/lib/Loader.js
CHANGED
|
@@ -5,7 +5,7 @@ export const Loader = ({ className, size = 'medium', kind = 'inherit', ...props
|
|
|
5
5
|
// https://github.com/feathericons/feather/blob/a718a7e9c39447202f703783336e8ba1c8e32405/icons/loader.svg#L1
|
|
6
6
|
// We cannot use it directly as it has `line` elements not in a sequential order
|
|
7
7
|
// And we need the sequential order to easily calculate animation delay
|
|
8
|
-
React.createElement("svg",
|
|
8
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: cn(styles.loader, {
|
|
9
9
|
[styles.small]: size === 'small',
|
|
10
10
|
[styles.smallMedium]: size === 'smallMedium',
|
|
11
11
|
[styles.medium]: size === 'medium',
|
|
@@ -14,7 +14,7 @@ React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg",
|
|
|
14
14
|
[styles.primary]: kind === 'primary',
|
|
15
15
|
[styles.contrast]: kind === 'contrast',
|
|
16
16
|
[styles.inherit]: kind === 'inherit',
|
|
17
|
-
}, className), viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-label": "Loader icon"
|
|
17
|
+
}, className), viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-label": "Loader icon", ...props },
|
|
18
18
|
React.createElement("line", { x1: "12", y1: "2", x2: "12", y2: "6" }),
|
|
19
19
|
React.createElement("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }),
|
|
20
20
|
React.createElement("line", { x1: "2", y1: "12", x2: "6", y2: "12" }),
|
package/lib/Loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../src/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,MAAM,YAAY,CAAA;AAI3B,OAAO,MAAM,MAAM,sBAAsB,CAAA;AASzC,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC;AACrG,4GAA4G;AAC5G,gFAAgF;AAChF,uEAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../src/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,MAAM,YAAY,CAAA;AAI3B,OAAO,MAAM,MAAM,sBAA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