@festo-ui/react 7.2.0-dev.423 → 7.2.0-dev.426
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/index.css +1 -1
- package/lib/components/buttons/button/Button.d.ts +1 -1
- package/lib/components/buttons/button/Button.js +3 -2
- package/lib/components/buttons/button/Button.stories.js +27 -19
- package/lib/components/card/CardNotification.d.ts +1 -2
- package/lib/components/card/CardNotification.js +3 -3
- package/lib/components/chips/chip/Chip.d.ts +2 -3
- package/lib/components/chips/chip/Chip.js +4 -4
- package/lib/components/icon-wrapper/IconWrapper.d.ts +4 -0
- package/lib/components/icon-wrapper/IconWrapper.js +17 -0
- package/lib/components/icons/check-small.d.ts +7 -0
- package/lib/components/icons/check-small.js +72 -0
- package/lib/components/icons/collapse.d.ts +7 -0
- package/lib/components/icons/collapse.js +71 -0
- package/lib/components/icons/expand.d.ts +7 -0
- package/lib/components/icons/expand.js +71 -0
- package/lib/components/icons/right-2.d.ts +7 -0
- package/lib/components/icons/right-2.js +68 -0
- package/lib/components/icons/warning.d.ts +7 -0
- package/lib/components/icons/warning.js +71 -0
- package/lib/components/link-button/LinkButton.js +6 -11
- package/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +1 -1
- package/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +7 -5
- package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +3 -3
- package/lib/components/modals/imageGallery/ImageGallery.js +6 -15
- package/lib/components/popovers/popover-menu/PopoverMenu.d.ts +3 -4
- package/lib/components/popovers/popover-menu/PopoverMenu.js +6 -8
- package/lib/components/tab/Tabs.js +3 -2
- package/lib/components/tab/interfaces.d.ts +2 -1
- package/lib/forms/color-picker/ColorPicker.js +9 -13
- package/lib/forms/segment/segment-control/SegmentControl.d.ts +2 -2
- package/lib/forms/segment/segment-control/SegmentControl.js +11 -14
- package/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +14 -24
- package/node/lib/components/buttons/button/Button.js +3 -2
- package/node/lib/components/buttons/button/Button.stories.js +27 -19
- package/node/lib/components/card/CardNotification.js +3 -3
- package/node/lib/components/chips/chip/Chip.js +4 -4
- package/node/lib/components/icon-wrapper/IconWrapper.js +23 -0
- package/node/lib/components/icons/check-small.js +77 -0
- package/node/lib/components/icons/collapse.js +76 -0
- package/node/lib/components/icons/expand.js +76 -0
- package/node/lib/components/icons/right-2.js +73 -0
- package/node/lib/components/icons/warning.js +76 -0
- package/node/lib/components/link-button/LinkButton.js +6 -11
- package/node/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +7 -5
- package/node/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +3 -3
- package/node/lib/components/modals/imageGallery/ImageGallery.js +6 -15
- package/node/lib/components/popovers/popover-menu/PopoverMenu.js +6 -8
- package/node/lib/components/tab/Tabs.js +3 -2
- package/node/lib/forms/color-picker/ColorPicker.js +9 -13
- package/node/lib/forms/segment/segment-control/SegmentControl.js +11 -14
- package/node/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +14 -24
- package/package.json +1 -1
- package/lib/components/chips/chip/DeleteIcon.d.ts +0 -2
- package/lib/components/chips/chip/DeleteIcon.js +0 -7
- package/node/lib/components/chips/chip/DeleteIcon.js +0 -13
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
export default function IconRight2(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
className,
|
|
6
|
+
svgProps,
|
|
7
|
+
festoColor,
|
|
8
|
+
size = 16
|
|
9
|
+
} = _ref;
|
|
10
|
+
if (size < 24) {
|
|
11
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
"data-name": "white background",
|
|
14
|
+
viewBox: "0 0 16 16",
|
|
15
|
+
width: size,
|
|
16
|
+
height: size,
|
|
17
|
+
...svgProps,
|
|
18
|
+
className: `fwe-svg-icon${className ? ` ${className}` : ''}`,
|
|
19
|
+
"aria-label": "right-2",
|
|
20
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
21
|
+
fill: "none",
|
|
22
|
+
d: "M0 16V0h16v16z"
|
|
23
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
24
|
+
fill: festoColor ? '#0091dc' : 'currentColor',
|
|
25
|
+
d: "m10.707 8-4.353 4.354-.708-.708L9.293 8 5.646 4.354l.708-.708z"
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (size < 32 || size === 48) {
|
|
30
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
31
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
32
|
+
"data-name": "white background",
|
|
33
|
+
viewBox: "0 0 24 24",
|
|
34
|
+
width: size,
|
|
35
|
+
height: size,
|
|
36
|
+
...svgProps,
|
|
37
|
+
className: `fwe-svg-icon${className ? ` ${className}` : ''}`,
|
|
38
|
+
"aria-label": "right-2",
|
|
39
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
40
|
+
fill: "none",
|
|
41
|
+
d: "M0 24V0h24v24z"
|
|
42
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
43
|
+
fill: festoColor ? '#0091dc' : 'currentColor',
|
|
44
|
+
d: "M9.172 18.364 15.536 12 9.172 5.636l-.708.707L14.121 12l-5.657 5.657z"
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (size >= 32) {
|
|
49
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
50
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
51
|
+
"data-name": "white background",
|
|
52
|
+
viewBox: "0 0 32 32",
|
|
53
|
+
width: size,
|
|
54
|
+
height: size,
|
|
55
|
+
...svgProps,
|
|
56
|
+
className: `fwe-svg-icon${className ? ` ${className}` : ''}`,
|
|
57
|
+
"aria-label": "right-2",
|
|
58
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
59
|
+
fill: "none",
|
|
60
|
+
d: "M0 32V0h32v32z"
|
|
61
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
62
|
+
fill: festoColor ? '#0091dc' : 'currentColor',
|
|
63
|
+
d: "m22 16-8.707 8.707-1.414-1.414L19.172 16l-7.293-7.293 1.414-1.414z"
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement, SVGProps } from 'react';
|
|
2
|
+
export default function IconWarning({ className, svgProps, festoColor, size, }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
svgProps?: SVGProps<SVGSVGElement>;
|
|
5
|
+
festoColor?: boolean;
|
|
6
|
+
size?: 16 | 24 | 32 | 48 | 64 | 96 | 128;
|
|
7
|
+
}): ReactElement<any, any> | null;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
export default function IconWarning(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
className,
|
|
6
|
+
svgProps,
|
|
7
|
+
festoColor,
|
|
8
|
+
size = 16
|
|
9
|
+
} = _ref;
|
|
10
|
+
if (size < 24) {
|
|
11
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
viewBox: "0 0 16 16",
|
|
14
|
+
width: size,
|
|
15
|
+
height: size,
|
|
16
|
+
...svgProps,
|
|
17
|
+
className: `fwe-svg-icon${className ? ` ${className}` : ''}`,
|
|
18
|
+
"aria-label": "warning",
|
|
19
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
20
|
+
fill: "none",
|
|
21
|
+
d: "M0 0h16v16H0z",
|
|
22
|
+
"data-name": "white background"
|
|
23
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
24
|
+
fill: festoColor ? '#ff9600' : 'currentColor',
|
|
25
|
+
d: "M15.216 13.53 8.882 1.653a1 1 0 0 0-1.764 0L.784 13.53A1 1 0 0 0 1.667 15h12.666a1 1 0 0 0 .883-1.47M9 13H7v-2h2Zm0-3H7V5h2Z",
|
|
26
|
+
"data-name": "content"
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
if (size < 32 || size === 48) {
|
|
31
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
viewBox: "0 0 24 24",
|
|
34
|
+
width: size,
|
|
35
|
+
height: size,
|
|
36
|
+
...svgProps,
|
|
37
|
+
className: `fwe-svg-icon${className ? ` ${className}` : ''}`,
|
|
38
|
+
"aria-label": "warning",
|
|
39
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
40
|
+
fill: "none",
|
|
41
|
+
d: "M0 0h24v24H0z",
|
|
42
|
+
"data-name": "white background"
|
|
43
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
44
|
+
fill: festoColor ? '#ff9600' : 'currentColor',
|
|
45
|
+
d: "M22.4 19.86 13.273 2.743a1.441 1.441 0 0 0-2.544 0L1.6 19.86a1.44 1.44 0 0 0 1.272 2.12H21.13a1.44 1.44 0 0 0 1.272-2.12M11 7h2v8h-2Zm2.005 11.965h-2.01v-2.01h2.01Z",
|
|
46
|
+
"data-name": "content"
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (size >= 32) {
|
|
51
|
+
return /*#__PURE__*/_jsxs("svg", {
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
viewBox: "0 0 32 32",
|
|
54
|
+
width: size,
|
|
55
|
+
height: size,
|
|
56
|
+
...svgProps,
|
|
57
|
+
className: `fwe-svg-icon${className ? ` ${className}` : ''}`,
|
|
58
|
+
"aria-label": "warning",
|
|
59
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
60
|
+
fill: "none",
|
|
61
|
+
d: "M0 0h32v32H0z",
|
|
62
|
+
"data-name": "white background"
|
|
63
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
64
|
+
fill: festoColor ? '#ff9600' : 'currentColor',
|
|
65
|
+
d: "M30.431 26.059 17.765 2.309a2 2 0 0 0-3.53 0L1.57 26.059A2 2 0 0 0 3.333 29h25.334a2 2 0 0 0 1.764-2.941M17 25h-2v-2h2Zm0-5h-2V10h2Z",
|
|
66
|
+
"data-name": "content"
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
+
import IconWrapper from '../icon-wrapper/IconWrapper';
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
6
|
const LinkButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
@@ -14,17 +15,9 @@ const LinkButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14
15
|
} = _ref;
|
|
15
16
|
const classes = classNames('fwe-btn', 'fwe-btn-link', {
|
|
16
17
|
'fwe-disabled': disabled
|
|
18
|
+
}, {
|
|
19
|
+
'fwe-btn-icon': iconOnly
|
|
17
20
|
}, className);
|
|
18
|
-
let innerIcon;
|
|
19
|
-
if (icon) {
|
|
20
|
-
if (typeof icon === 'string') {
|
|
21
|
-
innerIcon = /*#__PURE__*/_jsx("i", {
|
|
22
|
-
className: `fwe-icon fwe-icon-${icon}`
|
|
23
|
-
});
|
|
24
|
-
} else {
|
|
25
|
-
innerIcon = icon;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
21
|
return /*#__PURE__*/_jsxs("button", {
|
|
29
22
|
onClick: onClick,
|
|
30
23
|
type: "button",
|
|
@@ -32,7 +25,9 @@ const LinkButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
32
25
|
disabled: disabled,
|
|
33
26
|
ref: ref,
|
|
34
27
|
...props,
|
|
35
|
-
children: [
|
|
28
|
+
children: [/*#__PURE__*/_jsx(IconWrapper, {
|
|
29
|
+
icon: icon
|
|
30
|
+
}), !iconOnly && children]
|
|
36
31
|
});
|
|
37
32
|
});
|
|
38
33
|
export default LinkButton;
|
|
@@ -4,7 +4,7 @@ declare module 'react' {
|
|
|
4
4
|
function forwardRef<T, P = {}>(render: (props: P, ref: React.Ref<T>) => React.ReactElement | null): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
|
5
5
|
}
|
|
6
6
|
interface MobileFlyoutItemBaseProps {
|
|
7
|
-
icon?:
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
8
|
pageLink?: string;
|
|
9
9
|
active?: boolean;
|
|
10
10
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import cn from 'classnames';
|
|
2
2
|
import { forwardRef, useContext } from 'react';
|
|
3
3
|
import MobileFlyoutContext from '../MobileFlyoutContext';
|
|
4
|
+
import IconRight2 from '../../icons/right-2';
|
|
5
|
+
import IconWrapper from '../../icon-wrapper/IconWrapper';
|
|
4
6
|
|
|
5
7
|
/*
|
|
6
8
|
* Augment `forwardRef` only for this module so that storybook can infer controls
|
|
@@ -38,16 +40,16 @@ const MobileFlyoutItem = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
38
40
|
...props,
|
|
39
41
|
ref: ref,
|
|
40
42
|
onClick: handleClick,
|
|
41
|
-
children: [
|
|
42
|
-
|
|
43
|
+
children: [/*#__PURE__*/_jsx(IconWrapper, {
|
|
44
|
+
icon: icon
|
|
43
45
|
}), /*#__PURE__*/_jsx("div", {
|
|
44
46
|
className: cn('fwe-flex-grow-1', {
|
|
45
47
|
'fwe-color-hero': active
|
|
48
|
+
}, {
|
|
49
|
+
'fwe-ml-xxs': !!icon
|
|
46
50
|
}),
|
|
47
51
|
children: children
|
|
48
|
-
}), pageLink && /*#__PURE__*/_jsx(
|
|
49
|
-
className: "fwe-icon fwe-icon-arrows-right-2"
|
|
50
|
-
})]
|
|
52
|
+
}), pageLink && /*#__PURE__*/_jsx(IconRight2, {})]
|
|
51
53
|
});
|
|
52
54
|
});
|
|
53
55
|
export default MobileFlyoutItem;
|
|
@@ -29,15 +29,15 @@ export const MobileFlyoutPage = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
29
29
|
}),
|
|
30
30
|
ref: ref,
|
|
31
31
|
...props,
|
|
32
|
-
children: [!root && /*#__PURE__*/
|
|
32
|
+
children: [!root && /*#__PURE__*/_jsx("div", {
|
|
33
33
|
tabIndex: 0,
|
|
34
34
|
role: "button",
|
|
35
35
|
className: "fwe-page-back",
|
|
36
36
|
onClick: handleChange,
|
|
37
37
|
onKeyUp: handleChange,
|
|
38
|
-
children:
|
|
38
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
39
39
|
children: innerBack
|
|
40
|
-
})
|
|
40
|
+
})
|
|
41
41
|
}), /*#__PURE__*/_jsx("div", {
|
|
42
42
|
className: "fwe-mobile-flyout-item-container",
|
|
43
43
|
children: children
|
|
@@ -54,27 +54,18 @@ export const ImageGallery = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
54
54
|
length: images.length,
|
|
55
55
|
pagination: pagination
|
|
56
56
|
}), showScaleButton ? /*#__PURE__*/_jsx("button", {
|
|
57
|
-
"aria-label": "scale up",
|
|
58
57
|
type: "button",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
className: cn('fwe-icon fwe-icon-lg fwe-color-white fwe-modal-image-gallery-scale', {
|
|
63
|
-
'fwe-icon-arrows-scale-down': isScaled,
|
|
64
|
-
'fwe-icon-arrows-scale-up': !isScaled
|
|
65
|
-
})
|
|
66
|
-
})
|
|
58
|
+
"aria-label": "scale up",
|
|
59
|
+
className: "fwe-image-gallery-scale-btn fwe-ml-auto",
|
|
60
|
+
onClick: handleScale
|
|
67
61
|
}) : null, /*#__PURE__*/_jsx("button", {
|
|
68
|
-
"aria-label": "close",
|
|
69
62
|
type: "button",
|
|
70
|
-
|
|
63
|
+
"aria-label": "close",
|
|
64
|
+
className: cn('fwe-image-gallery-close-btn', {
|
|
71
65
|
'fwe-ml-auto': !showScaleButton,
|
|
72
66
|
'fwe-ml-3': showScaleButton
|
|
73
67
|
}),
|
|
74
|
-
onClick: onClose
|
|
75
|
-
children: /*#__PURE__*/_jsx("i", {
|
|
76
|
-
className: "fwe-icon fwe-icon-2x fwe-color-white fwe-icon-menu-close fwe-modal-image-gallery-close"
|
|
77
|
-
})
|
|
68
|
+
onClick: onClose
|
|
78
69
|
})]
|
|
79
70
|
}), descriptiveContent ? /*#__PURE__*/_jsxs("div", {
|
|
80
71
|
className: "fwe-image-gallery-container",
|
|
@@ -3,13 +3,12 @@ import { PopoverProps } from '../popover/Popover';
|
|
|
3
3
|
import './PopoverMenu.scss';
|
|
4
4
|
interface PopoverMenuItem {
|
|
5
5
|
text: string;
|
|
6
|
-
icon:
|
|
6
|
+
icon: React.ReactNode;
|
|
7
7
|
action?: (data: unknown) => void;
|
|
8
8
|
data: unknown;
|
|
9
9
|
}
|
|
10
|
-
export interface PopoverMenuProps extends Omit<PopoverProps, 'popoverContent' | '
|
|
11
|
-
icon: string;
|
|
10
|
+
export interface PopoverMenuProps extends Omit<PopoverProps, 'popoverContent' | 'open' | 'onStatusChange'> {
|
|
12
11
|
menu: PopoverMenuItem[];
|
|
13
12
|
}
|
|
14
|
-
declare function PopoverMenu({
|
|
13
|
+
declare function PopoverMenu({ children, menu, className, ...props }: PopoverMenuProps): JSX.Element;
|
|
15
14
|
export default PopoverMenu;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import Popover from '../popover/Popover';
|
|
4
|
+
import IconWrapper from '../../icon-wrapper/IconWrapper';
|
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
7
|
function PopoverMenu(_ref) {
|
|
7
8
|
let {
|
|
8
|
-
|
|
9
|
+
children,
|
|
9
10
|
menu,
|
|
10
11
|
className,
|
|
11
12
|
...props
|
|
@@ -29,8 +30,8 @@ function PopoverMenu(_ref) {
|
|
|
29
30
|
type: "button",
|
|
30
31
|
className: "fwe-btn fwe-btn-link fwe-dark",
|
|
31
32
|
onClick: e => handleClick(e, item),
|
|
32
|
-
children: [/*#__PURE__*/_jsx(
|
|
33
|
-
|
|
33
|
+
children: [/*#__PURE__*/_jsx(IconWrapper, {
|
|
34
|
+
icon: item.icon
|
|
34
35
|
}), /*#__PURE__*/_jsx("span", {
|
|
35
36
|
children: item.text
|
|
36
37
|
})]
|
|
@@ -47,11 +48,8 @@ function PopoverMenu(_ref) {
|
|
|
47
48
|
...props,
|
|
48
49
|
children: /*#__PURE__*/_jsx("button", {
|
|
49
50
|
type: "button",
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
children: /*#__PURE__*/_jsx("i", {
|
|
53
|
-
className: `fwe-icon fwe-mr-0 ${icon}`
|
|
54
|
-
})
|
|
51
|
+
className: "menu-button",
|
|
52
|
+
children: children
|
|
55
53
|
})
|
|
56
54
|
})
|
|
57
55
|
});
|
|
@@ -2,6 +2,7 @@ import classNames from 'classnames';
|
|
|
2
2
|
import React, { forwardRef, isValidElement, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import useForkRef from '../../helper/useForkRef';
|
|
4
4
|
import useTabScroll from './useTabScroll';
|
|
5
|
+
import IconWrapper from '../icon-wrapper/IconWrapper';
|
|
5
6
|
|
|
6
7
|
// legacy: recommended for desktop only applications
|
|
7
8
|
// responsive: desktop, tablet, mobile with scrollable tabs
|
|
@@ -142,8 +143,8 @@ export const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
142
143
|
role: "tab",
|
|
143
144
|
"aria-controls": id,
|
|
144
145
|
"aria-selected": active,
|
|
145
|
-
children: [/*#__PURE__*/_jsx(
|
|
146
|
-
|
|
146
|
+
children: [/*#__PURE__*/_jsx(IconWrapper, {
|
|
147
|
+
icon: icon
|
|
147
148
|
}), /*#__PURE__*/_jsx("span", {
|
|
148
149
|
children: name
|
|
149
150
|
})]
|
|
@@ -5,6 +5,8 @@ import Draggable from 'react-draggable';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import ColorHelper from './ColorHelper';
|
|
7
7
|
import useId from '../../helper/useId';
|
|
8
|
+
import IconCheckSmall from '../../components/icons/check-small';
|
|
9
|
+
import IconCollapse from '../../components/icons/collapse';
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
12
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -368,8 +370,8 @@ function ColorPicker(_ref) {
|
|
|
368
370
|
children: [/*#__PURE__*/_jsx("span", {
|
|
369
371
|
className: "fwe-input-type",
|
|
370
372
|
children: inputType
|
|
371
|
-
}), /*#__PURE__*/_jsx(
|
|
372
|
-
className: "fwe-
|
|
373
|
+
}), /*#__PURE__*/_jsx(IconCollapse, {
|
|
374
|
+
className: "fwe-ml-s"
|
|
373
375
|
})]
|
|
374
376
|
}), selectOpen && /*#__PURE__*/_jsxs("div", {
|
|
375
377
|
className: "fwe-popover",
|
|
@@ -378,17 +380,13 @@ function ColorPicker(_ref) {
|
|
|
378
380
|
'fwe-selected': inputType === 'HEX'
|
|
379
381
|
}),
|
|
380
382
|
onClick: () => onChangeType('HEX'),
|
|
381
|
-
children: [/*#__PURE__*/_jsx(
|
|
382
|
-
className: "fwe-icon fwe-icon-menu-check"
|
|
383
|
-
}), " HEX"]
|
|
383
|
+
children: [/*#__PURE__*/_jsx(IconCheckSmall, {}), " HEX"]
|
|
384
384
|
}), /*#__PURE__*/_jsxs("div", {
|
|
385
385
|
className: classNames('fwe-type-item', {
|
|
386
386
|
'fwe-selected': inputType === 'RGB'
|
|
387
387
|
}),
|
|
388
388
|
onClick: () => onChangeType('RGB'),
|
|
389
|
-
children: [/*#__PURE__*/_jsx(
|
|
390
|
-
className: "fwe-icon fwe-icon-menu-check"
|
|
391
|
-
}), " RGB"]
|
|
389
|
+
children: [/*#__PURE__*/_jsx(IconCheckSmall, {}), " RGB"]
|
|
392
390
|
})]
|
|
393
391
|
})]
|
|
394
392
|
}), /*#__PURE__*/_jsxs("div", {
|
|
@@ -513,8 +511,8 @@ function ColorPicker(_ref) {
|
|
|
513
511
|
fill: "url(#bwsquare2px)",
|
|
514
512
|
strokeWidth: "0"
|
|
515
513
|
})]
|
|
516
|
-
}), /*#__PURE__*/_jsx(
|
|
517
|
-
className: classNames(
|
|
514
|
+
}), /*#__PURE__*/_jsx(IconCheckSmall, {
|
|
515
|
+
className: classNames({
|
|
518
516
|
'fwe-color-text': !innerColor
|
|
519
517
|
})
|
|
520
518
|
})]
|
|
@@ -528,9 +526,7 @@ function ColorPicker(_ref) {
|
|
|
528
526
|
background: colorItem
|
|
529
527
|
},
|
|
530
528
|
onClick: () => updateColorRgb(colorItem.toUpperCase()),
|
|
531
|
-
children: innerColor === colorItem.toUpperCase() && /*#__PURE__*/_jsx(
|
|
532
|
-
className: "fwe-icon fwe-icon-menu-check"
|
|
533
|
-
})
|
|
529
|
+
children: innerColor === colorItem.toUpperCase() && /*#__PURE__*/_jsx(IconCheckSmall, {})
|
|
534
530
|
}, colorItem);
|
|
535
531
|
})]
|
|
536
532
|
})]
|
|
@@ -6,10 +6,10 @@ export interface SegmentControlProps extends ClassNameProps {
|
|
|
6
6
|
value: any;
|
|
7
7
|
checked?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
icon?:
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
10
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: any) => void;
|
|
11
|
-
iconOnly?: boolean;
|
|
12
11
|
id?: string;
|
|
12
|
+
iconOnly?: boolean;
|
|
13
13
|
}
|
|
14
14
|
declare function SegmentControl(props: SegmentControlProps): JSX.Element;
|
|
15
15
|
export default SegmentControl;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
+
import IconWrapper from '../../../components/icon-wrapper/IconWrapper';
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -12,20 +13,15 @@ function SegmentControl(props) {
|
|
|
12
13
|
value,
|
|
13
14
|
icon,
|
|
14
15
|
onChange,
|
|
15
|
-
iconOnly,
|
|
16
16
|
id,
|
|
17
|
-
className
|
|
17
|
+
className,
|
|
18
|
+
iconOnly
|
|
18
19
|
} = props;
|
|
19
20
|
const componentId = useRef(id ?? (Math.random() * Date.now()).toString().replace('.', '-'));
|
|
20
21
|
let viewMode = 'text';
|
|
21
22
|
if (icon) {
|
|
22
23
|
viewMode = iconOnly ? 'icon' : 'icon-text';
|
|
23
24
|
}
|
|
24
|
-
const prefix = 'fwe-icon-';
|
|
25
|
-
let innerIcon = icon;
|
|
26
|
-
if (icon && icon.indexOf(prefix) === -1) {
|
|
27
|
-
innerIcon = prefix + icon;
|
|
28
|
-
}
|
|
29
25
|
const handleChange = event => {
|
|
30
26
|
if (onChange) {
|
|
31
27
|
onChange(event, value);
|
|
@@ -48,15 +44,16 @@ function SegmentControl(props) {
|
|
|
48
44
|
children: [/*#__PURE__*/_jsx("span", {
|
|
49
45
|
className: "fwe-sr-only",
|
|
50
46
|
children: label
|
|
51
|
-
}), /*#__PURE__*/_jsx(
|
|
52
|
-
|
|
53
|
-
className: classNames('fwe-icon', innerIcon)
|
|
47
|
+
}), /*#__PURE__*/_jsx(IconWrapper, {
|
|
48
|
+
icon: icon
|
|
54
49
|
})]
|
|
55
50
|
}), viewMode === 'text' && label, viewMode === 'icon-text' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
56
|
-
children: [/*#__PURE__*/_jsx(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
children: [/*#__PURE__*/_jsx(IconWrapper, {
|
|
52
|
+
icon: icon
|
|
53
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
54
|
+
className: "fwe-ml-xxs",
|
|
55
|
+
children: label
|
|
56
|
+
})]
|
|
60
57
|
})]
|
|
61
58
|
})]
|
|
62
59
|
});
|
|
@@ -4,6 +4,8 @@ import useForkRef from '../../../helper/useForkRef';
|
|
|
4
4
|
import LinkButton from '../../../components/link-button/LinkButton';
|
|
5
5
|
import TimePickerInput from './TimePickerInput';
|
|
6
6
|
import useOnClickOutside from '../../../helper/useOnClickOutside';
|
|
7
|
+
import IconCollapse from '../../../components/icons/collapse';
|
|
8
|
+
import IconExpand from '../../../components/icons/expand';
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
11
|
const TimePickerDropdown = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
@@ -141,10 +143,8 @@ const TimePickerDropdown = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
141
143
|
"aria-label": "hour up",
|
|
142
144
|
className: "fwe-dark",
|
|
143
145
|
onClick: () => handleHourIncrement(1),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
className: "fwe-icon fwe-icon-arrows-expand"
|
|
147
|
-
})
|
|
146
|
+
iconOnly: true,
|
|
147
|
+
icon: /*#__PURE__*/_jsx(IconExpand, {})
|
|
148
148
|
}), /*#__PURE__*/_jsx(TimePickerInput, {
|
|
149
149
|
"aria-label": "hours value",
|
|
150
150
|
min: min,
|
|
@@ -156,10 +156,8 @@ const TimePickerDropdown = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
156
156
|
"aria-label": "hour down",
|
|
157
157
|
className: "fwe-dark",
|
|
158
158
|
onClick: () => handleHourIncrement(-1),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
className: "fwe-icon fwe-icon-arrows-collapse"
|
|
162
|
-
})
|
|
159
|
+
iconOnly: true,
|
|
160
|
+
icon: /*#__PURE__*/_jsx(IconCollapse, {})
|
|
163
161
|
})]
|
|
164
162
|
}), /*#__PURE__*/_jsxs("div", {
|
|
165
163
|
className: "fwe-timepicker-spinners-minutes",
|
|
@@ -167,10 +165,8 @@ const TimePickerDropdown = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
167
165
|
"aria-label": "minute up",
|
|
168
166
|
className: "fwe-dark",
|
|
169
167
|
onClick: () => handleMinuteIncrement(innerMinuteStepSize),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
className: "fwe-icon fwe-icon-arrows-expand"
|
|
173
|
-
})
|
|
168
|
+
iconOnly: true,
|
|
169
|
+
icon: /*#__PURE__*/_jsx(IconExpand, {})
|
|
174
170
|
}), /*#__PURE__*/_jsx(TimePickerInput, {
|
|
175
171
|
"aria-label": "minutes value",
|
|
176
172
|
min: min,
|
|
@@ -181,10 +177,8 @@ const TimePickerDropdown = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
181
177
|
"aria-label": "minute down",
|
|
182
178
|
className: "fwe-dark",
|
|
183
179
|
onClick: () => handleMinuteIncrement(-innerMinuteStepSize),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
className: "fwe-icon fwe-icon-arrows-collapse"
|
|
187
|
-
})
|
|
180
|
+
iconOnly: true,
|
|
181
|
+
icon: /*#__PURE__*/_jsx(IconCollapse, {})
|
|
188
182
|
})]
|
|
189
183
|
}), showSeconds && /*#__PURE__*/_jsxs("div", {
|
|
190
184
|
className: "fwe-timepicker-spinners-seconds",
|
|
@@ -192,10 +186,8 @@ const TimePickerDropdown = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
192
186
|
"aria-label": "seconds up",
|
|
193
187
|
className: "fwe-dark",
|
|
194
188
|
onClick: () => handleSecondIncrement(1),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
className: "fwe-icon fwe-icon-arrows-expand"
|
|
198
|
-
})
|
|
189
|
+
iconOnly: true,
|
|
190
|
+
icon: /*#__PURE__*/_jsx(IconExpand, {})
|
|
199
191
|
}), /*#__PURE__*/_jsx(TimePickerInput, {
|
|
200
192
|
"aria-label": "seconds value",
|
|
201
193
|
min: min,
|
|
@@ -206,10 +198,8 @@ const TimePickerDropdown = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
206
198
|
"aria-label": "minute down",
|
|
207
199
|
className: "fwe-dark",
|
|
208
200
|
onClick: () => handleSecondIncrement(-1),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
className: "fwe-icon fwe-icon-arrows-collapse"
|
|
212
|
-
})
|
|
201
|
+
iconOnly: true,
|
|
202
|
+
icon: /*#__PURE__*/_jsx(IconCollapse, {})
|
|
213
203
|
})]
|
|
214
204
|
})]
|
|
215
205
|
}), timeFormat === '12' && /*#__PURE__*/_jsx("button", {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
8
|
var _react = require("react");
|
|
9
|
+
var _IconWrapper = _interopRequireDefault(require("../../icon-wrapper/IconWrapper"));
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
@@ -39,8 +40,8 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
39
40
|
disabled: disabled,
|
|
40
41
|
ref: ref,
|
|
41
42
|
...props,
|
|
42
|
-
children: [
|
|
43
|
-
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconWrapper.default, {
|
|
44
|
+
icon: icon
|
|
44
45
|
}), !iconOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
45
46
|
children: children
|
|
46
47
|
})]
|