widenarrow-ui 1.1.21 → 1.1.23
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/assets/svg/chevronRightCircle-200.d.ts +6 -0
- package/lib/assets/svg/chevronRightCircle-300.d.ts +6 -0
- package/lib/assets/svg/sortAi.d.ts +6 -0
- package/lib/components/DropDown/DropDown.stories.d.ts +1 -0
- package/lib/constants.d.ts +3 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.esm.css +1 -1
- package/lib/index.esm.js +366 -336
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +366 -336
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
- package/src/assets/svg/chevronRightCircle-200.tsx +13 -0
- package/src/assets/svg/chevronRightCircle-300.tsx +13 -0
- package/src/assets/svg/sortAi.tsx +17 -0
- package/src/components/DropDown/DropDown.stories.tsx +18 -0
- package/src/components/DropDown/DropDown.tsx +3 -2
- package/src/components/Icon/getIconFromConstant.tsx +9 -0
- package/src/components/MultiActionButton/MultiActionButton.module.scss +5 -1
- package/src/components/MultiActionButton/MultiActionButton.stories.tsx +4 -2
- package/src/components/MultiActionButton/MultiActionButton.tsx +17 -9
- package/src/constants.ts +3 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "widenarrow-ui",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "A storybook 6 typeScript component library used for
|
|
3
|
+
"version": "1.1.23",
|
|
4
|
+
"description": "A storybook 6 typeScript component library used for InfoDesk",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.esm.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const Icon: FC<Props> = ({ className }) => (
|
|
8
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" className={className}>
|
|
9
|
+
<path d="M535.46-480 425.85-370.38q-5.62 5.42-5.62 13.55 0 8.14 5.62 13.98 5.84 6.62 14.27 6.23 8.42-.38 14.26-6.23l114.54-114.53q9.7-9.7 9.7-22.62 0-12.92-9.7-22.62L454.15-617.38q-5.84-5.85-14.15-6.12-8.31-.27-14.15 6.35-5.62 5.84-5.35 14.15.27 8.31 6.12 14.15L535.46-480Zm-55.33 360q-74.67 0-140.41-28.34-65.73-28.34-114.36-76.92-48.63-48.58-76.99-114.26Q120-405.19 120-479.87q0-74.67 28.34-140.41 28.34-65.73 76.92-114.36 48.58-48.63 114.26-76.99Q405.19-840 479.87-840q74.67 0 140.41 28.34 65.73 28.34 114.36 76.92 48.63 48.58 76.99 114.26Q840-554.81 840-480.13q0 74.67-28.34 140.41-28.34 65.73-76.92 114.36-48.58 48.63-114.26 76.99Q554.81-120 480.13-120Zm-.13-40q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z" />
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default Icon;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const Icon: FC<Props> = ({ className }) => (
|
|
8
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" className={className}>
|
|
9
|
+
<path d="M521.23-480 418.92-377.69q-8.3 8.21-8.3 20.53 0 12.31 8.3 21.24 8.93 9.3 21.39 9.11 12.46-.19 21.38-9.11l118.77-118.77q10.85-10.85 10.85-25.31 0-14.46-10.85-25.31L461.08-624.69q-8.93-8.92-21.08-8.81-12.15.12-21.08 9.42-8.3 8.93-8.42 21.08-.11 12.15 8.81 21.08L521.23-480Zm-41.16 380q-78.84 0-148.21-29.92t-120.68-81.21q-51.31-51.29-81.25-120.63Q100-401.1 100-479.93q0-78.84 29.92-148.21t81.21-120.68q51.29-51.31 120.63-81.25Q401.1-860 479.93-860q78.84 0 148.21 29.92t120.68 81.21q51.31 51.29 81.25 120.63Q860-558.9 860-480.07q0 78.84-29.92 148.21t-81.21 120.68q-51.29 51.31-120.63 81.25Q558.9-100 480.07-100Zm-.07-60q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z" />
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default Icon;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const Icon: FC<Props> = ({ className }) => (
|
|
8
|
+
<svg width="24" height="24" viewBox="0 0 24 24" className={className} xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
<path d="M3.71575 17.2843C3.85942 17.4281 4.0375 17.5 4.25 17.5H8.125C8.3375 17.5 8.51558 17.4282 8.65925 17.2845C8.80308 17.141 8.875 16.9629 8.875 16.7503C8.875 16.5378 8.80308 16.3596 8.65925 16.2158C8.51558 16.0719 8.3375 16 8.125 16H4.25C4.0375 16 3.85942 16.0718 3.71575 16.2155C3.57192 16.359 3.5 16.5371 3.5 16.7498C3.5 16.9622 3.57192 17.1404 3.71575 17.2843Z" />
|
|
10
|
+
<path d="M3.71575 12.5342C3.85942 12.6781 4.0375 12.75 4.25 12.75H13.9327C14.1452 12.75 14.3233 12.6782 14.467 12.5345C14.6108 12.391 14.6827 12.2129 14.6827 12.0003C14.6827 11.7878 14.6108 11.6096 14.467 11.4658C14.3233 11.3219 14.1452 11.25 13.9327 11.25H4.25C4.0375 11.25 3.85942 11.3218 3.71575 11.4655C3.57192 11.609 3.5 11.7871 3.5 11.9997C3.5 12.2122 3.57192 12.3904 3.71575 12.5342Z" />
|
|
11
|
+
<path d="M3.71575 7.78425C3.85942 7.92808 4.0375 8 4.25 8H19.75C19.9625 8 20.1406 7.92817 20.2843 7.7845C20.4281 7.641 20.5 7.46292 20.5 7.25025C20.5 7.03775 20.4281 6.85958 20.2843 6.71575C20.1406 6.57192 19.9625 6.5 19.75 6.5H4.25C4.0375 6.5 3.85942 6.57183 3.71575 6.7155C3.57192 6.859 3.5 7.03708 3.5 7.24975C3.5 7.46225 3.57192 7.64042 3.71575 7.78425Z" />
|
|
12
|
+
<path d="M18.6976 13.5926L19.9282 14.4641L19.7888 12.9626L20.6603 11.732L19.1588 11.8714L17.9282 11L18.0676 12.5014L17.1962 13.732L18.6976 13.5926Z" />
|
|
13
|
+
<path d="M18.6962 16.3301L16.4421 16.5461L14.5981 15.232L14.814 17.4861L13.5 19.3301L15.754 19.1142L17.5981 20.4282L17.3821 18.1742L18.6962 16.3301Z" />
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export default Icon;
|
|
@@ -9,6 +9,7 @@ import { MultiActionButton } from 'src/components/MultiActionButton';
|
|
|
9
9
|
import { DropDownItem } from 'src/components/DropDownItem';
|
|
10
10
|
|
|
11
11
|
import { ColorTypes, IconTypes } from 'src/constants';
|
|
12
|
+
import { InlineButton } from '../InlineButton';
|
|
12
13
|
|
|
13
14
|
const meta: Meta<typeof DropDown> = {
|
|
14
15
|
title: 'Components/DropDown',
|
|
@@ -45,6 +46,23 @@ export const WithActiveSelect: Story = {
|
|
|
45
46
|
)
|
|
46
47
|
};
|
|
47
48
|
|
|
49
|
+
export const AsInlineButton: Story = {
|
|
50
|
+
args: {},
|
|
51
|
+
render: ({ ...props }) => (
|
|
52
|
+
<div style={{ width: '80px', height: '200px', padding: '24px' }}>
|
|
53
|
+
<DropDown
|
|
54
|
+
{...props}
|
|
55
|
+
buttonComponent={<InlineButton text={'Show more'} icon={IconTypes.CHEVRON_DOWN} withIconRight />}
|
|
56
|
+
title={'Select'}
|
|
57
|
+
>
|
|
58
|
+
<DropDownItem active text={'Recently visited'} onClickCallback={() => undefined} />
|
|
59
|
+
<DropDownItem active={false} text={'Newest'} onClickCallback={() => undefined} />
|
|
60
|
+
<DropDownItem active={false} text={'Oldest'} onClickCallback={() => undefined} closeDropDownOnClick={false} />
|
|
61
|
+
</DropDown>
|
|
62
|
+
</div>
|
|
63
|
+
)
|
|
64
|
+
};
|
|
65
|
+
|
|
48
66
|
export const Complex: Story = {
|
|
49
67
|
args: {},
|
|
50
68
|
render: ({ ...props }) => (
|
|
@@ -8,6 +8,7 @@ import { ColorTypes, HierarchyTypes } from 'src/constants';
|
|
|
8
8
|
|
|
9
9
|
import { Heading } from 'src/components/Typography/Typography';
|
|
10
10
|
import { SolidSpinner } from 'src/components/SolidSpinner/SolidSpinner';
|
|
11
|
+
import { Box } from 'src/components/Box';
|
|
11
12
|
|
|
12
13
|
import useHandleClickOutside from './useHandleClickOutside';
|
|
13
14
|
|
|
@@ -187,11 +188,11 @@ const DropDown: FC<DropDownProps> = ({
|
|
|
187
188
|
return (
|
|
188
189
|
<div ref={containerRef}>
|
|
189
190
|
{/* ButtonComponent */}
|
|
190
|
-
<
|
|
191
|
+
<Box displayFlex alignItems={'center'} ref={setReferenceElement}>
|
|
191
192
|
{isValidElement(buttonComponent)
|
|
192
193
|
? cloneElement(buttonComponent, { [buttonCallbackName]: (e: MouseEvent) => onClickButton(e) })
|
|
193
194
|
: null}
|
|
194
|
-
</
|
|
195
|
+
</Box>
|
|
195
196
|
{/* DropDown */}
|
|
196
197
|
{isOpen && (
|
|
197
198
|
<div
|
|
@@ -34,6 +34,8 @@ import CheckIcon from 'src/assets/svg/check';
|
|
|
34
34
|
import CheckIndeterminateIcon from 'src/assets/svg/checkIndeterminate';
|
|
35
35
|
import ChevronIcon from 'src/assets/svg/chevron';
|
|
36
36
|
import ChevronLeftIcon from 'src/assets/svg/chevronLeft';
|
|
37
|
+
import ChevronRightCircleIcon200 from 'src/assets/svg/chevronRightCircle-200';
|
|
38
|
+
import ChevronRightCircleIcon300 from 'src/assets/svg/chevronRightCircle-300';
|
|
37
39
|
import ChevronRightIcon from 'src/assets/svg/chevronRight';
|
|
38
40
|
import ChevronUpIcon from 'src/assets/svg/chevronUp';
|
|
39
41
|
import ClassificationAddIcon200 from 'src/assets/svg/classificationAdd-200';
|
|
@@ -167,6 +169,7 @@ import SettingsIcon200 from 'src/assets/svg/settings-200';
|
|
|
167
169
|
import SettingsIcon300 from 'src/assets/svg/settings-300';
|
|
168
170
|
import ShareIcon from 'src/assets/svg/share';
|
|
169
171
|
import SortIcon from 'src/assets/svg/sort';
|
|
172
|
+
import SortAiIcon from 'src/assets/svg/sortAi';
|
|
170
173
|
import SparkleFilledIcon from 'src/assets/svg/sparkleFilled';
|
|
171
174
|
import SparkleGradientFilledIcon from 'src/assets/svg/sparkleGradientFilled';
|
|
172
175
|
import SparkleIcon from 'src/assets/svg/sparkle';
|
|
@@ -216,6 +219,10 @@ const getIconFromConstant = (icon: Partial<IconTypes>, getIconClassName: (additi
|
|
|
216
219
|
return <AddSectionBelowIcon className={getIconClassName('icon_rotate_270')} />;
|
|
217
220
|
case IconTypes.RESET:
|
|
218
221
|
return <ResetIcon className={getIconClassName('icon_flip')} />;
|
|
222
|
+
case IconTypes.CHEVRON_LEFT_CIRCLE_200:
|
|
223
|
+
return <ChevronRightCircleIcon200 className={getIconClassName('icon_flip')} />;
|
|
224
|
+
case IconTypes.CHEVRON_LEFT_CIRCLE_300:
|
|
225
|
+
return <ChevronRightCircleIcon300 className={getIconClassName('icon_flip')} />;
|
|
219
226
|
case IconTypes.NAVIGATE_LEFT_LARGE:
|
|
220
227
|
return <NavigateRightLargeIcon className={getIconClassName('icon_flip')} />;
|
|
221
228
|
case IconTypes.EXPAND_ARROWS:
|
|
@@ -551,6 +558,8 @@ const getIconFromConstant = (icon: Partial<IconTypes>, getIconClassName: (additi
|
|
|
551
558
|
return <ShareIcon className={getIconClassName()} />;
|
|
552
559
|
case IconTypes.SORT:
|
|
553
560
|
return <SortIcon className={getIconClassName()} />;
|
|
561
|
+
case IconTypes.SORT_AI:
|
|
562
|
+
return <SortAiIcon className={getIconClassName()} />;
|
|
554
563
|
case IconTypes.SPARKLE:
|
|
555
564
|
return <SparkleIcon className={getIconClassName()} />;
|
|
556
565
|
case IconTypes.SPARKLE_GRADIENT:
|
|
@@ -119,12 +119,16 @@ $button-l-min-width: 100px;
|
|
|
119
119
|
&_disabled {
|
|
120
120
|
@include buttonColors($grey-3, $grey-3, $white);
|
|
121
121
|
svg {
|
|
122
|
-
fill: $
|
|
122
|
+
fill: $white !important;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
.button_noButtonRight {
|
|
129
|
+
padding-right: 12px !important;
|
|
130
|
+
}
|
|
131
|
+
|
|
128
132
|
&_disabled {
|
|
129
133
|
pointer-events: none;
|
|
130
134
|
border-color: $grey-2;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
|
|
3
3
|
import { MultiActionButton } from 'src/components/MultiActionButton';
|
|
4
|
-
import { HierarchyTypes, IconTypes } from 'src/constants';
|
|
4
|
+
import { HierarchyTypes, IconTypes, SizeTypes } from 'src/constants';
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof MultiActionButton> = {
|
|
7
7
|
title: 'Components/MultiActionButton',
|
|
@@ -14,7 +14,9 @@ type Story = StoryObj<typeof MultiActionButton>;
|
|
|
14
14
|
|
|
15
15
|
export const Default: Story = {
|
|
16
16
|
args: {
|
|
17
|
-
text: '
|
|
17
|
+
text: 'Saved searches',
|
|
18
|
+
type: HierarchyTypes.PRIMARY,
|
|
19
|
+
size: SizeTypes.MEDIUM,
|
|
18
20
|
rightIcon: IconTypes.CHEVRON_DOWN
|
|
19
21
|
}
|
|
20
22
|
};
|
|
@@ -66,7 +66,13 @@ const MultiActionButton: FC<MultiActionButtonProps> = ({
|
|
|
66
66
|
>
|
|
67
67
|
<button
|
|
68
68
|
id={id ? `${id}` : ''}
|
|
69
|
-
className={s({
|
|
69
|
+
className={s({
|
|
70
|
+
button: true,
|
|
71
|
+
button_left: true,
|
|
72
|
+
button_disabled: loading || disabled,
|
|
73
|
+
button_noButtonRight: !rightIcon,
|
|
74
|
+
button_withEllipsis: withEllipsis
|
|
75
|
+
})}
|
|
70
76
|
disabled={loading || disabled}
|
|
71
77
|
onClick={!loading ? onLeftClickCallback : undefined}
|
|
72
78
|
autoFocus={autoFocus}
|
|
@@ -97,14 +103,16 @@ const MultiActionButton: FC<MultiActionButtonProps> = ({
|
|
|
97
103
|
/>
|
|
98
104
|
) : null}
|
|
99
105
|
</button>
|
|
100
|
-
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
{rightIcon ? (
|
|
107
|
+
<button className={s({ button: true, button_right: true, button_disabled: loading || disabled })} onClick={onRightClickCallback}>
|
|
108
|
+
<Icon
|
|
109
|
+
icon={rightIcon}
|
|
110
|
+
size={iconSize || size === SizeTypes.SMALL ? SizeTypes.SMALL : SizeTypes.MEDIUM}
|
|
111
|
+
className={iconClassName}
|
|
112
|
+
rotateIconByDegree={rotateRightIconByDegree}
|
|
113
|
+
/>
|
|
114
|
+
</button>
|
|
115
|
+
) : null}
|
|
108
116
|
</div>
|
|
109
117
|
</div>
|
|
110
118
|
);
|
package/src/constants.ts
CHANGED
|
@@ -35,6 +35,8 @@ export enum IconTypes {
|
|
|
35
35
|
CHEVRON_LEFT = 'iconChevronLeft',
|
|
36
36
|
CHEVRON_RIGHT = 'iconChevronRight',
|
|
37
37
|
CHEVRON_UP = 'iconChevronUp',
|
|
38
|
+
CHEVRON_LEFT_CIRCLE_200 = 'iconChevronLeftCircle200',
|
|
39
|
+
CHEVRON_LEFT_CIRCLE_300 = 'iconChevronLeftCircle300',
|
|
38
40
|
CLASSIFICATION = 'iconClassification',
|
|
39
41
|
CLASSIFICATION_ADD_200 = 'iconClassificationAdd200',
|
|
40
42
|
CLASSIFICATION_ADD_300 = 'iconClassificationAdd300',
|
|
@@ -164,6 +166,7 @@ export enum IconTypes {
|
|
|
164
166
|
SETTINGS_300 = 'iconSettings300',
|
|
165
167
|
SHARE = 'iconShare',
|
|
166
168
|
SORT = 'iconSort',
|
|
169
|
+
SORT_AI = 'iconSortAi',
|
|
167
170
|
SSO = 'iconSSO',
|
|
168
171
|
SSO_CONFIG = 'iconSSOConfig',
|
|
169
172
|
SPARKLE = 'iconSparkle',
|