@agility/plenum-ui 2.1.20-rc4 → 2.1.20-rc6
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/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/tailwind.css +34 -5
- package/package.json +2 -1
- package/stories/atoms/icons/DynamicIcon.tsx +27 -27
- package/stories/organisms/DropdownWithMultiSelect/DropdownItems.ts +200 -0
- package/stories/organisms/DropdownWithMultiSelect/DropdownWithMultiSelect.tsx +6 -2
- package/tsconfig.json +3 -2
package/dist/tailwind.css
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/*
|
|
110
|
-
! tailwindcss v3.4.
|
|
110
|
+
! tailwindcss v3.4.16 | MIT License | https://tailwindcss.com
|
|
111
111
|
*/
|
|
112
112
|
|
|
113
113
|
/*
|
|
@@ -600,6 +600,11 @@ input::placeholder,textarea::placeholder {
|
|
|
600
600
|
|
|
601
601
|
::-webkit-date-and-time-value {
|
|
602
602
|
min-height: 1.5em;
|
|
603
|
+
text-align: inherit;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
::-webkit-datetime-edit {
|
|
607
|
+
display: inline-flex;
|
|
603
608
|
}
|
|
604
609
|
|
|
605
610
|
::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field {
|
|
@@ -682,10 +687,26 @@ select {
|
|
|
682
687
|
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
|
|
683
688
|
}
|
|
684
689
|
|
|
690
|
+
@media (forced-colors: active) {
|
|
691
|
+
[type='checkbox']:checked {
|
|
692
|
+
-webkit-appearance: auto;
|
|
693
|
+
-moz-appearance: auto;
|
|
694
|
+
appearance: auto;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
685
698
|
[type='radio']:checked {
|
|
686
699
|
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
|
|
687
700
|
}
|
|
688
701
|
|
|
702
|
+
@media (forced-colors: active) {
|
|
703
|
+
[type='radio']:checked {
|
|
704
|
+
-webkit-appearance: auto;
|
|
705
|
+
-moz-appearance: auto;
|
|
706
|
+
appearance: auto;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
689
710
|
[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {
|
|
690
711
|
border-color: transparent;
|
|
691
712
|
background-color: currentColor;
|
|
@@ -700,6 +721,14 @@ select {
|
|
|
700
721
|
background-repeat: no-repeat;
|
|
701
722
|
}
|
|
702
723
|
|
|
724
|
+
@media (forced-colors: active) {
|
|
725
|
+
[type='checkbox']:indeterminate {
|
|
726
|
+
-webkit-appearance: auto;
|
|
727
|
+
-moz-appearance: auto;
|
|
728
|
+
appearance: auto;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
703
732
|
[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus {
|
|
704
733
|
border-color: transparent;
|
|
705
734
|
background-color: currentColor;
|
|
@@ -1911,12 +1940,12 @@ select {
|
|
|
1911
1940
|
height: 100%;
|
|
1912
1941
|
}
|
|
1913
1942
|
|
|
1914
|
-
|
|
1915
|
-
max-height:
|
|
1943
|
+
.\!max-h-\[240px\] {
|
|
1944
|
+
max-height: 240px !important;
|
|
1916
1945
|
}
|
|
1917
1946
|
|
|
1918
|
-
.max-h
|
|
1919
|
-
max-height:
|
|
1947
|
+
.max-h-60 {
|
|
1948
|
+
max-height: 15rem;
|
|
1920
1949
|
}
|
|
1921
1950
|
|
|
1922
1951
|
.\!min-h-0 {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agility/plenum-ui",
|
|
3
|
-
"version": "2.1.20-
|
|
3
|
+
"version": "2.1.20-rc6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"@testing-library/react": "^16.0.1",
|
|
64
64
|
"@types/jest": "^29.5.14",
|
|
65
65
|
"@types/node": "^22.10.2",
|
|
66
|
+
"@types/react": "^18.2.0",
|
|
66
67
|
"autoprefixer": "^10.4.13",
|
|
67
68
|
"esbuild": "^0.18.19",
|
|
68
69
|
"eslint": "8.32.0",
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import React from "react"
|
|
1
|
+
import React from "react";
|
|
2
2
|
// TODO: Fix heroicons support
|
|
3
|
-
import * as SolidIcons from "@heroicons/react/solid"
|
|
4
|
-
import * as OutlineIcons from "@heroicons/react/outline"
|
|
5
|
-
import * as FA from "react-icons/fa"
|
|
6
|
-
import { tablerIconNames, TablerIconName } from "./tablerIconNames"
|
|
7
|
-
import { default as cn } from "classnames"
|
|
3
|
+
import * as SolidIcons from "@heroicons/react/solid";
|
|
4
|
+
import * as OutlineIcons from "@heroicons/react/outline";
|
|
5
|
+
import * as FA from "react-icons/fa";
|
|
6
|
+
import { tablerIconNames, TablerIconName } from "./tablerIconNames";
|
|
7
|
+
import { default as cn } from "classnames";
|
|
8
8
|
|
|
9
|
-
import { ClassNameWithAutocomplete } from "@/utils/types"
|
|
10
|
-
import TablerIcon from "./TablerIcon"
|
|
9
|
+
import { ClassNameWithAutocomplete } from "@/utils/types";
|
|
10
|
+
import TablerIcon from "./TablerIcon";
|
|
11
11
|
|
|
12
|
-
export type IconName = keyof typeof SolidIcons | keyof typeof OutlineIcons
|
|
13
|
-
export type FAIconName = keyof typeof FA
|
|
12
|
+
export type IconName = keyof typeof SolidIcons | keyof typeof OutlineIcons;
|
|
13
|
+
export type FAIconName = keyof typeof FA;
|
|
14
14
|
|
|
15
|
-
export type UnifiedIconName = TablerIconName | IconName | FAIconName
|
|
15
|
+
export type UnifiedIconName = TablerIconName | IconName | FAIconName;
|
|
16
16
|
|
|
17
17
|
export function isHeroIcon(name: UnifiedIconName): name is keyof typeof SolidIcons | keyof typeof OutlineIcons {
|
|
18
|
-
return name in SolidIcons || name in OutlineIcons
|
|
18
|
+
return name in SolidIcons || name in OutlineIcons;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function isTablerIcon(name: UnifiedIconName): name is TablerIconName {
|
|
22
|
-
return tablerIconNames.includes(name as TablerIconName)
|
|
22
|
+
return tablerIconNames.includes(name as TablerIconName);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export function isFAIcon(name: UnifiedIconName): name is keyof typeof FA {
|
|
26
|
-
return name in FA
|
|
26
|
+
return name in FA;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export function isUnifiedIconName(name: UnifiedIconName): name is UnifiedIconName {
|
|
30
|
-
return isTablerIcon(name) // || isHeroIcon(name) || isFAIcon(name)
|
|
30
|
+
return isTablerIcon(name); // || isHeroIcon(name) || isFAIcon(name)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export interface IDynamicIconProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
34
|
-
icon: UnifiedIconName
|
|
35
|
-
className?: ClassNameWithAutocomplete
|
|
36
|
-
outline?: boolean
|
|
37
|
-
CustomSVG?: React.ReactNode
|
|
34
|
+
icon: UnifiedIconName;
|
|
35
|
+
className?: ClassNameWithAutocomplete;
|
|
36
|
+
outline?: boolean;
|
|
37
|
+
CustomSVG?: React.ReactNode;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export const DynamicIcon = ({
|
|
@@ -45,7 +45,7 @@ export const DynamicIcon = ({
|
|
|
45
45
|
...props
|
|
46
46
|
}: IDynamicIconProps): JSX.Element => {
|
|
47
47
|
if (CustomSVG) {
|
|
48
|
-
return <i {...{ ...props, className: "flex items-center justify-center" }}>{CustomSVG}</i
|
|
48
|
+
return <i {...{ ...props, className: "flex items-center justify-center" }}>{CustomSVG}</i>;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (isTablerIcon(icon)) {
|
|
@@ -59,11 +59,11 @@ export const DynamicIcon = ({
|
|
|
59
59
|
outline
|
|
60
60
|
}}
|
|
61
61
|
/>
|
|
62
|
-
)
|
|
62
|
+
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (isFAIcon(icon)) {
|
|
66
|
-
const Icon = FA[icon]
|
|
66
|
+
const Icon = FA[icon];
|
|
67
67
|
return (
|
|
68
68
|
<i {...{ ...props, className: "flex items-center justify-center" }}>
|
|
69
69
|
<Icon
|
|
@@ -72,10 +72,10 @@ export const DynamicIcon = ({
|
|
|
72
72
|
})}
|
|
73
73
|
/>
|
|
74
74
|
</i>
|
|
75
|
-
)
|
|
75
|
+
);
|
|
76
76
|
}
|
|
77
77
|
if (isHeroIcon(icon)) {
|
|
78
|
-
const Icon = outline ? OutlineIcons[icon] : SolidIcons[icon]
|
|
78
|
+
const Icon = outline ? OutlineIcons[icon] : SolidIcons[icon];
|
|
79
79
|
return (
|
|
80
80
|
<i {...{ ...props, className: "flex items-center justify-center" }}>
|
|
81
81
|
<Icon
|
|
@@ -84,7 +84,7 @@ export const DynamicIcon = ({
|
|
|
84
84
|
})}
|
|
85
85
|
/>
|
|
86
86
|
</i>
|
|
87
|
-
)
|
|
87
|
+
);
|
|
88
88
|
}
|
|
89
|
-
return
|
|
90
|
-
}
|
|
89
|
+
return <></>;
|
|
90
|
+
};
|
|
@@ -41,6 +41,206 @@ export const dropdownDataBase: MultiSelectItemProps[] = [
|
|
|
41
41
|
key: "Delete",
|
|
42
42
|
isSelected: true
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
key: "Add to Batch",
|
|
46
|
+
label: "Add to Batch",
|
|
47
|
+
onClick: () => {
|
|
48
|
+
console.log("Add to Batch action");
|
|
49
|
+
},
|
|
50
|
+
isSelected: false
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "Delete",
|
|
54
|
+
onClick: () => {
|
|
55
|
+
console.log("Delete action");
|
|
56
|
+
},
|
|
57
|
+
key: "Delete",
|
|
58
|
+
isSelected: true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "Add to Batch",
|
|
62
|
+
label: "Add to Batch",
|
|
63
|
+
onClick: () => {
|
|
64
|
+
console.log("Add to Batch action");
|
|
65
|
+
},
|
|
66
|
+
isSelected: false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: "Copy",
|
|
70
|
+
label: "Copy to Clipboard",
|
|
71
|
+
onClick: () => {
|
|
72
|
+
console.log("Copy action");
|
|
73
|
+
},
|
|
74
|
+
isSelected: false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "Delete",
|
|
78
|
+
onClick: () => {
|
|
79
|
+
console.log("Delete action");
|
|
80
|
+
},
|
|
81
|
+
key: "Delete",
|
|
82
|
+
isSelected: true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: "Add to Batch",
|
|
86
|
+
label: "Add to Batch",
|
|
87
|
+
onClick: () => {
|
|
88
|
+
console.log("Add to Batch action");
|
|
89
|
+
},
|
|
90
|
+
isSelected: false
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
label: "Delete",
|
|
94
|
+
onClick: () => {
|
|
95
|
+
console.log("Delete action");
|
|
96
|
+
},
|
|
97
|
+
key: "Delete",
|
|
98
|
+
isSelected: true
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: "Add to Batch",
|
|
102
|
+
label: "Add to Batch",
|
|
103
|
+
onClick: () => {
|
|
104
|
+
console.log("Add to Batch action");
|
|
105
|
+
},
|
|
106
|
+
isSelected: false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: "Copy",
|
|
110
|
+
label: "Copy to Clipboard",
|
|
111
|
+
onClick: () => {
|
|
112
|
+
console.log("Copy action");
|
|
113
|
+
},
|
|
114
|
+
isSelected: false
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: "Delete",
|
|
118
|
+
onClick: () => {
|
|
119
|
+
console.log("Delete action");
|
|
120
|
+
},
|
|
121
|
+
key: "Delete",
|
|
122
|
+
isSelected: true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: "Add to Batch",
|
|
126
|
+
label: "Add to Batch",
|
|
127
|
+
onClick: () => {
|
|
128
|
+
console.log("Add to Batch action");
|
|
129
|
+
},
|
|
130
|
+
isSelected: false
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: "Delete",
|
|
134
|
+
onClick: () => {
|
|
135
|
+
console.log("Delete action");
|
|
136
|
+
},
|
|
137
|
+
key: "Delete",
|
|
138
|
+
isSelected: true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: "Add to Batch",
|
|
142
|
+
label: "Add to Batch",
|
|
143
|
+
onClick: () => {
|
|
144
|
+
console.log("Add to Batch action");
|
|
145
|
+
},
|
|
146
|
+
isSelected: false
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: "Copy",
|
|
150
|
+
label: "Copy to Clipboard",
|
|
151
|
+
onClick: () => {
|
|
152
|
+
console.log("Copy action");
|
|
153
|
+
},
|
|
154
|
+
isSelected: false
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: "Delete",
|
|
158
|
+
onClick: () => {
|
|
159
|
+
console.log("Delete action");
|
|
160
|
+
},
|
|
161
|
+
key: "Delete",
|
|
162
|
+
isSelected: true
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
key: "Add to Batch",
|
|
166
|
+
label: "Add to Batch",
|
|
167
|
+
onClick: () => {
|
|
168
|
+
console.log("Add to Batch action");
|
|
169
|
+
},
|
|
170
|
+
isSelected: false
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
label: "Delete",
|
|
174
|
+
onClick: () => {
|
|
175
|
+
console.log("Delete action");
|
|
176
|
+
},
|
|
177
|
+
key: "Delete",
|
|
178
|
+
isSelected: true
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
key: "Add to Batch",
|
|
182
|
+
label: "Add to Batch",
|
|
183
|
+
onClick: () => {
|
|
184
|
+
console.log("Add to Batch action");
|
|
185
|
+
},
|
|
186
|
+
isSelected: false
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
key: "Copy",
|
|
190
|
+
label: "Copy to Clipboard",
|
|
191
|
+
onClick: () => {
|
|
192
|
+
console.log("Copy action");
|
|
193
|
+
},
|
|
194
|
+
isSelected: false
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
label: "Delete",
|
|
198
|
+
onClick: () => {
|
|
199
|
+
console.log("Delete action");
|
|
200
|
+
},
|
|
201
|
+
key: "Delete",
|
|
202
|
+
isSelected: true
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
key: "Add to Batch",
|
|
206
|
+
label: "Add to Batch",
|
|
207
|
+
onClick: () => {
|
|
208
|
+
console.log("Add to Batch action");
|
|
209
|
+
},
|
|
210
|
+
isSelected: false
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
label: "Delete",
|
|
214
|
+
onClick: () => {
|
|
215
|
+
console.log("Delete action");
|
|
216
|
+
},
|
|
217
|
+
key: "Delete",
|
|
218
|
+
isSelected: true
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
key: "Add to Batch",
|
|
222
|
+
label: "Add to Batch",
|
|
223
|
+
onClick: () => {
|
|
224
|
+
console.log("Add to Batch action");
|
|
225
|
+
},
|
|
226
|
+
isSelected: false
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
key: "Copy",
|
|
230
|
+
label: "Copy to Clipboard",
|
|
231
|
+
onClick: () => {
|
|
232
|
+
console.log("Copy action");
|
|
233
|
+
},
|
|
234
|
+
isSelected: false
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "Delete",
|
|
238
|
+
onClick: () => {
|
|
239
|
+
console.log("Delete action");
|
|
240
|
+
},
|
|
241
|
+
key: "Delete",
|
|
242
|
+
isSelected: true
|
|
243
|
+
},
|
|
44
244
|
{
|
|
45
245
|
key: "Add to Batch",
|
|
46
246
|
label: "Add to Batch",
|
|
@@ -29,14 +29,18 @@ const DropdownWithMultiSelect = ({ label, options, type = "checkbox" }: Props) =
|
|
|
29
29
|
</PopoverButton>
|
|
30
30
|
<PopoverPanel
|
|
31
31
|
transition
|
|
32
|
-
|
|
32
|
+
anchor={{
|
|
33
|
+
to: "bottom end",
|
|
34
|
+
gap: 8
|
|
35
|
+
}}
|
|
36
|
+
className="bg-white !max-h-[240px] w-[200px] rounded-[3px] border border-gray-300 shadow-lg z-40"
|
|
33
37
|
>
|
|
34
38
|
{options.map((option) => {
|
|
35
39
|
const inputWrapperStyles = cn("py-[8px] px-3 text-gray-500 hover:bg-[rgba(0,0,0,0.03)]", {
|
|
36
40
|
"text-gray-700": option.isSelected
|
|
37
41
|
});
|
|
38
42
|
return (
|
|
39
|
-
<div className={inputWrapperStyles}>
|
|
43
|
+
<div className={inputWrapperStyles} key={option.key}>
|
|
40
44
|
{type === "checkbox" ? (
|
|
41
45
|
<Checkbox
|
|
42
46
|
key={option.key}
|
package/tsconfig.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"moduleResolution": "node",
|
|
13
13
|
"resolveJsonModule": true,
|
|
14
14
|
"isolatedModules": true,
|
|
15
|
-
"jsx": "
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
16
|
"incremental": true,
|
|
17
17
|
"plugins": [
|
|
18
18
|
{
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"paths": {
|
|
24
24
|
"@/*": ["./*"]
|
|
25
25
|
},
|
|
26
|
-
"types": ["vitest/globals"]
|
|
26
|
+
"types": ["vitest/globals"],
|
|
27
|
+
"typeRoots": ["./node_modules/@types"]
|
|
27
28
|
},
|
|
28
29
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
29
30
|
"exclude": ["node_modules"]
|